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
Process received transactions data
protected function _processSpentTransactionData($data = [], $result = []) { foreach ($data as $trans) { if (isset($result[$trans['time']])) { $result[$trans['time']]['spent'] = abs($trans['credit']); } else { $result[$trans['time']] = [ 'y' => $trans['time'], 'received' => 0, 'spent' => abs($trans['credit']), ]; } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processTransaction($data){\n\n\t\t$bmtProducts = array( // todo add more products \n\t\t\t91390007 => '50',\n\t\t\t91390006 => '10',\n\t\t\t91390005 => '25',\n\t\t\t91390009 => '100',\n\t\t\t91390008 => '75',\n\t\t\t\n\t\t);\n\t \n\t $sessionId = $data['ccom'];\n\t $pid = $data['productid'];\n\t \n\t $value = $bmtProducts[$pid];\n\t \n\t \t$file = 'people.log';\n\t\t$person = \"\".json_encode($data).\"\\n\";\n\n\t\tfile_put_contents($file, $person, FILE_APPEND | LOCK_EX);\n\t\t\n\t\t/** get member info by session ID **/\n\t\t$rows = getMemberInfoBySessionId($sessionId);\n\t\taddPoints($data, $rows, $value);\n\n\t\t\n\t}", "public function transaction_process()\n {\n $this->_post_vars = array_merge($_GET, $_POST);\n\n if (!isset($this->_post_vars['cart_order_id'])) {\n //process as an INS signal\n return $this->_processINS();\n }\n //Need to add <base ...> tag so it displays correctly\n geoView::getInstance()->addBaseTag = true;\n\n //VARIABLES PASSED-BACK\n //order_number - 2Checkout order number\n //card_holder_name\n //street_address\n //city\n //state\n //zip\n //country\n //email\n //phone\n //cart_order_id\n //credit_card_processed\n //total\n //ship_name\n //ship_street_address\n //ship_city\n //ship_state\n //ship_country\n //ship_zip\n trigger_error('DEBUG TRANSACTION: Top of transaction_process.');\n\n if (!$this->get('testing_mode')) {\n //check the hash\n $hash = $this->_genHash(false);\n if (!$hash || ($this->_post_vars['key'] !== $hash)) {\n //NOTE: if testing mode turned on, it will skip the normal demo mode checks.\n trigger_error('DEBUG TRANSACTION: Payment failure, secret word/MD5 hash checks failed.');\n self::_failure($transaction, 2, \"No response from server, check vendor settings\");\n return;\n }\n //gets this far, the md5 hash check passed, so safe to proceed.\n }\n\n //true if $_SERVER['HTTP_REFERER'] is blank or contains a value from $referer_array\n trigger_error('DEBUG TRANSACTION: MD5 hash check was successful.');\n\n trigger_error('DEBUG TRANSACTION: 2checkout vars: ' . print_r($this->_post_vars, 1));\n //get objects\n $transaction = geoTransaction::getTransaction($this->_post_vars['cart_order_id']);\n if (!$transaction || $transaction->getID() == 0) {\n //failed to reacquire the transaction, or transaction does not exist\n trigger_error('DEBUG TRANSACTION: Could not find transaction using: ' . $this->_post_vars['cart_order_id']);\n self::_failure($transaction, 2, \"No response from server\");\n return;\n }\n $invoice = $transaction->getInvoice();\n $order = $invoice->getOrder();\n\n //store transaction data\n $transaction->set('twocheckout_response', $this->_post_vars);\n //transaction will be saved when order is saved.\n\n if (($this->_post_vars[\"order_number\"]) && ($this->_post_vars[\"cart_order_id\"])) {\n //if ($this->_post_vars[\"credit_card_processed\"] == \"Y\")\n if (strcmp($this->_post_vars[\"credit_card_processed\"], \"Y\") == 0) {\n //CC processed ok, now do stuff on our end\n //Might want to add further checks, like to check MD5 hash (if possible),\n //or check that the total is correct.\n trigger_error('DEBUG TRANSACTION: Payment success!');\n //let the objects do their thing to make this active\n self::_success($order, $transaction, $this);\n } else {\n //error in transaction, possibly declined\n trigger_error('DEBUG TRANSACTION: Payment failure, credit card not processed.');\n self::_failure($transaction, $this->_post_vars[\"credit_card_processed\"], \"2Checkout: Card not approved\");\n }\n } else {\n trigger_error('DEBUG TRANSACTION: Payment failure, no order number or cart order ID.');\n self::_failure($transaction, 2, \"No response from server\");\n }\n }", "public function processData() {}", "public function doProcessData() {}", "function en_send_transdata() {\n\t// Handle sending of data\n}", "public function transaction_process()\n {\n //treat as a robot, to avoid redirection or cookie issues.\n //shouldn't need to do this anymore\n //define('IS_ROBOT',true);\n\n //transId\n //transStatus\n // Y - successful\n // C - cancelled\n //transTime\n //authAmount\n //authCurrency\n //authAmountString\n //rawAuthMessage\n //rawAuthCode\n //callbackPW\n //cardType\n //countryString\n //countryMatch\n // Y - match\n // N - no match\n // B - comparison not available\n // I - contact country not supplied\n // S - card issue country not available\n //AVS\n // 1234\n // 1 - card verification\n // 2 - postcode AVS check\n // 3 - address AVS check\n // 4 - country comparison check\n // values\n // 0 - not supported\n // 1 - not checked\n // 2 - matched\n // 4 - not matched\n // 8 - partially matched\n //cartId\n //M_sessionId\n //M_customerId\n //name\n //address\n //postcode\n //country\n //tel\n //fax\n //email\n //amount\n //currency\n //description\n\n trigger_error('DEBUG TRANSACTION: start worldpay transaction process');\n\n $response = $_POST;\n\n //Check to make sure this is valid\n if (!($response[\"cartId\"]) && ($response[\"M_customerId\"])) {\n //Not stuff returned\n return;\n }\n\n if (strlen(trim($this->get(\"callback_password\"))) > 0) {\n if ($this->get(\"callback_password\") != $response[\"callbackPW\"]) {\n //password does not match\n return false;\n }\n }\n\n //transaction id is saved by \"cartId\"\n $trans_id = intval($response[\"cartId\"]);\n $transaction =& geoTransaction::getTransaction($trans_id);\n trigger_error('DEBUG TRANSACTION: paypal:transaction_process() - right AFTER - transaction: ' . print_r($transaction, 1));\n\n //save response data\n $transaction->set('worldpay_response', $response);\n $transaction->save();\n\n //make sure all of transaction info matches with what was passed back.\n if ($transaction->getUser() != $response[\"M_customerId\"]) {\n //something is wrong, do not proceed\n trigger_error('ERROR TRANSACTION: Invalid user set for transaction: ' . $trans_id);\n return;\n }\n if ($transaction->getGatewayTransaction() != $response[\"M_sessionId\"]) {\n //something is wrong, do not proceed\n trigger_error('ERROR TRANSACTION: Invalid session id set for transaction: ' . $trans_id);\n return;\n }\n if ($transaction->getAmount() != $response[\"authAmount\"] || $transaction->getStatus()) {\n //something is wrong, do not proceed\n trigger_error('ERROR TRANSACTION: Invalid transaction data returned for transaction: ' . $trans_id);\n return;\n }\n\n //worldpay transloads whatever result page is shown onto their own server, and displays it without CSS for \"security.\"\n //it *does* complete this POST, though, so we can go ahead right now and mark the transaction as success/failed in the database\n //but set our normal success/failure functions to not render the page -- instead echo just a redirect to transaction_result.php to return the user fully to the local site\n\n if ($response[\"transStatus\"] == \"C\") {\n //cancelled -- fail\n self::_failure($transaction, $response[\"transStatus\"], \"Worldpay said: \" . $response['rawAuthMessage'], true);\n } elseif ($response[\"transStatus\"] != \"Y\") {\n //fail\n self::_failure($transaction, $response[\"transStatus\"], \"Worldpay said: \" . $response['rawAuthMessage'], true);\n } else {\n //success\n self::_success($transaction->getInvoice()->getOrder(), $transaction, geoPaymentGateway::getPaymentGateway(self::getType()), true);\n }\n\n $db = DataAccess::getInstance();\n $target = str_replace($db->get_site_setting('classifieds_file_name'), 'transaction_result.php?transaction=' . $transaction->getId(), $db->get_site_setting('classifieds_url'));\n echo '<meta http-equiv=\"refresh\" content=\"1; url=' . $target . '\">';\n }", "function processData() ;", "public function shellProcessTransactions() {\n\t\t\t$response = $this->_processTransactions();\n\t\t\treturn $response;\n\t\t}", "protected function processReceivedData() {\n\n parent::processReceivedData();\n }", "function handle_transaction()\n\t{\t\n\t\tif ((file_exists(get_file_base().'/data_custom/ecommerce.log')) && (is_writable_wrap(get_file_base().'/data_custom/ecommerce.log')))\n\t\t{\n\t\t\t$myfile=fopen(get_file_base().'/data_custom/ecommerce.log','at');\n\t\t\tfwrite($myfile,serialize($_POST).chr(10));\n\t\t\tfclose($myfile);\n\t\t}\n\n\t\t// assign posted variables to local variables\n\t\t$purchase_id=post_param('custom','-1');\n\n\t\t$txn_type=post_param('txn_type',NULL);\n\n\t\tif ($txn_type=='cart')\n\t\t{\t\n\t\t\trequire_lang('shopping');\n\t\t\t$item_name=do_lang('CART_ORDER',$purchase_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$item_name=(substr(post_param('txn_type',''),0,6)=='subscr')?'':post_param('item_name','');\n\t\t}\n\n\t\t$payment_status=post_param('payment_status',''); // May be blank for subscription\n\t\t$reason_code=post_param('reason_code','');\n\t\t$pending_reason=post_param('pending_reason','');\n\t\t$memo=post_param('memo','');\n\t\t$mc_gross=post_param('mc_gross',''); // May be blank for subscription\n\t\t$tax=post_param('tax','');\n\t\tif (($tax!='') && (intval($tax)>0) && ($mc_gross!='')) $mc_gross=float_to_raw_string(floatval($mc_gross)-floatval($tax));\n\t\t$mc_currency=post_param('mc_currency',''); // May be blank for subscription\n\t\t$txn_id=post_param('txn_id',''); // May be blank for subscription\n\t\t$parent_txn_id=post_param('parent_txn_id','-1');\n\t\t$receiver_email=post_param('receiver_email',null);\n\t\tif ($receiver_email===null) $receiver_email=post_param('business');\n\n\t\t// post back to PayPal system to validate\n\t\tif (!ecommerce_test_mode())\n\t\t{\n\t\t\trequire_code('files');\n\t\t\t$pure_post=isset($GLOBALS['PURE_POST'])?$GLOBALS['PURE_POST']:$_POST;\n\t\t\t$x=0;\n\t\t\t$res=mixed();\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$res=http_download_file('https://'.(ecommerce_test_mode()?'www.sandbox.paypal.com':'www.paypal.com').'/cgi-bin/webscr',NULL,false,false,'ocPortal',$pure_post+array('cmd'=>'_notify-validate'));\n\t\t\t\t$x++;\n\t\t\t}\n\t\t\twhile ((is_null($res)) && ($x<3));\n\t\t\tif (is_null($res)) my_exit(do_lang('IPN_SOCKET_ERROR'));\n\t\t\tif (!(strcmp($res,'VERIFIED')==0))\n\t\t\t{\n\t\t\t\tif (post_param('txn_type','')=='send_money') exit('Unexpected'); // PayPal has been seen to mess up on send_money transactions, making the IPN unverifiable\n\t\t\t\tmy_exit(do_lang('IPN_UNVERIFIED').' - '.$res.' - '.flatten_slashed_array($pure_post),strpos($res,'<html')!==false);\n\t\t\t}\n\t\t}\n\n\t\t$txn_type=str_replace('-','_',post_param('txn_type'));\n\t\tif ($txn_type=='subscr-modify')\n\t\t{\n\t\t\t$payment_status='SModified';\n\t\t\t$txn_id=post_param('subscr_id').'-m';\n\t\t}\n\t\telseif ($txn_type=='subscr_signup')\n\t\t{\n\t\t\t$payment_status='Completed';\n\t\t\t$mc_gross=post_param('mc_amount3');\n\t\t\tif (post_param_integer('recurring')!=1) my_exit(do_lang('IPN_SUB_RECURRING_WRONG'));\n\t\t\t$txn_id=post_param('subscr_id');\n\t\t}\n\t\telseif ($txn_type=='subscr_eot' || $txn_type=='recurring_payment_suspended_due_to_max_failed_payment')\n\t\t{\n\t\t\t$payment_status='SCancelled';\n\t\t\t$txn_id=post_param('subscr_id').'-c';\n\t\t}\n\t\telseif ($txn_type=='subscr_payment' || $txn_type=='subscr_failed' || $txn_type=='subscr_cancel')\n\t\t{\n\t\t\texit();\n\t\t}\n\n\t\t$primary_paypal_email=get_value('primary_paypal_email');\n\n\t\tif (!is_null($primary_paypal_email))\n\t\t{\n\t\t\tif ($receiver_email!=$primary_paypal_email) my_exit(do_lang('IPN_EMAIL_ERROR'));\n\t\t} else\n\t\t{\n\t\t\tif ($receiver_email!=$this->_get_payment_address()) my_exit(do_lang('IPN_EMAIL_ERROR'));\n\t\t}\n\n\t\tif (addon_installed('shopping'))\n\t\t{\n\t\t\tif (preg_match('#'.str_replace('xxx','.*',preg_quote(do_lang('shopping:CART_ORDER','xxx'),'#')).'#',$item_name)!=0)\n\t\t\t{\n\t\t\t\t$this->store_shipping_address($purchase_id);\n\t\t\t}\n\t\t}\n\n\t\treturn array($purchase_id,$item_name,$payment_status,$reason_code,$pending_reason,$memo,$mc_gross,$mc_currency,$txn_id,$parent_txn_id);\n\t}", "public function DoTransaction(){\t\t\n\t\tif($this->IsLoggedIn('cashier')){\t\t\t\n\t\t\tif(isset($_POST) && !empty($_POST)){\n\t\t\t\t$customer_id = $_POST['txn_data']['txn_customer_id'];\t\t\t\t\t\t\t\n\t\t\t\t$count=1;\n\t\t\t\tforeach($_POST['cart_data'] as $key => $value)\n\t\t\t\t{\n\t\t\t\t\tif($key){\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// end\n\t\t\t\t$business_admin_id = $this->session->userdata['logged_in']['business_outlet_id'];\n\t\t\t\t$result = $this->CashierModel->BillingTransaction($_POST,$this->session->userdata['logged_in']['business_outlet_id'],$this->session->userdata['logged_in']['business_admin_id']);\n\n\t\t\t\tif($result['success'] == 'true'){\n\t\t\t\t\t$transcation_detail = $this->CashierModel->GetBilledServicesByTxnId($result['res_arr']['res_arr']['insert_id']);\n\t\t\t\t\t\n\t\t\t\t\t$cart_data['transaction_id'] = $result['res_arr']['res_arr']['insert_id'];\n\t\t\t\t\t$cart_data['outlet_admin_id'] = $business_admin_id;\t\t\t\t\t\n\t\t\t\t\t$cart_data['transaction_time'] = $transcation_detail['res_arr'][0]['txn_datetime'];\n\t\t\t\t\t$cart_data['cart_data'] = json_encode($_POST['cart_data']);\n\t\t\t\t\t$cart_detail = $this->CashierModel->Insert($cart_data,'mss_transaction_cart');\n\t\t\t\t\tif($cart_detail['success'] == 'true'){\n\t\t\t\t\t\t$this->session->set_userdata('loyalty_point',$transcation_detail['res_arr'][0]['txn_loyalty_points']);\n\t\t\t\t\t\t$this->session->set_userdata('cashback',$transcation_detail['res_arr'][0]['txn_loyalty_cashback']);\n\t\t\t\t\t\t$detail_id = $cart_detail['res_arr']['insert_id'];\n\t\t\t\t\t\t$bill_url = base_url().\"Cashier/generateBill/$customer_id/\".base64_encode($detail_id);\n\t\t\t\t\t\t$bill_url = str_replace(\"https\", \"http\", $bill_url);\n\t\t\t\t\t\t$bill_url = shortUrl($bill_url);\n\t\t\t\t\t}\n\n\t\t\t\t\t//1.Unset the payment session\n\t\t \t\t\tif(isset($this->session->userdata['payment'])){\n\t\t \t\t\t\t$this->session->unset_userdata('payment');\n\t\t\t\t\t }\n\t\t\t\t\t //j\n\t\t\t\t\t //Memebership Package Loyalty Calculation\n if(isset($this->session->userdata['cart'][$customer_id]))\n { \n $data = $this->CashierModel->GetCustomerPackages($customer_id);\n if($data['success'] == 'false')\n {\n // $this->PrettyPrintArray(\"Customer Does not have special membership\");\n }\n else{\n if(!empty($data['res_arr']))\n {\n if(isset($this->session->userdata['cart'][$customer_id]))\n {\n $curr_sess_cart = $this->session->userdata['cart'][$customer_id];\n $cart_data = array();\n $i = 0;\n $j = 0;\n $total_product = 0;\n $total_points = 0;\n for($j;$j<count($curr_sess_cart);$j++)\n {\n $service_details = $this->CashierModel->DetailsById($curr_sess_cart[$j]['service_id'],'mss_services','service_id');\n if(isset($service_details['res_arr']))\n {\n // print_r($service_details['res_arr']);\n if($service_details['res_arr']['service_type'] == 'otc')\n {\n $total_product += $curr_sess_cart[$j]['service_total_value'];\n $total_points+= ($curr_sess_cart[$j]['service_total_value']*$data['res_arr'][$i]['service_discount'])/100;\n $curr_sess_cart[$j] += ['service_discount'=>$data['res_arr'][$i]['service_discount']];\n \n array_push($cart_data,$curr_sess_cart[$j]);\n // array_push($cart_data,$data['res_arr'][$i]['service_discount']);\n }\n }\n }\n \n if(!empty($cart_data))\n {\n foreach($cart_data as $key=>$value)\n {\n }\n }\n $update = array(\n 'total_points' => $total_points,\n 'txn_id' => $result['res_arr']['res_arr']['insert_id'],\n 'customer_id' => $customer_id\n );\n $result_2 = $this->CashierModel->SpecialLoyaltyPoints($update,$this->session->userdata['logged_in']['business_outlet_id'],$this->session->userdata['logged_in']['business_admin_id']);\n // $this->PrettyPrintArray($cart_data);\n // exit;\n }\n }\n \n }\n \n }\n\t\t\t\t\t //end\n \n // 2.Then unset the cart session\n\t\t \t\t\tif(isset($this->session->userdata['cart'][$customer_id])){\n\t\t \t\t\t\t$curr_sess_cart_data = $this->session->userdata['cart'];\n\t\t \t\t\t\tunset($curr_sess_cart_data[''.$customer_id.'']);\n\t\t \t\t\t\t$this->session->set_userdata('cart',$curr_sess_cart_data);\n\t\t \t\t\t}\n if(isset($this->session->userdata['recommended_ser'][$customer_id])){\n\t\t\t\t\t\t$curr_sess_cart_data = $this->session->userdata['recommended_ser'];\n\t\t\t\t\t\tunset($curr_sess_cart_data[''.$customer_id.'']);\n\t\t\t\t\t\t$this->session->set_userdata('recommended_ser',$curr_sess_cart_data);\n\t\t\t\t\t}\n\t\t\t\t\t//3.Then unset the customer session from POS\n\t\t \t\t\tif(isset($this->session->userdata['POS'])){\n\t\t \t\t\t\t$curr_sess_cust_data = $this->session->userdata['POS'];\n\t\t \t\t\t\t\n\t\t \t\t\t\t$key = array_search($customer_id, array_column($curr_sess_cust_data, 'customer_id'));\n\t\t \t\t\t\t\n\t\t \t\t\t\tunset($curr_sess_cust_data[$key]);\n\t\t \t\t\t\t$curr_sess_cust_data = array_values($curr_sess_cust_data);\n\t\t \t\t\t\t\n\t\t \t\t\t\t$this->session->set_userdata('POS',$curr_sess_cust_data);\n\t\t \t\t\t}\n\n\t\t \t\t\t//These 2 call will be used for the further enhancement of message sending architecture.\n\t\t \t\t\t$outlet_details = $this->GetCashierDetails();\n\t\t\t\t\t$customer_details = $this->GetCustomerBilling($_POST['customer_pending_data']['customer_id']);\n\t\t\t\t\t//4.Send a msg\n\t\t\t\t\t$this->session->set_userdata('bill_url',$bill_url);\n\t\t\t\t\t$sms_status = $this->db->select('*')->from('mss_business_outlets')->where('business_outlet_id',$this->session->userdata['logged_in']['business_outlet_id'])->get()->row_array();\n\t\t\t\t\t\t// $this->PrettyPrintArray($sms_status);\n\t\t\t\t\tif($sms_status['business_outlet_sms_status']==1 && $sms_status['whats_app_sms_status']==0){\n\t\t\t\t\t\tif($_POST['send_sms'] === 'true' && $_POST['cashback']>0){\n\t\t\t\t\t\t\tif($_POST['txn_data']['txn_value']==0){\n\t\t\t\t\t\t\t$this->SendPackageTransactionSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['cart_data'][0]['salon_package_name'],$count,$customer_details['customer_name'],$_POST['cart_data'][0]['service_count'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$this->SendSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\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\tif($_POST['send_sms'] === 'true' && $_POST['cashback']==0){\n\t\t\t\t\t\t\tif($_POST['txn_data']['txn_value']==0){\n\t\t\t\t\t\t\t$this->SendPackageTransactionSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['cart_data'][0]['salon_package_name'],$count,$customer_details['customer_name'],$_POST['cart_data'][0]['service_count'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t\t\t}else{\t\t\n\t\t\t\t\t\t\t$this->SendSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}elseif($sms_status['business_outlet_sms_status']==1 && $sms_status['whats_app_sms_status']==1){\n\t\t\t\t\t\t$this->SendSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\n\t\t\t\t\t\t$this->SendWhatsAppSms($sms_status['client_id'],$sms_status['whatsapp_userid'],$sms_status['whatsapp_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\n\t\t\t\t\t}elseif($sms_status['business_outlet_sms_status']==0 && $sms_status['whats_app_sms_status']==1 ){\n\t\t\t\t\t\t$this->SendWhatsAppSms($sms_status['client_id'],$sms_status['whatsapp_userid'],$sms_status['whatsapp_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t}\n\t\t\t\t\t//\n \n\t\t\t\t\t$this->ReturnJsonArray(true,false,\"Transaction is successful!\");\n\t\t\t\t\tdie;\n\t\t\t\t}\n\t\t\t\telseif ($result['error'] == 'true') {\n\t\t\t\t\t$this->ReturnJsonArray(false,true,$result['message']);\n\t\t\t\t\tdie;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t}\n\t}", "function en_receive_upload() {\n\t// Handle incoming upload transaction\n\t\n\t//! Insert the upload job into the queue.\n\n\t//! Connect to PgSQL\n\t$dbconn = new en_connection();\n\t\n\t//! Prepare the query and make the insertions\n\t$query = 'INSERT INTO en_upload_queue VALUES (nextval(\\'en_upload_queue_trid_seq\\'::regclass), ?, ?, ?, ?, ?, ?, \\'0\\') RETURNING trid;';\n/*\n\t$sth = $dbconn->con->prepare($query);\n\t$sth->execute(array($time,$vaule));\n\t$result = $sth->fetchAll();\n */\n\t\n\t$enqueue = $dbconn->con->prepare($query);\n\t$enqueue->execute(array(\n\t\t$_POST['en_inputformat'],\n\t\t$_POST['en_productformat'],\n\t\t$_POST['dataproduct_id'],\n\t\t$_POST['observation'],\n\t\t$_POST['api_id'],\n\t\t$_POST['signature']\n\t));\n\t$row = $enqueue->fetchAll();\n\ten_debug(\"Incoming to queue - APIID: \".$_POST['api_id'].\" - Product: \".$_POST['dataproduct_id'].\" - Transaction ID: \".$row[0]['trid']);\n\t\n\techo $row[0]['trid'];\n\t\n\t//!@todo AMONG OTHERS, CHECK IF SELECTED DATAPRODUCT SUPPORTS THE UPLOAD FORMAT ID\n}", "abstract protected function getTransactions();", "protected function processTransactionUpdate(\\XLite\\Model\\Payment\\Transaction $transaction, $data)\n {\n $transaction->setDataCell('status', 'Transaction successful', 'X-Payments message', 'C');\n\n if (isset($data['advinfo']) && is_array($data['advinfo'])) {\n\n if (!empty($data['advinfo']['Error'])) {\n $transaction->setDataCell('status', $data['advinfo']['Error'], 'X-Payments error', 'C');\n $transaction->setNote($data['advinfo']['Error']);\n }\n\n if (!empty($data['advinfo']['Message'])) {\n $transaction->setDataCell('status', $data['advinfo']['Message'], 'X-Payments message', 'C');\n $transaction->setNote($data['advinfo']['Message']);\n }\n }\n\n $transactionData = array(\n 'xpc_authorized' => $data['authorized'],\n 'xpc_captured' => $data['capturedAmount'],\n 'xpc_charged' => $data['chargedAmount'] + $data['refundedAmount'],\n 'xpc_voided' => $data['voidedAmount'],\n 'xpc_refunded' => $data['refundedAmount'],\n 'xpc_can_capture' => $data['capturedAmountAvail'],\n 'xpc_can_void' => $data['voidedAmountAvail'], \n 'xpc_can_refund' => $data['refundedAmountAvail'],\n 'xpc_is_fraud_status' => $data['isFraudStatus'],\n ); \n\n if (\n isset($data['isFraudStatus'])\n && '1' == $data['isFraudStatus']\n ) {\n // Set default fraud \"review\" for the backwards compatibility\n $transaction->getOrder()->setFraudTypeXpc(\\XLite\\Module\\CDev\\XPaymentsConnector\\Model\\Payment\\FraudCheckData::CODE_GATEWAY);\n $transaction->getOrder()->setFraudStatusXpc(\\XLite\\Model\\Order::FRAUD_STATUS_REVIEW);\n }\n\n if (\n version_compare(\\XLite\\Core\\Config::getInstance()->CDev->XPaymentsConnector->xpc_api_version, '1.6') <= 0\n && $transaction->getDataCell('xpc_txnid')\n ) {\n\n // API 1.6 backwards compatiblity Kount info update\n\n $transactions = array();\n $kountData = false;\n\n $info = $this->client->requestPaymentAdditionalInfo($transaction->getDataCell('xpc_txnid')->getValue()); \n\n if ($info->isSuccess()) {\n $response = $info->getResponse();\n if (\n !empty($response['transactions'])\n && is_array($response['transactions'])\n ) {\n $transactions = $response['transactions'];\n }\n }\n\n // Search for KOUNT data thru transactions\n foreach ($transactions as $tr) {\n\n if (\n isset($tr['fields'])\n && !empty($tr['fields'])\n && is_array($tr['fields'])\n ) {\n $kountData = $this->processKountData($transaction, $tr);\n\n if ((bool)$kountData) {\n $transactionData['xpc_kount'] = serialize($kountData);\n break;\n }\n }\n }\n }\n\n foreach ($transactionData as $key => $value) {\n $transaction->setXpcDataCell($key, $value);\n }\n\n $this->processCardValidationData($transaction, $data);\n\n $this->processMaskedCardData($transaction, $data);\n\n $this->process3dSecureData($transaction, $data);\n\n $this->processFraudCheckData($transaction, $data);\n }", "public function addTransactionChildren($data)\n\t{\n\t\t$oTransactionStatus = new Transactions_Status();\n\t\t$oTransactionStatus->setTransactionStatus($data['tr_id'], Transaction_Statuses::STATUS_SUBMITTED);\n\n\t\t$oProperties = new Transaction_Properties();\n\t\tforeach($data['properties'] as $value)\n\t\t{\n\t\t\t$oProperties->addProperty($data['tr_id'], $value['id'], $value['value']);\n\t\t}\n\t\t$oProperties->addProperty($data['tr_id'], 'transaction_password', $this->generatePassword());\n\n\t\t$oRelationship = new Transaction_Relationships();\n\t\t$relationship_id = $oRelationship->addRelationship($data);\n\t\t$oRelationship->handleRelationshipUploadedFiles(\n\t\t\t$relationship_id,\n\t\t\t$data['case_id'],\n\t\t\t$data['relationship_documents'],\n\t\t\t$this->getUploadedFiles('relationship_documents')\n\t\t);\n\n\t\t$oParty = new Transaction_Relationship_Parties();\n\t\t$data['rel_id'] = $relationship_id;\n\n\n\t\tforeach($data['parties'] as $party_data)\n\t\t{\n\t\t\t$party_data['rel_id'] = $relationship_id;\n\t\t\t$party_id = $oParty->addParty($party_data);\n\n\t\t\t$oSubjects = new Transaction_Relationship_Party_Subjects();\n\t\t\tforeach($party_data['data'] as $item)\n\t\t\t{\n\t\t\t\t$item['party_id'] = $party_id;\n\t\t\t\t$subject_id = $oSubjects->addSubject($item);\n\n\t\t\t\t$oSubjects->handleSubjectUploadedFiles(\n\t\t\t\t\t$subject_id,\n\t\t\t\t\t$data['case_id'],\n\t\t\t\t\t$item['fileData']['existing_files'],\n\t\t\t\t\t$this->getUploadedFiles($item['hash'])\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\n\t\t// objects part\n\t\t$oObject = new Transaction_Relationship_Objects();\n\t\tforeach($data['objects'] as $item)\n\t\t{\n\t\t\t$data['rel_id'] = $relationship_id;\n\t\t\t$data['object_type'] = $item['objectType'];\n\t\t\t$object_id = $oObject->addObject($data, $item['objectData']);\n\n\t\t\t$oObject->handleObjectUploadedFiles(\n\t\t\t\t$object_id,\n\t\t\t\t$data['case_id'],\n\t\t\t\t$item['fileData']['existing_files'],\n\t\t\t\t$this->getUploadedFiles($item['hash'])\n\t\t\t);\n\t\t}\n\t}", "public function process($data,$config){\n\t\t\t\n\t\t\t// Set the transaction details into \n\t\t\t// a serialized array for posting to\n\t\t\t// the order\n\t\t\t\t$details = array(\n\t\t\t\t\t\t\t\t\t\"Method\" => \"AlertPay IPN\" \n\t\t\t\t\t\t\t\t);\n\n\t\t\t// Return the trans details \n\t\t\t\t$trans = array(\n\t\t\t\t\t\t\t\t\t'status' => -1, \n\t\t\t\t\t\t\t\t\t'transaction_id' => $data[\"transaction_id\"],\n\t\t\t\t\t\t\t\t\t'payment_card' => \"\",\n\t\t\t\t\t\t\t\t\t'payment_type' => 'AlertPay IPN', \n\t\t\t\t\t\t\t\t\t'amount' => $data[\"order_total\"],\n\t\t\t\t\t\t\t\t\t'details' => serialize($details), \n\t\t\t\t\t\t\t\t\t'approval' => \"\" \n\t\t\t\t\t\t\t\t);\n\t\t\treturn $trans;\n\t\t}", "private function __processTransaction($txnId){\n\t\t$this->log(\"Processing Trasaction: {$txnId}\", 'paypal');\n\t\t//Put the afterPaypalNotification($txnId) into your app_controller.php\n\t\t$this->afterPaypalNotification($txnId);\n\t}", "public function process($data);", "public function process() {\n\n\t\t\t/**\n\t\t\t * Decode all data from JSON\n\t\t\t *\n\t\t\t * @var array $data\n\t\t\t */\n\t\t\t$data = json_decode($this->getData(), true);\n\n\t\t\t/**\n\t\t\t * Get keys from first row of data set\n\t\t\t *\n\t\t\t * @var array $columNames\n\t\t\t */\n\t\t\t$columnNames = array_keys($data[0]);\n\n\t\t\t/**\n\t\t\t * Generate tablename from given columns\n\t\t\t *\n\t\t\t * @var string $tableName\n\t\t\t */\n\t\t\t$tableName = \"tmp_plista_api_\" . md5(implode($columnNames));\n\n\t\t\t/**\n\t\t\t * Building the query for creating the temporary Table\n\t\t\t * Note: This function does not fires a DROP TABLE. If the\n\t\t\t * table already exists the data gets filled in again. So the\n\t\t\t * client is responsible for droping the table after usage\n\t\t\t *\n\t\t\t * @var string $sql\n\t\t\t */\n\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS `\" . $tableName . \"`\n\t\t\t(\" . implode( $columnNames, \" VARCHAR(255), \" ) . \" VARCHAR(255))\n\t\t\tENGINE=MEMORY\n\t\t\tDEFAULT CHARSET=utf8;\";\n\n\t\t\t/**\n\t\t\t * Build the query for inserting data into the temporary table\n\t\t\t *\n\t\t\t * @var string $sql\n\t\t\t */\n\t\t\tforeach ($data as $row) {\n\t\t\t\t$sql .= \"\\nINSERT INTO $tableName (\" . implode($columnNames, \", \") . \") VALUES ('\" . implode($row, \"', '\") . \"');\";\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * set the data\n\t\t\t */\n\t\t\t$this->setData(\n\t\t\t\tarray(\n\t\t\t\t\t\"table_name\"\t=> $tableName,\n\t\t\t\t\t\"query\"\t\t=> $sql\n\t\t\t\t)\n\t\t\t);\n\t\t}", "protected function _processTransactionPaymentCompleted($parameters) {\n\t\t\t$invoiceItemData = $invoiceOrderData = $pendingTransactions = array();\n\t\t\t$invoiceTotalPaid = false;\n\n\t\t\tif (!empty($parameters['subscription_id'])) {\n\t\t\t\t$existingSubscription = $this->fetch('subscriptions', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'id' => $parameters['subscription_id']\n\t\t\t\t\t),\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'payment_attempts'\n\t\t\t\t\t)\n\t\t\t\t));\n\n\t\t\t\tif (!empty($existingSubscription['count'])) {\n\t\t\t\t\t$subscriptionData = array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => $parameters['subscription_id'],\n\t\t\t\t\t\t\t'payment_attempts' => 0\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t$this->save('subscriptions', $subscriptionData);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($parameters['invoice_id'])) {\n\t\t\t\t$invoice = $this->_call('invoices', array(\n\t\t\t\t\t'methodName' => 'invoice',\n\t\t\t\t\t'methodParameters' => array(\n\t\t\t\t\t\t'invoices',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t\t\t'id' => $parameters['invoice_id'],\n\t\t\t\t\t\t\t\t'payable' => true\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttrue\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t\t$invoiceWarningLevel = $invoice['data']['invoice']['warning_level'];\n\n\t\t\t\tif (!empty($invoice['data'])) {\n\t\t\t\t\t$invoiceData = array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'amount_paid' => $invoice['data']['invoice']['amount_paid'] + $parameters['payment_amount'],\n\t\t\t\t\t\t\t'id' => $invoice['data']['invoice']['id']\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t$total = !empty($invoice['data']['invoice']['total_pending']) ? $invoice['data']['invoice']['total_pending'] : $invoice['data']['invoice']['total'];\n\n\t\t\t\t\tif (is_numeric($invoice['data']['invoice']['remainder_pending'])) {\n\t\t\t\t\t\t$invoiceData[0]['remainder_pending'] = max(0, round(($invoice['data']['invoice']['remainder_pending'] - $parameters['payment_amount']) * 100) / 100);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t!empty($invoice['data']['invoice']['user_id']) &&\n\t\t\t\t\t\t!empty($parameters['user']) &&\n\t\t\t\t\t\t$amountToApplyToBalance = max(0, min($parameters['payment_amount'], round(($invoiceData[0]['amount_paid'] - $total) * 100) / 100))\n\t\t\t\t\t) {\n\t\t\t\t\t\tif (empty($invoice['data']['orders'])) {\n\t\t\t\t\t\t\t$amountToApplyToBalance = $parameters['payment_amount'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$userData = array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'id' => $parameters['user']['id'],\n\t\t\t\t\t\t\t\t'balance' => ($parameters['user']['balance'] + $amountToApplyToBalance)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->save('users', $userData);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t$invoiceData[0]['amount_paid'] >= $total ||\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\tisset($invoiceData[0]['remainder_pending']) &&\n\t\t\t\t\t\t\t\t$invoiceData[0]['remainder_pending'] === 0\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) &&\n\t\t\t\t\t\t$this->delete('invoice_items', array(\n\t\t\t\t\t\t\t'invoice_id' => $invoiceData[0]['id']\n\t\t\t\t\t\t))\n\t\t\t\t\t) {\n\t\t\t\t\t\t$invoiceData = array(\n\t\t\t\t\t\t\tarray_merge($invoiceData[0], array(\n\t\t\t\t\t\t\t\t'remainder_pending' => null,\n\t\t\t\t\t\t\t\t'shipping' => (!empty($invoice['data']['invoice']['shipping_pending']) ? $invoice['data']['invoice']['shipping_pending'] : $invoice['data']['invoice']['shipping']),\n\t\t\t\t\t\t\t\t'shipping_pending' => null,\n\t\t\t\t\t\t\t\t'status' => 'paid',\n\t\t\t\t\t\t\t\t'subtotal' => (!empty($invoice['data']['invoice']['subtotal_pending']) ? $invoice['data']['invoice']['subtotal_pending'] : $invoice['data']['invoice']['subtotal']),\n\t\t\t\t\t\t\t\t'subtotal_pending' => null,\n\t\t\t\t\t\t\t\t'tax' => (!empty($invoice['data']['invoice']['tax_pending']) ? $invoice['data']['invoice']['tax_pending'] : $invoice['data']['invoice']['tax']),\n\t\t\t\t\t\t\t\t'tax_pending' => null,\n\t\t\t\t\t\t\t\t'total' => (!empty($invoice['data']['invoice']['total_pending']) ? $invoice['data']['invoice']['total_pending'] : $invoice['data']['invoice']['total']),\n\t\t\t\t\t\t\t\t'total_pending' => null,\n\t\t\t\t\t\t\t\t'warning_level' => 0\n\t\t\t\t\t\t\t))\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tforeach ($invoice['data']['orders'] as $orderKey => $order) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\tis_numeric($order['quantity_pending']) &&\n\t\t\t\t\t\t\t\t\t$order['quantity_pending'] > $order['quantity_active'] &&\n\t\t\t\t\t\t\t\t\t($quantity = ($order['quantity_pending'] - $order['quantity_active']))\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\t$order['status'] !== 'active' &&\n\t\t\t\t\t\t\t\t\t($quantity = $order['quantity'])\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$quantity = (!empty($order['quantity_pending']) ? $order['quantity_pending'] : $order['quantity']);\n\t\t\t\t\t\t\t\t$orderData = array(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'currency' => $order['currency'],\n\t\t\t\t\t\t\t\t\t\t'id' => $order['id'],\n\t\t\t\t\t\t\t\t\t\t'interval_type' => (!empty($order['interval_type_pending']) ? $order['interval_type_pending'] : $order['interval_type']),\n\t\t\t\t\t\t\t\t\t\t'interval_type_pending' => null,\n\t\t\t\t\t\t\t\t\t\t'interval_value' => (!empty($order['interval_value_pending']) ? $order['interval_value_pending'] : $order['interval_value']),\n\t\t\t\t\t\t\t\t\t\t'interval_value_pending' => null,\n\t\t\t\t\t\t\t\t\t\t'ip_version' => $order['ip_version'],\n\t\t\t\t\t\t\t\t\t\t'previous_action' => null,\n\t\t\t\t\t\t\t\t\t\t'price' => ($price = (!empty($order['price_pending']) ? $order['price_pending'] : $order['price'])),\n\t\t\t\t\t\t\t\t\t\t'price_active' => min($order['price_active'] + $parameters['payment_amount'], $price),\n\t\t\t\t\t\t\t\t\t\t'price_pending' => null,\n\t\t\t\t\t\t\t\t\t\t'quantity' => $quantity,\n\t\t\t\t\t\t\t\t\t\t'quantity_active' => $order['quantity_active'],\n\t\t\t\t\t\t\t\t\t\t'quantity_allocated' => $order['quantity_allocated'],\n\t\t\t\t\t\t\t\t\t\t'quantity_pending' => null,\n\t\t\t\t\t\t\t\t\t\t'shipping' => (!empty($order['shipping_pending']) ? $order['shipping_pending'] : $order['shipping']),\n\t\t\t\t\t\t\t\t\t\t'shipping_pending' => null,\n\t\t\t\t\t\t\t\t\t\t'status' => 'active',\n\t\t\t\t\t\t\t\t\t\t'tax' => (!empty($order['tax_pending']) ? $order['tax_pending'] : $order['tax']),\n\t\t\t\t\t\t\t\t\t\t'tax_pending' => null,\n\t\t\t\t\t\t\t\t\t\t'user_id' => $order['user_id']\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\t$invoice['data']['orders'][$orderKey] = array_merge($invoice['data']['orders'][$orderKey], $orderData[0]);\n\t\t\t\t\t\t\t\t$invoiceItemData[] = array_merge(array_intersect_key($orderData[0], array(\n\t\t\t\t\t\t\t\t\t'currency' => true,\n\t\t\t\t\t\t\t\t\t'interval_type' => true,\n\t\t\t\t\t\t\t\t\t'interval_value' => true,\n\t\t\t\t\t\t\t\t\t'price' => true,\n\t\t\t\t\t\t\t\t\t'quantity' => true\n\t\t\t\t\t\t\t\t)), array(\n\t\t\t\t\t\t\t\t\t'invoice_id' => $invoiceData[0]['id'],\n\t\t\t\t\t\t\t\t\t'order_id' => $order['id'],\n\t\t\t\t\t\t\t\t\t'name' => $order['name']\n\t\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t\t\tif (is_numeric($order['quantity_pending'])) {\n\t\t\t\t\t\t\t\t\t$action = $orderData[0]['previous_action'] = ($order['quantity_pending'] > $order['quantity_active'] ? 'upgrade' : 'downgrade');\n\t\t\t\t\t\t\t\t\t$pendingTransactions[] = array(\n\t\t\t\t\t\t\t\t\t\t'customer_email' => $parameters['user']['email'],\n\t\t\t\t\t\t\t\t\t\t'details' => 'Order ' . $action . ' successful for order <a href=\"' . $this->settings['base_url'] . 'orders/' . $order['id'] . '\">#' . $order['id'] . '</a>.<br>' . $order['quantity'] . ' ' . $order['name'] . ' to ' . $order['quantity_pending'] . ' ' . $order['name'] . '<br>' . number_format($order['price'], 2, '.', '') . ' ' . $order['currency'] . ' for ' . $order['interval_value'] . ' ' . $order['interval_type'] . ($order['interval_value'] !== 1 ? 's' : '') . ' to ' . number_format($order['price_pending'], 2, '.', '') . ' ' . $order['currency'] . ' for ' . $order['interval_value_pending'] . ' ' . $order['interval_type_pending'] . ($order['interval_value_pending'] !== 1 ? 's' : ''),\n\t\t\t\t\t\t\t\t\t\t'id' => uniqid() . time(),\n\t\t\t\t\t\t\t\t\t\t'initial_invoice_id' => $invoiceData[0]['id'],\n\t\t\t\t\t\t\t\t\t\t'invoice_id' => $invoiceData[0]['id'],\n\t\t\t\t\t\t\t\t\t\t'payment_amount' => 0,\n\t\t\t\t\t\t\t\t\t\t'payment_currency' => $this->settings['billing']['currency'],\n\t\t\t\t\t\t\t\t\t\t'payment_status' => 'completed',\n\t\t\t\t\t\t\t\t\t\t'payment_status_message' => 'Order ' . $action . ' successful.',\n\t\t\t\t\t\t\t\t\t\t'processed' => true,\n\t\t\t\t\t\t\t\t\t\t'transaction_charset' => $this->settings['database']['charset'],\n\t\t\t\t\t\t\t\t\t\t'transaction_date' => date('Y-m-d H:i:s', strtotime('+1 second')),\n\t\t\t\t\t\t\t\t\t\t'transaction_method' => 'PaymentCompleted',\n\t\t\t\t\t\t\t\t\t\t'user_id' => $parameters['user']['id']\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 (\n\t\t\t\t\t\t\t\t\t$this->save('orders', $orderData) &&\n\t\t\t\t\t\t\t\t\t$this->save('transactions', $pendingTransactions)\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t$actionData = array(\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'chunks' => ($chunks = ceil(($itemCount = (abs($order['quantity'] - (integer) $order['quantity_pending']))) / 10000)),\n\t\t\t\t\t\t\t\t\t\t\t'encoded_parameters' => json_encode(array(\n\t\t\t\t\t\t\t\t\t\t\t\t'action' => 'allocate',\n\t\t\t\t\t\t\t\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'order' => $orderData[0]\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'item_count' => $itemCount,\n\t\t\t\t\t\t\t\t\t\t\t\t'table' => ($itemCount === 1 ? 'proxy' : 'proxies')\n\t\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t\t'foreign_key' => 'order_id',\n\t\t\t\t\t\t\t\t\t\t\t'foreign_value' => $order['id'],\n\t\t\t\t\t\t\t\t\t\t\t'processed' => ($processOrder = ($chunks == 1)),\n\t\t\t\t\t\t\t\t\t\t\t'progress' => ($processOrder ? 100 : 0),\n\t\t\t\t\t\t\t\t\t\t\t'user_id' => $parameters['user']['id']\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tif ($processOrder) {\n\t\t\t\t\t\t\t\t\t\t$this->_call('proxies', array(\n\t\t\t\t\t\t\t\t\t\t\t'methodName' => 'allocate',\n\t\t\t\t\t\t\t\t\t\t\t'methodParameters' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'proxies',\n\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'order' => $orderData[0]\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}\n\n\t\t\t\t\t\t\t\t\t$this->save('actions', $actionData);\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\t\t\t\t\t$invoiceOrders = $this->fetch('invoice_orders', array(\n\t\t\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t\t\t'invoice_id' => array_unique(array_filter(array(\n\t\t\t\t\t\t\t\t\t$invoice['data']['invoice']['id'],\n\t\t\t\t\t\t\t\t\t$invoice['data']['invoice']['initial_invoice_id'],\n\t\t\t\t\t\t\t\t\t$invoice['data']['invoice']['merged_invoice_id']\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'fields' => array(\n\t\t\t\t\t\t\t\t'id',\n\t\t\t\t\t\t\t\t'initial_invoice_id',\n\t\t\t\t\t\t\t\t'invoice_id',\n\t\t\t\t\t\t\t\t'order_id'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\tif (!empty($invoiceOrders['count'])) {\n\t\t\t\t\t\t\t$invoiceOrderData = array_replace_recursive($invoiceOrders['data'], array_fill(0, $invoiceOrders['count'], array(\n\t\t\t\t\t\t\t\t'initial_invoice_id' => null\n\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$invoiceTotalPaid = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t$invoiceTotalPaid &&\n\t\t\t\t\t\tempty($invoiceItemData) &&\n\t\t\t\t\t\tcount($invoice['data']['orders']) === 1 &&\n\t\t\t\t\t\t($order = $invoice['data']['orders'][0]) &&\n\t\t\t\t\t\t$order['quantity_active'] === $order['quantity_pending']\n\t\t\t\t\t) {\n\t\t\t\t\t\t$invoiceItemData[] = array_merge(array_intersect_key($order, array(\n\t\t\t\t\t\t\t'interval_type' => true,\n\t\t\t\t\t\t\t'interval_value' => true,\n\t\t\t\t\t\t\t'price' => true,\n\t\t\t\t\t\t\t'quantity' => true\n\t\t\t\t\t\t)), array(\n\t\t\t\t\t\t\t'invoice_id' => $invoiceData[0]['id'],\n\t\t\t\t\t\t\t'order_id' => $order['id'],\n\t\t\t\t\t\t\t'name' => $order['name']\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t$this->save('invoices', $invoiceData) &&\n\t\t\t\t\t\t$this->save('invoice_items', $invoiceItemData) &&\n\t\t\t\t\t\t$this->save('invoice_orders', $invoiceOrderData)\n\t\t\t\t\t) {\n\t\t\t\t\t\t$invoice['data']['invoice'] = array_merge($invoice['data']['invoice'], $invoiceData[0]);\n\t\t\t\t\t\t$invoiceData = array();\n\n\t\t\t\t\t\tif ($invoiceTotalPaid) {\n\t\t\t\t\t\t\t$additionalDueInvoices = $this->_call('invoices', array(\n\t\t\t\t\t\t\t\t'methodName' => 'retrieveDueInvoices',\n\t\t\t\t\t\t\t\t'methodParameters' => array(\n\t\t\t\t\t\t\t\t\t$invoice['data']['invoice']\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$intervalType = $invoice['data']['orders'][0]['interval_type'];\n\n\t\t\t\t\t\t\tif (!empty($additionalDueInvoices)) {\n\t\t\t\t\t\t\t\t$invoiceData = array_replace_recursive($additionalDueInvoices, array_fill(0, count($additionalDueInvoices), array(\n\t\t\t\t\t\t\t\t\t'due' => null,\n\t\t\t\t\t\t\t\t\t'warning_level' => 5\n\t\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tin_array($intervalType, array(\n\t\t\t\t\t\t\t\t\t'day',\n\t\t\t\t\t\t\t\t\t'month',\n\t\t\t\t\t\t\t\t\t'week',\n\t\t\t\t\t\t\t\t\t'year'\n\t\t\t\t\t\t\t\t)) &&\n\t\t\t\t\t\t\t\t!empty($intervalValue = $invoice['data']['orders'][0]['interval_value'])\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tempty($additionalDueInvoices) ||\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t!empty($additionalDueInvoices[0]['warning_level']) &&\n\t\t\t\t\t\t\t\t\t\t$additionalDueInvoices[0]['warning_level'] === 5\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\t\tif (\n\t\t\t\t\t\t\t\t\t\t$invoiceWarningLevel === 5 ||\n\t\t\t\t\t\t\t\t\t\tempty($invoice['data']['invoice']['initial_invoice_id'])\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t$invoice['data']['invoice']['due'] = null;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$invoiceData[] = array(\n\t\t\t\t\t\t\t\t\t\t'cart_items' => $invoice['data']['invoice']['cart_items'],\n\t\t\t\t\t\t\t\t\t\t'currency' => $invoice['data']['invoice']['currency'],\n\t\t\t\t\t\t\t\t\t\t'due' => date('Y-m-d H:i:s', strtotime($invoice['data']['invoice']['due'] . ' +' . $intervalValue . ' ' . $intervalType)),\n\t\t\t\t\t\t\t\t\t\t'initial_invoice_id' => !empty($invoice['data']['invoice']['initial_invoice_id']) ? $invoice['data']['invoice']['initial_invoice_id'] : $invoice['data']['invoice']['id'],\n\t\t\t\t\t\t\t\t\t\t'shipping' => $invoice['data']['invoice']['shipping'],\n\t\t\t\t\t\t\t\t\t\t'status' => 'unpaid',\n\t\t\t\t\t\t\t\t\t\t'subtotal' => $invoice['data']['invoice']['subtotal'],\n\t\t\t\t\t\t\t\t\t\t'tax' => $invoice['data']['invoice']['tax'],\n\t\t\t\t\t\t\t\t\t\t'total' => $invoice['data']['invoice']['total'],\n\t\t\t\t\t\t\t\t\t\t'user_id' => $invoice['data']['invoice']['user_id'],\n\t\t\t\t\t\t\t\t\t\t'warning_level' => 0\n\t\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\tunset($invoiceData[0]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (!empty($invoiceData)) {\n\t\t\t\t\t\t\t\t$this->save('invoices', $invoiceData);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$invoice['data']['transactions'][] = $transaction = array_merge($parameters, array(\n\t\t\t\t\t\t\t'payment_method' => $this->_retrieveTransactionPaymentMethod($parameters['payment_method_id'])\n\t\t\t\t\t\t));\n\t\t\t\t\t\t$invoice['data'] = $this->_call('invoices', array(\n\t\t\t\t\t\t\t'methodName' => 'calculateInvoicePaymentDetails',\n\t\t\t\t\t\t\t'methodParameters' => array(\n\t\t\t\t\t\t\t\t$invoice['data']\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\tif ($parameters['payment_amount'] > 0) {\n\t\t\t\t\t\t\t$mailParameters = array(\n\t\t\t\t\t\t\t\t'from' => $this->settings['from_email'],\n\t\t\t\t\t\t\t\t'subject' => 'Invoice #' . $invoice['data']['invoice']['id'] . ' payment confirmation',\n\t\t\t\t\t\t\t\t'template' => array(\n\t\t\t\t\t\t\t\t\t'name' => 'payment_successful',\n\t\t\t\t\t\t\t\t\t'parameters' => array(\n\t\t\t\t\t\t\t\t\t\t'invoice' => $invoice['data']['invoice'],\n\t\t\t\t\t\t\t\t\t\t'transaction' => array_merge($transaction, array(\n\t\t\t\t\t\t\t\t\t\t\t'amount_applied_to_balance' => $amountToApplyToBalance\n\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t'transactions' => $invoice['data']['transactions'],\n\t\t\t\t\t\t\t\t\t\t'user' => $parameters['user']\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\t'to' => $parameters['user']['email']\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->_sendMail($mailParameters);\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\treturn;\n\t\t}", "public function processTransaction() {\n // Uses the CURL library for php to establish a connection,\n // submit the post, and record the response.\n if(function_exists('curl_init') && extension_loaded('curl')) {\n $request = curl_init($this->getEnvironment()); // Initiate curl object\n curl_setopt($request, CURLOPT_HEADER, 0); // Set to 0 to eliminate header info from response\n curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)\n curl_setopt($request, CURLOPT_POSTFIELDS, $this->getNVP()); // Use HTTP POST to send the data\n curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); // Uncomment this line if you get no gateway response.\n $postResponse = curl_exec($request); // Execute curl post and store results in $post_response\n \n // Additional options may be required depending upon your server configuration\n // you can find documentation on curl options at http://www.php.net/curl_setopt\n curl_close($request); // close curl object\n \n // Get the response.\n $this->response = $postResponse; \n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "public function mapTransactionData($data) {\n\n\t\t$transactions = [];\n\n\t\tif (is_array($data)) {\n\n\t\t\tforeach ($data as $item) {\n\n\t\t\t\t$tdata = [];\n\t\t\t\t$tdata['network'] = self::NETWORK_NAME;\n\t\t\t\t$tdata['network_tid'] = object_get($item, \"transactionID\");\n\t\t\t\t$tdata['network_status'] = object_get($item, 'paymentStatus');\n\t\t\t\t$tdata['amount'] = object_get($item, 'saleValue');\n\t\t\t\t$tdata['currency'] = self::DEFAULT_CURRENCY;\n\t\t\t\t$tdata['clickdate'] = (empty($item->date) ? null : Carbon::parse(object_get($item, 'date')));\n\t\t\t\t$tdata['commission'] = object_get($item, 'commission');\n\t\t\t\t$tdata['program_name'] = object_get($item, 'programName');\n\t\t\t\t$tdata['program_id'] = object_get($item, 'programID');\n\t\t\t\tif (preg_match(\"/shopid(\\d+).*userid(\\d+)/\", object_get($item, 'clickRef'), $matches) === 1) {\n\t\t\t\t\t$tdata['shop_id'] = $matches[1];\n\t\t\t\t\t$tdata['user_id'] = $matches[2];\n\t\t\t\t}\n\t\t\t\t$tr = new MerchantTransaction($tdata);\n\t\t\t\t$tr->_rawData = $item;\n\t\t\t\t$transactions[] = $tr;\n\t\t\t}\n\t\t}\n\n\t\treturn $transactions;\n\t}", "function _process($data)\n {\t\t\n\t\t$post = JFactory::getApplication()->input->get($_POST);\n \t\n \t$orderpayment_id = @$data['ssl_invoice_number'];\n \t\n \t$errors = array();\n \t$send_email = false;\n \t\n \t// load the orderpayment record and set some values\n JTable::addIncludePath( JPATH_ADMINISTRATOR.'/components/com_tienda/tables' );\n $orderpayment = JTable::getInstance('OrderPayments', 'TiendaTable');\n $orderpayment->load( $orderpayment_id );\n if (empty($orderpayment_id) || empty($orderpayment->orderpayment_id))\n {\n $errors[] = JText::_('VIRTUALMERCHANT MESSAGE INVALID ORDERPAYMENTID');\n return count($errors) ? implode(\"\\n\", $errors) : '';\n }\n $orderpayment->transaction_details = $data['ssl_result_message'];\n $orderpayment->transaction_id = $data['ssl_txn_id'];\n $orderpayment->transaction_status = $data['ssl_result'];\n \n // check the stored amount against the payment amount \n \tTienda::load( 'TiendaHelperBase', 'helpers._base' );\n $stored_amount = TiendaHelperBase::number( $orderpayment->get('orderpayment_amount'), array( 'thousands'=>'' ) );\n $respond_amount = TiendaHelperBase::number( $data['ssl_amount'], array( 'thousands'=>'' ) );\n if ($stored_amount != $respond_amount ) {\n \t$errors[] = JText::_('VIRTUALMERCHANT MESSAGE AMOUNT INVALID');\n \t$errors[] = $stored_amount . \" != \" . $respond_amount;\n }\n \n // set the order's new status and update quantities if necessary\n Tienda::load( 'TiendaHelperOrder', 'helpers.order' );\n Tienda::load( 'TiendaHelperCarts', 'helpers.carts' );\n $order = JTable::getInstance('Orders', 'TiendaTable');\n $order->load( $orderpayment->order_id );\n if (count($errors)) \n {\n // if an error occurred \n $order->order_state_id = $this->params->get('failed_order_state', '10'); // FAILED\n }\n\t\telse\n {\n $order->order_state_id = $this->params->get('payment_received_order_state', '17');; // PAYMENT RECEIVED\n\n // do post payment actions\n $setOrderPaymentReceived = true;\n \n // send email\n $send_email = true;\n }\n\n // save the order\n if (!$order->save())\n {\n \t$errors[] = $order->getError();\n }\n \n // save the orderpayment\n if (!$orderpayment->save())\n {\n \t$errors[] = $orderpayment->getError(); \n }\n \n if (!empty($setOrderPaymentReceived))\n {\n $this->setOrderPaymentReceived( $orderpayment->order_id );\n }\n \n if ($send_email)\n {\n // send notice of new order\n Tienda::load( \"TiendaHelperBase\", 'helpers._base' );\n $helper = TiendaHelperBase::getInstance('Email');\n $model = Tienda::getClass(\"TiendaModelOrders\", \"models.orders\");\n $model->setId( $orderpayment->order_id );\n $order = $model->getItem();\n $helper->sendEmailNotices($order, 'new_order');\n }\n\n return count($errors) ? implode(\"\\n\", $errors) : ''; \n\n \treturn true;\n }", "private function processPayment($data){\n $p_cust_id_cliente = env('EPAYCO_P_CUST_ID_CLIENTE');\n $p_key = env('EPAYCO_P_KEY');\n $x_ref_payco = $data->x_ref_payco;\n $x_transaction_id = $data->x_transaction_id;\n $x_amount = $data->x_amount;\n $x_currency_code = $data->x_currency_code;\n $x_signature = $data->x_signature;\n $signature = hash('sha256', $p_cust_id_cliente . '^' . $p_key . '^' . $x_ref_payco . '^' . $x_transaction_id . '^' . $x_amount . '^' . $x_currency_code);\n $x_response = $data->x_response;\n $x_response_reason_text = $data->x_response_reason_text;\n $x_id_invoice = $data->x_id_invoice;\n $x_autorizacion = $data->x_approval_code;\n\n //Validamos la firma\n if ($x_signature != $signature) {\n die(\"Firma no valida\");\n }\n\n $this->saveTransaction($data);\n NotificationController::notify('delivery', $data->x_extra3, $x_amount,$data->x_extra5,\"0\");\n\n return response()->json([\n 'success' => true,\n 'message' => 'transacción procesada'\n ],200);\n\n }", "protected function _processReceivedTransactionData($data = [], $result = [])\n {\n $key = '';\n foreach ($data as $trans) {\n if (!$key) {\n $key = $trans['time'];\n }\n $result[$trans['time']] = [\n 'y' => $trans['time'],\n 'received' => $trans['credit'],\n 'spent' => 0,\n ];\n }\n return $result;\n }", "public function processPayment();", "public function controller_processReceivedData() {\n // validate received form data\n // update data model\n }", "protected abstract function handleData();", "public function TransferStockTransaction($post){\r\n\t\t$db=$this->getAdapter();\r\n\t\t$session_user = new Zend_Session_Namespace('auth');\r\n\t\t$userName = $session_user->user_name;\r\n\t\t$GetUserId = $session_user->user_id;\r\n\t\r\n\t\t$db_global = new Application_Model_DbTable_DbGlobal();\r\n\t\t\n\t\tif($post['from_location']!== $post['to_location']){\n\t\t\t//try{\n\t\t\t\n\t\t\t\t\tif($post['invoce_num']!=\"\"){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$tr_no=$post['invoce_num'];\n\t\t\t\t\t}\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t$date= new Zend_Date();\r\n\t\t\t\t\t\t$tr_no=\"TR\".$date->get('hh-mm-ss');\r\n\t\t\t\t\t}\n\t\t\t\t $data_transfer=array(\r\n\t\t\t\t\t\t\t\t\t\t'invoice_num'\t=> $tr_no,\r\n\t\t\t\t\t\t\t\t\t\t'transfer_date' => $post['transfer_date'],\r\n\t\t\t\t\t\t\t\t\t\t'from_location'\t=> $post['from_location'],\r\n\t\t\t\t\t\t\t\t\t\t'to_location'\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t\t'user_id' \t\t=> $GetUserId,\r\n\t\t\t\t\t\t\t\t\t\t'mod_date'\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t\t'remark'\t => $post['remark_transfer']\r\n\t\t\t\t\t\t\t\t );\r\n\t\t\t\t\t$transfer_id = $db_global->addRecord($data_transfer, \"tb_stocktransfer\");\r\n\t\t\t\t unset($data_transfer);\n\t\t\t\t $identity = explode(',',$post['identity']);\r\n\t\t\t\t\tforeach($identity as $i){\r\n\t\t\t\t\t \t\t\t\t$data_item=array(\r\n\t\t\t\t\t\t\t\t\t\t'transfer_id'\t => $transfer_id,\n\t\t\t\t\t\t\t\t\t\t'pro_id'\t\t => $post['item_id_'.$i],\r\n\t\t\t\t\t \t\t\t\t\t'qty'\t\t\t => $post['qty_id_'.$i],\r\n\t\t\t\t\t \t\t\t\t\t'remark_transfer'=> $post['remark_'.$i]\r\n\t\t\r\n\t\t\t\t\t\t\t\t\t );\r\n\t\t\t\t \t\t\t\t $db->insert(\"tb_transfer_item\", $data_item);\r\n\t\t\t\t\t \t\t\t\tunset($data_item);\r\n\t\t\r\n\t\t\t\t\t$rows = $db_global ->porductLocationExist($post['item_id_'.$i], $post['from_location']);\r\n\t\t\t\t\tif($rows){\r\n\t\t\t\t\t\t//update poduct location from\r\n\t\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t\t'qty' \t\t\t=>\t$rows['qty']- $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $rows[\"qty_avaliable\"]- $post['qty_id_'.$i],\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db_global->updateRecord($data_qty_location, $rows['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//add move history\r\n\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['from_location'],\r\n\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_before' => $rows['qty'],\r\n\t\t\t\t\t\t\t\t'qty_after' \t=> $rows['qty']- $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tunset($data_qty_location);unset($rows);unset($data_history);\r\n\t\t\t\t\t\t//update product location to\r\n\t\t\t\t\t\t$rows_gets_qty=$db_global -> porductLocationExist($post['item_id_'.$i], $post['to_location']);\r\n\t\t\r\n\t\t\t\t\t\tif($rows_gets_qty){\r\n\t\t\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t\t\t'qty' \t\t\t=>\t$rows_gets_qty['qty']\t\t\t+ $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $rows_gets_qty[\"qty_avaliable\"]\t+ $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$itemid=$db_global->updateRecord($data_qty_location, $rows_gets_qty['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\r\n\t\t\t\t\t\t\t//add move history\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],//can't add remark cos short table in form\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_before' => $rows_gets_qty['qty'],\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $rows_gets_qty['qty']+ $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($rows_gets_qty);unset($data_history);\r\n\t\t\t\t\t\t}//if recieve deosn't exist in product location\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'LocationId' => $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'qty' => $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\r\n\t\t\t\t\t\t\t//if receive not have\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_before' => 0,\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($add_pro_location); unset($data_history);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{//if from doesn't exist\r\n\t\t\t\t\t\t//add qty in location if from doesn't exist\r\n\t\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t'LocationId' => $post['from_location'],\r\n\t\t\t\t\t\t\t\t'qty' => -$post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t'qty_avaliable'\t=> - $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\r\n\t\t\t\t\t\tunset($add_pro_location);\r\n\t\t\t\t\t\t//echeck for get product location\r\n\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t'transaction_type' => 1,\r\n\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['from_location'],\r\n\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_after' \t=> -$post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\r\n\t\t\t\t\t\tunset($data_history);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//for get stock\r\n\t\t\t\t\t\t$rows_gets_qty=$db_global -> porductLocationExist($post['item_id_'.$i], $post['to_location']);\r\n\t\t\t\t\t\tif($rows_gets_qty){\r\n\t\t\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t\t\t'qty' =>$rows_gets_qty['qty']+ $post['qty_id_'.$i]\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db_global->updateRecord($data_qty_location, $rows_gets_qty['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\r\n\t\t\t\t\t\t\t//add move history\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t( \t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_before' => $rows_gets_qty['qty'],\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $rows_gets_qty['qty']+ $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($rows_gets_qty);unset($data_qty_location);\r\n\t\t\t\t\t\t}//if recieve deosn't exist in product location\r\n\t\t\t\t\t\telse{ //if doesn't exist from and to\r\n\t\t\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'LocationId' => $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'qty' => $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\n\t\t\t\t\t\t\tunset($add_pro_location);\r\n\t\t\t\t\t\t\t//if doesn't exist from and to\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'transaction_type' => 1,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($data_history);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//forforeach\n\t\t\t\t//$db->commit();\n\t\t /*}//try\n\t\t catch (Exception $e) {\n\t\t \t$db->rollBack();\n\t\t \t$this->view->msg = $e->getMessage();\r\n\t\t }*/\r\n\t\t}//for if\r\n\t}", "abstract public function determineTransaction();", "function process() // OK\n { \n if(! $this->validate()) {\n\t $this->_errors->addError('Failed at event validation.');\n\t return false;\n }\n \n $this->_getTransactions();\n \n// -- added\n if(! $this->validate()) {\n\t $this->_errors->addError('Failed after dynamic validations.');\n\t return false;\n }\n// --\n if (! $this->_executeTransactions()) return false;\n else return $this->storeEventDetail();\n }", "protected function processReceivedData() \n {\n parent::processReceivedData();\n // to do: call processReceivedData() for all members\n }", "protected function processReceivedData() \r\n {\r\n parent::processReceivedData();\r\n // to do: call processReceivedData() for all members\r\n }", "public function process($data)\n {\n // Delete previous set\n $this->deleteWhere('serial_number=?', $this->serial_number);\n\n // Parse log data\n $start = ''; // Start date\n $errors = array();\n $now = time();\n $four_weeks = $now + 3600 * 24 * 7 * 4;\n\n foreach (explode(\"\\n\", $data) as $line) {\n if ($line) {\n $parts = explode(\"\\t\", $line);\n\n if (count($parts) !== 3) {\n echo 'Invalid log entry: '.$line;\n } else {\n // Convert unix timestamp string to int\n $this->cert_exp_time = intval($parts[0]);\n // Trim path to 255 chars\n $this->cert_path = substr($parts[1], 0, 254);\n // Get common name out of subject\n if (preg_match('/subject= CN = ([^,]+)/', $parts[2], $matches)) {\n $this->cert_cn = $matches[1];\n } else {\n $this->cert_cn = 'Unknown';\n }\n\n $this->id = '';\n $this->timestamp = time();\n $this->create();\n \n // Check for errors\n if ($this->cert_exp_time < $now) {\n $errors[] = array(\n 'type' => 'danger',\n 'msg' => 'cert.expired',\n 'data' => json_encode(array(\n 'name' => $this->cert_cn,\n 'timestamp' => $this->cert_exp_time\n ))\n );\n } elseif ($this->cert_exp_time < $four_weeks) {\n $errors[] = array(\n 'type' => 'warning',\n 'msg' => 'cert.expire_warning',\n 'data' => json_encode(array(\n 'name' => $this->cert_cn,\n 'timestamp' => $this->cert_exp_time\n ))\n );\n }\n }\n }\n }// end foreach()\n \n if (! $errors) {\n $this->delete_event();\n } else {\n if (count($errors) == 1) {\n $error = array_pop($errors);\n $this->store_event($error['type'], $error['msg'], $error['data']);\n } else {\n // Loop through errors and submit stats\n $error_count = 0;\n $last_error = array();\n $warning_count = 0;\n // Search through errors and warnings\n foreach ($errors as $error) {\n if ($error['type'] == 'danger') {\n $last_error = $error;\n $error_count ++;\n }\n if ($error['type'] == 'warning') {\n $warning_count ++;\n }\n }\n // If errors, ignore warnings\n if ($error_count) {\n $type = 'error';\n if ($error_count == 1) {\n $msg = $last_error['msg'];\n $data = $last_error['data'];\n } else {\n $msg = 'cert.multiple_errors';\n $data = $error_count;\n }\n } else {\n $type = 'warning';\n $msg = 'cert.multiple_warnings';\n $data = $warning_count;\n }\n $this->store_event($type, $msg, $data);\n }\n }\n }", "function after_process() {\n\t\t $requestParamList = array(\"MID\" => MODULE_PAYMENT_PAYTM_MERCHANT_ID , \"ORDERID\" => $_POST['ORDERID']);\n\n\t\t $paytmParamsStatus = array();\n /* body parameters */\n $paytmParamsStatus[\"body\"] = array(\n /* Find your MID in your Paytm Dashboard at https://dashboard.paytm.com/next/apikeys */\n \"mid\" => $requestParamList['MID'],\n /* Enter your order id which needs to be check status for */\n \"orderId\" => $requestParamList['ORDERID'],\n );\n $checksumStatus = PaytmChecksum::generateSignature(json_encode($paytmParamsStatus[\"body\"], JSON_UNESCAPED_SLASHES), MODULE_PAYMENT_PAYTM_MERCHANT_KEY);\n /* head parameters */\n $paytmParamsStatus[\"head\"] = array(\n /* put generated checksum value here */\n \"signature\" => $checksumStatus\n );\n /* prepare JSON string for request */\n $post_data_status = json_encode($paytmParamsStatus, JSON_UNESCAPED_SLASHES);\n $paytstsusmurl = $this->paytmurl.PaytmConstants::ORDER_STATUS_URL; \n $ch = curl_init($paytstsusmurl);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data_status);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n $responseJson = curl_exec($ch);\n $responseStatusArray = json_decode($responseJson, true);\n\t\t if($responseStatusArray['body']['resultInfo']['resultStatus']=='TXN_SUCCESS' && $responseStatusArray['body']['txnAmount']==$_POST['TXNAMOUNT'])\n\t\t {\n\t\t \tglobal $insert_id;\n\t\t\t $status_comment=array();\n\t\t\t if(isset($_POST)){\n\t\t\t\t if(isset($_POST['ORDERID'])){\n\t\t\t\t \t$status_comment[]=\"Order Id: \" . $_POST['ORDERID'];\n\t\t\t\t }\n\t\t\t\t\n\t\t\t\t if(isset($_POST['TXNID'])){\n\t\t\t\t\t $status_comment[]=\"Paytm TXNID: \" . $_POST['TXNID'];\n\t\t\t\t }\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$sql_data_array = array('orders_id' => $insert_id,\n 'orders_status_id' => MODULE_PAYMENT_PAYTM_ORDER_STATUS_ID,\n 'date_added' => 'now()',\n 'customer_notified' => '0',\n 'comments' => implode(\"\\n\", $status_comment));\n\n\t\t\tzen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);\n\t\t}\n\t\telse{\n\t\t\tzen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, 'error_message=' . urlencode(\"It seems some issue in server to server communication. Kindly connect with administrator.\"), 'SSL', true, false));\n\t\t}\n }", "public function processRequests() {\n\t\t$receivedRequests = $this->receivedRequestMapper->findAll();\n\t\tforeach ($receivedRequests as $receivedRequest) {\n\t\t\t$id = $receivedRequest->getId();\n\t\t\t$sendingLocation = $receivedRequest->getSendingLocation();\n\t\t\t$type = $receivedRequest->getRequestType();\n\t\t\t$addedAt = $receivedRequest->getAddedAt();\n\t\t\t$field1 = $receivedRequest->getField1();\n\t\t\t\n\t\t\tswitch ($type) {\n\t\t\t\tcase Request::USER_EXISTS: //Want same behavior for these two queries\n\t\t\t\tcase Request::FETCH_USER: //for login for a user that doesn't exist in the db\n\t\t\t\t\t$userExists = $this->api->userExists($field1) ? '1' : '0';\t\n\n\t\t\t\t\t$this->api->beginTransaction();\n\t\t\t\t\t$response = new QueuedResponse($id, $sendingLocation, (string) $userExists, $this->api->microTime());\n\t\t\t\t\t$this->queuedResponseMapper->save($response); //Does not throw Exception if already exists\n\n\t\t\t\t\tif ($userExists) {\n\t\t\t\t\t\t$userUpdate = $this->userUpdateMapper->find($field1);\n\t\t\t\t\t\t$displayName = $this->api->getDisplayName($field1);\n\t\t\t\t\t\t$password = $this->api->getPassword($field1);\n\t\t\t\t\t\t$queuedUser = new QueuedUser($field1, $displayName, $password, $userUpdate->getUpdatedAt(), $sendingLocation); \n\t\t\t\t\t\t$this->queuedUserMapper->save($queuedUser); //Does not throw Exception if already exists\n\t\t\t\t\t}\n\t\t\t\t\t$this->api->commit();\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->api->log(\"Invalid request_type {$type} for request from {$sendingLocation} added_at {$addedAt}, field1 = {$field1}\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request = $this->receivedRequestMapper->delete($receivedRequest);\n\t\t}\n\t}", "private function _processINS()\n {\n //like is needed for normal signal...\n if (!isset($this->_post_vars['message_type']) || $this->_post_vars['message_type'] !== 'ORDER_CREATED') {\n //don't care about this signal, it is not related to order created.\n trigger_error(\"DEBUG TRANSACTION: Ignoring signal, appears to be INS but NOT the order_created signal.\");\n return;\n }\n\n trigger_error(\"DEBUG TRANSACTION: Processing signal as INS signal. Var details:\\n\" . print_r($this->_post_vars, 1));\n\n //make sure it is valid...\n $hash = $this->_genHash(true);\n if (!$hash || $hash !== $this->_post_vars['md5_hash']) {\n trigger_error('DEBUG TRANSACTION: Authentication check failed, MD5 hash did not match. Check secret word settings for gateway.');\n return;\n }\n\n if (!isset($this->_post_vars['vendor_order_id'])) {\n trigger_error(\"DEBUG TRANSACTION: No vendor_order_id present, not able to process signal any further.\");\n return;\n }\n //get the transaction...\n $parts = explode(self::ORDER_SEP, $this->_post_vars['vendor_order_id']);\n if (!isset($parts[1])) {\n trigger_error(\"DEBUG TRANSACTION: vendor_order_id does not contain transaction id, cannot process INS signal. Value is {$this->_post_vars['vendor_order_id']}.\");\n return;\n }\n $transaction = geoTransaction::getTransaction((int)$parts[1]);\n if (!$transaction) {\n trigger_error(\"DEBUG TRANSACTION: Problem getting transaction for ID {$parts[1]}\");\n return;\n }\n if ($transaction->getStatus()) {\n trigger_error(\"DEBUG TRANSACTION: Transaction already active! Nothing is needed for this INS signal as the main signal already processed successfully.\");\n return;\n }\n $order = geoOrder::getOrder($parts[0]);\n if (!$order) {\n trigger_error(\"DEBUG TRANSACTION: First part of vendor_order_id, for the order ID, not able to get order from it. Value: {$parts[0]}\");\n return;\n }\n trigger_error(\"DEBUG TRANSACTION: INS Approved! Activating transaction, INS payment signal is valid and for transaction not already approved.\");\n $transaction->set('ins_data', $post_vars);\n self::_success($order, $transaction, $this, true);\n }", "function _processSale() {\n\t\t$this->autoload();\t\t\n\t\tJbPaymentxxsourcexxLib::write_log('xxsourcexx.txt', 'IPN: '.json_encode($_REQUEST));\n\t\t\n\t\t$input = jfactory::getApplication()->input;\t\t\n\t\t$status = $input->getString('xxsourcexx_transactionStatus');\n\t\t\n\t\t$success_status = array('CO','PA');\n\t\t\n\t\tif(in_array($status, $success_status)){\n\t\t\t$order_number = $input->getString('_itemId');\n\t\t\t$order_jb = JbPaymentxxsourcexxLib::getOrder($order_number);\n\t\t\t$order_jb->pay_status = 'SUCCESS';\n\t\t\t$order_jb->order_status = 'CONFIRMED';\n\t\t\t$order_jb->tx_id = $tnxref;\n\t\t\t$order_jb->store ();\n\t\t\treturn $order_jb;\t\n\t\t}else{\n\t\t\texit;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function orderCommitEtProcess($order_data, $bid)\r\n {\r\n $sysUtil = new SysUtility();\r\n $orderSet = new Order1InfoSet($bid);\r\n $result = array();\r\n\r\n $orderSet->setBusinessId($bid);\r\n $orderSet->setProductName($order_data->product_name_id);\r\n $orderSet->setMonthTerm($order_data->service_term_id);\r\n $orderSet->setStoreQuantity($order_data->store_quantity_id);\r\n $orderSet->setTotalAmount($order_data->amount_id);\r\n $orderSet->setTaxRate(CommonDefinition::TAX_RATE_CANADA);\r\n $orderSet->setAmountPaid(CommonDefinition::ZERO_NUM); // Assume no payment received yet\r\n $orderSet->setPaymentMethod(CommonDefinition::PAY_METHOD_EMAIL); // paid by email\r\n // transfer\r\n $orderSet->setOrderStatus(NeoDefinition::ORDER_STATUS_EMAIL_COMMIT); // set order status\r\n\r\n $temp = $sysUtil->generateDb1OrderId($bid);\r\n\r\n // Set the order ID\r\n $orderSet->setOrderId($temp);\r\n $orderSet->setOrderNote(NeoDefinition::ET_ORDER_NOTE_1);\r\n $orderSet->setPaymentInfo(NeoDefinition::ET_ORDER_PAYMENT_INFO_1);\r\n\r\n $tblName = $sysUtil->getNeoDb1OrderTblName();\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($tblName);\r\n $queryResult = $neoModel->addDashboard1OrderById($orderSet);\r\n\r\n if ($queryResult) {\r\n $result[\"status\"] = CommonDefinition::SUCCESS;\r\n $result[\"info\"] = NeoDefinition::ET_ORDER_ADD_SUCCESS . NeoDefinition::EMAIL_INTERAC_LINK;\r\n\r\n // get the total order number after this submit if add order success\r\n\r\n $queryResult = $neoModel->getDashboard1OrderNumberByBid($bid);\r\n if (! is_bool($queryResult)) {\r\n session_start();\r\n $_SESSION[\"total_order\"] = $queryResult;\r\n }\r\n } else {\r\n $result[\"status\"] = CommonDefinition::ERROR;\r\n $result[\"info\"] = NeoDefinition::ET_ORDER_ADD_FAIL;\r\n }\r\n\r\n $neoModel->close();\r\n return ($result);\r\n }", "public function process()\n {\n // check order configurations for funny PT case\n foreach ($this->order_configurations as $config) {\n $products = $config->getProductArray(true);\n $hasPreceptorTraining = in_array(\"9\", $products);\n\n // we found preceptor training and other products\n //(we need an addtional serial number, therefor an additional config)\n if (count($products) > 1 && $hasPreceptorTraining && !$this->upgrade_purchase) {\n $this->addPreceptorTrainingConfig($config->quantity);\n }\n }\n\n //Mark order as completed\n $this->completed = true;\n $this->order_date = new \\DateTime();\n\n //Either apply upgrades or generate new serial numbers\n if ($this->upgrade_purchase) {\n $this->applyUpgradesAndDowngrades();\n } else {\n $this->generateSerialNumbers();\n }\n\n //Send email to interested parties, unless this is an instant order by Staff\n if ($this->order_type->id != 3) {\n $this->emailSerialNumbers();\n }\n\n //Generate invoice number and email the invoice if appropriate\n if ($this->payment_method->id == 1 && !$this->isFreeOrder()) {\n $this->generateInvoiceNumber();\n $this->emailInvoicePdf();\n }\n \n $session = new \\Zend_Session_Namespace(\"OrdersController\");\n $session->unsetAll();\n }", "public function handleData();", "public function syncTransactions(): void\n\t{\n\t\tif (!$this->checkTransactions()) {\n\t\t\treturn;\n\t\t}\n\n\t\t$transactions = $this->getTransactionList();\n\n\t\t/** @var array<\\Eshop\\DB\\Order> $orders */\n\t\t$orders = $this->orderRepository->many()->setIndex('this.code')->toArrayOf('uuid');\n\t\t/** @var array<\\Eshop\\DB\\EHubTransaction> $existingTransactions */\n\t\t$existingTransactions = $this->EHubTransactionRepository->many()->toArray();\n\n\t\t$newTransactionsValues = [];\n\n\t\tforeach ($transactions as $transaction) {\n\t\t\t$transactionPK = DIConnection::generateUuid('eHubTransactionId', $transaction['id']);\n\t\t\t$transactionValues = [\n\t\t\t\t'order' => null,\n\t\t\t];\n\n\t\t\tif (isset($existingTransactions[$transactionPK])) {\n\t\t\t\t$transactionValues = $existingTransactions[$transactionPK]->toArray();\n\t\t\t}\n\n\t\t\t$transactionValues['transactionId'] = $transaction['id'];\n\t\t\t$transactionValues['status'] = $transaction['status'];\n\t\t\t$transactionValues['createdTs'] = (new Carbon($transaction['dateTime']))->format('Y-m-d G:i');\n\t\t\t$transactionValues['clickDateTime'] = (new Carbon($transaction['clickDateTime']))->format('Y-m-d G:i');\n\t\t\t$transactionValues['orderAmount'] = (float) $transaction['orderAmount'];\n\t\t\t$transactionValues['originalOrderAmount'] = $transaction['originalOrderAmount'] ?? null;\n\t\t\t$transactionValues['originalCurrency'] = $transaction['originalCurrency'] ?? null;\n\t\t\t$transactionValues['commission'] = isset($transaction['commission']) ? (float) $transaction['commission'] : null;\n\t\t\t$transactionValues['type'] = $transaction['type'];\n\t\t\t$transactionValues['orderId'] = $transaction['orderId'] ?? null;\n\t\t\t$transactionValues['couponCode'] = $transaction['couponCode'] ?? null;\n\t\t\t$transactionValues['newCustomer'] = $transaction['newCustomer'] ?? null;\n\n\t\t\tif (isset($orders[$transaction['orderId']])) {\n\t\t\t\t$transactionValues['order'] = $orders[$transaction['orderId']];\n\t\t\t}\n\n\t\t\t$newTransactionsValues[] = $transactionValues;\n\t\t}\n\n\t\t$this->EHubTransactionRepository->syncMany($newTransactionsValues);\n\t}", "public function populateTransaction($data = array())\n\t{\n\t\ttry {\n\t\t\t$data = EMerchantPayHelper::sanitizeData($data, $this);\n\n\t\t\t// Check if transaction exists\n\t\t\t$insert_query = $this->db->query(\"\n\t\t\t\tSELECT\n\t\t\t\t\t*\n\t\t\t\tFROM\n\t\t\t\t\t`\" . DB_PREFIX . \"emerchantpay_checkout_transactions`\n\t\t\t\tWHERE\n\t\t\t\t\t`unique_id` = '\" . $data['unique_id'] . \"'\n\t\t\t\");\n\n\t\t\tif ($insert_query->rows) {\n\t\t\t\t$this->updateTransaction($data);\n\t\t\t} else {\n\t\t\t\t$this->addTransaction($data);\n\t\t\t}\n\t\t} catch (Exception $exception) {\n\t\t\t$this->logEx($exception);\n\t\t}\n\t}", "public function execute() {\n $request = $this->getRequest()->getParams();\n \n $order_id = strip_tags($request[\"orderId\"]);\n $order = $this->objectManagement->create('Magento\\Sales\\Model\\Order')->loadByIncrementId($order_id);\n $validateOrder = $this->validateWebhook($request, $order);\n\n $transactionId = $request['referenceId'];\n\n $mageOrderStatus = $order->getStatus();\n\n if($mageOrderStatus === 'pending') {\n\n if(!empty($validateOrder['status']) && $validateOrder['status'] === true) {\n if($request['txStatus'] == 'SUCCESS') {\n $request['additional_data']['cf_transaction_id'] = $transactionId;\n $this->logger->info(\"Cashfree Notify processing started for cashfree transaction_id(:$transactionId)\");\n $this->processPayment($transactionId, $order);\n $this->logger->info(\"Cashfree Notify processing complete for cashfree transaction_id(:$transactionId)\");\n return;\n } elseif($request['txStatus'] == 'FAILED' || $request['txStatus'] == 'CANCELLED') {\n $orderStatus = self::STATE_CANCELED;\n $this->processWebhookStatus($orderStatus, $order);\n $this->logger->info(\"Cashfree Notify change magento order status to (:$orderStatus) cashfree transaction_id(:$transactionId)\");\n return;\n } elseif($request['txStatus'] == 'USER_DROPPED') {\n $orderStatus = self::STATE_CLOSED;\n $this->processWebhookStatus($orderStatus, $order);\n $this->logger->info(\"Cashfree Notify change magento order status to (:$orderStatus) cashfree transaction_id(:$transactionId)\");\n return;\n } else {\n $orderStatus = self::STATE_PENDING_PAYMENT;\n $this->processWebhookStatus($orderStatus, $order);\n $this->logger->info(\"Cashfree Notify change magento order status to (:$orderStatus) cashfree transaction_id(:$transactionId)\");\n return;\n }\n } else {\n $errorMsg = $validateOrder['errorMsg'];\n $this->logger->info(\"Cashfree Notify processing payment for cashfree transaction_id(:$transactionId) is failed due to ERROR(: $errorMsg)\");\n return;\n }\n } else {\n $this->logger->info(\"Order has been already in processing state for cashfree transaction_id(:$transactionId)\");\n return;\n }\n }", "protected function postProcessUpdateReceipt()\n {\n }", "public function process()\n {\n // Get all orders not yet sent to Flow within the valid time period\n $orders = Order::get()\n ->filter([\n 'Scheduled' => 0,\n 'IsCart' => 0\n ]);\n\n // run through and schedule\n /** @var Order|\\Isobar\\Flow\\Extensions\\OrderExtension $order */\n foreach ($orders as $order) {\n if ($order->UnpaidTotal()->getDecimalValue() <= 0) {\n echo 'Order #' . $order->ID . ' to be scheduled' . \"\\n\";\n\n $order->scheduleOrder();\n }\n }\n }", "protected function runTransactionBuild()\n {\n $this->request->transaction = new Transaction($this->request); /* Write the transaction record to disk */\n }", "public function processResponses() {\n\t\t$receivedResponses = $this->receivedResponseMapper->findAll();\n\t\tforeach ($receivedResponses as $receivedResponse) {\n\t\t\t$requestId = $receivedResponse->getRequestId();\n\t\t\t$answer = $receivedResponse->getAnswer();\n\t\t\n\t\t\t$queuedRequest = $this->queuedRequestMapper->find($requestId);\n\t\t\tif ($queuedRequest) {\n\t\t\t\t$type = $queuedRequest->getRequestType();\n\t\t\t\t$field1 = $queuedRequest->getField1();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//request no longer exists, so just delete response\n\t\t\t\t$this->receivedResponseMapper->delete($receivedResponse);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tswitch ($type) {\n\t\t\t\tcase Request::USER_EXISTS:\n\t\t\t\t\tif ($answer !== \"1\" AND $answer !== \"0\") {\n\t\t\t\t\t\t$this->api->log(\"ReceivedResponse for Request USER_EXISTS, request_id = {$receivedResponse->getId()} had invalid response = {$answer}\"); \n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ($answer === \"0\") {\n\t\t\t\t\t\t$friendships = $this->friendshipMapper->findAllByUser($field1);\n\t\t\t\t\t\tforeach ($friendships as $friendship) {\n\t\t\t\t\t\t\t$this->friendshipMapper->delete($friendship);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->api->beginTransaction();\n\t\t\t\t\t//Don't need destination for delete since they should all be this instance\n\t\t\t\t\t$this->receivedResponseMapper->delete($receivedResponse);\n \t\t\t\t\t$this->queuedRequestMapper->delete($receivedResponse);\n\t\t\t\t\t$this->api->commit();\n\t\t\t\t\tbreak;\n\t\t\t\tcase Request::FETCH_USER: \n\t\t\t\t\tif ($answer !== \"1\" AND $answer !== \"0\") {\n\t\t\t\t\t\t$this->api->log(\"ReceivedResponse for Request FETCH_USER, request_id = {$receivedResponse->getId()} had invalid response = {$answer}\"); \n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->api->beginTransaction();\n\t\t\t\t\t//Don't need destination for delete since they should all be this instance\n\t\t\t\t\t$this->receivedResponseMapper->delete($receivedResponse);\n \t\t\t\t\t$this->queuedRequestMapper->delete($receivedResponse);\n\t\t\t\t\t$this->api->commit();\n\t\t\t\t\t\n\t\t\t\t\tbreak;\t\n\t\t\t\tdefault:\n\t\t\t\t\t$this->api->log(\"Invalid request_type {$type} for request id {$requestId}\");\n\t\t\t\t\tcontinue;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function storeIncomingData() {}", "private function parseResponses() \r\n {\r\n $validStates = array('Response', 'Response30');\r\n $messages = $this->MessageQueue->find('all', array(\r\n 'fields' => array('messageIdentity', 'message', 'processState', 'isCopied', 'sourceDeviceAlias'),\r\n 'conditions' => array(\r\n 'mailbox' => $this->CurrentDevice->deviceAlias,\r\n 'processState' => $validStates\r\n ),\r\n 'order' => 'createDate'\r\n ));\r\n \r\n // Start a transaction\r\n $this->MessageQueue->transaction(null, true);\r\n\r\n // Process all the messages. Any messages that fail will be placed into the $errors array.\r\n $errors = array();\r\n $processed = array();\r\n foreach($messages as $message)\r\n {\r\n $message = $message['MessageQueue'];\r\n\r\n try\r\n {\r\n libxml_use_internal_errors(true);\r\n $xml = Xml::build($message['message']);\r\n $namespaces = array_flip($xml->getNamespaces(true));\r\n\r\n // Convert the XML to an array and pass the resulting message to the correct processing function.\r\n $payload = Set::reverse($xml);\r\n // Set messageQuery to the payload array for message handling.\r\n $this->messageQuery[] = $payload['LawEnforcementTransaction']['Transaction']['Response'];\r\n\r\n if ($this->{\"handle{$message['processState']}\"}($message, $payload, $namespaces))\r\n $processed[] = $message['messageIdentity'];\r\n else\r\n $errors[] = array(\r\n 'message' => $message,\r\n 'error' => 'Message id ' . $message['messageIdentity'] . ' failed to process.'\r\n );\r\n }\r\n catch(Exception $e)\r\n {\r\n $errors[] = array(\r\n 'message' => $message,\r\n 'error' => 'Exception thrown while processing Message id ' . $message['messageIdentity'] . ': '\r\n . $e->getMessage()\r\n );\r\n }\r\n }\r\n \r\n // Just send the raw LawEnforcementTransaction to the user as is with a statement indicating the error.\r\n if (!empty($errors))\r\n {\r\n $copy = $errors;\r\n foreach($copy as $index => $error) {\r\n try\r\n {\r\n $this->queueErrorResponse($error['error'], $error['message']);\r\n $processed[] = $error['message']['messageIdentity'];\r\n unset($copy[$index]);\r\n }\r\n catch(Exception $e)\r\n {\r\n $errors[$index]['error'] = \"Failed to enqueue message that failed processing. \" \r\n . \"Original Error:\\n\\n\" . $error['error'];\r\n }\r\n }\r\n }\r\n\r\n // Dequeue all processed messages.\r\n if (!empty($processed))\r\n $this->MessageQueue->deleteAll(array('messageIdentity' => $processed));\r\n \r\n // Deal with any errors that failed to get directed towards the user. All we can do is change them in the queu\r\n // to a new state (so they're not lost) and log them in the CLIPS error log.\r\n //\r\n // This should almost never happen.\r\n if (!empty($errors)) {\r\n $ids = Set::extract($errors, '{n}.message.messageIdentity');\r\n \r\n // Log each of the messages that failed\r\n foreach($errors as $id => $error) {\r\n CakeLog::write('error', \"Message (id {$error['message']['messageIdentity']}) failed to process. \" \r\n . \"{$error['error']}\\n{$error['message']['message']}\");\r\n }\r\n \r\n // UpdateAll doesn't behave like other Cake model functions. We have to quote the param ourself.\r\n $this->MessageQueue->updateAll(\r\n array('processState' => '\\'CLIPS_Error\\''),\r\n array('messageIdentity' => $ids)\r\n );\r\n }\r\n\r\n return $this->MessageQueue->transaction(true, true);\r\n }", "function TransactionRecordLoad( &$data ) {\n\t\t$table = BIT_DB_PREFIX.\"task_transaction\";\n\t\t\n\t\t$pDataHash['data_store']['ticket_id'] = $data[0];\n\t\t$pDataHash['data_store']['transact_no'] = $data[1];\n\t\t$pDataHash['data_store']['transact'] = $data[2];\n\t\t$pDataHash['data_store']['ticket_ref'] = $data[3];\n\t\t$pDataHash['data_store']['staff_id'] = $data[4];\n\t\t$pDataHash['data_store']['previous'] = $data[5];\n\t\t$pDataHash['data_store']['room'] = $data[6];\n\t\t$pDataHash['data_store']['applet'] = $data[7];\n\t\t$pDataHash['data_store']['office'] = $data[8];\n\t\t$pDataHash['data_store']['ticket_no'] = $data[9];\n\t\tif ( $data[10] == '[null]' )\n\t\t\t$pDataHash['data_store']['proom'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['proom'] = $data[10];\n\t\tif ( $data[11] == '[null]' )\n\t\t\t$pDataHash['data_store']['tags'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['tags'] = $data[11];\n\t\tif ( $data[12] == '[null]' )\n\t\t\t$pDataHash['data_store']['clearance'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['clearance'] = $data[12];\n\t\t$result = $this->mDb->associateInsert( $table, $pDataHash['data_store'] );\n\t}", "public function process_gateway_notification() {\r\n\t\t$order_id = self::get_post_var( 'OrderID' );\r\n\t\t$message = self::get_post_var( 'Message' );\r\n\t\t$status_code = self::get_post_var( 'StatusCode' );\r\n\t\t$prev_status_code = self::get_post_var( 'PreviousStatusCode' );\r\n\t\t$session_id = explode( ' ', self::get_post_var( 'OrderDescription' ) );\r\n\r\n\t\tif ( is_numeric( $status_code ) ) {\r\n\t\t\t$processed = WPSC_Purchase_Log::INCOMPLETE_SALE;\r\n\t\t\tswitch ( $status_code ) {\r\n\t\t\t\tcase PS_TRX_RESULT_SUCCESS:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::ACCEPTED_PAYMENT;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_REFERRED:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::PAYMENT_DECLINED;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_DECLINED:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::PAYMENT_DECLINED;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_DUPLICATE:\r\n\t\t\t\t\t$processed = ( PS_TRX_RESULT_SUCCESS === $prev_status_code )\r\n\t\t\t\t\t\t? WPSC_Purchase_Log::ACCEPTED_PAYMENT\r\n\t\t\t\t\t\t: WPSC_Purchase_Log::PAYMENT_DECLINED;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_FAILED:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::INCOMPLETE_SALE;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\twp_die( 'Unsupported StatusCode. Please contact support.',\r\n\t\t\t\t\t\t'Unsupported StatusCode',\r\n\t\t\t\t\t\tarray( 'response' => 400 )\r\n\t\t\t\t\t);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t$data = array(\r\n\t\t\t\t'processed' => $processed,\r\n\t\t\t\t'transactid' => $order_id,\r\n\t\t\t\t'notes' => $message,\r\n\t\t\t\t'date' => time(),\r\n\t\t\t);\r\n\t\t\twpsc_update_purchase_log_details( $session_id[4], $data, 'sessionid' );\r\n\r\n\t\t\tswitch ( $processed ) {\r\n\t\t\t\tcase WPSC_Purchase_Log::ACCEPTED_PAYMENT:\r\n\t\t\t\t\ttransaction_results( $session_id, false, $order_id );\r\n\t\t\t\t\t// Thank you for purchasing.\r\n\t\t\t\t\t$this->go_to_transaction_results( $session_id[4] );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase WPSC_Purchase_Log::PAYMENT_DECLINED:\r\n\t\t\t\t\t// Sorry, your transaction was not accepted.\r\n\t\t\t\t\t$this->go_to_transaction_results( null );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t// Thank you, your purchase is pending.\r\n\t\t\t\t\t$this->go_to_transaction_results( $session_id[4] );\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\twp_die( 'Unexpected response from the payment gateway. Please contact support.',\r\n\t\t\t\t'Unexpected response from the payment gateway',\r\n\t\t\t\tarray( 'response' => 400 )\r\n\t\t\t);\r\n\t\t}\r\n\t}", "public function run()\n {\n $elements = [\n ['from_id' => 1, 'to_id' => 2, 'details' => 'sample transaction', 'amount' => 14],\n ['from_id' => 1, 'to_id' => 2, 'details' => 'sample transaction 2', 'amount' => 24],\n ['from_id' => 2, 'to_id' => 1, 'details' => 'sample transaction 3', 'amount' => 15],\n ];\n foreach($elements as $element){\n $item = new \\App\\Transaction();\n $item->from_id = $element['from_id'];\n $item->to_id = $element['to_id'];\n $item->details = $element['details'];\n $item->amount = $element['amount'];\n $item->save();\n }\n }", "public function process($data)\n {\n if (! $data) {\n throw new Exception(\"Error Processing Request: No data found\", 1);\n } else if (substr( $data, 0, 30 ) != '<?xml version=\"1.0\" encoding=\"' ) { // Else if old style text, process with old text based handler\n \n // Translate network strings to db fields\n $translate = array(\n ' agrCtlRSSI: ' => 'agrctlrssi',\n ' agrExtRSSI: ' => 'agrextrssi',\n ' agrCtlNoise: ' => 'agrctlnoise',\n ' agrExtNoise: ' => 'agrextnoise',\n ' state: ' => 'state',\n ' op mode: ' => 'op_mode',\n ' lastTxRate: ' => 'lasttxrate',\n ' maxRate: ' => 'maxrate',\n 'lastAssocStatus: ' => 'lastassocstatus',\n ' 802.11 auth: ' => 'x802_11_auth',\n ' link auth: ' => 'link_auth',\n ' BSSID: ' => 'bssid',\n ' SSID: ' => 'ssid',\n ' MCS: ' => 'mcs',\n ' channel: ' => 'channel');\n\n // Delete previous entries\n\n // Parse data\n foreach (explode(\"\\n\", $data) as $line) {\n // Translate standard entries\n foreach ($translate as $search => $field) {\n if (strpos($line, $search) === 0) {\n $value = substr($line, strlen($search));\n\n $this->$field = $value;\n break;\n }\n }\n } //end foreach explode lines\n $this->save();\n } else { // Else process with new XML handler\n\n // Process incoming wifi.plist\n $parser = new CFPropertyList();\n $parser->parse($data, CFPropertyList::FORMAT_XML);\n $plist = $parser->toArray();\n\n // Process each of the items\n foreach (array('agrctlrssi', 'agrextrssi', 'agrctlnoise', 'agrextnoise', 'state', 'op_mode', 'lasttxrate', 'lastassocstatus', 'maxrate', 'x802_11_auth', 'link_auth', 'bssid', 'ssid', 'mcs', 'channel', 'snr', 'known_networks') as $item) {\n\n // If key exists and is zero, set it to zero\n if ( array_key_exists($item, $plist) && $plist[$item] === 0) {\n $this->$item = 0;\n // Else if key does not exist in $plist, null it\n } else if (! array_key_exists($item, $plist) || $plist[$item] == '' || $plist[$item] == \"{}\" || $plist[$item] == \"[]\") {\n $this->$item = null;\n\n // Set the db fields to be the same as those in the preference file\n } else {\n $this->$item = $plist[$item];\n }\n }\n\n // Save the data because bumblebees are fuzzy\n $this->save();\n }\n }", "function saveTransaction($orderid, $payment) {\n\n\t//Get order from database\n $order = db_getOrderById($orderid); \n\n //Get buyer info from database\n $userId = \"\";\n\t $order_ordernumber = \"\";\n\t foreach($order as $o){\n\t\t$userId = $o['userid'];\n\t\t$order_ordernumber = $o['ordernumber'];\n\t }\n\n //Get order items\n $orderitems = db_getOrderItems($orderid);\n\n \t//Initialize array that will hold all order items ids and if the web service saved them succesfully\n $orderItemsSuccess = array();\n \n //Initialize array that will hold items that will be set through the web service with rollback false\n $itemsArr = array();\n \n //Initialize index of order items array\n $itemIndex = 0;\n \n \n $itemsIndexArr = array();\n \n //print_r($orderitems);\n \n //Iterate thorugh $orderItems obtained from db\n foreach ($orderitems as $orderitem) {\n \n \t//Get item from database\n\t\t\n $item = refactored_db_getItem($orderitem['itemid']);\n\n //print_r($item);\n \n //Initialize item success assuming it will be true\n $orderItemsSuccess[$itemIndex] = array(\"id\"=>$item['id'], \"success\"=>false);\n \n //Get item type to see if it is a package or not\n $type = $item['type'];\n //echo $item->name.\"-\".$item->type;\n \n if ($type == \"ITEM\") {\n\t\t\t//Save item in itemsArr to send the request to the web service\n $quantity = $orderitem['quantity'];\n array_push($itemsArr, array(\"creditTypeId\"=>$item['referenceid'],\n\t\t\t\t\t\t\t \"quantity\"=>$quantity, \n\t\t\t\t\t\t\t \"purchaseId\"=>$order_ordernumber, \n\t\t\t\t\t\t\t \"active\"=>false));\n \tarray_push($itemsIndexArr, \t$itemIndex);\n \t\n } else if ($type == \"PACKAGE\") {\n \t\n \t$orderItemsSuccess[$itemIndex][\"success\"]=true;\n\n \t//Get package items\n $packageitems = db_getPackageItems($item['id']);\n\n //Initialize array to send a ws request for package items only with rollback true\n $packageItemsArr = array();\n\n //Initialize the response\n $success = true;\n \n //Save items in request array\n foreach ($packageitems as $packageitem) {\n\n $item = refactored_db_getItem($packageitem['itemid']);\n\n $quantity = $orderitem['quantity']*$packageitem['quantity'];\n array_push($packageItemsArr, array(\"creditTypeId\"=>$item['referenceid'],\n\t\t\t\t\t\t\t\t\t \"quantity\"=>$quantity, \n\t\t\t\t\t\t\t\t\t \"purchaseId\"=>$order_ordernumber.\"\".$orderitem['itemid'], \n\t\t\t\t\t\t\t\t\t \"active\"=>false)); \n }\n \n //Send request for package\n $response = ws_assignQuota($packageItemsArr, $userId, $payment, true);\n \n //print_r($response);\n \n //Check if an item failed to be saved, if it did set success to False\n foreach ($response as $r) {\n \t\n \tif(!$r->active){ \t\n\t \t$orderItemsSuccess[$itemIndex][\"success\"]=$r->active;\n\t \tbreak;\n \t}\n } \n }\n\n //echo \"Item success = \".$orderItemsSuccess[$itemIndex][\"success\"];\n\t\t$itemIndex++;\n }\n \n \n //print_r($orderItemsSuccess);\n //print_r($itemsIndexArr);\n \n //echo \"Single Items :\";\n //print_r($itemsArr);\n \n //Send request for order items that were not packages. if there are any\n $successIndex = 0;\n\t$assignments = array();\n if(count($itemsArr)>0){\n \t$response = ws_assignQuota($itemsArr, $userId,$payment, false);\n \t\n \tif(is_array($response)){\n \t\t$assignments = array_merge($assignments,$response);\n \t}else{\n \t\tarray_push($assignments, $response);\n \t}\n \t\n \t\n \t//print_r(\"assign quota response \".$assignments);\n \t\n \t$i = 0; \t \n \t//Go thorugh the response to check which item failed\n \tforeach ($assignments as $assignment) {\n \t\t\n \t\t$index = $itemsIndexArr[$i++];\n \t\t\n \t\t//print_r(\"index \".$index);\n \t\t\n \t\t$orderItemsSuccess[$index][\"success\"]=$assignment->active;\n \t}\n \t \t\n }\n\n //echo \"OrderItemsSuccess :\";\n //print_r($orderItemsSuccess);\n return $orderItemsSuccess;\n}", "public function insertTransactionJson($input){\r\n try{\r\n foreach($input[\"transactionsresponse\"] as $key=>$trans){\r\n $storeId = (string)$trans['storeId'];\r\n $transactionDate = (string)$trans['transactionDate'];\r\n $amount = (string)$trans['amount'];\r\n $fee = (string)$trans['fee'];\r\n $amountToPrincipal = (string)$trans['amountToPrincipal'];\r\n $amountToEscrow = (string)$trans['amountToEscrow'];\r\n $amountToInterest = (string)$trans['amountToInterest'];\r\n $ledgerBalance = (string)$trans['ledgerBalance'];\r\n $checkNumber = (string)$trans['checkNumber'];\r\n $transactionType = (string)$trans['transactionType'];\r\n $pending = (string)$trans['pending'];\r\n $generatedDescription = (string)$trans['generatedDescription'];\r\n $transactionId = (string)$trans['transactionId'];\r\n $intradayOrderId = (string)$trans['intradayOrderId'];\r\n $exportTNUM = (string)$trans['exportTNUM'];\r\n $depositSlipIdentifier = (string)$trans['depositSlipIdentifier'];\r\n $checkImageIdentifier = (string)$trans['checkImageIdentifier'];\r\n $creditTransaction = (string)$trans['creditTransaction'];\r\n \r\n //convert date format from mm/dd/yyyy to yyyy-mm-dd\r\n $transactionDate = explode('/', $transactionDate);\r\n $transactionDate = [$transactionDate[2], $transactionDate[0], $transactionDate[1]];\r\n $transactionDate = join( '-', $transactionDate);\r\n\r\n if(!$this->insertTransaction( \r\n $storeId, \r\n $transactionDate, \r\n $amount, \r\n $fee, \r\n $amountToPrincipal, \r\n $amountToEscrow, \r\n $amountToInterest, \r\n $ledgerBalance, \r\n $checkNumber, \r\n $transactionType, \r\n $pending, \r\n $generatedDescription, \r\n $transactionId, \r\n $intradayOrderId, \r\n $exportTNUM, \r\n $depositSlipIdentifier, \r\n $checkImageIdentifier, \r\n $creditTransaction )){\r\n throw new Exception();\r\n }\r\n }\r\n }\r\n catch(Exception $ex) {\r\n return false;\r\n }\r\n \r\n return true;\r\n }", "public function query_in_transactions(){\n\t\t$response = $this->execute($this->query_in_transaction_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 processReceivedData(&$myAddress)\n {\n\t\tif (isset($_REQUEST['Address']) && \n\t\t\tisset($_REQUEST['ShoppingCart']))\n\t\t{\n\t\t\t$myAddress = $_REQUEST['Address'];\n\t\t\t$Address = $this->_database->real_escape_string($_REQUEST['Address']);\n\t\t\t$Sql = \"\n\t\t\t\tINSERT INTO `order` (address) \n\t\t\t\tVALUES ('$Address');\n\t\t\t\";\n\t\t\t$this->_database->query ($Sql);\n\t\t\tif ($this->_database->errno) \n\t\t\t{\n\t\t\t throw new Exception(\"BlockShoppingCart::processReceivedData INSERT order failed: \".$this->_database->error.\"\\n\".$Sql);\n\t\t\t}\n\t\t\t$orderid = $this->_database->insert_id;\n\n\t\t\t$Names = $_REQUEST['ShoppingCart'];\n\t\t\tfor ($i = 0; $i < count($Names); $i++) {\n\t\t\t\t$Name = $this->_database->real_escape_string($Names[$i]);\n\t\t\t\t$Sql = \"\n\t\t\t\t\tINSERT INTO pizza (orderid, name, `status`) \n\t\t\t\t\tVALUES ('$orderid', '$Name', '1b');\n\t\t\t\t\";\n\t\t\t\t$this->_database->query ($Sql);\n\t\t\t\tif ($this->_database->errno) \n\t\t\t\t{\n\t\t\t\t throw new Exception(\"BlockShoppingCart::processReceivedData INSERT pizza failed: \".$this->_database->error.\"\\n\".$Sql);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }", "public function processAndComplete()\n {\n if ($this->withdrawal->status == Withdrawal::STATUS_CREATED) {\n // update withdrawal model\n $this->withdrawal->status = Withdrawal::STATUS_COMPLETED;\n $this->withdrawal->save();\n }\n }", "public function process()\n {\n //If they don't order 7 days after sign up, the points disappear\n //send sms before 1-2days if not order placed\n $orderTable = $this->getServiceLocator()->get('Api\\Table\\LoyaltyPointTable');\n $accounts = $orderTable->getAccountsForCreditExpiry();\n if (!$accounts) {\n echo $msg = 'CreditsExpiryController: Not orders available, skipping '. $this->orderId .\"\\n\";\n $this->logger->debug($msg);\n return;\n }\n \n foreach ($accounts['list'] as $account) {\n if ($account['no_order_days_since_signup'] == 5) {\n $this->sendSms($account['contact_no']);\n } else if ($account['no_order_days_since_signup'] >= 7) {\n $this->removeCredits($account['account_id'], $account['points']);\n } \n }\n }", "public function transactionProcess (&$errorMessage);", "final public function removeTransaction(array $data):array{\n try {\n if (!isset($data['tokenTr'])) {\n throw new Exception('Could not Process(0)');\n \n }\n\n if (!Func::decodeNumber($data['tokenTr'])) {\n throw new Exception('Could not Proces (1)'); \n }\n\n $token = Func::decodeNumber($data['tokenTr']);\n } catch (Exception $e) {\n return ['success'=>0,'message'=>$e->getMessage()];\n }\n\n $this->db->delete('jc_transacciones','tr_id='.intval($token).' and tr_id_user='.$this->user.' and tr_status=0');\n return ['success'=>1,'message'=>'This transaction has been successfully removed'];\n}", "function execute()\n{\n\t\n\n\n\n\n\t$arr = array_merge($this->amount,$this->customer,$this->creditCard,$this->options);\n\t\n\t$collection = Braintree_Transaction::search(array(\n Braintree_TransactionSearch::customerId()->is($arr['customer']['id']),\n));\nif($collection->maximumCount() > 0)\n{\n\n$result = Braintree_Transaction::sale(\n array(\n 'customerId' => $arr['customer']['id'],\n 'amount' => $arr['amount']\n )\n);\nif ($result->success) {\necho json_encode(array('type'=>'success','response'=>'payment amount: '.$arr['amount'].' Your transaction id : '.$result->transaction->id));\n\tdo_action('payment_made',array('message'=>'payment amount: '.$arr['amount'].' transaction id : '.$result->transaction->id));\n\n}elseif ($result->transaction) \n{\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n} else {\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n\t\n}\n}else{\n\n$result = Braintree_Transaction::sale($arr);\n\nif ($result->success) {\n\tdo_action('payment_made',array('message'=>'payment amount: '.$arr['amount'].' transaction id : '.$result->transaction->id));\n\t\necho json_encode(array('type'=>'success','response'=>'Payment Amount : '.$arr['amount'].'Your transaction id : '.$result->transaction->id));\n}elseif ($result->transaction) \n{\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n} else {\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n\t\n}\n\n\n\n\t\n}\n\t\n}", "public function run()\n {\n while (($payload = array_shift($this->payloads)) !== null) {\n list($ttr, $message) = $payload;\n $this->startedId = $this->finishedId + 1;\n $this->handleMessage($this->startedId, $message, $ttr, 1);\n $this->finishedId = $this->startedId;\n $this->startedId = 0;\n }\n }", "public function dataTransact($data)\n\t\t{\n\t\t\t$this->connection->autocommit(false);\n\t\t\tif($this->connection->query('BEGIN;'))\n\t\t\t{\n\t\t\t\tif($this->connection->multi_query($data))\n\t\t\t\t{\n\t\t\t\t\tdo {\n\t\t\t\t\t\t/* almacenar primer juego de resultados */\n\t\t\t\t\t\tif ($result = $this->connection->store_result()) {\n\t\t\t\t\t\t\twhile ($row = $result->fetch_row()) {\n\t\t\t\t\t\t\t\techo $row[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$result->free();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} while ($this->connection->more_results() && $this->connection->next_result());\n\n\t\t\t\t\t$this->connection->commit();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$error = $this->connection->error;\n\t\t\t\t\t//echo \"Chiales esto trono!\";\n\t\t\t\t\t$this->connection->rollback();\n\t\t\t\t\treturn $error;\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$error = $this->connection->error;\n\t\t\t\t$this->connection->rollback();\n\t\t\t\treturn $error;\n\t\t\t}\n\t\t}", "function handleIncomingFundsERP(\n $tid, $created, $serialnumber, $paymentmethod_id, $amount\n ) {\n debug_print(\"Entry: handlingIncomingFundsERP ( tid = $tid )\");\n\n debug_print(\"Creating debtor transaction record\");\n\n $paymentmethod = loadPaymentMethod($paymentmethod_id);\n if ($paymentmethod === false)\n return false;\n\n $meter = loadMeterInformation($serialnumber);\n if ($meter === false)\n return false;\n\n $account = loadAccount($meter['account_id']);\n if ($account === false)\n return false;\n\n $branch = loadCustomerBranch($account['customerbranch_id']);\n if ($branch === false)\n return false;\n\n $branchcode = $branch['code'];\n $new_date = date('Y-m-d', strtotime($created));\n $period_id = fgetPeriod_id($new_date, __FILE__, __LINE__);\n $reference = substr($paymentmethod['code'], 0, 7) . ' ' . $tid;\n $salesorder_id = 0;\n $gst = 0.00;\n $freight = 0.00;\n $rate = 1.00;\n $invtext = '';\n $settled = 0;\n $discount = 0;\n $invtext = 'ReceivedMeter:' . $serialnumber . '(' . $branchcode . ')';\n $invtextevent = 'Received';\n $invtextserialnumber = $serialnumber;\n $invtextbranchcode = $branchcode;\n $meter_id = $meter['meter_id'];\n $posted = 1;\n\n $dtid = insertDebtorTrans(\n $tid, $paymentmethod['transactiontype_id'], $account['customerbranch_id'], $created, $period_id, $reference, $salesorder_id, \n (-($amount)), $gst, $freight, $rate, $invtext, $settled, $discount, $invtextevent, $invtextserialnumber, $invtextbranchcode, $meter_id\n );\n\n debug_print(\"Creating GL transaction records\");\n\n $vatapplicable_id = 5;\n\n if (doesGlExist($paymentmethod['erpglaccountcredit']) &&\n doesGlExist($paymentmethod['erpglaccountdebit'])) {\n $rc = insertGLTrans(\n $paymentmethod['transactiontype_id'], $tid, $new_date, $period_id, $invtext, $posted, $vatapplicable_id, $postings = array(\n array($paymentmethod['erpglaccountcredit'] => -$amount),\n array($paymentmethod['erpglaccountdebit'] => $amount)\n )\n );\n }\n\n debug_print(\"Returning transaction id $tid\");\n debug_print(\"Exit: handleIncomingFundsERP\");\n return $tid;\n }", "function the_incomplete_transaction() {\n\n // Get codeigniter object instance\n $CI = &get_instance();\n\n // Verify if flash data exists\n if ( $CI->session->flashdata('incomplete_transaction') ) {\n\n // Get incomplete transaction\n $transaction = $CI->session->flashdata('incomplete_transaction');\n\n // Verify if pay's data exists\n if ( isset($transaction['pay']['amount']) && isset($transaction['pay']['currency']) ) {\n\n // Prepare data to save\n $transaction_params = array(\n 'user_id' => $CI->user_id,\n 'amount' => $CI->security->xss_clean($transaction['pay']['amount']),\n 'currency' => $CI->security->xss_clean($transaction['pay']['currency']),\n 'created' => time()\n );\n\n // Try to save the transaction\n $transaction_id = $CI->base_model->insert('transactions', $transaction_params);\n\n // Verify if the transaction was created\n if ( $transaction_id ) {\n\n // Verify if the transaction has fields\n if ( !empty($transaction['fields']) ) {\n\n // List all fields\n foreach ( $transaction['fields'] as $field_name => $field_value ) {\n\n // Prepare data to save\n $transaction_field = array(\n 'transaction_id' => $transaction_id,\n 'field_name' => $CI->security->xss_clean($field_name),\n 'field_value' => $CI->security->xss_clean($field_value)\n );\n\n // Try to save the transaction's field\n $CI->base_model->insert('transactions_fields', $transaction_field);\n\n }\n\n }\n\n // Verify if the transaction has options\n if ( !empty($transaction['options']) ) {\n\n // List all options\n foreach ( $transaction['options'] as $option_name => $option_value ) {\n\n // Prepare data to save\n $transaction_option = array(\n 'transaction_id' => $transaction_id,\n 'option_name' => $CI->security->xss_clean($option_name),\n 'option_value' => $CI->security->xss_clean($option_value)\n );\n\n // Try to save the transaction's option\n $CI->base_model->insert('transactions_options', $transaction_option);\n\n }\n \n }\n\n // Set the transaction's id\n $transaction['transaction_id'] = $transaction_id;\n\n // Set transaction data which will be used if gateway uses ajax for a better security\n $CI->session->set_flashdata('incomplete_transaction_saved', $transaction);\n\n // Return transaction\n return $transaction;\n\n }\n\n }\n\n }\n\n return false;\n \n }", "function testTransactions() {\n $rcv_num = \n // Create a transaction as the vendor\n $tr = Transaction::create(self::$vendor, 5.0, true);\n // Send code back to vendor\n SMSHelper::send(SMSHelper::smsUrl($tr));\n // Receive code from client\n\n $tr2 = Transaction::find($tr->code);\n // Accept the transaction on behalf of the client\n $tr2->accept(self::$client);\n // Check balances are updated OK\n $this->assertEquals(self::$vendor->balance(), 47.0);\n $this->assertEquals(self::$client->balance(), 37.0);\n }", "function CommitTrans()\n\t{\n\t\tif ($this->__transCount > 0) {\n\t\t\t$this->__connection->commit();\n\t\t\t$this->__transCount--;\n\t\t}\n\t}", "private function processTransaction($arTransaction, $lineNumber = \"Unknown\") {\n $date = false;\n if (preg_match(\"/([0-9]{1,2})\\.([0-9]{1,2})\\.([0-9]{2,4})/\", $arTransaction[\"DATE\"], $arMatches)) {\n // dd.mm.yyyy\n $date = $arMatches[3].\"-\".$arMatches[2].\"-\".$arMatches[1];\n } else if (preg_match(\"/([0-9]{1,2})\\/([0-9]{1,2})\\/([0-9]{2,4})/\", $arTransaction[\"DATE\"], $arMatches)) {\n // mm/dd/yyyy\n $date = $arMatches[3].\"-\".$arMatches[1].\"-\".$arMatches[2];\n } else if (preg_match(\"/([0-9]{2,4})\\.([0-9]{1,2})\\.([0-9]{1,2})/\", $arTransaction[\"DATE\"], $arMatches)) {\n // yyyy-mm-dd\n $date = $arMatches[1].\"-\".$arMatches[2].\"-\".$arMatches[3];\n } else {\n $this->errors[] = \"Invalid date in line \".$lineNumber.\": \".$arTransaction[\"DATE\"];\n return false;\n }\n $dateStamp = strtotime($date);\n if ($dateStamp <= $this->dateStartStamp) {\n // Already imported, skip.\n return true;\n }\n // Convert amount to float\n $amount = false;\n if (preg_match(\"/^[+-]?[0-9\\.]+\\,[0-9]{2}$/\", $arTransaction[\"AMOUNT\"])) {\n // e.g. 1.000,00 = 1000\n $amount = floatval( str_replace(\",\", \".\", str_replace(\".\", \"\", $arTransaction[\"AMOUNT\"])) );\n } else if (preg_match(\"/^[+-]?[0-9\\,]+\\.[0-9]{2}$/\", $arTransaction[\"AMOUNT\"])) {\n // e.g. 1,000.00 = 1000\n $amount = floatval( str_replace(\".\", \",\", str_replace(\",\", \"\", $arTransaction[\"AMOUNT\"])) );\n } else {\n $this->errors[] = \"Invalid amount in line \".$lineNumber.\": \".$arTransaction[\"AMOUNT\"];\n return false;\n }\n // Get subject\n $subject = $arTransaction[\"SUBJECT\"];\n // Process\n $id_target = null;\n $result = true;\n $action = \"SKIP\";\n $notice = \"\";\n if ($date == $this->dateToday) {\n $action = \"PENDING\";\n $notice = \"Umsätze vom aktuellen Tag werden noch nicht verarbeitet.\";\n } else if ($amount > 0) {\n // Received payment\n if (preg_match(\"/\".preg_quote($this->configBankTransfer[\"PREFIX\"]).\"\\-([0-9]+)\\-([0-9]+)/i\", $subject, $arMatches)) {\n $action = \"SUCCESS\";\n $id_user = (int)$arMatches[1];\n $id_target = (int)$arMatches[2];\n $id_transaction = md5(\"I\".$id_target.\"_D\".$date.\"_A\".$amount);\n $billingInvoiceManagement = BillingInvoiceManagement::getInstance($this->db);\n $ar_invoice = $billingInvoiceManagement->fetchById($id_target);\n if ($ar_invoice === false) {\n $notice = \"Ungültige Rechnungs-Nr \".$id_target.\" (Zeile \".$lineNumber.\")\";\n $action = \"ERROR\";\n } else if ($ar_invoice[\"FK_USER\"] != $id_user) {\n $notice = \"Ungültiger Benutzer für \".$this->getLink(\"invoice\", $id_target).\" (Zeile \".$lineNumber.\")\";\n $action = \"ERROR\";\n } else {\n $billingInvoiceTransactionManagement = BillingInvoiceTransactionManagement::getInstance($this->db);\n if ($billingInvoiceTransactionManagement->countByParam(array(\"TRANSACTION_ID\" => $id_transaction)) == 0) {\n // New payment\n $paymentResult = $billingInvoiceTransactionManagement->createInvoiceTransaction(array(\n 'FK_BILLING_INVOICE' => $id_target,\n 'TYPE' => BillingInvoiceTransactionManagement::TYPE_DEFAULT,\n 'STAMP_CREATE' => $date,\n 'DESCRIPTION' => $subject,\n 'TRANSACTION_ID' => $id_transaction,\n 'PRICE' => $amount\n ));\n if ($paymentResult === null) {\n $notice = \"Fehler beim hinzufügen der Zahlung für \".$this->getLink(\"invoice\", $id_target).\"! (Zeile \".$lineNumber.\")\";\n $action = \"ERROR\";\n }\n } else {\n $notice = \"Identische Zahlung für \".$this->getLink(\"invoice\", $id_target).\" bereits gebucht (Zeile \".$lineNumber.\")\";\n $action = \"NOTICE\";\n }\n }\n }\n }\n $this->addProcess($action, $id_target, $arTransaction[\"NAME\"], $arTransaction[\"ACCOUNT\"], $arTransaction[\"BANK\"], $date, $amount, $subject, $notice);\n return $result;\n }", "public function successAction() {\n \n //Grab the database ID\n $collection = Mage::getModel('CardstreamHosted/CardstreamHosted_Trans')->getCollection();\n $collection->addFilter('transactionunique', $_POST['transactionUnique']);\n $transrow = $collection->toArray();\n \n //Grab the database ID\n \n if( isset( $transrow['items'][0]['id'] ) ){\n \n $transid = $transrow['items'][0]['id'];\n \n }else{\n \n $transid = false;\n \n }\n\n if( $transid ){\n \n //We have a transaction ID\n \n $trans = $transrow['items'][0];\n \n // Get the last four of the card used.\n if( isset( $_POST['cardNumberMask'] ) ){\n \n $lastfour = substr($_POST['cardNumberMask'], -4, strlen($_POST['cardNumberMask']) );\n \n }else{\n \n $lastfour = false;\n \n }\n \n //If threeDSEnrolled has been sent, insert it into the database. Otherwise, insert nothing.\n \n if( isset( $_POST['threeDSEnrolled'] ) ){\n \n $threeDSEnrolled = $_POST['threeDSEnrolled'];\n \n }else{\n \n $threeDSEnrolled = false;\n \n }\n \n //If threeDSAuthenticated has been sent, insert it into the database. Otherwise, insert nothing.\n \n if( isset( $_POST['threeDSAuthenticated'] ) ){\n \n $threeDSAuthenticated = $_POST['threeDSAuthenticated'];\n \n }else{\n \n $threeDSAuthenticated = false;\n \n }\n \n //If cardType has been sent, insert it into the database. Otherwise, insert nothing.\n if( isset( $_POST['cardType'] ) ){\n \n $cardType = $_POST['cardType'];\n \n }else{\n \n $cardType = false;\n \n }\n \n //Update the database with the transaction result\n $trn = Mage::getModel('CardstreamHosted/CardstreamHosted_Trans')->loadById( $trans['id'] );\n $trn->setxref( $_POST['xref'] )\n ->setresponsecode( $_POST['responseCode'] )\n ->setmessage( $_POST['responseMessage'] )\n ->setthreedsenrolled( $threeDSEnrolled )\n ->setthreedsauthenticated( $threeDSAuthenticated )\n ->setlastfour( $lastfour )\n ->setcardtype( $cardType )\n ->save();\n\n if( $_POST['responseCode'] === \"0\") {\n\n if( $_POST['amountReceived'] == $trans['amount'] ){\n\n //Load order\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId( $trans['orderid'] );\n\n if( $order->getId() ){\n\n $order->sendNewOrderEmail();\n $order->true;\n\n if( !$order->canInvoice() ) {\n\n //Add order comment and update status - Although we cant invoice, its important to record the transaction outcome.\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/successfulpaymentstatus'), $this->buildordermessage(), 0);\n $order->save();\n\n //when order cannot create invoice, need to have some logic to take care\n $order->addStatusToHistory(\n $order->getStatus(),\n Mage::helper('CardstreamHosted')->__('Order cannot create invoice')\n );\n\n }else{\n\n //need to save transaction id\n $order->getPayment()->setTransactionId( $_POST['xref'] );\n $order->save();\n $converter = Mage::getModel('sales/convert_order');\n $invoice = $converter->toInvoice($order);\n\n foreach($order->getAllItems() as $orderItem) {\n\n if(!$orderItem->getQtyToInvoice()) {\n continue;\n }\n\n $item = $converter->itemToInvoiceItem($orderItem);\n $item->setQty($orderItem->getQtyToInvoice());\n $invoice->addItem($item);\n }\n\n $invoice->collectTotals();\n $invoice->register()->capture();\n $CommentData = \"Invoice \" . $invoice->getIncrementId() . \" was created\";\n\n Mage::getModel('core/resource_transaction')\n ->addObject($invoice)\n ->addObject($invoice->getOrder())\n ->save();\n\n //Add order comment and update status.\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/successfulpaymentstatus'), $this->buildordermessage(), 0);\n\n $order->save();\n\n }\n\n }\n\n $this->_redirect('checkout/onepage/success');\n\n }else{\n\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId( $trans['orderid'] );\n\n if( $order->getId() ){\n\n //Add order comment and update status\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/order_status'), $this->buildordermessage(), 0);\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/order_status'), \"The amount paid did not match the amount due.\", 0);\n\n $order->save();\n\n }\n\n $session = Mage::getSingleton('checkout/session');\n $session->setQuoteId( $trans['quoteid'] );\n Mage::getModel('sales/quote')->load($session->getQuoteId())->setIsActive(true)->save();\n\n $message = \"The amount paid did not match the amount due. Please contact us for more information\";\n $session->addError($message);\n $this->_redirect('checkout/cart');\n\n }\n \n }else{\n \n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId( $trans['orderid'] );\n\n if( $order->getId() ){\n\n //Add order comment and update status.\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/unsuccessfulpaymentstatus'), $this->buildordermessage(), 0);\n $order->save(); \n\n }\n\n $session = Mage::getSingleton('checkout/session');\n $session->setQuoteId( $trans['quoteid'] );\n Mage::getModel('sales/quote')->load($session->getQuoteId())->setIsActive(true)->save();\n\n $this->loadLayout();\n\n $block = $this->getLayout()->createBlock(\n 'Mage_Core_Block_Template',\n 'CardstreamHosted/standard_failure',\n array('template' => 'CardstreamHosted/standard/failure.phtml')\n );\n\n $this->getLayout()->getBlock('content')->append($block);\n\n $this->renderLayout();\n \n }\n \n }else{\n \n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId( Mage::getSingleton('checkout/session')->getCardstreamHostedOrderId() );\n\n if( $order->getId() ){\n\n //Add order comment and update status.\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/order_status'), $this->buildordermessage(), 0);\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/order_status'), \"Unable to locate the transaction in the CardstreamHosted table\", 0);\n $order->save(); \n\n }\n \n $session = Mage::getSingleton('checkout/session');\n $session->setQuoteId( Mage::getSingleton('checkout/session')->getCardstreamHostedQuoteId() );\n Mage::getModel('sales/quote')->load($session->getQuoteId())->setIsActive(true)->save();\n \n $message = \"Unable to locate transaction. Please contact us for payment status.\";\n $session->addError($message);\n $this->_redirect('checkout/cart');\n \n }\n \n }", "function transfer_eth($currency=\"\",$transdata){\r\n\r\n\r\n \t\t$bitcoin_row \t\t= get_cn_data($currency);\r\n\t\t\t$bitcoin_portnumber = insep_decode($bitcoin_row[\"port\"]);\r\n\t\t\t$bitcoin_ipaddress \t= insep_decode($bitcoin_row[\"ip\"]);\t\r\n\t\t\t $adminEthAddr \t\t= $this->get_currancy_address($currency);\t\t\t\r\n\t\t\r\n\r\n\t\t\t\r\n \t\t\t$amountdata=$transdata->row();\r\n \t\t$sendAmount=$amountdata->transfer_amount;\r\n \t\t$currencyToAddress=$amountdata->to_address;\r\n \t\t$key=trim($this->input->post(\"password\"));\r\n\r\n\t\t\t$data1 \t = array('port'=>$bitcoin_portnumber,'from'=>$adminEthAddr,'sendaddress'=>$currencyToAddress,'withdraw_amount'=>$sendAmount,'keyword' => '98543423','name'=>'bitcocyrus.com','key'=>$key,'method'=>'ethwithdraw');\r\n\t\t\t$output = connecteth('ethwithdraw',$data1);\r\n\r\n\t\t\r\n\t\t\t\t $txn_id \t= $output->result;\r\n\t\t\t\t\tif($output->type == 'success') {\r\n\t\t\t\t\t\tif($txn_id != '') {\r\n\t\t\t\t\t\t\treturn $txn_id;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$this->session->set_flashdata(\"error\",$output);\r\n\t\t\t\t\t\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\t\t\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}else\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->session->set_flashdata(\"error\",$output);\r\n\t\t\t\t\t\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\t\r\n\r\n\t\t\t}\r\n\r\n\t}", "public function run()\n {\n # Temp iterator\n $data = [];\n\n DB::connection()->disableQueryLog();\n\n foreach( $this->getIterator() as $rowNumber => $row){\n # push the element into the row\n $data[] = $row;\n # Chunk the handling\n if (($rowNumber % $this->readChunk) == 0){\n # Handle the Data\n $this->handleData($data);\n # Reset data container\n $data = [];\n }\n }\n\n # Residue $data\n if(!empty($data)){\n $this->handleData( $data );\n }\n\n return $this->getMessages();\n }", "abstract protected function _start_transaction();", "abstract public function commitTransaction();", "public function __processTransaction(CakeEvent $event) {\n\t\t$txnId = $event->subject()->id;\n\t\t$this->log(__d('paypal_ipn', 'Processing Trasaction: %s', $txnId), 'paypal');\n\t\t//Put the afterPaypalNotification($txnId) into your AppController.php\n\t\tif (method_exists($this, 'afterPaypalNotification')) {\n\t\t\t$this->afterPaypalNotification($txnId);\n\t\t}\n\t}", "public function saveTransactionFromRequest($request_id,$message,$status,$adminccount)\n {\n list($count,$request) = Mp3music_Api_Cart::getFinanceAccountRequests(\"paymentrequest_id = \".$request_id,\"\",1,1);\n $re = $request[0];\n $insert_item = array($re['request_date'],$re['request_user_id'],$adminccount['user_id'],'','',$re['request_amount'],$re['request_payment_acount_id'],$adminccount['paymentaccount_id'],$status,'request') ;\n //print_r($insert_item); die;\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction(); \n $l_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music'); \n $list = $l_table->createRow();\n $list->transaction_date = $insert_item[0];\n $list->user_seller = $insert_item[1];\n $list->user_buyer = $insert_item[2];\n $list->item_id = $insert_item[3];\n $list->item_type = $insert_item[4];\n $list->amount = $insert_item[5];\n $list->account_seller_id = $insert_item[6];\n $list->account_buyer_id = $insert_item[7];\n $list->transaction_status = $insert_item[8];\n $list->params = $insert_item[9];\n $list->save();\n try {\n $db->commit();\n } catch (Exception $ex) {\n $db->rollback();\n break;\n } \n }", "public function insert_receive_order($received_order_info,$order_id)\n\t{\n\t\t\n\t$log=new Log(\"receiveorder.log\");\n\n\t\t$log->write($received_order_info);\n\t\tif($received_order_info['order_receive_date'] != '')\n\t\t{\n\t\t\t$received_order_info['order_receive_date'] = strtotime($received_order_info['order_receive_date']);\n\t\t\t$received_order_info['order_receive_date'] = date('Y-m-d',$received_order_info['order_receive_date']);\n\t\t}\n\t\t$inner_loop_limit = count($received_order_info['received_quantities']);\n\t\t$quantities = array();\n\t\t$quantity = 0;\n\t\t$this->db->query(\"UPDATE oc_po_order SET receive_date = '\" .$received_order_info['order_receive_date'].\"', receive_bit = \" . 1 . \", pending_bit = \" . 0 . \" WHERE id = \" . $order_id);\n\t\t$log->write(\"UPDATE oc_po_order SET receive_date = '\" .$received_order_info['order_receive_date'].\"', receive_bit = \" . 1 . \", pending_bit = \" . 0 . \" WHERE id = \" . $order_id);\t\t\n\t\t//if pre selected supplier\n\t\tif(count($received_order_info['received_quantities']) != count($received_order_info['suppliers_ids']))\n\t\t{\n\t\t\n\n\t\t\tfor($i =0; $i<count($received_order_info['prices']); $i++)\n\t\t\t{\n\t\t\t\tif($received_order_info['prices'][$i] != \"next product\")\n\t\t\t\t{\n\t\t\t\t\t$prices[$i] = $received_order_info['prices'][$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$log->write($received_order_info['received_quantities']);\n\t\t\tfor($i =0; $i<count($received_order_info['received_quantities']); $i++)\n\t\t\t{\n\t\t\t\tif($received_order_info['received_quantities'][$i] != \"next product\")\n\t\t\t\t{\n\t\t\t\t\t$received_quantities[$i] = $received_order_info['received_quantities'][$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$prices = array_values($prices);\n\t\t\t$received_quantities = array_values($received_quantities);\n\t\t\n\t\t\t$log->write($prices);\t\t\n\t\t\t$log->write(\"after price\");\n\t\t\t$log->write($received_quantities);\t\t\n\n\n\t\t\tfor($i =0; $i<count($received_quantities); $i++)\n\t\t\t{\n\t\t\t$log->write(\"in for loop\");\n\n\t\t\t\t$log->write(\"UPDATE oc_po_receive_details SET price =\" .$prices[$i]. \", quantity = \".$received_quantities[$i].\" WHERE product_id =\".$received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t\t\t$this->db->query(\"UPDATE oc_po_receive_details SET quantity = \".$received_quantities[$i].\" WHERE product_id =\".$received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t\t\t$query = $this->db->query(\"SELECT quantity FROM oc_po_receive_details WHERE product_id = \" . $received_order_info['received_product_ids'][$i] . \" AND order_id =\" . $order_id);\n\t\t\t\t$quantities[$i] = $query->row['quantity'];\n\t\t\t$log->write(\"quantity\");\t\n\t\t\t$log->write($quantities[$i]);\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_receive_details WHERE order_id=\".$order_id);\n\t\t\t\t\t$log->write(\"update order info done select \".$query);\n\t\t\tif(count($query->rows) > 0)\n\t\t\t{\n\t\t\t\t$this->db->query(\"DELETE FROM oc_po_receive_details WHERE order_id=\".$order_id);\n\t\t\t}\n\t\t\n\t\t\tfor($j = 0; $j<count($received_order_info['received_product_ids']); $j++)\n\t\t\t{\n\t\t\t\tfor($k = 0; $k<$inner_loop_limit; $k++)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif($received_order_info['received_quantities'][$k] != 'next product')\n\t\t\t\t\t{\n\t\t\t\t\t\t//\"INSERT INTO oc_po_receive_details (quantity,price,product_id,supplier_id,order_id) VALUES(\".$received_order_info['received_quantities'][$k].\",\".$received_order_info['prices'][$k].\",\".$received_order_info['received_product_ids'][$j].\",\".$received_order_info['suppliers_ids'][$k].\",\".$order_id.\")\"\n\t\t\t\t\t\t$this->db->query(\"INSERT INTO oc_po_receive_details (quantity,product_id,supplier_id,order_id,store_id) VALUES(\".$received_order_info['received_quantities'][$k].\",\".$received_order_info['received_product_ids'][$j].\",\".$received_order_info['suppliers_ids'][$k].\",\".$order_id.\",\".$query->rows[$j][\"store_id\"].\")\");\n\t\t\t\t\t\t$quantity = $quantity + $received_order_info['received_quantities'][$k];\n\t\t\t\t\t\tunset($received_order_info['received_quantities'][$k]);\n\t\t\t\t\t\tunset($received_order_info['suppliers_ids'][$k]);\n\t\t\t\t\t\tunset($received_order_info['prices'][$k]);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($received_order_info['received_quantities'][$k]);\n\t\t\t\t\t\tunset($received_order_info['suppliers_ids'][$k]);\n\t\t\t\t\t\tunset($received_order_info['prices'][$k]);\n\t\t\t\t\t\t$received_order_info['received_quantities'] = array_values($received_order_info['received_quantities']);\n\t\t\t\t\t\t$received_order_info['suppliers_ids'] = array_values($received_order_info['suppliers_ids']);\n\t\t\t\t\t\t$received_order_info['prices'] = array_values($received_order_info['prices']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$quantities[$j] = $quantity;\n\t\t\t\t$quantity = 0;\n\t\t\t}\n\t\t}\n\t\t$bool = false;\n\t\tfor($i=0; $i<count($quantities); $i++)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT DISTINCT( product_id), store_id FROM oc_po_product WHERE product_id = \" . $received_order_info['received_product_ids'][$i]);\n\t\t\t$product_ids[$i] = $query->row;\n\t\t\t$query1 = $this->db->query(\"UPDATE oc_po_product SET received_products = \" . $quantities[$i] . \" WHERE product_id = \" . $received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t}\n\t\t\t$totalamount=0;\n\t\tfor($i=0; $i<count($product_ids); $i++)\n\t\t{\n\t\t\t\n\t\t\t$log->write(\"SELECT quantity FROM \".DB_PREFIX.\"product_to_store WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$query = $this->db->query(\"SELECT quantity FROM \".DB_PREFIX.\"product_to_store WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$quantity = $quantities[$i];//$query->row['quantity'] ;''+\n\t\t\t//$log->write(\"UPDATE \".DB_PREFIX.\"product SET quantity = quantity + \" . $quantity . \" WHERE product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t//$query1 = $this->db->query(\"UPDATE \".DB_PREFIX.\"product SET quantity = quantity + \" . $quantity . \" WHERE product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$log->write(\"UPDATE \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$query2 = $this->db->query(\"UPDATE \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$log->write(\"no product\");\n\t\t\t\t$log->write($query2);\n\t\t\tif($query2->num_rows==0)\n\t\t\t{\t\n\t\t\t\t$log->write(\"insert into \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" , store_id=\".$product_ids[$i]['store_id'].\" ,product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t$this->db->query(\"insert into \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" , store_id=\".$product_ids[$i]['store_id'].\" ,product_id = \" . $product_ids[$i]['product_id']);\n\n\t\t\t}\n\t\t\tif($query && $query2)\n\t\t\t\t{\n\t\t\t\t\t$log->write(\"before credit change in \");\n\t\t\t\t\t$log->write(\"SELECT * FROM \".DB_PREFIX.\"product_to_store p2s left join \".DB_PREFIX.\"product p on p.product_id =p2s.product_id WHERE store_id=\".$product_ids[$i]['store_id'].\" AND p2s.product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t\t//upadte current credit\n\t\t\t\t\t\t//get product details\n\t\t\t\t\t$queryprd = $this->db->query(\"SELECT * FROM \".DB_PREFIX.\"product_to_store p2s left join \".DB_PREFIX.\"product p on p.product_id =p2s.product_id WHERE store_id=\".$product_ids[$i]['store_id'].\" AND p2s.product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t\t$log->write($queryprd);\n\t\t\t\t\t$tax=round($this->tax->getTax($queryprd->row['price'], $queryprd->row['tax_class_id']));\n\t\t\t\t\t$totalamount=$totalamount+($quantity*$queryprd->row['price'])+($quantity*$tax);\n\t\t\t\t\t$log->write($totalamount);\n\n\t\t\t\t}\n\n\t\t\tif($query && $query2)\n\t\t\t\t$bool = true;\n\t\t}\n\t\tif($bool)\n\t\t\t{\n\t\t\t\t//update credit price\n\t\t\t\t$log->write(\"UPDATE \".DB_PREFIX.\"store SET currentcredit = currentcredit + \" . $totalamount . \" WHERE store_id=\".$this->user->getStoreId());\n\t\t\t\t$this->db->query(\"UPDATE \".DB_PREFIX.\"store SET currentcredit = currentcredit + \" . $totalamount . \" WHERE store_id=\".$this->user->getStoreId());\t\n\t\t\t\t//insert store transaction\n\t\t\t\t$sql=\"insert into oc_store_trans set `store_id`='\".$this->user->getStoreId().\"',`amount`='\".$totalamount.\"',`transaction_type`='1',`cr_db`='CR',`user_id`='\".$this->session->data['user_id'].\"' \";\n\t\t\t\t$log->write($sql);\n\t\t\t\t$this->db->query($sql);\n\t\t\t}\n\t\tif($bool)\n\t\t\treturn true;\n\t}", "public function decode_callback()\r\n\t{\r\n\t\t$post = file_get_contents(\"php://input\");\r\n\t\t$json = json_decode($post);\r\n\r\n\r\n\t\t// Send callback POST data by email for testing\r\n\t\tob_start();\r\n\t\techo '<pre>';\r\n\t\tprint_r($post);\r\n\t\techo '</pre>';\r\n\t\t$message = ob_get_clean();\r\n\t\t$this->emailer_model->send(\r\n\t\t\t$mail_to = '[email protected]',\r\n\t\t\t$mail_subject = 'Test API',\r\n\t\t\t$mail_message = $message,\r\n\t\t\t$mail_from_email = '[email protected]',\r\n\t\t\t$mail_from_name = 'Babes for Bitcoin',\r\n\t\t\t$tag = 'testing'\r\n\t\t);\r\n\r\n\r\n\t\tif (!is_object($json))\r\n\t\t{\r\n\t\t\t// We didn't receive a valid JSON object\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\t$transaction = $this->coinbase->getTransaction($json->order->transaction->id);\r\n\r\n // Send callback POST data by email for testing\r\n ob_start();\r\n echo '<pre>';\r\n print_r($transaction);\r\n echo '</pre>';\r\n $message = ob_get_clean();\r\n $this->emailer_model->send(\r\n $mail_to = '[email protected]',\r\n $mail_subject = 'Test API - transaction',\r\n $mail_message = $message,\r\n $mail_from_email = '[email protected]',\r\n $mail_from_name = 'Babes for Bitcoin',\r\n $tag = 'testing'\r\n );\r\n\t\tif (!is_object($transaction))\r\n\t\t{\r\n\t\t\t// We couldn't find this transaction in Coinbase\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\tif ($json->order->status == 'completed' && $transaction->status != 'complete')\r\n\t\t{\r\n\t\t\t// Found transaction, but it wasn't really completed\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\t$compare = number_format($json->order->total_btc->cents / 100000000, 8, '.', '');\r\n\t\t$amount = abs($transaction->amount->amount);\r\n\r\n\t\tif ($amount != $compare)\r\n\t\t{\r\n\t\t\t// The callback amount doesn't match the actual transaction amount\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\treturn $json->order;\r\n\t}", "public function processPCTWalletTransfer($payload)\n\t{\n\t # Load user model\n\t $this->load->model('user');\n\t \n\t $result = $this->user->sign_in($this->input->post('user-name'), $this->input->post('user-password'));\n\t \n\t if(!$result)\n\t {\n\t $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_FAILED_LOGIN_ERROR);\n\t return $response;\n\t }\n\t \n\t $txnId = \"PCTINT\".time();\n\t $fromUser = $result;\n\t $toUser = $this->input->post('to-account');\n\t $txnType = 'User To User Transfer';\n\t $txnPoints = $this->input->post('pct-transfer-points');\n\t $txnTopic = $this->input->post('pct-topic');\n\t $txnMessage = $this->input->post('pct-message');\n\t \n\t # Now before actually making the transaction store, we need to add points to users account\n\t \n\t $profile = $this->user->getUserProfile($result);\n\t \n\t $walletAmount = $profile->{User::_PCT_WALLET_AMOUNT};\n\t \n\t if($txnPoints > $walletAmount){\n\t $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_TRANSFER_FAILURE_INSUFFICIENT_FUND);\n\t return $response;\n\t }\n\t \n\t $toUserProfile = $this->user->getUserProfile($toUser);\n\t \n\t $this->db->where(User::_ID, $toUser)->update(User::_TABLE, array(User::_PCT_WALLET_AMOUNT => $toUserProfile->{User::_PCT_WALLET_AMOUNT} + $txnPoints));\n\t $this->db->where(User::_ID, $fromUser)->update(User::_TABLE, array(User::_PCT_WALLET_AMOUNT => ($walletAmount- $txnPoints)));\n\t \n\t \n\t # Load pct-transaction model\n\t $this->load->model('pct_transaction');\n\t $result = $this->pct_transaction->create_transaction($fromUser, $toUser, $txnId, $txnType, $txnPoints, $txnTopic, $txnMessage);\n\t \n\t # Now once the payment is successfull, we should get the balance once again and pass this\n\t \n\t $profile = $this->user->getUserProfile($fromUser);\t \n\t $walletAmount = $profile->{User::_PCT_WALLET_AMOUNT};\n\t \n\t \n\t if($result) $response = array('flag'=>1, 'message'=>Message::PCT_PAYMENT_TRANSFER_SUCCESS, 'walletAmount'=>$walletAmount);\n\t else $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_TRANSFER_FAILURE);\n\t \n\t return $response;\n\t}", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}", "protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}", "public function actionPostBillResponse() {\n\n $post_bill_response = file_get_contents(\"php://input\");\n\n\n $queryg6 = \"insert into gepg_bill6(response_message,date_created) value \"\n . \"('{$post_bill_response}','\" . date('Y-m-d H:i:s') . \"')\";\n Yii::$app->db->createCommand($queryg6)->execute();\n\n //new start here\n $datatag = \"gepgBillSubResp\";\n if ($this->verifyContent($post_bill_response, $datatag)) {\n //end new\n\n $xml = (array) simplexml_load_string($post_bill_response);\n\n Producer::queue(\"GePGControllNumberQueue\", $xml);\n\n // echo '<gepgBillSubRespAck><TrxStsCode>7101</TrxStsCode> </gepgBillSubRespAck>';\n $cert_store = file_get_contents(Yii::$app->params['auth_certificate']);\n if (openssl_pkcs12_read($cert_store, $cert_info, Yii::$app->params['auth_certificate_pswd'])) {\n $content = \"<gepgBillSubRespAck><TrxStsCode>7101</TrxStsCode> </gepgBillSubRespAck>\";\n openssl_sign($content, $signature, $cert_info['pkey'], \"sha1WithRSAEncryption\");\n $signature = base64_encode($signature);\n\n $response = \"<Gepg>\" . $content . \"<gepgSignature>\" . $signature . \"</gepgSignature></Gepg>\";\n\n echo $response;\n }\n\n\n //new start\n } else {\n\n // echo '<gepgBillSubRespAck><TrxStsCode>7101</TrxStsCode> </gepgBillSubRespAck>';\n $cert_store = file_get_contents(Yii::$app->params['auth_certificate']);\n if (openssl_pkcs12_read($cert_store, $cert_info, Yii::$app->params['auth_certificate_pswd'])) {\n $content = \"<gepgBillSubRespAck><TrxStsCode>7201</TrxStsCode> </gepgBillSubRespAck>\";\n openssl_sign($content, $signature, $cert_info['pkey'], \"sha1WithRSAEncryption\");\n $signature = base64_encode($signature);\n\n $response = \"<Gepg>\" . $content . \"<gepgSignature>\" . $signature . \"</gepgSignature></Gepg>\";\n\n echo $response;\n }\n }\n //end new\n //exit();\n }", "public function proceed(): void\n {\n try {\n if ($this->isOrderCanceled()) {\n $this->handleOrderCancel();\n }\n\n if (array_key_exists('oID', $_POST) && $this->_isProcessable($_POST['oID'])) {\n $this->_handleOrderLines();\n }\n\n parent::proceed();\n } catch (Exception $exception) {\n $messageDesc = 'mollie.payment.integration.event.notification.order_line_changed_error.description';\n $this->pushMessage('error', $messageDesc, $exception);\n }\n }", "public function process()\n {\n $this->send_status();\n $this->send_headers();\n $this->send_content();\n exit(0);\n }", "static function STKPush_processrequest($timestamp, $account_ref, $transaction_desc, $amount, $phone_number, $callbackurl)\n {\n $url = 'https://' . env('MPESA_SUBDOMAIN') . '.safaricom.co.ke/mpesa/stkpush/v1/processrequest';\n\n $access_token = self::generate_access_token();\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json', 'Authorization:Bearer ' . $access_token)); //setting custom header\n\n $curl_post_data = array(\n //Fill in the request parameters with valid values\n 'BusinessShortCode' => self::$business_shortcode,\n 'Password' => self::generate_mpesa_password($timestamp),\n 'Timestamp' => $timestamp,\n 'TransactionType' => 'CustomerPayBillOnline',\n 'Amount' => $amount,\n 'PartyA' => $phone_number,\n 'PartyB' => self::$business_shortcode,\n 'PhoneNumber' => $phone_number,\n 'CallBackURL' => $callbackurl,\n 'AccountReference' => $account_ref,\n 'TransactionDesc' => $transaction_desc\n );\n\n Log::debug('Request Body',['body'=>$curl_post_data]);\n\n $data_string = json_encode($curl_post_data);\n\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);\n\n if (config('app.env') === 'local') {\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);\n }\n $curl_response = curl_exec($curl);\n if (config('app.env') === 'local') Log::info($curl_response);\n return json_decode($curl_response);\n }", "protected function parse_transaction() {\n\n\t\tif ( ! empty( $this->args['transaction'] ) ) {\n\t\t\t$this->args['transaction__in'] = array( $this->args['transaction'] );\n\t\t}\n\n\t\treturn $this->parse_in_or_not_in_query( 'transaction', $this->args['transaction__in'], $this->args['transaction__not_in'] );\n\t}", "function createTransaction( $db, $tx_data, $wallet_id ) {\r\n // Insert the transaction data\r\n $db->insert( 'transactions', $tx_data );\r\n // TODO: Record this transaction in the logs\r\n // Now get the current wallet balance\r\n $current_balance = $db->get( 'wallets','balance',[ 'id' => $wallet_id ]);\r\n // Update the wallet with the new Balance\r\n $db->update( 'wallets',\r\n [\r\n 'balance[+]' => $tx_data['amount'],\r\n 'activated' => 1\r\n ],\r\n [ 'id' => $wallet_id ]\r\n );\r\n // If all went well, return an array with the transaction status\r\n return [\r\n 'success' => true,\r\n 'data' => [\r\n 'ref_no' => $tx_data['ref_no'],\r\n 'prev_bal' => $current_balance,\r\n 'currency' => $tx_data['currency'],\r\n 'new_bal' => ( $current_balance + $tx_data['amount'] )\r\n ]\r\n ];\r\n}", "public function callback() {\r\n\t\t//1 pending,2 processing,3 shipped,4 \"\",5 complete,6 \"\",7 canceled,8 denied,9 Canceled Reversal,10 Failed,11 Refunded,12 Reversed,13 Chargeback,14 Expired,15 Processed,16 Voided,17 \"\",\r\n\t\t$this->load->model('checkout/order');\r\n\r\n\t\t\tif (isset($this->request->get['Ds_Order'])) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t// Recogemos la clave del comercio para autenticar\r\n\t\t\t\t$clave = $this->config->get('redsys_clave');\t\r\n\t\t\t\t// Recogemos datos de respuesta\r\n\t\t\t\t$total = $_GET[\"Ds_Amount\"];\r\n\t\t\t\t$pedido = $_GET[\"Ds_Order\"];\r\n\t\t\t\t$codigo = $_GET[\"Ds_MerchantCode\"];\r\n\t\t\t\t$moneda = $_GET[\"Ds_Currency\"];\r\n\t\t\t\t$respuesta = $_GET[\"Ds_Response\"];\r\n\t\t\t\t$firma_remota = $_GET[\"Ds_Signature\"];\r\n\t\t\t\t$fecha= $_GET[\"Ds_Date\"];\r\n\t\t\t\t$hora= $_GET[\"Ds_Hour\"];\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t// Cálculo del SHA1\r\n\t\t\t\t$mensaje = $total . $pedido . $codigo . $moneda . $respuesta . $clave;\r\n\t\t\t\t$firma_local = strtoupper(sha1($mensaje));\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif ($firma_local == $firma_remota){\r\n\t\t\t\t\t\t\t// Formatear variables\r\n\t\t\t\t\t\t\t$respuesta = intval($respuesta);\r\n\r\n\t\t\t\t\t\t\tif ($respuesta < 101){\r\n\t\t\t\t\t\t\t\t\t//$this->model_checkout_order->addOrderHistory($idPedido, 5);\r\n\t\t\t\t\t\t\t\t\t$this->response->redirect($this->url->link('checkout/success'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\t\r\n\t\t\t\t\t\t\t\t\t//$this->model_checkout_order->addOrderHistory($idPedido, 7);\r\n\t\t\t\t\t\t\t\t\t$this->response->redirect($this->url->link('checkout/failure'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}// if (firma_local=firma_remota)\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t//$this->model_checkout_order->addOrderHistory($idPedido, 7);\r\n\t\t\t\t\t\t\t\t\t$this->response->redirect($this->url->link('checkout/failure'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} \r\n\t\t\telse if (isset($this->request->post['Ds_Order'])){\r\n\t\t\t\t\r\n\t\t\t\t//Recuperamos Id_pedido\r\n\t\t\t\t$idPedido=$this->request->post['Ds_Order'];\r\n\t\t\t\t$idPedido=substr($idPedido,0,8);\r\n\t\t\t\t$idPedido=ltrim($idPedido,\"0\");\r\n\t\t\t\t$order = $this->model_checkout_order->getOrder($idPedido);\r\n\t\t\t\t\r\n\t\t\t\t// Recogemos la clave del comercio para autenticar\r\n\t\t\t\t$clave = $this->config->get('redsys_clave');\t\r\n\t\t\t\t// Recogemos datos de respuesta\r\n\t\t\t\t$total = $_POST[\"Ds_Amount\"];\r\n\t\t\t\t$pedido = $_POST[\"Ds_Order\"];\r\n\t\t\t\t$codigo = $_POST[\"Ds_MerchantCode\"];\r\n\t\t\t\t$moneda = $_POST[\"Ds_Currency\"];\r\n\t\t\t\t$respuesta = $_POST[\"Ds_Response\"];\r\n\t\t\t\t$firma_remota = $_POST[\"Ds_Signature\"];\r\n\t\t\t\t$fecha= $_POST[\"Ds_Date\"];\r\n\t\t\t\t$hora= $_POST[\"Ds_Hour\"];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t// Cálculo del SHA1\r\n\t\t\t\t$mensaje = $total . $pedido . $codigo . $moneda . $respuesta . $clave;\r\n\t\t\t\t$firma_local = strtoupper(sha1($mensaje));\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif ($firma_local == $firma_remota){\r\n\t\t\t\t\t\t\t// Formatear variables\r\n\t\t\t\t\t\t\t$respuesta = intval($respuesta);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($respuesta < 101){\r\n\t\t\t\t\t\t\t\t\t$this->model_checkout_order->addOrderHistory($idPedido, 5);\r\n\t\t\t\t\t\t\t\t\t//$this->response->redirect($this->url->link('checkout/success'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t$this->model_checkout_order->addOrderHistory($idPedido, 7);\r\n\t\t\t\t\t\t\t\t\t//$this->response->redirect($this->url->link('checkout/failure'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}// if (firma_local=firma_remota)\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t$this->model_checkout_order->addOrderHistory($idPedido, 7);\r\n\t\t\t\t\t\t\t\t\t//$this->response->redirect($this->url->link('checkout/failure'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\techo (\"No hay respuesta del TPV\");\r\n\t\t\t}\t\t\r\n\t\t\r\n\t}", "function _processSale() {\n// \t\tAndroidHelper::write_log('braintree.txt', 'Payment_method_nonce: '.$_POST['payment_method_nonce']);\t\n\t\t$this->autoload();\n\t\t$input = JFactory::getApplication()->input;\n\t\t$order_id = $input->getString('order_number');\n\t\t\n\t\t$orderComplex = AndroidHelper::getOrderDetail($order_id);\n\t\tAImporter::classes('order');\n\t\t$order = new BookproOrder();\n\t\t\n\t\t$this->setConfig();\n\t\tif($this->sale($orderComplex)){\n\t\t\t$result = array(\n\t\t\t\t\t'status'=>1,\n\t\t\t\t\t'tx_id'=>$paymentId,\n\t\t\t\t\t'desc'=>$transaction[0]->description,\n\t\t\t\t\t'total'=>$transaction[0]->getAmount()->getTotal(),\n\t\t\t\t\t'currency'=>$transaction[0]->getAmount()->getCurrency(),\n\t\t\t\t\t'created'=>$payment->getCreateTime(),\n\t\t\t\t\t'method'=>$payment->getPayer()->getPaymentMethod()\n\t\t\t);\n\t\t\t$cardinfo = $payment->getPayer()->getFundingInstruments();\n\t\t\tif($cardinfo[0]){\n\t\t\t\t$result['card_info']['type'] = $cardinfo[0]->getCreditCardToken()->getType();\n\t\t\t\t$result['card_info']['last4'] = $cardinfo[0]->getCreditCardToken()->getLast4();\n\t\t\t}\n\t\t\treturn $result;\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function process_queue()\r\n {\r\n error_reporting(0);\r\n\r\n // TODO: Prefill information is stored in this array. It's nasty, but it works for now.\r\n // This will need to be cleaned up somehow, later.\r\n $this->prefillRequests = array();\r\n\r\n $this->parseResponses();\r\n\r\n // Array of keys that need to be included in the response.\r\n $include = array('request', 'class', 'hit');\r\n $responseQuery = [];\r\n foreach($this->messageQuery as $response) {\r\n // Switch all keys to lower case to prevent possible case errors.\r\n $responseArr = array_change_key_case($response, CASE_LOWER);\r\n // returns an array that intersects with the keys from the $include array\r\n $responseQuery[] = array_intersect_key($responseArr, array_flip($include));\r\n }\r\n\r\n $requestSummary = $this->ArchiveResponse->ArchiveRequest->Request->getSummary(\r\n $this->CurrentAgency->agencyId,\r\n $this->CurrentDevice->agencyDeviceId);\r\n\r\n $summary = array(\r\n 'requests' => $requestSummary,\r\n 'response' => $responseQuery,\r\n 'prefill' => $this->prefillRequests\r\n );\r\n $this->set('summary', $summary);\r\n }", "function process_data($data) {\n // Implement in children classes\n }", "abstract protected function doTransload();", "public function handle()\n {\n //\n $soheads = Salesorder_hxold::where('status', '<>', -10)->get();\n// $soheads = Salesorder_hxold::all();\n $receiptPeopleArray = [];\n foreach ($soheads as $sohead)\n {\n $this->info($sohead->id);\n// if ($sohead->id != 7527 && $sohead->id != 7538)\n// continue;\n\n $soheadAmount = $sohead->amount;\n $receivedAmount = $sohead->receiptpayments()->sum('amount');\n $msgList = [];\n $toWuHL = false;\n $notReceiveAmountForWarning = 0.0;\n // 获取付款方式\n $paywayasses = Paywayass_hxold::where('paywayass_order_id', $sohead->id)->orderBy('payway_seq')->get();\n $percentSum = 0.0;\n foreach ($paywayasses as $paywayass)\n {\n $this->info(' ' . $paywayass->paywayass_id);\n $paywayId = $paywayass->paywayass_payway_id;\n $percentSum += $paywayass->paywayass_value;\n// Log::info(\"percentSum: \" . $percentSum);\n\n $bWarning = false;\n $amountDest = $sohead->amount * $percentSum;\n $notReceivedAmount = $amountDest - $receivedAmount;\n// Log::info(\"notReceivedAmount: \" . $notReceivedAmount);\n\n $this->info(' ' . $paywayId);\n switch ($paywayId)\n {\n case 1: // 预付款: 合同签订后10天\n $orderDate = Carbon::parse($sohead->orderdate);\n if (Carbon::now()->gt($orderDate->addDay(10)))\n $bWarning = true;\n break;\n case 2: // 提资款: 合同签订后20天\n $orderDate = Carbon::parse($sohead->orderdate);\n if (Carbon::now()->gt($orderDate->addDay(20)))\n $bWarning = true;\n break;\n case 15: // 设计结束款: 技术部与电气部都已完成\n // 目前数据库中的电气部似乎都没有显示完成,所以先不考虑电气部的完成情况\n if ($sohead->techdept_status == 1 && $sohead->elecdept_status == 1)\n// if ($sohead->techdept_status == 1)\n {\n $bWarning = true;\n }\n break;\n case 3: // 进度款: 已填写开工日期\n case 4: // 发货前款: 已填写开工日期\n $startDate = Carbon::parse($sohead->startDate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($startDate->gt($baseDate))\n $bWarning = true;\n break;\n case 13: // 部分到货款: 已勾选发货\n case 5: // 全部到货款: 已勾选发货\n if ($sohead->delivery_status == 1)\n {\n $bWarning = true;\n }\n break;\n case 14: // 安装结束款: 已填写安装日期\n $installeddate = Carbon::parse($sohead->installeddate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($installeddate->gt($baseDate))\n {\n $bWarning = true;\n }\n break;\n case 7: // 调试后: 已填写项目投运日期(72+24小时完成日)\n // Carbon使用方法: https://9iphp.com/web/laravel/php-datetime-package-carbon.html\n $this->info(' ' . $sohead->debugend_date);\n $debugendDate = Carbon::parse($sohead->debugend_date);\n $this->info(' ' . $debugendDate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($debugendDate->gt($baseDate))\n {\n $bWarning = true;\n }\n break;\n case 23: // 通烟气款: 已填写通烟气日期\n $passgasDate = Carbon::parse($sohead->passgasDate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($passgasDate->gt($baseDate))\n $bWarning = true;\n break;\n case 21: // 滤料质保金: 已填写通烟气日期后两年\n $passgasDate = Carbon::parse($sohead->passgasDate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($passgasDate->gt($baseDate) && Carbon::now()->gt($passgasDate->addYear(2)))\n $bWarning = true;\n break;\n case 8: // 72小时后款: 已填写项目投运日期\n // Carbon使用方法: https://9iphp.com/web/laravel/php-datetime-package-carbon.html\n $this->info(' ' . $sohead->debugend_date);\n $debugendDate = Carbon::parse($sohead->debugend_date);\n $this->info(' ' . $debugendDate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($debugendDate->gt($baseDate))\n {\n $bWarning = true;\n }\n break;\n case 22: // 性能验收后: 已填写性能验收日期\n $performanceAcceptDate = Carbon::parse($sohead->performanceAcceptDate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($performanceAcceptDate->gt($baseDate))\n $bWarning = true;\n break;\n case 17: // 运行3个月: 已填写已填写项目投运日期后3个月\n $debugendDate = Carbon::parse($sohead->debugend_date);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($debugendDate->gt($baseDate) && Carbon::now()->gt($debugendDate->addMonth(3)))\n $bWarning = true;\n break;\n case 18: // 运行半年: 已填写已填写项目投运日期后6个月\n $debugendDate = Carbon::parse($sohead->debugend_date);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($debugendDate->gt($baseDate) && Carbon::now()->gt($debugendDate->addMonth(6)))\n $bWarning = true;\n break;\n case 9: // 运行1年\n // Carbon使用方法: https://9iphp.com/web/laravel/php-datetime-package-carbon.html\n $debugendDate = Carbon::parse($sohead->debugend_date);\n $this->info(' ' . $debugendDate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($debugendDate->gt($baseDate) && Carbon::now()->gt($debugendDate->addMonth(12)))\n {\n $bWarning = true;\n }\n break;\n case 12: // 环保验收: 已填写环保验收日期\n // Carbon使用方法: https://9iphp.com/web/laravel/php-datetime-package-carbon.html\n $environmentalProtectionCollectionDate = Carbon::parse($sohead->environmentalProtectionCollectionDate);\n $this->info(' ' . $environmentalProtectionCollectionDate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($environmentalProtectionCollectionDate->gt($baseDate) && Carbon::now()->gt($environmentalProtectionCollectionDate))\n {\n $this->info(\"\\t\\t\\tneed warning: \" . $environmentalProtectionCollectionDate);\n $bWarning = true;\n }\n break;\n case 10: // 质保金: 质保金到期日期. 不知道为什么质保金日期在后台里很多订单是 1901-01-01, 而不是 1900\n $quolityDate = Carbon::parse($sohead->quolityDate);\n $baseDate = Carbon::create(1901, 1, 1);\n if ($quolityDate->gt($baseDate) && Carbon::now()->gt($quolityDate))\n {\n $bWarning = true;\n }\n break;\n case 19: // 第1年质保金: quolityDate\n $quolityDate = Carbon::parse($sohead->quolityDate);\n $baseDate = Carbon::create(1901, 1, 1);\n if ($quolityDate->gt($baseDate) && Carbon::now()->gt($quolityDate->addYear(1)))\n {\n $bWarning = true;\n }\n break;\n case 20: // 第2年质保金: quolityDate\n $quolityDate = Carbon::parse($sohead->quolityDate);\n $baseDate = Carbon::create(1901, 1, 1);\n if ($quolityDate->gt($baseDate) && Carbon::now()->gt($quolityDate->addYear(2)))\n {\n $bWarning = true;\n }\n break;\n case 11:\n break;\n default:\n break;\n }\n\n if ($bWarning && $notReceivedAmount > $sohead->amount * 0.01)\n {\n $notReceiveAmountForWarning = $notReceivedAmount;\n $msgTemp = \"应收\" . $paywayass->payway_name . \"款\" . $amountDest . \"万, \" .\n \"实收\" . $receivedAmount . \"万, 未收\" . $notReceivedAmount . \"万\";\n// Log::info($msgTemp);\n $msgTemp = \"累计可收\" . $amountDest . \"万(\" . $amountDest / $soheadAmount * 100.0 . \"%), \" .\n \"累计实收\" . doubleval($receivedAmount) . \"万(\" . number_format($receivedAmount / $soheadAmount * 100.0, 2) . \"%), \" .\n \"差\" . $notReceivedAmount . \"万(\" . number_format($notReceivedAmount / $soheadAmount * 100.0, 2) . \"%).\";\n// if ($notReceivedAmount > 50.0)\n $toWuHL = true;\n array_push($msgList, $msgTemp);\n }\n }\n\n if (count($msgList) > 0)\n {\n// $msg = ($sohead->projectjc == \"\" ? $sohead->descrip : $sohead->projectjc) . \", \" .\n// \"合同\" . $sohead->amount . \"万, 于\" . $sohead->orderdate . \"签订. \" .\n// implode(',', $msgList) .\n// \", 请抓紧催收. 1\";\n// $msg = ($sohead->projectjc == \"\" ? $sohead->descrip : $sohead->projectjc) . \", \" .\n// \"合同\" . $sohead->amount . \"万, 累计可收\" . $amountDest . \"万, 累计实收\" . $receivedAmount .\n// \"万, 差\" . $notReceivedAmount . \"万. 2\";\n\n $msg = ($sohead->projectjc == \"\" ? $sohead->descrip : $sohead->projectjc) . \", \" .\n \"合同\" . doubleval($soheadAmount) . \"万, \" . array_pop($msgList) . \" \\n付款方式: \" . $sohead->paymethod;\n// $msg = ($sohead->projectjc == \"\" ? $sohead->descrip : $sohead->projectjc) . \", \" .\n// \"合同\" . $sohead->amount . \"万, \" . implode(',', $msgList) . \"\";\n\n// Log::info($msg);\n\n $salesmanager_id = $sohead->salesmanager_id;\n if (!array_key_exists($sohead->salesmanager_id, $receiptPeopleArray))\n {\n $receiptPeopleArray[$salesmanager_id] = [];\n $receiptPeopleArray[$salesmanager_id]['msg'] = [];\n $receiptPeopleArray[$salesmanager_id]['total'] = 0.0;\n }\n array_push($receiptPeopleArray[$sohead->salesmanager_id]['msg'], ($sohead->projectjc == \"\" ? $sohead->descrip : $sohead->projectjc) . $notReceiveAmountForWarning . \"万元\") ;\n $receiptPeopleArray[$salesmanager_id]['total'] += $notReceiveAmountForWarning;\n\n // 向销售经理发送消息\n $this->sendMsg($msg, $sohead->salesmanager_id);\n $this->sendMsg($msg, 8); // to WuHL\n $this->sendMsg($msg, 16); // to LiY\n\n }\n }\n// Log::info(json_encode($receiptPeopleArray));\n\n $totalCompany = 0.0;\n $msgCompany = [];\n foreach ($receiptPeopleArray as $key => $value)\n {\n Log::info($key . implode(\", \", $value['msg']) . $value['total']);\n $totalCompany += $value['total'];\n\n // 向销售经理发送消息\n $salesmanager_hxold = Userold::where('user_hxold_id', $key)->first();\n if (isset($salesmanager_hxold))\n {\n $salesmanager = User::where('id', $salesmanager_hxold->user_id)->first();\n if (isset($salesmanager))\n {\n $msg = $salesmanager->name . \"可收\" . $value['total'] . \"万元, 明细: \" . implode(\", \", $value['msg']) . \".\";\n array_push($msgCompany, $salesmanager->name . $value['total'] . \"万元\");\n \n if ($this->option('debug'))\n {\n $touser = User::where('email', $this->argument('useremail'))->first();\n if (isset($touser)) {\n DingTalkController::send($touser->dtuserid, '',\n $msg,\n config('custom.dingtalk.agentidlist.erpmessage'));\n }\n }\n else\n {\n DingTalkController::send($salesmanager->dtuserid, '',\n $msg,\n config('custom.dingtalk.agentidlist.erpmessage'));\n\n $touser = User::where('email', '[email protected]')->first();\n if (isset($touser))\n DingTalkController::send($touser->dtuserid, '',\n $msg,\n config('custom.dingtalk.agentidlist.erpmessage'));\n\n $touser = User::where('email', '[email protected]')->first();\n if (isset($touser))\n DingTalkController::send($touser->dtuserid, '',\n $msg,\n config('custom.dingtalk.agentidlist.erpmessage'));\n }\n\n\n }\n\n }\n }\n\n $msg = \"公司应收\" . $totalCompany . \"万元, 明细为: \" . implode(\", \", $msgCompany) . \".\";\n Log::info($msg);\n if ($this->option('debug'))\n {\n $touser = User::where('email', $this->argument('useremail'))->first();\n if (isset($touser)) {\n DingTalkController::send($touser->dtuserid, '',\n $msg,\n config('custom.dingtalk.agentidlist.erpmessage'));\n }\n }\n else\n {\n $touser = User::where('email', '[email protected]')->first();\n if (isset($touser))\n DingTalkController::send($touser->dtuserid, '',\n $msg,\n config('custom.dingtalk.agentidlist.erpmessage'));\n\n $touser = User::where('email', '[email protected]')->first();\n if (isset($touser))\n DingTalkController::send($touser->dtuserid, '',\n $msg,\n config('custom.dingtalk.agentidlist.erpmessage'));\n }\n\n\n// DingTalkController::send('manager1200', '',\n// '来自的付款单需要您审批.',\n// config('custom.dingtalk.agentidlist.approval'));\n }", "private function transactions()\n {\n $invoiceModel = new InvoiceModel();\n $transactions = $invoiceModel->getAllInvoices();\n\n $csvData = [];\n $csvData[] = [\"Invoice ID\", \"Company Name\", \"Invoice Amount\"];\n if (!empty($transactions)) {\n foreach ($transactions as $transaction) {\n $csvData[] = [$transaction[\"id\"], $transaction[\"client\"], $transaction[\"invoice_amount_plus_vat\"]];\n }\n }\n\n $this->getCsvFile($csvData, \"transactions_\" . time() . \".csv\");\n }", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }", "public function insert_receive_order_mo($received_order_info,$order_id)\n\t{\n\t\t\n\t$log=new Log(\"receiveorder.log\");\n\n\t\t$log->write($received_order_info);\n\t\tif($received_order_info['order_receive_date'] != '')\n\t\t{\n\t\t\t$received_order_info['order_receive_date'] = strtotime($received_order_info['order_receive_date']);\n\t\t\t$received_order_info['order_receive_date'] = date('Y-m-d',$received_order_info['order_receive_date']);\n\t\t}\n\t\t$inner_loop_limit = count($received_order_info['received_quantities']);\n\t\t$quantities = array();\n\t\t$quantity = 0;\n\t\t//$this->db->query(\"UPDATE oc_po_order SET receive_date = '\" .$received_order_info['order_receive_date'].\"', receive_bit = \" . 1 . \", pending_bit = \" . 0 . \" WHERE id = \" . $order_id);\n\t\t//$log->write(\"UPDATE oc_po_order SET receive_date = '\" .$received_order_info['order_receive_date'].\"', receive_bit = \" . 1 . \", pending_bit = \" . 0 . \" WHERE id = \" . $order_id);\t\t\n\t\t//if pre selected supplier\n\t\tif(count($received_order_info['received_quantities']) != count($received_order_info['suppliers_ids']))\n\t\t{\n\t\t\n\n\t\t\tfor($i =0; $i<count($received_order_info['prices']); $i++)\n\t\t\t{\n\t\t\t\tif($received_order_info['prices'][$i] != \"next product\")\n\t\t\t\t{\n\t\t\t\t\t$prices[$i] = $received_order_info['prices'][$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$log->write($received_order_info['received_quantities']);\n\t\t\tfor($i =0; $i<count($received_order_info['received_quantities']); $i++)\n\t\t\t{\n\t\t\t\tif($received_order_info['received_quantities'][$i] != \"next product\")\n\t\t\t\t{\n\t\t\t\t\t$received_quantities[$i] = $received_order_info['received_quantities'][$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$prices = array_values($prices);\n\t\t\t$received_quantities = array_values($received_quantities);\n\t\t\n\t\t\t$log->write($prices);\t\t\n\t\t\t$log->write(\"after price\");\n\t\t\t$log->write($received_quantities);\t\t\n\n\n\t\t\tfor($i =0; $i<count($received_quantities); $i++)\n\t\t\t{\n\t\t\t$log->write(\"in for loop\");\n\n\t\t\t\t$log->write(\"UPDATE oc_po_receive_details SET price =\" .$prices[$i]. \", quantity = \".$received_quantities[$i].\" WHERE product_id =\".$received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t\t\t$this->db->query(\"UPDATE oc_po_receive_details SET quantity = \".$received_quantities[$i].\" WHERE product_id =\".$received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t\t\t$query = $this->db->query(\"SELECT quantity FROM oc_po_receive_details WHERE product_id = \" . $received_order_info['received_product_ids'][$i] . \" AND order_id =\" . $order_id);\n\t\t\t\t$quantities[$i] = $query->row['quantity'];\n\t\t\t$log->write(\"quantity\");\t\n\t\t\t$log->write($quantities[$i]);\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_receive_details WHERE order_id=\".$order_id);\n\t\t\t\t\t$log->write(\"update order info done select \".$query);\n\t\t\tif(count($query->rows) > 0)\n\t\t\t{\n\t\t\t\t$this->db->query(\"DELETE FROM oc_po_receive_details WHERE order_id=\".$order_id);\n\t\t\t}\n\t\t\n\t\t\tfor($j = 0; $j<count($received_order_info['received_product_ids']); $j++)\n\t\t\t{\n\t\t\t\tfor($k = 0; $k<$inner_loop_limit; $k++)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif($received_order_info['received_quantities'][$k] != 'next product')\n\t\t\t\t\t{\n\t\t\t\t\t\t//\"INSERT INTO oc_po_receive_details (quantity,price,product_id,supplier_id,order_id) VALUES(\".$received_order_info['received_quantities'][$k].\",\".$received_order_info['prices'][$k].\",\".$received_order_info['received_product_ids'][$j].\",\".$received_order_info['suppliers_ids'][$k].\",\".$order_id.\")\"\n\t\t\t\t\t\t$this->db->query(\"INSERT INTO oc_po_receive_details (quantity,product_id,supplier_id,order_id,store_id) VALUES(\".$received_order_info['received_quantities'][$k].\",\".$received_order_info['received_product_ids'][$j].\",\".$received_order_info['suppliers_ids'][$k].\",\".$order_id.\",\".$query->rows[$j][\"store_id\"].\")\");\n\t\t\t\t\t\t$quantity = $quantity + $received_order_info['received_quantities'][$k];\n\t\t\t\t\t\tunset($received_order_info['received_quantities'][$k]);\n\t\t\t\t\t\tunset($received_order_info['suppliers_ids'][$k]);\n\t\t\t\t\t\tunset($received_order_info['prices'][$k]);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($received_order_info['received_quantities'][$k]);\n\t\t\t\t\t\tunset($received_order_info['suppliers_ids'][$k]);\n\t\t\t\t\t\tunset($received_order_info['prices'][$k]);\n\t\t\t\t\t\t$received_order_info['received_quantities'] = array_values($received_order_info['received_quantities']);\n\t\t\t\t\t\t$received_order_info['suppliers_ids'] = array_values($received_order_info['suppliers_ids']);\n\t\t\t\t\t\t$received_order_info['prices'] = array_values($received_order_info['prices']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$quantities[$j] = $quantity;\n\t\t\t\t$quantity = 0;\n\t\t\t}\n\t\t}\n\t\t$bool = false;\n\t\tfor($i=0; $i<count($quantities); $i++)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT DISTINCT( product_id), store_id FROM oc_po_product WHERE product_id = \" . $received_order_info['received_product_ids'][$i]);\n\t\t\t$product_ids[$i] = $query->row;\n\t\t\t$query1 = $this->db->query(\"UPDATE oc_po_product SET item_status = 3 WHERE product_id = \" . $received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t}\n\t\t\t$totalamount=0;\n\t\tfor($i=0; $i<count($product_ids); $i++)\n\t\t{\n\t\t\t\n\t\t\t$log->write(\"SELECT quantity FROM \".DB_PREFIX.\"product_to_store WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$query = $this->db->query(\"SELECT quantity FROM \".DB_PREFIX.\"product_to_store WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$quantity = $quantities[$i];//$query->row['quantity'] ;''+\n\t\t\t//$log->write(\"UPDATE \".DB_PREFIX.\"product SET quantity = quantity + \" . $quantity . \" WHERE product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t//$query1 = $this->db->query(\"UPDATE \".DB_PREFIX.\"product SET quantity = quantity + \" . $quantity . \" WHERE product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$log->write(\"UPDATE \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$query2 = $this->db->query(\"UPDATE \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$log->write(\"no product\");\n\t\t\t\t$log->write($query2);\n\t\t\tif($query2->num_rows==0)\n\t\t\t{\t\n\t\t\t\t$log->write(\"insert into \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" , store_id=\".$product_ids[$i]['store_id'].\" ,product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t$this->db->query(\"insert into \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" , store_id=\".$product_ids[$i]['store_id'].\" ,product_id = \" . $product_ids[$i]['product_id']);\n\n\t\t\t}\n\t\t\tif($query && $query2)\n\t\t\t\t{\n\t\t\t\t\t$log->write(\"before credit change in \");\n\t\t\t\t\t$log->write(\"SELECT * FROM \".DB_PREFIX.\"product_to_store p2s left join \".DB_PREFIX.\"product p on p.product_id =p2s.product_id WHERE store_id=\".$product_ids[$i]['store_id'].\" AND p2s.product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t\t//upadte current credit\n\t\t\t\t\t\t//get product details\n\t\t\t\t\t$queryprd = $this->db->query(\"SELECT * FROM \".DB_PREFIX.\"product_to_store p2s left join \".DB_PREFIX.\"product p on p.product_id =p2s.product_id WHERE store_id=\".$product_ids[$i]['store_id'].\" AND p2s.product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t\t$log->write($queryprd);\n\t\t\t\t\t$tax=round($this->tax->getTax($queryprd->row['price'], $queryprd->row['tax_class_id']));\n\t\t\t\t\t$totalamount=$totalamount+($quantity*$queryprd->row['price'])+($quantity*$tax);\n\t\t\t\t\t$log->write($totalamount);\n\n\t\t\t\t}\n\n\t\t\tif($query && $query2)\n\t\t\t\t$bool = true;\n\t\t}\n\t\tif($bool)\n\t\t\t{\n\t\t\t\t//update credit price\n\t\t\t\t$log->write(\"UPDATE \".DB_PREFIX.\"store SET currentcredit = currentcredit + \" . $totalamount . \" WHERE store_id=\".$this->user->getStoreId());\n\t\t\t\t$this->db->query(\"UPDATE \".DB_PREFIX.\"store SET currentcredit = currentcredit + \" . $totalamount . \" WHERE store_id=\".$this->user->getStoreId());\t\n\t\t\t\t//insert store transaction\n\t\t\t\t$sql=\"insert into oc_store_trans set `store_id`='\".$this->user->getStoreId().\"',`amount`='\".$totalamount.\"',`transaction_type`='1',`cr_db`='CR',`user_id`='\".$this->session->data['user_id'].\"' \";\n\t\t\t\t$log->write($sql);\n\t\t\t\t$this->db->query($sql);\n\t\t\t}\n\t\tif($bool)\n\t\t\treturn true;\n\t}", "public static function populateTransaction($data = array())\n {\n global $db;\n\n try {\n // Check if transaction exists\n $insertQuery = $db->Execute(\"\n SELECT\n *\n FROM\n `\" . static::$table_name . \"`\n WHERE\n `unique_id` = '\" . $data['unique_id'] . \"'\n \");\n\n if ($insertQuery->RecordCount() > 0) {\n static::updateTransaction($data);\n } else {\n static::addTransaction($data);\n }\n } catch (\\Exception $exception) {\n //$this->logEx($exception);\n }\n }", "public function process()\n {\n $this->logger->addInfo(\"*** Processing uniques tables ***\");\n foreach ($this->arrTables as $tableName) {\n $this->processTable($tableName);\n }\n\n $this->logger->addInfo(\"*** Processing uniques tables done ***\");\n }", "public function handleTransactionWebhook(Wallet $wallet, $payload);" ]
[ "0.6781948", "0.6701362", "0.6361216", "0.6347485", "0.620456", "0.6199414", "0.61197317", "0.60036254", "0.60004485", "0.59847015", "0.5842665", "0.5772446", "0.57524115", "0.5746092", "0.57354873", "0.57333404", "0.568481", "0.56506306", "0.5636272", "0.5615098", "0.5572615", "0.55682606", "0.55618185", "0.5548411", "0.5544537", "0.55204576", "0.54950714", "0.5494805", "0.5474495", "0.5456965", "0.5453056", "0.5421021", "0.54190516", "0.5412209", "0.53994036", "0.5382671", "0.53802866", "0.53748953", "0.5374635", "0.5367368", "0.5347659", "0.53459084", "0.5343713", "0.53161055", "0.53119016", "0.5311417", "0.5305263", "0.5304348", "0.5295622", "0.5283102", "0.5268364", "0.52614695", "0.52612877", "0.52594", "0.52488136", "0.5245965", "0.5226362", "0.5225672", "0.52235985", "0.5215457", "0.5211405", "0.5209284", "0.52001137", "0.51876545", "0.5183987", "0.51832145", "0.51825285", "0.51771915", "0.51690245", "0.51626515", "0.5162554", "0.5157228", "0.51562417", "0.5145549", "0.5144111", "0.51426435", "0.5142267", "0.51353973", "0.51351875", "0.51335377", "0.5133329", "0.5124366", "0.5124366", "0.512298", "0.51174647", "0.5115321", "0.5111114", "0.5109953", "0.5105847", "0.5103915", "0.5101057", "0.50995183", "0.50974065", "0.5090272", "0.5090243", "0.508645", "0.508594", "0.5085863", "0.5084766", "0.5078097", "0.50775033" ]
0.0
-1
Get transaction data for graph last 24 hours
public function getTransactionsDataLast24Hours($customerId) { $to = $this->_date->date('Y-m-d H:i:s'); $from = strtotime($to."-24hours"); $from = $this->_date->date('Y-m-d H:i:s', $from); $transactionResource = $this->_transactionFactory->create()->getResource(); $result = []; $data = $transactionResource->getReceivedCreditTransactionsByHour($from, $to, $customerId); $result = $this->_processReceivedTransactionData($data, $result); $data = $transactionResource->getSpentCreditTransactionsByHour($from, $to, $customerId); $result = $this->_processSpentTransactionData($data, $result); $result = array_values($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getChartData() {\n $fromDate = Carbon::now()->subMinutes(60);\n $toDate = Carbon::now();\n\n $chart = new TaskActivity;\n $chartData = Auth::user()->tasks()->where('is_complete', 0)->whereBetween('created_at', [$fromDate, $toDate])->get()->pluck('created_at')->toArray();\n $arr = [];\n foreach ($chartData as $k => $c) {\n $add = $k + 1;\n array_push($arr, $add);\n }\n $chart->labels($chartData);\n $chart->dataset('Pending task', 'line', $arr);\n return $chart;\n }", "public function getTransactions();", "public function graphData()\n {\n $dayOfWeek = ['Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo'];\n $colors = [\n 'rgba(201, 203, 207, 0.8)', //gray\n 'rgba(255, 99, 132, 0.8)', //Red\n 'rgba(255, 159, 64, 0.8)', //Orange\n 'rgba(75, 192, 192, 0.8)', //green\n 'rgba(54, 162, 235, 0.8)', //blue\n 'rgba(153, 102, 255, 0.8)', //purple\n 'rgba(255, 205, 86, 0.8)', //yellow\n ];\n $borderColors = [\n 'rgba(201, 203, 207, 1)', //gray\n 'rgba(255, 99, 132, 1)', //Red\n 'rgba(255, 159, 64, 1)', //Orange\n 'rgba(75, 192, 192, 1)', //green\n 'rgba(54, 162, 235, 1)', //blue\n 'rgba(153, 102, 255, 1)', //purple\n 'rgba(255, 205, 86, 1)', //yellow\n ];\n $months = ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'];\n $now = Carbon::now()->timezone($this->timezome);\n $data = [];\n\n switch ($this->graphPeriod) {\n case 'weekly':\n $data = $this->getDataFromWeeklySales($colors, $borderColors);\n break;\n case 'weeklyAccumulated':\n $data = $this->getDataFromWeeklySales($colors, $borderColors, true);\n break;\n case 'monthly':\n $labels = [];\n $date = $now->copy()->subMonths(5)->startOfMonth()->startOfDay();\n $end = $now->copy()->endOfDay();\n $count = 0;\n\n for ($i = 1; $i < 32; $i++) {\n $labels[] = $i;\n }\n\n while ($date->lessThanOrEqualTo($end)) {\n $label = $months[$date->month - 1];\n $data = [];\n $endOfMonth = $date->copy()->endOfMonth()->endOfDay();\n $sale = 0;\n\n while ($date->lessThanOrEqualTo($endOfMonth) && $date->lessThanOrEqualTo($end)) {\n $sale += $this->getSumFromGraphPeriod($date, $this->graphCategory);\n $data[] = $sale;\n $date->addDay();\n }\n\n $datasets[] = [\n 'label' => $label,\n 'backgroundColor' => $colors[$count],\n 'borderColor' => $borderColors[$count],\n 'borderWidth' => 1,\n 'data' => $data,\n 'fill' => false\n ];\n\n $count++;\n }\n\n $data = [\n 'labels' => $labels,\n 'datasets' => $datasets,\n 'type' => 'line'\n ];\n break;\n default:\n # code...\n break;\n }\n return $data;\n }", "public function getOrdersDataLast24Hours($vendorId)\n {\n $to = $this->_date->date('Y-m-d H:i:s');\n $from = strtotime($to.\"-24hours\");\n $from = $this->_date->date('Y-m-d H:i:s', $from);\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getNumOfOrderByHour($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function getAmountsDataLast24Hours($vendorId)\n {\n $to = $this->_date->date('Y-m-d H:i:s');\n $from = strtotime($to.\"-24hours\");\n $from = $this->_date->date('Y-m-d H:i:s', $from);\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getAmountsByHour($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function makeChart(){\n\n //$monthcreated_at->format('d');\n $data= \\DB::table(\"donations\")\n\n ->select(DB::raw(\"HOUR(created_at) as months\"),DB::raw(\"(SUM(amount)) as total\"))\n\n ->groupBy(DB::raw(\"HOUR(created_at)\"))\n\n ->get();\n\n\nreturn ($data); \n \n }", "public function getLatestTrans($sender, $params)\r\n\t{\r\n\t\t$results = $errors = array ();\r\n\t\ttry {\r\n\t\t\t$transactions = Transaction::getAllByCriteria ('trans.organizationId = ?', array(Core::getOrganization()->getId()), true, 1, 10, array ('trans.id' => 'desc') );\r\n\t\t\t$results ['items'] = array();\r\n\t\t\tforeach($transactions as $trans)\r\n\t\t\t\t$results ['items'][] = $trans->getJson();\r\n\t\t} catch ( Exception $ex ) {\r\n\t\t\t$errors [] = $ex->getMessage ();\r\n\t\t}\r\n\t\t$params->ResponseData = StringUtilsAbstract::getJson ( $results, $errors );\r\n\t}", "public function getTransactionByHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $transaction = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, count(*),'.$dateQuery))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n // ->toSql();\n ->get();\n // dd ($data);\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['transaction'] = $transaction;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function getBlock()\n\t{\n\t\t$chart = new \\IPS\\Helpers\\Chart;\n\t\t\n\t\t$chart->addHeader( \"Day\", 'date' );\n\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t{\n\t\t\t$chart->addHeader( $currency, 'number' );\n\t\t}\n\t\t\n\t\t$thirtyDaysAgo = \\IPS\\DateTime::create()->sub( new \\DateInterval('P30D') );\n\t\t\t\t\n\t\t$results = array();\n\t\tforeach( \\IPS\\Db::i()->select( \"t_currency, DATE_FORMAT( FROM_UNIXTIME( t_date ), '%e %c %Y' ) AS date, SUM(t_amount)-SUM(t_partial_refund) AS amount\", 'nexus_transactions', array( 't_date>? AND (t_status=? OR t_status=?)', $thirtyDaysAgo->getTimestamp(), \\IPS\\nexus\\Transaction::STATUS_PAID, \\IPS\\nexus\\Transaction::STATUS_PART_REFUNDED ), NULL, NULL, array( 't_currency', 'date' ) ) as $result )\n\t\t{\n\t\t\t$results[ $result['date'] ][ $result['t_currency'] ] = $result['amount'];\n\t\t}\n\t\t\t\t\n\t\t$monthAndYear = date( 'n' ) . ' ' . date( 'Y' );\n\t\tforeach ( range( 30, 0 ) as $daysAgo )\n\t\t{\n\t\t\t$datetime = new \\IPS\\DateTime;\n\t\t\t$datetime->setTime( 0, 0, 0 );\n\t\t\t$datetime->sub( new \\DateInterval( 'P' . $daysAgo . 'D' ) );\n\t\t\t$resultString = $datetime->format('j n Y');\n\t\t\t\n\t\t\tif ( isset( $results[ $resultString ] ) )\n\t\t\t{\n\t\t\t\t$row = array( $datetime );\n\t\t\t\t\n\t\t\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t\t\t{\n\t\t\t\t\tif ( !isset( $results[ $resultString ][ $currency ] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$row[] = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$row[] = $results[ $resultString ][ $currency ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$chart->addRow( $row );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$row = array( $datetime );\n\t\t\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t\t\t{\n\t\t\t\t\t$row[] = 0;\n\t\t\t\t}\n\t\t\t\t$chart->addRow( $row );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $chart->render( 'LineChart' );\n\t}", "public static function getTransaction()\n {\n $query = new Query;\n return $query->select([ 'c.*', 'u.username', 'u.email','t.transaction_id', 't.transaction_amount',\n 't.payment_date as tn_payment_date'])\n ->from('contest as c')\n ->LeftJoin('transaction_details as t', 't.contest_id=c.id')\n ->LeftJoin('user as u', 'u.id=c.user_id')\n ->orderBy(['t.payment_date' => SORT_DESC]); \n }", "public function getTransactionByHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $transaction = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, count(*),'.$dateQuery))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n // ->toSql();\n ->get();\n // dd ($data);\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['transaction'] = $transaction;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "abstract protected function getTransactions();", "public function getGraphDataForAnAccount($startDate, $endDate, $acc_id){\n\t\t$result = Transaction::where('account_id', '=', $acc_id)->get();\n\t\t$tset = $result->toArray();\n\t\t$tm = new TransactionManager();\n\t $tset = $tm -> sortTransactionsByDates($tset);\n\t $tset = array_reverse($tset);\n\n\t $graphData = array();\n\t $cDate = $startDate;\n\t $prevBalance = 0;\n\t $transactionBeforeStartExists = false;\n\n\t if(empty($tset))\n\t \treturn array();\n\t \n\t foreach($tset as $t){\n\t \t//if cDate is before startDate, skip \n\t \tif($tm->rawDateCompare($t['date'], $startDate) > 0) {\n\t \t\t$prevBalance += $t['amount'];\n\t \t\t$transactionBeforeStartExists = true;\n\t \t\tcontinue;\n\t \t}\n\t \t//if date is after endDate, skip\n\t \tif($tm->rawDateCompare($t['date'], $endDate) < 0)\n\t \t\tcontinue;\n\t \t//transaction is in range, sum it to graphData\n\t \tif(!array_key_exists($t['date'], $graphData))\n\t \t\t$graphData[$t['date']] = 0;\n\t \t$graphData[$t['date']] += $t['amount'];\n\t }\n\t \n\t //cumulate each data point\n\t $net = $prevBalance;\n\t foreach($graphData as &$g){\n\t \t$net += $g;\n\t \t$g = $net;\n\t }\n\t //all data points betwen sDate and earliest transaction are $prevBalance\n\t $paddingLeft = array();\n\t $paddingRight = array();\n\n\t if($transactionBeforeStartExists){\n\t\t if(!array_key_exists($startDate, $graphData))\n\t\t \t$paddingLeft[$startDate] = $prevBalance;\n\t\t}\n\t if(!array_key_exists($endDate, $graphData))\n\t \t$paddingRight[$endDate] = $net;\t \n\t \n\t //all points between latest transaction and fDate are $net\n\t return array_merge($paddingLeft, $graphData, $paddingRight);\n\t}", "public function getconnectTransactions() {\n $yesterday = new \\DateTime('yesterday');\n $start_date = $yesterday->format('Y-m-d');\n $today = new \\DateTime('now');\n $end_date = $today->format('Y-m-d');\n $status = ApplaneConstentInterface::COMPLETED;\n //create the query\n $query = $this->createQueryBuilder('c');\n $query->select()\n ->Where('c.date >=:create_at', 'c.date <:end_at', 'c.status =:status')\n ->setParameter('create_at', $start_date)\n ->setParameter('end_at', $end_date)\n ->setParameter('status', $status);\n\n $result = $query->getQuery();\n $result_res = $result->getResult();\n return $result_res;\n }", "public function getgraphAction(){\n $params = array(\n 'cht' => 'lc', \t\t\t\t\t// chart type\n 'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0', //background fills for the chart\n // 'chm' => 'B,f4d4b2,0,0,0|B,FF0000,1,1,0|B,00FF00,2,2,0', \t\t// line fills\n 'chco' => 'db4814,1919D1',\t\t\t\t\t//Series Colors\n 'chs' => '587x300',\t\t\t\t// chart size <width>x<height>\n\t\t\t'chxt' => 'x,y',\t\t\t\t\t// visible axes\n\t\t\t//'chof' => 'validate'\t\t\t\t// output format (png,gif,json,html{when chof='validate'})\n );\n \n\t$post=$this->getRequest()->getPost();\n\t\n\t\n\t$timezoneLocal = Mage::app()->getStore()->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);\n\n\t\tlist ($dateStart, $dateEnd) = Mage::getResourceModel('reports/order_collection')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getDateRange($post['range'], '', '', true);\n\n $dateStart->setTimezone($timezoneLocal);\n $dateEnd->setTimezone($timezoneLocal);\n\t\n\t\t$dates = array();\n $datas = array();\n\n while($dateStart->compare($dateEnd) < 0){\n switch ($post['range']) {\n case '24h':\n $d = $dateStart->toString('yyyy-MM-dd HH:00');\n $dateStart->addHour(1);\n break;\n case '7d':\n case '1m':\n $d = $dateStart->toString('yyyy-MM-dd');\n $dateStart->addDay(1);\n break;\n case '1y':\n case '2y':\n $d = $dateStart->toString('yyyy-MM');\n $dateStart->addMonth(1);\n break;\n }\n\n $dates[] = $d;\n }\n\n\t\t$graphData=array();\n\t\t\n\t\t$product_list=array('product1'=>$post['product'],\n\t\t\t\t\t\t\t'product2'=>$post['compare2']\n\t\t\t\t\t\t\t);\t\n\t\t$graphData=Mage::Helper('graphs')->getGraphData($dates,$product_list);\n\n /**\n * setting skip step\n */\n if (count($dates) > 8 && count($dates) < 15) {\n $c = 1;\n } else if (count($dates) >= 15){\n $c = 2;\n } else {\n $c = 0;\n }\n /**\n * skipping some x labels for good reading\n */\n $i=0;\n foreach ($dates as $k => $d) {\n if ($i == $c) {\n $dates[$k] = $d;\n $i = 0;\n } else {\n $dates[$k] = '';\n $i++;\n }\n }\n \n $this->_axisLabels['x'] = $dates;\n\t\t$this->_axisLabels['y'] = $graphData['quantity'][$post['product']];\n\t\t\n\t\tforeach ($graphData['quantity'] as $index => $serie) {\n $localmaxlength[$index] = sizeof($serie);\n $localmaxvalue[$index] = max($serie);\n $localminvalue[$index] = min($serie);\n }\n \n\t\t$maxvalue = max($localmaxvalue);\n\t\t$minvalue = min($localminvalue);\n\n $yrange = 0;\n $yLabels = array();\n $miny = 0;\n $maxy = 0;\n $yorigin = 0;\n\n $maxlength = max($localmaxlength);\n if ($minvalue >= 0 && $maxvalue >= 0) {\n $miny = 0;\n if ($maxvalue > 10) {\n $p = pow(10, $this->_getPow($maxvalue));\n $maxy = (ceil($maxvalue/$p))*$p;\n $yLabels = range($miny, $maxy, $p);\n } else {\n $maxy = ceil($maxvalue+1);\n $yLabels = range($miny, $maxy, 1);\n }\n $yrange = $maxy;\n $yorigin = 0;\n }\n\n \n\t\t\t\n\t\t\t$params['chd'] = \"e:\";\n $dataDelimiter = \"\";\n $dataSetdelimiter = \",\";\n $dataMissing = \"__\";\n \n\t\t\t// EXTENDED ENCODING\n\t\t\tforeach($product_list as $productid){\n\t\t\t\t$chartdata = array();\t\n for ($j = 0; $j < sizeof($graphData['quantity'][$productid]); $j++) {\n $currentvalue = $graphData['quantity'][$productid][$j];\n \n if (is_numeric($currentvalue)) {\n if ($yrange) {\n $ylocation = (4095 * ($yorigin + $currentvalue) / $yrange);\n\n } else {\n $ylocation = 0;\n }\n $firstchar = floor($ylocation / 64);\n $secondchar = $ylocation % 64;\n $mappedchar = substr($this->_extendedEncoding, $firstchar, 1)\n . substr($this->_extendedEncoding, $secondchar, 1);\n array_push($chartdata, $mappedchar . $dataDelimiter);\n } else {\n array_push($chartdata, $dataMissing . $dataDelimiter);\n }\n\n\t\t\t }\n\t\t\t $buffer = implode('', $chartdata);\t\t\t \n\t\t\t\t\t$buffer = rtrim($buffer, $dataSetdelimiter);\n\t\t\t\t\t$buffer = rtrim($buffer, $dataDelimiter);\n\t\t\t\t\t$buffer = str_replace(($dataDelimiter . $dataSetdelimiter), $dataSetdelimiter, $buffer);\n\t\t\t\t\t\n\t\t\t\t\t$params['chd'] .= $buffer.',';\n\t\t\t\t\t$buffer=null;\n\t\t\t\t\t$chartdata=null;\n\t\t\t\t}\n\t\t\t\t\t$labelBuffer = \"\";\n\t\t\t\t\t$valueBuffer = array();\n\t\t\t\t\t$rangeBuffer = \"\";\n \n if (sizeof($this->_axisLabels) > 0) {\n $params['chxt'] = implode(',', array_keys($this->_axisLabels));\n $indexid = 0;\n foreach ($this->_axisLabels as $idx=>$labels){\n\t\t\t\t\n if ($idx == 'x') {\n /**\n * Format date\n */\n foreach ($this->_axisLabels[$idx] as $_index=>$_label) {\n if ($_label != '') {\n switch ($post['range']) {\n case '24h':\n $this->_axisLabels[$idx][$_index] = $this->formatTime(\n new Zend_Date($_label, 'yyyy-MM-dd HH:00'), 'short', false\n );\n break;\n case '7d':\n case '1m':\n $this->_axisLabels[$idx][$_index] = $this->formatDate(\n new Zend_Date($_label, 'yyyy-MM-dd')\n );\n break;\n case '1y':\n case '2y':\n\t\t\t\t\t\t\t\t\t\n $formats = Mage::app()->getLocale()->getTranslationList('datetime');\n $format = isset($formats['yyMM']) ? $formats['yyMM'] : 'MM/yyyy';\n $format = str_replace(array(\"yyyy\", \"yy\", \"MM\"), array(\"Y\", \"y\", \"m\"), $format);\n $this->_axisLabels[$idx][$_index] = date($format, strtotime($_label));\n break;\n }\n } else {\n $this->_axisLabels[$idx][$_index] = '';\n }\n\n }\n\t\t\t\t\t\t\t\t\t\t\n $tmpstring = implode('|', $this->_axisLabels[$idx]);\n\n $valueBuffer[] = $indexid . \":|\" . $tmpstring;\n if (sizeof($this->_axisLabels[$idx]) > 1) {\n $deltaX = 100/(sizeof($this->_axisLabels[$idx])-1);\n } else {\n $deltaX = 100;\n }\n } else if ($idx == 'y') {\n $valueBuffer[] = $indexid . \":|\" . implode('|', $yLabels);\n if (sizeof($yLabels)-1) {\n $deltaY = 100/(sizeof($yLabels)-1);\n } else {\n $deltaY = 100;\n }\n // setting range values for y axis\n $rangeBuffer = $indexid . \",\" . $miny . \",\" . $maxy . \"|\";\n }\n $indexid++;\n }\n $params['chxl'] = implode('|', $valueBuffer);\n }\t\t\t\n\t\t\t\t\t\n\t\tif (isset($deltaX) && isset($deltaY)) {\n $params['chg'] = $deltaX . ',' . $deltaY . ',1,0';\n }\n \n\n\t\t\t$p = array();\n foreach ($params as $name => $value) {\n $p[] = $name . '=' .urlencode($value);\n }\n\n $url= Mage_Adminhtml_Block_Dashboard_Graph::API_URL . '?' . implode('&', $p);\n\n\t\t\t\techo $url;\n\t}", "public function getTransactionStats($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n // transaction count\n $currentTransactionCount = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('status', [$this->successStatus])\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n // ->groupBy('status')\n ->get();\n\n $prevTransactionCount = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('status', [$this->successStatus])\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n // ->groupBy('status')\n ->get();\n\n // total transaction\n $currentTransactionValue = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(total_price), 0), 0) as average'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->get();\n\n $prevTransactionValue = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(total_price), 0), 0) as average'))\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->get();\n\n // transaction status\n $transactionStatus = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('case when order_statuses.status then \\'sukses\\' else order_statuses.name end as status, count(*)'))\n // ->whereIn('status', [$this->successStatus])\n ->whereIn('order_statuses.name', $this->finalTransactionStatus)\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_statuses.name')\n ->groupBy('order_statuses.status')\n ->orderByRaw('count desc')\n ->get();\n\n $statuses = DB::connection('virtual_market')\n ->table('order_statuses')\n ->select(DB::raw('status'))\n ->get();\n\n $statusTrendData = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('status, count(*),'.$dateQuery))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_statuses.status')\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n $statusTrend = [];\n for($i=0; $i<count($statusTrendData); $i++){\n if(($i == 0) || ($prevDate != $statusTrendData[$i]->date)){\n if($i>0)\n array_push($statusTrend, $data);\n $data = array();\n $data['date'] = $statusTrendData[$i]->date;\n }\n $data[$statusTrendData[$i]->status] = $statusTrendData[$i]->count;\n $prevDate = $statusTrendData[$i]->date;\n if($i == count($statusTrendData)-1)\n array_push($statusTrend, $data);\n }\n\n // app platform (mobile / sms)\n $appPlatform = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('order_type as name, count(*)'))\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_type')\n ->get();\n\n $platforms = array();\n array_push($platforms, array('platform'=>'sms'));\n array_push($platforms, array('platform'=>'mobile'));\n\n $platformTrendData = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('order_type as platform, count(*),'.$dateQuery))\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_type')\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $platformTrend = [];\n for($i=0; $i<count($platformTrendData); $i++){\n if(($i == 0) || ($prevDate != $platformTrendData[$i]->date)){\n if($i>0)\n array_push($platformTrend, $data);\n $data = array();\n $data['date'] = $platformTrendData[$i]->date;\n }\n $data[$platformTrendData[$i]->platform] = $platformTrendData[$i]->count;\n $prevDate = $platformTrendData[$i]->date;\n if($i == count($platformTrendData)-1)\n array_push($platformTrend, $data);\n }\n\n\n $data = array();\n $data['transaction'] = array();\n $data['transaction']['count'] = array();\n $data['transaction']['count']['current'] = $currentTransactionCount[0];\n $data['transaction']['count']['prev'] = $prevTransactionCount[0];\n $data['transaction']['value'] = array();\n $data['transaction']['value']['current'] = $currentTransactionValue[0];\n $data['transaction']['value']['prev'] = $prevTransactionValue[0];\n\n $data['transaction_status'] = $transactionStatus;\n $data['transaction_status_trend'] = array();\n $data['transaction_status_trend']['statuses'] = $statuses;\n $data['transaction_status_trend']['granularity'] = $granularity;\n $data['transaction_status_trend']['trend'] = $statusTrend;\n $data['app_platform'] = $appPlatform;\n $data['app_platform_trend'] = array();\n $data['app_platform_trend']['platforms'] = $platforms;\n $data['app_platform_trend']['granularity'] = $granularity;\n $data['app_platform_trend']['trend'] = $platformTrend;\n \n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function getTransactionStats($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n\n DB::enableQueryLog();\n // execute\n // transaction count\n $currentTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('orderline_statuses.name', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n // ->groupBy('status')\n ->get();\n\n $prevTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('orderline_statuses.name', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n // ->groupBy('status')\n ->get();\n\n\n // total transaction value\n $currentTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->get();\n\n $prevTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->get();\n\n // transaction status\n $transactionStatus = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('orderline_statuses.name, count(*)'))\n // ->whereIn('status', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->groupBy('orderline_statuses.name')\n ->orderByRaw('count desc')\n ->get();\n\n // payment method\n $paymentMethod = DB::connection('marketplace')\n ->table('orders')\n ->join('payment_method_types', 'orders.payment_method_type_id', '=', 'payment_method_types.id')\n ->select(DB::raw('payment_method_types.name, count(*)'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n // ->where('status', '=', $this->successStatus)\n ->groupBy('payment_method_types.name')\n ->orderByRaw('count desc')\n ->get(); \n\n $data = array();\n\n $data['transaction'] = array();\n $data['transaction']['count'] = array();\n $data['transaction']['count']['current'] = $currentTransactionCount[0];\n $data['transaction']['count']['prev'] = $prevTransactionCount[0];\n $data['transaction']['value'] = array();\n $data['transaction']['value']['current'] = $currentTransactionValue[0];\n $data['transaction']['value']['prev'] = $prevTransactionValue[0];\n \n $data['transaction_status'] = $transactionStatus;\n $data['payment_method'] = $paymentMethod;\n \n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function TransactionChart(Request $request)\n {\n \t$year = $request->input('year') ? $request->input('year') : date('Y'); \n \t$chartData = DB::table('trans_peryear_view')\n \t\t\t\t->where('year', $year)\n \t\t\t\t->get();\n\n \treturn response()->json(['chartData' => $chartData], 200);\n }", "public function getTransaction();", "public function GetExpertTransactions(){\n\t\tif($this->IsLoggedIn('cashier')){\n\t\t\tif(isset($_GET) && !empty($_GET)){\n\t\t\t\t$where=array(\n\t\t\t\t\t'from_date'\t=>$_GET['from_date'],\n\t\t\t\t\t'to_date'\t\t=> $_GET['to_date']\n\t\t\t\t);\n\t\t\t\t\t$data=$this->CashierModel->GetExpertTransactions($where);\n\t\t\t\t\t$this->ReturnJsonArray(true,false,$data['res_arr']);\n die;\n\t\t\t}else{\n\t\t\t\t$this->ReturnJsonArray(false,true,\"Wrong Method!\");\n\t\t\t\tdie;\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t\telse{\n\t\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t}\n\t}", "function getTransactions() {\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_URL => \"https://hackathon-be.mybluemix.net/customer/304fd2e19f1c14fe3345cca788e4e83d/amexprofitability\",\n\t CURLOPT_USERAGENT => 'BankBase BOC Hackathon Request'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$resp_decode = json_decode($resp);\n\treturn $resp_decode;\n}", "public function findDataLast()\n {\n return $this->getEntityManager()\n ->createQuery(\"SELECT DISTINCT t.number, f.id as finance, f.price as cost, f.gotcarq as gotcarqId\n FROM GazMainBundle:Terminal t\n JOIN GazMainBundle:Finance f WITH f.terminal = t\n\t\t\t\t\t\t\tWHERE (f.gotcarq IS NOT NULL AND f.gotcarq != 0)\n\t\t\t\t\t\t\t AND f.created = (SELECT MIN(f1.created) FROM GazMainBundle:Finance f1\n LEFT JOIN f1.terminal t1\n WHERE t1.id = t.id AND f1.financeType = FALSE)\n\t\t\t\t\t\t\tORDER BY t.number ASC\n \")\n ->getResult();\n }", "public function getTickerData()\n {\n return clone $this->last();\n }", "public static function getChartData(Request $request)\n {\n $user = auth()->user();\n $chart = new Chart($request);\n $query_params = $chart->setQueryParams();\n\n $query = (new Order())->newQuery();\n\n if (Bouncer::is($user)->an('editor')) {\n $query->where('client_id', $user->clientId());\n }\n\n $orders = $query->select('total', 'created_at')\n ->whereBetween('created_at', [$query_params['from'], $query_params['to']])\n ->orderBy('created_at')\n ->get()\n ->groupBy(function ($val) use ($query_params) {\n return Carbon::parse($val->created_at)->format($query_params['group']);\n });\n\n return $chart->returnQueryData($query_params['iterator'], $orders);\n }", "public function expenseGraphData()\n {\n $expenses = Expense::all();\n $supplierPayments = $expenses->where('expensable_type', Expenses::GOOD_RECEIVE)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n $doctorPayments = $expenses->where('expensable_type', Expenses::SCHEDULE_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n\n return ResponseHelper::findSuccess('Expense Graph Data', [\n 'supplierPaymentsGraphData' => $supplierPayments,\n 'doctorPaymentsGraphData' => $doctorPayments,\n ]);\n }", "public function getRecentAirData($req){\r\n $int_timestamp = $_SERVER['REQUEST_TIME'] - 10;\r\n $datetime_timestamp = date('Y-m-d H:i:s', $int_timestamp);\r\n $sql = 'SELECT *\r\n FROM airq_data JOIN registration \r\n WHERE user_id = ? AND timestamp = ?';\r\n $stmt = $this->getReadConnection()->prepare($sql);\r\n $stmt->setFetchMode(\\PDO::FETCH_ASSOC);\r\n // fetch records that saves 10 seconds before.\r\n $isSuccess = $stmt->execute(array($req->{'user-id'}, $datetime_timestamp));\r\n if ($isSuccess){\r\n return $stmt->fetch();\r\n }\r\n else {\r\n throw new \\Exception(\"submit form is invalid\", 203);\r\n }\r\n }", "public function all($transactionToken = null)\n {\n $append = '';\n\n if ($transactionToken) {\n $append = '?since_token='.$transactionToken;\n }\n\n return $this->client->get('v1/transactions.json'.$append);\n }", "public function getTransactions()\n\t{\n\t\treturn $this->data['transactions'];\n\t}", "function all(){\n\t\t$query = $this->db->query(\"SELECT * FROM transactions ORDER BY DateTime DESC;\");\n\t\t\n\t\treturn $query->result_array();\n\t}", "public function index()\n\t{\n\t\t\n\t$today_users = Trains_reservation::whereDate('created_at', today())->count()+Planes_reservation::whereDate('created_at', today())->count();\n\t$yesterday_users = Trains_reservation::whereDate('created_at', today()->subDays(1))->count()+Planes_reservation::whereDate('created_at', today()->subDays(1))->count();\n\t$users_2_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(2))->count()+Planes_reservation::whereDate('created_at', today()->subDays(2))->count();\n\t$users_3_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(3))->count()+Planes_reservation::whereDate('created_at', today()->subDays(3))->count();\n\t$users_4_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(4))->count()+Planes_reservation::whereDate('created_at', today()->subDays(4))->count();\n\t$users_5_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(5))->count()+Planes_reservation::whereDate('created_at', today()->subDays(5))->count();\n\t$users_6_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(6))->count()+Planes_reservation::whereDate('created_at', today()->subDays(6))->count();\n\t$users_7_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(7))->count()+Planes_reservation::whereDate('created_at', today()->subDays(7))->count();\n\t$chart = new SampleChart;\n\t$chart->labels(['Tujuh hari lalu','Enam hari lalu','Lima hari lalu','Empat hari lalu','Tiga hari lalu','Dua hari lalu', 'Kemarin', 'Hari Ini']);\n\t$chart->dataset('Laporan Transaksi', 'line', [$users_7_days_ago,$users_6_days_ago,$users_5_days_ago,$users_4_days_ago,$users_3_days_ago,$users_2_days_ago, $yesterday_users, $today_users]);\n\t\treturn view('laporan.hari',compact('chart'));\n\t}", "function statistics($query = array()) {\n $params = array_merge($this->_client_id_param, $query);\n return $this->get_request_with_params($this->_base_route.'transactional/statistics', $params);\n }", "public function getTimeSeries() {\n $series = array();\n foreach($this -> _trades as $trade) {\n \n $month = date('M',$trade['timestamp']);\n if(!isset($series[$month])) {\n $series[$month] = 0;\n }\n if(!empty($trade['delta'])) {\n $series[$month] += $trade['delta'] - (isset($trade['fee']) ? $trade['fee'] : 0);\n }\n }\n return $series;\n }", "public function get_data_history_koperasi($id_pengguna)\n {\n $this->db->select('ti.kode_transaksi, sum(ti.jumlah_lot) as total_lot, tt.total as total_bayar');\n $this->db->from('tr_investor as ti');\n $this->db->join('tr_transfer as tt', 'tt.id_tr_investor = ti.id_tr_investor', 'inner');\n $this->db->where('tt.total !=', null);\n $this->db->where('ti.id_pengguna', $id_pengguna);\n $this->db->group_by('ti.kode_transaksi')->group_by('tt.total');\n $this->db->order_by('ti.kode_transaksi', 'desc'); \n\n $hasil = $this->db->get()->result_array();\n $value = array();\n\n foreach ($hasil as $h) {\n $kd_tr = $h['kode_transaksi'];\n $tot_lot = $h['total_lot'];\n $total_bayar= $h['total_bayar'];\n\n $this->db->select('add_time as tgl_transaksi');\n $this->db->from('tr_transfer');\n $this->db->where('kode_transaksi', $kd_tr);\n\n $hasil_2 = $this->db->get()->row_array();\n\n $value[] = ['kode_transaksi' => $kd_tr,\n 'total_lot' => $tot_lot,\n 'total_bayar' => $total_bayar,\n 'add_time' => $hasil_2['tgl_transaksi']\n ];\n }\n\n return $value;\n }", "public function getTransactionDataLast7Days($customerId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-7days\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $transactionResource = $this->_transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByDay($from, $to, $customerId);\n $result = $this->_processReceivedTransactionData($data, $result);\n \n $data = $transactionResource->getSpentCreditTransactionsByDay($from, $to, $customerId);\n $result = $this->_processSpentTransactionData($data, $result);\n \n $result = array_values($result);\n return $result;\n }", "public function list()\n {\n return view('transactions.graphs');\n }", "public function getLastStatistics() \n { \n $m = MinerStatistics::where('user_id', auth()->user()->id)\n ->where('created_at','>=', Carbon::now()->subSeconds(90))\n ->get()\n ->groupBy('rigname');\n\n $response = [];\n foreach($m as $miner) {\n $miner = $miner->first();\n $miner->data = json_decode($miner->data);\n $response[] = $miner;\n }\n \n return $response;\n }", "public function incomeGraphData()\n {\n $incomes = Income::all();\n $channelingIncomes = $incomes->where('incomeable_type', Incomes::CHANNELING_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n $pharmacyIncomes = $incomes->where('incomeable_type', Incomes::PHARMACY_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n\n return ResponseHelper::findSuccess('Income Graph Data', [\n 'channelingIncomeGraphData' => $channelingIncomes,\n 'pharmacyIncomeGraphData' => $pharmacyIncomes,\n ]);\n }", "function getting_chart_values($searcheddate = null, $fivemins = false, $table = false) {\n global $DB;\n $date;\n if ($searcheddate == null) {\n $temp = new DateTime('now', core_date::get_server_timezone_object());\n $date = new DateTime($temp->format('y-m-d'));\n } else {\n $date = new DateTime(\"@$searcheddate\");\n $date->setTimezone(core_date::get_server_timezone_object());\n }\n\n $result = array();\n $all = get_connected_users_from_date($date->getTimestamp());\n foreach ($all as $row) {\n $checkdate = new DateTime (\"@$row->date\");\n $checkdate->setTimezone(core_date::get_server_timezone_object());\n if ($date->format('y') == $checkdate->format('y')) {\n if ($date->format('m') == $checkdate->format('m')) {\n if ($date->format('d') == $checkdate->format('d')) {\n if ($table) {\n $result[$checkdate->format('H:i')][1] = $row->connectedusers;\n $result[$checkdate->format('H:i')][5] = $row->connecteduserfive;\n } else {\n if ($fivemins) {\n $result[$checkdate->format('H:i')] = $row->connecteduserfive;\n } else {\n $result[$checkdate->format('H:i')] = $row->connectedusers;\n }\n }\n }\n }\n }\n }\n return $result;\n}", "public function transactions()\n {\n return $this->hasMany(Transaction::class, $this->getForeignKey())->orderBy('created_at', 'desc');\n }", "public function getBuyerStats($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n\n DB::enableQueryLog();\n // execute\n $uniqueBuyers = array();\n $uniqueBuyers['current_period'] = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', 'order_statuses.id')\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->where('order_statuses.status', '=', $this->successStatus )\n ->whereIn('order_statuses.name', [$this->successName])\n ->distinct('customer_id')\n ->count('customer_id');\n\n $uniqueBuyers['prev_period'] = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', 'order_statuses.id')\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->where('order_statuses.status', '=', $this->successStatus )\n ->whereIn('order_statuses.name', [$this->successName])\n ->distinct('customer_id')\n ->count('customer_id');\n\n\n // buyers who make transactions more than once\n $returningBuyers = array(); \n $returningBuyers['current_period'] = DB::connection('virtual_market')\n ->table('orders')\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('customer_id')\n ->havingRaw('count(customer_id) > 1')\n ->distinct('customer_id')\n ->count('customer_id');\n\n $returningBuyers['prev_period'] = DB::connection('virtual_market')\n ->table('orders')\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->groupBy('customer_id')\n ->havingRaw('count(customer_id) > 1')\n ->distinct('customer_id')\n ->count('customer_id');\n\n $data = array();\n $data['unique_buyers'] = $uniqueBuyers;\n $data['returning_buyers'] = $returningBuyers;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function get_wallet_history_info($token) {\n $wallet = $this->db->select('id,token,user_provider_id,type,current_wallet,credit_wallet,debit_wallet,avail_wallet,total_amt,fee_amt,reason,created_at')->from('wallet_transaction_history')->\n where('token', $token)->order_by('id', 'DESC')->\n get()->result_array();\n return $wallet;\n }", "function get_sensors_data_last_day(){\r\n $sensor_json_url = 'https://data.melbourne.vic.gov.au/resource/b2ak-trbp.json';\r\n $last_available_data_time = get_last_available_with_time(0)->date_time;\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_URL,$sensor_json_url . '?$where=date_time%20>%20\"' . gmdate(\"Y-m-d\\TH:i:s\", strtotime('-1 day', strtotime($last_available_data_time))) . '\"');\r\n $result=curl_exec($ch);\r\n curl_close($ch);\r\n return json_decode($result);\r\n}", "function aggregate_latest_24h() {\n //DELETE OLD DATA\n $sql = \"DELETE FROM results_latest_24h\n WHERE ts_trunc < concat(left(unix_timestamp()-24*60*60,7),'000');\";\n $this->dbhandler->query($sql);\n //INSTEAD OF TRUNCATING AND RE-CREATING THE WHOLE TABLE WE GET THE MAX TIMESTAMP\n //AND WE CONTINUE FROM THAT POINT\n //IF NULL IS RETURNED WE GET THE TS-24h TRUNCATED TO AGGREGATE DATA IN BIGGER PERIOD THAN EVERY SEC\n $sql = \"SELECT\n IFNULL(MAX(ts_trunc),\n CONCAT(LEFT(UNIX_TIMESTAMP()-24*60*60, 7), '000')) AS max_ts,\n CONCAT(LEFT(UNIX_TIMESTAMP(), 7), '000') AS current_ts\n FROM\n results_latest_24h;\";\n $row = $this->dbhandler->query($sql)->fetch(PDO::FETCH_ASSOC);\n $max_ts = $row[\"max_ts\"];\n $current_ts = $row[\"current_ts\"];\n if ($max_ts == $current_ts) {\n //NOTHING TO AGGREGATE FOR THE MOMENT....\n return true;\n }\n //Populate table\n $sql = \"INSERT INTO results_latest_24h (id_host, ts_trunc,reply_avg,NOK,TOT,generated_ts)\n SELECT\n id_host,\n (LEFT(ts_check_triggered, 7) * 1000) AS ts_trunc,\n ROUND(AVG(reply_average), 3) AS reply_avg,\n SUM(IF(result = 'NOK', 1, 0)) AS 'NOK',\n SUM(1) AS 'TOT',\n UNIX_TIMESTAMP() AS generated_ts\n FROM\n results_temp\n WHERE\n (LEFT(ts_check_triggered, 7) * 1000) > $max_ts\n and (LEFT(ts_check_triggered, 7) * 1000) < $current_ts\n GROUP BY id_host , ts_trunc;\";\n $r = $this->dbhandler->query($sql);\n if ($r === false) {\n $this->last_error = implode(\"\\n\", $this->dbhandler->errorInfo());\n\n return false;\n }\n $this->records_found = $r->rowCount();\n\n return true;\n }", "private function getTempExtremsToday() {\n //get last update date\n $update = explode(\" \", $this->lastUpdateStr())[0];\n\n $statement = $this->db->prepare('SELECT max(\"amount\") as \"high\", min(\"amount\") as \"low\" FROM \"temperature\" WHERE date(\"created\") = ?');\n $statement->bindValue(1, $update);\n $result = $statement->execute();\n return $result->fetchArray(SQLITE3_ASSOC);\n }", "public function hourOfBuys() {\n\n $query = \"SELECT COUNT(*) AS BUYS, HOUR(BUYDATE) AS HOUR FROM `BUY` WHERE 1 GROUP BY HOUR(BUYDATE)\";\n\n $result = parent::query($query);\n\n $toReturn = array();\n\n while ($row = $result->fetch_assoc()) {\n $toReturn[] = array(\n 'hour' => $row['HOUR'],\n 'buys' => $row['BUYS']\n );\n }\n\n return $toReturn;\n\n }", "public function getSpecialOfferTransactionPending() {\n $time_stamp = time() - 24*60*60; //1 day\n \n $results = array();\n $qb = $this->createQueryBuilder('t');\n $qb->select('t')\n ->where(' t.transactionType= :transactionType and t.status = :status and t.timeStamp >= :time_stamp ')\n ->setParameter('transactionType', 'PAY_ONCE_OFFER')\n ->setParameter('time_stamp', $time_stamp)\n ->setParameter('status', 'PENDING');\n $results = $qb->getQuery()->getResult();\n return $results;\n }", "public function getTransactions()\r\n {\r\n return $this->transactions;\r\n }", "public function getTransactions()\r\n {\r\n return $this->transactions;\r\n }", "public function getTransactions()\r\n {\r\n return $this->transactions;\r\n }", "public function query_in_transactions(){\n\t\t$response = $this->execute($this->query_in_transaction_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}", "function getRevenueData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n \n if($varAction=='today' || $varAction=='yesterday'){\n if($varAction=='today'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n \n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $arrClms = array('TIME(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded < \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$i]['time'][]=$arrData;\n $arrRes[$i]['count']=$count;\n }\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_week'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$key]['dates']=$arrData;\n $arrRes[$key]['count']=$count;\n }\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_month'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $lastMonth.'=='.$lastMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$key]['dates']=$arrData;\n $arrRes[$key]['count']=$count;\n }\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "public function getBuyerStats($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n\n DB::enableQueryLog();\n // execute\n $uniqueBuyers = array();\n $uniqueBuyers['current_period'] = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->distinct('buyer_id')\n ->count('buyer_id');\n\n $uniqueBuyers['prev_period'] = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->distinct('buyer_id')\n ->count('buyer_id');\n\n\n // buyers who make transactions more than once\n $returningBuyers = array(); \n $returningBuyers['current_period'] = DB::connection('marketplace')\n ->table('orders')\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('buyer_id')\n ->havingRaw('count(buyer_id) > 1')\n ->distinct('buyer_id')\n ->count('buyer_id');\n\n $returningBuyers['prev_period'] = DB::connection('marketplace')\n ->table('orders')\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->groupBy('buyer_id')\n ->havingRaw('count(buyer_id) > 1')\n ->distinct('buyer_id')\n ->count('buyer_id');\n\n $data = array();\n $data['unique_buyers'] = $uniqueBuyers;\n // $data['returning_buyers'] = $returningBuyers;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function doctorIncomeGraphData()\n {\n $schedules = Auth::user()->doctor->schedules;\n $channelingIncomeGraphData = Appointment::whereIn('schedule_id', $schedules->pluck('id'))\n ->whereIn('status', [Appointments::PENDING, Appointments::COMPLETED])\n ->get()\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum(function ($appointment) {\n return $appointment->schedule->doctor_fee;\n })\n ];\n })->values()->all();\n $receivedPaymentsGraphData = Expense::whereIn('expensable_id', $schedules->pluck('id'))\n ->get()\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n return ResponseHelper::findSuccess('Items Summary Data', [\n 'channelingIncomeGraphData' => $channelingIncomeGraphData,\n 'receivedPaymentsGraphData' => $receivedPaymentsGraphData,\n ]);\n }", "public function getViewPay($id){\n if (!is_numeric($id))\n return Response::json(array('status' => 400, 'message' => 'Only IDs are perrmitted'), 400);\n\n\t//variables\n $query = TimeTrackingEntry::where('pay_id', '=', $id)->orderBy('user_id')-> orderBy('startDate')->get(); //inital query\n\n //grabbing eveyone who has NOT submitted anything to bosapp, had to be raw sql as eloquent does not have a way of doing exclusive joins\n\t$noentry = \\DB::select('select user.last_name, user.first_name, user.email from user where not exists (select * from time_tracking_entry where user.id = time_tracking_entry.user_id and time_tracking_entry.pay_id =' . $id . ') AND user.active = 1 order by user.last_name');\n\n//return Response::json($noentry );\n\n $usrcount = 0; //count is just used generally as a counter\n $current = 0; //current and prev are used in seperating out users in the data array\n $prev = 0;\n $curperiod = TimeTrackingPayPeriod::where('id', '=', $id)->get(); //timestamps for pay periods\n $startstamp = strtotime($curperiod[0]['start_pay_period']);\n $midstamp = strtotime($curperiod[0]['start_pay_period'] . ' + 7 days');\n $endstamp = strtotime($curperiod[0]['start_pay_period'] . ' + 14 days');\n $entrystart = 0; //these are for individual stamp entrys\n $entrystop = 0;\n $strvar = ''; //used as one off strings here and there so there's not 50 of them\n\t$clocked = 0;\n $comment = 0;\n $sat1 = 0;\n $sun1 = 0;\n $mon1 = 0;\n $tue1 = 0;\n $wed1 = 0;\n $thu1 = 0;\n $fri1 = 0;\n $sat2 = 0;\n $sun2 = 0;\n $mon2 = 0;\n $tue2 = 0;\n $wed2 = 0;\n $thu2 = 0;\n $fri2 = 0;\n\n $data = array();\n\n foreach($query as $i) {\n $current = $i['user_id'];\n if ($current != $prev) { //if its a new user...\n $prev = $current;\n $usrcount++;\n $strvar = User::find($i['user_id']); //get there name and email\n $data[$usrcount]['name'] = $strvar['last_name'] . ', ' . $strvar['first_name'];\n $data[$usrcount]['email'] = $strvar['email'];\n $comment = 0;\n $sat1 = 0; //and reset day counts for that user\n $sun1 = 0;\n $mon1 = 0;\n $tue1 = 0;\n $wed1 = 0;\n $thu1 = 0;\n $fri1 = 0;\n $sat2 = 0;\n $sun2 = 0;\n $mon2 = 0;\n $tue2 = 0;\n $wed2 = 0;\n $thu2 = 0;\n $fri2 = 0;\n } //end of if prev\n\n $entrystart = strtotime($i['startDate'] . ' ' . $i['startTime']);\n $entrystop = strtotime($i['endDate'] . ' ' . $i['endTime']);\n $clocked = $i['clocked_in'];\n if ($entrystart < $midstamp && $entrystart > $startstamp) { //week1\n\n if ( date('D', $entrystart) == 'Sat') {\n $data[$usrcount]['week1']['sat'][$sat1]['start'] = $entrystart;\n $data[$usrcount]['week1']['sat'][$sat1]['end'] = $entrystop;\n $data[$usrcount]['week1']['sat'][$sat1]['clock'] = $clocked;\n $sat1++;\n }\n \n if ( date('D', $entrystart) == 'Sun') {\n $data[$usrcount]['week1']['sun'][$sun1]['start'] = $entrystart;\n $data[$usrcount]['week1']['sun'][$sun1]['end'] = $entrystop;\n $data[$usrcount]['week1']['sun'][$sun1]['clock'] = $clocked;\n $sun1++;\n } \n if ( date('D', $entrystart) == 'Mon') {\n $data[$usrcount]['week1']['mon'][$mon1]['start'] = $entrystart;\n $data[$usrcount]['week1']['mon'][$mon1]['end'] = $entrystop;\n $data[$usrcount]['week1']['mon'][$mon1]['clock'] = $clocked;\n $mon1++;\n } \n if ( date('D', $entrystart) == 'Tue') {\n $data[$usrcount]['week1']['tue'][$tue1]['start'] = $entrystart;\n $data[$usrcount]['week1']['tue'][$tue1]['end'] = $entrystop;\n $data[$usrcount]['week1']['tue'][$tue1]['clock'] = $clocked;\n $tue1++;\n } \n if ( date('D', $entrystart) == 'Wed') {\n $data[$usrcount]['week1']['wed'][$wed1]['start'] = $entrystart;\n $data[$usrcount]['week1']['wed'][$wed1]['end'] = $entrystop;\n $data[$usrcount]['week1']['wed'][$wed1]['clock'] = $clocked;\n $wed1++;\n } \n if ( date('D', $entrystart) == 'Thu') {\n $data[$usrcount]['week1']['thu'][$thu1]['start'] = $entrystart;\n $data[$usrcount]['week1']['thu'][$thu1]['end'] = $entrystop;\n $data[$usrcount]['week1']['thu'][$thu1]['clock'] = $clocked;\n $thu1++;\n } \n if ( date('D', $entrystart) == 'Fri') {\n $data[$usrcount]['week1']['fri'][$fri1]['start'] = $entrystart;\n $data[$usrcount]['week1']['fri'][$fri1]['end'] = $entrystop;\n $data[$usrcount]['week1']['fri'][$fri1]['clock'] = $clocked;\n $fri1++;\n }\n \n }//end of week 1\n\n elseif ($entrystart < $endstamp && $entrystart > $midstamp) { //week2\n\n if ( date('D', $entrystart) == 'Sat') {\n $data[$usrcount]['week2']['sat'][$sat2]['start'] = $entrystart;\n $data[$usrcount]['week2']['sat'][$sat2]['end'] = $entrystop;\n $data[$usrcount]['week2']['sat'][$sat2]['clock'] = $clocked;\n $sat2++;\n }\n \n if ( date('D', $entrystart) == 'Sun') {\n $data[$usrcount]['week2']['sun'][$sun2]['start'] = $entrystart;\n $data[$usrcount]['week2']['sun'][$sun2]['end'] = $entrystop;\n $data[$usrcount]['week2']['sun'][$sun2]['clock'] = $clocked;\n $sun2++;\n } \n if ( date('D', $entrystart) == 'Mon') {\n $data[$usrcount]['week2']['mon'][$mon2]['start'] = $entrystart;\n $data[$usrcount]['week2']['mon'][$mon2]['end'] = $entrystop;\n $data[$usrcount]['week2']['mon'][$mon2]['clock'] = $clocked;\n $mon2++;\n } \n if ( date('D', $entrystart) == 'Tue') {\n $data[$usrcount]['week2']['tue'][$tue2]['start'] = $entrystart;\n $data[$usrcount]['week2']['tue'][$tue2]['end'] = $entrystop;\n $data[$usrcount]['week2']['tue'][$tue2]['clock'] = $clocked;\n $tue2++;\n } \n if ( date('D', $entrystart) == 'Wed') {\n $data[$usrcount]['week2']['wed'][$wed2]['start'] = $entrystart;\n $data[$usrcount]['week2']['wed'][$wed2]['end'] = $entrystop;\n $data[$usrcount]['week2']['wed'][$wed2]['clock'] = $clocked;\n $wed2++;\n } \n if ( date('D', $entrystart) == 'Thu') {\n $data[$usrcount]['week2']['thu'][$thu2]['start'] = $entrystart;\n $data[$usrcount]['week2']['thu'][$thu2]['end'] = $entrystop;\n $data[$usrcount]['week2']['thu'][$thu2]['clock'] = $clocked;\n $thu2++;\n } \n if ( date('D', $entrystart) == 'Fri') {\n $data[$usrcount]['week2']['fri'][$fri2]['start'] = $entrystart;\n $data[$usrcount]['week2']['fri'][$fri2]['end'] = $entrystop;\n $data[$usrcount]['week2']['fri'][$fri2]['clock'] = $clocked;\n $fri2++;\n }\n\n }//end of week 2\n\n if ($i['description'] != '') { //if the comment field is not blank add it as a field with its timestamp\n $data[$usrcount]['comment'][$comment]['comment'] = $i['description'];\n $data[$usrcount]['comment'][$comment]['date'] = $entrystart;\n $comment++;\n }//end of if comment \n } //end of foreach query as i\n //sorts the array by name\n usort($data, array($this, \"cmp\"));\n $this->layout->content = View::make('admin/time/viewpay', array('entrys' => $data))->with('dates', array(0 => $startstamp, 1 => $midstamp))->with('noentry', $noentry);\n }", "function getOrdersData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n $total=0;\n if($varAction=='today' || $varAction=='yesterday'){\n if($varAction=='today'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n \n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $arrClms = array('TIME(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded < \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$i]['time'][]=$arrData;\n $arrRes['data'][$i]['count']=$count;\n $total +=$count;\n }\n $arrRes['total']=$total;\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_week'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$count;\n $total +=$count;\n }\n $arrRes['total']=$total;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_month'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $lastMonth.'=='.$lastMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$count;\n $total +=$count; \n }\n $arrRes['total']=$total;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "public function getMyTransactionHistory($patron, $params)\n {\n $pageSize = $params['limit'] ?? 50;\n $offset = isset($params['page']) ? ($params['page'] - 1) * $pageSize : 0;\n $sortOrder = isset($params['sort']) && 'checkout asc' === $params['sort']\n ? 'asc' : 'desc';\n $result = $this->makeRequest(\n ['v3', 'patrons', $patron['id'], 'checkouts', 'history'],\n [\n 'limit' => $pageSize,\n 'offset' => $offset,\n 'sortField' => 'outDate',\n 'sortOrder' => $sortOrder,\n 'fields' => 'item,outDate'\n ],\n 'GET',\n $patron\n );\n if (isset($result['code'])) {\n return [\n 'success' => false,\n 'status' => 146 === $result['code']\n ? 'ils_transaction_history_disabled'\n : 'ils_connection_failed'\n ];\n }\n $transactions = [];\n foreach ($result['entries'] as $entry) {\n $transaction = [\n 'id' => '',\n 'item_id' => $this->extractId($entry['item']),\n 'checkoutDate' => $this->dateConverter->convertToDisplayDate(\n 'Y-m-d', $entry['outDate']\n )\n ];\n // Fetch item information\n $item = $this->makeRequest(\n ['v3', 'items', $transaction['item_id']],\n ['fields' => 'bibIds,varFields'],\n 'GET',\n $patron\n );\n $transaction['volume'] = $this->extractVolume($item);\n if (!empty($item['bibIds'])) {\n $transaction['id'] = $item['bibIds'][0];\n\n // Fetch bib information\n $bib = $this->getBibRecord(\n $transaction['id'], 'title,publishYear', $patron\n );\n if (!empty($bib['title'])) {\n $transaction['title'] = $bib['title'];\n }\n if (!empty($bib['publishYear'])) {\n $transaction['publication_year'] = $bib['publishYear'];\n }\n }\n $transactions[] = $transaction;\n }\n\n return [\n 'count' => $result['total'] ?? 0,\n 'transactions' => $transactions\n ];\n }", "private function getTraffic() {\n $readSiteViews = new Read;\n $readSiteViews->ExeRead('ws_siteviews', \"WHERE siteviews_date = :date\", \"date = {$this->Date}\");\n if ($readSiteViews->getRowCount()):\n $this->Traffic = $readSiteViews->getResult()[0];\n endif;\n }", "public function getBuyerHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $buyer = DB::connection('virtual_market')\n ->table('orders')\n ->select(DB::raw($dateQuery.',count(distinct customer_id)'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['buyer'] = $buyer;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "function getAllTransactions()\n {\n $transactions = $this->all();\n\n /* Add additional attributes to each Stock */\n foreach ($transactions as $transaction)\n {\n // Add a link to each stock's history page\n $transaction->href = '/transaction/' . $transaction->DateTime;\n }\n\n return $transactions;\n }", "private function bottomGridData() {\r\n\t\t\r\n $result = $this->getLatestPeriod();\r\n \r\n if (is_array($result) && !empty($result))\r\n {\r\n $periodResult = array_column($result, \"period\");\r\n $query = \"SELECT \".$this->accountIdField.\" AS SKUID \" .\r\n \",MAX(\".$this->accountNameField.\") AS ACCOUNT \" .\r\n \",\".$this->settingVars->tesco_po_details.\".purchase_order_number AS PON \" .\r\n \",MAX(\".$this->settingVars->tesco_po_details.\".depot_number) AS DEPOT_NO \" .\r\n \",\".$this->settingVars->tesco_po_details.\".period AS PERIOD \" .\r\n \",MAX(\".$this->settingVars->tesco_po_details.\".delivered_on_time) AS DOT \" .\r\n \",SUM((CASE WHEN period IN('\" . implode(\"','\", $periodResult) . \"') THEN total_placed_orders_Cases ELSE 0 END)) AS ORDERED \" .\r\n \",SUM((CASE WHEN period IN('\" . implode(\"','\", $periodResult) . \"') THEN delivered_on_time ELSE 0 END)) AS DELIVERED \" .\r\n \" FROM \".$this->settingVars->tesco_po_details.\", \".$this->settingVars->skutable.\" WHERE \".$this->settingVars->tesco_po_details.\".GID = \".$this->settingVars->skutable.\".GID AND \".$this->settingVars->tesco_po_details.\".skuID = \".$this->settingVars->skutable.\".PIN AND \".$this->settingVars->skutable.\".clientID = '\".$this->settingVars->clientID.\"' AND \".$this->settingVars->skutable.\".GID = \".$this->settingVars->GID.\" AND \".$this->settingVars->tesco_po_details.\".skuID = '\".$_REQUEST['selectedSKUID'].\"' AND \".$this->settingVars->tesco_po_details.\".period IN ('\".implode(\"','\", $periodResult).\"') AND \".$this->commonQueryPart.\" GROUP BY SKUID, PERIOD, PON ORDER BY PERIOD DESC\";\r\n //echo $query; exit;\r\n $redisOutput = $this->redisCache->checkAndReadByQueryHashFromCache($query);\r\n if ($redisOutput === false) {\r\n $result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\r\n $this->redisCache->setDataForHash($result);\r\n } else {\r\n $result = $redisOutput;\r\n }\r\n \r\n if (is_array($result) && !empty($result))\r\n {\r\n foreach($result as $data)\r\n {\r\n $tmp = array();\r\n $tmp[\"SKUID\"] = $data[\"SKUID\"];\r\n $tmp[\"ACCOUNT\"] = $data[\"ACCOUNT\"];\r\n $tmp[\"PO\"] = (int)$data[\"PON\"];\r\n $tmp[\"DEPOT\"] = (int)$data[\"DEPOT_NO\"];\r\n $tmp[\"PERIOD\"] = (int)$data[\"PERIOD\"];\r\n $tmp[\"ORDERED\"] = (int)$data[\"ORDERED\"];\r\n $tmp[\"DOT\"] = (int)$data[\"DOT\"];\r\n $tmp[\"DOT_PER\"] = ($data[\"ORDERED\"] != 0) ? ($data[\"DELIVERED\"]/$data[\"ORDERED\"])*100 : 0;\r\n $tmp[\"DOT_PER\"] = (double)number_format($tmp[\"DOT_PER\"], 1, '.', '');\r\n $tmp[\"SHORT_CASES\"] = $data[\"ORDERED\"]-$data[\"DOT\"];\r\n $finalData[] = $tmp;\r\n }\r\n }\r\n $this->jsonOutput['bottomGridData'] = $finalData;\r\n }\r\n }", "public function transhistory()\n {\n $User = User::where('id', Auth::user()->id)->first();\n $Trans = Transaction::where('user_id', Auth::user()->id)->where('trans_type', 'topup')->get();\n \n return view('wallet.transhistory',compact('User','Trans'));\n }", "public function tradinghistory()\n {\n\n return view('user.thistory')\n ->with(array(\n\n 't_history' => tp_transactions::where('user', Auth::user()->id)\n ->where('type', 'ROI')\n ->orderBy('id', 'desc')\n ->get(),\n 'title' => 'Trading History',\n 'settings' => settings::where('id', '=', '1')->first(),\n ));\n }", "public function getUsersGrowthStatisticsByYesterday($accountId)\n {\n $url = $this->weconnectDomain . \"/accounts/$accountId/statistics/users/growth/keyIndicator\";\n\n $result = $this->_curl(self::METHOD_GET, $url, 'admin');\n\n //format date\n if (!empty($result)) {\n $result['refDate'] = $this->_formatTime($result['refDate'], 'Y-m-d');\n }\n return $result;\n }", "function getPlayerActivity($player)\n {\n $queryString = \"SELECT * FROM transactions WHERE Player='\" . $player . \"' ORDER BY DateTime DESC\";\n $result = $this->db->query($queryString);\n\n return $result;\n }", "public function getTradeData()\n {\n return $this->TradeData;\n }", "public function getTransactionsAttribute() {\n return DB::table('transactions')\n -> leftjoin('accounts as paying', 'transactions.paying_id', '=', 'paying.id')\n -> leftjoin('accounts as receiving', 'transactions.receiving_id', '=', 'receiving.id')\n -> leftjoin('banks as paying_bank', 'paying.bank_id', '=', 'paying_bank.id')\n -> leftjoin('banks as receiving_bank', 'receiving.bank_id', '=', 'receiving_bank.id')\n -> leftjoin('users as payer', 'paying.user_id', '=', 'payer.id')\n -> leftjoin('users as receiver', 'receiving.user_id', '=', 'receiver.id')\n -> where('payer.id', $this -> id)\n -> orWhere('receiver.id', $this -> id)\n -> get(['transactions.id',\n 'paying.id as paying_account_id',\n 'payer.first_name as paying_first',\n 'payer.last_name as paying_last',\n 'paying_bank.id as paying_bank_id',\n 'paying_bank.name as paying_bank_name',\n 'receiving.id as receiving_account_id',\n 'receiver.first_name as receiving_first',\n 'receiver.last_name as receiving_last',\n 'receiving_bank.id as receiving_bank_id',\n 'receiving_bank.name as receiving_bank_name',\n 'transactions.ammount as ammount',\n 'transactions.created_at as created_at']) -> all();\n }", "public function userBuyCoinHistory()\n {\n $response = ['success' => false, 'message'=> __('Something went wrong.')];\n $items = Sell::where(['user_id'=> Auth::user()->id])->get();\n $datas = [];\n if (isset($items[0])) {\n $datas = [];\n foreach ($items as $item) {\n $datas[] = [\n 'user_name' => $item->user->name,\n 'coin_name' => $item->coin->name,\n 'payment_method' => $item->payment->name,\n 'amount' => $item->amount,\n 'price_rate' => $item->price,\n 'date' => date('d M y', strtotime($item->created_at)),\n ];\n }\n $response = [\n 'success' => true,\n 'buy_history' => $datas,\n 'message'=> __('Data get successfully.')];\n } else {\n $response = ['success' => false,'buy_history' => [], 'message'=> __('No data found.')];\n }\n\n return $response;\n }", "function get_statistics_data_note($params)\r\n {\r\n $params = (object)$params;\r\n $default_params = (object)array(\r\n 'user_id' => USER_ID,\r\n 'sdate' => date('Y-m-d'),\r\n 'edate' => date('Y-m-d', strtotime(\"-1 week\"))\r\n );\r\n foreach($default_params as $key => $value){\r\n if(!isset($params->{$key}))\r\n $params->{$key} = $value;\r\n }\r\n \r\n $period = new DatePeriod(\r\n new DateTime($params->sdate),\r\n new DateInterval('P1D'),\r\n new DateTime($params->edate)\r\n );\r\n\r\n $data = array();\r\n \r\n $sql = \"SELECT \r\n date_format(n.regdate, '%Y-%m-%d') as date,\r\n count(n.id) as log_count,\r\n count(distinct n.work_id) as work_count\r\n from\r\n log_work_note as n\r\n left join works on works.work_id = n.work_id\r\n where\r\n works.user_id = ?\r\n and n.regdate between ? and ?\r\n group by date\"; \r\n $query = $this->db->query($sql, array($params->user_id, $params->sdate, $params->edate));\r\n foreach ($query->result() as $row)\r\n {\r\n $data[$row->date] = $row->log_count;\r\n }\r\n\r\n $output = array();\r\n foreach ($period as $date) {\r\n $dateString = $date->format('Y-m-d');\r\n $output[$dateString] = (empty($data[$dateString]))?0:$data[$dateString];\r\n }\r\n\r\n return $output;\r\n }", "function get_sensors_data_by_timestamp($timestamp){\r\n $sensor_json_url = 'https://data.melbourne.vic.gov.au/resource/b2ak-trbp.json';\r\n\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_URL,$sensor_json_url . '?date_time=' . $timestamp);\r\n $result=curl_exec($ch);\r\n curl_close($ch);\r\n return json_decode($result);\r\n}", "public function getTransfers()\n {\n return Wrapper\\Player\\Senior::transfershistory($this->getId());\n }", "public function getPlayerTransactions($player){\n\t\t$this->player = $player;\n\t\t$this->getTransactions(-1,-1,-1,-1,$player->getPlayerID());\n\t}", "public function getTransactions()\n {\n return $this->transactions;\n }", "function GetYoutubeGraphData($ytUserName,$arrayDate)\n\t\t{\n\t\t\tset_include_path('library');\n\t\t\trequire_once 'Zend/Loader.php';\n\t\t\tZend_Loader::loadClass('Zend_Gdata_YouTube');\n\t\t\t\n\t\t\n\t\t\t\t$this->userName= $ytUserName;\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Uploads & comments\n\t\t\t\t$yt = new Zend_Gdata_YouTube();\n\t\t\t\t$yt->getHttpClient()->setConfig(array('timeout'=>180));\n\t\t\t\t$yt->setMajorProtocolVersion(2);\n\t\t\n\t\t\t\t$this->srVideoList='';\n\t\t\t\t$this->GetUploadDates($yt->getuserUploads($this->channelName));\n\t\t\n\t\t\t\t\n\t\t\t\t// \"Favorite\";\n\t\t\t\t$this->GetFavoriteDates();\n\t\t\t\t\n\t\t\t\t$this->CountDates($arrayDate);\n\t\t\t\t\t\n\t\t\t\treturn $this->graphArray;\n\t\t\t}", "public function query_trading_clock(){\n\t\t$response = $this->execute($this->query_clock_url);\n\t\tif(!$response){\n\t\t\tthrow new Exception(\"error in connecting to server\");\n\t\t}\n\t\treturn json_decode($response,true);\n\t}", "public function getHourlyForecast() : array\n {\n $data = $this->getForecast();\n return $data[self::HOURLY_KEY] ?? [];\n }", "public function getPaymentHistory(){\r\n\t\t$result = array();\r\n\t\treturn $result;\r\n\t}", "public static function GetDashboard() {\n $date = [];\n $num_orders = [];\n $last_month = \\Carbon\\Carbon::today()->subDays(30);\n $orders = Order::where('created_at', '>=', $last_month)->get()\n ->groupBy(function($item) {\n return $item->created_at->format('d-m-y');\n })->toArray();\n foreach ($orders as $key => $value) {\n $date[] = $key;\n $num_orders[] = count($value);\n }\n\n //======= Get income from last month - Chart From DB =======\n $last_month_income = \\Carbon\\Carbon::today()->subDays(30);\n $all_orders = [];\n $orders_income = [];\n $income = [];\n $income_date = [];\n $users_orders = DB::table('users')\n ->join('orders', 'users.id', '=', 'orders.user_id')\n ->select('users.*', 'orders.*')\n ->where('orders.created_at', '>=', $last_month_income)->get();\n foreach ($users_orders as $new_user_order) {\n $all_orders[] = (array) $new_user_order;\n }\n foreach ($all_orders as &$orders_data) {\n $orders_data['data'] = unserialize($orders_data['data']);\n }\n foreach ($all_orders as $order) {\n $order['created_at'] = (new \\DateTime($order['created_at']))->format('Y-m-d');\n $income_date[] = $order['created_at'];\n $sum = 0;\n foreach ($order['data'] as $price) {\n $sum += ($price['price'] * $price['quantity']);\n }\n $income[] = $sum;\n }\n\n for ($i = count($income_date) - 1; $i > 0; $i--) {\n if ($income_date[$i] == $income_date[$i - 1]) {\n unset($income_date[$i]);\n $income[$i - 1] = $income[$i] + $income[$i - 1];\n unset($income[$i]);\n }\n }\n $income = array_values($income);\n $income_date = array_values($income_date);\n\n self::$data['income'] = json_encode($income);\n self::$data['income_date'] = json_encode($income_date);\n\n //======= Get last week new users =======\n $last_week = \\Carbon\\Carbon::today()->subDays(7);\n $weekly_users = User::where('created_at', '>=', $last_week)->get()->toArray();\n\n //======= Get all users except admin =======\n $all_users = User::where('role', '!=', '6')->get()->toArray();\n\n //======= Get last day new orders =======\n $last_day = \\Carbon\\Carbon::today();\n $daily_orders = Order::where('created_at', '>=', $last_day)->get()->toArray();\n\n self::$data['weekly_new_users'] = count($weekly_users);\n self::$data['all_users'] = count($all_users);\n self::$data['daily_orders'] = count($daily_orders);\n self::$data['date'] = json_encode($date);\n self::$data['num_orders'] = json_encode($num_orders);\n self::$data['title'] .= 'CMS';\n self::$data['page_name'] = 'Ski Expert | Main';\n return view('cms.dashboard', self::$data);\n }", "public function processedTimeseries()\n {\n return collect($this->logs([\n 'StartTime' => now()->subHours(23)->setMinute(0)->format('Y-m-d H:i:s'),\n 'Period' => 60 * 60,\n 'EndTime' => now()->addDays(1)->format('Y-m-d H:i:s'),\n 'MetricName' => 'NumberOfMessagesReceived',\n 'Statistics' => ['Sum'],\n ])['Datapoints'])->map(function ($result, $key) {\n return [\n 'timestamp' => $result['Timestamp']->getTimestamp(),\n 'value' => $result['Sum'],\n ];\n })->sortBy('timestamp')->values()->all();\n }", "function presentAsJson()\n {\n $order = $this->order;\n\n $transactions = array_map(function (Transaction $tx) {\n $stampMethod = 'get' . ucfirst($status = TransactionModel::$statusMap[$tx->getStatus()]) . 'At';\n\n return [\n 'id' => $tx->getId(),\n 'status' => $status,\n 'amount' => bcadd($tx->getAmount(), 0, 8),\n 'price' => bcadd($tx->getPrice(), 0, 8),\n 'fee' => bcadd($tx->getFee(), 0, 8),\n 'timestamp' => $tx->{$stampMethod}()->getTimestamp(),\n ];\n }, $order->getTransactions()->toArray());\n\n return [\n 'id' => $order->getId(),\n 'type' => strtolower($order->getType() === 1 ? Order::TYPE_LIMIT_STR : Order::TYPE_MARKET_STR),\n 'side' => strtolower($order->getSide()),\n 'market' => $order->getMarket()->getSlug(),\n 'amount' => bcadd($order->getAmount(), 0, 8),\n 'current_amount' => bcadd($order->getCurrentAmount(), 0, 8),\n 'price' => bcadd($order->getAskedUnitPrice(), 0, 8),\n 'status' => $order->getStatus() === Order::STATUS_OPEN ? 'open' :\n ($order->getStatus() === Order::STATUS_COMPLETED ? 'completed' :\n ($order->getStatus() === Order::STATUS_CANCELLED ? 'cancelled' : 'closed')),\n 'timestamp' => $order->getUpdatedAt()->getTimestamp(),\n 'fee_taken' => bcadd($order->getFeeAmountTaken(), 0, 8),\n 'fee_fixed' => '0.00000000',\n 'fee_percent' => bcadd($order->getFeePercent(), 0, 8),\n 'transactions' => $transactions,\n ];\n }", "function getTransactionHistoryRecordsForUser($userAccountID, $userEncryptionKey, $numItemsPerPage, $pageNumber, $globalCurrentDate, $sid, $dbh)\n\t{\n\t\t$transactionsForUser\t\t\t\t\t\t\t\t\t\t\t\t= array();\n\t\t\t\n\t\t$offset\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t\t\n\t\tif ($pageNumber > 1)\n\t\t{\n\t\t\t$beginOffset\t\t\t\t\t\t\t\t\t\t\t\t\t= $pageNumber - 1;\n\t\t\t\n\t\t\t$offset\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= $numItemsPerPage * $beginOffset;\t\n\t\t}\n\t\t\t\n\t\t$numItemsPerPage\t\t\t\t\t\t\t\t\t\t\t\t\t= (int) $numItemsPerPage;\n\t\t$offset\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= (int) $offset;\n\t\t\n\t\ttry\n\t\t{\t\t\n\t\t\t$getTransactionHistoryRecords\t\t\t\t\t\t\t\t\t= $dbh -> prepare(\"SELECT \n\t\ttransactionID,\n\t\ttransactionDate,\n\t\tformattedTransactionDate,\n\t\taction,\n\t\tcryptoAmount,\n\t\tunitPrice,\n\t\tfiatAmount,\n\t\texchange,\n\t\tfees,\n\t\tfeesInPercentage,\n\t\tcapitolGains,\n\t\ttaxDue,\n\t\tFK_AssetTypeID,\n\t\tassetTypeLabel\n\tFROM\n\t(\n\t\tSELECT\n\t\t\tTransactions.transactionID,\n\t\t\tTransactions.transactionDate,\n\t\t\tDATE_FORMAT(Transactions.transactionDate, '%e %b %Y') AS formattedTransactionDate,\n\t\t\tTransactionTypes.displayTransactionTypeLabel AS action,\n\t\t\tTransactions.btcQuantityTransacted AS cryptoAmount,\n\t\t\tTransactions.spotPriceAtTimeOfTransaction AS unitPrice,\n\t\t\tTransactions.usdQuantityTransacted AS fiatAmount,\n\t\t\tTransactionSources.transactionSourceLabel AS exchange,\n\t\t\tTransactions.usdFeeAmount AS fees,\n\t\t\t(Transactions.usdFeeAmount / Transactions.usdQuantityTransacted) * 100 AS feesInPercentage,\n\t\t\toutbound.profitOrLossAmountUSD AS capitolGains,\n\t\t\tCASE\n\t\t\t\tWHEN outbound.profitOrLossAmountUSD > 0 AND outbound.FK_GainTypeID = 2 THEN (outbound.profitOrLossAmountUSD * AccountingMethodForRegionProfile.shortTermGainTaxPercentage) / 100\n\t\t\t\tWHEN outbound.profitOrLossAmountUSD > 0 AND outbound.FK_GainTypeID = 3 THEN (outbound.profitOrLossAmountUSD * AccountingMethodForRegionProfile.longTermGainTaxPercentage) / 100\n\t\t\t\tELSE 0\n\t\t\tEND AS taxDue,\n\t\t\tTransactions.FK_AssetTypeID,\n\t\t\tassetTypes.assetTypeLabel\n\t\tFROM\n\t\t\tTransactions \n\t\t\tINNER JOIN AssetTypes assetTypes ON Transactions.FK_AssetTypeID = assetTypes.assetTypeID AND assetTypes.languageCode = 'EN'\n\t\t\tINNER JOIN TransactionTypes ON Transactions.FK_TransactionTypeID = TransactionTypes.transactionTypeID AND TransactionTypes.languageCode = 'EN'\n\t\t\tINNER JOIN TransactionSources ON Transactions.FK_TransactionSourceID = TransactionSources.transactionSourceID AND TransactionSources.languageCode = 'EN'\n\t\t\tINNER JOIN OutboundTransactionSourceGrouping outbound ON Transactions.transactionID = outbound.FK_OutboundAssetTransactionID\n\t\t\tINNER JOIN UserAccounts ON Transactions.FK_AccountID = UserAccounts.userAccountID\n\t\t\tINNER JOIN CountryForRegionProfile ON UserAccounts.FK_CountryCode = CountryForRegionProfile.FK_CountryID\n\t\t\tINNER JOIN AccountingMethodForRegionProfile ON CountryForRegionProfile.FK_RegionProfileID = AccountingMethodForRegionProfile.FK_RegionProfileID\n\t\t\tINNER JOIN CryptoWallets toWallet ON Transactions.FK_DestinationAddressID = toWallet.walletID\n\t\t\tINNER JOIN CryptoWallets fromWallet ON Transactions.FK_SourceAddressID = fromWallet.walletID\n\t\t\tLEFT JOIN AssetTypes toWalletAssetType ON toWallet.FK_AssetTypeID = toWalletAssetType.assetTypeID\n\t\t\tLEFT JOIN AssetTypes fromWalletAssetType ON fromWallet.FK_AssetTypeID = fromWalletAssetType.assetTypeID\n\t\tWHERE\n\t\t\tTransactions.FK_AccountID = :accountID\n\tUNION\n\t\tSELECT\n\t\t\tTransactions.transactionID,\n\t\t\tTransactions.transactionDate,\n\t\t\tDATE_FORMAT(Transactions.transactionDate, '%e %b %Y') AS formattedTransactionDate,\n\t\t\tTransactionTypes.displayTransactionTypeLabel AS action,\n\t\t\tTransactions.btcQuantityTransacted AS cryptoAmount,\n\t\t\tTransactions.spotPriceAtTimeOfTransaction AS unitPrice,\n\t\t\tTransactions.usdQuantityTransacted AS fiatAmount,\n\t\t\tTransactionSources.transactionSourceLabel AS exchange,\n\t\t\tTransactions.usdFeeAmount AS fees,\n\t\t\t(Transactions.usdFeeAmount / Transactions.usdQuantityTransacted) * 100 AS feesInPercentage,\n\t\t\tinbound.profitOrLossAmountUSD AS capitolGains,\n\t\t\tCASE\n\t\t\t\tWHEN inbound.profitOrLossAmountUSD > 0 AND inbound.FK_GainTypeID = 2 THEN (inbound.profitOrLossAmountUSD * AccountingMethodForRegionProfile.shortTermGainTaxPercentage) / 100\n\t\t\t\tWHEN inbound.profitOrLossAmountUSD > 0 AND inbound.FK_GainTypeID = 3 THEN (inbound.profitOrLossAmountUSD * AccountingMethodForRegionProfile.longTermGainTaxPercentage) / 100\n\t\t\t\tELSE 0\n\t\t\tEND AS taxDue,\n\t\t\tTransactions.FK_AssetTypeID,\n\t\t\tassetTypes.assetTypeLabel\n\t\tFROM\n\t\t\tTransactions \n\t\t\tINNER JOIN AssetTypes assetTypes ON Transactions.FK_AssetTypeID = assetTypes.assetTypeID AND assetTypes.languageCode = 'EN'\n\t\t\tINNER JOIN TransactionTypes ON Transactions.FK_TransactionTypeID = TransactionTypes.transactionTypeID AND TransactionTypes.languageCode = 'EN'\n\t\t\tINNER JOIN TransactionSources ON Transactions.FK_TransactionSourceID = TransactionSources.transactionSourceID AND TransactionSources.languageCode = 'EN'\n\t\t\tINNER JOIN OutboundTransactionSourceGrouping inbound ON Transactions.transactionID = inbound.FK_InboundAssetTransactionID\n\t\t\tINNER JOIN UserAccounts ON Transactions.FK_AccountID = UserAccounts.userAccountID\n\t\t\tINNER JOIN CountryForRegionProfile ON UserAccounts.FK_CountryCode = CountryForRegionProfile.FK_CountryID\n\t\t\tINNER JOIN AccountingMethodForRegionProfile ON CountryForRegionProfile.FK_RegionProfileID = AccountingMethodForRegionProfile.FK_RegionProfileID\n\t\t\tINNER JOIN CryptoWallets toWallet ON Transactions.FK_DestinationAddressID = toWallet.walletID\n\t\t\tINNER JOIN CryptoWallets fromWallet ON Transactions.FK_SourceAddressID = fromWallet.walletID\n\t\t\tLEFT JOIN AssetTypes toWalletAssetType ON toWallet.FK_AssetTypeID = toWalletAssetType.assetTypeID\n\t\t\tLEFT JOIN AssetTypes fromWalletAssetType ON fromWallet.FK_AssetTypeID = fromWalletAssetType.assetTypeID\n\t\tWHERE\n\t\t\tTransactions.FK_AccountID = :accountID\n\tUNION\n\t\tSELECT\n\t\t\tTransactions.transactionID,\n\t\t\tTransactions.transactionDate,\n\t\t\tDATE_FORMAT(Transactions.transactionDate, '%e %b %Y') AS formattedTransactionDate,\n\t\t\tTransactionTypes.displayTransactionTypeLabel AS action,\n\t\t\tTransactions.btcQuantityTransacted AS cryptoAmount,\n\t\t\tTransactions.spotPriceAtTimeOfTransaction AS unitPrice,\n\t\t\tTransactions.usdQuantityTransacted AS fiatAmount,\n\t\t\tTransactionSources.transactionSourceLabel AS exchange,\n\t\t\tTransactions.usdFeeAmount AS fees,\n\t\t\t(Transactions.usdFeeAmount / Transactions.usdQuantityTransacted) * 100 AS feesInPercentage,\n\t\t\t0 AS capitolGains,\n\t\t\t0 AS taxDue,\n\t\t\tTransactions.FK_AssetTypeID,\n\t\t\tassetTypes.assetTypeLabel\n\t\tFROM\n\t\t\tTransactions \n\t\t\tINNER JOIN AssetTypes assetTypes ON Transactions.FK_AssetTypeID = assetTypes.assetTypeID AND assetTypes.languageCode = 'EN'\n\t\t\tINNER JOIN TransactionTypes ON Transactions.FK_TransactionTypeID = TransactionTypes.transactionTypeID AND TransactionTypes.languageCode = 'EN'\n\t\t\tINNER JOIN TransactionSources ON Transactions.FK_TransactionSourceID = TransactionSources.transactionSourceID AND TransactionSources.languageCode = 'EN'\n\t\t\tINNER JOIN UserAccounts ON Transactions.FK_AccountID = UserAccounts.userAccountID\n\t\t\tINNER JOIN CountryForRegionProfile ON UserAccounts.FK_CountryCode = CountryForRegionProfile.FK_CountryID\n\t\t\tINNER JOIN AccountingMethodForRegionProfile ON CountryForRegionProfile.FK_RegionProfileID = AccountingMethodForRegionProfile.FK_RegionProfileID\n\t\t\tINNER JOIN CryptoWallets toWallet ON Transactions.FK_DestinationAddressID = toWallet.walletID\n\t\t\tINNER JOIN CryptoWallets fromWallet ON Transactions.FK_SourceAddressID = fromWallet.walletID\n\t\t\tLEFT JOIN AssetTypes toWalletAssetType ON toWallet.FK_AssetTypeID = toWalletAssetType.assetTypeID\n\t\t\tLEFT JOIN AssetTypes fromWalletAssetType ON fromWallet.FK_AssetTypeID = fromWalletAssetType.assetTypeID\n\t\t\tLEFT JOIN OutboundTransactionSourceGrouping inbound ON Transactions.transactionID = inbound.FK_InboundAssetTransactionID\n\t\t\t\n\t\tWHERE\n\t\t\tTransactions.FK_AccountID = :accountID AND\n\t\t\tTransactions.isDebit = 0 AND\n\t\t\tinbound.FK_InboundAssetTransactionID IS NULL\n\t) a\n\tORDER BY\n\t\ttransactionDate, transactionID\n\tLIMIT\n\t\t:limit\n\tOFFSET\n\t\t:offset\");\n\t\t\n\t\t\t$getTransactionHistoryRecords -> bindValue(':accountID', $userAccountID, PDO::PARAM_INT);\n\t\t\t$getTransactionHistoryRecords -> bindValue(':userEncryptionKey', $userEncryptionKey);\n\t\t\t$getTransactionHistoryRecords -> bindValue(':limit', $numItemsPerPage, PDO::PARAM_INT);\n\t\t\t$getTransactionHistoryRecords -> bindValue(':offset', $offset, PDO::PARAM_INT);\n\t\t\n\t\t\tif ($getTransactionHistoryRecords -> execute() && $getTransactionHistoryRecords -> rowCount() > 0)\n\t\t\t{\n\t\t\t\twhile ($row = $getTransactionHistoryRecords -> fetchObject())\n\t\t\t\t{\n\t\t\t\t\t$transactionArray\t\t\t\t\t\t= array();\n\t\t\t\t\t\n\t\t\t\t\t$transactionID\t\t\t\t\t\t\t= $row->transactionID;\n\t\t\t\t\t$transactionDate\t\t\t\t\t\t= $row->formattedTransactionDate;\n\t\t\t\t\t$action\t\t\t\t\t\t\t\t\t= $row->action;\n\t\t\t\t\t$cryptoAmount\t\t\t\t\t\t\t= $row->cryptoAmount;\n\t\t\t\t\t$unitPrice\t\t\t\t\t\t\t\t= $row->unitPrice;\n\t\t\t\t\t$fiatAmount\t\t\t\t\t\t\t\t= $row->fiatAmount;\n\t\t\t\t\t$exchange\t\t\t\t\t\t\t\t= $row->exchange;\n\t\t\t\t\t$fees\t\t\t\t\t\t\t\t\t= $row->fees;\n\t\t\t\t\t$feesInPercentage\t\t\t\t\t\t= $row->feesInPercentage;\n\t\t\t\t\t$capitolGains\t\t\t\t\t\t\t= $row->capitolGains;\n\t\t\t\t\t$taxDue\t\t\t\t\t\t\t\t\t= $row->taxDue;\t\n\t\t\t\t\t$assetTypeID\t\t\t\t\t\t\t= $row->FK_AssetTypeID;\n\t\t\t\t\t$assetTypeLabel\t\t\t\t\t\t\t= $row->assetTypeLabel;\n\t\t\t\t\t\n\t\t\t\t\t$transactionArray['transactionID']\t\t= $transactionID;\n\t\t\t\t\t$transactionArray['transactionDate']\t= $transactionDate;\n\t\t\t\t\t$transactionArray['action']\t\t\t\t= $action;\n\t\t\t\t\t$transactionArray['cryptoAmount']\t\t= $cryptoAmount;\n\t\t\t\t\t$transactionArray['unitPrice']\t\t\t= $unitPrice;\t\n\t\t\t\t\t$transactionArray['fiatAmount']\t\t\t= $fiatAmount;\n\t\t\t\t\t$transactionArray['exchange']\t\t\t= $exchange;\n\t\t\t\t\t$transactionArray['fees']\t\t\t\t= $fees;\n\t\t\t\t\t$transactionArray['feesInPercentage']\t= $feesInPercentage;\n\t\t\t\t\t$transactionArray['capitolGains']\t\t= $capitolGains;\n\t\t\t\t\t$transactionArray['taxDue']\t\t\t\t= $taxDue;\n\t\t\t\t\t$transactionArray['assetTypeLabel']\t\t= $assetTypeLabel;\n\n\t\t\t\t\t$transactionsForUser[]\t\t\t\t\t= $transactionArray;\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t}\n\t catch (PDOException $e) \n\t {\n\t \terrorLog($e -> getMessage());\n\t\t}\n\t\t\n\t\treturn $transactionsForUser;\t\t\n\t}", "public function getHistories($user_id = null ,$fromDate = null ,$toDate = null,$params = array())\n {\n \n $condition = array();\n $condition =\" 1=1 \";\n if ($user_id != null)\n {\n $condition .= \" AND his.user_id = \".$user_id;\n }\n if ($fromDate != null)\n {\n $condition .= \" AND DATEDIFF(DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d'),'\".$fromDate.\"')>=0\";\n }\n if ($toDate != null)\n {\n $condition .= \" AND DATEDIFF(DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d'),'\".$toDate.\"')<=0\";\n }\n foreach($params as $key=>$value)\n {\n if ( $key != 'limit' && $key!='group_by')\n $condition .= $value;\n }\n if(!isset($params['limit']))\n $params['limit'] = 50;\n $count = 0;\n if(!isset($params['group_by']))\n {\n $count = 0;\n $t_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music');\n $t_name = $t_table->info('name');\n $select = $t_table->select()->setIntegrityCheck(false)\n ->from(\"$t_name as his\",array(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d' ) as pDate\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='song' and item_id>0 and transaction_status =1) as selling_sold_songs\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='album' and item_id>0 and transaction_status =1) as selling_sold_albums\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 0) as selling_transaction_fail\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 1) as selling_transaction_succ\",\n \"(SELECT sum(amount) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and (item_type='song' or item_type='album') and item_id>0 and transaction_status = 1 ) as selling_total_amount\"\n ));\n $select ->where($condition)\n ->group(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d')\")\n ->order(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d') DESC\")\n ->limit($params['limit']);\n $histories = $t_table->fetchAll($select)->toArray();\n $count = count($histories); \n return array($histories,$count);\n }\n else\n {\n $count = 0; \n $t_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music');\n $t_name = $t_table->info('name');\n $select = $t_table->select()->setIntegrityCheck(false)\n ->from(\"$t_name as his\",array(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d' ) as pDate\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='song' and item_id>0 and transaction_status =1) as selling_sold_songs\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='album' and item_id>0 and transaction_status =1) as selling_sold_albums\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 0) as selling_transaction_fail\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 1) as selling_transaction_succ\",\n \"(SELECT sum(amount) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and (item_type='song' or item_type='album') and item_id>0 and transaction_status = 1 ) as selling_total_amount\"\n ));\n $select ->where($condition)\n ->group($params['group_by'])\n ->order(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d') ASC\")\n ->limit($params['limit']);\n $histories = $t_table->fetchAll($select)->toArray();\n $count = count($histories); \n return array($histories,$count);\n }\n \n }", "public function getGraphView()\n\t{\n\t\t$chart = new ComboChart();\t\t\n\n\t\t// switch selon le type d'analyse\n\t\tswitch ($this->time) {\n\t\t\t// cas analyse jour\n\t\t\tcase 'day':\t\t\t\t\n\t\t\t $sql = 'SELECT \n\t\t\t\t\t\t\tdate(date_time) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\tgroup by date(date_time)';\n\t\t\t\t\tbreak;\t\t\t\n\t\t\tcase 'month':\n\t\t\t// cas analyse mois\n\t\t\t\t$sql = 'SELECT \n\t\t\t\t\t\t\tleft(date(date_time),7) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\tgroup by left(date(date_time),7)';\n\t\t\t\tbreak;\n\t\t\tcase 'year':\n\t\t\t// cas analyse année\n\t\t\t\t$sql = 'SELECT \n\t\t\t\t\t\t\tleft(date(date_time),4) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\tgroup by left(date(date_time),4)';\n\t\t\t\tbreak;\n\t\t\tcase 'week':\n\t\t\t// cas analyse 7 derniers jours\n\t\t\t\t$date = new dateTime();\n\t\t\t\t$startDate = $date->format('Y-m-d');\n\t \t\t \t$endDate = $date->modify('-1 week');\n\t \t\t \t$endDate = $endDate->format('Y-m-d');\n\n\t\t\t\t$sql = \"SELECT \n\t\t\t\t\t\t\tdate(date_time) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\twhere date_time BETWEEN '\" . $endDate . \"' and '\" . $startDate . \"'\n\t\t\t\t\t\tgroup by date(date_time)\";\n\t\t\t\tbreak;\n\t\t}\n\n\n\t $stmt = $this->em->query($sql);\n\t $views = $stmt->fetchAll();\n\n\t\t// entete du googleGraph\n\t\t$arrayToDataTable[] = ['', 'Montant', ['role' => 'tooltip'], 'Evolution', ['role' => 'tooltip']]; \n\n\t\t//data du googleGraph\n\t\tforeach ($views as $view){\n\t\t\t$arrayToDataTable[] = [$view['date'], intval($view['nb']), intval($view['nb']) .\" vues\", 0, \"evolution\"];\n\t\t}\n\n\t\t$chart->getData()->setArrayToDataTable($arrayToDataTable);\n\t\t$vAxisAmount = new VAxis();\n\t\t$vAxisAmount->setTitle('Nombre de vues');\n\t\t$chart->getOptions()->setVAxes([$vAxisAmount]);\n\n\t\t$seriesAmount = new \\CMEN\\GoogleChartsBundle\\GoogleCharts\\Options\\ComboChart\\Series();\n\t\t$seriesAmount->setType('bars');\n\t\t$seriesAmount->setTargetAxisIndex(0);\n\t\t$seriesEvol = new \\CMEN\\GoogleChartsBundle\\GoogleCharts\\Options\\ComboChart\\Series();\n\t\t$seriesEvol->setType('line');\n\t\t$seriesEvol->setTargetAxisIndex(1);\n\t\t$chart->getOptions()->setSeries([$seriesAmount, $seriesEvol]);\n\t\t$chart->getOptions()->setColors(['black', 'red']);\t\n\n\t\treturn $chart;\t\t\n\t}", "protected function getDatastreamHistory() {\n return $this->repository->api->m->getDatastreamHistory($this->parent->id, $this->id);\n }", "public function query_out_transactions(){\n\t\t$response = $this->execute($this->query_out_transaction_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 get_client_transactions($client_id)\n {\n $sql=\"SELECT * FROM transactions where client_id=$client_id order by trans_date desc\";\n $q=$this->db->query($sql);\n return $q->result_array();\n }", "public function lineGraphInterface()\n {\n date_default_timezone_set('Asia/Jakarta');\n // echo 'Indonesian Timezone: ' . date('d-m-Y H:i:s');\n $interface = $this->input->post('iface');\n $first_date = $this->input->post('start');\n $last_date = $this->input->post('end');\n $graphs = $this->statistic->getDataInterface(array('interface' => $interface, 'first_date' => $first_date, 'last_date' => $last_date));\n $stat = $this->statistic->getStatisticInterface(array('interface'=> $interface ,'first_date' => $first_date, 'last_date' => $last_date));\n // echo '<pre>';\n // print_r($graph);\n $row = array (\n 'tx' => array(), \n 'rx' => array(),\n 'stat' => $stat\n );\n foreach($graphs as $graph){\n $row['tx'][] = [strtotime($graph->time)*1000,round($graph->tx)];\n\t\t\t$row['rx'][] = [strtotime($graph->time)*1000,round($graph->rx)];\n // $row['point'][] = date('H:i:s', strtotime($graph->time));\n // if(date('H:i:s', strtotime($graph->time))=='00:00:00'){\n // $time = date('Y-m-d H:i:s', strtotime($graph->time));\n // }else{\n // $time = date('H:i:s', strtotime($graph->time));\n // }\n\t\t\t// $row['point'][] = $time;\n }\n // $result = $row;\n // echo \"<pre>\";\n // echo $last_date;\n // print_r($time = date('H:i:s', strtotime($first_date)));\n echo json_encode($row);\n }", "static function getPaymentBookingHistory() {\n global $wpdb;\n $resultset = $wpdb->get_results(\n \"SELECT t.reservation_id, t.booking_reference, t.first_name, t.last_name, t.email, t.vendor_tx_code, t.payment_amount, a.auth_status, a.auth_status_detail, a.card_type, a.last_4_digits, a.processed_date\n FROM wp_sagepay_transaction t\n INNER JOIN wp_sagepay_tx_auth a ON t.vendor_tx_code = a.vendor_tx_code\n WHERE t.reservation_id IS NOT NULL\n UNION ALL \n SELECT reservation_id, booking_reference, first_name, last_name, email, vendor_tx_code, \n payment_amount, auth_status, auth_status_detail, card_type, last_4_digits, processed_date\n FROM wp_stripe_transaction\n WHERE processed_date IS NOT NULL\n AND booking_reference IS NOT NULL\n ORDER BY processed_date DESC\n LIMIT 100\" );\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n return $resultset;\n }", "private function getTraffic() {//Irá verificar na tabela se os dados do dia existem\n $readSiteViews = new Read; //Aqui ocorrendo uma composição\n $readSiteViews->ExeRead('siteviews', \"WHERE siteviews_date = :date\", \"date={$this->Date}\");\n if ($readSiteViews->getRowCount())://Verifica se a leitura retornou resultado\n $this->Traffic = $readSiteViews->getResult()[0]; //Pega apenas o resultado atual, logo o Traffic vai armazenar os dados do dia recorrente\n endif;\n }", "public function getHistoricalTrades($symbol, $fromId = NULL, $limit = NULL);", "function get_statistics_data_view($params)\r\n {\r\n $params = (object)$params;\r\n $default_params = (object)array(\r\n 'user_id' => USER_ID,\r\n 'sdate' => date('Y-m-d'),\r\n 'edate' => date('Y-m-d', strtotime(\"-1 week\"))\r\n );\r\n foreach($default_params as $key => $value){\r\n if(!isset($params->{$key}))\r\n $params->{$key} = $value;\r\n }\r\n \r\n $period = new DatePeriod(\r\n new DateTime($params->sdate),\r\n new DateInterval('P1D'),\r\n new DateTime($params->edate)\r\n );\r\n\r\n $data = array();\r\n \r\n $sql = \"SELECT \r\n date_format(v.regdate, '%Y-%m-%d') as date,\r\n count(v.id) as log_count,\r\n count(distinct v.work_id) as work_count\r\n from\r\n log_work_view as v\r\n left join works on works.work_id = v.work_id\r\n where\r\n works.user_id = ?\r\n and v.regdate between ? and ?\r\n group by date\"; \r\n $query = $this->db->query($sql, array($params->user_id, $params->sdate, $params->edate));\r\n foreach ($query->result() as $row)\r\n {\r\n $data[$row->date] = $row->log_count;\r\n }\r\n\r\n $output = array();\r\n foreach ($period as $date) {\r\n $dateString = $date->format('Y-m-d');\r\n $output[$dateString] = (empty($data[$dateString]))?0:$data[$dateString];\r\n }\r\n\r\n return $output;\r\n }", "public function getAll()\n {\n return $this->transactions;\n }", "function getAttnDataLast(){\n\t\t\n\t\t$lim= isset($_REQUEST['limit'])?$_REQUEST['limit']:'0';\n\t\t$orgid = isset($_REQUEST['refno'])?$_REQUEST['refno']:'0';\n\t\t$datafor= isset($_REQUEST['datafor'])?$_REQUEST['datafor']:'';\n\t\t//$datafor= isset($_REQUEST['datafor'])?$_REQUEST['datafor']:'';\n\t\t$zone = getTimeZone($orgid);\n date_default_timezone_set($zone);\n\t\t$end = date(\"Y-m-d\");\n $start = date(\"Y-m-d\");\n\t\t$data=array();\n\t\tif($lim=='l7'){ // Last 7 days\n\t\t\t$end = date(\"Y-m-d\", strtotime(\"-1 days\"));\n\t\t\t$end1 = date(\"Y-m-d\", strtotime(\"-1 days\"));\n $start = date(\"Y-m-d\", strtotime('-6 day', strtotime($end)));\n $start1 = date(\"Y-m-d\", strtotime('-6 day', strtotime($end)));\n\t\t\t$start = \\DateTime::createFromFormat('Y-m-d', $start);\n $end = \\DateTime::createFromFormat('Y-m-d', $end);\n\t\t}else if($lim=='l30'){ // Last 30 days\n\t\t\t$end = date(\"Y-m-d\", strtotime(\"-1 days\"));\n $start = date(\"Y-m-d\", strtotime('-29 day', strtotime($end)));\n\t\t\t$end1 = date(\"Y-m-d\", strtotime(\"-1 days\"));\n $start1 = date(\"Y-m-d\", strtotime('-29 day', strtotime($end)));\n\t\t\t$start = \\DateTime::createFromFormat('Y-m-d', $start);\n $end = \\DateTime::createFromFormat('Y-m-d', $end);\n\t\t}\n\t\t$datePeriod = new \\DatePeriod($start, new \\DateInterval('P1D'), $end->modify('+1day'));\n\t\t///////getting data\n\t\t\t\n\t\t\tif($datafor=='present'){\n\t\t\t\t$res = array();\n\t\t\t\tforeach ($datePeriod as $date) {\n\t\t\t\t\t$dt = $date->format('Y-m-d');\n\t\t\t\t\t$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , `TimeIn`, `TimeOut` ,AttendanceDate FROM `AttendanceMaster` WHERE `AttendanceDate` ='\" . $dt . \"' and `OrganizationId`=\" . $orgid . \" and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = $orgid AND Is_Delete = 0) order by DATE(AttendanceDate) desc,name\");\n\t\t\t\t\t//$res[] = $query->result();\n\t\t\t\t\t$data['elist'][] = $query->result();\n\t\t\t\t}\n\t\t\t}else if($datafor=='absent'){\n\t\t\t\t$res = array();\n\n\t\t\t\t$query = $this->db->query(\"SELECT EmployeeId , AttendanceDate FROM `AttendanceMaster` WHERE OrganizationId = ? and AttendanceStatus in (2,6,7) and `AttendanceDate` between ? and ? AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = $orgid AND Is_Delete = 0) order by AttendanceDate \", array($orgid , $start1 , $end1));\n\t\t\t\tforeach ($query->result() as $row) {\n\t\t\t\t\t\t\t$data1 = array();\n\t\t\t\t\t\t\t//$data['name']=ucwords(getEmpName($row->Id));\n\t\t\t\t\t\t\t$data1['name'] = getEmpName($row->EmployeeId);\n\t\t\t\t\t\t\t$data1['AttendanceDate'] = date(\"Y-m-d\", strtotime($row->AttendanceDate));\n\t\t\t\t\t\t\t$data1['TimeIn'] = '-';\n\t\t\t\t\t\t\t$data1['TimeOut'] = '-';\n\t\t\t\t\t\t\t$res[] = $data1;\n\t\t\t\t\t\t}\n\t\t\t\t$data['elist'][] =array_reverse($res);\n\t\t\t}else if($datafor=='latecomings'){\n\t\t\t\t$res = array();\n\t\t\t\tforeach ($datePeriod as $date) {\n\t\t\t\t\t$dt = $date->format('Y-m-d');\n\t\t\t\t\t$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , `TimeIn`, `TimeOut` ,AttendanceDate FROM `AttendanceMaster` WHERE (time(TimeIn) > (select time(TimeIn) from ShiftMaster where ShiftMaster.Id=shiftId)) and `AttendanceDate` ='\" . $dt . \"' and `OrganizationId`=\" . $orgid . \" and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = $orgid AND Is_Delete = 0) order by DATE(AttendanceDate) desc,name\");\n\t\t\t\t\t$res[] = $query->result();\n\t\t\t\t}\n\t\t\t\t$data['elist'] = $res;\n\t\t\t}else if($datafor=='earlyleavings'){\n\t\t\t\t$res = array();\n\t\t\t\tforeach ($datePeriod as $date) {\n\t\t\t\t\t$dt = $date->format('Y-m-d');\n\t\t\t\t\t\t$query = $this->db->query(\"select Shift,Id , FirstName , LastName from EmployeeMaster where OrganizationId = $orgid and Id IN (select EmployeeId from AttendanceMaster where OrganizationId = $orgid and AttendanceDate='$dt ' and TimeIn != '00:00:00' ) AND is_Delete=0 order by FirstName\");\n\t\t\t\t\t $innerarr = array();\n\t\t\t\t\t $cond = '';\n\t\t\t\t\tforeach ($query->result() as $row) {\n\t\t\t\t\t\t$ShiftId = $row->Shift;\n\t\t\t\t\t\t$EId = $row->Id;\n\t\t\t\t\t\t$query = $this->db->query(\"select TimeIn,TimeOut,shifttype from ShiftMaster where Id = $ShiftId\");\n\t\t\t\t\t\tif ($data123 = $query->row()) {\n\t\t\t\t\t\t\t$shiftout = $data123->TimeOut;\n\t\t\t\t\t\t\t$shiftout1 = $dt. ' '.$data123->TimeOut;\n\t\t\t\t\t\t\tif($data123->shifttype==2)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$nextdate = date('Y-m-d',strtotime($dt . \"+1 days\"));\n\t\t\t\t\t\t\t\t $shiftout1 = $nextdate.' '.$data123->TimeOut;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$shift = substr($data123->TimeIn, 0, 5) . ' - ' . substr($data123->TimeOut, 0, 5);\n\t\t\t\t\t\t\t$ct = date('H:i:s');\n\t\t\t\t\t\t\t\t$query333 = $this->db->query(\"select SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out from AttendanceMaster where EmployeeId =$EId and if(timeoutdate = '0000-00-00' , TimeOut < '$shiftout' , CONCAT(timeoutdate,' ' ,TimeOut) < '$shiftout1' ) and AttendanceDate='$dt' and TimeOut !='00:00:00' \");\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\tif ($row333 = $query333->row()) {\n\t\t\t\t\t\t\t\t\t$a = new DateTime($row333->TimeOut);\n\t\t\t\t\t\t\t\t\t$b = new DateTime($data123->TimeOut);\n\t\t\t\t\t\t\t\t\t$interval = $a->diff($b);\n\t\t\t\t\t\t\t\t\t$data1['earlyby'] = $interval->format(\"%H:%I\");\n\t\t\t\t\t\t\t\t\t$data1['timeout'] = substr($row333->TimeOut, 0, 5);\n\t\t\t\t\t\t\t\t\t$data1['name'] = $row->FirstName . ' ' . $row->LastName;\n\t\t\t\t\t\t\t\t\t$data1['shift'] = $shift;\n\t\t\t\t\t\t\t\t\t$data1['status'] = $row333->status;\n\t\t\t\t\t\t\t\t\t$data1['TimeIn'] = $row333->TimeIn;\n\t\t\t\t\t\t\t\t\t$data1['TimeOut'] = $row333->TimeOut;\n\t\t\t\t\t\t\t\t\t$data1['AttendanceDate'] = $dt;\n\t\t\t\t\t\t\t\t\t$innerarr[] = $data1;\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$res[] = $innerarr;\n\t\t\t\t}\n\t\t\t\t$data['elist'] = $res;\n\t\t\t}\n\t\t\t\n\t\t///////getting data/\n\t\techo json_encode($data);\n\t\t////////////\n\n\t}", "public function getBuyerHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $buyer = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($dateQuery.',count(distinct buyer_id)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['buyer'] = $buyer;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function whmcs_get_transactions($params = array()) {\n\t\t$params['action'] = 'GetTransactions';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "public function getTradeLog($userId, $skipCount, $filter, $dateFilter): array {\n\n $result = $selling = $buying = $last100Entries = $ids = [];\n $result['log'] = $result['timestamps'] = $result['days'] = $result['overview'] = [];\n $result['selling']['total'] = $result['buying']['total'] = $result['selling']['valuesById'] = $result['buying']['valuesById'] = 0;\n\n for($i = 0; $i <= 23; ++$i) {\n $result['timestamps'][$i] = 0;\n }\n\n for($event = 0; $event <= 1; ++$event) {\n for($i = 0; $i <= 57; ++$i) {\n $getSumQuery = 'SELECT SUM(`amount` * `price`) as `sum` FROM `userTradeLog_' . $userId . '` WHERE `event` = ' . $event . ' AND `itemId` = ' . $i . '';\n $getSum = $this->_conn->query($getSumQuery);\n\n if($getSum->num_rows === 1) {\n while($data = $getSum->fetch_assoc()) {\n\n if($event === 0) {\n $targetArr = 'buying';\n } else {\n $targetArr = 'selling';\n }\n\n ${$targetArr}[$i] = $data['sum'];\n }\n }\n }\n }\n\n $result['selling']['total'] = array_sum($selling);\n $result['selling']['valuesById'] = $selling;\n\n $result['buying']['total'] = array_sum($buying);\n $result['buying']['valuesById'] = $buying;\n\n // selling hours\n $getTimestampsQuery = 'SELECT `timestamp` FROM `userTradeLog_' . $userId . '` WHERE `event` = 1';\n $getTimestamps = $this->_conn->query($getTimestampsQuery);\n\n if($getTimestamps->num_rows > 0) {\n while($data = $getTimestamps->fetch_assoc()) {\n ++$result['timestamps'][date('G', $data['timestamp'])];\n }\n }\n\n // skipCount\n $mostRecentEntryQuery = 'SELECT `timestamp` FROM `userTradeLog_' . $userId . '` ORDER BY `timestamp` DESC LIMIT 1';\n $mostRecentEntry = $this->_conn->query($mostRecentEntryQuery);\n if($mostRecentEntry->num_rows === 1) {\n $mostRecentEntry = $mostRecentEntry->fetch_assoc();\n }\n\n if(!$skipCount) {\n $skipCount = 0;\n $start = $mostRecentEntry['timestamp'];\n $end = strtotime('midnight', $mostRecentEntry['timestamp']);\n } else {\n $end = strtotime('midnight', $mostRecentEntry['timestamp']) - $skipCount * 86400;\n $start = strtotime('tomorrow', $mostRecentEntry['timestamp']) - $skipCount * 86400;\n }\n\n if($dateFilter) {\n $skipCount = 0;\n $start = $dateFilter + 86400;\n $end = $dateFilter;\n }\n\n $result['skipCount'] = $skipCount;\n\n // filter\n if(!isset($filter) || $filter === -1) {\n $filter = -1;\n $addFilter = '';\n } elseif($filter >= -1) {\n $addFilter = ' AND `event` = ' . $filter;\n }\n\n $result['filter'] = $filter;\n\n // individual days filter\n $getDaysAndEntriesCountQuery = 'SELECT DATE(FROM_UNIXTIME(`timestamp`)) AS `date`, COUNT(1) AS `entries` FROM `userTradeLog_' . $userId . '` GROUP BY DATE(FROM_UNIXTIME(`timestamp`)) ORDER BY `date` DESC';\n $getDaysAndEntriesCount = $this->_conn->query($getDaysAndEntriesCountQuery);\n\n if($getDaysAndEntriesCount->num_rows > 0) {\n while($data = $getDaysAndEntriesCount->fetch_assoc()) {\n\n $arr = [\n 'date' => $data['date'],\n 'entries' => $data['entries'],\n ];\n\n $result['days'][] = $arr;\n }\n }\n\n $getMostRecentEntriesQuery = 'SELECT `actor`, `actorLevel`, `transportCost`, `amount`, `price`, `itemId`, `timestamp`, `event` FROM `userTradeLog_' . $userId . '` WHERE `timestamp` > ' . $end . ' AND `timestamp` <= ' . $start . ' ' . $addFilter . ' ORDER BY `timestamp` DESC';\n $getMostRecentEntries = $this->_conn->query($getMostRecentEntriesQuery);\n\n if($getMostRecentEntries->num_rows > 0) {\n while($data = $getMostRecentEntries->fetch_assoc()) {\n $result['log'][] = $data;\n }\n }\n\n // overview\n $distinctIdsQuery = 'SELECT DISTINCT(`itemId`) AS `id` FROM `userTradeLog_' . $userId . '` WHERE `timestamp` > ' . $end . ' AND `timestamp` <= ' . $start;\n $distinctIds = $this->_conn->query($distinctIdsQuery);\n\n if($distinctIds->num_rows > 0) {\n while($data = $distinctIds->fetch_assoc()) {\n $ids[] = $data['id'];\n }\n }\n\n foreach($ids as $id) {\n $sellSumQuery = 'SELECT SUM(`amount` * `price`) AS `sumSell` FROM `userTradeLog_' . $userId . '` WHERE `timestamp` > ' . $end . ' AND `timestamp` <= ' . $start . ' AND `event` = 1 AND `itemId` = ' . $id . '';\n $sellSum = $this->_conn->query($sellSumQuery);\n\n if($sellSum->num_rows === 1) {\n while($data = $sellSum->fetch_assoc()) {\n $positive = $data['sumSell'];\n }\n }\n\n $buySumQuery = 'SELECT SUM(`amount` * `price`) AS `sumBuy` FROM `userTradeLog_' . $userId . '` WHERE `timestamp` > ' . $end . ' AND `timestamp` <= ' . $start . ' AND `event` = 0 AND `itemId` = ' . $id . '';\n $buySum = $this->_conn->query($buySumQuery);\n\n if($buySum->num_rows === 1) {\n while($data = $buySum->fetch_assoc()) {\n $negative = $data['sumBuy'];\n }\n }\n\n if($positive === NULL) {\n $positive = 0;\n }\n\n if($negative === NULL) {\n $negative = 0;\n }\n\n $result['overview'][$id] = [\n 'itemId' => $id,\n 'sum' => $positive - $negative,\n 'bought' => $negative,\n 'sold' => $positive,\n ];\n }\n\n usort($result['overview'], function($a, $b) {\n return $b['sum'] - $a['sum'];\n });\n\n return $result;\n }", "public function last24hours($dateP)\n {\n\n $comments = Comment::all();\n $data = $comments->toArray();\n\n\t\t$data = Comment::where('created_at', '>', $dateP)\n ->groupBy(\\DB::raw('DATE(created_at)'))\n ->count();\n\n $response = [\n 'date' => $dateP,\n 'commentsNumber' => $data\n ];\n\n return response()->json($response, 200);\n }", "public function gettransaction($transaction){\n return $this->bitcoin->gettransaction($transaction);\n }", "static public function get($session)\n{\n $receipt = ReceiptLib::biggerFont(\"Transaction Summary\").\"\\n\\n\";\n $receipt .= ReceiptLib::biggerFont(date('D M j Y - g:ia')).\"\\n\\n\";\n\t$report_params = array();\n\n\t$lane_db = Database::tDataConnect();\n if ($lane_db->isConnected('core_translog')) {\n\t $this_lane = $session->get('laneno');\n\t\t$transarchive = 'localtranstoday';\n\t\t$opdata_dbname = 'core_opdata';\n\t\t$report_params += array(\n\t\t\t\"Lane {$this_lane} tender\" => \"\n\t\t\t\t\tSELECT\n\t\t\t\t\t\t'Lane {$this_lane} tenders' Plural,\n\t\t\t\t\t\tDATE_FORMAT(d.datetime, '%Y-%m-%d') TransDate,\n\t\t\t\t\t\tt.TenderName GroupLabel,\n\t\t\t\t\t\tCOUNT(*) GroupQuantity,\n\t\t\t\t\t\t'transaction' GroupQuantityLabel,\n\t\t\t\t\t\t-SUM(d.total) GroupValue\n\t\t\t\t\tFROM {$transarchive} d\n\t\t\t\t\t\tLEFT JOIN {$opdata_dbname}.tenders t ON d.trans_subtype = t.TenderCode\n\t\t\t\t\tWHERE d.emp_no != 9999 AND d.register_no != 99\n\t\t\t\t\t\tAND d.trans_status != 'X'\n\t\t\t\t\t\tAND d.trans_type = 'T'\n\t\t\t\t\t\tAND DATE_FORMAT(d.datetime, '%Y-%m-%d') = (SELECT MAX(DATE_FORMAT(datetime, '%Y-%m-%d')) FROM {$transarchive})\n\t\t\t\t\tGROUP BY t.tenderName\n\t\t\t\t\tORDER BY\n\t\t\t\t\t\tFIELD(d.trans_subtype, 'CA', 'CK', 'CC', 'DC', 'EF', d.trans_subtype),\n\t\t\t\t\t\td.trans_subtype\n\t\t\t\t\",\n\t\t\t);\n\t}\n\n\tif ($this_lane > 1) {\n\t\t$receipt .= \"\\n\";\n\t\t$receipt .= ReceiptLib::boldFont();\n\t\t$receipt .= \"Printing lane data only.\";\n\t\t$receipt .= ReceiptLib::normalFont();\n\t\t$receipt .= \"\\n\";\n\n\t\t$office_db = Database::tDataConnect();\n\t\t$office_dbname = $session->get('tDatabase'); //'lane';\n\t\t$transarchive = 'localtrans';\n\t\t$opdata_dbname = 'core_opdata';\n\t}\n\telse {\n\t\t$office_host = $session->get('mServer');\n\t\t$office_ping = shell_exec(\"ping -q -t2 -c3 {$office_host}\");\n\t\t$office_live = (preg_match('~0 packets received~', $office_ping)? false : true);\n\n\t\tif ($office_live) {\n\t\t\t$office_db = Database::mDataConnect();\n\t\t\tif (!$office_db->isConnected($session->get('mDatabase'))) {\n\t\t\t\t$office_live = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($office_live) {\n\t\t\t$office_dbname = $session->get('mDatabase'); //'office';\n\t\t\t$transarchive = 'dtransactions';\n\t\t\t$opdata_dbname = 'office_opdata';\n\t\t}\n\t\telse {\n\t\t\t$receipt .= \"\\n\";\n\t\t\t$receipt .= ReceiptLib::boldFont();\n\t\t\t$receipt .= \"Server is unavailable; printing lane data only.\";\n\t\t\t$receipt .= ReceiptLib::normalFont();\n\t\t\t$receipt .= \"\\n\";\n\n\t\t\t$office_db = Database::tDataConnect();\n\t\t\t$office_dbname = $session->get('tDatabase'); //'lane';\n\t\t\t$transarchive = 'localtrans';\n\t\t\t$opdata_dbname = 'core_opdata';\n\t\t}\n\n\t\t$report_params += array(\n\t\t\t'department' => \"\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t'departments' Plural,\n\t\t\t\t\t\t\tDATE_FORMAT(d.datetime, '%Y-%m-%d') TransDate,\n\t\t\t\t\t\t\tCONCAT_WS(' ', t.dept_no, t.dept_name) GroupLabel,\n\t\t\t\t\t\t\tSUM(IF(d.department IN (102, 113) OR d.scale = 1, 1, d.quantity)) GroupQuantity,\n\t\t\t\t\t\t\t'item' GroupQuantityLabel,\n\t\t\t\t\t\t\tSUM(d.total) GroupValue\n\t\t\t\t\t\tFROM {$transarchive} d\n\t\t\t\t\t\t\tLEFT JOIN {$opdata_dbname}.departments t ON d.department=t.dept_no\n\t\t\t\t\t\tWHERE d.emp_no != 9999 AND d.register_no != 99\n\t\t\t\t\t\t\tAND d.trans_status != 'X'\n\t\t\t\t\t\t\tAND d.department != 0\n\t\t\t\t\t\t\tAND DATE_FORMAT(d.datetime, '%Y-%m-%d') = (SELECT MAX(DATE_FORMAT(datetime, '%Y-%m-%d')) FROM {$transarchive})\n\t\t\t\t\t\tGROUP BY t.dept_no\n\t\t\t\t\t\",\n\t\t\t'tax' => \"\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t'taxes' Plural,\n\t\t\t\t\t\t\tDATE_FORMAT(d.datetime, '%Y-%m-%d') TransDate,\n\t\t\t\t\t\t\tIF(d.total = 0, 'Non-taxed', 'Taxed') GroupLabel,\n\t\t\t\t\t\t\tCOUNT(*) GroupQuantity,\n\t\t\t\t\t\t\t'transaction' GroupQuantityLabel,\n\t\t\t\t\t\t\tSUM(d.total) GroupValue\n\t\t\t\t\t\tFROM {$transarchive} d\n\t\t\t\t\t\tWHERE d.emp_no != 9999 AND d.register_no != 99\n\t\t\t\t\t\t\tAND d.trans_status != 'X'\n\t\t\t\t\t\t\tAND d.trans_type = 'A' AND d.upc = 'TAX'\n\t\t\t\t\t\t\tAND DATE_FORMAT(d.datetime, '%Y-%m-%d') = (SELECT MAX(DATE_FORMAT(datetime, '%Y-%m-%d')) FROM {$transarchive})\n\t\t\t\t\t\tGROUP BY (total = 0)\n\t\t\t\t\t\",\n\t\t\t'discount' => \"\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t'discounts' Plural,\n\t\t\t\t\t\t\tDATE_FORMAT(d.datetime, '%Y-%m-%d') TransDate,\n\t\t\t\t\t\t\tCONCAT(d.percentDiscount, '%') GroupLabel,\n\t\t\t\t\t\t\tCOUNT(*) GroupQuantity,\n\t\t\t\t\t\t\t'transaction' GroupQuantityLabel,\n\t\t\t\t\t\t\t-SUM(d.total) GroupValue\n\t\t\t\t\t\tFROM {$transarchive} d\n\t\t\t\t\t\tWHERE d.emp_no != 9999 AND d.register_no != 99\n\t\t\t\t\t\t\tAND d.trans_status != 'X'\n\t\t\t\t\t\t\tAND d.trans_type = 'S' AND d.upc = 'DISCOUNT'\n\t\t\t\t\t\t\tAND DATE_FORMAT(d.datetime, '%Y-%m-%d') = (SELECT MAX(DATE_FORMAT(datetime, '%Y-%m-%d')) FROM {$transarchive})\n\t\t\t\t\t\tGROUP BY percentDiscount\n\t\t\t\t\t\",\n\t\t\t'tender' => \"\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t'tenders' Plural,\n\t\t\t\t\t\t\tDATE_FORMAT(d.datetime, '%Y-%m-%d') TransDate,\n\t\t\t\t\t\t\tt.TenderName GroupLabel,\n\t\t\t\t\t\t\tCOUNT(*) GroupQuantity,\n\t\t\t\t\t\t\t'transaction' GroupQuantityLabel,\n\t\t\t\t\t\t\t-SUM(d.total) GroupValue\n\t\t\t\t\t\tFROM {$transarchive} d\n\t\t\t\t\t\t\tLEFT JOIN {$opdata_dbname}.tenders t ON d.trans_subtype = t.TenderCode\n\t\t\t\t\t\tWHERE d.emp_no != 9999 AND d.register_no != 99\n\t\t\t\t\t\t\tAND d.trans_status != 'X'\n\t\t\t\t\t\t\tAND d.trans_type = 'T'\n\t\t\t\t\t\t\tAND DATE_FORMAT(d.datetime, '%Y-%m-%d') = (SELECT MAX(DATE_FORMAT(datetime, '%Y-%m-%d')) FROM {$transarchive})\n\t\t\t\t\t\tGROUP BY t.tenderName\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\tFIELD(d.trans_subtype, 'CA', 'CK', 'CC', 'DC', 'EF', d.trans_subtype),\n\t\t\t\t\t\t\td.trans_subtype\n\t\t\t\t\t\",\n\t\t\t);\n\t}\n\n\tforeach ($report_params as $report => $query) {\n\t\t$receipt .= \"\\n\";\n\n\t\t$receipt .= ReceiptLib::boldFont();\n\t\t$receipt .= ReceiptLib::centerString(ucwords($report).' Report').\"\\n\";\n\t\t$receipt .= ReceiptLib::normalFont();\n\n\t\t$result = $office_db->query($query);\n\t\tif (!$result) $result = $lane_db->query($query);\n\n\t\t$total_quantity = $total_value = 0;\n\t\t$plural = $group_label = $group_quantity = $group_quantity_label = $group_value = '';\n\n\t\twhile ($row = $office_db->fetchRow($result)) {\n\t\t\t$plural = $row['Plural'];\n\t\t\t$group_label = $row['GroupLabel'];\n\t\t\t$group_quantity = $row['GroupQuantity'];\n\t\t\t$group_quantity_label = $row['GroupQuantityLabel'];\n\t\t\t$group_value = $row['GroupValue'];\n\n\t\t\t$total_quantity += $group_quantity;\n\t\t\t$total_value += $group_value;\n\n\t\t\t$group_quantity = rtrim(number_format($group_quantity, 3), '.0');\n\t\t\t$group_value = number_format($group_value, 2);\n\n\t\t\t$receipt .= ReceiptLib::boldFont();\n\t\t\t$receipt .= \"{$group_label}: \";\n\t\t\t$receipt .= ReceiptLib::normalFont();\n\t\t\t$receipt .= \"\\${$group_value} from {$group_quantity} {$group_quantity_label}\".($group_quantity==1?'':'s').\"\\n\";\n\t\t}\n\t\tswitch ($report) {\n\t\t\tcase 'department':\n\t\t\tcase 'tax':\n\t\t\tcase 'discount':\n\t\t\tcase 'tender':\n\t\t\t\t$total_values[$report] = $total_value;\n\t\t\tdefault:\n\t\t}\n\n\t\t$total_quantity = rtrim(number_format($total_quantity, 3), '.0');\n\t\t$total_value = number_format($total_value, 2);\n\n\t\t$receipt .= ReceiptLib::boldFont();\n\t\tif ($plural) {\n\t\t\t$receipt .= \"All \".ucwords($plural).\": \\${$total_value} from {$total_quantity} {$group_quantity_label}\".($total_quantity==1?'':'s').\"\\n\";\n\t\t}\n\t\telse {\n\t\t\t$receipt .= \"No data match in {$office_dbname}.{$transarchive}\\n\";\n\t\t}\n\t\t$receipt .= ReceiptLib::normalFont();\n\t}\n\n\t$checksum = 0;\n\t$receipt .= \"\\n\";\n\tforeach ($total_values as $report => $total_value) {\n\t\tswitch ($report) {\n\t\t\tcase 'department':\n\t\t\tcase 'tax':\n\t\t\t\t$sign = +1;\n\t\t\t\tbreak;\n\t\t\tcase 'discount':\n\t\t\tcase 'tender':\n\t\t\t\t$sign = -1;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcontinue;\n\t\t}\n\t\t$checksum += ($sign * $total_value);\n\t\t$total_value = number_format($total_value, 2);\n\n\t\t$receipt .= \"\\n\";\n\t\t$receipt .= str_repeat(' ', 8);\n\t\t$receipt .= ReceiptLib::boldFont();\n\t\t$receipt .= ucwords($report).' Total:';\n\t\t$receipt .= ReceiptLib::normalFont();\n\t\t$receipt .= str_repeat(' ', 32 - strlen(\"{$report}{$total_value}\"));\n\t\t$receipt .= ($sign < 0? '-' : '+') . \" \\${$total_value}\";\n\t}\n\tif ($sign) {\n\t\t$checksum = number_format($checksum, 2);\n\t\tif ($checksum === '-0.00') $checksum = '0.00'; // remove possible floating point sign error\n\n\t\t$receipt .= \"\\n\";\n\t\t$receipt .= str_repeat(' ', 38);\n\t\t$receipt .= str_repeat('_', 14);\n\t\t$receipt .= \"\\n\";\n\t\t$receipt .= str_repeat(' ', 8);\n\t\t$receipt .= ReceiptLib::boldFont();\n\t\t$receipt .= 'Checksum (should be zero):';\n\t\t$receipt .= str_repeat(' ', 15 - strlen(\"{$checksum}\"));\n\t\t$receipt .= \"\\${$checksum}\";\n\t\t$receipt .= ReceiptLib::normalFont();\n\t}\n\n $receipt .= \"\\n\";\n $receipt .= \"\\n\";\n $receipt .= ReceiptLib::centerString(\"------------------------------------------------------\");\n $receipt .= \"\\n\";\n\n $receipt .= str_repeat(\"\\n\", 4);\n $receipt .= chr(27).chr(105); // cut\n return $receipt;\n}", "public function postDashboard(Request $request) {\n $graphdata = array();\n $period = $request->input('period');\n $grouping = $request->input('grouping');\n $chart = $request->input('chart');\n $stat = $request->input('stat');\n $fromDate = $request->input('fromDate');\n $thruDate = $request->input('thruDate');\n $query = 'SELECT ';\n if($grouping == 'Product') {\n $query = $query . \"products.product_name as 'Group',\";\n } elseif ($grouping == 'Category') {\n $query = $query . \"categories.category_name as 'Group',\";\n } else {\n $query = $query . \"CONCAT(salespeople.last_name,', ',salespeople.first_name) as 'Group',\";\n }\n $query = $query . \"sum(quantity) as 'Quantity',\";\n $query = $query . \"sum(products.price * quantity) as 'Dollars' \";\n $query = $query . \"FROM sales_transactions \";\n if($grouping == 'Product') {\n $query = $query . \"INNER JOIN products ON sales_transactions.product_id = products.id \";\n $query = $query . \" WHERE transaction_date between '\" . $fromDate . \"' and '\" . $thruDate . \"' \";\n $query = $query . \"GROUP BY product_name\";\n } elseif ($grouping == 'Category') {\n $query = $query . \"INNER JOIN products ON sales_transactions.product_id = products.id \";\n $query = $query . \"INNER JOIN categories ON products.category_id = categories.id \";\n $query = $query . \" WHERE transaction_date between '\" . $fromDate . \"' and '\" . $thruDate . \"' \";\n $query = $query . \"GROUP BY categories.category_name\";\n } else {\n $query = $query . \"INNER JOIN salespeople ON sales_transactions.salesperson_id = salespeople.id \";\n $query = $query . \"INNER JOIN products ON sales_transactions.product_id = products.id \";\n $query = $query . \" WHERE transaction_date between '\" . $fromDate . \"' and '\" . $thruDate . \"' \";\n $query = $query . \"GROUP BY CONCAT(salespeople.last_name,', ',salespeople.first_name)\";\n }\n if($stat == 'Quantity') {\n $query = $query . \" ORDER BY sum(quantity) DESC\";\n } else {\n $query = $query . \" ORDER BY sum(products.price * quantity) DESC\";\n }\n\n\n $graphdata = \\DB::select($query);\n\n // if the result set has more than 10 rows, need to group the results in 10 and higher into category of \"other\"\n $other = array();\n if (count($graphdata) > 10) {\n $graphdata2 = new \\Illuminate\\Database\\Eloquent\\Collection;\n for ($i=0; $i<10; $i++) {\n $graphdata2[$i] = $graphdata[$i];\n }\n $qty = 0;\n $dol = 0;\n for ($i=10; $i<count($graphdata); $i++) {\n $qty = $qty + $graphdata[$i]->Quantity;\n $dol = $dol + $graphdata[$i]->Dollars;\n }\n\n $other = \\DB::select(\"SELECT 'Other' as 'Group',\" . $qty . \" as 'Quantity',\" . $dol . \" as 'Dollars' FROM sales_transactions where id=1\");\n $graphdata = $graphdata2;\n }\n\n return view('salesdashboard')->with('graphdata',$graphdata)->with('grouping',$grouping)->with('period',$period)->with('chart',$chart)->with('query',$query)->with('stat',$stat)->with('other',$other)->with('fromDate',$fromDate)->with('thruDate',$thruDate);\n }", "public static function get_transactions()\n\t{\n\t\tglobal $user_ID;\n\t\t\n\t\t$args = array(\n\t\t\t'posts_per_page'\t=> -1,\n\t\t\t'post_type'\t\t\t=> 'pxp_transactions',\n\t\t\t'post_status'\t\t=> 'private',\n\t\t\t'order'\t\t\t\t=> 'date',\n\t\t\t'orderby'\t\t\t=> 'ASC',\n\t\t\t'author'\t\t\t=> $user_ID\n\t\t);\n\n\t\t$query = get_posts( $args );\n\t\t\n\t\t$transactions = array();\n\t\t\n\t\tforeach( $query as $transaction )\n\t\t{\n\t\t\t$transactions[] = array(\n\t\t\t\t'ID'\t\t\t\t\t\t=> $transaction->ID,\n\t\t\t\t'transaction_description'\t=> $transaction->post_content,\n\t\t\t\t'transaction_date'\t\t\t=> date( 'F j, Y g:i A', strtotime( $transaction->post_date ) ),\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $transactions;\n\t}" ]
[ "0.60542", "0.59338474", "0.57770365", "0.5693097", "0.5671071", "0.55951077", "0.5591348", "0.5587907", "0.5587562", "0.5577061", "0.5568402", "0.5552195", "0.55167", "0.5442502", "0.54316807", "0.54188687", "0.54127675", "0.538055", "0.5363416", "0.53165084", "0.52765894", "0.5261024", "0.5247327", "0.5244764", "0.5243848", "0.52236164", "0.52072436", "0.518796", "0.5181921", "0.51792264", "0.5148296", "0.5141149", "0.5141045", "0.51250094", "0.51226974", "0.5119457", "0.5111797", "0.5106506", "0.5105843", "0.5102252", "0.5095303", "0.5094731", "0.5085876", "0.5067271", "0.5053991", "0.50336474", "0.50307566", "0.50307566", "0.50307566", "0.50202775", "0.50175065", "0.5012193", "0.50118697", "0.5011547", "0.5002722", "0.50007117", "0.49945986", "0.4991399", "0.49911642", "0.4986328", "0.49850324", "0.498288", "0.4982184", "0.49819535", "0.4977294", "0.49674925", "0.4961591", "0.49589285", "0.4954871", "0.49538594", "0.495369", "0.49529585", "0.4951256", "0.49507284", "0.49416494", "0.49404055", "0.49401948", "0.49354035", "0.49333116", "0.49298713", "0.4921902", "0.49104008", "0.49048427", "0.49026898", "0.49025476", "0.48998728", "0.4896991", "0.4892475", "0.4886443", "0.4879476", "0.48765507", "0.4875408", "0.48749918", "0.4869315", "0.48687446", "0.48686293", "0.48566052", "0.4855858", "0.48551032", "0.48542768" ]
0.638745
0
Get transaction data for graph last 7 days
public function getTransactionDataLast7Days($customerId) { $to = $this->_date->date('Y-m-d'); $from = strtotime($to."-7days"); $from = $this->_date->date('Y-m-d', $from); $to .= ' 23:59:59'; $transactionResource = $this->_transactionFactory->create()->getResource(); $result = []; $data = $transactionResource->getReceivedCreditTransactionsByDay($from, $to, $customerId); $result = $this->_processReceivedTransactionData($data, $result); $data = $transactionResource->getSpentCreditTransactionsByDay($from, $to, $customerId); $result = $this->_processSpentTransactionData($data, $result); $result = array_values($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function graphData()\n {\n $dayOfWeek = ['Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo'];\n $colors = [\n 'rgba(201, 203, 207, 0.8)', //gray\n 'rgba(255, 99, 132, 0.8)', //Red\n 'rgba(255, 159, 64, 0.8)', //Orange\n 'rgba(75, 192, 192, 0.8)', //green\n 'rgba(54, 162, 235, 0.8)', //blue\n 'rgba(153, 102, 255, 0.8)', //purple\n 'rgba(255, 205, 86, 0.8)', //yellow\n ];\n $borderColors = [\n 'rgba(201, 203, 207, 1)', //gray\n 'rgba(255, 99, 132, 1)', //Red\n 'rgba(255, 159, 64, 1)', //Orange\n 'rgba(75, 192, 192, 1)', //green\n 'rgba(54, 162, 235, 1)', //blue\n 'rgba(153, 102, 255, 1)', //purple\n 'rgba(255, 205, 86, 1)', //yellow\n ];\n $months = ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'];\n $now = Carbon::now()->timezone($this->timezome);\n $data = [];\n\n switch ($this->graphPeriod) {\n case 'weekly':\n $data = $this->getDataFromWeeklySales($colors, $borderColors);\n break;\n case 'weeklyAccumulated':\n $data = $this->getDataFromWeeklySales($colors, $borderColors, true);\n break;\n case 'monthly':\n $labels = [];\n $date = $now->copy()->subMonths(5)->startOfMonth()->startOfDay();\n $end = $now->copy()->endOfDay();\n $count = 0;\n\n for ($i = 1; $i < 32; $i++) {\n $labels[] = $i;\n }\n\n while ($date->lessThanOrEqualTo($end)) {\n $label = $months[$date->month - 1];\n $data = [];\n $endOfMonth = $date->copy()->endOfMonth()->endOfDay();\n $sale = 0;\n\n while ($date->lessThanOrEqualTo($endOfMonth) && $date->lessThanOrEqualTo($end)) {\n $sale += $this->getSumFromGraphPeriod($date, $this->graphCategory);\n $data[] = $sale;\n $date->addDay();\n }\n\n $datasets[] = [\n 'label' => $label,\n 'backgroundColor' => $colors[$count],\n 'borderColor' => $borderColors[$count],\n 'borderWidth' => 1,\n 'data' => $data,\n 'fill' => false\n ];\n\n $count++;\n }\n\n $data = [\n 'labels' => $labels,\n 'datasets' => $datasets,\n 'type' => 'line'\n ];\n break;\n default:\n # code...\n break;\n }\n return $data;\n }", "public function getChartData() {\n $fromDate = Carbon::now()->subMinutes(60);\n $toDate = Carbon::now();\n\n $chart = new TaskActivity;\n $chartData = Auth::user()->tasks()->where('is_complete', 0)->whereBetween('created_at', [$fromDate, $toDate])->get()->pluck('created_at')->toArray();\n $arr = [];\n foreach ($chartData as $k => $c) {\n $add = $k + 1;\n array_push($arr, $add);\n }\n $chart->labels($chartData);\n $chart->dataset('Pending task', 'line', $arr);\n return $chart;\n }", "public function getLastSevenDaysRevenue() {\n $userClient = Auth::user()->clientID;\n\n if($userClient == 1) {\n \t\n $result = DB::select(\"SELECT calendar.datefield AS DATE,IFNULL(SUM(r.amount),0) AS total FROM request_logs r RIGHT JOIN calendar ON (DATE(r.date_created) = calendar.datefield) inner join transactions t on t.requestlogID = r.requestlogID inner join client_channels_reference ccr on t.channel_ref_id=ccr.channel_ref_id GROUP BY DATE DESC LIMIT 7\");\n } else {\n\n $result = DB::select(\"SELECT calendar.datefield AS DATE,IFNULL(SUM(r.amount),0) AS total FROM request_logs r RIGHT JOIN calendar ON (DATE(r.date_created) = calendar.datefield) inner join transactions t on t.requestlogID = r.requestlogID inner join client_channels_reference ccr on t.channel_ref_id=ccr.channel_ref_id WHERE ccr.clientID='$userClient' or ccr.destinationClientID='$userClient' GROUP BY DATE DESC LIMIT 7\");\n }\n\n \treturn $result;\n\n }", "public function getTransactionByHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $transaction = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, count(*),'.$dateQuery))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n // ->toSql();\n ->get();\n // dd ($data);\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['transaction'] = $transaction;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function getTransactionByHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $transaction = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, count(*),'.$dateQuery))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n // ->toSql();\n ->get();\n // dd ($data);\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['transaction'] = $transaction;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function getTransactions();", "public function findDataLast()\n {\n return $this->getEntityManager()\n ->createQuery(\"SELECT DISTINCT t.number, f.id as finance, f.price as cost, f.gotcarq as gotcarqId\n FROM GazMainBundle:Terminal t\n JOIN GazMainBundle:Finance f WITH f.terminal = t\n\t\t\t\t\t\t\tWHERE (f.gotcarq IS NOT NULL AND f.gotcarq != 0)\n\t\t\t\t\t\t\t AND f.created = (SELECT MIN(f1.created) FROM GazMainBundle:Finance f1\n LEFT JOIN f1.terminal t1\n WHERE t1.id = t.id AND f1.financeType = FALSE)\n\t\t\t\t\t\t\tORDER BY t.number ASC\n \")\n ->getResult();\n }", "public function getTransactionStats($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n // transaction count\n $currentTransactionCount = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('status', [$this->successStatus])\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n // ->groupBy('status')\n ->get();\n\n $prevTransactionCount = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('status', [$this->successStatus])\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n // ->groupBy('status')\n ->get();\n\n // total transaction\n $currentTransactionValue = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(total_price), 0), 0) as average'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->get();\n\n $prevTransactionValue = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(total_price), 0), 0) as average'))\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->get();\n\n // transaction status\n $transactionStatus = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('case when order_statuses.status then \\'sukses\\' else order_statuses.name end as status, count(*)'))\n // ->whereIn('status', [$this->successStatus])\n ->whereIn('order_statuses.name', $this->finalTransactionStatus)\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_statuses.name')\n ->groupBy('order_statuses.status')\n ->orderByRaw('count desc')\n ->get();\n\n $statuses = DB::connection('virtual_market')\n ->table('order_statuses')\n ->select(DB::raw('status'))\n ->get();\n\n $statusTrendData = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('status, count(*),'.$dateQuery))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_statuses.status')\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n $statusTrend = [];\n for($i=0; $i<count($statusTrendData); $i++){\n if(($i == 0) || ($prevDate != $statusTrendData[$i]->date)){\n if($i>0)\n array_push($statusTrend, $data);\n $data = array();\n $data['date'] = $statusTrendData[$i]->date;\n }\n $data[$statusTrendData[$i]->status] = $statusTrendData[$i]->count;\n $prevDate = $statusTrendData[$i]->date;\n if($i == count($statusTrendData)-1)\n array_push($statusTrend, $data);\n }\n\n // app platform (mobile / sms)\n $appPlatform = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('order_type as name, count(*)'))\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_type')\n ->get();\n\n $platforms = array();\n array_push($platforms, array('platform'=>'sms'));\n array_push($platforms, array('platform'=>'mobile'));\n\n $platformTrendData = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('order_type as platform, count(*),'.$dateQuery))\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_type')\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $platformTrend = [];\n for($i=0; $i<count($platformTrendData); $i++){\n if(($i == 0) || ($prevDate != $platformTrendData[$i]->date)){\n if($i>0)\n array_push($platformTrend, $data);\n $data = array();\n $data['date'] = $platformTrendData[$i]->date;\n }\n $data[$platformTrendData[$i]->platform] = $platformTrendData[$i]->count;\n $prevDate = $platformTrendData[$i]->date;\n if($i == count($platformTrendData)-1)\n array_push($platformTrend, $data);\n }\n\n\n $data = array();\n $data['transaction'] = array();\n $data['transaction']['count'] = array();\n $data['transaction']['count']['current'] = $currentTransactionCount[0];\n $data['transaction']['count']['prev'] = $prevTransactionCount[0];\n $data['transaction']['value'] = array();\n $data['transaction']['value']['current'] = $currentTransactionValue[0];\n $data['transaction']['value']['prev'] = $prevTransactionValue[0];\n\n $data['transaction_status'] = $transactionStatus;\n $data['transaction_status_trend'] = array();\n $data['transaction_status_trend']['statuses'] = $statuses;\n $data['transaction_status_trend']['granularity'] = $granularity;\n $data['transaction_status_trend']['trend'] = $statusTrend;\n $data['app_platform'] = $appPlatform;\n $data['app_platform_trend'] = array();\n $data['app_platform_trend']['platforms'] = $platforms;\n $data['app_platform_trend']['granularity'] = $granularity;\n $data['app_platform_trend']['trend'] = $platformTrend;\n \n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function buildVisitorsGraph(): \\Google_Service_Analytics_GaData\n {\n $startDate = Carbon::now()->subDays(7);\n\n $visitorsData = AnalyticsFacade::performQuery(\n Period::create($startDate, $this->endDate),\n 'ga:sessions,ga:pageviews',\n [\n 'dimensions' => 'ga:date',\n 'sort' => 'ga:date'\n ]\n );\n\n $visitorsGraph = [];\n foreach ($visitorsData->rows as $row) {\n $row[0] = Carbon::createFromFormat('Ymd', $row[0]);\n\n array_push($visitorsGraph, $row);\n }\n $visitorsData->rows = array_reverse($visitorsGraph);\n\n return $visitorsData;\n }", "public function getconnectTransactions() {\n $yesterday = new \\DateTime('yesterday');\n $start_date = $yesterday->format('Y-m-d');\n $today = new \\DateTime('now');\n $end_date = $today->format('Y-m-d');\n $status = ApplaneConstentInterface::COMPLETED;\n //create the query\n $query = $this->createQueryBuilder('c');\n $query->select()\n ->Where('c.date >=:create_at', 'c.date <:end_at', 'c.status =:status')\n ->setParameter('create_at', $start_date)\n ->setParameter('end_at', $end_date)\n ->setParameter('status', $status);\n\n $result = $query->getQuery();\n $result_res = $result->getResult();\n return $result_res;\n }", "public function getSentraData($query)\n {\n // config\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n\n $data = array();\n $data['granularity'] = $granularity;\n\n DB::enableQueryLog();\n // execute\n // TRANSACTION DATA\n // transaction count\n $currentTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('count(*)'))\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n $prevTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('count(*)'))\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n\n // total transaction value\n $currentTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n $prevTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n // transaction status\n $transactionStatus = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('orderline_statuses.name, count(*)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy('orderline_statuses.name')\n ->orderByRaw('count desc')\n ->get();\n\n $transactionHistory = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw($query['aggregate'].'as value, count(*),'.$dateQuery))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n // TRANSACTION\n $data['transaction'] = array();\n $data['transaction']['count'] = array();\n $data['transaction']['count']['current'] = $currentTransactionCount[0];\n $data['transaction']['count']['prev'] = $prevTransactionCount[0];\n $data['transaction']['value'] = array();\n $data['transaction']['value']['current'] = $currentTransactionValue[0];\n $data['transaction']['value']['prev'] = $prevTransactionValue[0];\n $data['transaction']['history'] = $transactionHistory;\n $data['transaction']['status'] = $transactionStatus;\n \n // BUYER\n $currentBuyers = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->distinct('buyer_id')\n ->count('buyer_id');\n\n $prevBuyers = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->distinct('buyer_id')\n ->count('buyer_id');\n\n $buyerHistory = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw($dateQuery.',count(distinct buyer_id)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data['buyer'] = array();\n $data['buyer']['count'] = array();\n $data['buyer']['count']['current'] = $currentBuyers;\n $data['buyer']['count']['prev'] = $prevBuyers;\n $data['buyer']['history'] = $buyerHistory;\n\n\n // PRODUCT\n $product = DB::connection('marketplace')\n ->table('orderlines')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->join('products', 'orderlines.product_id', '=', 'products.id')\n ->select(DB::raw('products.id, products.name, count(*), sum(quantity) as sums, sum(orderlines.subtotal) as value'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy('products.id')\n ->orderByRaw('sums desc, products.name asc')\n ->limit(5)\n ->get();\n\n for($i=0; $i<count($product); $i++) {\n $countData = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('products', 'orderlines.product_id', '=', 'products.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('products.id', '=', $product[$i]->id)\n ->count();\n if($countData) {\n $prevData = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('products', 'orderlines.product_id', '=', 'products.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('count(*), sum(quantity) as sums, sum(orderlines.subtotal) as value'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('products.id', '=', $product[$i]->id)\n ->get();\n } else {\n $prevData = array();\n }\n if(count($prevData) != 0) {\n $product[$i]->count_change = (string) ($product[$i]->count - $prevData[0]->count);\n $product[$i]->sum_change = (string) ($product[$i]->sums - $prevData[0]->sums);\n $product[$i]->value_change = (string) ($product[$i]->value - $prevData[0]->value);\n } else {\n $product[$i]->count_change = (string) 0;\n $product[$i]->sum_change = (string) 0;\n $product[$i]->value_change = (string) 0;\n }\n }\n\n $data['product'] = $product;\n\n // RATING\n $currentRating = DB::connection('marketplace')\n ->table('ratings')\n ->join('feedbacks', 'ratings.feedback_id', '=', 'feedbacks.id')\n ->join('orderlines', 'feedbacks.orderline_id', '=', 'orderlines.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('round(avg(value), 2) as rating'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n $prevRating = DB::connection('marketplace')\n ->table('ratings')\n ->join('feedbacks', 'ratings.feedback_id', '=', 'feedbacks.id')\n ->join('orderlines', 'feedbacks.orderline_id', '=', 'orderlines.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('round(avg(value), 2) as rating'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n $ratingTrend = DB::connection('marketplace')\n ->table('ratings')\n ->join('feedbacks', 'ratings.feedback_id', '=', 'feedbacks.id')\n ->join('orderlines', 'feedbacks.orderline_id', '=', 'orderlines.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('round(avg(value), 2) as rating,'.$dateQuery))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data['rating'] = array();\n $data['rating']['average']['current'] = $currentRating[0]->rating;\n $data['rating']['average']['prev'] = $prevRating[0]->rating;\n $data['rating']['trend'] = $ratingTrend;\n\n $city = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orders','orderlines.order_id','orders.id')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('orders.buyer_city as name, count(*)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy('orders.buyer_city')\n ->orderByRaw('count desc')\n ->limit(5)\n ->get();\n\n $data['city'] = $city;\n\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]); \n }", "public function get_last7Days($type, $array_data, $auth) {\n $date = date('Y-m-d', strtotime('-7 days'));\n $today = date('Y-m-d');\n\n if ($type == 1) {\n\n $exception = '';\n $exception2 = '';\n if ($auth['id'] == '2') {\n $exception = ' AND affiliate=\"0\"';\n //$exception2 = ' WHERE affiliate=\"0\" AND insertDate=\"' . $today . '\"';\n }\n\n //last 7 days\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE insertDate >= \"' . $date . '\"' . $exception . ' GROUP BY insertDate');\n\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n /*\n //today\n //clicks\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, SUM( clicks ) AS clicks FROM MainReport INNER JOIN Sources ON source=Sources.id ' . $exception2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n //conversions\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id ' . $exception2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n /*\n //last 7 days\n $statement = $this->getDi()->getDb()->prepare('SELECT insert_date as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM Agr__MainReport INNER JOIN tinas__Sources ON source=tinas__Sources.id WHERE insert_date >= \"' . $date . '\"' . $exception . ' GROUP BY insert_date');\n\n $exe = $this->getDi()->getDb()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n //today\n //clicks\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS clicks FROM ClicksDaily INNER JOIN Sources ON fkSource=Sources.id ' . $exception2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n //conversions\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS conversions, SUM( ccpa ) AS revenue FROM ConversionsDaily INNER JOIN Sources ON fkSource=Sources.id ' . $exception2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n\n foreach ($array_ret as $key => $value) {\n $cr = $value['conversions'] / $value['clicks'];\n\n $array_ret[$key]['cr'] = $cr;\n\n $array_ret[$key]['revenue'] = number_format($array_ret[$key]['revenue'], 2, '.', '');\n $array_ret[$key]['cr'] = number_format($array_ret[$key]['cr'] * 100, 3, '.', '');\n }\n\n //$cr = $array_ret_conversions[0]['conversions'] / $array_ret_clicks[0]['clicks'];\n //array_push($array_ret, array('date' => $array_ret_clicks[0]['date'] , 'clicks' => $array_ret_clicks[0]['clicks'], 'conversions' => $array_ret_conversions[0]['conversions'], 'revenue' => number_format($array_ret_conversions[0]['revenue'], 2, '.', ''), 'cr' => $cr * 100));\n\n return $array_ret;\n } else if ($type == 2) {\n\n $sql = '';\n\n if ($array_data[0]['sources'] != '') {\n $sources = str_replace(',', '\",\"', $auth['sources']);\n $sources = ' AND source IN (\"' . $sources . '\")';\n $sql .= $sources;\n }\n\n if ($array_data[0]['countries'] != '') {\n $countries = str_replace(',', '\",\"', $auth['countries']);\n $countries = ' AND campaign_country IN (\"' . $countries . '\")';\n $sql .= $countries;\n }\n\n if ($array_data[0]['aggregators'] != '') {\n $aggregators = str_replace(',', '\",\"', $auth['aggregators']);\n $aggregators = ' AND agregator IN (\"' . $aggregators . '\")';\n $sql .= $aggregators;\n }\n\n /*\n //last 7 days\n\n $statement = $this->getDi()->getDb()->prepare('SELECT insert_date as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM Agr__MainReport INNER JOIN tinas__Sources ON source=tinas__Sources.id WHERE insert_date >= \"' . $date . '\" ' . $sql . ' AND affiliate=\"0\" GROUP BY insert_date');\n $exe = $this->getDi()->getDb()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n */\n\n //last 7 days\n $sqlstr = 'SELECT insertDate as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE insertDate >= \"' . $date . '\" ' . $sql . ' AND affiliate=\"0\" GROUP BY insertDate';\n //mail('[email protected]', 'str', $sqlstr);\n $statement = $this->getDi()->getDb4()->prepare($sqlstr);\n\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n /*\n //today\n //clicks\n $sql = '';\n if($array_data[0]['sources'] != '') {\n $sources = str_replace(',', '\",\"', $auth['sources']);\n $sources = (($sql != \"\")) ? (' AND source IN (\"' . $sources . '\")') : (' WHERE source IN (\"' . $sources . '\")');\n $sql .= $sources;\n }\n\n if($array_data[0]['countries'] != '') {\n $countries = str_replace(',', '\",\"', $auth['countries']);\n $countries = (($sql != \"\")) ? (' AND campaign_country IN (\"' . $countries . '\")') : (' WHERE campaign_country IN (\"' . $countries . '\")');\n $sql .= $countries;\n }\n\n if($array_data[0]['aggregators'] != '') {\n $aggregators = str_replace(',', '\",\"', $auth['aggregators']);\n $aggregators = (($sql != \"\")) ? (' AND agregator IN (\"' . $aggregators . '\")') : (' WHERE agregator IN (\"' . $aggregators . '\")');\n $sql .= $aggregators;\n }\n\n $date = (($sql != \"\")) ? (' AND insertDate=\"' . $today . '\"') : (' WHERE insertDate =\"' . $today . '\"');\n $sql .= $date;\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS clicks FROM MainReport ' . $sql);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS clicks FROM ClicksDaily ' . $sql);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n //conversions\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS conversions, SUM( ccpa ) AS revenue FROM ConversionsDaily ' . $sql);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n //conversions\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS conversions, SUM( revenue ) AS revenue FROM MainReport ' . $sql);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n foreach ($array_ret as $key => $value) {\n $cr = $value['conversions'] / $value['clicks'];\n\n $array_ret[$key]['cr'] = $cr;\n\n $array_ret[$key]['revenue'] = number_format($array_ret[$key]['revenue'], 2, '.', '');\n $array_ret[$key]['cr'] = number_format($array_ret[$key]['cr'] * 100, 3, '.', '');\n }\n\n //$cr = ($array_ret_clicks[0]['clicks'] == 0) ? 0 : ($array_ret_conversions[0]['conversions'] / ($array_ret_clicks[0]['clicks']));\n //array_push($array_ret, array('date' => $array_ret_clicks[0]['date'] , 'clicks' => $array_ret_clicks[0]['clicks'], 'conversions' => $array_ret_conversions[0]['conversions'], 'revenue' => number_format($array_ret_conversions[0]['revenue'], 2, '.', ''), 'cr' => $cr * 100));\n\n return $array_ret;\n } else if ($type == 3) {\n //last 7 days\n /*\n $statement = $this->getDi()->getDb()->prepare('SELECT insert_date as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM Agr__MainReport INNER JOIN tinas__Sources ON source=tinas__Sources.id WHERE insert_date >= \"' . $date . '\" AND affiliate=\"1\" GROUP BY insert_date');\n $exe = $this->getDi()->getDb()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE insertDate >= \"' . $date . '\" AND affiliate=\"1\" GROUP BY insertDate');\n\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n /*\n //today\n //clicks\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS clicks FROM ClicksDaily INNER JOIN Sources ON fkSource=Sources.id WHERE affiliate=\"1\"');\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS clicks FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE affiliate=\"1\" AND insertDate=\"' . $today . '\"');\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n //conversions\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS conversions, SUM( ccpa ) AS revenue FROM ConversionsDaily INNER JOIN Sources ON fkSource=Sources.id WHERE affiliate=\"1\"');\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE affiliate=\"1\" AND insertDate=\"' . $today . '\"');\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n foreach ($array_ret as $key => $value) {\n $cr = $value['conversions'] / (($value['clicks'] == 0) ? 1 : $value['clicks']);\n\n $array_ret[$key]['cr'] = $cr;\n\n $array_ret[$key]['revenue'] = number_format($array_ret[$key]['revenue'], 2, '.', '');\n $array_ret[$key]['cr'] = number_format($array_ret[$key]['cr'] * 100, 3, '.', '');\n }\n\n //$cr = ($array_ret_clicks[0]['clicks'] == 0) ? 0 : ($array_ret_conversions[0]['conversions'] / ($array_ret_clicks[0]['clicks']));\n //array_push($array_ret, array('date' => $array_ret_clicks[0]['date'] , 'clicks' => $array_ret_clicks[0]['clicks'], 'conversions' => $array_ret_conversions[0]['conversions'], 'revenue' => number_format($array_ret_conversions[0]['revenue'], 2, '.', ''), 'cr' => $cr * 100));\n\n return $array_ret;\n } else if ($type == 4) {\n\n\n $sqlDb = '';\n $sqlDb2 = '';\n if ($array_data[0]['sources'] != '') {\n $sources = str_replace(',', '\",\"', $auth['sources']);\n $sqlDb .= ' AND source IN (\"' . $sources . '\") ';\n //$sqlDb2 .= ' AND source IN (\"' . $sources . '\") AND insertDate=\"' . $today . '\"';\n }\n\n //last 7 days\n /*\n $statement = $this->getDi()->getDb()->prepare('SELECT insert_date as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM Agr__MainReport INNER JOIN tinas__Sources ON source=tinas__Sources.id WHERE insert_date >= \"' . $date . '\" AND affiliate=\"2\" ' . $sqlDb . ' GROUP BY insert_date');\n $exe = $this->getDi()->getDb()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE insertDate >= \"' . $date . '\" AND affiliate=\"2\" ' . $sqlDb . ' GROUP BY insertDate');\n\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n /*\n //today\n //clicks\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS clicks FROM ClicksDaily INNER JOIN Sources ON fkSource=Sources.id WHERE affiliate=\"2\" ' . $sqlDb2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS clicks FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE affiliate=\"2\" ' . $sqlDb2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n //conversions\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS conversions, SUM( ccpa ) AS revenue FROM ConversionsDaily INNER JOIN Sources ON fkSource=Sources.id WHERE affiliate=\"2\" ' . $sqlDb2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE affiliate=\"2\" ' . $sqlDb2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n foreach ($array_ret as $key => $value) {\n $cr = $value['conversions'] / (($value['clicks'] == 0) ? 1 : $value['clicks']);\n\n $array_ret[$key]['cr'] = $cr;\n\n $array_ret[$key]['revenue'] = number_format($array_ret[$key]['revenue'], 2, '.', '');\n $array_ret[$key]['cr'] = number_format($array_ret[$key]['cr'] * 100, 3, '.', '');\n }\n\n //$cr = $array_ret_conversions[0]['conversions'] / $array_ret_clicks[0]['clicks'];\n //array_push($array_ret, array('date' => $array_ret_clicks[0]['date'] , 'clicks' => $array_ret_clicks[0]['clicks'], 'conversions' => $array_ret_conversions[0]['conversions'], 'revenue' => number_format($array_ret_conversions[0]['revenue'], 2, '.', ''), 'cr' => $cr * 100));\n\n return $array_ret;\n } else if ($type == 5) {\n\n $sqlDb = '';\n $sqlDb2 = '';\n if ($array_data[0]['aggregators'] != '') {\n $aggregators = str_replace(',', '\",\"', $auth['aggregators']);\n $sqlDb .= ' AND agregator IN (\"' . $aggregators . '\") ';\n //$sqlDb2 .= ' WHERE agregator IN (\"' . $aggregators . '\") AND insertDate=\"' . $today . '\"';\n }\n\n //last 7 days\n /*\n $statement = $this->getDi()->getDb()->prepare('SELECT insert_date as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM Agr__MainReport WHERE insert_date >= \"' . $date . '\" ' . $sqlDb . ' GROUP BY insert_date');\n $exe = $this->getDi()->getDb()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n $sqlstr = 'SELECT insertDate as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE insertDate >= \"' . $date . '\" ' . $sqlDb . ' GROUP BY insertDate';\n $statement = $this->getDi()->getDb4()->prepare($sqlstr);\n //mail('[email protected]', 'sql', $sqlstr);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n /*\n //today\n //clicks\n\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS clicks FROM ClicksDaily INNER JOIN Sources ON fkSource=Sources.id ' . $sqlDb2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS clicks FROM MainReport INNER JOIN Sources ON source=Sources.id ' . $sqlDb2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n //conversions\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS conversions, SUM( ccpa ) AS revenue FROM ConversionsDaily INNER JOIN Sources ON fkSource=Sources.id ' . $sqlDb2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id ' . $sqlDb2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n foreach ($array_ret as $key => $value) {\n $cr = $value['conversions'] / (($value['clicks'] == 0) ? 1 : $value['clicks']);\n\n $array_ret[$key]['cr'] = $cr;\n\n $array_ret[$key]['revenue'] = number_format($array_ret[$key]['revenue'], 2, '.', '');\n $array_ret[$key]['cr'] = number_format($array_ret[$key]['cr'] * 100, 3, '.', '');\n }\n\n //$cr = $array_ret_conversions[0]['conversions'] / $array_ret_clicks[0]['clicks'];\n //array_push($array_ret, array('date' => $array_ret_clicks[0]['date'] , 'clicks' => $array_ret_clicks[0]['clicks'], 'conversions' => $array_ret_conversions[0]['conversions'], 'revenue' => number_format($array_ret_conversions[0]['revenue'], 2, '.', ''), 'cr' => $cr * 100));\n\n return $array_ret;\n }\n }", "public function getAmountsDataLast7Days($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-7days\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getAmountsByDay($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function getgraphAction(){\n $params = array(\n 'cht' => 'lc', \t\t\t\t\t// chart type\n 'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0', //background fills for the chart\n // 'chm' => 'B,f4d4b2,0,0,0|B,FF0000,1,1,0|B,00FF00,2,2,0', \t\t// line fills\n 'chco' => 'db4814,1919D1',\t\t\t\t\t//Series Colors\n 'chs' => '587x300',\t\t\t\t// chart size <width>x<height>\n\t\t\t'chxt' => 'x,y',\t\t\t\t\t// visible axes\n\t\t\t//'chof' => 'validate'\t\t\t\t// output format (png,gif,json,html{when chof='validate'})\n );\n \n\t$post=$this->getRequest()->getPost();\n\t\n\t\n\t$timezoneLocal = Mage::app()->getStore()->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);\n\n\t\tlist ($dateStart, $dateEnd) = Mage::getResourceModel('reports/order_collection')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getDateRange($post['range'], '', '', true);\n\n $dateStart->setTimezone($timezoneLocal);\n $dateEnd->setTimezone($timezoneLocal);\n\t\n\t\t$dates = array();\n $datas = array();\n\n while($dateStart->compare($dateEnd) < 0){\n switch ($post['range']) {\n case '24h':\n $d = $dateStart->toString('yyyy-MM-dd HH:00');\n $dateStart->addHour(1);\n break;\n case '7d':\n case '1m':\n $d = $dateStart->toString('yyyy-MM-dd');\n $dateStart->addDay(1);\n break;\n case '1y':\n case '2y':\n $d = $dateStart->toString('yyyy-MM');\n $dateStart->addMonth(1);\n break;\n }\n\n $dates[] = $d;\n }\n\n\t\t$graphData=array();\n\t\t\n\t\t$product_list=array('product1'=>$post['product'],\n\t\t\t\t\t\t\t'product2'=>$post['compare2']\n\t\t\t\t\t\t\t);\t\n\t\t$graphData=Mage::Helper('graphs')->getGraphData($dates,$product_list);\n\n /**\n * setting skip step\n */\n if (count($dates) > 8 && count($dates) < 15) {\n $c = 1;\n } else if (count($dates) >= 15){\n $c = 2;\n } else {\n $c = 0;\n }\n /**\n * skipping some x labels for good reading\n */\n $i=0;\n foreach ($dates as $k => $d) {\n if ($i == $c) {\n $dates[$k] = $d;\n $i = 0;\n } else {\n $dates[$k] = '';\n $i++;\n }\n }\n \n $this->_axisLabels['x'] = $dates;\n\t\t$this->_axisLabels['y'] = $graphData['quantity'][$post['product']];\n\t\t\n\t\tforeach ($graphData['quantity'] as $index => $serie) {\n $localmaxlength[$index] = sizeof($serie);\n $localmaxvalue[$index] = max($serie);\n $localminvalue[$index] = min($serie);\n }\n \n\t\t$maxvalue = max($localmaxvalue);\n\t\t$minvalue = min($localminvalue);\n\n $yrange = 0;\n $yLabels = array();\n $miny = 0;\n $maxy = 0;\n $yorigin = 0;\n\n $maxlength = max($localmaxlength);\n if ($minvalue >= 0 && $maxvalue >= 0) {\n $miny = 0;\n if ($maxvalue > 10) {\n $p = pow(10, $this->_getPow($maxvalue));\n $maxy = (ceil($maxvalue/$p))*$p;\n $yLabels = range($miny, $maxy, $p);\n } else {\n $maxy = ceil($maxvalue+1);\n $yLabels = range($miny, $maxy, 1);\n }\n $yrange = $maxy;\n $yorigin = 0;\n }\n\n \n\t\t\t\n\t\t\t$params['chd'] = \"e:\";\n $dataDelimiter = \"\";\n $dataSetdelimiter = \",\";\n $dataMissing = \"__\";\n \n\t\t\t// EXTENDED ENCODING\n\t\t\tforeach($product_list as $productid){\n\t\t\t\t$chartdata = array();\t\n for ($j = 0; $j < sizeof($graphData['quantity'][$productid]); $j++) {\n $currentvalue = $graphData['quantity'][$productid][$j];\n \n if (is_numeric($currentvalue)) {\n if ($yrange) {\n $ylocation = (4095 * ($yorigin + $currentvalue) / $yrange);\n\n } else {\n $ylocation = 0;\n }\n $firstchar = floor($ylocation / 64);\n $secondchar = $ylocation % 64;\n $mappedchar = substr($this->_extendedEncoding, $firstchar, 1)\n . substr($this->_extendedEncoding, $secondchar, 1);\n array_push($chartdata, $mappedchar . $dataDelimiter);\n } else {\n array_push($chartdata, $dataMissing . $dataDelimiter);\n }\n\n\t\t\t }\n\t\t\t $buffer = implode('', $chartdata);\t\t\t \n\t\t\t\t\t$buffer = rtrim($buffer, $dataSetdelimiter);\n\t\t\t\t\t$buffer = rtrim($buffer, $dataDelimiter);\n\t\t\t\t\t$buffer = str_replace(($dataDelimiter . $dataSetdelimiter), $dataSetdelimiter, $buffer);\n\t\t\t\t\t\n\t\t\t\t\t$params['chd'] .= $buffer.',';\n\t\t\t\t\t$buffer=null;\n\t\t\t\t\t$chartdata=null;\n\t\t\t\t}\n\t\t\t\t\t$labelBuffer = \"\";\n\t\t\t\t\t$valueBuffer = array();\n\t\t\t\t\t$rangeBuffer = \"\";\n \n if (sizeof($this->_axisLabels) > 0) {\n $params['chxt'] = implode(',', array_keys($this->_axisLabels));\n $indexid = 0;\n foreach ($this->_axisLabels as $idx=>$labels){\n\t\t\t\t\n if ($idx == 'x') {\n /**\n * Format date\n */\n foreach ($this->_axisLabels[$idx] as $_index=>$_label) {\n if ($_label != '') {\n switch ($post['range']) {\n case '24h':\n $this->_axisLabels[$idx][$_index] = $this->formatTime(\n new Zend_Date($_label, 'yyyy-MM-dd HH:00'), 'short', false\n );\n break;\n case '7d':\n case '1m':\n $this->_axisLabels[$idx][$_index] = $this->formatDate(\n new Zend_Date($_label, 'yyyy-MM-dd')\n );\n break;\n case '1y':\n case '2y':\n\t\t\t\t\t\t\t\t\t\n $formats = Mage::app()->getLocale()->getTranslationList('datetime');\n $format = isset($formats['yyMM']) ? $formats['yyMM'] : 'MM/yyyy';\n $format = str_replace(array(\"yyyy\", \"yy\", \"MM\"), array(\"Y\", \"y\", \"m\"), $format);\n $this->_axisLabels[$idx][$_index] = date($format, strtotime($_label));\n break;\n }\n } else {\n $this->_axisLabels[$idx][$_index] = '';\n }\n\n }\n\t\t\t\t\t\t\t\t\t\t\n $tmpstring = implode('|', $this->_axisLabels[$idx]);\n\n $valueBuffer[] = $indexid . \":|\" . $tmpstring;\n if (sizeof($this->_axisLabels[$idx]) > 1) {\n $deltaX = 100/(sizeof($this->_axisLabels[$idx])-1);\n } else {\n $deltaX = 100;\n }\n } else if ($idx == 'y') {\n $valueBuffer[] = $indexid . \":|\" . implode('|', $yLabels);\n if (sizeof($yLabels)-1) {\n $deltaY = 100/(sizeof($yLabels)-1);\n } else {\n $deltaY = 100;\n }\n // setting range values for y axis\n $rangeBuffer = $indexid . \",\" . $miny . \",\" . $maxy . \"|\";\n }\n $indexid++;\n }\n $params['chxl'] = implode('|', $valueBuffer);\n }\t\t\t\n\t\t\t\t\t\n\t\tif (isset($deltaX) && isset($deltaY)) {\n $params['chg'] = $deltaX . ',' . $deltaY . ',1,0';\n }\n \n\n\t\t\t$p = array();\n foreach ($params as $name => $value) {\n $p[] = $name . '=' .urlencode($value);\n }\n\n $url= Mage_Adminhtml_Block_Dashboard_Graph::API_URL . '?' . implode('&', $p);\n\n\t\t\t\techo $url;\n\t}", "public function weekly_deposits()\n\t{\n\t\t// $date->format('Y-m-d'); \n\n\t\t// $date = strtotime(\"-6 day\");\n\t\t // date(\"Y-m-d\", $date);\n\t\t \n\t\t$today = date(\"Y-m-d\");\n\t\t$newDate = date(\"Y-m-d\",strtotime($today.\"-6 day\"));\n\t\t\n\t\t//`date_transaction` BETWEEN '$newDate' AND '$today'\n\t\t//OR\n\t\t//`date_transaction` > DATE_SUB(NOW(), INTERVAL 1 WEEK)\t\n\t\t\n\t\t$query = $this->db->prepare(\"SELECT * FROM `statement` WHERE `credit` <> 0 AND `date_transaction` > DATE_SUB(NOW(), INTERVAL 1 WEEK) ORDER BY `date_transaction` DESC\");\n\n\t\ttry{\n\t\t\t\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchAll();\n\t\t\t\n\t\t\t\n\t\t}catch(PDOException $e){\n\t\t\tdie($e->getMessage());\n\t\t}\n\n\t}", "public function getTransactionStats($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n\n DB::enableQueryLog();\n // execute\n // transaction count\n $currentTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('orderline_statuses.name', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n // ->groupBy('status')\n ->get();\n\n $prevTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('orderline_statuses.name', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n // ->groupBy('status')\n ->get();\n\n\n // total transaction value\n $currentTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->get();\n\n $prevTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->get();\n\n // transaction status\n $transactionStatus = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('orderline_statuses.name, count(*)'))\n // ->whereIn('status', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->groupBy('orderline_statuses.name')\n ->orderByRaw('count desc')\n ->get();\n\n // payment method\n $paymentMethod = DB::connection('marketplace')\n ->table('orders')\n ->join('payment_method_types', 'orders.payment_method_type_id', '=', 'payment_method_types.id')\n ->select(DB::raw('payment_method_types.name, count(*)'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n // ->where('status', '=', $this->successStatus)\n ->groupBy('payment_method_types.name')\n ->orderByRaw('count desc')\n ->get(); \n\n $data = array();\n\n $data['transaction'] = array();\n $data['transaction']['count'] = array();\n $data['transaction']['count']['current'] = $currentTransactionCount[0];\n $data['transaction']['count']['prev'] = $prevTransactionCount[0];\n $data['transaction']['value'] = array();\n $data['transaction']['value']['current'] = $currentTransactionValue[0];\n $data['transaction']['value']['prev'] = $prevTransactionValue[0];\n \n $data['transaction_status'] = $transactionStatus;\n $data['payment_method'] = $paymentMethod;\n \n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function index()\n\t{\n\t\t\n\t$today_users = Trains_reservation::whereDate('created_at', today())->count()+Planes_reservation::whereDate('created_at', today())->count();\n\t$yesterday_users = Trains_reservation::whereDate('created_at', today()->subDays(1))->count()+Planes_reservation::whereDate('created_at', today()->subDays(1))->count();\n\t$users_2_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(2))->count()+Planes_reservation::whereDate('created_at', today()->subDays(2))->count();\n\t$users_3_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(3))->count()+Planes_reservation::whereDate('created_at', today()->subDays(3))->count();\n\t$users_4_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(4))->count()+Planes_reservation::whereDate('created_at', today()->subDays(4))->count();\n\t$users_5_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(5))->count()+Planes_reservation::whereDate('created_at', today()->subDays(5))->count();\n\t$users_6_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(6))->count()+Planes_reservation::whereDate('created_at', today()->subDays(6))->count();\n\t$users_7_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(7))->count()+Planes_reservation::whereDate('created_at', today()->subDays(7))->count();\n\t$chart = new SampleChart;\n\t$chart->labels(['Tujuh hari lalu','Enam hari lalu','Lima hari lalu','Empat hari lalu','Tiga hari lalu','Dua hari lalu', 'Kemarin', 'Hari Ini']);\n\t$chart->dataset('Laporan Transaksi', 'line', [$users_7_days_ago,$users_6_days_ago,$users_5_days_ago,$users_4_days_ago,$users_3_days_ago,$users_2_days_ago, $yesterday_users, $today_users]);\n\t\treturn view('laporan.hari',compact('chart'));\n\t}", "public static function getTransaction()\n {\n $query = new Query;\n return $query->select([ 'c.*', 'u.username', 'u.email','t.transaction_id', 't.transaction_amount',\n 't.payment_date as tn_payment_date'])\n ->from('contest as c')\n ->LeftJoin('transaction_details as t', 't.contest_id=c.id')\n ->LeftJoin('user as u', 'u.id=c.user_id')\n ->orderBy(['t.payment_date' => SORT_DESC]); \n }", "abstract protected function getTransactions();", "public function getOrdersDataLast7Days($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-7days\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getNumOfOrderByDay($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function getThrendsDaily(Request $request) {\n\n\n if (($request->has('fr') && $request->has('to')) && (is_iso_date($request->input('fr')) && is_iso_date($request->input('to')))) {\n\n $this->dr->fr = carbonCheckorNow($request->input('fr'));\n $this->dr->to = carbonCheckorNow($request->input('to'));\n\n if ($this->dr->fr->gt($this->dr->to))\n return 'fr is gt to';\n\n $len = $this->dr->to->diffInDays($this->dr->fr);\n } else {\n\n $date = carbonCheckorNow($request->input('date'));\n $len = 6;\n if ($request->has('len') && $request->input('len')>0 && $request->input('len')<90)\n $len = $request->input('len');\n\n $this->dr->to = $date;\n $this->dr->fr = $date->copy()->subDays($len);\n } \n\n $datas = [];\n\n\n // return $this->dr->to->diffInDays($this->dr->fr);\n\n // return $this->dr->fr;\n // return $this->dr->fr->copy()->subDay();\n\n $dailysales = $this->repo\n // ->skipCache()\n ->getAllByDr($this->dr->fr->copy()->subDay(), $this->dr->to, ['sales', 'branchid', 'date']);\n\n // $branchs = \\App\\Models\\Boss\\Branch::select(['code', 'descriptor', 'id'])->active()->orderBy('code')->get();\n $branchs = \\App\\Models\\Branch::select(['code', 'descriptor', 'id'])->whereIn('id', collect($dailysales->pluck('branchid'))->unique()->toArray())->orderBy('code')->get();\n\n foreach($branchs as $key => $branch) {\n $datas[$key]['code'] = $branch->code;\n $datas[$key]['descriptor'] = $branch->descriptor;\n\n $to_date = $this->dr->to->copy();\n for ($i=0; $i<=$len+1; $i++) {\n $to = $to_date->copy()->subDay($i);\n \n $datas[$key]['dss'][$i]['date'] = $to;\n\n $filtered = $dailysales->filter(function ($item) use ($to, $branch) {\n return ($item->branchid == $branch->id) && ($item->date->format('Y-m-d') == $to->format('Y-m-d'))\n ? $item : null;\n });\n\n $f = $filtered->first();\n\n $datas[$key]['dss'][$i]['sales'] = is_null($f) ? NULL : $f->sales;\n }\n }\n\n\n // return $datas;\n\n\n foreach($datas as $j => $data) {\n foreach($data['dss'] as $k => $ds) {\n if ($k==0 && is_null($datas[$j]['dss'][$k]['sales'])) {\n $prev_sales = NULL;\n } else {\n if (($k)<=$len)\n $prev_sales = is_null($datas[$j]['dss'][($k+1)]['sales']) ? 0 : $datas[$j]['dss'][($k+1)]['sales'];\n else\n $prev_sales = 0;\n }\n $datas[$j]['dss'][$k]['prev_sales'] = $prev_sales;\n $datas[$j]['dss'][$k]['diff'] = $datas[$j]['dss'][$k]['sales'] - $prev_sales;\n $datas[$j]['dss'][$k]['pct'] = $prev_sales>0 ? ($datas[$j]['dss'][$k]['diff']/$prev_sales)*100 : 0;\n }\n }\n\n foreach($datas as $l => $data) {\n unset($datas[$l]['dss'][$len+1]);\n }\n\n // return $datas;\n\n /*\n if (!in_array($request->user()->id, ['41F0FB56DFA811E69815D19988DDBE1E', '11E943EA14DDA9E4EAAFBD26C5429A67'])) {\n\n $email = [\n 'body' => $request->user()->name.' '.$this->dr->fr->format('Y-m-d').' '.$this->dr->to->format('Y-m-d')\n ];\n\n \\Mail::queue('emails.notifier', $email, function ($m) {\n $m->from('[email protected]', 'GI App - Boss');\n $m->to('[email protected]')->subject('Sales Trend');\n });\n }\n */\n\n\n $view = view('report.trends-all-daily')\n ->with('datas', $datas);\n return $this->setViewWithDR($view);\n\n return $datas[0]['dss'];\n }", "function getAttnDataLast(){\n\t\t\n\t\t$lim= isset($_REQUEST['limit'])?$_REQUEST['limit']:'0';\n\t\t$orgid = isset($_REQUEST['refno'])?$_REQUEST['refno']:'0';\n\t\t$datafor= isset($_REQUEST['datafor'])?$_REQUEST['datafor']:'';\n\t\t//$datafor= isset($_REQUEST['datafor'])?$_REQUEST['datafor']:'';\n\t\t$zone = getTimeZone($orgid);\n date_default_timezone_set($zone);\n\t\t$end = date(\"Y-m-d\");\n $start = date(\"Y-m-d\");\n\t\t$data=array();\n\t\tif($lim=='l7'){ // Last 7 days\n\t\t\t$end = date(\"Y-m-d\", strtotime(\"-1 days\"));\n\t\t\t$end1 = date(\"Y-m-d\", strtotime(\"-1 days\"));\n $start = date(\"Y-m-d\", strtotime('-6 day', strtotime($end)));\n $start1 = date(\"Y-m-d\", strtotime('-6 day', strtotime($end)));\n\t\t\t$start = \\DateTime::createFromFormat('Y-m-d', $start);\n $end = \\DateTime::createFromFormat('Y-m-d', $end);\n\t\t}else if($lim=='l30'){ // Last 30 days\n\t\t\t$end = date(\"Y-m-d\", strtotime(\"-1 days\"));\n $start = date(\"Y-m-d\", strtotime('-29 day', strtotime($end)));\n\t\t\t$end1 = date(\"Y-m-d\", strtotime(\"-1 days\"));\n $start1 = date(\"Y-m-d\", strtotime('-29 day', strtotime($end)));\n\t\t\t$start = \\DateTime::createFromFormat('Y-m-d', $start);\n $end = \\DateTime::createFromFormat('Y-m-d', $end);\n\t\t}\n\t\t$datePeriod = new \\DatePeriod($start, new \\DateInterval('P1D'), $end->modify('+1day'));\n\t\t///////getting data\n\t\t\t\n\t\t\tif($datafor=='present'){\n\t\t\t\t$res = array();\n\t\t\t\tforeach ($datePeriod as $date) {\n\t\t\t\t\t$dt = $date->format('Y-m-d');\n\t\t\t\t\t$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , `TimeIn`, `TimeOut` ,AttendanceDate FROM `AttendanceMaster` WHERE `AttendanceDate` ='\" . $dt . \"' and `OrganizationId`=\" . $orgid . \" and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = $orgid AND Is_Delete = 0) order by DATE(AttendanceDate) desc,name\");\n\t\t\t\t\t//$res[] = $query->result();\n\t\t\t\t\t$data['elist'][] = $query->result();\n\t\t\t\t}\n\t\t\t}else if($datafor=='absent'){\n\t\t\t\t$res = array();\n\n\t\t\t\t$query = $this->db->query(\"SELECT EmployeeId , AttendanceDate FROM `AttendanceMaster` WHERE OrganizationId = ? and AttendanceStatus in (2,6,7) and `AttendanceDate` between ? and ? AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = $orgid AND Is_Delete = 0) order by AttendanceDate \", array($orgid , $start1 , $end1));\n\t\t\t\tforeach ($query->result() as $row) {\n\t\t\t\t\t\t\t$data1 = array();\n\t\t\t\t\t\t\t//$data['name']=ucwords(getEmpName($row->Id));\n\t\t\t\t\t\t\t$data1['name'] = getEmpName($row->EmployeeId);\n\t\t\t\t\t\t\t$data1['AttendanceDate'] = date(\"Y-m-d\", strtotime($row->AttendanceDate));\n\t\t\t\t\t\t\t$data1['TimeIn'] = '-';\n\t\t\t\t\t\t\t$data1['TimeOut'] = '-';\n\t\t\t\t\t\t\t$res[] = $data1;\n\t\t\t\t\t\t}\n\t\t\t\t$data['elist'][] =array_reverse($res);\n\t\t\t}else if($datafor=='latecomings'){\n\t\t\t\t$res = array();\n\t\t\t\tforeach ($datePeriod as $date) {\n\t\t\t\t\t$dt = $date->format('Y-m-d');\n\t\t\t\t\t$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , `TimeIn`, `TimeOut` ,AttendanceDate FROM `AttendanceMaster` WHERE (time(TimeIn) > (select time(TimeIn) from ShiftMaster where ShiftMaster.Id=shiftId)) and `AttendanceDate` ='\" . $dt . \"' and `OrganizationId`=\" . $orgid . \" and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = $orgid AND Is_Delete = 0) order by DATE(AttendanceDate) desc,name\");\n\t\t\t\t\t$res[] = $query->result();\n\t\t\t\t}\n\t\t\t\t$data['elist'] = $res;\n\t\t\t}else if($datafor=='earlyleavings'){\n\t\t\t\t$res = array();\n\t\t\t\tforeach ($datePeriod as $date) {\n\t\t\t\t\t$dt = $date->format('Y-m-d');\n\t\t\t\t\t\t$query = $this->db->query(\"select Shift,Id , FirstName , LastName from EmployeeMaster where OrganizationId = $orgid and Id IN (select EmployeeId from AttendanceMaster where OrganizationId = $orgid and AttendanceDate='$dt ' and TimeIn != '00:00:00' ) AND is_Delete=0 order by FirstName\");\n\t\t\t\t\t $innerarr = array();\n\t\t\t\t\t $cond = '';\n\t\t\t\t\tforeach ($query->result() as $row) {\n\t\t\t\t\t\t$ShiftId = $row->Shift;\n\t\t\t\t\t\t$EId = $row->Id;\n\t\t\t\t\t\t$query = $this->db->query(\"select TimeIn,TimeOut,shifttype from ShiftMaster where Id = $ShiftId\");\n\t\t\t\t\t\tif ($data123 = $query->row()) {\n\t\t\t\t\t\t\t$shiftout = $data123->TimeOut;\n\t\t\t\t\t\t\t$shiftout1 = $dt. ' '.$data123->TimeOut;\n\t\t\t\t\t\t\tif($data123->shifttype==2)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$nextdate = date('Y-m-d',strtotime($dt . \"+1 days\"));\n\t\t\t\t\t\t\t\t $shiftout1 = $nextdate.' '.$data123->TimeOut;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$shift = substr($data123->TimeIn, 0, 5) . ' - ' . substr($data123->TimeOut, 0, 5);\n\t\t\t\t\t\t\t$ct = date('H:i:s');\n\t\t\t\t\t\t\t\t$query333 = $this->db->query(\"select SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out from AttendanceMaster where EmployeeId =$EId and if(timeoutdate = '0000-00-00' , TimeOut < '$shiftout' , CONCAT(timeoutdate,' ' ,TimeOut) < '$shiftout1' ) and AttendanceDate='$dt' and TimeOut !='00:00:00' \");\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\tif ($row333 = $query333->row()) {\n\t\t\t\t\t\t\t\t\t$a = new DateTime($row333->TimeOut);\n\t\t\t\t\t\t\t\t\t$b = new DateTime($data123->TimeOut);\n\t\t\t\t\t\t\t\t\t$interval = $a->diff($b);\n\t\t\t\t\t\t\t\t\t$data1['earlyby'] = $interval->format(\"%H:%I\");\n\t\t\t\t\t\t\t\t\t$data1['timeout'] = substr($row333->TimeOut, 0, 5);\n\t\t\t\t\t\t\t\t\t$data1['name'] = $row->FirstName . ' ' . $row->LastName;\n\t\t\t\t\t\t\t\t\t$data1['shift'] = $shift;\n\t\t\t\t\t\t\t\t\t$data1['status'] = $row333->status;\n\t\t\t\t\t\t\t\t\t$data1['TimeIn'] = $row333->TimeIn;\n\t\t\t\t\t\t\t\t\t$data1['TimeOut'] = $row333->TimeOut;\n\t\t\t\t\t\t\t\t\t$data1['AttendanceDate'] = $dt;\n\t\t\t\t\t\t\t\t\t$innerarr[] = $data1;\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$res[] = $innerarr;\n\t\t\t\t}\n\t\t\t\t$data['elist'] = $res;\n\t\t\t}\n\t\t\t\n\t\t///////getting data/\n\t\techo json_encode($data);\n\t\t////////////\n\n\t}", "public function getGraphDataForAnAccount($startDate, $endDate, $acc_id){\n\t\t$result = Transaction::where('account_id', '=', $acc_id)->get();\n\t\t$tset = $result->toArray();\n\t\t$tm = new TransactionManager();\n\t $tset = $tm -> sortTransactionsByDates($tset);\n\t $tset = array_reverse($tset);\n\n\t $graphData = array();\n\t $cDate = $startDate;\n\t $prevBalance = 0;\n\t $transactionBeforeStartExists = false;\n\n\t if(empty($tset))\n\t \treturn array();\n\t \n\t foreach($tset as $t){\n\t \t//if cDate is before startDate, skip \n\t \tif($tm->rawDateCompare($t['date'], $startDate) > 0) {\n\t \t\t$prevBalance += $t['amount'];\n\t \t\t$transactionBeforeStartExists = true;\n\t \t\tcontinue;\n\t \t}\n\t \t//if date is after endDate, skip\n\t \tif($tm->rawDateCompare($t['date'], $endDate) < 0)\n\t \t\tcontinue;\n\t \t//transaction is in range, sum it to graphData\n\t \tif(!array_key_exists($t['date'], $graphData))\n\t \t\t$graphData[$t['date']] = 0;\n\t \t$graphData[$t['date']] += $t['amount'];\n\t }\n\t \n\t //cumulate each data point\n\t $net = $prevBalance;\n\t foreach($graphData as &$g){\n\t \t$net += $g;\n\t \t$g = $net;\n\t }\n\t //all data points betwen sDate and earliest transaction are $prevBalance\n\t $paddingLeft = array();\n\t $paddingRight = array();\n\n\t if($transactionBeforeStartExists){\n\t\t if(!array_key_exists($startDate, $graphData))\n\t\t \t$paddingLeft[$startDate] = $prevBalance;\n\t\t}\n\t if(!array_key_exists($endDate, $graphData))\n\t \t$paddingRight[$endDate] = $net;\t \n\t \n\t //all points between latest transaction and fDate are $net\n\t return array_merge($paddingLeft, $graphData, $paddingRight);\n\t}", "protected function getDatastreamHistory() {\n return $this->repository->api->m->getDatastreamHistory($this->parent->id, $this->id);\n }", "function showLast7($data){\ntry{\n $sym = $data[\"Symbol\"];\n $symbol = getInfo($sym);\n $newObj = json_decode($symbol);\n\n //How many days are we returning?\n $days = 7;\n\n $Close = array();\n\n //Populate a new object with the necesary information\n for ($i = 0; $i < 7;$i++)\n {\n array_push($Close, $newObj->Close[$i]); \n }\n} catch (Exception $e){\n echo \"Error : \" . $e->getMessage();\n }\n return json_encode($Close);\n}", "public function getBlock()\n\t{\n\t\t$chart = new \\IPS\\Helpers\\Chart;\n\t\t\n\t\t$chart->addHeader( \"Day\", 'date' );\n\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t{\n\t\t\t$chart->addHeader( $currency, 'number' );\n\t\t}\n\t\t\n\t\t$thirtyDaysAgo = \\IPS\\DateTime::create()->sub( new \\DateInterval('P30D') );\n\t\t\t\t\n\t\t$results = array();\n\t\tforeach( \\IPS\\Db::i()->select( \"t_currency, DATE_FORMAT( FROM_UNIXTIME( t_date ), '%e %c %Y' ) AS date, SUM(t_amount)-SUM(t_partial_refund) AS amount\", 'nexus_transactions', array( 't_date>? AND (t_status=? OR t_status=?)', $thirtyDaysAgo->getTimestamp(), \\IPS\\nexus\\Transaction::STATUS_PAID, \\IPS\\nexus\\Transaction::STATUS_PART_REFUNDED ), NULL, NULL, array( 't_currency', 'date' ) ) as $result )\n\t\t{\n\t\t\t$results[ $result['date'] ][ $result['t_currency'] ] = $result['amount'];\n\t\t}\n\t\t\t\t\n\t\t$monthAndYear = date( 'n' ) . ' ' . date( 'Y' );\n\t\tforeach ( range( 30, 0 ) as $daysAgo )\n\t\t{\n\t\t\t$datetime = new \\IPS\\DateTime;\n\t\t\t$datetime->setTime( 0, 0, 0 );\n\t\t\t$datetime->sub( new \\DateInterval( 'P' . $daysAgo . 'D' ) );\n\t\t\t$resultString = $datetime->format('j n Y');\n\t\t\t\n\t\t\tif ( isset( $results[ $resultString ] ) )\n\t\t\t{\n\t\t\t\t$row = array( $datetime );\n\t\t\t\t\n\t\t\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t\t\t{\n\t\t\t\t\tif ( !isset( $results[ $resultString ][ $currency ] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$row[] = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$row[] = $results[ $resultString ][ $currency ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$chart->addRow( $row );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$row = array( $datetime );\n\t\t\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t\t\t{\n\t\t\t\t\t$row[] = 0;\n\t\t\t\t}\n\t\t\t\t$chart->addRow( $row );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $chart->render( 'LineChart' );\n\t}", "public function GetExpertTransactions(){\n\t\tif($this->IsLoggedIn('cashier')){\n\t\t\tif(isset($_GET) && !empty($_GET)){\n\t\t\t\t$where=array(\n\t\t\t\t\t'from_date'\t=>$_GET['from_date'],\n\t\t\t\t\t'to_date'\t\t=> $_GET['to_date']\n\t\t\t\t);\n\t\t\t\t\t$data=$this->CashierModel->GetExpertTransactions($where);\n\t\t\t\t\t$this->ReturnJsonArray(true,false,$data['res_arr']);\n die;\n\t\t\t}else{\n\t\t\t\t$this->ReturnJsonArray(false,true,\"Wrong Method!\");\n\t\t\t\tdie;\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t\telse{\n\t\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t}\n\t}", "public function weekly_withdrawals()\n\t{\n\t\t// $date->format('Y-m-d'); \n\n\t\t// $date = strtotime(\"-6 day\");\n\t\t // date(\"Y-m-d\", $date);\n\t\t \n\t\t$today = date(\"Y-m-d\");\n\t\t$newDate = date(\"Y-m-d\",strtotime($today.\"-6 day\"));\n\t\t\n\t\t//`date_transaction` BETWEEN '$newDate' AND '$today'\n\t\t//OR\n\t\t//`date_transaction` > DATE_SUB(NOW(), INTERVAL 1 WEEK)\t\n\t\t\n\t\t$query = $this->db->prepare(\"SELECT * FROM `statement` WHERE `debit` <> 0 AND `date_transaction` > DATE_SUB(NOW(), INTERVAL 1 WEEK) ORDER BY `date_transaction` DESC\");\n\n\t\ttry{\n\t\t\t\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchAll();\n\t\t\t\n\t\t\t\n\t\t}catch(PDOException $e){\n\t\t\tdie($e->getMessage());\n\t\t}\n\n\t}", "function getRevenueData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n \n if($varAction=='today' || $varAction=='yesterday'){\n if($varAction=='today'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n \n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $arrClms = array('TIME(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded < \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$i]['time'][]=$arrData;\n $arrRes[$i]['count']=$count;\n }\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_week'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$key]['dates']=$arrData;\n $arrRes[$key]['count']=$count;\n }\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_month'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $lastMonth.'=='.$lastMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$key]['dates']=$arrData;\n $arrRes[$key]['count']=$count;\n }\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "public function TransactionChart(Request $request)\n {\n \t$year = $request->input('year') ? $request->input('year') : date('Y'); \n \t$chartData = DB::table('trans_peryear_view')\n \t\t\t\t->where('year', $year)\n \t\t\t\t->get();\n\n \treturn response()->json(['chartData' => $chartData], 200);\n }", "function getResults(&$analytics, $profileId) {\n // for the last seven days.\n return $analytics->data_ga->get(\n 'ga:' . $profileId,\n '7daysAgo',\n 'today',\n 'ga:sessions');\n}", "function get_statistics_data_note($params)\r\n {\r\n $params = (object)$params;\r\n $default_params = (object)array(\r\n 'user_id' => USER_ID,\r\n 'sdate' => date('Y-m-d'),\r\n 'edate' => date('Y-m-d', strtotime(\"-1 week\"))\r\n );\r\n foreach($default_params as $key => $value){\r\n if(!isset($params->{$key}))\r\n $params->{$key} = $value;\r\n }\r\n \r\n $period = new DatePeriod(\r\n new DateTime($params->sdate),\r\n new DateInterval('P1D'),\r\n new DateTime($params->edate)\r\n );\r\n\r\n $data = array();\r\n \r\n $sql = \"SELECT \r\n date_format(n.regdate, '%Y-%m-%d') as date,\r\n count(n.id) as log_count,\r\n count(distinct n.work_id) as work_count\r\n from\r\n log_work_note as n\r\n left join works on works.work_id = n.work_id\r\n where\r\n works.user_id = ?\r\n and n.regdate between ? and ?\r\n group by date\"; \r\n $query = $this->db->query($sql, array($params->user_id, $params->sdate, $params->edate));\r\n foreach ($query->result() as $row)\r\n {\r\n $data[$row->date] = $row->log_count;\r\n }\r\n\r\n $output = array();\r\n foreach ($period as $date) {\r\n $dateString = $date->format('Y-m-d');\r\n $output[$dateString] = (empty($data[$dateString]))?0:$data[$dateString];\r\n }\r\n\r\n return $output;\r\n }", "function getResults(&$analytics, $profileId) {\n\t // for the last seven days.\n\t return $analytics->data_ga->get(\n\t 'ga:' . $profileId,\n\t '7daysAgo',\n\t 'today',\n\t 'ga:sessions');\n\t}", "public function chartNewVistors()\n {\n $dayOfTheWeek = [] ; $newVistors = [] ;\n\n for ($i=0; $i <7 ; $i++) {\n $dayOfTheWeek[] = Carbon::now()->subDays($i)->format('D');\n $subscribes = Subscribe::all();\n $count = 0 ;\n foreach ($subscribes as $key => $value) {\n if (Carbon::parse($value->created_at)->format('Y-m-d') == Carbon::now()->subDays($i)->format('Y-m-d')) {\n $count += 1 ;\n }\n }\n $newVistors[] = $count;\n }\n return response()->json([ 'dayOfTheWeek' => $dayOfTheWeek , 'newVistors' => $newVistors ]);\n }", "public function transactions()\n {\n return $this->hasMany(Transaction::class, $this->getForeignKey())->orderBy('created_at', 'desc');\n }", "public function postDashboard(Request $request) {\n $graphdata = array();\n $period = $request->input('period');\n $grouping = $request->input('grouping');\n $chart = $request->input('chart');\n $stat = $request->input('stat');\n $fromDate = $request->input('fromDate');\n $thruDate = $request->input('thruDate');\n $query = 'SELECT ';\n if($grouping == 'Product') {\n $query = $query . \"products.product_name as 'Group',\";\n } elseif ($grouping == 'Category') {\n $query = $query . \"categories.category_name as 'Group',\";\n } else {\n $query = $query . \"CONCAT(salespeople.last_name,', ',salespeople.first_name) as 'Group',\";\n }\n $query = $query . \"sum(quantity) as 'Quantity',\";\n $query = $query . \"sum(products.price * quantity) as 'Dollars' \";\n $query = $query . \"FROM sales_transactions \";\n if($grouping == 'Product') {\n $query = $query . \"INNER JOIN products ON sales_transactions.product_id = products.id \";\n $query = $query . \" WHERE transaction_date between '\" . $fromDate . \"' and '\" . $thruDate . \"' \";\n $query = $query . \"GROUP BY product_name\";\n } elseif ($grouping == 'Category') {\n $query = $query . \"INNER JOIN products ON sales_transactions.product_id = products.id \";\n $query = $query . \"INNER JOIN categories ON products.category_id = categories.id \";\n $query = $query . \" WHERE transaction_date between '\" . $fromDate . \"' and '\" . $thruDate . \"' \";\n $query = $query . \"GROUP BY categories.category_name\";\n } else {\n $query = $query . \"INNER JOIN salespeople ON sales_transactions.salesperson_id = salespeople.id \";\n $query = $query . \"INNER JOIN products ON sales_transactions.product_id = products.id \";\n $query = $query . \" WHERE transaction_date between '\" . $fromDate . \"' and '\" . $thruDate . \"' \";\n $query = $query . \"GROUP BY CONCAT(salespeople.last_name,', ',salespeople.first_name)\";\n }\n if($stat == 'Quantity') {\n $query = $query . \" ORDER BY sum(quantity) DESC\";\n } else {\n $query = $query . \" ORDER BY sum(products.price * quantity) DESC\";\n }\n\n\n $graphdata = \\DB::select($query);\n\n // if the result set has more than 10 rows, need to group the results in 10 and higher into category of \"other\"\n $other = array();\n if (count($graphdata) > 10) {\n $graphdata2 = new \\Illuminate\\Database\\Eloquent\\Collection;\n for ($i=0; $i<10; $i++) {\n $graphdata2[$i] = $graphdata[$i];\n }\n $qty = 0;\n $dol = 0;\n for ($i=10; $i<count($graphdata); $i++) {\n $qty = $qty + $graphdata[$i]->Quantity;\n $dol = $dol + $graphdata[$i]->Dollars;\n }\n\n $other = \\DB::select(\"SELECT 'Other' as 'Group',\" . $qty . \" as 'Quantity',\" . $dol . \" as 'Dollars' FROM sales_transactions where id=1\");\n $graphdata = $graphdata2;\n }\n\n return view('salesdashboard')->with('graphdata',$graphdata)->with('grouping',$grouping)->with('period',$period)->with('chart',$chart)->with('query',$query)->with('stat',$stat)->with('other',$other)->with('fromDate',$fromDate)->with('thruDate',$thruDate);\n }", "private function data()\n {\n return [\n 'start_date'=>date('Y-m-d', strtotime('-7 days')),\n 'end_date'=>date('Y-m-d')\n ];\n }", "public function getDataWeek()\n {\n return $this->model()->where('created_at', '>=', Carbon::now()->startOfWeek())->get();\n }", "public function get_transaction_by_day($date){\n $this->load->database();\n\n $query = $this->db->select('type,is_of,amount')\n ->get_where('tbl_transactions',array('date' => $date));\n return $query->result_array();\n }", "public function expenseGraphData()\n {\n $expenses = Expense::all();\n $supplierPayments = $expenses->where('expensable_type', Expenses::GOOD_RECEIVE)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n $doctorPayments = $expenses->where('expensable_type', Expenses::SCHEDULE_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n\n return ResponseHelper::findSuccess('Expense Graph Data', [\n 'supplierPaymentsGraphData' => $supplierPayments,\n 'doctorPaymentsGraphData' => $doctorPayments,\n ]);\n }", "protected function getData()\n\t{\n\t\t$today = $this->get(\"events\", array(\n\t\t\t\"per_page\" => -1,\n\t\t\t\"date\" => date(\"Y-m-d\", time())\n\t\t));\n\n\t\t$tomorrow = $this->get(\"events\", array(\n\t\t\t\"per_page\" => -1,\n\t\t\t\"date\" => date(\"Y-m-d\", strtotime(\"+1 day\"))\n\t\t));\n\n\t\t// if it's not friday, return\n\t\tif (date(\"N\", time()) != 5) {\n\t\t\treturn $this->combineData(array($today, $tomorrow));\n\t\t}\n\n\n\t\t// if today is friday, also get sunday and monday's events\n\t\t$sunday = $this->get(\"events\", array(\n\t\t\t\"per_page\" => -1,\n\t\t\t\"date\" => date(\"Y-m-d\", strtotime(\"+2 days\"))\n\t\t));\n\n\t\t$monday = $this->get(\"events\", array(\n\t\t\t\"per_page\" => -1,\n\t\t\t\"date\" => date(\"Y-m-d\", strtotime(\"+3 days\"))\n\t\t));\n\n\t\treturn $this->combineData(array($today, $tomorrow, $sunday, $monday));\n\t}", "public function incomeGraphData()\n {\n $incomes = Income::all();\n $channelingIncomes = $incomes->where('incomeable_type', Incomes::CHANNELING_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n $pharmacyIncomes = $incomes->where('incomeable_type', Incomes::PHARMACY_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n\n return ResponseHelper::findSuccess('Income Graph Data', [\n 'channelingIncomeGraphData' => $channelingIncomes,\n 'pharmacyIncomeGraphData' => $pharmacyIncomes,\n ]);\n }", "public function run()\n {\n $today = Carbon::now()->format('Y-m-d');\n $twoDaysAgo = Carbon::now()->subDay()->format('Y-m-d');\n $sevenDaysAgo = Carbon::now()->subDays(7)->format('Y-m-d');\n $lastMonth = Carbon::now()->subMonth()->format('Y-m-d');\n\n Transaction::factory()->create([\n 'category_id' => 1, //sales\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $today,\n 'amount' => 20000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 1,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $today,\n 'amount' => 15000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 4, //electric bill\n 'admin_id' => 1,\n 'account_id' => 1,\n 'description' => 'inec',\n 'date' => $today,\n 'amount' => 17500\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 5, // internet\n 'admin_id' => 1,\n 'account_id' => 1,\n 'description' => 'pldc',\n 'date' => $today,\n 'amount' => 12000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 6, // water\n 'admin_id' => 1,\n 'account_id' => 1,\n 'description' => 'inwad',\n 'date' => $today,\n 'amount' => 10000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 7, // fuel\n 'admin_id' => 1,\n 'account_id' => 1,\n 'description' => 'van gas',\n 'date' => $today,\n 'amount' => 5000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 1,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $twoDaysAgo,\n 'amount' => 90000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 7, // fuel\n 'admin_id' => 1,\n 'account_id' => 1,\n 'description' => 'ryan gas',\n 'date' => $twoDaysAgo,\n 'amount' => 30000\n ]);\n\n\n Transaction::factory()->create([\n 'category_id' => 1,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $sevenDaysAgo,\n 'amount' => 10000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 1,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $sevenDaysAgo,\n 'amount' => 20000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 1,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $lastMonth,\n 'amount' => 35000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 7,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $lastMonth,\n 'amount' => 55000\n ]);\n }", "public function getGraphView()\n\t{\n\t\t$chart = new ComboChart();\t\t\n\n\t\t// switch selon le type d'analyse\n\t\tswitch ($this->time) {\n\t\t\t// cas analyse jour\n\t\t\tcase 'day':\t\t\t\t\n\t\t\t $sql = 'SELECT \n\t\t\t\t\t\t\tdate(date_time) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\tgroup by date(date_time)';\n\t\t\t\t\tbreak;\t\t\t\n\t\t\tcase 'month':\n\t\t\t// cas analyse mois\n\t\t\t\t$sql = 'SELECT \n\t\t\t\t\t\t\tleft(date(date_time),7) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\tgroup by left(date(date_time),7)';\n\t\t\t\tbreak;\n\t\t\tcase 'year':\n\t\t\t// cas analyse année\n\t\t\t\t$sql = 'SELECT \n\t\t\t\t\t\t\tleft(date(date_time),4) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\tgroup by left(date(date_time),4)';\n\t\t\t\tbreak;\n\t\t\tcase 'week':\n\t\t\t// cas analyse 7 derniers jours\n\t\t\t\t$date = new dateTime();\n\t\t\t\t$startDate = $date->format('Y-m-d');\n\t \t\t \t$endDate = $date->modify('-1 week');\n\t \t\t \t$endDate = $endDate->format('Y-m-d');\n\n\t\t\t\t$sql = \"SELECT \n\t\t\t\t\t\t\tdate(date_time) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\twhere date_time BETWEEN '\" . $endDate . \"' and '\" . $startDate . \"'\n\t\t\t\t\t\tgroup by date(date_time)\";\n\t\t\t\tbreak;\n\t\t}\n\n\n\t $stmt = $this->em->query($sql);\n\t $views = $stmt->fetchAll();\n\n\t\t// entete du googleGraph\n\t\t$arrayToDataTable[] = ['', 'Montant', ['role' => 'tooltip'], 'Evolution', ['role' => 'tooltip']]; \n\n\t\t//data du googleGraph\n\t\tforeach ($views as $view){\n\t\t\t$arrayToDataTable[] = [$view['date'], intval($view['nb']), intval($view['nb']) .\" vues\", 0, \"evolution\"];\n\t\t}\n\n\t\t$chart->getData()->setArrayToDataTable($arrayToDataTable);\n\t\t$vAxisAmount = new VAxis();\n\t\t$vAxisAmount->setTitle('Nombre de vues');\n\t\t$chart->getOptions()->setVAxes([$vAxisAmount]);\n\n\t\t$seriesAmount = new \\CMEN\\GoogleChartsBundle\\GoogleCharts\\Options\\ComboChart\\Series();\n\t\t$seriesAmount->setType('bars');\n\t\t$seriesAmount->setTargetAxisIndex(0);\n\t\t$seriesEvol = new \\CMEN\\GoogleChartsBundle\\GoogleCharts\\Options\\ComboChart\\Series();\n\t\t$seriesEvol->setType('line');\n\t\t$seriesEvol->setTargetAxisIndex(1);\n\t\t$chart->getOptions()->setSeries([$seriesAmount, $seriesEvol]);\n\t\t$chart->getOptions()->setColors(['black', 'red']);\t\n\n\t\treturn $chart;\t\t\n\t}", "function getAllTransactions()\n {\n $transactions = $this->all();\n\n /* Add additional attributes to each Stock */\n foreach ($transactions as $transaction)\n {\n // Add a link to each stock's history page\n $transaction->href = '/transaction/' . $transaction->DateTime;\n }\n\n return $transactions;\n }", "public function getTransactionsDataLast24Hours($customerId)\n {\n $to = $this->_date->date('Y-m-d H:i:s');\n $from = strtotime($to.\"-24hours\");\n $from = $this->_date->date('Y-m-d H:i:s', $from);\n \n $transactionResource = $this->_transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByHour($from, $to, $customerId);\n $result = $this->_processReceivedTransactionData($data, $result);\n \n $data = $transactionResource->getSpentCreditTransactionsByHour($from, $to, $customerId);\n $result = $this->_processSpentTransactionData($data, $result);\n \n $result = array_values($result);\n return $result;\n }", "function all(){\n\t\t$query = $this->db->query(\"SELECT * FROM transactions ORDER BY DateTime DESC;\");\n\t\t\n\t\treturn $query->result_array();\n\t}", "function get_statistics_data_view($params)\r\n {\r\n $params = (object)$params;\r\n $default_params = (object)array(\r\n 'user_id' => USER_ID,\r\n 'sdate' => date('Y-m-d'),\r\n 'edate' => date('Y-m-d', strtotime(\"-1 week\"))\r\n );\r\n foreach($default_params as $key => $value){\r\n if(!isset($params->{$key}))\r\n $params->{$key} = $value;\r\n }\r\n \r\n $period = new DatePeriod(\r\n new DateTime($params->sdate),\r\n new DateInterval('P1D'),\r\n new DateTime($params->edate)\r\n );\r\n\r\n $data = array();\r\n \r\n $sql = \"SELECT \r\n date_format(v.regdate, '%Y-%m-%d') as date,\r\n count(v.id) as log_count,\r\n count(distinct v.work_id) as work_count\r\n from\r\n log_work_view as v\r\n left join works on works.work_id = v.work_id\r\n where\r\n works.user_id = ?\r\n and v.regdate between ? and ?\r\n group by date\"; \r\n $query = $this->db->query($sql, array($params->user_id, $params->sdate, $params->edate));\r\n foreach ($query->result() as $row)\r\n {\r\n $data[$row->date] = $row->log_count;\r\n }\r\n\r\n $output = array();\r\n foreach ($period as $date) {\r\n $dateString = $date->format('Y-m-d');\r\n $output[$dateString] = (empty($data[$dateString]))?0:$data[$dateString];\r\n }\r\n\r\n return $output;\r\n }", "public function getTransactions()\n\t{\n\t\treturn $this->data['transactions'];\n\t}", "public static function getChartData(Request $request)\n {\n $user = auth()->user();\n $chart = new Chart($request);\n $query_params = $chart->setQueryParams();\n\n $query = (new Order())->newQuery();\n\n if (Bouncer::is($user)->an('editor')) {\n $query->where('client_id', $user->clientId());\n }\n\n $orders = $query->select('total', 'created_at')\n ->whereBetween('created_at', [$query_params['from'], $query_params['to']])\n ->orderBy('created_at')\n ->get()\n ->groupBy(function ($val) use ($query_params) {\n return Carbon::parse($val->created_at)->format($query_params['group']);\n });\n\n return $chart->returnQueryData($query_params['iterator'], $orders);\n }", "function calculateGBPFX7($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] GBPFX7 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $NZDUSD = $data['NZDUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $nzdusd = $NZDUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$nzdusd) * 100, 1/7) * $gbpusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $nzdusd = $NZDUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$nzdusd) * 100, 1/7) * $gbpusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function chartData()\n {\n // Data tanggal selama 7 hari\n foreach(range(0, 7) as $day) {\n $dates[] = Carbon::now()->subDays($day)->format('yy-m-d');\n $tanggal = array_reverse($dates);\n }\n\n // Jumlah buku yang dipinjam per hari selama 1 mingggu\n foreach($tanggal as $date){\n $chartdata = Peminjaman::select(DB::raw('DATE(tanggal_pinjam) as date'))\n ->selectRaw('count(tanggal_pinjam) as jumlah')\n ->where('tanggal_pinjam', 'like', '%'.$date.'%')\n ->orderBy('tanggal_pinjam')\n ->groupBy('date')\n ->pluck('jumlah')\n ->toArray();\n\n if($chartdata){\n $jumlah[] = $chartdata[0];\n }else {\n $jumlah[] = 0;\n }\n }\n \n return response()->json([\n 'jumlah' => $jumlah,\n 'tanggal' => $tanggal\n ]);\n }", "public function doctorIncomeGraphData()\n {\n $schedules = Auth::user()->doctor->schedules;\n $channelingIncomeGraphData = Appointment::whereIn('schedule_id', $schedules->pluck('id'))\n ->whereIn('status', [Appointments::PENDING, Appointments::COMPLETED])\n ->get()\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum(function ($appointment) {\n return $appointment->schedule->doctor_fee;\n })\n ];\n })->values()->all();\n $receivedPaymentsGraphData = Expense::whereIn('expensable_id', $schedules->pluck('id'))\n ->get()\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n return ResponseHelper::findSuccess('Items Summary Data', [\n 'channelingIncomeGraphData' => $channelingIncomeGraphData,\n 'receivedPaymentsGraphData' => $receivedPaymentsGraphData,\n ]);\n }", "private function getTempExtremsToday() {\n //get last update date\n $update = explode(\" \", $this->lastUpdateStr())[0];\n\n $statement = $this->db->prepare('SELECT max(\"amount\") as \"high\", min(\"amount\") as \"low\" FROM \"temperature\" WHERE date(\"created\") = ?');\n $statement->bindValue(1, $update);\n $result = $statement->execute();\n return $result->fetchArray(SQLITE3_ASSOC);\n }", "public function getBuyerHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $buyer = DB::connection('virtual_market')\n ->table('orders')\n ->select(DB::raw($dateQuery.',count(distinct customer_id)'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['buyer'] = $buyer;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function list()\n {\n return view('transactions.graphs');\n }", "public function getTransaction();", "public function index()\n\t{\n\t\t$this->load->helper('url');\n\t\t$this->load->library('session');\n\t\t$this->load->database();\n\n\t\t$this->is_logged_in();\n\n\t\t$this->getSalesToday();\n\t\t$sql = $this->db->query(\"SELECT distinct(DATE_FORMAT(tr_at, '%Y-%m')) 'm', SUM(total) 'p' FROM transaction t group by YEAR(tr_at),MONTH(tr_at)\");\n\t\t//$sql = $this->db->query(\"SELECT distinct(DATE_FORMAT(t.tr_at, '%Y-%m')) 'm', b.br_id 'b', SUM(t.total) 'p' FROM transaction t, branch b where t.br_id = b.br_id group by YEAR(t.tr_at),MONTH(t.tr_at), t.br_id;\");\n\n\t\t$rows = json_encode($sql->result());\n\t\t// foreach($rows as $date):\n\t\t// $date->dates;\n\t\t// endforeach;\n\t\t$sql_branch = $this->db->query('SELECT * FROM branch');\n\t\t$branches = $sql_branch->result();\n\n\t\t$transactions = $this->db->query(\"SELECT t.tr_id 'tr_id', t.tr_at 'date', u.firstname 'firstname', u.lastname 'lastname', b.br_name 'branch', t.total 'total' FROM `transaction` t, `users` u, branch b WHERE t.user_id = u.user_id AND t.br_id = b.br_id\");\n\t\t$x = [\n\t\t\t\t'dataforChart' => $rows,\n\t\t\t\t'branches'=> $branches,\n\t\t\t\t'transactions' => $transactions->result(),\n\t\t];\n\n $this->load->view('template/header', $x);\n $this->load->view('dashboard/dashboard', $x);\n $this->load->view('template/footer', $x);\n\n\t}", "public function pharmacySalesGraphData()\n {\n $prescriptions = Prescription::whereIn('status',[Prescriptions::PAID_PRESCRIPTION,Prescriptions::ISSUED_PRESCRIPTION])->get();\n $internalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::INTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n $externalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::EXTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n return ResponseHelper::findSuccess('Explorations Data', [\n 'internalPrescriptionsSales' => $internalPrescriptions,\n 'externalPrescriptionsSales' => $externalPrescriptions,\n ]);\n }", "public function getDebitData()\n {\n $where = \"(SELECT DATEDIFF(sales_order.`due_date`, '$this->curDate') AS days) < 14 AND sales_order.`status_paid` = 0 AND sales_order.`active` = 1\";\n $this->db->where($where);\n $this->db->from('sales_order');\n $query = $this->db->get();\n\n $data['sum'] = 0;\n $data['count'] = 0;\n\n if ($query->num_rows() > 0) {\n foreach ($query->result() as $row) {\n $data['count']++;\n $data['sum'] += ($row->grand_total - $row->paid);\n }\n }\n return $data;\n }", "function getTransactions() {\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_URL => \"https://hackathon-be.mybluemix.net/customer/304fd2e19f1c14fe3345cca788e4e83d/amexprofitability\",\n\t CURLOPT_USERAGENT => 'BankBase BOC Hackathon Request'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$resp_decode = json_decode($resp);\n\treturn $resp_decode;\n}", "public static function getRegistered(): array {\n return [\n 'labels' => UserSiteAccessStatistics::whereNotNull('amount_registered')->whereBetween('created_at', [Carbon::today()->subDays(7), Carbon::today()])->get()->map(function($statistic) {\n return $statistic->created_at->format('y-m-d g:i A');\n }),\n 'data' => UserSiteAccessStatistics::whereNotNull('amount_registered')->whereBetween('created_at', [Carbon::today()->subDays(7), Carbon::today()])->get()->pluck('amount_registered'),\n ];\n }", "public function getFeedTransDetails($var)\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$query = \" SELECT DISTINCT ft.ft_id,\r\n\t\t\t\t\t\t\tft.quantity,\r\n\t\t\t\t\t\t\tft.unit,\r\n\r\n\t\t\t\t\t\t\tft.date_given,\r\n\t\t\t\t\t\t\tft.time_given,\r\n\t\t\t\t\t\t\tft.pig_id,\r\n\t\t\t\t\t\t\tft.feed_id,\r\n\t\t\t\t\t\t\tft.prod_date,\r\n\t\t\t\t\t\t\tf.feed_name,\r\n\t\t\t\t\t\t\tf.feed_type\r\n\t\t\t\t\t\t\tFROM feed_transaction ft \r\n\t\t\t\t\t\t\tINNER JOIN feeds f on\r\n\t\t\t\t\t\t\t\tft.feed_id = f.feed_id\r\n\t\t\t\t\t\t\tWHERE ft.feed_id = '\" . $var . \"'\";\r\n\t\t\t\t$result = mysqli_query($link, $query);\r\n\t\t\t\t$f = array();\r\n\t\t\t\t$f_arr = array();\r\n\t\t\t\twhile($row = mysqli_fetch_row($result)){\r\n\t\t\t\t\t$f['ft_id'] = $row[0];\r\n\t\t\t\t\t$f['qty'] = $row[1];\r\n\t\t\t\t\t$f['unit'] = $row[2];\r\n\t\t\t\t\t$date = date_create($row[3]);\r\n\t\t\t\t\t$f['d_given'] = $date->format('F j,Y');\r\n\t\t\t\t\t$f['t_given'] = $row[4];\r\n\t\t\t\t\t$f['pid'] = $row[5];\r\n\t\t\t\t\t$f['f_id'] = $row[6];\r\n\t\t\t\t\t$date2 = date_create($row[7]);\r\n\t\t\t\t\t$f['proddate'] = $date2->format('F j,Y');\r\n\t\t\t\t\t$f['fname'] = $row[8];\r\n\t\t\t\t\t$f['ftype'] = $row[9];\r\n\t\t\t\t\t$f_arr[] = $f;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\treturn $f_arr;\r\n\t\t\t\t\r\n\t\t}", "function calculateSGDFX7($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] SGDFX7 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $USDSGD = $data['USDSGD']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $usdsgd = $USDSGD[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdsgd * 100000;\n $iOpen = (int) round($open * 100000);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $usdsgd = $USDSGD[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdsgd * 100000;\n $iClose = (int) round($close * 100000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function getWaiverTransactionByWeek_post() {\n $this->form_validation->set_rules('ContestGUID', 'ContestGUID', 'trim|required|callback_validateEntityGUID[Contest,ContestID]');\n $this->form_validation->validation($this); /* Run validation */\n $TransactionHistory = $this->SnakeDrafts_model->getWaiverTransactionByWeek($this->ContestID);\n if ($TransactionHistory) {\n $this->Return['Data'] = $TransactionHistory;\n }\n }", "public function getBuyerStats($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n\n DB::enableQueryLog();\n // execute\n $uniqueBuyers = array();\n $uniqueBuyers['current_period'] = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', 'order_statuses.id')\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->where('order_statuses.status', '=', $this->successStatus )\n ->whereIn('order_statuses.name', [$this->successName])\n ->distinct('customer_id')\n ->count('customer_id');\n\n $uniqueBuyers['prev_period'] = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', 'order_statuses.id')\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->where('order_statuses.status', '=', $this->successStatus )\n ->whereIn('order_statuses.name', [$this->successName])\n ->distinct('customer_id')\n ->count('customer_id');\n\n\n // buyers who make transactions more than once\n $returningBuyers = array(); \n $returningBuyers['current_period'] = DB::connection('virtual_market')\n ->table('orders')\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('customer_id')\n ->havingRaw('count(customer_id) > 1')\n ->distinct('customer_id')\n ->count('customer_id');\n\n $returningBuyers['prev_period'] = DB::connection('virtual_market')\n ->table('orders')\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->groupBy('customer_id')\n ->havingRaw('count(customer_id) > 1')\n ->distinct('customer_id')\n ->count('customer_id');\n\n $data = array();\n $data['unique_buyers'] = $uniqueBuyers;\n $data['returning_buyers'] = $returningBuyers;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "function getDailyReport($date = null)\n{\n//SELECT COUNT(0)\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `invoice_count`,\n//`b`.`tran_date` AS `tran_date`,(\n//SELECT COUNT(`0_debtor_trans_details`.`id`)\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND\n//(`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_service_count`,(\n//SELECT SUM((`0_debtor_trans`.`ov_amount` + `0_debtor_trans`.`ov_gst`))\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_invoice_amount`,(\n//SELECT SUM(`0_debtor_trans`.`alloc`)\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_amount_recieved`,(\n//SELECT (SUM((`0_debtor_trans`.`ov_amount` + `0_debtor_trans`.`ov_gst`)) - SUM(`0_debtor_trans`.`alloc`))\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `pending_amount`,(\n//SELECT (SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`unit_price`)) -\n//SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`discount_amount`)))\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND (`0_debtor_trans`.`type` = 10) AND\n//(`0_debtor_trans`.`tran_date` = '$date'))) AS `total_service_charge`,(\n//SELECT SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`user_commission`))\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND (`0_debtor_trans`.`type` = 10) AND\n//(`0_debtor_trans`.`tran_date` = '$date'))) AS `total_commission`,(\n//SELECT SUM(ABS(`0_gl_trans`.`amount`))\n//FROM `0_gl_trans`\n//WHERE ((`0_gl_trans`.`type` = 12) AND (`0_gl_trans`.`account` = 1200) AND\n//(`b`.`tran_date` = '$date'))) AS `total_collection`\n//FROM ((`0_debtor_trans` `a`\n//JOIN `0_gl_trans` `b` ON((`a`.`trans_no` = `b`.`type_no`)))\n//JOIN `0_debtor_trans_details` `c` ON((`a`.`trans_no` = `c`.`debtor_trans_no`)))\n//WHERE ((`c`.`debtor_trans_type` = 10) AND (`a`.`type` = 10)) and `b`.`tran_date` = '$date'\n//GROUP BY `b`.`tran_date`\n//ORDER BY `b`.`tran_date`\";\n//\n//// if ($date) {\n//// $sql .= \" and tran_date='$date' \";\n//// }\n////\n//// $sql .= \" order by tran_date desc LIMIT 10\";\n//\n//\n//// print_r($sql); die;\n//\n// $result = db_query($sql, \"Transactions could not be calculated\");\n//\n// $table_html = \"\";\n//\n// $i = 0;\n//\n// while ($myrow = db_fetch($result)) {\n//\n// $class = 'class=\"oddrow\"';\n// if ($i % 2 == 0)\n// $class = 'class=\"evenrow\"';\n//\n// $table_html .= \"<tr $class>\";\n// $table_html .= \"<td>\" . $myrow['tran_date'] . \"</td>\";\n// $table_html .= \"<td style='text-align: center'>\" . $myrow['invoice_count'] . \"</td>\";\n// $table_html .= \"<td style='text-align: center'>\" . $myrow['total_service_count'] . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_service_charge'], user_price_dec()) . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_invoice_amount'], user_price_dec()) . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_collection'], user_price_dec()) . \"</td>\";\n// $table_html .= \"</tr>\";\n// $i++;\n// }\n// return $table_html;\n\n}", "static function getPaymentBookingHistory() {\n global $wpdb;\n $resultset = $wpdb->get_results(\n \"SELECT t.reservation_id, t.booking_reference, t.first_name, t.last_name, t.email, t.vendor_tx_code, t.payment_amount, a.auth_status, a.auth_status_detail, a.card_type, a.last_4_digits, a.processed_date\n FROM wp_sagepay_transaction t\n INNER JOIN wp_sagepay_tx_auth a ON t.vendor_tx_code = a.vendor_tx_code\n WHERE t.reservation_id IS NOT NULL\n UNION ALL \n SELECT reservation_id, booking_reference, first_name, last_name, email, vendor_tx_code, \n payment_amount, auth_status, auth_status_detail, card_type, last_4_digits, processed_date\n FROM wp_stripe_transaction\n WHERE processed_date IS NOT NULL\n AND booking_reference IS NOT NULL\n ORDER BY processed_date DESC\n LIMIT 100\" );\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n return $resultset;\n }", "public function retrieveRevenueData()\n {\n //setting header to json\n header('Content-Type: application/json');\n\n //query to get the revenue data\n $query = sprintf(\"SELECT CONCAT(YEAR(date), '/', WEEK(date)) AS theWeek, SUM(exlAmount) AS revenue FROM payment GROUP BY theWeek ORDER BY YEAR(DATE) ASC, WEEK(date) ASC;\");\n\n //execute query\n $result = $GLOBALS['db']->query($query);\n\n //loop through the returned data\n $data = array();\n foreach ($result as $row) {\n $data[] = $row;\n }\n\n //free memory associated with result\n $result->close();\n\n //return the data\n return $data;\n }", "function getOrdersData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n $total=0;\n if($varAction=='today' || $varAction=='yesterday'){\n if($varAction=='today'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n \n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $arrClms = array('TIME(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded < \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$i]['time'][]=$arrData;\n $arrRes['data'][$i]['count']=$count;\n $total +=$count;\n }\n $arrRes['total']=$total;\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_week'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$count;\n $total +=$count;\n }\n $arrRes['total']=$total;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_month'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $lastMonth.'=='.$lastMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$count;\n $total +=$count; \n }\n $arrRes['total']=$total;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "function calculateEURFX7($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] EURFX7 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $NZDUSD = $data['NZDUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $nzdusd = $NZDUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$gbpusd) * ($usdjpy/$nzdusd) * 100, 1/7) * $eurusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $nzdusd = $NZDUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$gbpusd) * ($usdjpy/$nzdusd) * 100, 1/7) * $eurusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function getPaymentHistory(){\r\n\t\t$result = array();\r\n\t\treturn $result;\r\n\t}", "public function getDistribusiRevenueData()\n {\n $rekening_tabungan = $this->getRekening(\"TABUNGAN\");\n $rekening_deposito = $this->getRekening(\"DEPOSITO\");\n\n $data_rekening = array();\n $total_rata_rata = array();\n\n foreach($rekening_tabungan as $tab)\n {\n $rata_rata_product_tabungan = 0.0;\n $tabungan = $this->tabunganReporsitory->getTabungan($tab->nama_rekening);\n foreach($tabungan as $user_tabungan) {\n $temporarySaldo = $this->getSaldoAverageTabunganAnggota($user_tabungan->id_user, $user_tabungan->id);\n $rata_rata_product_tabungan = $rata_rata_product_tabungan + $temporarySaldo;\n }\n Session::put($user_tabungan->jenis_tabungan, $rata_rata_product_tabungan);\n array_push($total_rata_rata, $rata_rata_product_tabungan);\n }\n\n foreach($rekening_deposito as $dep)\n {\n $rata_rata_product_deposito = 0.0;\n $deposito = $this->depositoReporsitory->getDepositoDistribusi($dep->nama_rekening);\n foreach($deposito as $user_deposito) {\n if ($user_deposito->type == 'jatuhtempo'){\n $tanggal = $user_deposito->tempo;\n }\n else if($user_deposito->type == 'pencairanawal')\n {\n $tanggal = $user_deposito->tanggal_pencairan;\n }\n else if($user_deposito->type == 'active')\n {\n $tanggal = Carbon::parse('first day of January 1970');\n }\n $temporarySaldo = $this->getSaldoAverageDepositoAnggota($user_deposito->id_user, $user_deposito->id, $tanggal);\n $rata_rata_product_deposito = $rata_rata_product_deposito + $temporarySaldo ;\n }\n Session::put($dep->nama_rekening, $rata_rata_product_deposito);\n array_push($total_rata_rata, $rata_rata_product_deposito);\n }\n\n $total_rata_rata = $this->getTotalProductAverage($total_rata_rata);\n Session::put(\"total_rata_rata\", $total_rata_rata);\n $total_pendapatan = $this->getRekeningPendapatan(\"saldo\") - $this->getRekeningBeban(\"saldo\");\n $total_pendapatan_product = 0;\n\n foreach($rekening_tabungan as $tab)\n {\n $tabungan = $this->tabunganReporsitory->getTabungan($tab->nama_rekening);\n $rata_rata = Session::get($tab->nama_rekening);\n $nisbah_anggota = json_decode($tab->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($tab->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_pendapatan_product += $pendapatan_product;\n\n array_push($data_rekening, [\n \"jenis_rekening\" => $tab->nama_rekening,\n \"jumlah\" => count($tabungan),\n \"rata_rata\" => $rata_rata,\n \"nisbah_anggota\" => $nisbah_anggota,\n \"nisbah_bmt\" => $nisbah_bmt,\n \"total_rata_rata\" => $total_rata_rata,\n \"total_pendapatan\" => $total_pendapatan,\n \"pendapatan_product\" => $pendapatan_product,\n \"porsi_anggota\" => $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product),\n \"porsi_bmt\" => $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product),\n \"percentage_anggota\" => $total_pendapatan > 0 ?$this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product) / $total_pendapatan : 0\n ]);\n }\n\n foreach($rekening_deposito as $dep)\n {\n $deposito = $this->depositoReporsitory->getDepositoDistribusi($dep->nama_rekening);\n $rata_rata = Session::get($dep->nama_rekening);\n $nisbah_anggota = json_decode($dep->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($dep->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_pendapatan_product += $pendapatan_product;\n\n array_push($data_rekening, [\n \"jenis_rekening\" => $dep->nama_rekening,\n \"jumlah\" => count($deposito),\n \"rata_rata\" => $rata_rata,\n \"nisbah_anggota\" => $nisbah_anggota,\n \"nisbah_bmt\" => $nisbah_bmt,\n \"total_rata_rata\" => $total_rata_rata,\n \"total_pendapatan\" => $total_pendapatan,\n \"pendapatan_product\" => $pendapatan_product,\n \"porsi_anggota\" => $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product),\n \"porsi_bmt\" => $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product)\n ]);\n }\n\n\n return $data_rekening;\n }", "public function getHistories($user_id = null ,$fromDate = null ,$toDate = null,$params = array())\n {\n \n $condition = array();\n $condition =\" 1=1 \";\n if ($user_id != null)\n {\n $condition .= \" AND his.user_id = \".$user_id;\n }\n if ($fromDate != null)\n {\n $condition .= \" AND DATEDIFF(DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d'),'\".$fromDate.\"')>=0\";\n }\n if ($toDate != null)\n {\n $condition .= \" AND DATEDIFF(DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d'),'\".$toDate.\"')<=0\";\n }\n foreach($params as $key=>$value)\n {\n if ( $key != 'limit' && $key!='group_by')\n $condition .= $value;\n }\n if(!isset($params['limit']))\n $params['limit'] = 50;\n $count = 0;\n if(!isset($params['group_by']))\n {\n $count = 0;\n $t_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music');\n $t_name = $t_table->info('name');\n $select = $t_table->select()->setIntegrityCheck(false)\n ->from(\"$t_name as his\",array(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d' ) as pDate\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='song' and item_id>0 and transaction_status =1) as selling_sold_songs\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='album' and item_id>0 and transaction_status =1) as selling_sold_albums\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 0) as selling_transaction_fail\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 1) as selling_transaction_succ\",\n \"(SELECT sum(amount) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and (item_type='song' or item_type='album') and item_id>0 and transaction_status = 1 ) as selling_total_amount\"\n ));\n $select ->where($condition)\n ->group(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d')\")\n ->order(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d') DESC\")\n ->limit($params['limit']);\n $histories = $t_table->fetchAll($select)->toArray();\n $count = count($histories); \n return array($histories,$count);\n }\n else\n {\n $count = 0; \n $t_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music');\n $t_name = $t_table->info('name');\n $select = $t_table->select()->setIntegrityCheck(false)\n ->from(\"$t_name as his\",array(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d' ) as pDate\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='song' and item_id>0 and transaction_status =1) as selling_sold_songs\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='album' and item_id>0 and transaction_status =1) as selling_sold_albums\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 0) as selling_transaction_fail\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 1) as selling_transaction_succ\",\n \"(SELECT sum(amount) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and (item_type='song' or item_type='album') and item_id>0 and transaction_status = 1 ) as selling_total_amount\"\n ));\n $select ->where($condition)\n ->group($params['group_by'])\n ->order(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d') ASC\")\n ->limit($params['limit']);\n $histories = $t_table->fetchAll($select)->toArray();\n $count = count($histories); \n return array($histories,$count);\n }\n \n }", "function get_statistics_data_collect($params)\r\n {\r\n $params = (object)$params;\r\n $default_params = (object)array(\r\n 'user_id' => USER_ID,\r\n 'sdate' => date('Y-m-d'),\r\n 'edate' => date('Y-m-d', strtotime(\"-1 week\"))\r\n );\r\n foreach($default_params as $key => $value){\r\n if(!isset($params->{$key}))\r\n $params->{$key} = $value;\r\n }\r\n \r\n $period = new DatePeriod(\r\n new DateTime($params->sdate),\r\n new DateInterval('P1D'),\r\n new DateTime($params->edate)\r\n );\r\n\r\n $data = array();\r\n \r\n $sql = \"SELECT \r\n date_format(c.regdate, '%Y-%m-%d') as date,\r\n count(c.id) as log_count,\r\n count(distinct c.work_id) as work_count\r\n from\r\n user_work_collect as c\r\n left join works on works.work_id = c.work_id\r\n where\r\n works.user_id = ?\r\n and c.regdate between ? and ?\r\n group by date\"; \r\n $query = $this->db->query($sql, array($params->user_id, $params->sdate, $params->edate));\r\n foreach ($query->result() as $row)\r\n {\r\n $data[$row->date] = $row->log_count;\r\n }\r\n\r\n $output = array();\r\n foreach ($period as $date) {\r\n $dateString = $date->format('Y-m-d');\r\n $output[$dateString] = (empty($data[$dateString]))?0:$data[$dateString];\r\n }\r\n\r\n return $output;\r\n }", "public function getSixMonthsData() {\n\t\t$dates = getPeriods('SixMonths');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear'], 6);\t\t\n\t}", "private function getTraffic() {\n $readSiteViews = new Read;\n $readSiteViews->ExeRead('ws_siteviews', \"WHERE siteviews_date = :date\", \"date = {$this->Date}\");\n if ($readSiteViews->getRowCount()):\n $this->Traffic = $readSiteViews->getResult()[0];\n endif;\n }", "public function get_trend_data_rows()\n\t{\n\t\t$dates = array();\n\t\t$i_rows = array();\n\t\t$sr_rows = array();\n\t\t$trend_data = array();\n\n\t $current_month = date_create()->format('Y-m-d H:i:s');\n\n\t // echo $current_month_first_day=date_create($current_month)\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\t $current_month_first_day=date_create($current_month)\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n\n $dates[] = $current_month_first_day;\n\n //echo\"</br>\";\n \n // echo $current_month_current_day=date_create($current_month)\n // ->format(\"Y-m-d 23:59:59\");\n\n $current_month_current_day=date_create($current_month)\n ->format(\"Y-m-d 23:59:59\");\t\n\n $dates[] = $current_month_current_day;\n\n //echo\"</br></br>\";\n\n // echo $second_month_first_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $second_month_first_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $second_month_first_day;\n\n //echo\"</br>\";\n\n // echo $second_month_last_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n $second_month_last_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $second_month_last_day;\n\n// echo\"</br></br>\";\n\n // echo $third_month_first_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $third_month_first_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $third_month_first_day;\n\n //echo\"</br>\";\n \t\t\t\n // echo $third_month_last_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n\t $third_month_last_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $third_month_last_day;\n\n // echo\"</br>\";\t\n // echo \"<pre>\";\n // print_r($dates);\n\t // echo \"</pre>\";\t\n\t // echo\"</br>\";\t\t\t \n\n for ($i=0; $i <=5 ; $i=$i+2)\n { \t\n \t//echo\"</br>\";\n\n \t$start = new DateTime($dates[$i]);\n \t\n \t//echo\"</br>\";\n\n\t\t$start = date_format($start,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\n\t\t$end = new DateTime($dates[$i+1]);\n\n\t\t//echo\"</br>\";\n\n\t\t$end = date_format($end,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\t\t$i_rows[] = date_create($start)->format(\"F Y\");\n\t\t$i_rows[] = date_create($end)->format(\"F Y\");\n\t\t$i_rows[] = $this->trend_insident_data($start,$end);\n \t$sr_rows[] = date_create($start)->format(\"F Y\");\n\t\t$sr_rows[] = date_create($end)->format(\"F Y\");\n \t$sr_rows[] = $this->trend_sr_data($start,$end);\t\n }\n\n // echo \"<pre>\";\n // \tprint_r($i_rows);\n \t\t// echo \"<h4>SR Array</h4>\";\n \t\t// print_r($sr_rows);\n \t\t// echo \"</pre>\";\n\n \t\t$trend_data[] = $i_rows;\n \t\t$trend_data[] = $sr_rows;\n\n\n \t\treturn $trend_data;\n\n\n // // First day of a specific month\n // $d = new DateTime('2010-01-19');\n // $d->modify('first day of this month');\n // echo $d->format('jS, F Y').\"</br>\";\n\n // // alternatively...\n // echo date_create('2010-01-19')\n // ->modify('first day of this month')\n // ->format('jS, F Y');\n\t\t//exit();\n\t}", "public function getDailyForecast() : array\n {\n $data = $this->getForecast();\n return $data[self::DAILY_KEY] ?? [];\n }", "public function initChart()\r\n {\r\n $days = 6;\r\n $this->lastDaysStartDate = date('Y-m-d', strtotime(\"-$days days\"));\r\n for ($i = $days; $i > 0; $i--) {\r\n $this->lastDays[] = array(\r\n 'display' => date('D, M d', strtotime(\"-$i days\")) ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', strtotime(\"-$i days\")) ,\r\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', strtotime(\"-$i days\"))\r\n )\r\n );\r\n }\r\n $this->lastDays[] = array(\r\n 'display' => date('D, M d') ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', strtotime(\"now\")) ,\r\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', strtotime(\"now\"))\r\n )\r\n );\r\n $days = 13;\r\n for ($i = $days; $i >= 7; $i--) {\r\n $this->lastDaysPrev[] = array(\r\n 'display' => date('M d, Y', strtotime(\"-$i days\")) ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', strtotime(\"-$i days\")) ,\r\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', strtotime(\"-$i days\"))\r\n )\r\n );\r\n }\r\n //# last weeks date settings\r\n $timestamp_end = strtotime('last Saturday');\r\n $weeks = 3;\r\n $this->lastWeeksStartDate = date('Y-m-d', $timestamp_end-((($weeks*7) -1) *24*3600));\r\n for ($i = $weeks; $i > 0; $i--) {\r\n $start = $timestamp_end-((($i*7) -1) *24*3600);\r\n $end = $start+(6*24*3600);\r\n $this->lastWeeks[] = array(\r\n 'display' => date('M d', $start) . ' - ' . date('M d', $end) ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', $start) ,\r\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', $end) ,\r\n )\r\n );\r\n }\r\n $this->lastWeeks[] = array(\r\n 'display' => date('M d', $timestamp_end+24*3600) . ' - ' . date('M d') ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', $timestamp_end+24*3600) ,\r\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', strtotime('now'))\r\n )\r\n );\r\n $weeks = 7;\r\n for ($i = $weeks; $i > 3; $i--) {\r\n $start = $timestamp_end-((($i*7) -1) *24*3600);\r\n $end = $start+(6*24*3600);\r\n $this->lastWeeksPrev[] = array(\r\n 'display' => date('M d', $start) . ' - ' . date('M d', $end) ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', $start) ,\r\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', $end)\r\n )\r\n );\r\n }\r\n //# last months date settings\r\n $months = 2;\r\n $this->lastMonthsStartDate = date('Y-m-01', strtotime(\"-$months months\"));\r\n for ($i = $months; $i > 0; $i--) {\r\n $this->lastMonths[] = array(\r\n 'display' => date('M, Y', strtotime(\"-$i months\")) ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-01', strtotime(\"-$i months\")) ,\r\n '#MODEL#.created <=' => date('Y-m-t', strtotime(\"-$i months\")) ,\r\n )\r\n );\r\n }\r\n $this->lastMonths[] = array(\r\n 'display' => date('M, Y') ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-01', strtotime('now')) ,\r\n '#MODEL#.created <=' => date('Y-m-t', strtotime('now')) ,\r\n )\r\n );\r\n $months = 5;\r\n for ($i = $months; $i > 2; $i--) {\r\n $this->lastMonthsPrev[] = array(\r\n 'display' => date('M, Y', strtotime(\"-$i months\")) ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-01', strtotime(\"-$i months\")) ,\r\n '#MODEL#.created <=' => date('Y-m-' . date('t', strtotime(\"-$i months\")) , strtotime(\"-$i months\"))\r\n )\r\n );\r\n }\r\n //# last years date settings\r\n $years = 2;\r\n $this->lastYearsStartDate = date('Y-01-01', strtotime(\"-$years years\"));\r\n for ($i = $years; $i > 0; $i--) {\r\n $this->lastYears[] = array(\r\n 'display' => date('Y', strtotime(\"-$i years\")) ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-01-01', strtotime(\"-$i years\")) ,\r\n '#MODEL#.created <=' => date('Y-12-31', strtotime(\"-$i years\")) ,\r\n )\r\n );\r\n }\r\n $this->lastYears[] = array(\r\n 'display' => date('Y') ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-01-01', strtotime('now')) ,\r\n '#MODEL#.created <=' => date('Y-12-31', strtotime('now')) ,\r\n )\r\n );\r\n $years = 5;\r\n for ($i = $years; $i > 2; $i--) {\r\n $this->lastYearsPrev[] = array(\r\n 'display' => date('Y', strtotime(\"-$i years\")) ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-01-01', strtotime(\"-$i years\")) ,\r\n '#MODEL#.created <=' => date('Y-12-' . date('t', strtotime(\"-$i years\")) , strtotime(\"-$i years\")) ,\r\n )\r\n );\r\n }\r\n $this->selectRanges = array(\r\n 'lastDays' => __l('Last 7 days') ,\r\n 'lastWeeks' => __l('Last 4 weeks') ,\r\n 'lastMonths' => __l('Last 3 months') ,\r\n 'lastYears' => __l('Last 3 years')\r\n );\r\n }", "function GetYoutubeGraphData($ytUserName,$arrayDate)\n\t\t{\n\t\t\tset_include_path('library');\n\t\t\trequire_once 'Zend/Loader.php';\n\t\t\tZend_Loader::loadClass('Zend_Gdata_YouTube');\n\t\t\t\n\t\t\n\t\t\t\t$this->userName= $ytUserName;\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Uploads & comments\n\t\t\t\t$yt = new Zend_Gdata_YouTube();\n\t\t\t\t$yt->getHttpClient()->setConfig(array('timeout'=>180));\n\t\t\t\t$yt->setMajorProtocolVersion(2);\n\t\t\n\t\t\t\t$this->srVideoList='';\n\t\t\t\t$this->GetUploadDates($yt->getuserUploads($this->channelName));\n\t\t\n\t\t\t\t\n\t\t\t\t// \"Favorite\";\n\t\t\t\t$this->GetFavoriteDates();\n\t\t\t\t\n\t\t\t\t$this->CountDates($arrayDate);\n\t\t\t\t\t\n\t\t\t\treturn $this->graphArray;\n\t\t\t}", "public function getBuyerHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $buyer = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($dateQuery.',count(distinct buyer_id)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['buyer'] = $buyer;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "function archivate_referal_day_stat() {\r\n //$users = $this->CI->pm->get_project_users();\r\n //foreach ($users as $u)\r\n $this->backup_partner_xml();\r\n }", "public function initChart() \n {\n $days = 6;\n $this->lastDaysStartDate = date('Y-m-d', strtotime(\"-$days days\"));\n for ($i = $days; $i > 0; $i--) {\n $this->lastDays[] = array(\n 'display' => date('D, M d', strtotime(\"-$i days\")) ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', strtotime(\"-$i days\")) ,\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', strtotime(\"-$i days\"))\n )\n );\n }\n $this->lastDays[] = array(\n 'display' => date('D, M d') ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', strtotime(\"now\")) ,\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', strtotime(\"now\"))\n )\n );\n $days = 13;\n for ($i = $days; $i >= 7; $i--) {\n $this->lastDaysPrev[] = array(\n 'display' => date('M d, Y', strtotime(\"-$i days\")) ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', strtotime(\"-$i days\")) ,\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', strtotime(\"-$i days\"))\n )\n );\n }\n //# last weeks date settings\n $timestamp_end = strtotime('last Saturday');\n $weeks = 3;\n $this->lastWeeksStartDate = date('Y-m-d', $timestamp_end-((($weeks*7) -1) *24*3600));\n for ($i = $weeks; $i > 0; $i--) {\n $start = $timestamp_end-((($i*7) -1) *24*3600);\n $end = $start+(6*24*3600);\n $this->lastWeeks[] = array(\n 'display' => date('M d', $start) . ' - ' . date('M d', $end) ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-d', $start) ,\n '#MODEL#.created <=' => date('Y-m-d', $end) ,\n )\n );\n }\n $this->lastWeeks[] = array(\n 'display' => date('M d', $timestamp_end+24*3600) . ' - ' . date('M d') ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-d', $timestamp_end+24*3600) ,\n '#MODEL#.created <=' => date('Y-m-d', strtotime('now'))\n )\n );\n $weeks = 7;\n for ($i = $weeks; $i > 3; $i--) {\n $start = $timestamp_end-((($i*7) -1) *24*3600);\n $end = $start+(6*24*3600);\n $this->lastWeeksPrev[] = array(\n 'display' => date('M d', $start) . ' - ' . date('M d', $end) ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-d', $start) ,\n '#MODEL#.created <=' => date('Y-m-d', $end)\n )\n );\n }\n //# last months date settings\n $months = 2;\n $this->lastMonthsStartDate = date('Y-m-01', strtotime(\"-$months months\"));\n for ($i = $months; $i > 0; $i--) {\n $this->lastMonths[] = array(\n 'display' => date('M, Y', strtotime(\"-$i months\")) ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-01', strtotime(\"-$i months\")) ,\n '#MODEL#.created <=' => date('Y-m-t', strtotime(\"-$i months\")) ,\n )\n );\n }\n $this->lastMonths[] = array(\n 'display' => date('M, Y') ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-01', strtotime('now')) ,\n '#MODEL#.created <=' => date('Y-m-t', strtotime('now')) ,\n )\n );\n $months = 5;\n for ($i = $months; $i > 2; $i--) {\n $this->lastMonthsPrev[] = array(\n 'display' => date('M, Y', strtotime(\"-$i months\")) ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-01', strtotime(\"-$i months\")) ,\n '#MODEL#.created <=' => date('Y-m-' . date('t', strtotime(\"-$i months\")) , strtotime(\"-$i months\"))\n )\n );\n }\n //# last years date settings\n $years = 2;\n $this->lastYearsStartDate = date('Y-01-01', strtotime(\"-$years years\"));\n for ($i = $years; $i > 0; $i--) {\n $this->lastYears[] = array(\n 'display' => date('Y', strtotime(\"-$i years\")) ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-01-01', strtotime(\"-$i years\")) ,\n '#MODEL#.created <=' => date('Y-12-31', strtotime(\"-$i years\")) ,\n )\n );\n }\n $this->lastYears[] = array(\n 'display' => date('Y') ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-01-01', strtotime('now')) ,\n '#MODEL#.created <=' => date('Y-12-31', strtotime('now')) ,\n )\n );\n $years = 5;\n for ($i = $years; $i > 2; $i--) {\n $this->lastYearsPrev[] = array(\n 'display' => date('Y', strtotime(\"-$i years\")) ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-01-01', strtotime(\"-$i years\")) ,\n '#MODEL#.created <=' => date('Y-12-' . date('t', strtotime(\"-$i years\")) , strtotime(\"-$i years\")) ,\n )\n );\n }\n $this->selectRanges = array(\n 'lastDays' => __l('Last 7 days') ,\n 'lastWeeks' => __l('Last 4 weeks') ,\n 'lastMonths' => __l('Last 3 months') ,\n 'lastYears' => __l('Last 3 years')\n );\n }", "function getUniqueVisitorsData() {\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n \n $lastmonthStartDate=$objClassCommon->calculateMonthDate(date(\"Y-m-d\"), '1', '01', '-');\n $lastmonthEndDate=$objClassCommon->calculateMonthDate(date(\"Y-m-d\"), '1', 't', '-');\n \n $currentmonthStartDate=$objClassCommon->calculateMonthDate(date(\"Y-m-d\"), '0', '01', '-');\n $currentmonthEndDate=$objClassCommon->calculateMonthDate(date(\"Y-m-d\"), '0', 't', '-');\n \n //echo $lastmonthStartDate.\"==\".$lastmonthEndDate.'<br>'.$currentmonthStartDate.'=='.$currentmonthEndDate;\n //die;\n \n //For Calculating last month data\n $varQuery = \"SELECT count(DISTINCT VisitorIP) as count FROM \" . TABLE_VISITOR . \" WHERE DATE(Visitor_Date_Added) >='\".$lastmonthStartDate.\"' AND DATE(Visitor_Date_Added) <='\".$lastmonthEndDate.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $arrRes['last']['count']=$arrData[0]['count'];\n \n //For Calculating current month data\n $varQuery = \"SELECT count(DISTINCT VisitorIP) as count FROM \" . TABLE_VISITOR . \" WHERE DATE(Visitor_Date_Added) >='\".$currentmonthStartDate.\"' AND DATE(Visitor_Date_Added) <='\".$currentmonthEndDate.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $arrRes['current']['count']=$arrData[0]['count'];\n \n \n //pre($arrRes);\n return $arrRes;\n }", "function statistics($query = array()) {\n $params = array_merge($this->_client_id_param, $query);\n return $this->get_request_with_params($this->_base_route.'transactional/statistics', $params);\n }", "public function get_data_history_koperasi($id_pengguna)\n {\n $this->db->select('ti.kode_transaksi, sum(ti.jumlah_lot) as total_lot, tt.total as total_bayar');\n $this->db->from('tr_investor as ti');\n $this->db->join('tr_transfer as tt', 'tt.id_tr_investor = ti.id_tr_investor', 'inner');\n $this->db->where('tt.total !=', null);\n $this->db->where('ti.id_pengguna', $id_pengguna);\n $this->db->group_by('ti.kode_transaksi')->group_by('tt.total');\n $this->db->order_by('ti.kode_transaksi', 'desc'); \n\n $hasil = $this->db->get()->result_array();\n $value = array();\n\n foreach ($hasil as $h) {\n $kd_tr = $h['kode_transaksi'];\n $tot_lot = $h['total_lot'];\n $total_bayar= $h['total_bayar'];\n\n $this->db->select('add_time as tgl_transaksi');\n $this->db->from('tr_transfer');\n $this->db->where('kode_transaksi', $kd_tr);\n\n $hasil_2 = $this->db->get()->row_array();\n\n $value[] = ['kode_transaksi' => $kd_tr,\n 'total_lot' => $tot_lot,\n 'total_bayar' => $total_bayar,\n 'add_time' => $hasil_2['tgl_transaksi']\n ];\n }\n\n return $value;\n }", "public function recentVisits_get()\n {\n $em = $this->doctrine->em;\n $morevisitsRepo = $em->getRepository('Entities\\Service');\n $morevisits = $morevisitsRepo->findBy(array(), array('visit_at' => 'DESC'), 4);\n\n foreach ($morevisits as $service) {\n $service->loadRelatedData(null, null, site_url());\n }\n\n if ($morevisits) {\n $response[\"desc\"] = \"Servicios mas visitados\";\n $response[\"count\"] = count($morevisits);\n $response[\"data\"] = $morevisits;\n } else {\n $response[\"desc\"] = 'No existen servicios mas visitados';\n $response[\"count\"] = 0;\n $response[\"data\"] = array();\n }\n $this->set_response($response, REST_Controller::HTTP_OK);\n }", "public static function get_follow_all($today) {\n\t\t$today = date_create($today);\n\t\t$year = date_format($today, 'Y');\n\t\t$month = date_format($today, 'm');\n\t\t$date = date_format($today, 'd');\n\t\t// get week\n\t\t$book_follow = BooksFollowStatisticQModel::get_book_follow_all($date, $month, $year);\n\t\tif ($book_follow == null) {\n\t\t\t$week = null;\n\t\t} else {\n\t\t\t$week = $book_follow->week;\n\t\t}\n\t\t// dd($week);\n\t\t$data['day']\t= [];\n\t\t$data['week']\t= [];\n\t\t$data['month']\t= [];\n\t\t$data['season']\t= [];\n\t\t$data['year']\t= [];\n\t\t// get view day all\n\t\tfor ($i = 0; $i < 7; $i++) { \n\t\t\t$data['day'][$i] = BooksFollowStatisticQModel::get_book_follow_day_all($i, $week, $month, $year);\n\t\t\tif ($data['day'][$i] == null)\n\t\t\t\t$data['day'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['day'][$i] = (int)$data['day'][$i]->follow;\n\t\t}\n\t\t// get view week all\n\t\tfor ($i = 0; $i < 5; $i++) { \n\t\t\t$data['week'][$i] = BooksFollowStatisticQModel::get_book_follow_week_all($i, $month, $year);\n\t\t\tif ($data['week'][$i] == null)\n\t\t\t\t$data['week'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['week'][$i] = (int)$data['week'][$i]->follow;\n\t\t}\n\t\t// get view month all\n\t\tfor ($i = 1; $i <= 12; $i++) { \n\t\t\t$data['month'][$i] = BooksFollowStatisticQModel::get_book_follow_month_all($i, $year);\n\t\t\tif ($data['month'][$i] == null)\n\t\t\t\t$data['month'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['month'][$i] = (int)$data['month'][$i]->follow;\n\t\t}\n\t\t// get view season all\n\t\tfor ($i = 1; $i <= 4; $i++) { \n\t\t\t$data['season'][$i] = BooksFollowStatisticQModel::get_book_follow_season_all($i, $year);\n\t\t\tif ($data['season'][$i] == null)\n\t\t\t\t$data['season'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['season'][$i] = (int)$data['season'][$i]->follow;\n\t\t}\n\t\t// get view year all\n\t\tfor ($i = 2012; $i <= 2019; $i++) { \n\t\t\t$data['year'][$i] = BooksFollowStatisticQModel::get_book_follow_year_all($i);\n\t\t\tif ($data['year'][$i] == null)\n\t\t\t\t$data['year'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['year'][$i] = (int)$data['year'][$i]->follow;\n\t\t}\n\t\treturn $data;\n\t}", "function get_weekday_stats(){\n if(!DashboardCommon::is_su()) return null;\n \n $sat = strtotime(\"last saturday\");\n $sat = date('w', $sat) == date('w') ? $sat + 7 * 86400 : $sat;\n $fri = strtotime(date(\"Y-m-d\", $sat) . \" +6 days\");\n $from = date(\"Y-m-d\", $sat);//for current week only\n $to = date(\"Y-m-d\", $fri);//for current week only\n $sql = \"SELECT DAYNAME(atr.call_start) as dayname,count(*) as total \n FROM week_days wd \n LEFT JOIN ( SELECT * FROM calls WHERE call_start >= '\" . $this->from . \"' AND call_start <= '\" . $this->to . \"') atr\n ON wd.week_day_num = DAYOFWEEK(atr.call_start)\n GROUP BY\n DAYOFWEEK(atr.call_start)\";\n\n $this_week_rec = DashboardCommon::db()->Execute($sql);\n $saturday = $sunday = $monday = $tuesday = $wednesday = 0;\n $thursday = $friday = 0;\n// $data = array();\n// while (!$this_week_rec->EOF) {\n// $k = $this_week_rec->fields['dayname'];\n// $data[$k]= $this_week_rec->fields['total'];\n// $this_week_rec->MoveNext();\n// }\n// \n// return array_keys($data, max($data));\n\n while (!$this_week_rec->EOF) {\n $daynames = $this_week_rec->fields['dayname'];\n $totalcalls = $this_week_rec->fields['total'];\n if ($daynames == 'Saturday') {\n $saturday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Sunday') {\n $sunday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Monday') {\n $monday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Tuesday') {\n $tuesday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Wednesday') {\n $wednesday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Thursday') {\n $thursday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Friday') {\n $friday = $this_week_rec->fields['total'];\n }\n\n $this_week_rec->MoveNext();\n }\n\n $arr = array('Saturday' => $saturday,\n 'Sunday' => $sunday,\n 'Monday' => $monday,\n 'Tuesday' => $tuesday,\n 'Wednesday' => $wednesday,\n 'Thursday' => $thursday,\n 'Friday' => $friday\n );\n $max_day = array_keys($arr, max($arr));\n \n $avg_calltime_sql = \"SELECT sum(duration) as total_call_time, count(*) as total_records, \n sum(duration) / count(*) as avg_time\n FROM \n (\n SELECT call_end-call_start as duration\n FROM calls\n WHERE call_start >= '\".$this->from.\"' AND call_start <= '\".$this->to.\"'\n ) as dt\";\n $avg_calltime_res = DashboardCommon::db()->Execute($avg_calltime_sql);\n \n \n return array('weekday'=>$max_day[0],'avg_call_time'=>$avg_calltime_res->fields['avg_time']);\n \n }", "public function ajaxChart(Request $request) {\n if($request->duration == 'week')\n {\n $startWeek = Carbon::now()->startOfWeek();\n $endWeek = Carbon::now()->endOfWeek();\n // $startWeek = Carbon::create(2019,06,17,0,0,0);\n // $endWeek = Carbon::create(2019,06,23,0,0,0);\n }\n if($request->duration == 'month')\n {\n $startWeek = Carbon::now()->startOfMonth();\n $endWeek = Carbon::now()->endOfMonth();\n // $startWeek = Carbon::create(2019,06,01,0,0,0);\n // $endWeek = Carbon::create(2019,06,30,0,0,0);\n }\n // get data for listing enquery\n if($request->type == 'le')\n $graphArray = Helper::getLeadDatewise('business_post_enquiries',$startWeek,$endWeek);\n // get data for business post enquiries\n if($request->type == 'bae')\n $graphArray = Helper::getLeadDatewise('business_form_contents',$startWeek,$endWeek,['type'=>'banner-ad']);\n // get data for elast enquiries\n if($request->type == 'ebe')\n $graphArray = Helper::getLeadDatewise('business_form_contents',$startWeek,$endWeek,['type'=>'eblast']);\n // get data for e-commerce\n if($request->type == 'ecom')\n {\n $whereData = [\n ['is_old', 0],\n ['province_id', '!=', 1]\n ];\n $graphArray = Helper::getLeadDatewise('users',$startWeek,$endWeek,$whereData,'lis');\n }\n return $graphArray;\n }", "public function getTransactions()\r\n {\r\n return $this->transactions;\r\n }", "public function getTransactions()\r\n {\r\n return $this->transactions;\r\n }", "public function getTransactions()\r\n {\r\n return $this->transactions;\r\n }", "function get_sensors_data_last_day(){\r\n $sensor_json_url = 'https://data.melbourne.vic.gov.au/resource/b2ak-trbp.json';\r\n $last_available_data_time = get_last_available_with_time(0)->date_time;\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_URL,$sensor_json_url . '?$where=date_time%20>%20\"' . gmdate(\"Y-m-d\\TH:i:s\", strtotime('-1 day', strtotime($last_available_data_time))) . '\"');\r\n $result=curl_exec($ch);\r\n curl_close($ch);\r\n return json_decode($result);\r\n}", "public function graphmonthused()\n \t{\n \t\t// announce return variable\n \t\t$return \t= \tarray();\n \t\t$count \t\t=\tarray();\n \t\t// select logger collection \n \t\t$use_data \t= \t$this->mongo_db->db->used;\n \t\t// preparing query data\n \t\t$splitday \t= \texplode('-', $this->use_date);\n \t\t// check day in month\n \t\t$lastday \t= \tcal_days_in_month(CAL_GREGORIAN,$splitday[1],$splitday[0]);\n \t\tfor ($i = 1; $i <= $lastday; $i++) \n \t\t{\n \t\t\tif (strlen($i) == 1) \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t= \tarray(\n \t\t\t\t\t'use_date' \t\t=> \t\t$splitday[0].'-'.$splitday[1].'-0'.$i, \n \t\t\t\t\t'use_appid' \t=> \t\t$this->use_appid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t} \n \t\t\telse \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_date' \t=> \t$splitday[0].'-'.$splitday[1].'-'.$i, \n \t\t\t\t\t'use_appid' => \t$this->use_appid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t}\n \t\t}\n\n \t\t$return\t\t=\tarray(\n \t\t\t'lastday'\t=>\t$lastday,\n \t\t\t'data'\t\t=>\tarray(\n\t\t\t\t'name'\t\t=>\t\t'User',\n \t\t\t\t'data'\t\t=>\t\t$count\n \t\t\t\t)\n \t\t\t);\n\n \t\treturn $return;\t\n \t}", "function getReportLastWeek(){\n global $db;\n \n $get = getWeekSale();//Pulls most recent week from purchasing table\n $week = $get['week'];\n \n $stmt=$db->prepare(\"SELECT week, SUM(expense) AS 'expense', SUM(revenue) AS 'revenue' FROM invoices WHERE week = :week\");\n \n $binds=array(\n \":week\"=>$week\n );\n $results= false;\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n }\n return $results;\n }", "public function getTradeLog($userId, $skipCount, $filter, $dateFilter): array {\n\n $result = $selling = $buying = $last100Entries = $ids = [];\n $result['log'] = $result['timestamps'] = $result['days'] = $result['overview'] = [];\n $result['selling']['total'] = $result['buying']['total'] = $result['selling']['valuesById'] = $result['buying']['valuesById'] = 0;\n\n for($i = 0; $i <= 23; ++$i) {\n $result['timestamps'][$i] = 0;\n }\n\n for($event = 0; $event <= 1; ++$event) {\n for($i = 0; $i <= 57; ++$i) {\n $getSumQuery = 'SELECT SUM(`amount` * `price`) as `sum` FROM `userTradeLog_' . $userId . '` WHERE `event` = ' . $event . ' AND `itemId` = ' . $i . '';\n $getSum = $this->_conn->query($getSumQuery);\n\n if($getSum->num_rows === 1) {\n while($data = $getSum->fetch_assoc()) {\n\n if($event === 0) {\n $targetArr = 'buying';\n } else {\n $targetArr = 'selling';\n }\n\n ${$targetArr}[$i] = $data['sum'];\n }\n }\n }\n }\n\n $result['selling']['total'] = array_sum($selling);\n $result['selling']['valuesById'] = $selling;\n\n $result['buying']['total'] = array_sum($buying);\n $result['buying']['valuesById'] = $buying;\n\n // selling hours\n $getTimestampsQuery = 'SELECT `timestamp` FROM `userTradeLog_' . $userId . '` WHERE `event` = 1';\n $getTimestamps = $this->_conn->query($getTimestampsQuery);\n\n if($getTimestamps->num_rows > 0) {\n while($data = $getTimestamps->fetch_assoc()) {\n ++$result['timestamps'][date('G', $data['timestamp'])];\n }\n }\n\n // skipCount\n $mostRecentEntryQuery = 'SELECT `timestamp` FROM `userTradeLog_' . $userId . '` ORDER BY `timestamp` DESC LIMIT 1';\n $mostRecentEntry = $this->_conn->query($mostRecentEntryQuery);\n if($mostRecentEntry->num_rows === 1) {\n $mostRecentEntry = $mostRecentEntry->fetch_assoc();\n }\n\n if(!$skipCount) {\n $skipCount = 0;\n $start = $mostRecentEntry['timestamp'];\n $end = strtotime('midnight', $mostRecentEntry['timestamp']);\n } else {\n $end = strtotime('midnight', $mostRecentEntry['timestamp']) - $skipCount * 86400;\n $start = strtotime('tomorrow', $mostRecentEntry['timestamp']) - $skipCount * 86400;\n }\n\n if($dateFilter) {\n $skipCount = 0;\n $start = $dateFilter + 86400;\n $end = $dateFilter;\n }\n\n $result['skipCount'] = $skipCount;\n\n // filter\n if(!isset($filter) || $filter === -1) {\n $filter = -1;\n $addFilter = '';\n } elseif($filter >= -1) {\n $addFilter = ' AND `event` = ' . $filter;\n }\n\n $result['filter'] = $filter;\n\n // individual days filter\n $getDaysAndEntriesCountQuery = 'SELECT DATE(FROM_UNIXTIME(`timestamp`)) AS `date`, COUNT(1) AS `entries` FROM `userTradeLog_' . $userId . '` GROUP BY DATE(FROM_UNIXTIME(`timestamp`)) ORDER BY `date` DESC';\n $getDaysAndEntriesCount = $this->_conn->query($getDaysAndEntriesCountQuery);\n\n if($getDaysAndEntriesCount->num_rows > 0) {\n while($data = $getDaysAndEntriesCount->fetch_assoc()) {\n\n $arr = [\n 'date' => $data['date'],\n 'entries' => $data['entries'],\n ];\n\n $result['days'][] = $arr;\n }\n }\n\n $getMostRecentEntriesQuery = 'SELECT `actor`, `actorLevel`, `transportCost`, `amount`, `price`, `itemId`, `timestamp`, `event` FROM `userTradeLog_' . $userId . '` WHERE `timestamp` > ' . $end . ' AND `timestamp` <= ' . $start . ' ' . $addFilter . ' ORDER BY `timestamp` DESC';\n $getMostRecentEntries = $this->_conn->query($getMostRecentEntriesQuery);\n\n if($getMostRecentEntries->num_rows > 0) {\n while($data = $getMostRecentEntries->fetch_assoc()) {\n $result['log'][] = $data;\n }\n }\n\n // overview\n $distinctIdsQuery = 'SELECT DISTINCT(`itemId`) AS `id` FROM `userTradeLog_' . $userId . '` WHERE `timestamp` > ' . $end . ' AND `timestamp` <= ' . $start;\n $distinctIds = $this->_conn->query($distinctIdsQuery);\n\n if($distinctIds->num_rows > 0) {\n while($data = $distinctIds->fetch_assoc()) {\n $ids[] = $data['id'];\n }\n }\n\n foreach($ids as $id) {\n $sellSumQuery = 'SELECT SUM(`amount` * `price`) AS `sumSell` FROM `userTradeLog_' . $userId . '` WHERE `timestamp` > ' . $end . ' AND `timestamp` <= ' . $start . ' AND `event` = 1 AND `itemId` = ' . $id . '';\n $sellSum = $this->_conn->query($sellSumQuery);\n\n if($sellSum->num_rows === 1) {\n while($data = $sellSum->fetch_assoc()) {\n $positive = $data['sumSell'];\n }\n }\n\n $buySumQuery = 'SELECT SUM(`amount` * `price`) AS `sumBuy` FROM `userTradeLog_' . $userId . '` WHERE `timestamp` > ' . $end . ' AND `timestamp` <= ' . $start . ' AND `event` = 0 AND `itemId` = ' . $id . '';\n $buySum = $this->_conn->query($buySumQuery);\n\n if($buySum->num_rows === 1) {\n while($data = $buySum->fetch_assoc()) {\n $negative = $data['sumBuy'];\n }\n }\n\n if($positive === NULL) {\n $positive = 0;\n }\n\n if($negative === NULL) {\n $negative = 0;\n }\n\n $result['overview'][$id] = [\n 'itemId' => $id,\n 'sum' => $positive - $negative,\n 'bought' => $negative,\n 'sold' => $positive,\n ];\n }\n\n usort($result['overview'], function($a, $b) {\n return $b['sum'] - $a['sum'];\n });\n\n return $result;\n }", "private function bottomGridData() {\r\n\t\t\r\n $result = $this->getLatestPeriod();\r\n \r\n if (is_array($result) && !empty($result))\r\n {\r\n $periodResult = array_column($result, \"period\");\r\n $query = \"SELECT \".$this->accountIdField.\" AS SKUID \" .\r\n \",MAX(\".$this->accountNameField.\") AS ACCOUNT \" .\r\n \",\".$this->settingVars->tesco_po_details.\".purchase_order_number AS PON \" .\r\n \",MAX(\".$this->settingVars->tesco_po_details.\".depot_number) AS DEPOT_NO \" .\r\n \",\".$this->settingVars->tesco_po_details.\".period AS PERIOD \" .\r\n \",MAX(\".$this->settingVars->tesco_po_details.\".delivered_on_time) AS DOT \" .\r\n \",SUM((CASE WHEN period IN('\" . implode(\"','\", $periodResult) . \"') THEN total_placed_orders_Cases ELSE 0 END)) AS ORDERED \" .\r\n \",SUM((CASE WHEN period IN('\" . implode(\"','\", $periodResult) . \"') THEN delivered_on_time ELSE 0 END)) AS DELIVERED \" .\r\n \" FROM \".$this->settingVars->tesco_po_details.\", \".$this->settingVars->skutable.\" WHERE \".$this->settingVars->tesco_po_details.\".GID = \".$this->settingVars->skutable.\".GID AND \".$this->settingVars->tesco_po_details.\".skuID = \".$this->settingVars->skutable.\".PIN AND \".$this->settingVars->skutable.\".clientID = '\".$this->settingVars->clientID.\"' AND \".$this->settingVars->skutable.\".GID = \".$this->settingVars->GID.\" AND \".$this->settingVars->tesco_po_details.\".skuID = '\".$_REQUEST['selectedSKUID'].\"' AND \".$this->settingVars->tesco_po_details.\".period IN ('\".implode(\"','\", $periodResult).\"') AND \".$this->commonQueryPart.\" GROUP BY SKUID, PERIOD, PON ORDER BY PERIOD DESC\";\r\n //echo $query; exit;\r\n $redisOutput = $this->redisCache->checkAndReadByQueryHashFromCache($query);\r\n if ($redisOutput === false) {\r\n $result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\r\n $this->redisCache->setDataForHash($result);\r\n } else {\r\n $result = $redisOutput;\r\n }\r\n \r\n if (is_array($result) && !empty($result))\r\n {\r\n foreach($result as $data)\r\n {\r\n $tmp = array();\r\n $tmp[\"SKUID\"] = $data[\"SKUID\"];\r\n $tmp[\"ACCOUNT\"] = $data[\"ACCOUNT\"];\r\n $tmp[\"PO\"] = (int)$data[\"PON\"];\r\n $tmp[\"DEPOT\"] = (int)$data[\"DEPOT_NO\"];\r\n $tmp[\"PERIOD\"] = (int)$data[\"PERIOD\"];\r\n $tmp[\"ORDERED\"] = (int)$data[\"ORDERED\"];\r\n $tmp[\"DOT\"] = (int)$data[\"DOT\"];\r\n $tmp[\"DOT_PER\"] = ($data[\"ORDERED\"] != 0) ? ($data[\"DELIVERED\"]/$data[\"ORDERED\"])*100 : 0;\r\n $tmp[\"DOT_PER\"] = (double)number_format($tmp[\"DOT_PER\"], 1, '.', '');\r\n $tmp[\"SHORT_CASES\"] = $data[\"ORDERED\"]-$data[\"DOT\"];\r\n $finalData[] = $tmp;\r\n }\r\n }\r\n $this->jsonOutput['bottomGridData'] = $finalData;\r\n }\r\n }", "protected function getChartData()\n {\n $data = $this->loadChartData(); //load data from CSV\n\n $groupedByWeek = $data->groupBy(function ($item) { // Group data base on week start date\n return $item->created_at->startOfWeek()->format('d/m/Y');\n });\n\n $chartData = array();\n foreach ($groupedByWeek as $key => $item) {\n $cohort = new \\stdClass();\n $cohort->name = $key;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 0)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 20)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 40)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 50)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 70)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 90)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 99)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 100)->count() / $item->count()) * 100;\n array_push($chartData, $cohort);\n };\n\n return Response()->json( // return data for chart as Json\n $chartData\n );\n }" ]
[ "0.61208314", "0.6014315", "0.58201826", "0.5778815", "0.5752533", "0.57223696", "0.5625854", "0.56048405", "0.558557", "0.55691063", "0.5525034", "0.5522897", "0.55196416", "0.54932946", "0.5476488", "0.5458259", "0.5436292", "0.5436242", "0.54315376", "0.54266995", "0.5412241", "0.54042095", "0.5399271", "0.53987926", "0.53655493", "0.5348509", "0.53400457", "0.53004104", "0.52882874", "0.5283173", "0.52473867", "0.5247371", "0.5240385", "0.5218427", "0.52039367", "0.5199725", "0.51948625", "0.5187186", "0.5171887", "0.5130102", "0.51252407", "0.5113003", "0.5112745", "0.5106221", "0.51040494", "0.510394", "0.51016337", "0.5099631", "0.509791", "0.5095577", "0.5089673", "0.5088598", "0.5086454", "0.5084294", "0.5077776", "0.5070535", "0.50573623", "0.50499606", "0.504895", "0.50482", "0.5037334", "0.50291216", "0.5019623", "0.50072384", "0.5006568", "0.50057703", "0.49984807", "0.49948752", "0.4980776", "0.49793097", "0.4977276", "0.49764085", "0.49722227", "0.49631518", "0.49613276", "0.49602446", "0.49578926", "0.49570405", "0.49540704", "0.4948428", "0.49411255", "0.49400833", "0.4938381", "0.49383724", "0.4933481", "0.49316737", "0.49314424", "0.49190238", "0.4917255", "0.49148455", "0.4914175", "0.4914094", "0.4914094", "0.4914094", "0.49129617", "0.49110457", "0.49105912", "0.49040666", "0.49023268", "0.49017206" ]
0.6137587
0
Get transaction data for graph last month
public function getTransactionDataLastMonth($customerId) { $to = $this->_date->date('Y-m-d'); $from = strtotime($to."-30days"); $from = $this->_date->date('Y-m-d', $from); $to .= ' 23:59:59'; $transactionResource = $this->_transactionFactory->create()->getResource(); $result = []; $data = $transactionResource->getReceivedCreditTransactionsByDay($from, $to, $customerId); $result = $this->_processReceivedTransactionData($data, $result); $data = $transactionResource->getSpentCreditTransactionsByDay($from, $to, $customerId); $result = $this->_processSpentTransactionData($data, $result); $result = array_values($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function graphData()\n {\n $dayOfWeek = ['Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo'];\n $colors = [\n 'rgba(201, 203, 207, 0.8)', //gray\n 'rgba(255, 99, 132, 0.8)', //Red\n 'rgba(255, 159, 64, 0.8)', //Orange\n 'rgba(75, 192, 192, 0.8)', //green\n 'rgba(54, 162, 235, 0.8)', //blue\n 'rgba(153, 102, 255, 0.8)', //purple\n 'rgba(255, 205, 86, 0.8)', //yellow\n ];\n $borderColors = [\n 'rgba(201, 203, 207, 1)', //gray\n 'rgba(255, 99, 132, 1)', //Red\n 'rgba(255, 159, 64, 1)', //Orange\n 'rgba(75, 192, 192, 1)', //green\n 'rgba(54, 162, 235, 1)', //blue\n 'rgba(153, 102, 255, 1)', //purple\n 'rgba(255, 205, 86, 1)', //yellow\n ];\n $months = ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'];\n $now = Carbon::now()->timezone($this->timezome);\n $data = [];\n\n switch ($this->graphPeriod) {\n case 'weekly':\n $data = $this->getDataFromWeeklySales($colors, $borderColors);\n break;\n case 'weeklyAccumulated':\n $data = $this->getDataFromWeeklySales($colors, $borderColors, true);\n break;\n case 'monthly':\n $labels = [];\n $date = $now->copy()->subMonths(5)->startOfMonth()->startOfDay();\n $end = $now->copy()->endOfDay();\n $count = 0;\n\n for ($i = 1; $i < 32; $i++) {\n $labels[] = $i;\n }\n\n while ($date->lessThanOrEqualTo($end)) {\n $label = $months[$date->month - 1];\n $data = [];\n $endOfMonth = $date->copy()->endOfMonth()->endOfDay();\n $sale = 0;\n\n while ($date->lessThanOrEqualTo($endOfMonth) && $date->lessThanOrEqualTo($end)) {\n $sale += $this->getSumFromGraphPeriod($date, $this->graphCategory);\n $data[] = $sale;\n $date->addDay();\n }\n\n $datasets[] = [\n 'label' => $label,\n 'backgroundColor' => $colors[$count],\n 'borderColor' => $borderColors[$count],\n 'borderWidth' => 1,\n 'data' => $data,\n 'fill' => false\n ];\n\n $count++;\n }\n\n $data = [\n 'labels' => $labels,\n 'datasets' => $datasets,\n 'type' => 'line'\n ];\n break;\n default:\n # code...\n break;\n }\n return $data;\n }", "public function getCurrentMonthData() {\n\t\t//return $this->getDataByInterval($currentMonth, $currentYear, $currentMonth, $currentYear);\n\t\t$dates = getPeriods('CurrentMonth');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear']);\t\t\n\t}", "public function getDataMonth()\n {\n return $this->model()->where('created_at', '>=', Carbon::now()->startOfMonth())->get();\n }", "public function getChartData() {\n $fromDate = Carbon::now()->subMinutes(60);\n $toDate = Carbon::now();\n\n $chart = new TaskActivity;\n $chartData = Auth::user()->tasks()->where('is_complete', 0)->whereBetween('created_at', [$fromDate, $toDate])->get()->pluck('created_at')->toArray();\n $arr = [];\n foreach ($chartData as $k => $c) {\n $add = $k + 1;\n array_push($arr, $add);\n }\n $chart->labels($chartData);\n $chart->dataset('Pending task', 'line', $arr);\n return $chart;\n }", "public function getGraphDataForAnAccount($startDate, $endDate, $acc_id){\n\t\t$result = Transaction::where('account_id', '=', $acc_id)->get();\n\t\t$tset = $result->toArray();\n\t\t$tm = new TransactionManager();\n\t $tset = $tm -> sortTransactionsByDates($tset);\n\t $tset = array_reverse($tset);\n\n\t $graphData = array();\n\t $cDate = $startDate;\n\t $prevBalance = 0;\n\t $transactionBeforeStartExists = false;\n\n\t if(empty($tset))\n\t \treturn array();\n\t \n\t foreach($tset as $t){\n\t \t//if cDate is before startDate, skip \n\t \tif($tm->rawDateCompare($t['date'], $startDate) > 0) {\n\t \t\t$prevBalance += $t['amount'];\n\t \t\t$transactionBeforeStartExists = true;\n\t \t\tcontinue;\n\t \t}\n\t \t//if date is after endDate, skip\n\t \tif($tm->rawDateCompare($t['date'], $endDate) < 0)\n\t \t\tcontinue;\n\t \t//transaction is in range, sum it to graphData\n\t \tif(!array_key_exists($t['date'], $graphData))\n\t \t\t$graphData[$t['date']] = 0;\n\t \t$graphData[$t['date']] += $t['amount'];\n\t }\n\t \n\t //cumulate each data point\n\t $net = $prevBalance;\n\t foreach($graphData as &$g){\n\t \t$net += $g;\n\t \t$g = $net;\n\t }\n\t //all data points betwen sDate and earliest transaction are $prevBalance\n\t $paddingLeft = array();\n\t $paddingRight = array();\n\n\t if($transactionBeforeStartExists){\n\t\t if(!array_key_exists($startDate, $graphData))\n\t\t \t$paddingLeft[$startDate] = $prevBalance;\n\t\t}\n\t if(!array_key_exists($endDate, $graphData))\n\t \t$paddingRight[$endDate] = $net;\t \n\t \n\t //all points between latest transaction and fDate are $net\n\t return array_merge($paddingLeft, $graphData, $paddingRight);\n\t}", "function get_sale_grouplastby_ccode($lastmonthdate) {\r\n\tglobal $db;\r\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.total_fee) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND transaction_alipay.transaction_type IN ('1','s1') AND transaction_alipay.result_code='SUCCESS' AND transaction_alipay.trade_status='TRADE_SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$lastmonthdate') GROUP BY year, month, merchants.currency_code\";\r\n\t$transactionsDetails = $db->rawQuery($M_R_query);\r\n\treturn $transactionsDetails;\t\r\n}", "public function getBlock()\n\t{\n\t\t$chart = new \\IPS\\Helpers\\Chart;\n\t\t\n\t\t$chart->addHeader( \"Day\", 'date' );\n\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t{\n\t\t\t$chart->addHeader( $currency, 'number' );\n\t\t}\n\t\t\n\t\t$thirtyDaysAgo = \\IPS\\DateTime::create()->sub( new \\DateInterval('P30D') );\n\t\t\t\t\n\t\t$results = array();\n\t\tforeach( \\IPS\\Db::i()->select( \"t_currency, DATE_FORMAT( FROM_UNIXTIME( t_date ), '%e %c %Y' ) AS date, SUM(t_amount)-SUM(t_partial_refund) AS amount\", 'nexus_transactions', array( 't_date>? AND (t_status=? OR t_status=?)', $thirtyDaysAgo->getTimestamp(), \\IPS\\nexus\\Transaction::STATUS_PAID, \\IPS\\nexus\\Transaction::STATUS_PART_REFUNDED ), NULL, NULL, array( 't_currency', 'date' ) ) as $result )\n\t\t{\n\t\t\t$results[ $result['date'] ][ $result['t_currency'] ] = $result['amount'];\n\t\t}\n\t\t\t\t\n\t\t$monthAndYear = date( 'n' ) . ' ' . date( 'Y' );\n\t\tforeach ( range( 30, 0 ) as $daysAgo )\n\t\t{\n\t\t\t$datetime = new \\IPS\\DateTime;\n\t\t\t$datetime->setTime( 0, 0, 0 );\n\t\t\t$datetime->sub( new \\DateInterval( 'P' . $daysAgo . 'D' ) );\n\t\t\t$resultString = $datetime->format('j n Y');\n\t\t\t\n\t\t\tif ( isset( $results[ $resultString ] ) )\n\t\t\t{\n\t\t\t\t$row = array( $datetime );\n\t\t\t\t\n\t\t\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t\t\t{\n\t\t\t\t\tif ( !isset( $results[ $resultString ][ $currency ] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$row[] = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$row[] = $results[ $resultString ][ $currency ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$chart->addRow( $row );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$row = array( $datetime );\n\t\t\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t\t\t{\n\t\t\t\t\t$row[] = 0;\n\t\t\t\t}\n\t\t\t\t$chart->addRow( $row );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $chart->render( 'LineChart' );\n\t}", "public function getTimeSeries() {\n $series = array();\n foreach($this -> _trades as $trade) {\n \n $month = date('M',$trade['timestamp']);\n if(!isset($series[$month])) {\n $series[$month] = 0;\n }\n if(!empty($trade['delta'])) {\n $series[$month] += $trade['delta'] - (isset($trade['fee']) ? $trade['fee'] : 0);\n }\n }\n return $series;\n }", "public function getTransactionByHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $transaction = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, count(*),'.$dateQuery))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n // ->toSql();\n ->get();\n // dd ($data);\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['transaction'] = $transaction;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function getTransactionByHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $transaction = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, count(*),'.$dateQuery))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n // ->toSql();\n ->get();\n // dd ($data);\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['transaction'] = $transaction;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function graphmonthused()\n \t{\n \t\t// announce return variable\n \t\t$return \t= \tarray();\n \t\t$count \t\t=\tarray();\n \t\t// select logger collection \n \t\t$use_data \t= \t$this->mongo_db->db->used;\n \t\t// preparing query data\n \t\t$splitday \t= \texplode('-', $this->use_date);\n \t\t// check day in month\n \t\t$lastday \t= \tcal_days_in_month(CAL_GREGORIAN,$splitday[1],$splitday[0]);\n \t\tfor ($i = 1; $i <= $lastday; $i++) \n \t\t{\n \t\t\tif (strlen($i) == 1) \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t= \tarray(\n \t\t\t\t\t'use_date' \t\t=> \t\t$splitday[0].'-'.$splitday[1].'-0'.$i, \n \t\t\t\t\t'use_appid' \t=> \t\t$this->use_appid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t} \n \t\t\telse \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_date' \t=> \t$splitday[0].'-'.$splitday[1].'-'.$i, \n \t\t\t\t\t'use_appid' => \t$this->use_appid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t}\n \t\t}\n\n \t\t$return\t\t=\tarray(\n \t\t\t'lastday'\t=>\t$lastday,\n \t\t\t'data'\t\t=>\tarray(\n\t\t\t\t'name'\t\t=>\t\t'User',\n \t\t\t\t'data'\t\t=>\t\t$count\n \t\t\t\t)\n \t\t\t);\n\n \t\treturn $return;\t\n \t}", "public function index()\n\t{\n\t\t$this->load->helper('url');\n\t\t$this->load->library('session');\n\t\t$this->load->database();\n\n\t\t$this->is_logged_in();\n\n\t\t$this->getSalesToday();\n\t\t$sql = $this->db->query(\"SELECT distinct(DATE_FORMAT(tr_at, '%Y-%m')) 'm', SUM(total) 'p' FROM transaction t group by YEAR(tr_at),MONTH(tr_at)\");\n\t\t//$sql = $this->db->query(\"SELECT distinct(DATE_FORMAT(t.tr_at, '%Y-%m')) 'm', b.br_id 'b', SUM(t.total) 'p' FROM transaction t, branch b where t.br_id = b.br_id group by YEAR(t.tr_at),MONTH(t.tr_at), t.br_id;\");\n\n\t\t$rows = json_encode($sql->result());\n\t\t// foreach($rows as $date):\n\t\t// $date->dates;\n\t\t// endforeach;\n\t\t$sql_branch = $this->db->query('SELECT * FROM branch');\n\t\t$branches = $sql_branch->result();\n\n\t\t$transactions = $this->db->query(\"SELECT t.tr_id 'tr_id', t.tr_at 'date', u.firstname 'firstname', u.lastname 'lastname', b.br_name 'branch', t.total 'total' FROM `transaction` t, `users` u, branch b WHERE t.user_id = u.user_id AND t.br_id = b.br_id\");\n\t\t$x = [\n\t\t\t\t'dataforChart' => $rows,\n\t\t\t\t'branches'=> $branches,\n\t\t\t\t'transactions' => $transactions->result(),\n\t\t];\n\n $this->load->view('template/header', $x);\n $this->load->view('dashboard/dashboard', $x);\n $this->load->view('template/footer', $x);\n\n\t}", "public function getgraphAction(){\n $params = array(\n 'cht' => 'lc', \t\t\t\t\t// chart type\n 'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0', //background fills for the chart\n // 'chm' => 'B,f4d4b2,0,0,0|B,FF0000,1,1,0|B,00FF00,2,2,0', \t\t// line fills\n 'chco' => 'db4814,1919D1',\t\t\t\t\t//Series Colors\n 'chs' => '587x300',\t\t\t\t// chart size <width>x<height>\n\t\t\t'chxt' => 'x,y',\t\t\t\t\t// visible axes\n\t\t\t//'chof' => 'validate'\t\t\t\t// output format (png,gif,json,html{when chof='validate'})\n );\n \n\t$post=$this->getRequest()->getPost();\n\t\n\t\n\t$timezoneLocal = Mage::app()->getStore()->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);\n\n\t\tlist ($dateStart, $dateEnd) = Mage::getResourceModel('reports/order_collection')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getDateRange($post['range'], '', '', true);\n\n $dateStart->setTimezone($timezoneLocal);\n $dateEnd->setTimezone($timezoneLocal);\n\t\n\t\t$dates = array();\n $datas = array();\n\n while($dateStart->compare($dateEnd) < 0){\n switch ($post['range']) {\n case '24h':\n $d = $dateStart->toString('yyyy-MM-dd HH:00');\n $dateStart->addHour(1);\n break;\n case '7d':\n case '1m':\n $d = $dateStart->toString('yyyy-MM-dd');\n $dateStart->addDay(1);\n break;\n case '1y':\n case '2y':\n $d = $dateStart->toString('yyyy-MM');\n $dateStart->addMonth(1);\n break;\n }\n\n $dates[] = $d;\n }\n\n\t\t$graphData=array();\n\t\t\n\t\t$product_list=array('product1'=>$post['product'],\n\t\t\t\t\t\t\t'product2'=>$post['compare2']\n\t\t\t\t\t\t\t);\t\n\t\t$graphData=Mage::Helper('graphs')->getGraphData($dates,$product_list);\n\n /**\n * setting skip step\n */\n if (count($dates) > 8 && count($dates) < 15) {\n $c = 1;\n } else if (count($dates) >= 15){\n $c = 2;\n } else {\n $c = 0;\n }\n /**\n * skipping some x labels for good reading\n */\n $i=0;\n foreach ($dates as $k => $d) {\n if ($i == $c) {\n $dates[$k] = $d;\n $i = 0;\n } else {\n $dates[$k] = '';\n $i++;\n }\n }\n \n $this->_axisLabels['x'] = $dates;\n\t\t$this->_axisLabels['y'] = $graphData['quantity'][$post['product']];\n\t\t\n\t\tforeach ($graphData['quantity'] as $index => $serie) {\n $localmaxlength[$index] = sizeof($serie);\n $localmaxvalue[$index] = max($serie);\n $localminvalue[$index] = min($serie);\n }\n \n\t\t$maxvalue = max($localmaxvalue);\n\t\t$minvalue = min($localminvalue);\n\n $yrange = 0;\n $yLabels = array();\n $miny = 0;\n $maxy = 0;\n $yorigin = 0;\n\n $maxlength = max($localmaxlength);\n if ($minvalue >= 0 && $maxvalue >= 0) {\n $miny = 0;\n if ($maxvalue > 10) {\n $p = pow(10, $this->_getPow($maxvalue));\n $maxy = (ceil($maxvalue/$p))*$p;\n $yLabels = range($miny, $maxy, $p);\n } else {\n $maxy = ceil($maxvalue+1);\n $yLabels = range($miny, $maxy, 1);\n }\n $yrange = $maxy;\n $yorigin = 0;\n }\n\n \n\t\t\t\n\t\t\t$params['chd'] = \"e:\";\n $dataDelimiter = \"\";\n $dataSetdelimiter = \",\";\n $dataMissing = \"__\";\n \n\t\t\t// EXTENDED ENCODING\n\t\t\tforeach($product_list as $productid){\n\t\t\t\t$chartdata = array();\t\n for ($j = 0; $j < sizeof($graphData['quantity'][$productid]); $j++) {\n $currentvalue = $graphData['quantity'][$productid][$j];\n \n if (is_numeric($currentvalue)) {\n if ($yrange) {\n $ylocation = (4095 * ($yorigin + $currentvalue) / $yrange);\n\n } else {\n $ylocation = 0;\n }\n $firstchar = floor($ylocation / 64);\n $secondchar = $ylocation % 64;\n $mappedchar = substr($this->_extendedEncoding, $firstchar, 1)\n . substr($this->_extendedEncoding, $secondchar, 1);\n array_push($chartdata, $mappedchar . $dataDelimiter);\n } else {\n array_push($chartdata, $dataMissing . $dataDelimiter);\n }\n\n\t\t\t }\n\t\t\t $buffer = implode('', $chartdata);\t\t\t \n\t\t\t\t\t$buffer = rtrim($buffer, $dataSetdelimiter);\n\t\t\t\t\t$buffer = rtrim($buffer, $dataDelimiter);\n\t\t\t\t\t$buffer = str_replace(($dataDelimiter . $dataSetdelimiter), $dataSetdelimiter, $buffer);\n\t\t\t\t\t\n\t\t\t\t\t$params['chd'] .= $buffer.',';\n\t\t\t\t\t$buffer=null;\n\t\t\t\t\t$chartdata=null;\n\t\t\t\t}\n\t\t\t\t\t$labelBuffer = \"\";\n\t\t\t\t\t$valueBuffer = array();\n\t\t\t\t\t$rangeBuffer = \"\";\n \n if (sizeof($this->_axisLabels) > 0) {\n $params['chxt'] = implode(',', array_keys($this->_axisLabels));\n $indexid = 0;\n foreach ($this->_axisLabels as $idx=>$labels){\n\t\t\t\t\n if ($idx == 'x') {\n /**\n * Format date\n */\n foreach ($this->_axisLabels[$idx] as $_index=>$_label) {\n if ($_label != '') {\n switch ($post['range']) {\n case '24h':\n $this->_axisLabels[$idx][$_index] = $this->formatTime(\n new Zend_Date($_label, 'yyyy-MM-dd HH:00'), 'short', false\n );\n break;\n case '7d':\n case '1m':\n $this->_axisLabels[$idx][$_index] = $this->formatDate(\n new Zend_Date($_label, 'yyyy-MM-dd')\n );\n break;\n case '1y':\n case '2y':\n\t\t\t\t\t\t\t\t\t\n $formats = Mage::app()->getLocale()->getTranslationList('datetime');\n $format = isset($formats['yyMM']) ? $formats['yyMM'] : 'MM/yyyy';\n $format = str_replace(array(\"yyyy\", \"yy\", \"MM\"), array(\"Y\", \"y\", \"m\"), $format);\n $this->_axisLabels[$idx][$_index] = date($format, strtotime($_label));\n break;\n }\n } else {\n $this->_axisLabels[$idx][$_index] = '';\n }\n\n }\n\t\t\t\t\t\t\t\t\t\t\n $tmpstring = implode('|', $this->_axisLabels[$idx]);\n\n $valueBuffer[] = $indexid . \":|\" . $tmpstring;\n if (sizeof($this->_axisLabels[$idx]) > 1) {\n $deltaX = 100/(sizeof($this->_axisLabels[$idx])-1);\n } else {\n $deltaX = 100;\n }\n } else if ($idx == 'y') {\n $valueBuffer[] = $indexid . \":|\" . implode('|', $yLabels);\n if (sizeof($yLabels)-1) {\n $deltaY = 100/(sizeof($yLabels)-1);\n } else {\n $deltaY = 100;\n }\n // setting range values for y axis\n $rangeBuffer = $indexid . \",\" . $miny . \",\" . $maxy . \"|\";\n }\n $indexid++;\n }\n $params['chxl'] = implode('|', $valueBuffer);\n }\t\t\t\n\t\t\t\t\t\n\t\tif (isset($deltaX) && isset($deltaY)) {\n $params['chg'] = $deltaX . ',' . $deltaY . ',1,0';\n }\n \n\n\t\t\t$p = array();\n foreach ($params as $name => $value) {\n $p[] = $name . '=' .urlencode($value);\n }\n\n $url= Mage_Adminhtml_Block_Dashboard_Graph::API_URL . '?' . implode('&', $p);\n\n\t\t\t\techo $url;\n\t}", "public function indexgraphmonthAd()\n {\n\n // ->elementLabel(\"amout\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->groupBy('name');\n\n // $bills = Bill::where(DB::raw(\"(DATE_FORMAT(updated_at,'%Y'))\"),date('Y'))->get();\n // $chart = Charts::database($bills, 'bar', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->groupByMonth(date('Y'), true);\n\n // $data = Bill::where('updated_at', '2018-12-10')->get();\n // $chart = Charts::create('line', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->labels($data->pluck('updated_at'))\n // ->values($data->pluck('sum'));\n\n $chart = Charts::database(Bill::all(), 'bar', 'highcharts')\n ->elementLabel(\"Total\")\n ->dimensions(1000, 500)\n ->responsive(false)\n ->lastByMonth(12, true);\n\n \n\n // $data = BillDetail::all();\n // $chart = Charts::create('line', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->labels($data->pluck('name'))\n // ->values($data->pluck('amout'));\n\n\n // ->template(\"material\")\n // ->dataset('Element 1', [5,20,100])\n // ->dataset('Element 1', [15,30,80])\n // ->dataset('Element 1', [25,10,40])\n // ->labels(['One', 'Two', 'Three']);\n\n return view('adminPharmacy.a_graphmonth', ['chart' => $chart]);\n }", "public static function GetDashboard() {\n $date = [];\n $num_orders = [];\n $last_month = \\Carbon\\Carbon::today()->subDays(30);\n $orders = Order::where('created_at', '>=', $last_month)->get()\n ->groupBy(function($item) {\n return $item->created_at->format('d-m-y');\n })->toArray();\n foreach ($orders as $key => $value) {\n $date[] = $key;\n $num_orders[] = count($value);\n }\n\n //======= Get income from last month - Chart From DB =======\n $last_month_income = \\Carbon\\Carbon::today()->subDays(30);\n $all_orders = [];\n $orders_income = [];\n $income = [];\n $income_date = [];\n $users_orders = DB::table('users')\n ->join('orders', 'users.id', '=', 'orders.user_id')\n ->select('users.*', 'orders.*')\n ->where('orders.created_at', '>=', $last_month_income)->get();\n foreach ($users_orders as $new_user_order) {\n $all_orders[] = (array) $new_user_order;\n }\n foreach ($all_orders as &$orders_data) {\n $orders_data['data'] = unserialize($orders_data['data']);\n }\n foreach ($all_orders as $order) {\n $order['created_at'] = (new \\DateTime($order['created_at']))->format('Y-m-d');\n $income_date[] = $order['created_at'];\n $sum = 0;\n foreach ($order['data'] as $price) {\n $sum += ($price['price'] * $price['quantity']);\n }\n $income[] = $sum;\n }\n\n for ($i = count($income_date) - 1; $i > 0; $i--) {\n if ($income_date[$i] == $income_date[$i - 1]) {\n unset($income_date[$i]);\n $income[$i - 1] = $income[$i] + $income[$i - 1];\n unset($income[$i]);\n }\n }\n $income = array_values($income);\n $income_date = array_values($income_date);\n\n self::$data['income'] = json_encode($income);\n self::$data['income_date'] = json_encode($income_date);\n\n //======= Get last week new users =======\n $last_week = \\Carbon\\Carbon::today()->subDays(7);\n $weekly_users = User::where('created_at', '>=', $last_week)->get()->toArray();\n\n //======= Get all users except admin =======\n $all_users = User::where('role', '!=', '6')->get()->toArray();\n\n //======= Get last day new orders =======\n $last_day = \\Carbon\\Carbon::today();\n $daily_orders = Order::where('created_at', '>=', $last_day)->get()->toArray();\n\n self::$data['weekly_new_users'] = count($weekly_users);\n self::$data['all_users'] = count($all_users);\n self::$data['daily_orders'] = count($daily_orders);\n self::$data['date'] = json_encode($date);\n self::$data['num_orders'] = json_encode($num_orders);\n self::$data['title'] .= 'CMS';\n self::$data['page_name'] = 'Ski Expert | Main';\n return view('cms.dashboard', self::$data);\n }", "public function makeChart(){\n\n //$monthcreated_at->format('d');\n $data= \\DB::table(\"donations\")\n\n ->select(DB::raw(\"HOUR(created_at) as months\"),DB::raw(\"(SUM(amount)) as total\"))\n\n ->groupBy(DB::raw(\"HOUR(created_at)\"))\n\n ->get();\n\n\nreturn ($data); \n \n }", "public function get_trend_data_rows()\n\t{\n\t\t$dates = array();\n\t\t$i_rows = array();\n\t\t$sr_rows = array();\n\t\t$trend_data = array();\n\n\t $current_month = date_create()->format('Y-m-d H:i:s');\n\n\t // echo $current_month_first_day=date_create($current_month)\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\t $current_month_first_day=date_create($current_month)\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n\n $dates[] = $current_month_first_day;\n\n //echo\"</br>\";\n \n // echo $current_month_current_day=date_create($current_month)\n // ->format(\"Y-m-d 23:59:59\");\n\n $current_month_current_day=date_create($current_month)\n ->format(\"Y-m-d 23:59:59\");\t\n\n $dates[] = $current_month_current_day;\n\n //echo\"</br></br>\";\n\n // echo $second_month_first_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $second_month_first_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $second_month_first_day;\n\n //echo\"</br>\";\n\n // echo $second_month_last_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n $second_month_last_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $second_month_last_day;\n\n// echo\"</br></br>\";\n\n // echo $third_month_first_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $third_month_first_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $third_month_first_day;\n\n //echo\"</br>\";\n \t\t\t\n // echo $third_month_last_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n\t $third_month_last_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $third_month_last_day;\n\n // echo\"</br>\";\t\n // echo \"<pre>\";\n // print_r($dates);\n\t // echo \"</pre>\";\t\n\t // echo\"</br>\";\t\t\t \n\n for ($i=0; $i <=5 ; $i=$i+2)\n { \t\n \t//echo\"</br>\";\n\n \t$start = new DateTime($dates[$i]);\n \t\n \t//echo\"</br>\";\n\n\t\t$start = date_format($start,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\n\t\t$end = new DateTime($dates[$i+1]);\n\n\t\t//echo\"</br>\";\n\n\t\t$end = date_format($end,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\t\t$i_rows[] = date_create($start)->format(\"F Y\");\n\t\t$i_rows[] = date_create($end)->format(\"F Y\");\n\t\t$i_rows[] = $this->trend_insident_data($start,$end);\n \t$sr_rows[] = date_create($start)->format(\"F Y\");\n\t\t$sr_rows[] = date_create($end)->format(\"F Y\");\n \t$sr_rows[] = $this->trend_sr_data($start,$end);\t\n }\n\n // echo \"<pre>\";\n // \tprint_r($i_rows);\n \t\t// echo \"<h4>SR Array</h4>\";\n \t\t// print_r($sr_rows);\n \t\t// echo \"</pre>\";\n\n \t\t$trend_data[] = $i_rows;\n \t\t$trend_data[] = $sr_rows;\n\n\n \t\treturn $trend_data;\n\n\n // // First day of a specific month\n // $d = new DateTime('2010-01-19');\n // $d->modify('first day of this month');\n // echo $d->format('jS, F Y').\"</br>\";\n\n // // alternatively...\n // echo date_create('2010-01-19')\n // ->modify('first day of this month')\n // ->format('jS, F Y');\n\t\t//exit();\n\t}", "public function get_month_data($month = \"January\", $year = 2015){\n\t\t/* if($year==2015)\n\t\t$year = date('y'); */\n\t\t// echo date( 'F Y');\n\t\t$this->loadModel(\"Invoice.Invoice\");\n\t\t$this->loadModel(\"Transaction.Transaction\");\n\t\t$month_first_day = strtotime( 'first day of ' . $month.' '.$year);\n\t\t$month_last_day = strtotime( 'last day of ' . $month.' '.$year);\n\t\t// echo date('Y-m-d',$month_last_day);\n\t\t// $dt = new DateTime('first Monday of this month');\n\t\t$dt = new DateTime('first Monday of '.$month.' '.$year);\n\t\t// echo $dt->format('Y-m-d');\n\t\t$first_week_start = $dt->getTimestamp(); \n\t\t$week_last = $first_week_start;\n\t\t$this->Invoice->belongsTo = array('Client' => array('className'=>\"Usermgmt.Client\",'foreignKey'=>'client_id'));\n\t\t$this->Transaction->belongsTo = array('Invoice' => array('className'=>\"Invoice.Invoice\",'foreignKey'=>'invoice_id'));\n\t\t$this->Transaction->recursive = 2;\n\t\t$this->Transaction->Behaviors->load('Containable');\n\t\t\n\t\t$all_transactoins = array();\n\t\tfor($current =$month_first_day; ($week_last<$month_last_day && $week_last<time()); $week_last += (7*86400)){\n\t\t\t\n\t\t\t\t$transactions = $this->Transaction->find(\"all\",array(\"conditions\"=>array(\"UNIX_TIMESTAMP(STR_TO_DATE(Transaction.payment_date, '%m-%d-%Y')) >\"=>$current,\"UNIX_TIMESTAMP(STR_TO_DATE(Transaction.payment_date, '%m-%d-%Y')) <\"=>$week_last,'Transaction.status'=>1),'contain'=>array(\"Invoice\"=>array(\"fields\"=>array(\"title\",\"client_id\",\"payment\",\"tax\",\"total\")),\"Invoice.Client\"=>array(\"fields\"=>array(\"first_name\",\"last_name\"))),\"fields\"=>array(\"invoice_id\",\"payment_date\",\"method\")));\n\t\t\t\t\n\t\t\t\t$all_transactoins[date('m/d/Y',$current).'-'.date('m/d/Y',$week_last)] = $transactions;\n\t\t\t\t\n\t\t\t\t// pr($transactions); die;\n\t\t\t\n\t\t\t$current =$week_last;\n\t\t}\n\t\treturn $all_transactoins;\n\t\t\n\t}", "public function getSalesByMonth()\n {\n\n $dataPoints = DB::select('SELECT date_format(created_at, \\'%Y\\') as year, date_format(created_at, \\'%m\\') as month, count(id) as pocount, sum(total) as monthtotal from purchase_orders group by date_format(created_at, \\'%Y-%m\\')');\n\n\n return response()->json($dataPoints);\n\n }", "public function get_chart($where){\n\t\t\t$this->db->select('SUM(trans_pembayaran) as jumlah, monthname(tgl_trans) as bulan');\n\t\t\t$this->db->where('status = \"done\"');\n\t\t\t$this->db->like('DATE_FORMAT(tgl_trans, \"%Y\")', $where);\n\t\t\t$this->db->group_by('DATE_FORMAT(tgl_trans, \"%m\")');\n\t\t\treturn $this->db->get('transaksi')->result_array();\n\t\t}", "public function getTransactions();", "public function TransactionChart(Request $request)\n {\n \t$year = $request->input('year') ? $request->input('year') : date('Y'); \n \t$chartData = DB::table('trans_peryear_view')\n \t\t\t\t->where('year', $year)\n \t\t\t\t->get();\n\n \treturn response()->json(['chartData' => $chartData], 200);\n }", "public function graphmonthused_dashboard()\n \t{\n \t\t// announce return variable\n \t\t$return \t= \tarray();\n \t\t$count \t\t=\tarray();\n \t\t// select logger collection \n \t\t$use_data \t= \t$this->mongo_db->db->used;\n \t\t// preparing query data\n \t\t$splitday \t= \texplode('-', $this->use_date);\n \t\t// check day in month\n \t\t$lastday \t= \tcal_days_in_month(CAL_GREGORIAN,$splitday[1],$splitday[0]);\n \t\tfor ($i = 1; $i <= $lastday; $i++) \n \t\t{\n \t\t\tif (strlen($i) == 1) \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t= \tarray(\n \t\t\t\t\t'use_date' \t=> \t$splitday[0].'-'.$splitday[1].'-0'.$i\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t} \n \t\t\telse \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t= \tarray(\n \t\t\t\t\t'use_date' \t=> \t$splitday[0].'-'.$splitday[1].'-'.$i\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t}\n \t\t}\n\n \t\t$return\t\t=\tarray(\n \t\t\t'lastday'\t=>\t$lastday,\n \t\t\t'data'\t\t=>\tarray(\n\t\t\t\t'name'\t\t=>\t\t'User',\n \t\t\t\t'data'\t\t=>\t\t$count\n \t\t\t\t)\n \t\t\t);\n\n \t\treturn $return;\t\n \t}", "public function transaksi()\n {\n $data = [];\n $date = Akad::selectRaw(\"DATE_FORMAT(tanggal_akad, '%Y-%m') as month\")->orderBy('tanggal_akad', 'desc')->distinct()->get();\n\n foreach ($date as $item) {\n $years = Carbon::parse($item->month)->format('Y');\n $months = Carbon::parse($item->month)->format('m');\n $count = $this->akad->whereYear('tanggal_akad', $years)->whereMonth('tanggal_akad', $months)->count();\n $data[$item->month] = $count;\n }\n\n return $data;\n }", "function charts($data1) {\n\t $startDate = Carbon::now()->subDay(365);\n\t $endDate = Carbon::now();\n\t\n\t\t//THIS RETURNS THE 4 BOXES\n\t\t$month = $data->filter(function($data1){ return $data1->created_at->format('m-y') == date('m-y'); });\n\t\t$lastmonth = $data->filter(function($data1){ return $data1->created_at->format('m-y') == Carbon::now()->firstOfMonth()->subMonth()->format('m-y'); });\n\t\t$year = $data->filter(function($data1){ return $data1->created_at->format('y') == date('y'); });\n\t\t$lastyear = $data->filter(function($data1){ return $data1->created_at->format('y') == Carbon::now()->subYear()->format('y'); });\n\t\n\t}", "public function getTransactionStats($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n // transaction count\n $currentTransactionCount = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('status', [$this->successStatus])\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n // ->groupBy('status')\n ->get();\n\n $prevTransactionCount = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('status', [$this->successStatus])\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n // ->groupBy('status')\n ->get();\n\n // total transaction\n $currentTransactionValue = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(total_price), 0), 0) as average'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->get();\n\n $prevTransactionValue = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(total_price), 0), 0) as average'))\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->get();\n\n // transaction status\n $transactionStatus = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('case when order_statuses.status then \\'sukses\\' else order_statuses.name end as status, count(*)'))\n // ->whereIn('status', [$this->successStatus])\n ->whereIn('order_statuses.name', $this->finalTransactionStatus)\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_statuses.name')\n ->groupBy('order_statuses.status')\n ->orderByRaw('count desc')\n ->get();\n\n $statuses = DB::connection('virtual_market')\n ->table('order_statuses')\n ->select(DB::raw('status'))\n ->get();\n\n $statusTrendData = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('status, count(*),'.$dateQuery))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_statuses.status')\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n $statusTrend = [];\n for($i=0; $i<count($statusTrendData); $i++){\n if(($i == 0) || ($prevDate != $statusTrendData[$i]->date)){\n if($i>0)\n array_push($statusTrend, $data);\n $data = array();\n $data['date'] = $statusTrendData[$i]->date;\n }\n $data[$statusTrendData[$i]->status] = $statusTrendData[$i]->count;\n $prevDate = $statusTrendData[$i]->date;\n if($i == count($statusTrendData)-1)\n array_push($statusTrend, $data);\n }\n\n // app platform (mobile / sms)\n $appPlatform = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('order_type as name, count(*)'))\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_type')\n ->get();\n\n $platforms = array();\n array_push($platforms, array('platform'=>'sms'));\n array_push($platforms, array('platform'=>'mobile'));\n\n $platformTrendData = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('order_type as platform, count(*),'.$dateQuery))\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_type')\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $platformTrend = [];\n for($i=0; $i<count($platformTrendData); $i++){\n if(($i == 0) || ($prevDate != $platformTrendData[$i]->date)){\n if($i>0)\n array_push($platformTrend, $data);\n $data = array();\n $data['date'] = $platformTrendData[$i]->date;\n }\n $data[$platformTrendData[$i]->platform] = $platformTrendData[$i]->count;\n $prevDate = $platformTrendData[$i]->date;\n if($i == count($platformTrendData)-1)\n array_push($platformTrend, $data);\n }\n\n\n $data = array();\n $data['transaction'] = array();\n $data['transaction']['count'] = array();\n $data['transaction']['count']['current'] = $currentTransactionCount[0];\n $data['transaction']['count']['prev'] = $prevTransactionCount[0];\n $data['transaction']['value'] = array();\n $data['transaction']['value']['current'] = $currentTransactionValue[0];\n $data['transaction']['value']['prev'] = $prevTransactionValue[0];\n\n $data['transaction_status'] = $transactionStatus;\n $data['transaction_status_trend'] = array();\n $data['transaction_status_trend']['statuses'] = $statuses;\n $data['transaction_status_trend']['granularity'] = $granularity;\n $data['transaction_status_trend']['trend'] = $statusTrend;\n $data['app_platform'] = $appPlatform;\n $data['app_platform_trend'] = array();\n $data['app_platform_trend']['platforms'] = $platforms;\n $data['app_platform_trend']['granularity'] = $granularity;\n $data['app_platform_trend']['trend'] = $platformTrend;\n \n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function get_transaction_by_month($date){\n $this->load->database();\n\n $query = $this->db->select('date,type,is_of,amount')\n ->get_where('tbl_transactions',array('left(date,7)' => $date));\n return $query->result_array();\n }", "public function graphmonthusedfunc()\n \t{\n \t\t// announce return variable\n \t\t$return \t\t= \tarray();\n \t\t$count \t\t\t=\tarray();\n \t\t// select logger collection \n \t\t$use_data \t\t= \t$this->mongo_db->db->used;\n \t\t// preparing query data\n \t\t$splitday \t\t= \texplode('-', $this->use_date);\n \t\t// check day in month\n \t\t$lastday \t\t= \tcal_days_in_month(CAL_GREGORIAN,$splitday[1],$splitday[0]);\n \t\tfor ($i = 1; $i <= $lastday; $i++) \n \t\t{\n \t\t\tif (strlen($i) == 1) \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t= \tarray(\n \t\t\t\t\t'use_date' \t\t=> \t$splitday[0].'-'.$splitday[1].'-0'.$i, \n \t\t\t\t\t'use_funcid' \t=> \t$this->use_funcid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t} \n \t\t\telse \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t= \tarray(\n \t\t\t\t\t'use_date' \t\t=> \t$splitday[0].'-'.$splitday[1].'-'.$i, \n \t\t\t\t\t'use_funcid' \t=> \t$this->use_funcid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t}\n \t\t}\n\n \t\t$return\t\t=\tarray(\n \t\t\t'lastday'\t=>\t$lastday,\n \t\t\t'data'\t\t=>\tarray(\n\t\t\t\t'name'\t\t=>\t\t'User',\n \t\t\t\t'data'\t\t=>\t\t$count\n \t\t\t\t)\n \t\t\t);\n\n \t\treturn $return;\t\n \t}", "function get_totals(){\r\n $this_month = date('n', time()) - 1;\r\n\r\n $this->payments_this_month = $this->payment_totals_by_month[$this_month];\r\n\r\n $last_month = $this_month > 0 ? $this_month - 1 : false;\r\n if($last_month){\r\n $payments_last_month = $this->payment_totals_by_month[$last_month];\r\n\r\n if($payments_last_month > 0)\r\n $this->payments_this_month_change_percentage = (($this->payments_this_month/$payments_last_month) - 1) * 100;\r\n else $this->payments_this_month_change_percentage = 0;\r\n }\r\n }", "public function index()\n {\n $admin = Auth::user();\n $success = [];\n $i = 1;\n for($i; $i<=12; $i++ ){\n $success[$i] = Transaction::where('status','success')->whereMonth('created_at',$i)->whereYear('created_at','2019')->sum('total');\n }\n $success1 = array_values($success);\n\n $bulan = ['January','February','March','April','May','June','July','August','September','October','November','Desember'];\n \n $now = Carbon::now();\n $bulanTahunText = $now->format('F').\" \".$now->format('Y');\n $tahun = $now->format('Y');\n //Per Bulan\n $namaBulan = array();\n array_push($namaBulan,\"January\");\n array_push($namaBulan,\"February\");\n array_push($namaBulan,\"March\");\n array_push($namaBulan,\"April\");\n array_push($namaBulan,\"May\");\n array_push($namaBulan,\"June\");\n array_push($namaBulan,\"July\");\n array_push($namaBulan,\"August\");\n array_push($namaBulan,\"September\");\n array_push($namaBulan,\"October\");\n array_push($namaBulan,\"November\");\n array_push($namaBulan,\"December\");\n $dataChart = array();\n for($i = 1; $i <= 12; $i++){\n $row = Transaction::selectRaw(\"SUM(total) as total, COUNT(id) as jumlah\")\n ->where(DB::raw('MONTH(created_at)'),'=',$i)\n ->where(DB::raw('YEAR(created_at)'),'=',$tahun)\n ->where(\"status\",\"success\")\n ->first();\n $penjualan = $row->total;\n $jumlah = $row->jumlah;\n if($penjualan == null){\n $penjualan = 0;\n }\n if($jumlah == null){\n $jumlah = 0;\n }\n array_push($dataChart,array('penjualan' => $penjualan,'bulan'=>$namaBulan[$i-1],'jumlah' => $jumlah));\n }\n\n $namaTahun = array();\n $dataTahun = Transaction::selectRaw('YEAR(created_at) as tahun')->groupBy(DB::raw('YEAR(created_at)'))->get();\n foreach($dataTahun as $data){\n array_push($namaTahun,$data->tahun);\n }\n $dataPertahun = array();\n for($i = 0; $i < count($namaTahun); $i++){\n $row = Transaction::selectRaw(\"SUM(total) as total, COUNT(id) as jumlah\")\n ->where(DB::raw('YEAR(created_at)'),'=',$namaTahun[$i])\n ->where(\"status\",\"success\")\n ->first();\n $penjualan = $row->total;\n $jumlah = $row->jumlah;\n if($penjualan == null){\n $penjualan = 0;\n }\n if($jumlah == null){\n $jumlah = 0;\n }\n array_push($dataPertahun,array('penjualan' => $penjualan,'tahun'=>$namaTahun[$i],'jumlah' => $jumlah));\n }\n \n\n return view('admin.dashboard',['success1'=>$success1,'admin'=>$admin,'bulanTahunText'=>$bulanTahunText,'dataChart'=>$dataChart,'dataPertahun'=>$dataPertahun]);\n }", "public function getAmountsDataLastMonth($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-30days\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getAmountsByDay($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function findDataLast()\n {\n return $this->getEntityManager()\n ->createQuery(\"SELECT DISTINCT t.number, f.id as finance, f.price as cost, f.gotcarq as gotcarqId\n FROM GazMainBundle:Terminal t\n JOIN GazMainBundle:Finance f WITH f.terminal = t\n\t\t\t\t\t\t\tWHERE (f.gotcarq IS NOT NULL AND f.gotcarq != 0)\n\t\t\t\t\t\t\t AND f.created = (SELECT MIN(f1.created) FROM GazMainBundle:Finance f1\n LEFT JOIN f1.terminal t1\n WHERE t1.id = t.id AND f1.financeType = FALSE)\n\t\t\t\t\t\t\tORDER BY t.number ASC\n \")\n ->getResult();\n }", "public function incomeGraphData()\n {\n $incomes = Income::all();\n $channelingIncomes = $incomes->where('incomeable_type', Incomes::CHANNELING_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n $pharmacyIncomes = $incomes->where('incomeable_type', Incomes::PHARMACY_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n\n return ResponseHelper::findSuccess('Income Graph Data', [\n 'channelingIncomeGraphData' => $channelingIncomes,\n 'pharmacyIncomeGraphData' => $pharmacyIncomes,\n ]);\n }", "function get_refundlast_by_ccode($ccode_last,$lastmonthdate) {\r\n\tglobal $db;\r\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.refund_amount) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND merchants.currency_code= '$ccode_last' AND transaction_alipay.transaction_type IN ('2','s2') AND transaction_alipay.result_code='SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$lastmonthdate') GROUP BY year, month\";\r\n\t$transactionsDetails = $db->rawQuery($M_R_query);\r\n\treturn $transactionsDetails;\r\n}", "public function getTransactionDataLastYear($customerId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-1year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $transactionResource = $this->_transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processReceivedTransactionData($data, $result);\n \n $data = $transactionResource->getSpentCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processSpentTransactionData($data, $result);\n \n $result = array_values($result);\n return $result;\n }", "function get_transaction_by_month($conds = array())\n\t{\n\t\t//print_r(\"asdfasd\" .$conds);die;\n\t\t$this->db->select('rt_transactions_counts.*'); \n \t\t$this->db->from('rt_transactions_counts');\n \t\t$this->db->where('month(added_date)',$conds['added_date']);\n \t\t$this->db->where('rt_transactions_counts.shop_id',$conds['shop_id']);\n\n\t\treturn $this->db->get();\n\t\t // print_r($this->db->last_query());die;\n\t}", "public function getcontributorPayoutData($month = null){\n\t\t$videos = ContributorPayout::where('month', $month)->get(); \n\t\treturn $videos;\n\t}", "public function get_sales_data(Request $request){\n\n $sales_graph=$this->all_orders->groupBy(function($item){\n return ($item->created_at->format('Y:m'));\n })->map(function($item,$key){\n return ($item->sum('grand_total'));\n });\n $orders_graph=$this->all_orders->groupBy(function($item){\n return ($item->created_at->format('Y:m'));\n })->map(function($item,$key){\n return ($item->count());\n });\n \n $sales_str=\"[\";\n foreach($sales_graph as $key=>$value){\n\n if($sales_graph->last()==$value)\n $sales_str.='{\"Month\" : \"' . $key . '\", \"Sales\":\"'.$value .'\"}';\n else\n $sales_str.='{\"Month\": \"' . $key . '\", \"Sales\":\"'.$value .'\"},';\n }\n $sales_str.=\"]\";\n \n $orders_str=\"[\";\n \n foreach($orders_graph as $key=>$value){\n\n if($orders_graph->last()==$value)\n $orders_str.='{\"Month\" : \"' . $key . '\", \"Orders\":\"'.$value .'\"}';\n else\n $orders_str.='{\"Month\": \"' . $key . '\", \"Orders\":\"'.$value .'\"},';\n }\n $orders_str.=\"]\";\n\n\n echo json_encode([$sales_str,$orders_str]);\n }", "public function expenseGraphData()\n {\n $expenses = Expense::all();\n $supplierPayments = $expenses->where('expensable_type', Expenses::GOOD_RECEIVE)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n $doctorPayments = $expenses->where('expensable_type', Expenses::SCHEDULE_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n\n return ResponseHelper::findSuccess('Expense Graph Data', [\n 'supplierPaymentsGraphData' => $supplierPayments,\n 'doctorPaymentsGraphData' => $doctorPayments,\n ]);\n }", "public function list()\n {\n return view('transactions.graphs');\n }", "public function pharmacySalesGraphData()\n {\n $prescriptions = Prescription::whereIn('status',[Prescriptions::PAID_PRESCRIPTION,Prescriptions::ISSUED_PRESCRIPTION])->get();\n $internalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::INTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n $externalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::EXTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n return ResponseHelper::findSuccess('Explorations Data', [\n 'internalPrescriptionsSales' => $internalPrescriptions,\n 'externalPrescriptionsSales' => $externalPrescriptions,\n ]);\n }", "function get_cancellast_by_ccode($ccode_last,$lastmonthdate) {\r\n\tglobal $db;\r\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.total_fee) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND merchants.currency_code= '$ccode_last' AND transaction_alipay.transaction_type IN ('4','s4') AND transaction_alipay.result_code='SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$lastmonthdate') GROUP BY year, month\";\r\n\t$transactionsDetails = $db->rawQuery($M_R_query);\r\n\treturn $transactionsDetails;\r\n}", "public function get_wallet_history_info($token) {\n $wallet = $this->db->select('id,token,user_provider_id,type,current_wallet,credit_wallet,debit_wallet,avail_wallet,total_amt,fee_amt,reason,created_at')->from('wallet_transaction_history')->\n where('token', $token)->order_by('id', 'DESC')->\n get()->result_array();\n return $wallet;\n }", "public function getPaymentHistory(){\r\n\t\t$result = array();\r\n\t\treturn $result;\r\n\t}", "function get_sale_groupby_ccode($currentdate) {\r\n\tglobal $db;\r\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.total_fee) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND transaction_alipay.transaction_type IN ('1','s1') AND transaction_alipay.result_code='SUCCESS' AND transaction_alipay.trade_status='TRADE_SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$currentdate') GROUP BY year, month, merchants.currency_code\";\r\n\t$transactionsDetails = $db->rawQuery($M_R_query);\r\n\treturn $transactionsDetails;\t\r\n}", "public function _listTotalBoletaMonth() {\n $db = new SuperDataBase();\n $query = \"CALL sp_get_total_ventas_mes('$this->dateGO')\";\n $resul = $db->executeQuery($query);\n//pkComprobante, pkMesa, estado_pago, tipoComprobante, total_tarjeta, total_efectivo, descuento, total_venta, tipo_tarjeta, pkCliente, pkMozo, fechaPago, hora_entrada, hora_salida, fecha_modificacion, idUsuario, npersonas\n $array = array();\n $total = 0;\n while ($row = $db->fecth_array($resul)) {\n $array[] = array(\"pkComprobante\" => $row['pkPediido'],\n \"pkMesa\" => $row['pkMesa'],\n \"total_venta\" => $row['total'],\n \"horaEntrada\" => $row['horaEntrada'],\n \"nmesa\" => $row['nmesa'],\n \"npersonas\" => $row['npersonas'],\n// \"tcomprobante\" => $row['tipo_comprobante'],\n \"descuento\" => $row['descuento'],\n// \"totalTarjeta\" => $row['total_tarjeta'],\n );\n// $total=$total+$row['total_venta'];\n }\n// $array[]= array('Total')\n// echo $query;\n echo json_encode($array);\n }", "function all(){\n\t\t$query = $this->db->query(\"SELECT * FROM transactions ORDER BY DateTime DESC;\");\n\t\t\n\t\treturn $query->result_array();\n\t}", "public function getLastYearData() {\n\t\t$dates = getPeriods('LastYear');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear'], 12);\t\t\n\t}", "public function statistics()\n\t{\n\t\t// $sql_query .= \"FROM transactions \";\n\t\t// $sql_query .= \"WHERE date(date_ordered) > date_ordered - INTERVAL 30 DAY \";\n\t\t// $sql_query .= \"GROUP BY date(date_ordered) \";\n\t\t// $sql_query .= \"ORDER BY date_ordered DESC \";\n\n\t\t// $new_cust_30_days = DB::select($sql_query);\n\n\t\t// $new_customers_30_days = array();\n\n\t\t// for ($i=0; $i<30; $i++) {\n\t\t// $timestamp = mktime(0, 0, 0, date(\"m\") , date(\"d\") - $i, date(\"Y\"));\n\t\t// $days30[] = date(\"Y-m-d\", $timestamp);;\n\t\t// }\n\t\t// foreach ($new_cust_30_days as $result) {\n\t\t// \t$arr_keys[$result->date_ordered] = $result->count;\n\t\t// }\n\t\t// foreach ($days30 as $day) {\n\t\t// \t(isset($arr_keys[$day])) ? $new_customers_30_days[$day] = $arr_keys[$day] : $new_customers_30_days[$day] = 0;\n\t\t// }\n\n\n\t\t// ============================================================================\n\n\t\t$new_customers_past_months = array();\n\t\t$sql_query = \"SELECT DATE_FORMAT(date_ordered, '%Y-%m') AS date_ordered, \";\n\t\t$sql_query .= \"COUNT(DISTINCT date_ordered) as count \";\n\t\t$sql_query .= \"FROM transactions \";\n\t\t$sql_query .= \"WHERE status != 'cancelled' \";\n\t\t$sql_query .= \"AND status != 'removed' \";\n\t\t$sql_query .= \"GROUP BY DATE_FORMAT(date_ordered, '%Y-%m') \";\n\t\t$sql_query .= \"ORDER BY date_ordered DESC \";\n\t\t$new_customers_past_months = DB::select($sql_query);\n\n\t\t// ============================================================================\n\n\t\t$new_customers_this_month = array();\n\t\t$sql_query = \"SELECT date_ordered, user_email, user_firstname, user_lastname, count(*) AS amount_of_products \";\n\t\t$sql_query .= \"FROM transactions \";\n\t\t$sql_query .= \"WHERE (date_ordered BETWEEN DATE_FORMAT(NOW() ,'%Y-%m-01') AND NOW() ) \";\n\t\t$sql_query .= \"AND status != 'cancelled' \";\n\t\t$sql_query .= \"AND status != 'removed' \";\n\t\t$sql_query .= \"GROUP BY date_ordered \";\n\t\t$sql_query .= \"ORDER BY date_ordered DESC \";\n\t\t$new_customers_this_month = DB::select($sql_query);\n\n// print \"<pre>\";\n// print_R($new_customers_this_month);\n// exit;\n\n\n\t\t// ============================================================================\n\n\t\t$new_customers_last_30_days = array();\n\t\t$sql_query = \"SELECT date_ordered, user_email, user_firstname, user_lastname, count(*) AS amount_of_products \";\n\t\t$sql_query .= \"FROM transactions \";\n\t\t$sql_query .= \"WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= date_ordered \";\n\t\t$sql_query .= \"AND status != 'cancelled' \";\n\t\t$sql_query .= \"AND status != 'removed' \";\n\t\t$sql_query .= \"GROUP BY date_ordered \";\n\t\t$sql_query .= \"ORDER BY date_ordered DESC \";\n\t\t$new_customers_last_30_days = DB::select($sql_query);\n\n\t\t$pass_variables = array(\n//\t\t\t'new_customers_30_days' => $new_customers_30_days,\n\t\t\t'new_customers_last_30_days' => $new_customers_last_30_days,\n\t\t\t'new_customers_past_months' => $new_customers_past_months,\n\t\t\t'new_customers_this_month' => $new_customers_this_month\n\t\t);\n\t\treturn view('activities_statistics', $pass_variables );\n\t}", "public function getTransactionByAjax()\n {\n $data = [];\n try {\n $orders = Invoice::whereHas('invoiceDetail.testPackage', function ($query) {\n if (Auth::guard('tutor')->check()) {\n $tutor_id = Auth::guard('tutor')->user()->TutorID;\n $query->where('TutorID', $tutor_id);\n }\n })\n ->whereHas('paymentTransaction', function ($query) {\n if (Auth::guard('tutor')->check()) {\n $query->where('ExternalTransactionStatusID', 3);\n }\n })\n ->select(DB::raw(\"convert(date, CreateDate, 105) as sale_date, SUM(Amount) as total_count\"))\n ->groupBy(DB::raw(\"convert(date, CreateDate, 105)\"))\n ->orderBy(DB::raw(\"convert(date, CreateDate, 105)\", 'ASC'))\n ->get()->toArray();\n\n $total = array_column($orders, 'total_count');\n $date = array_column($orders, 'sale_date');\n $data['total'] = $total;\n $data['date'] = $date; \n return $data;\n } catch (\\Exception $e) {\n echo $e->getMessage();\n Log::channel('loginfo')->error('Get date wise total price by ajax.',['PurchasePackagesRepository/getTransactionByAjax', $e->getMessage()]);\n return false;\n }\n return $data;\n }", "public function doctorIncomeGraphData()\n {\n $schedules = Auth::user()->doctor->schedules;\n $channelingIncomeGraphData = Appointment::whereIn('schedule_id', $schedules->pluck('id'))\n ->whereIn('status', [Appointments::PENDING, Appointments::COMPLETED])\n ->get()\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum(function ($appointment) {\n return $appointment->schedule->doctor_fee;\n })\n ];\n })->values()->all();\n $receivedPaymentsGraphData = Expense::whereIn('expensable_id', $schedules->pluck('id'))\n ->get()\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n return ResponseHelper::findSuccess('Items Summary Data', [\n 'channelingIncomeGraphData' => $channelingIncomeGraphData,\n 'receivedPaymentsGraphData' => $receivedPaymentsGraphData,\n ]);\n }", "public function getOrdersDataLastMonth($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-30days\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getNumOfOrderByDay($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "abstract protected function getTransactions();", "public function purchaseSalesGraph($financial_month, $financialYearDD, $userId)\r\n\t{\r\n\t\t\r\n\t\t$arrayData=array();\r\n\t\t$cashData=array();\r\n\t\t//total sales in amount\r\n\t\t\t$saleQuery='SELECT sum(invoice_total_value) as total_sales FROM '.$this->tableNames['client_invoice'].'\r\n\t\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\t\tand added_by=\"'.$userId.'\" \r\n\t\t\tand is_deleted=\"0\" \r\n\t\t\tand is_canceled=\"0\"';\r\n\t\t\t\r\n\t\t\t//total purchase in amount\r\n\t\t\t$purchaseQuery = 'SELECT sum(invoice_total_value) as total_purchase FROM '.$this->tableNames['client_purchase_invoice'].'\r\n\t\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\t\tand added_by=\"'.$userId.'\"\r\n\t\t\tand is_deleted=\"0\" \r\n\t\t\tand is_canceled=\"0\"';\r\n\r\n\t\t\t$totalSales = $this->get_row($saleQuery,false);\r\n\t\t\t$totalPurchase = $this->get_row($purchaseQuery,false);\r\n\t\t\t\r\n\t\t\tif(empty($totalSales)) {\r\n\t\t\t\t$cashData['sales'] = \"0.00\";\r\n\t\t\t} else {\r\n\t\t\t\t$cashData['sales'] = $totalSales[0];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(empty($totalPurchase)) {\r\n\t\t\t\t$cashData['purchase'] = \"0.00\";\r\n\t\t\t} else {\r\n\t\t\t\t$cashData['purchase'] = $totalPurchase[0];\r\n\t\t\t\t$cashData['month'] = $financial_month;\r\n\t\t\t}\r\n\t\t\tarray_push($arrayData, $cashData);\r\n\t\t\treturn $arrayData;\r\n\t}", "public static function totalPreMonth(){\n $data = DB::table('auctions')->select(DB::raw('substr(date,1,2) as month'), DB::raw('SUM(tax_amount) as total'))->groupBy(\"month\")->get();\n return $data;\n }", "function getUniqueVisitorsData() {\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n \n $lastmonthStartDate=$objClassCommon->calculateMonthDate(date(\"Y-m-d\"), '1', '01', '-');\n $lastmonthEndDate=$objClassCommon->calculateMonthDate(date(\"Y-m-d\"), '1', 't', '-');\n \n $currentmonthStartDate=$objClassCommon->calculateMonthDate(date(\"Y-m-d\"), '0', '01', '-');\n $currentmonthEndDate=$objClassCommon->calculateMonthDate(date(\"Y-m-d\"), '0', 't', '-');\n \n //echo $lastmonthStartDate.\"==\".$lastmonthEndDate.'<br>'.$currentmonthStartDate.'=='.$currentmonthEndDate;\n //die;\n \n //For Calculating last month data\n $varQuery = \"SELECT count(DISTINCT VisitorIP) as count FROM \" . TABLE_VISITOR . \" WHERE DATE(Visitor_Date_Added) >='\".$lastmonthStartDate.\"' AND DATE(Visitor_Date_Added) <='\".$lastmonthEndDate.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $arrRes['last']['count']=$arrData[0]['count'];\n \n //For Calculating current month data\n $varQuery = \"SELECT count(DISTINCT VisitorIP) as count FROM \" . TABLE_VISITOR . \" WHERE DATE(Visitor_Date_Added) >='\".$currentmonthStartDate.\"' AND DATE(Visitor_Date_Added) <='\".$currentmonthEndDate.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $arrRes['current']['count']=$arrData[0]['count'];\n \n \n //pre($arrRes);\n return $arrRes;\n }", "public function chartData()\n {\n // Data tanggal selama 7 hari\n foreach(range(0, 7) as $day) {\n $dates[] = Carbon::now()->subDays($day)->format('yy-m-d');\n $tanggal = array_reverse($dates);\n }\n\n // Jumlah buku yang dipinjam per hari selama 1 mingggu\n foreach($tanggal as $date){\n $chartdata = Peminjaman::select(DB::raw('DATE(tanggal_pinjam) as date'))\n ->selectRaw('count(tanggal_pinjam) as jumlah')\n ->where('tanggal_pinjam', 'like', '%'.$date.'%')\n ->orderBy('tanggal_pinjam')\n ->groupBy('date')\n ->pluck('jumlah')\n ->toArray();\n\n if($chartdata){\n $jumlah[] = $chartdata[0];\n }else {\n $jumlah[] = 0;\n }\n }\n \n return response()->json([\n 'jumlah' => $jumlah,\n 'tanggal' => $tanggal\n ]);\n }", "public static function data_last_month() {\n\t$month = date('m');\n\t$year = date('Y');\n\t$day = date(\"d\", mktime(0,0,0, $month+1, 0, $year));\n\n\treturn date('Y-m-d', mktime(0,0,0, $month, $day, $year));\n}", "public function fetchNextPage(&$last_page) {\n\n\t\t$transactions = [];\n\n\t\tif (!$this->date) {\n\t\t\tthrow new \\Exception(get_class($this) . ': you need to call setDate() before fetching any transactions');\n\t\t}\n\n\t\t$data = json_decode($this->api->getSales($this->date->toDateString(), NULL, NULL, NULL, NULL, $this->page, $this->page_size), true);\n\t\t$transactions = array_merge(\n\t\t\t$transactions,\n\t\t\t$this->mapTransactionData($data)\n\t\t);\n\n\t\t$data = json_decode($this->api->getLeads($this->date->toDateString(), NULL, NULL, NULL, NULL, $this->page, $this->page_size), true);\n\t\t$transactions = array_merge(\n\t\t\t$transactions,\n\t\t\t$this->mapTransactionData($data)\n\t\t);\n\n\t\t$this->page++;\n\n\t\t$last_page = empty($transactions);\n\n\t\treturn $transactions;\n\t}", "function getMonthlyReportData($month)\n{\n $sql = sprintf(\"SELECT * FROM PURCHASES WHERE strftime('%m', DATE) = '%s'\", $month);\n\n $rows = array();\n $result = $this->query($sql);\n while($row = $result->fetchArray(SQLITE3_ASSOC))\n {\n array_push($rows, $row);\n }\n return $rows;\n}", "public function getTransactionDataLast2Years($customerId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-2year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $transactionResource = $this->_transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processReceivedTransactionData($data, $result);\n \n $data = $transactionResource->getSpentCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processSpentTransactionData($data, $result);\n \n $result = array_values($result);\n return $result;\n }", "public function getTransactionStats($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n\n DB::enableQueryLog();\n // execute\n // transaction count\n $currentTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('orderline_statuses.name', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n // ->groupBy('status')\n ->get();\n\n $prevTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('orderline_statuses.name', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n // ->groupBy('status')\n ->get();\n\n\n // total transaction value\n $currentTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->get();\n\n $prevTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->get();\n\n // transaction status\n $transactionStatus = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('orderline_statuses.name, count(*)'))\n // ->whereIn('status', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->groupBy('orderline_statuses.name')\n ->orderByRaw('count desc')\n ->get();\n\n // payment method\n $paymentMethod = DB::connection('marketplace')\n ->table('orders')\n ->join('payment_method_types', 'orders.payment_method_type_id', '=', 'payment_method_types.id')\n ->select(DB::raw('payment_method_types.name, count(*)'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n // ->where('status', '=', $this->successStatus)\n ->groupBy('payment_method_types.name')\n ->orderByRaw('count desc')\n ->get(); \n\n $data = array();\n\n $data['transaction'] = array();\n $data['transaction']['count'] = array();\n $data['transaction']['count']['current'] = $currentTransactionCount[0];\n $data['transaction']['count']['prev'] = $prevTransactionCount[0];\n $data['transaction']['value'] = array();\n $data['transaction']['value']['current'] = $currentTransactionValue[0];\n $data['transaction']['value']['prev'] = $prevTransactionValue[0];\n \n $data['transaction_status'] = $transactionStatus;\n $data['payment_method'] = $paymentMethod;\n \n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function loadTransactionInformations()\n {\n $this->loadCount(['transactions', 'transactions as last_month_transactions_count' => function (Builder $query) {\n $query->where('created_at', '>', now()->subDays(30));\n }]);\n }", "public function getMyTransactionHistory($patron, $params)\n {\n $pageSize = $params['limit'] ?? 50;\n $offset = isset($params['page']) ? ($params['page'] - 1) * $pageSize : 0;\n $sortOrder = isset($params['sort']) && 'checkout asc' === $params['sort']\n ? 'asc' : 'desc';\n $result = $this->makeRequest(\n ['v3', 'patrons', $patron['id'], 'checkouts', 'history'],\n [\n 'limit' => $pageSize,\n 'offset' => $offset,\n 'sortField' => 'outDate',\n 'sortOrder' => $sortOrder,\n 'fields' => 'item,outDate'\n ],\n 'GET',\n $patron\n );\n if (isset($result['code'])) {\n return [\n 'success' => false,\n 'status' => 146 === $result['code']\n ? 'ils_transaction_history_disabled'\n : 'ils_connection_failed'\n ];\n }\n $transactions = [];\n foreach ($result['entries'] as $entry) {\n $transaction = [\n 'id' => '',\n 'item_id' => $this->extractId($entry['item']),\n 'checkoutDate' => $this->dateConverter->convertToDisplayDate(\n 'Y-m-d', $entry['outDate']\n )\n ];\n // Fetch item information\n $item = $this->makeRequest(\n ['v3', 'items', $transaction['item_id']],\n ['fields' => 'bibIds,varFields'],\n 'GET',\n $patron\n );\n $transaction['volume'] = $this->extractVolume($item);\n if (!empty($item['bibIds'])) {\n $transaction['id'] = $item['bibIds'][0];\n\n // Fetch bib information\n $bib = $this->getBibRecord(\n $transaction['id'], 'title,publishYear', $patron\n );\n if (!empty($bib['title'])) {\n $transaction['title'] = $bib['title'];\n }\n if (!empty($bib['publishYear'])) {\n $transaction['publication_year'] = $bib['publishYear'];\n }\n }\n $transactions[] = $transaction;\n }\n\n return [\n 'count' => $result['total'] ?? 0,\n 'transactions' => $transactions\n ];\n }", "function get_historical_views_chart() {\r\n\tif (current_user_authored($post)){\r\n\t\tglobal $wp_query;\r\n\t\tget_and_store_page_views(false, true);\r\n\t\t$historical_views = get_user_meta($wp_query->get_queried_object_id(), 'ga_author_historical_views');\r\n\r\n\t\tif(empty($historical_views)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$page_views_string = \"'\" . implode ( \"', '\", array_keys($historical_views[0]) ) . \"'\";\r\n\t\t$dates_string = implode( ',', $historical_views[0] );\r\n\r\n\t\t$result = '<section class=\"stats_charts\">\r\n\t\t\t\t\t\t<h2 class=\"kicker\">All articles by month</h2>\r\n\t\t\t\t\t\t<div class=\"graphic\">\r\n\t\t\t\t\t\t\t<canvas id=\"monthly-views\" width=\"800\" height=\"450\"></canvas>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</section>';\r\n\t\t$result.= '<script>\r\n\t\t\t\t\t\tnew Chart(document.getElementById(\"monthly-views\"), {\r\n\t\t\t\t\t\t\ttype: \"line\",\r\n\t\t\t\t\t\t\tdata: {\r\n\t\t\t\t\t\t\t\tlabels: [' . $page_views_string . '],\r\n\t\t\t\t\t\t\t\tdatasets: [{ \r\n\t\t\t\t\t\t\t\t\tdata: [' . $dates_string . '],\r\n\t\t\t\t\t\t\t\t\tlabel: \"Users\",\r\n\t\t\t\t\t\t\t\t\tborderColor: \"#BF2528\",\r\n\t\t\t\t\t\t\t\t\tfill: true\r\n\t\t\t\t\t\t\t\t},\r\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\toptions: {\r\n\t\t\t\t\t\t\t\ttitle: {\r\n\t\t\t\t\t\t\t\tdisplay: false,\r\n\t\t\t\t\t\t\t\ttext: \"Monthly views\"\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\tlegend: {\r\n\t\t\t\t\t\t\t\t\t\tdisplay: false\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\tlayout: {\r\n\t\t\t\t\t\t\t\t\tpadding: {\r\n\t\t\t\t\t\t\t\t\t\tleft: 5,\r\n\t\t\t\t\t\t\t\t\t\tright: 5,\r\n\t\t\t\t\t\t\t\t\t\ttop: 25,\r\n\t\t\t\t\t\t\t\t\t\tbottom: 5\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\t\t\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t</script>';\r\n\t\treturn $result;\r\n\t}\r\n}", "public function actionChart()\n {\n $data = Account::find()->where('id_user='.Yii::$app->user->id)->all();\n $accounts = ArrayHelper::map($data, 'id', 'title');\n\n $operationsByAccount = [];\n foreach($accounts as $id_account=>$title){\n $operations = OperationController::findOperationsOfAccount($id_account);\n $operationsByAccount[$title] = $this->splitValueByMonths($operations);\n }\n\n $chart = new Chart($operationsByAccount);\n $data = $chart->data;\n\n return $this->render('chart', [\n 'data' => $data,\n ]);\n }", "function getAttnDataLast(){\n\t\t\n\t\t$lim= isset($_REQUEST['limit'])?$_REQUEST['limit']:'0';\n\t\t$orgid = isset($_REQUEST['refno'])?$_REQUEST['refno']:'0';\n\t\t$datafor= isset($_REQUEST['datafor'])?$_REQUEST['datafor']:'';\n\t\t//$datafor= isset($_REQUEST['datafor'])?$_REQUEST['datafor']:'';\n\t\t$zone = getTimeZone($orgid);\n date_default_timezone_set($zone);\n\t\t$end = date(\"Y-m-d\");\n $start = date(\"Y-m-d\");\n\t\t$data=array();\n\t\tif($lim=='l7'){ // Last 7 days\n\t\t\t$end = date(\"Y-m-d\", strtotime(\"-1 days\"));\n\t\t\t$end1 = date(\"Y-m-d\", strtotime(\"-1 days\"));\n $start = date(\"Y-m-d\", strtotime('-6 day', strtotime($end)));\n $start1 = date(\"Y-m-d\", strtotime('-6 day', strtotime($end)));\n\t\t\t$start = \\DateTime::createFromFormat('Y-m-d', $start);\n $end = \\DateTime::createFromFormat('Y-m-d', $end);\n\t\t}else if($lim=='l30'){ // Last 30 days\n\t\t\t$end = date(\"Y-m-d\", strtotime(\"-1 days\"));\n $start = date(\"Y-m-d\", strtotime('-29 day', strtotime($end)));\n\t\t\t$end1 = date(\"Y-m-d\", strtotime(\"-1 days\"));\n $start1 = date(\"Y-m-d\", strtotime('-29 day', strtotime($end)));\n\t\t\t$start = \\DateTime::createFromFormat('Y-m-d', $start);\n $end = \\DateTime::createFromFormat('Y-m-d', $end);\n\t\t}\n\t\t$datePeriod = new \\DatePeriod($start, new \\DateInterval('P1D'), $end->modify('+1day'));\n\t\t///////getting data\n\t\t\t\n\t\t\tif($datafor=='present'){\n\t\t\t\t$res = array();\n\t\t\t\tforeach ($datePeriod as $date) {\n\t\t\t\t\t$dt = $date->format('Y-m-d');\n\t\t\t\t\t$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , `TimeIn`, `TimeOut` ,AttendanceDate FROM `AttendanceMaster` WHERE `AttendanceDate` ='\" . $dt . \"' and `OrganizationId`=\" . $orgid . \" and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = $orgid AND Is_Delete = 0) order by DATE(AttendanceDate) desc,name\");\n\t\t\t\t\t//$res[] = $query->result();\n\t\t\t\t\t$data['elist'][] = $query->result();\n\t\t\t\t}\n\t\t\t}else if($datafor=='absent'){\n\t\t\t\t$res = array();\n\n\t\t\t\t$query = $this->db->query(\"SELECT EmployeeId , AttendanceDate FROM `AttendanceMaster` WHERE OrganizationId = ? and AttendanceStatus in (2,6,7) and `AttendanceDate` between ? and ? AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = $orgid AND Is_Delete = 0) order by AttendanceDate \", array($orgid , $start1 , $end1));\n\t\t\t\tforeach ($query->result() as $row) {\n\t\t\t\t\t\t\t$data1 = array();\n\t\t\t\t\t\t\t//$data['name']=ucwords(getEmpName($row->Id));\n\t\t\t\t\t\t\t$data1['name'] = getEmpName($row->EmployeeId);\n\t\t\t\t\t\t\t$data1['AttendanceDate'] = date(\"Y-m-d\", strtotime($row->AttendanceDate));\n\t\t\t\t\t\t\t$data1['TimeIn'] = '-';\n\t\t\t\t\t\t\t$data1['TimeOut'] = '-';\n\t\t\t\t\t\t\t$res[] = $data1;\n\t\t\t\t\t\t}\n\t\t\t\t$data['elist'][] =array_reverse($res);\n\t\t\t}else if($datafor=='latecomings'){\n\t\t\t\t$res = array();\n\t\t\t\tforeach ($datePeriod as $date) {\n\t\t\t\t\t$dt = $date->format('Y-m-d');\n\t\t\t\t\t$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , `TimeIn`, `TimeOut` ,AttendanceDate FROM `AttendanceMaster` WHERE (time(TimeIn) > (select time(TimeIn) from ShiftMaster where ShiftMaster.Id=shiftId)) and `AttendanceDate` ='\" . $dt . \"' and `OrganizationId`=\" . $orgid . \" and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = $orgid AND Is_Delete = 0) order by DATE(AttendanceDate) desc,name\");\n\t\t\t\t\t$res[] = $query->result();\n\t\t\t\t}\n\t\t\t\t$data['elist'] = $res;\n\t\t\t}else if($datafor=='earlyleavings'){\n\t\t\t\t$res = array();\n\t\t\t\tforeach ($datePeriod as $date) {\n\t\t\t\t\t$dt = $date->format('Y-m-d');\n\t\t\t\t\t\t$query = $this->db->query(\"select Shift,Id , FirstName , LastName from EmployeeMaster where OrganizationId = $orgid and Id IN (select EmployeeId from AttendanceMaster where OrganizationId = $orgid and AttendanceDate='$dt ' and TimeIn != '00:00:00' ) AND is_Delete=0 order by FirstName\");\n\t\t\t\t\t $innerarr = array();\n\t\t\t\t\t $cond = '';\n\t\t\t\t\tforeach ($query->result() as $row) {\n\t\t\t\t\t\t$ShiftId = $row->Shift;\n\t\t\t\t\t\t$EId = $row->Id;\n\t\t\t\t\t\t$query = $this->db->query(\"select TimeIn,TimeOut,shifttype from ShiftMaster where Id = $ShiftId\");\n\t\t\t\t\t\tif ($data123 = $query->row()) {\n\t\t\t\t\t\t\t$shiftout = $data123->TimeOut;\n\t\t\t\t\t\t\t$shiftout1 = $dt. ' '.$data123->TimeOut;\n\t\t\t\t\t\t\tif($data123->shifttype==2)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$nextdate = date('Y-m-d',strtotime($dt . \"+1 days\"));\n\t\t\t\t\t\t\t\t $shiftout1 = $nextdate.' '.$data123->TimeOut;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$shift = substr($data123->TimeIn, 0, 5) . ' - ' . substr($data123->TimeOut, 0, 5);\n\t\t\t\t\t\t\t$ct = date('H:i:s');\n\t\t\t\t\t\t\t\t$query333 = $this->db->query(\"select SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out from AttendanceMaster where EmployeeId =$EId and if(timeoutdate = '0000-00-00' , TimeOut < '$shiftout' , CONCAT(timeoutdate,' ' ,TimeOut) < '$shiftout1' ) and AttendanceDate='$dt' and TimeOut !='00:00:00' \");\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\tif ($row333 = $query333->row()) {\n\t\t\t\t\t\t\t\t\t$a = new DateTime($row333->TimeOut);\n\t\t\t\t\t\t\t\t\t$b = new DateTime($data123->TimeOut);\n\t\t\t\t\t\t\t\t\t$interval = $a->diff($b);\n\t\t\t\t\t\t\t\t\t$data1['earlyby'] = $interval->format(\"%H:%I\");\n\t\t\t\t\t\t\t\t\t$data1['timeout'] = substr($row333->TimeOut, 0, 5);\n\t\t\t\t\t\t\t\t\t$data1['name'] = $row->FirstName . ' ' . $row->LastName;\n\t\t\t\t\t\t\t\t\t$data1['shift'] = $shift;\n\t\t\t\t\t\t\t\t\t$data1['status'] = $row333->status;\n\t\t\t\t\t\t\t\t\t$data1['TimeIn'] = $row333->TimeIn;\n\t\t\t\t\t\t\t\t\t$data1['TimeOut'] = $row333->TimeOut;\n\t\t\t\t\t\t\t\t\t$data1['AttendanceDate'] = $dt;\n\t\t\t\t\t\t\t\t\t$innerarr[] = $data1;\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$res[] = $innerarr;\n\t\t\t\t}\n\t\t\t\t$data['elist'] = $res;\n\t\t\t}\n\t\t\t\n\t\t///////getting data/\n\t\techo json_encode($data);\n\t\t////////////\n\n\t}", "public function postDashboard(Request $request) {\n $graphdata = array();\n $period = $request->input('period');\n $grouping = $request->input('grouping');\n $chart = $request->input('chart');\n $stat = $request->input('stat');\n $fromDate = $request->input('fromDate');\n $thruDate = $request->input('thruDate');\n $query = 'SELECT ';\n if($grouping == 'Product') {\n $query = $query . \"products.product_name as 'Group',\";\n } elseif ($grouping == 'Category') {\n $query = $query . \"categories.category_name as 'Group',\";\n } else {\n $query = $query . \"CONCAT(salespeople.last_name,', ',salespeople.first_name) as 'Group',\";\n }\n $query = $query . \"sum(quantity) as 'Quantity',\";\n $query = $query . \"sum(products.price * quantity) as 'Dollars' \";\n $query = $query . \"FROM sales_transactions \";\n if($grouping == 'Product') {\n $query = $query . \"INNER JOIN products ON sales_transactions.product_id = products.id \";\n $query = $query . \" WHERE transaction_date between '\" . $fromDate . \"' and '\" . $thruDate . \"' \";\n $query = $query . \"GROUP BY product_name\";\n } elseif ($grouping == 'Category') {\n $query = $query . \"INNER JOIN products ON sales_transactions.product_id = products.id \";\n $query = $query . \"INNER JOIN categories ON products.category_id = categories.id \";\n $query = $query . \" WHERE transaction_date between '\" . $fromDate . \"' and '\" . $thruDate . \"' \";\n $query = $query . \"GROUP BY categories.category_name\";\n } else {\n $query = $query . \"INNER JOIN salespeople ON sales_transactions.salesperson_id = salespeople.id \";\n $query = $query . \"INNER JOIN products ON sales_transactions.product_id = products.id \";\n $query = $query . \" WHERE transaction_date between '\" . $fromDate . \"' and '\" . $thruDate . \"' \";\n $query = $query . \"GROUP BY CONCAT(salespeople.last_name,', ',salespeople.first_name)\";\n }\n if($stat == 'Quantity') {\n $query = $query . \" ORDER BY sum(quantity) DESC\";\n } else {\n $query = $query . \" ORDER BY sum(products.price * quantity) DESC\";\n }\n\n\n $graphdata = \\DB::select($query);\n\n // if the result set has more than 10 rows, need to group the results in 10 and higher into category of \"other\"\n $other = array();\n if (count($graphdata) > 10) {\n $graphdata2 = new \\Illuminate\\Database\\Eloquent\\Collection;\n for ($i=0; $i<10; $i++) {\n $graphdata2[$i] = $graphdata[$i];\n }\n $qty = 0;\n $dol = 0;\n for ($i=10; $i<count($graphdata); $i++) {\n $qty = $qty + $graphdata[$i]->Quantity;\n $dol = $dol + $graphdata[$i]->Dollars;\n }\n\n $other = \\DB::select(\"SELECT 'Other' as 'Group',\" . $qty . \" as 'Quantity',\" . $dol . \" as 'Dollars' FROM sales_transactions where id=1\");\n $graphdata = $graphdata2;\n }\n\n return view('salesdashboard')->with('graphdata',$graphdata)->with('grouping',$grouping)->with('period',$period)->with('chart',$chart)->with('query',$query)->with('stat',$stat)->with('other',$other)->with('fromDate',$fromDate)->with('thruDate',$thruDate);\n }", "public function getGraphView()\n\t{\n\t\t$chart = new ComboChart();\t\t\n\n\t\t// switch selon le type d'analyse\n\t\tswitch ($this->time) {\n\t\t\t// cas analyse jour\n\t\t\tcase 'day':\t\t\t\t\n\t\t\t $sql = 'SELECT \n\t\t\t\t\t\t\tdate(date_time) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\tgroup by date(date_time)';\n\t\t\t\t\tbreak;\t\t\t\n\t\t\tcase 'month':\n\t\t\t// cas analyse mois\n\t\t\t\t$sql = 'SELECT \n\t\t\t\t\t\t\tleft(date(date_time),7) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\tgroup by left(date(date_time),7)';\n\t\t\t\tbreak;\n\t\t\tcase 'year':\n\t\t\t// cas analyse année\n\t\t\t\t$sql = 'SELECT \n\t\t\t\t\t\t\tleft(date(date_time),4) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\tgroup by left(date(date_time),4)';\n\t\t\t\tbreak;\n\t\t\tcase 'week':\n\t\t\t// cas analyse 7 derniers jours\n\t\t\t\t$date = new dateTime();\n\t\t\t\t$startDate = $date->format('Y-m-d');\n\t \t\t \t$endDate = $date->modify('-1 week');\n\t \t\t \t$endDate = $endDate->format('Y-m-d');\n\n\t\t\t\t$sql = \"SELECT \n\t\t\t\t\t\t\tdate(date_time) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\twhere date_time BETWEEN '\" . $endDate . \"' and '\" . $startDate . \"'\n\t\t\t\t\t\tgroup by date(date_time)\";\n\t\t\t\tbreak;\n\t\t}\n\n\n\t $stmt = $this->em->query($sql);\n\t $views = $stmt->fetchAll();\n\n\t\t// entete du googleGraph\n\t\t$arrayToDataTable[] = ['', 'Montant', ['role' => 'tooltip'], 'Evolution', ['role' => 'tooltip']]; \n\n\t\t//data du googleGraph\n\t\tforeach ($views as $view){\n\t\t\t$arrayToDataTable[] = [$view['date'], intval($view['nb']), intval($view['nb']) .\" vues\", 0, \"evolution\"];\n\t\t}\n\n\t\t$chart->getData()->setArrayToDataTable($arrayToDataTable);\n\t\t$vAxisAmount = new VAxis();\n\t\t$vAxisAmount->setTitle('Nombre de vues');\n\t\t$chart->getOptions()->setVAxes([$vAxisAmount]);\n\n\t\t$seriesAmount = new \\CMEN\\GoogleChartsBundle\\GoogleCharts\\Options\\ComboChart\\Series();\n\t\t$seriesAmount->setType('bars');\n\t\t$seriesAmount->setTargetAxisIndex(0);\n\t\t$seriesEvol = new \\CMEN\\GoogleChartsBundle\\GoogleCharts\\Options\\ComboChart\\Series();\n\t\t$seriesEvol->setType('line');\n\t\t$seriesEvol->setTargetAxisIndex(1);\n\t\t$chart->getOptions()->setSeries([$seriesAmount, $seriesEvol]);\n\t\t$chart->getOptions()->setColors(['black', 'red']);\t\n\n\t\treturn $chart;\t\t\n\t}", "public function getBuyerHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $buyer = DB::connection('virtual_market')\n ->table('orders')\n ->select(DB::raw($dateQuery.',count(distinct customer_id)'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['buyer'] = $buyer;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function countLastMonth()\n\t{\n\t\t$fromDate = Carbon::parse('Monday last month')->subMonth(1)->toDateString();\n\t\t// ambil tanggal di hari terakhir dalam bulan kemarin\n\t\t$tillDate = Carbon::parse('Monday last month')->subMonth(1)->endOfMonth()->toDateString();\n\t\treturn $this->model\n\t\t\t\t\t->whereBetween('tgl', [$fromDate, $tillDate])\t\t\n\t\t\t\t\t->count();\n\t}", "public function getconnectTransactions() {\n $yesterday = new \\DateTime('yesterday');\n $start_date = $yesterday->format('Y-m-d');\n $today = new \\DateTime('now');\n $end_date = $today->format('Y-m-d');\n $status = ApplaneConstentInterface::COMPLETED;\n //create the query\n $query = $this->createQueryBuilder('c');\n $query->select()\n ->Where('c.date >=:create_at', 'c.date <:end_at', 'c.status =:status')\n ->setParameter('create_at', $start_date)\n ->setParameter('end_at', $end_date)\n ->setParameter('status', $status);\n\n $result = $query->getQuery();\n $result_res = $result->getResult();\n return $result_res;\n }", "function monthlyBalancedData(){\n\t\t//results to be returned\n\t\t$results= [];\n\t\t//the total expense of all the month of all users\n\t\t$results['total'] = $this->getMonthTotal();\n\t\t//the fair amount to be paid by each member\n\t\t// total/number of members on household\n\t\t$results['fairAmount'] = $results['total']/$this->getNumberOfMembers();\n\t\tforeach ($this->members as $member) {\n\t\t\t//retrieves the individual expenses\n\t\t\t$name = $member->getUserFirstName();\n\t\t\t$results['members'][$name] = $member->billsDistribution();\n\t\t}\n\t\treturn $results;\n\t}", "public function sumCashTransactionPerMonths(): array\n {\n $months = ['jan', 'feb', 'mar', 'apr', 'mei', 'jun', 'jul', 'agu', 'sep', 'okt', 'nov', 'des'];\n\n for ($i = 1; $i <= 12; $i++) {\n // Looping dari angka 1-12 karena setiap tahun ada 12 bulan dan menghitung kolom amount\n // berdasarkan bulannya.\n $cashTransactions = $this->model\n ->select('is_paid', 'amount', 'date')\n ->whereMonth('date', \"{$i}\")\n ->whereYear('date', date('Y'))\n ->sum('amount');\n\n $results[$months[$i - 1]] = $cashTransactions;\n }\n\n /**\n * Output yang akan dihasilkan seperti dibawah ini\n * \n * $results = [\n * 'jan' => 10000,\n * 'feb' => 10000,\n * 'mar' => 10000,\n * 'apr' => 10000,\n * 'mei' => 10000,\n * 'jun' => 10000,\n * 'jul' => 10000,\n * 'agu' => 10000,\n * 'sep' => 10000,\n * 'okt' => 10000,\n * 'nov' => 10000,\n * 'des' => 10000\n * ];\n */\n\n return $results;\n }", "public static function getTransaction()\n {\n $query = new Query;\n return $query->select([ 'c.*', 'u.username', 'u.email','t.transaction_id', 't.transaction_amount',\n 't.payment_date as tn_payment_date'])\n ->from('contest as c')\n ->LeftJoin('transaction_details as t', 't.contest_id=c.id')\n ->LeftJoin('user as u', 'u.id=c.user_id')\n ->orderBy(['t.payment_date' => SORT_DESC]); \n }", "public function run()\n {\n $today = Carbon::now()->format('Y-m-d');\n $twoDaysAgo = Carbon::now()->subDay()->format('Y-m-d');\n $sevenDaysAgo = Carbon::now()->subDays(7)->format('Y-m-d');\n $lastMonth = Carbon::now()->subMonth()->format('Y-m-d');\n\n Transaction::factory()->create([\n 'category_id' => 1, //sales\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $today,\n 'amount' => 20000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 1,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $today,\n 'amount' => 15000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 4, //electric bill\n 'admin_id' => 1,\n 'account_id' => 1,\n 'description' => 'inec',\n 'date' => $today,\n 'amount' => 17500\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 5, // internet\n 'admin_id' => 1,\n 'account_id' => 1,\n 'description' => 'pldc',\n 'date' => $today,\n 'amount' => 12000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 6, // water\n 'admin_id' => 1,\n 'account_id' => 1,\n 'description' => 'inwad',\n 'date' => $today,\n 'amount' => 10000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 7, // fuel\n 'admin_id' => 1,\n 'account_id' => 1,\n 'description' => 'van gas',\n 'date' => $today,\n 'amount' => 5000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 1,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $twoDaysAgo,\n 'amount' => 90000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 7, // fuel\n 'admin_id' => 1,\n 'account_id' => 1,\n 'description' => 'ryan gas',\n 'date' => $twoDaysAgo,\n 'amount' => 30000\n ]);\n\n\n Transaction::factory()->create([\n 'category_id' => 1,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $sevenDaysAgo,\n 'amount' => 10000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 1,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $sevenDaysAgo,\n 'amount' => 20000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 1,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $lastMonth,\n 'amount' => 35000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 7,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $lastMonth,\n 'amount' => 55000\n ]);\n }", "public function getData($agency,$month){\n\n// $dataset = booking::where([['agency_id','=',$agency]])\n// ->whereBetween('date',['2020-'.$month.'-01','2020-'.$month.'-30'])->get();\n// foreach ($dataset as $data){\n// $i[] = ['date'=>$data->date,'fare'=>$data->fare];\n// }\n// $i2 = collect($i)->mapToGroups(function ($item){\n// return [$item['date']=>$item['fare']];\n// })->map(function ($item){\n// return $item->sum();\n// });\n\n $dataset = booking::where([['agency_id','=',$agency]])\n ->whereBetween('date',['2020-'.$month.'-01','2020-'.$month.'-30'])->get()\n ->mapToGroups(function ($item){\n return [Carbon::parse($item->date)->format('d') => $item->fare];\n })->map(function($item){\n return $item->sum();\n });\n\n\n return $dataset;\n }", "public function all($transactionToken = null)\n {\n $append = '';\n\n if ($transactionToken) {\n $append = '?since_token='.$transactionToken;\n }\n\n return $this->client->get('v1/transactions.json'.$append);\n }", "public function getMomentsByMonth() {\n\t\ttry {\n\t\t\t$timezone = \\Auth::User()->station->getStationTimezone();\n\n\t\t\t$station_time = new \\DateTime('now', new \\DateTimeZone($timezone));\n\t\t\t$offset = $station_time->getOffset();\n\n\t\t\t$date = Carbon::now($timezone);\n\n\t\t\t$year_start = $date->copy()->startOfMonth()->subMonths(12);\n\n\t\t\t//If station is Nova we want to start at March 11 since this is when we launched with them\n\t\t\tif(\\Auth::User()->station->id == 8 && $year_start->lt(Carbon::parse('2016-03-11'))) {\n\t\t\t\t$year_start = Carbon::parse('2016-03-11');\n\t\t\t}\n\t\t\t$year_end = $date;\n\n\t\t\t$moments = \\DB::table('airshr_events')\n\t\t\t\t->select(\\DB::raw('MONTH(FROM_UNIXTIME(record_timestamp)) AS month, \n\t\t\t\tYEAR(FROM_UNIXTIME(record_timestamp)) AS year,\n\t\t\t\tWEEK(FROM_UNIXTIME(record_timestamp)) as week, \n\t\t\t\tCOUNT(*) as count'))\n\t\t\t\t->where('station_id', '=', \\Auth::User()->station->id)\n//\t\t\t\t->where('event_data_status', '=', 1)\n\t\t\t\t->where('record_timestamp', '>=', $year_start->timestamp)\n\t\t\t\t->where('record_timestamp', '<=', $year_end->timestamp)\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) >= 6')\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) < 22')\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) >= 6*60*60\") //\"MOD(record_timestamp + {$offset}, 86400)\" gets seconds since midnight\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) < 22*60*60\") // We then compare the hours from midnight to check if it is between the hours we want\n\t\t\t\t->groupBy('week')\n\t\t\t\t->orderBy('year')\n\t\t\t\t->orderBy('month')\n\t\t\t\t->orderBy('week')\n\t\t\t\t->get();\n\n\t\t\t$total_moments = 0;\n\t\t\t$moments_this_month = 0;\n\n\t\t\tforeach($moments as $moment) {\n\t\t\t\t$total_moments += $moment->count;\n\t\t\t\tif($moment->month == $date->month && $moment->year == $date->year) {\n\t\t\t\t\t$moments_this_month += $moment->count;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn response()->json(array('code' => 0,\n\t\t\t\t'moments' => $moments,\n\t\t\t\t'moments_this_month' => $moments_this_month,\n\t\t\t\t'total_moments' => $total_moments\n\t\t\t\t));\n\t\t\t\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}", "public function monthly_sales_report()\n\t{\n\t\t$query1 = $this->db->query(\"\n\t\t\tSELECT \n\t\t\t\tdate,\n\t\t\t\tEXTRACT(MONTH FROM date) as month, \n\t\t\t\tCOUNT(invoice_id) as total\n\t\t\tFROM \n\t\t\t\tinvoice\n\t\t\tWHERE \n\t\t\t\tEXTRACT(YEAR FROM date) >= EXTRACT(YEAR FROM NOW())\n\t\t\tGROUP BY \n\t\t\t\tEXTRACT(YEAR_MONTH FROM date)\n\t\t\tORDER BY\n\t\t\t\tmonth ASC\n\t\t\")->result();\n\n\t\t$query2 = $this->db->query(\"\n\t\t\tSELECT \n\t\t\t\tpurchase_date,\n\t\t\t\tEXTRACT(MONTH FROM purchase_date) as month, \n\t\t\t\tCOUNT(purchase_id) as total_month\n\t\t\tFROM \n\t\t\t\tproduct_purchase\n\t\t\tWHERE \n\t\t\t\tEXTRACT(YEAR FROM purchase_date) >= EXTRACT(YEAR FROM NOW())\n\t\t\tGROUP BY \n\t\t\t\tEXTRACT(YEAR_MONTH FROM purchase_date)\n\t\t\tORDER BY\n\t\t\t\tmonth ASC\n\t\t\")->result();\n\n\t\treturn [$query1,$query2];\n\t}", "public function getTransactions()\n\t{\n\t\treturn $this->data['transactions'];\n\t}", "protected function getMonthBalanceData($month, $year, $employee) {\n $rows = array();\n\n //number of day in the month selected according to the year\n $nbreOfDay = date(\"t\",mktime(0,0,0,$month,1,$year));\n\n $todoMonth = 0;\n $doneMonth = 0;\n $overTimeMonth = 0;\n $timeCode = array();\n\n /*\n * Representaiton of the array to be displayed\n * line['date'] => date of the current day\n * line['sign'] => liste of the booking for the current day\n */\n\n for($day=1; $day<=$nbreOfDay;$day++)\n {\n // create a line\n $line = array();\n\n //------------------------------- DATE ---------------------------------------------------------------------------------------------------\n // create the date\n $date = $year.\"-\".$month.\"-\".$day;\n $line['date'] = $date;\n\n //------------------------------- BOOKINGS -----------------------------------------------------------------------------------------------\n $bookingsDay = $employee->getBookingsDay($day, $month, $year);\n\n // when 4 bookings are displayed, add a new line\n $index_br = 1;\n\n foreach($bookingsDay as $b) {\n\n // add an * if the booking was modified by hand\n if($b['internet'] == 1) $line['sign'].= \"*\";\n\n $inout = $employee->isBookingIn($b) ? Prado::localize(\"in\") : Prado::localize(\"out\");\n\n $line['sign'] .= substr($b['roundBooking'],0,5).\"/\".$inout.\"&nbsp;&nbsp;&nbsp;\";\n\n if($index_br % 4 == 0) $line['sign'] .= \"<br/>\";\n\n $index_br++;\n }\n\n if(substr($line['sign'],-5,5) == \"<br/>\")\n $line['sign'] = substr($line['sign'], 0, strlen($line['sign'])-5);\n\n //------------------------------- TIME TO DO -----------------------------------------------------------------------------------------\n\n $todo = $employee->getDayTodo($day, $month, $year);\n if($todo == 0)\n $line['todo'] = '';\n else {\n $line['todo'] = sprintf(\"%.02f\",$todo);\n $todoMonth = bcadd($todoMonth, $todo,4);\n }\n\n //------------------------------- TIME DONE -----------------------------------------------------------------------------------------\n\n $done = $employee->getDayDone($day, $month, $year);\n if($done['done'] == 0)\n $line['done'] = '';\n else {\n $line['done'] = sprintf(\"%.02f\",$done['done']);\n $doneMonth = bcadd($doneMonth, $done['done'],4);\n }\n\n if($done['compensation'] > 0) {\n $tc['timecodeName'] = $done['timecodeName'];\n $tc['compensation'] = bcadd($timeCode[$done['timecodeId']]['compensation'], $done['compensation'],4);\n $timeCode[$done['timecodeId']] = $tc;\n\n }\n\n //------------------------------- OVERTIME -----------------------------------------------------------------------------------------\n\n $overtime = bcsub($done['done'],$todo,4);\n if($overtime == 0)\n $line['overtime'] = '';\n else {\n $line['overtime'] = sprintf(\"%.02f\",$overtime);\n $overTimeMonth = bcadd($overTimeMonth, $overtime,4);\n }\n\n //------------------------------- REMARKS -----------------------------------------------------------------------------------------\n\n $isNWD = false;\n //inform when it is a non working day\n if($employee->isNonWorkingDay($day, $month, $year) && $employee->isWorking($year, $month, $day)) {\n if($line['remark'] != '') $line['remark'].=\"<br>\";\n\n $line['remark'] .= Prado::localize('Non working day');\n $isNWD = true;\n }\n\n $bookingIn = 0;\n $bookingOut = 0;\n //inform when the booking is a special time code\n foreach($bookingsDay as $b) {\n\n if($employee->isBookingIn($b))\n $bookingIn++;\n else\n $bookingOut++;\n\n if($employee->isSpecialTimeCode($b))\n {\n if($line['remark'] != '') $line['remark'].=\"<br>\";\n if($employee->isBookingIn($b))\n {\n $line['remark'].= '&larr; ';\n $line['remark'].= substr($b['roundBooking'],0,5).\" \".$employee->getBookingTimeCode($b);\n }\n else\n {\n $line['remark'].= '&rarr; ';\n $line['remark'].= substr($b['roundBooking'],0,5).\" \".$employee->getBookingTimeCode($b);\n\n }\n }\n\n }\n\n $isMiddleNwd = false;\n //check if the day is a absent request\n $requests = $employee->getDayRequest($day, $month, $year);\n\n if($requests && !$isNWD && $employee->isWorking($year, $month, $day)) {\n foreach($requests as $request) {\n if($request['period'] === 'allday')\n {\n if($line['remark'] != '') $line['remark'].=\"<br>\";\n $line['remark'] .= $request['name'];\n }\n elseif($request['period'] === 'morning')\n {\n if($line['remark'] != '') $line['remark'].=\"<br>\";\n $line['remark'] .= $request['name'].' / '.Prado::localize('morning');\n }\n elseif($request['period'] === 'afternoon')\n {\n if($line['remark'] != '') $line['remark'].=\"<br>\";\n $line['remark'] .= $request['name'].' / '.Prado::localize('afternoon');\n }\n }\n }\n\n // check the missing bookings\n if(count($bookingsDay) % 2 > 0)\n {\n if($line['remark'] != '') $line['remark'].=\"<br>\";\n $line['remark'] .= \"<span style=\\\"color:red\\\">\".Prado::localize('Signing missing').\"</span>\";\n }\n else {\n // check the error booking\n if($bookingIn != $bookingOut)\n {\n if($line['remark'] != '') $line['remark'].=\"<br>\";\n $line['remark'] .= \"<span style=\\\"color:red\\\">\".Prado::localize('Signing error').\"</span>\";\n } else {\n\n $nextB = 'IN';\n foreach($bookingsDay as $b) {\n $type = $employee->isBookingIn($b) ? 'IN' : 'OUT';\n\n if($type != $nextB) {\n if($line['remark'] != '') $line['remark'].=\"<br>\";\n $line['remark'] .= \"<span style=\\\"color:red\\\">\".Prado::localize('Signing error').\"</span>\";\n break;\n }\n\n $nextB = $nextB == 'IN' ? 'OUT' : 'IN';\n }\n\n }\n }\n\n if($minBreak = $employee->isBreakOk($bookingsDay))\n {\n if($line['remark'] != '') $line['remark'].=\"<br>\";\n $line['remark'] .= \"<span style=\\\"color:red\\\">\".$minBreak.\" \".Prado::localize('min. for the break are required').\"</span>\";\n }\n\n\n // add a line in the rows\n $rows[] = $line;\n\n }\n\n //------------------------------- RESUME TIME -----------------------------------------------------------------------------------------\n\n if($todoMonth>0)\n $this->hoursDue = sprintf(\"+%.02f\",$todoMonth);\n elseif($todoMonth<0 || $todoMonth==0)\n $this->hoursDue = sprintf(\"%.02f\",$todoMonth);\n\n if($doneMonth>0)\n $this->signed = sprintf(\"+%.02f\",$doneMonth);\n elseif($doneMonth<0 || $doneMonth==0)\n $this->signed = sprintf(\"%.02f\",$doneMonth);\n\n $this->overTimeMonth = $overTimeMonth;\n\n\n if($overTimeMonth>0)\n $this->balanceForTheMonth = sprintf(\"+%.02f\",$overTimeMonth);\n elseif($overTimeMonth<0 || $overTimeMonth==0)\n $this->balanceForTheMonth = sprintf(\"%.02f\",$overTimeMonth);\n\n $overTimeLastMonth = $employee->getOvertimeLastMonth($month, $year);\n $this->overTimeLastMonth = $overTimeLastMonth;\n if($overTimeLastMonth>0)\n $this->lastMonth = sprintf(\"+%.02f\",$overTimeLastMonth);\n elseif($overTimeLastMonth<0 || $overTimeLastMonth==0)\n $this->lastMonth = sprintf(\"%.02f\",$overTimeLastMonth);\n\n $solde = bcadd($overTimeLastMonth,$overTimeMonth,4);\n\n $overtTimeActivityCounter = $employee->getActivityCounter($year, $month, $employee->getDefaultOvertimeCounter() );\n\n if($overtTimeActivityCounter != 0) {\n $solde = bcadd($solde, $overtTimeActivityCounter, 4);\n }\n\n if($solde>0) {\n if($overtTimeActivityCounter != 0)\n $this->balances = sprintf(\"* +%.02f\",$solde);\n else\n $this->balances = sprintf(\"+%.02f\",$solde);\n }\n elseif($solde<0 || $solde==0) {\n if($overtTimeActivityCounter != 0)\n $this->balances = sprintf(\"* %.02f\",$solde);\n else\n $this->balances = sprintf(\"%.02f\",$solde);\n }\n\n\n //------------------------------- RESUME HOLIDAYS -----------------------------------------------------------------------------------------\n\n //Balance of holiday fot the last year\n $balanceHolidaysLastYear = $employee->geHolidaystMonth($year-1,12);\n $this->balanceHolidaysLastYear = sprintf(\"%.02f\",$balanceHolidaysLastYear);\n\n\n // compute in this way when the 12 month of the last year is not closed\n\n if(!$employee->isLastMonthLastYeatClosed($year)) {\n $wt = $employee->getWorkingTime(1, $month, $year);\n\n // get the holiday for this month\n $defaultHolidayTimeCode = $employee->getDefaultHolidaysCounter();\n \n for($i=1; $i<$month ;$i++) {\n $holidays = $employee->getRequest($year,$i,$defaultHolidayTimeCode); \n $wt['holidaysByYear'] = bcsub($wt['holidaysByYear'], $holidays['nbre'],4);\n }\n\n $this->holidayForTheYear = sprintf(\"%.02f\",$wt['holidaysByYear']);\n\n\n $holidaysLastMonth = bcadd($wt['holidaysByYear'],$balanceHolidaysLastYear,4);\n if($holidaysLastMonth>0)\n $this->holidaysLastMonth = sprintf(\"+%.02f\",$holidaysLastMonth);\n elseif($holidaysLastMonth<0 || $holidaysLastMonth==0)\n $this->holidaysLastMonth = sprintf(\"%.02f\",$holidaysLastMonth);\n\n\n $holidays = $employee->getRequest($year,$month,$defaultHolidayTimeCode);\n if($holidays['nbre']>0)\n $this->holidaysThisMonth = sprintf(\"-%.02f\",$holidays['nbre']);\n elseif($holidays['nbre']==0)\n $this->holidaysThisMonth = sprintf(\"%.02f\",$holidays['nbre']);\n\n\n $holidayActivityCounter = $employee->getActivityCounter($year, $month, $employee->getDefaultHolidaysCounter() );\n $holidaysTotal = bcsub($holidaysLastMonth,$holidays['nbre'],4);\n\n if($holidaysTotal>0) {\n if($holidayActivityCounter)\n $this->holidaysTotal = sprintf(\"* +%.02f\",$holidaysTotal);\n else\n $this->holidaysTotal = sprintf(\"+%.02f\",$holidaysTotal);\n }\n elseif($holidaysTotal<0 || $holidaysTotal==0) {\n if($holidayActivityCounter)\n $this->holidaysTotal = sprintf(\"* %.02f\",$holidaysTotal);\n else\n $this->holidaysTotal = sprintf(\"%.02f\",$holidaysTotal);\n }\n\n } else {\n\n $holidaysTotal = $employee->geHolidaystMonth($year,$month);\n\n $holidayActivityCounter = $employee->getActivityCounter($year, $month, $employee->getDefaultHolidaysCounter() );\n\n\n if($holidaysTotal>0) {\n if($holidayActivityCounter)\n $this->holidaysTotal = sprintf(\"* +%.02f\",$holidaysTotal);\n else\n $this->holidaysTotal = sprintf(\"+%.02f\",$holidaysTotal);\n }\n elseif($holidaysTotal<0 || $holidaysTotal==0) {\n if($holidayActivityCounter)\n $this->holidaysTotal = sprintf(\"* %.02f\",$holidaysTotal);\n else\n $this->holidaysTotal = sprintf(\"%.02f\",$holidaysTotal);\n }\n\n // get the holiday for this month\n $defaultHolidayTimeCode = $employee->getDefaultHolidaysCounter();\n $holidays = $employee->getRequest($year,$month,$defaultHolidayTimeCode);\n\n if($holidays['nbre']>0)\n $this->holidaysThisMonth = sprintf(\"-%.02f\",$holidays['nbre']);\n elseif($holidays['nbre']==0)\n $this->holidaysThisMonth = sprintf(\"%.02f\",$holidays['nbre']);\n\n $holidaysLastMonth = $holidaysTotal + $holidays['nbre'];\n\n // display the value\n if($holidaysLastMonth>0)\n $this->holidaysLastMonth = sprintf(\"+%.02f\",$holidaysLastMonth);\n elseif($holidaysLastMonth<0 || $holidaysLastMonth==0)\n $this->holidaysLastMonth = sprintf(\"%.02f\",$holidaysLastMonth);\n\n\n $this->holidayForTheYear = sprintf(\"%.02f\",$this->holidaysLastMonth - $balanceHolidaysLastYear);\n }\n\n\n /*//Balance of holiday fot the last year\n $balanceHolidaysLastYear = $employee->geHolidaystMonth($year-1,12);\n $this->balanceHolidaysLastYear = sprintf(\"%.02f\",$balanceHolidaysLastYear);\n\n\n $holidaysTotal = $employee->geHolidaystMonth($year,$month);\n\n $holidayActivityCounter = $employee->getActivityCounter($year, $month, $employee->getDefaultHolidaysCounter() );\n\n\n if($holidaysTotal>0) {\n if($holidayActivityCounter)\n $this->holidaysTotal = sprintf(\"* +%.02f\",$holidaysTotal);\n else\n $this->holidaysTotal = sprintf(\"+%.02f\",$holidaysTotal);\n }\n elseif($holidaysTotal<0 || $holidaysTotal==0) {\n if($holidayActivityCounter)\n $this->holidaysTotal = sprintf(\"* %.02f\",$holidaysTotal);\n else\n $this->holidaysTotal = sprintf(\"%.02f\",$holidaysTotal);\n }\n\n // get the holiday for this month\n $defaultHolidayTimeCode = $employee->getDefaultHolidaysCounter();\n $holidays = $employee->getRequest($year,$month,$defaultHolidayTimeCode);\n\n if($holidays['nbre']>0)\n $this->holidaysThisMonth = sprintf(\"-%.02f\",$holidays['nbre']);\n elseif($holidays['nbre']==0)\n $this->holidaysThisMonth = sprintf(\"%.02f\",$holidays['nbre']);\n\n\n $holidaysLastMonth = $holidaysTotal + $holidays['nbre'];\n\n // display the value\n if($holidaysLastMonth>0)\n $this->holidaysLastMonth = sprintf(\"+%.02f\",$holidaysLastMonth);\n elseif($holidaysLastMonth<0 || $holidaysLastMonth==0)\n $this->holidaysLastMonth = sprintf(\"%.02f\",$holidaysLastMonth);\n\n\n $this->holidayForTheYear = sprintf(\"%.02f\",$this->holidaysLastMonth - $balanceHolidaysLastYear);*/\n\n\n\n\n\n\n //------------------------------- RESUME NON WORKING DAY -------------------------------------------------------------------------\n\n\n $nonWorkingDay = $employee->getAllNonWorkingDay($year, $month);\n if($nonWorkingDay>0)\n $this->nonworkingday = sprintf(\"%.02f\",$nonWorkingDay);\n elseif($nonWorkingDay==0)\n $this->nonworkingday = sprintf(\"%.02f\",$nonWorkingDay);\n\n\n // number of n.w.d. until the end of the year\n $this->nonworkingdayendofyear = sprintf(\"%.02f\",$employee->getNonWorkingDayEndOfYear($month,$year));\n\n\n //------------------------------- RESUME OTHER REQUEST -------------------------------------------------------------------------\n\n $absences = $employee->getMonthAbsence($month, $year);\n\n foreach($timeCode as $k=>$v) {\n for($i=0; $i< count($absences); $i++) {\n if($absences[$i]['name'] == $v['timecodeName'] ) {\n if($absences[$i]['disp'] == 'day') {\n //convert in day\n $v['compensation'] = bcdiv($v['compensation'],$employee->getHoursByDay($month, $year),4);\n $absences[$i]['nbre'] = bcadd($absences[$i]['nbre'],$v['compensation'],4);\n } else {\n $absences[$i]['nbre'] = bcadd($absences[$i]['nbre'],$v['compensation'],4);\n }\n }\n }\n }\n\n $tc = array();\n foreach($absences as $v)\n {\n $disp = $v['disp'] == 'day' ? Prado::localize('days') : Prado::localize('hours');\n if($v['nbre']>0) {\n $tc[] = array('name'=>$v['name'], 'value'=>sprintf(\"%.02f $disp\",$v['nbre']) );\n }\n }\n\n\n $ac = $employee->getAllActivityCounter($year,$month);\n\n foreach($ac as $v) {\n $disp = $v['formatDisplay'] == 'day' ? Prado::localize('days') : Prado::localize('hours');\n $remark = $v['remark'];\n $tc[] = array('name'=>$v['name'], 'value'=>sprintf(\"%.02f $disp / $remark\",$v['nbre']) );\n }\n\n $this->TimeCode=$tc;\n\n return $rows;\n }", "public function fetchNextPage(&$last_page) {\n\n\t\tif (!$this->from_date || !$this->to_date) {\n\t\t\tthrow new \\Exception(get_class($this) . ': you have to call setDate or setDateRange before you can fetch any data');\n\t\t}\n\n\t\t$transactions = $this->mapTransactionData($this->soap_client->getFullEarnings(\n\t\t\t$this->from_date->toDateString(),\n\t\t\t$this->to_date->toDateString(),\n\t\t\t$this->conf['campaignId'],\n\t\t\t$this->conf['login'],\n\t\t\t$this->conf['password']\n\t\t));\n\n\t\t$last_page = true;\n\n\t\treturn $transactions;\n\t}", "public function chartBarDataByEventsByMonthByFundingSource($meeting_nodes = array(), $by_event = TRUE, $step = 1) {\n $output = [];\n\n $meeting_nodes_by_fundingSource = array_values(\\Drupal::service('ngdata.node.meeting')\n ->meetingNodesByStandardTermWithNodeField($meeting_nodes, 'fundingsource', 'field_meeting_fundingsource'));\n\n foreach ($meeting_nodes_by_fundingSource as $key => $row) {\n $month_num = array();\n for ($j = 1; $j < 13; $j += $step) {\n $months = array($j);\n if ($step == 3) {\n $months = array($j, $j + 1, $j + 2);\n }\n\n $meeting_nodes_by_month = \\Drupal::getContainer()->get('flexinfo.querynode.service')->meetingNodesByMonth($row, $months);\n\n if ($by_event) {\n $month_num[] = count($meeting_nodes_by_month);\n }\n else {\n $month_num[] = array_sum(\n \\Drupal::getContainer()->get('flexinfo.field.service')\n ->getFieldFirstValueCollection($meeting_nodes_by_month, 'field_meeting_signature')\n );\n }\n }\n\n $color = \\Drupal::getContainer()->get('baseinfo.setting.service')->colorPlateLineChartOne($key + 1, TRUE);\n $output[] = array(\n \"backgroundColor\" => $color,\n \"borderColor\" => $color,\n \"pointColor\" => $color,\n \"data\" => $month_num,\n );\n }\n\n return $output;\n }", "public static function getReportOfThisMonth ( ) {\n\n $query = Movement::query();\n\n // [1] SELECT sum(quantity), type\n\n $query = $query -> select(\n 'type',\n DB::raw('SUM(quantity) as quantity')\n );\n\n // [2] WHERE createdDate BETWEEN ...\n\n $query = $query -> where(DB::raw('YEAR(createdDate)'),'=',date('Y'));\n\n // [3] WHERE MONTH(createdDate) = $month\n\n $query = $query -> where(DB::raw('MONTH(createdDate)'),'=',date('m'));\n\n // [4] GROUP BY type\n\n $query = $query -> groupBy('type');\n\n $reportOfMonth = $query -> get();\n\n return $reportOfMonth;\n }", "public static function get_transactions()\n\t{\n\t\tglobal $user_ID;\n\t\t\n\t\t$args = array(\n\t\t\t'posts_per_page'\t=> -1,\n\t\t\t'post_type'\t\t\t=> 'pxp_transactions',\n\t\t\t'post_status'\t\t=> 'private',\n\t\t\t'order'\t\t\t\t=> 'date',\n\t\t\t'orderby'\t\t\t=> 'ASC',\n\t\t\t'author'\t\t\t=> $user_ID\n\t\t);\n\n\t\t$query = get_posts( $args );\n\t\t\n\t\t$transactions = array();\n\t\t\n\t\tforeach( $query as $transaction )\n\t\t{\n\t\t\t$transactions[] = array(\n\t\t\t\t'ID'\t\t\t\t\t\t=> $transaction->ID,\n\t\t\t\t'transaction_description'\t=> $transaction->post_content,\n\t\t\t\t'transaction_date'\t\t\t=> date( 'F j, Y g:i A', strtotime( $transaction->post_date ) ),\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $transactions;\n\t}", "public function GetExpertTransactions(){\n\t\tif($this->IsLoggedIn('cashier')){\n\t\t\tif(isset($_GET) && !empty($_GET)){\n\t\t\t\t$where=array(\n\t\t\t\t\t'from_date'\t=>$_GET['from_date'],\n\t\t\t\t\t'to_date'\t\t=> $_GET['to_date']\n\t\t\t\t);\n\t\t\t\t\t$data=$this->CashierModel->GetExpertTransactions($where);\n\t\t\t\t\t$this->ReturnJsonArray(true,false,$data['res_arr']);\n die;\n\t\t\t}else{\n\t\t\t\t$this->ReturnJsonArray(false,true,\"Wrong Method!\");\n\t\t\t\tdie;\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t\telse{\n\t\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t}\n\t}", "public function chart($enf)\n {\n $enfant = Enfant::where('id_enfant',$enf)->first();\n //chart month\n\n $data = DB::table('seancetraitements')\n ->select(\n DB::raw('MAX(note) as sums'),\n\n DB::raw('Month(created_at)as month' ))\n ->where('enfant_id','=',$enf)\n ->groupby(DB::raw('Month(created_at)' ))\n ->get();\n //$k= date(\"F\", mktime(0, 0, 0, date, 1));\n $array[] = ['', 'تقييم'];\n foreach($data as $key => $value)\n {\n\n $array[++$key] = [(string)$value->month,(int) $value->sums];\n }\n\n//DATE_FORMAT(created_at,'%M')as date\n\n //chart janfier\n $datadatejanvier = DB::table('seancetraitements')\n ->select(\n DB::raw('note as sums'),\n\n DB::raw(\"DATE_FORMAT(created_at,'%D')as datejanvier\"))\n ->where('enfant_id','=',$enf)\n ->where( DB::raw('Month(created_at)' ),'=','1' )\n\n ->get();\n //$k= date(\"F\", mktime(0, 0, 0, date, 1));\n $arraydatejanvier[] = ['شهر جانفي', 'تقييم'];\n foreach($datadatejanvier as $key => $value)\n {\n\n $arraydatejanvier[++$key] = [(string)$value->datejanvier,(int) $value->sums];\n }\n //chart fivrier\n $datadatefivrier = DB::table('seancetraitements')\n ->select(\n DB::raw('note as sums'),\n\n DB::raw(\"DATE_FORMAT(created_at,'%D')as datefivrier\"))\n ->where('enfant_id','=',$enf)\n ->where( DB::raw('Month(created_at)' ),'=','2' )\n\n ->get();\n //$k= date(\"F\", mktime(0, 0, 0, date, 1));\n $arraydatefivrier[] = ['شهر فيفري', 'تقييم'];\n foreach($datadatefivrier as $key => $value)\n {\n\n $arraydatefivrier[++$key] = [(string)$value->datefivrier,(int) $value->sums];\n }\n //chart mars\n $datadatemars = DB::table('seancetraitements')\n ->select(\n DB::raw('note as sums'),\n\n DB::raw(\"DATE_FORMAT(created_at,'%D')as datemars\"))\n ->where('enfant_id','=',$enf)\n ->where( DB::raw('Month(created_at)' ),'=','3' )\n\n ->get();\n //$k= date(\"F\", mktime(0, 0, 0, date, 1));\n $arraydatemars[] = ['شهر مارس', 'تقييم'];\n foreach($datadatemars as $key => $value)\n {\n\n $arraydatemars[++$key] = [(string)$value->datemars,(int) $value->sums];\n }\n //chart avril\n $datadateavril = DB::table('seancetraitements')\n ->select(\n DB::raw('note as sums'),\n\n DB::raw(\"DATE_FORMAT(created_at,'%D')as dateavril\"))\n ->where('enfant_id','=',$enf)\n ->where( DB::raw('Month(created_at)' ),'=','4' )\n\n ->get();\n //$k= date(\"F\", mktime(0, 0, 0, date, 1));\n $arraydateavril[] = ['شهر افريل', 'تقييم'];\n foreach($datadateavril as $key => $value)\n {\n\n $arraydateavril[++$key] = [(string)$value->dateavril,(int) $value->sums];\n }\n //chart MAI\n $datadatemai = DB::table('seancetraitements')\n ->select(\n DB::raw('note as sums'),\n\n DB::raw(\"DATE_FORMAT(created_at,'%D')as datemai\"))\n ->where('enfant_id','=',$enf)\n ->where( DB::raw('Month(created_at)' ),'=','5' )\n\n ->get();\n //$k= date(\"F\", mktime(0, 0, 0, date, 1));\n $arraydatemai[] = ['شهر ماي', 'تقييم'];\n foreach($datadatemai as $key => $value)\n {\n\n $arraydatemai[++$key] = [(string)$value->datemai,(int) $value->sums];\n }\n //chart septembre\n $datadateseptember = DB::table('seancetraitements')\n ->select(\n DB::raw('note as sums'),\n\n DB::raw(\"DATE_FORMAT(created_at,'%D')as dateseptember\"))\n ->where('enfant_id','=',$enf)\n ->where( DB::raw('Month(created_at)' ),'=','9' )\n\n ->get();\n //$k= date(\"F\", mktime(0, 0, 0, date, 1));\n $arraydateseptember[] = ['شهر سبتمبر', 'تقييم'];\n foreach($datadateseptember as $key => $value)\n {\n\n $arraydateseptember[++$key] = [(string)$value->dateseptember,(int) $value->sums];\n }\n //chart october\n $datadateoctober = DB::table('seancetraitements')\n ->select(\n DB::raw('note as sums'),\n\n DB::raw(\"DATE_FORMAT(created_at,'%D')as dateoctober\"))\n ->where('enfant_id','=',$enf)\n ->where( DB::raw('Month(created_at)' ),'=','10' )\n\n ->get();\n //$k= date(\"F\", mktime(0, 0, 0, date, 1));\n $arraydateoctober[] = ['شهر أكتوبر', 'تقييم'];\n foreach($datadateoctober as $key => $value)\n {\n\n $arraydateoctober[++$key] = [(string)$value->dateoctober,(int) $value->sums];\n }\n //chartnovember\n $datadatenovember = DB::table('seancetraitements')\n ->select(\n DB::raw('note as sums'),\n\n DB::raw(\"DATE_FORMAT(created_at,'%D')as datenovember\"))\n ->where('enfant_id','=',$enf)\n ->where( DB::raw('Month(created_at)' ),'=','11' )\n\n ->get();\n //$k= date(\"F\", mktime(0, 0, 0, date, 1));\n $arraydatenovember[] = ['شهر نوفمبر', 'تقييم'];\n foreach($datadatenovember as $key => $value)\n {\n\n $arraydatenovember[++$key] = [(string)$value->datenovember,(int) $value->sums];\n }\n //chartdecember\n $datadatedecember = DB::table('seancetraitements')\n ->select(\n DB::raw('note as sums'),\n\n DB::raw(\"DATE_FORMAT(created_at,'%D')as datedecember\"))\n ->where('enfant_id','=',$enf)\n ->where( DB::raw('Month(created_at)' ),'=','12' )\n\n ->get();\n //$k= date(\"F\", mktime(0, 0, 0, date, 1));\n $arraydatedecember[] = ['شهر ديسمبر', 'تقييم'];\n foreach($datadatedecember as $key => $value)\n {\n\n $arraydatedecember[++$key] = [(string)$value->datedecember,(int) $value->sums];\n }\n\n\n\n $datadateyear = DB::table('seancetraitements')\n ->select(\n DB::raw('MAX(note) as sums'),\n\n DB::raw(\"DATE_FORMAT(created_at,'%Y')as dateyear\"))\n ->where('enfant_id','=',$enf)\n ->groupby('dateyear' )\n ->get();\n $arraydateyear[] = ['عام', 'تقييم'];\n foreach($datadateyear as $key => $value)\n {\n $arraydateyear[++$key] = [(string)$value-> dateyear,(int) $value->sums];\n }\n\n return view('pagetraitant.seancetraitements.chart',compact('enfant'))->with('month', json_encode($array))->with('datejanvier', json_encode($arraydatejanvier))->with('datefivrier', json_encode($arraydatefivrier))->with('datemars', json_encode($arraydatemars))->with('dateavril', json_encode($arraydateavril))->with('datemai', json_encode($arraydatemai))->with('datedecember', json_encode($arraydatedecember))->with('datenovember', json_encode($arraydatenovember))->with('dateoctober', json_encode($arraydateoctober))->with('dateseptember', json_encode($arraydateseptember))->with('dateyear', json_encode($arraydateyear));\n }", "public function getBuyerHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $buyer = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($dateQuery.',count(distinct buyer_id)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['buyer'] = $buyer;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function index()\n\t{\n\t\t\n\t$today_users = Trains_reservation::whereDate('created_at', today())->count()+Planes_reservation::whereDate('created_at', today())->count();\n\t$yesterday_users = Trains_reservation::whereDate('created_at', today()->subDays(1))->count()+Planes_reservation::whereDate('created_at', today()->subDays(1))->count();\n\t$users_2_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(2))->count()+Planes_reservation::whereDate('created_at', today()->subDays(2))->count();\n\t$users_3_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(3))->count()+Planes_reservation::whereDate('created_at', today()->subDays(3))->count();\n\t$users_4_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(4))->count()+Planes_reservation::whereDate('created_at', today()->subDays(4))->count();\n\t$users_5_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(5))->count()+Planes_reservation::whereDate('created_at', today()->subDays(5))->count();\n\t$users_6_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(6))->count()+Planes_reservation::whereDate('created_at', today()->subDays(6))->count();\n\t$users_7_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(7))->count()+Planes_reservation::whereDate('created_at', today()->subDays(7))->count();\n\t$chart = new SampleChart;\n\t$chart->labels(['Tujuh hari lalu','Enam hari lalu','Lima hari lalu','Empat hari lalu','Tiga hari lalu','Dua hari lalu', 'Kemarin', 'Hari Ini']);\n\t$chart->dataset('Laporan Transaksi', 'line', [$users_7_days_ago,$users_6_days_ago,$users_5_days_ago,$users_4_days_ago,$users_3_days_ago,$users_2_days_ago, $yesterday_users, $today_users]);\n\t\treturn view('laporan.hari',compact('chart'));\n\t}", "public function getPriorMonthData($store_id = 0) {\n\t\t// $startMonth = 1;\n\t\t// $startYear = 2017;\n\t\t// $endMonth = 1;\n\t\t// $endYear = 2017;\n\t\t// return $this->getDataByInterval($startMonth, $startYear, $endMonth, $endYear,$store_id);\n\t\t$dates = getPeriods('PriorMonth');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear'],$store_id);\n\t}", "private function grab_data(){\n\t\t$y=0;\n\t\tfor($i=$this->startingmonth;$i>=0;$i--){\n\t\t\t$this->searchmonth = date(\"n\")-$i;\n\t\t\t$this->searchyear = date(\"Y\");\n\t\t\tif(0 >= $this->searchmonth){\n\t\t\t\twhile(0 >= $this->searchmonth){\n\t\t\t\t\t$this->searchmonth += 12;\n\t\t\t\t\t$this->searchyear--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->count_chrono_records();\n\t\t\t$this->monthlyrecordvolume[$i] = intval($this->volume_of_records_in_timerange);\n\t\t\tif(0==$this->max_month_value or $this->monthlyrecordvolume[$i] > $this->max_month_value){\n\t\t\t\t$this->max_month_value = $this->monthlyrecordvolume[$i];\n\t\t\t}\n\t\t\t$this->monthaggregator += $this->monthlyrecordvolume[$i];\n\t\t\t\n\t\t\t$this->count_months_recorded_this_year++;\n\t\t\tif(12 == $this->searchmonth or 0 == $i ){\n\t\t\t\t$this->ave_this_year[$y]['volume'] = intval($this->monthaggregator / $this->count_months_recorded_this_year);\n\t\t\t\t$this->ave_this_year[$y]['month'] = $i;\n\t\t\t\t$this->ave_this_year[$y]['year'] = $this->searchyear;\n\t\t\t\t$this->monthaggregator = 0;\n\t\t\t\t$this->count_months_recorded_this_year = 0;\n\t\t\t\t$y++;\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}", "function get_inventory_data($month,$year) {\r\n\t\t\r\n\t\t$query = \"SELECT category, MONTH(auction_date) AS month, YEAR(auction_date) as year,\r\n\t\tSUM(pre_tax_amount) as pre_tax_amount, SUM(tax_amount) AS tax_amount FROM $table_name\r\n\t\tWHERE MONTH(auction_date)=:month AND YEAR(auction_date)=:year\r\n\t\tGROUP BY category ORDER BY category ASC\";\r\n\t\t\r\n\t\t$result = $this->execute_query($query,array(\":year\"=>$year,\":month\"=>$month));\t\r\n\t\t\r\n\t\tif($result === FALSE ) { $this->error_log[] = \"Error or empty result while calling \".__FUNCTION__; return FALSE; }\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $result;\t\r\n\t\t}\r\n\t}", "public function getLastOnlineTotalMonthPaginate()\n {\n $today = Carbon::now()->toDateString();\n $timezone = new Carbon();\n $last_thirty_days = $timezone->subDays(30);\n\n return $this->appUser->whereBetween('last_online_date', array($last_thirty_days, $today))->orderByRaw(\"FIELD(status , 'Approved', 'Disabled', 'Blocked') ASC\")->paginate();\n }", "public function getSentraData($query)\n {\n // config\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n\n $data = array();\n $data['granularity'] = $granularity;\n\n DB::enableQueryLog();\n // execute\n // TRANSACTION DATA\n // transaction count\n $currentTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('count(*)'))\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n $prevTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('count(*)'))\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n\n // total transaction value\n $currentTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n $prevTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n // transaction status\n $transactionStatus = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('orderline_statuses.name, count(*)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy('orderline_statuses.name')\n ->orderByRaw('count desc')\n ->get();\n\n $transactionHistory = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw($query['aggregate'].'as value, count(*),'.$dateQuery))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n // TRANSACTION\n $data['transaction'] = array();\n $data['transaction']['count'] = array();\n $data['transaction']['count']['current'] = $currentTransactionCount[0];\n $data['transaction']['count']['prev'] = $prevTransactionCount[0];\n $data['transaction']['value'] = array();\n $data['transaction']['value']['current'] = $currentTransactionValue[0];\n $data['transaction']['value']['prev'] = $prevTransactionValue[0];\n $data['transaction']['history'] = $transactionHistory;\n $data['transaction']['status'] = $transactionStatus;\n \n // BUYER\n $currentBuyers = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->distinct('buyer_id')\n ->count('buyer_id');\n\n $prevBuyers = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->distinct('buyer_id')\n ->count('buyer_id');\n\n $buyerHistory = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw($dateQuery.',count(distinct buyer_id)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data['buyer'] = array();\n $data['buyer']['count'] = array();\n $data['buyer']['count']['current'] = $currentBuyers;\n $data['buyer']['count']['prev'] = $prevBuyers;\n $data['buyer']['history'] = $buyerHistory;\n\n\n // PRODUCT\n $product = DB::connection('marketplace')\n ->table('orderlines')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->join('products', 'orderlines.product_id', '=', 'products.id')\n ->select(DB::raw('products.id, products.name, count(*), sum(quantity) as sums, sum(orderlines.subtotal) as value'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy('products.id')\n ->orderByRaw('sums desc, products.name asc')\n ->limit(5)\n ->get();\n\n for($i=0; $i<count($product); $i++) {\n $countData = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('products', 'orderlines.product_id', '=', 'products.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('products.id', '=', $product[$i]->id)\n ->count();\n if($countData) {\n $prevData = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('products', 'orderlines.product_id', '=', 'products.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('count(*), sum(quantity) as sums, sum(orderlines.subtotal) as value'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('products.id', '=', $product[$i]->id)\n ->get();\n } else {\n $prevData = array();\n }\n if(count($prevData) != 0) {\n $product[$i]->count_change = (string) ($product[$i]->count - $prevData[0]->count);\n $product[$i]->sum_change = (string) ($product[$i]->sums - $prevData[0]->sums);\n $product[$i]->value_change = (string) ($product[$i]->value - $prevData[0]->value);\n } else {\n $product[$i]->count_change = (string) 0;\n $product[$i]->sum_change = (string) 0;\n $product[$i]->value_change = (string) 0;\n }\n }\n\n $data['product'] = $product;\n\n // RATING\n $currentRating = DB::connection('marketplace')\n ->table('ratings')\n ->join('feedbacks', 'ratings.feedback_id', '=', 'feedbacks.id')\n ->join('orderlines', 'feedbacks.orderline_id', '=', 'orderlines.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('round(avg(value), 2) as rating'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n $prevRating = DB::connection('marketplace')\n ->table('ratings')\n ->join('feedbacks', 'ratings.feedback_id', '=', 'feedbacks.id')\n ->join('orderlines', 'feedbacks.orderline_id', '=', 'orderlines.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('round(avg(value), 2) as rating'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n $ratingTrend = DB::connection('marketplace')\n ->table('ratings')\n ->join('feedbacks', 'ratings.feedback_id', '=', 'feedbacks.id')\n ->join('orderlines', 'feedbacks.orderline_id', '=', 'orderlines.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('round(avg(value), 2) as rating,'.$dateQuery))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data['rating'] = array();\n $data['rating']['average']['current'] = $currentRating[0]->rating;\n $data['rating']['average']['prev'] = $prevRating[0]->rating;\n $data['rating']['trend'] = $ratingTrend;\n\n $city = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orders','orderlines.order_id','orders.id')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('orders.buyer_city as name, count(*)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy('orders.buyer_city')\n ->orderByRaw('count desc')\n ->limit(5)\n ->get();\n\n $data['city'] = $city;\n\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]); \n }", "public function getLastStatistics() \n { \n $m = MinerStatistics::where('user_id', auth()->user()->id)\n ->where('created_at','>=', Carbon::now()->subSeconds(90))\n ->get()\n ->groupBy('rigname');\n\n $response = [];\n foreach($m as $miner) {\n $miner = $miner->first();\n $miner->data = json_decode($miner->data);\n $response[] = $miner;\n }\n \n return $response;\n }", "public function chartApiOutput() {\n\n $user = Auth::user();\n $chart = new DataChart();\n $mounthOutput = $this->getQueryChart($user);\n $chart->dataset('Last Mounth output', 'line', $mounthOutput->values())\n ->color('rgb(0,123,255)');;\n return json_decode($chart->api());\n }", "function last_month()\n{\n global $db; // golbalize db variable:\n $thisMonth = array(\n \"start\" => date('Y-m-d', strtotime('first day of last month', strtotime(date('Y-m-d')))),\n \"end\" => date('Y-m-d', strtotime('last day of last month', strtotime(date('Y-m-d'))))\n );\n $datesIds = $db->getMany(DATES, [\n 'date' => $thisMonth['start'],\n 'dates.date' => $thisMonth['end']\n ], ['id', 'date'], ['date' => '>=', 'dates.date' => '<=']);\n\n if ($db->count > 0) {\n return $datesIds;\n }\n}", "public function purchaseSalesInvoiceGraph($financial_month, $financialYearDD, $userId)\r\n\t{\r\n\t\t$invoiceArray=array();\r\n\t\t$invoiceData=array();\r\n\t\t\r\n\t\t$saleInvoice='SELECT count(reference_number) as sales_invoice \r\n\t\tFROM '.$this->tableNames['client_invoice'].'\r\n\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\tand added_by=\"'.$userId.'\"\r\n\t\tand is_deleted=\"0\" \r\n\t\tand is_canceled=\"0\"';\r\n\t\t\r\n\t\t//total purchase invoice\r\n\t\t$purchaseInvoice = 'SELECT count(reference_number) as purchase_invoice \r\n\t\tFROM '.$this->tableNames['client_purchase_invoice'].'\r\n\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\tand added_by=\"'.$userId.'\"\r\n\t\tand is_deleted=\"0\" \r\n\t\tand is_canceled=\"0\"';\r\n\r\n\t\t$totalSalesInvoice = $this->get_row($saleInvoice,false);\r\n\t\t$totalPurchaseInvoice = $this->get_row($purchaseInvoice,false);\r\n\t\t\r\n\t\tif(empty($totalSalesInvoice)) {\r\n\t\t\t$invoiceData['sales'] = \"0\";\r\n\t\t} else {\r\n\t\t\t$invoiceData['sales'] = $totalSalesInvoice[0];\r\n\t\t}\r\n\t\t\r\n\t\tif(empty($totalPurchaseInvoice)) {\r\n\t\t\t$invoiceData['purchase'] = \"0.00\";\r\n\t\t} else {\r\n\t\t\t$invoiceData['purchase'] = $totalPurchaseInvoice[0];\r\n\t\t\t$invoiceData['month'] = $financial_month;\r\n\t\t}\r\n\t\tarray_push($invoiceArray, $invoiceData);\r\n\t\treturn $invoiceArray;\r\n\t}", "public function getDebitData()\n {\n $where = \"(SELECT DATEDIFF(sales_order.`due_date`, '$this->curDate') AS days) < 14 AND sales_order.`status_paid` = 0 AND sales_order.`active` = 1\";\n $this->db->where($where);\n $this->db->from('sales_order');\n $query = $this->db->get();\n\n $data['sum'] = 0;\n $data['count'] = 0;\n\n if ($query->num_rows() > 0) {\n foreach ($query->result() as $row) {\n $data['count']++;\n $data['sum'] += ($row->grand_total - $row->paid);\n }\n }\n return $data;\n }" ]
[ "0.64858806", "0.63189", "0.62106276", "0.60974693", "0.5990626", "0.5970631", "0.5957802", "0.59255177", "0.5884934", "0.58690435", "0.58343613", "0.5818631", "0.5817361", "0.5742855", "0.5735136", "0.5733393", "0.5692241", "0.5644872", "0.56400865", "0.56345624", "0.5621875", "0.5604433", "0.55953956", "0.5594843", "0.5589207", "0.5578993", "0.55483043", "0.5532371", "0.5521011", "0.55160445", "0.55138427", "0.54983455", "0.5479265", "0.5469098", "0.5468449", "0.54641634", "0.54421175", "0.54365075", "0.54030144", "0.538941", "0.5372809", "0.5365036", "0.53644085", "0.5364187", "0.53529656", "0.53466535", "0.5339855", "0.53310615", "0.5320777", "0.53190374", "0.5298203", "0.52883303", "0.5284768", "0.5283467", "0.5279104", "0.527819", "0.52757215", "0.52545047", "0.5235875", "0.5234151", "0.5229866", "0.5228262", "0.52274776", "0.5226371", "0.52230096", "0.52078456", "0.5201037", "0.51924825", "0.51827663", "0.5176693", "0.5165519", "0.51618254", "0.51602113", "0.51586473", "0.5155941", "0.5154098", "0.51507735", "0.5149963", "0.51229876", "0.51173395", "0.5110782", "0.5106927", "0.50967467", "0.5082639", "0.5080116", "0.50743365", "0.50706136", "0.50608516", "0.5060743", "0.505432", "0.50512904", "0.504332", "0.5036738", "0.5030712", "0.5027295", "0.5026866", "0.5025187", "0.50226986", "0.50202405", "0.5017175" ]
0.6270143
2
Get transaction data for graph last year
public function getTransactionDataLastYear($customerId) { $to = $this->_date->date('Y-m-d'); $from = strtotime($to."-1year"); $from = $this->_date->date('Y-m-d', $from); $to .= ' 23:59:59'; $transactionResource = $this->_transactionFactory->create()->getResource(); $result = []; $data = $transactionResource->getReceivedCreditTransactionsByMonth($from, $to, $customerId); $result = $this->_processReceivedTransactionData($data, $result); $data = $transactionResource->getSpentCreditTransactionsByMonth($from, $to, $customerId); $result = $this->_processSpentTransactionData($data, $result); $result = array_values($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLastYearData() {\n\t\t$dates = getPeriods('LastYear');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear'], 12);\t\t\n\t}", "public function TransactionChart(Request $request)\n {\n \t$year = $request->input('year') ? $request->input('year') : date('Y'); \n \t$chartData = DB::table('trans_peryear_view')\n \t\t\t\t->where('year', $year)\n \t\t\t\t->get();\n\n \treturn response()->json(['chartData' => $chartData], 200);\n }", "public function graphData()\n {\n $dayOfWeek = ['Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo'];\n $colors = [\n 'rgba(201, 203, 207, 0.8)', //gray\n 'rgba(255, 99, 132, 0.8)', //Red\n 'rgba(255, 159, 64, 0.8)', //Orange\n 'rgba(75, 192, 192, 0.8)', //green\n 'rgba(54, 162, 235, 0.8)', //blue\n 'rgba(153, 102, 255, 0.8)', //purple\n 'rgba(255, 205, 86, 0.8)', //yellow\n ];\n $borderColors = [\n 'rgba(201, 203, 207, 1)', //gray\n 'rgba(255, 99, 132, 1)', //Red\n 'rgba(255, 159, 64, 1)', //Orange\n 'rgba(75, 192, 192, 1)', //green\n 'rgba(54, 162, 235, 1)', //blue\n 'rgba(153, 102, 255, 1)', //purple\n 'rgba(255, 205, 86, 1)', //yellow\n ];\n $months = ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'];\n $now = Carbon::now()->timezone($this->timezome);\n $data = [];\n\n switch ($this->graphPeriod) {\n case 'weekly':\n $data = $this->getDataFromWeeklySales($colors, $borderColors);\n break;\n case 'weeklyAccumulated':\n $data = $this->getDataFromWeeklySales($colors, $borderColors, true);\n break;\n case 'monthly':\n $labels = [];\n $date = $now->copy()->subMonths(5)->startOfMonth()->startOfDay();\n $end = $now->copy()->endOfDay();\n $count = 0;\n\n for ($i = 1; $i < 32; $i++) {\n $labels[] = $i;\n }\n\n while ($date->lessThanOrEqualTo($end)) {\n $label = $months[$date->month - 1];\n $data = [];\n $endOfMonth = $date->copy()->endOfMonth()->endOfDay();\n $sale = 0;\n\n while ($date->lessThanOrEqualTo($endOfMonth) && $date->lessThanOrEqualTo($end)) {\n $sale += $this->getSumFromGraphPeriod($date, $this->graphCategory);\n $data[] = $sale;\n $date->addDay();\n }\n\n $datasets[] = [\n 'label' => $label,\n 'backgroundColor' => $colors[$count],\n 'borderColor' => $borderColors[$count],\n 'borderWidth' => 1,\n 'data' => $data,\n 'fill' => false\n ];\n\n $count++;\n }\n\n $data = [\n 'labels' => $labels,\n 'datasets' => $datasets,\n 'type' => 'line'\n ];\n break;\n default:\n # code...\n break;\n }\n return $data;\n }", "public function getBlock()\n\t{\n\t\t$chart = new \\IPS\\Helpers\\Chart;\n\t\t\n\t\t$chart->addHeader( \"Day\", 'date' );\n\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t{\n\t\t\t$chart->addHeader( $currency, 'number' );\n\t\t}\n\t\t\n\t\t$thirtyDaysAgo = \\IPS\\DateTime::create()->sub( new \\DateInterval('P30D') );\n\t\t\t\t\n\t\t$results = array();\n\t\tforeach( \\IPS\\Db::i()->select( \"t_currency, DATE_FORMAT( FROM_UNIXTIME( t_date ), '%e %c %Y' ) AS date, SUM(t_amount)-SUM(t_partial_refund) AS amount\", 'nexus_transactions', array( 't_date>? AND (t_status=? OR t_status=?)', $thirtyDaysAgo->getTimestamp(), \\IPS\\nexus\\Transaction::STATUS_PAID, \\IPS\\nexus\\Transaction::STATUS_PART_REFUNDED ), NULL, NULL, array( 't_currency', 'date' ) ) as $result )\n\t\t{\n\t\t\t$results[ $result['date'] ][ $result['t_currency'] ] = $result['amount'];\n\t\t}\n\t\t\t\t\n\t\t$monthAndYear = date( 'n' ) . ' ' . date( 'Y' );\n\t\tforeach ( range( 30, 0 ) as $daysAgo )\n\t\t{\n\t\t\t$datetime = new \\IPS\\DateTime;\n\t\t\t$datetime->setTime( 0, 0, 0 );\n\t\t\t$datetime->sub( new \\DateInterval( 'P' . $daysAgo . 'D' ) );\n\t\t\t$resultString = $datetime->format('j n Y');\n\t\t\t\n\t\t\tif ( isset( $results[ $resultString ] ) )\n\t\t\t{\n\t\t\t\t$row = array( $datetime );\n\t\t\t\t\n\t\t\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t\t\t{\n\t\t\t\t\tif ( !isset( $results[ $resultString ][ $currency ] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$row[] = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$row[] = $results[ $resultString ][ $currency ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$chart->addRow( $row );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$row = array( $datetime );\n\t\t\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t\t\t{\n\t\t\t\t\t$row[] = 0;\n\t\t\t\t}\n\t\t\t\t$chart->addRow( $row );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $chart->render( 'LineChart' );\n\t}", "public function getGraphDataForAnAccount($startDate, $endDate, $acc_id){\n\t\t$result = Transaction::where('account_id', '=', $acc_id)->get();\n\t\t$tset = $result->toArray();\n\t\t$tm = new TransactionManager();\n\t $tset = $tm -> sortTransactionsByDates($tset);\n\t $tset = array_reverse($tset);\n\n\t $graphData = array();\n\t $cDate = $startDate;\n\t $prevBalance = 0;\n\t $transactionBeforeStartExists = false;\n\n\t if(empty($tset))\n\t \treturn array();\n\t \n\t foreach($tset as $t){\n\t \t//if cDate is before startDate, skip \n\t \tif($tm->rawDateCompare($t['date'], $startDate) > 0) {\n\t \t\t$prevBalance += $t['amount'];\n\t \t\t$transactionBeforeStartExists = true;\n\t \t\tcontinue;\n\t \t}\n\t \t//if date is after endDate, skip\n\t \tif($tm->rawDateCompare($t['date'], $endDate) < 0)\n\t \t\tcontinue;\n\t \t//transaction is in range, sum it to graphData\n\t \tif(!array_key_exists($t['date'], $graphData))\n\t \t\t$graphData[$t['date']] = 0;\n\t \t$graphData[$t['date']] += $t['amount'];\n\t }\n\t \n\t //cumulate each data point\n\t $net = $prevBalance;\n\t foreach($graphData as &$g){\n\t \t$net += $g;\n\t \t$g = $net;\n\t }\n\t //all data points betwen sDate and earliest transaction are $prevBalance\n\t $paddingLeft = array();\n\t $paddingRight = array();\n\n\t if($transactionBeforeStartExists){\n\t\t if(!array_key_exists($startDate, $graphData))\n\t\t \t$paddingLeft[$startDate] = $prevBalance;\n\t\t}\n\t if(!array_key_exists($endDate, $graphData))\n\t \t$paddingRight[$endDate] = $net;\t \n\t \n\t //all points between latest transaction and fDate are $net\n\t return array_merge($paddingLeft, $graphData, $paddingRight);\n\t}", "public function getAnnualSales() {\n\t\t// Query\n\t\t$sql = '\n\t\t\tSELECT \n\t\t\t\tDATE_FORMAT(transactionDate, \"%Y\") AS year, \n\t\t\t\tSUM(amount) AS amount\n\t\t\tFROM \n\t\t\t\ttransactions\n\t\t\tGROUP BY \n\t\t\t\tDATE_FORMAT(transactionDate, \"%Y\")\n\t\t';\n\n\t\t// Return\n\t\treturn DB::select($sql);\n\t}", "public function getTransactionDataLast2Years($customerId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-2year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $transactionResource = $this->_transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processReceivedTransactionData($data, $result);\n \n $data = $transactionResource->getSpentCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processSpentTransactionData($data, $result);\n \n $result = array_values($result);\n return $result;\n }", "function getSalesByYear() {\n // Function to connect to the DB\n $link = connectToDB();\n\t\n //Initialize <categories> element\n $strCat = \"<categories>\";\n\n //Initialize datasets\n $strAmtDS = \"<dataset seriesname='Revenue'>\";\n $strQtyDS = \"<dataset seriesName='Units Sold' parentYAxis='S'>\";\n\n $strSQL = \"SELECT Year(o.OrderDate) As SalesYear, ROUND(SUM(d.Quantity*p.UnitPrice),0) As Total, SUM(d.Quantity) as Quantity FROM FC_OrderDetails as d,FC_Orders as o,FC_Products as p WHERE o.OrderID=d.OrderID and d.ProductID=p.ProductID GROUP BY Year(o.OrderDate) ORDER BY Year(o.OrderDate)\";\n $result = mysql_query($strSQL) or die(mysql_error());\n\t\n if ($result) {\n while($ors = mysql_fetch_array($result)) {\n $strCat .= \"<category label='\" . $ors['SalesYear'] . \"'/>\";\n\n //Generate the link\n $strLink = urlencode(\"javaScript:updateCharts(\" . $ors['SalesYear'] . \");\");\n $strAmtDS .= \"<set value='\" . $ors['Total'] . \"' link='\" . $strLink . \"'/>\";\n $strQtyDS .= \"<set value='\" . $ors['Quantity'] . \"'/>\";\n }\n }\n mysql_close($link);\n\n\t//Closing elements\n\t$strCat .= \"</categories>\";\n\t$strAmtDS .= \"</dataset>\";\n\t$strQtyDS .= \"</dataset>\";\n\t//Entire XML - concatenation\n\t$strXML = $strCat . $strAmtDS . $strQtyDS;\n\n\treturn $strXML;\n}", "public function getAmountsDataLastYear($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-1year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getAmountsByMonth($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function getTransactions();", "public function incomeGraphData()\n {\n $incomes = Income::all();\n $channelingIncomes = $incomes->where('incomeable_type', Incomes::CHANNELING_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n $pharmacyIncomes = $incomes->where('incomeable_type', Incomes::PHARMACY_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n\n return ResponseHelper::findSuccess('Income Graph Data', [\n 'channelingIncomeGraphData' => $channelingIncomes,\n 'pharmacyIncomeGraphData' => $pharmacyIncomes,\n ]);\n }", "public function getLatestTrans($sender, $params)\r\n\t{\r\n\t\t$results = $errors = array ();\r\n\t\ttry {\r\n\t\t\t$transactions = Transaction::getAllByCriteria ('trans.organizationId = ?', array(Core::getOrganization()->getId()), true, 1, 10, array ('trans.id' => 'desc') );\r\n\t\t\t$results ['items'] = array();\r\n\t\t\tforeach($transactions as $trans)\r\n\t\t\t\t$results ['items'][] = $trans->getJson();\r\n\t\t} catch ( Exception $ex ) {\r\n\t\t\t$errors [] = $ex->getMessage ();\r\n\t\t}\r\n\t\t$params->ResponseData = StringUtilsAbstract::getJson ( $results, $errors );\r\n\t}", "public function indexgraphyearAd()\n {\n\n // ->elementLabel(\"amout\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->groupBy('name');\n\n // $bills = Bill::where(DB::raw(\"(DATE_FORMAT(update_at,'%Y'))\"),date('Y'))->get();\n // $chart = Charts::database($bills, 'bar', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->groupByMonth(date('Y'), true);\n\n // $data = Bill::where('updated_at', '2018-12-10')->get();\n // $chart = Charts::create('line', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->labels($data->pluck('updated_at'))\n // ->values($data->pluck('sum'));\n\n $chart = Charts::database(Bill::all(), 'bar', 'highcharts')\n ->elementLabel(\"Total\")\n ->dimensions(1000, 500)\n ->responsive(false)\n ->lastByYear(6);\n\n \n\n // $data = BillDetail::all();\n // $chart = Charts::create('line', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->labels($data->pluck('name'))\n // ->values($data->pluck('amout'));\n\n\n // ->template(\"material\")\n // ->dataset('Element 1', [5,20,100])\n // ->dataset('Element 1', [15,30,80])\n // ->dataset('Element 1', [25,10,40])\n // ->labels(['One', 'Two', 'Three']);\n\n return view('adminPharmacy.a_graphyear', ['chart' => $chart]);\n }", "public function getTransactionByHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $transaction = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, count(*),'.$dateQuery))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n // ->toSql();\n ->get();\n // dd ($data);\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['transaction'] = $transaction;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function doctorIncomeGraphData()\n {\n $schedules = Auth::user()->doctor->schedules;\n $channelingIncomeGraphData = Appointment::whereIn('schedule_id', $schedules->pluck('id'))\n ->whereIn('status', [Appointments::PENDING, Appointments::COMPLETED])\n ->get()\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum(function ($appointment) {\n return $appointment->schedule->doctor_fee;\n })\n ];\n })->values()->all();\n $receivedPaymentsGraphData = Expense::whereIn('expensable_id', $schedules->pluck('id'))\n ->get()\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n return ResponseHelper::findSuccess('Items Summary Data', [\n 'channelingIncomeGraphData' => $channelingIncomeGraphData,\n 'receivedPaymentsGraphData' => $receivedPaymentsGraphData,\n ]);\n }", "public function getOrdersDataLastYear($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-1year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getNumOfOrderByMonth($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function getTimeSeries() {\n $series = array();\n foreach($this -> _trades as $trade) {\n \n $month = date('M',$trade['timestamp']);\n if(!isset($series[$month])) {\n $series[$month] = 0;\n }\n if(!empty($trade['delta'])) {\n $series[$month] += $trade['delta'] - (isset($trade['fee']) ? $trade['fee'] : 0);\n }\n }\n return $series;\n }", "public function getTransactionByHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $transaction = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, count(*),'.$dateQuery))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n // ->toSql();\n ->get();\n // dd ($data);\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['transaction'] = $transaction;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function pharmacySalesGraphData()\n {\n $prescriptions = Prescription::whereIn('status',[Prescriptions::PAID_PRESCRIPTION,Prescriptions::ISSUED_PRESCRIPTION])->get();\n $internalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::INTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n $externalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::EXTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n return ResponseHelper::findSuccess('Explorations Data', [\n 'internalPrescriptionsSales' => $internalPrescriptions,\n 'externalPrescriptionsSales' => $externalPrescriptions,\n ]);\n }", "function charts($data1) {\n\t $startDate = Carbon::now()->subDay(365);\n\t $endDate = Carbon::now();\n\t\n\t\t//THIS RETURNS THE 4 BOXES\n\t\t$month = $data->filter(function($data1){ return $data1->created_at->format('m-y') == date('m-y'); });\n\t\t$lastmonth = $data->filter(function($data1){ return $data1->created_at->format('m-y') == Carbon::now()->firstOfMonth()->subMonth()->format('m-y'); });\n\t\t$year = $data->filter(function($data1){ return $data1->created_at->format('y') == date('y'); });\n\t\t$lastyear = $data->filter(function($data1){ return $data1->created_at->format('y') == Carbon::now()->subYear()->format('y'); });\n\t\n\t}", "public function get_income_expenditure_report_data($year)\n\t{\n\t\t$this->db->where('td_fee_collection.session', $year);\n\t\t$this->db->select('tb_fin_head.name as name, SUM(td_fee_subfunds.amount) as amount');\n\t\t$this->db->group_by('td_fee_subfunds.fee_head_id');\n\t\t$this->db->order_by('tb_fin_head.name', 'asc');\n\t\t$this->db->from('td_fee_collection');\n\t\t$this->db->join('td_fee_subfunds', 'td_fee_subfunds.fee_id = td_fee_collection.fee_id', 'inner');\n\t\t$this->db->join('tb_fin_head', 'tb_fin_head.id = td_fee_subfunds.fee_head_id', 'inner');\n\t\t$query=$this->db->get();\n\t\treturn $query->result();\n\t}", "abstract protected function getTransactions();", "public static function getTransaction()\n {\n $query = new Query;\n return $query->select([ 'c.*', 'u.username', 'u.email','t.transaction_id', 't.transaction_amount',\n 't.payment_date as tn_payment_date'])\n ->from('contest as c')\n ->LeftJoin('transaction_details as t', 't.contest_id=c.id')\n ->LeftJoin('user as u', 'u.id=c.user_id')\n ->orderBy(['t.payment_date' => SORT_DESC]); \n }", "public function expenseGraphData()\n {\n $expenses = Expense::all();\n $supplierPayments = $expenses->where('expensable_type', Expenses::GOOD_RECEIVE)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n $doctorPayments = $expenses->where('expensable_type', Expenses::SCHEDULE_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n\n return ResponseHelper::findSuccess('Expense Graph Data', [\n 'supplierPaymentsGraphData' => $supplierPayments,\n 'doctorPaymentsGraphData' => $doctorPayments,\n ]);\n }", "function get_sale_grouplastby_ccode($lastmonthdate) {\r\n\tglobal $db;\r\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.total_fee) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND transaction_alipay.transaction_type IN ('1','s1') AND transaction_alipay.result_code='SUCCESS' AND transaction_alipay.trade_status='TRADE_SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$lastmonthdate') GROUP BY year, month, merchants.currency_code\";\r\n\t$transactionsDetails = $db->rawQuery($M_R_query);\r\n\treturn $transactionsDetails;\t\r\n}", "function get_annual_period_balance($cur='IDR',$acc=null,$eyear=null)\n {\n// transactions.debit, transactions.credit, transactions.vamount, gls.approved');\n \n $this->db->select_sum('transactions.vamount');\n $this->db->select_sum('transactions.debit');\n $this->db->select_sum('transactions.credit');\n \n $this->db->from('gls, transactions, accounts');\n $this->db->where('gls.id = transactions.gl_id');\n $this->db->where('transactions.account_id = accounts.id');\n $this->db->where('YEAR(dates)', $eyear);\n $this->db->where('gls.currency', $cur);\n $this->cek_null($acc,\"transactions.account_id\");\n $this->db->where('gls.approved', 1);\n $this->db->where('accounts.deleted', NULL);\n return $this->db->get(); \n }", "function get_sale_groupby_ccode($currentdate) {\r\n\tglobal $db;\r\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.total_fee) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND transaction_alipay.transaction_type IN ('1','s1') AND transaction_alipay.result_code='SUCCESS' AND transaction_alipay.trade_status='TRADE_SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$currentdate') GROUP BY year, month, merchants.currency_code\";\r\n\t$transactionsDetails = $db->rawQuery($M_R_query);\r\n\treturn $transactionsDetails;\t\r\n}", "public function searchYear(Request $request){\n $result = Order::with('customer')->where('order_year',$request->search_year)->latest()->get();\n return response()->json($result);\n\n }", "public function getSaleByMonth2($year = null)\n {\n $date = new \\DateTime(\"now\");\n $currentYear = $date->format('y');\n //If the value of $year is not define then use the current year (default)\n if(!$year){\n $year = $currentYear;\n }\n \n //Get all the STransaction from the DB first.\n $STransactions = $this->em->getRepository('TransactionBundle:STransaction')->findAll();\n $months = array('jan' => 0, 'feb' => 0, 'mar' => 0, 'apr' => 0, 'may' => 0, 'jun' => 0, 'jul'\n => 0, 'aug' => 0, 'sep' => 0, 'oct' => 0, 'nov' => 0, 'dec' => 0);\n foreach ($STransactions as $st){\n $m = $st->getCreatedAt()->format(\"m\");\n $y = $st->getCreatedAt()->format(\"y\");\n if($m == 01 && $y == $year){\n $months['jan'] = $months['jan'] + $st->getTotalAmount();\n }elseif($m == 11 && $y == $year){\n $months['nov'] = $months['nov'] + $st->getTotalAmount();\n }\n }\n \n return $months;\n \n }", "public function index()\n\t{\n\t\t$this->load->helper('url');\n\t\t$this->load->library('session');\n\t\t$this->load->database();\n\n\t\t$this->is_logged_in();\n\n\t\t$this->getSalesToday();\n\t\t$sql = $this->db->query(\"SELECT distinct(DATE_FORMAT(tr_at, '%Y-%m')) 'm', SUM(total) 'p' FROM transaction t group by YEAR(tr_at),MONTH(tr_at)\");\n\t\t//$sql = $this->db->query(\"SELECT distinct(DATE_FORMAT(t.tr_at, '%Y-%m')) 'm', b.br_id 'b', SUM(t.total) 'p' FROM transaction t, branch b where t.br_id = b.br_id group by YEAR(t.tr_at),MONTH(t.tr_at), t.br_id;\");\n\n\t\t$rows = json_encode($sql->result());\n\t\t// foreach($rows as $date):\n\t\t// $date->dates;\n\t\t// endforeach;\n\t\t$sql_branch = $this->db->query('SELECT * FROM branch');\n\t\t$branches = $sql_branch->result();\n\n\t\t$transactions = $this->db->query(\"SELECT t.tr_id 'tr_id', t.tr_at 'date', u.firstname 'firstname', u.lastname 'lastname', b.br_name 'branch', t.total 'total' FROM `transaction` t, `users` u, branch b WHERE t.user_id = u.user_id AND t.br_id = b.br_id\");\n\t\t$x = [\n\t\t\t\t'dataforChart' => $rows,\n\t\t\t\t'branches'=> $branches,\n\t\t\t\t'transactions' => $transactions->result(),\n\t\t];\n\n $this->load->view('template/header', $x);\n $this->load->view('dashboard/dashboard', $x);\n $this->load->view('template/footer', $x);\n\n\t}", "public function findDataLast()\n {\n return $this->getEntityManager()\n ->createQuery(\"SELECT DISTINCT t.number, f.id as finance, f.price as cost, f.gotcarq as gotcarqId\n FROM GazMainBundle:Terminal t\n JOIN GazMainBundle:Finance f WITH f.terminal = t\n\t\t\t\t\t\t\tWHERE (f.gotcarq IS NOT NULL AND f.gotcarq != 0)\n\t\t\t\t\t\t\t AND f.created = (SELECT MIN(f1.created) FROM GazMainBundle:Finance f1\n LEFT JOIN f1.terminal t1\n WHERE t1.id = t.id AND f1.financeType = FALSE)\n\t\t\t\t\t\t\tORDER BY t.number ASC\n \")\n ->getResult();\n }", "public function graphyearused()\n \t{\n \t\t// announce return variable\n \t\t$return \t= \tarray();\n \t\t$count \t\t=\tarray();\n \t\t// select logger collection \n \t\t$use_data \t= \t$this->mongo_db->db->used;\n \t\t// preparing query data\n \t\t$splitday \t= \texplode('-', $this->use_date);\n \t\tfor ($i = 1; $i <= 12; $i++) \n \t\t{\n \t\t\tif (strlen($i) == 1) \n \t\t\t{\n \t\t\t\t// use mongoRegex (while like in sql)\n \t\t\t\t$regex_Date \t= \tnew MongoRegex('/^'.$splitday[0].'-0'.$i.'/');\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_date' \t=> \t$regex_Date, \n \t\t\t\t\t'use_appid' => \t$this->use_appid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t} \n \t\t\telse \n \t\t\t{\n \t\t\t\t// use mongoRegex (while like in sql)\n \t\t\t\t$regex_Date \t= \tnew MongoRegex('/^'.$splitday[0].'-'.$i.'/');\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_date' \t=> $regex_Date, \n \t\t\t\t\t'use_appid' => $this->use_appid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t}\n \t\t}\n \t\t$return\t\t=\tarray(\n \t\t\t'name'\t\t=>\t\t'User',\n \t\t\t'data'\t\t=>\t\t$count\n \t\t\t);\n\n \t\treturn $return;\t\n \t}", "public function getOrdersDataLast2Years($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-2year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getNumOfOrderByMonth($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function getReportsbyYear()\n {\n $charts = app(ReportChart::class);\n $response = $this->byYear();\n \n $charts->labels($response['ano']);\n \n $charts->dataset('Relatório Anual de Vendas','bar',$response['total'])\n ->backgroundColor($response['colors'])\n ->color('red');\n\n $charts->options([\n 'scales' => [\n 'yAxes' => [\n [\n 'ticks' => [\n 'callback' => $charts->rawObject('myCallback')\n ]\n ]\n ]\n ]\n ]); \n \n return $charts;\n }", "public function getReportTransportbyClient($data) {\n\t\t$sql = \" SELECT project_id,project_no,DATE_FORMAT(start_date,'%d/%m/%Y') as start_date,project,\n DATE_FORMAT(year_end,'%d/%m/%Y') as year_end,\n DATE_FORMAT(finish_date,'%d/%m/%Y') as finish_date,address,budget_cost,client_name ,client.address \n FROM project\n INNER JOIN client ON client.client_id=project.client_id\n WHERE project.client_id=$data[client_id]\n AND YEAR(year_end)>='$data[year]' \n ORDER BY YEAR(year_end) ASC\n \";\n\t\treturn $this->rst2Array ( $sql );\n\t}", "public function getAmountsDataLast2Years($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-2year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getAmountsByMonth($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function transaksi()\n {\n $data = [];\n $date = Akad::selectRaw(\"DATE_FORMAT(tanggal_akad, '%Y-%m') as month\")->orderBy('tanggal_akad', 'desc')->distinct()->get();\n\n foreach ($date as $item) {\n $years = Carbon::parse($item->month)->format('Y');\n $months = Carbon::parse($item->month)->format('m');\n $count = $this->akad->whereYear('tanggal_akad', $years)->whereMonth('tanggal_akad', $months)->count();\n $data[$item->month] = $count;\n }\n\n return $data;\n }", "public function purchaseSalesGraph($financial_month, $financialYearDD, $userId)\r\n\t{\r\n\t\t\r\n\t\t$arrayData=array();\r\n\t\t$cashData=array();\r\n\t\t//total sales in amount\r\n\t\t\t$saleQuery='SELECT sum(invoice_total_value) as total_sales FROM '.$this->tableNames['client_invoice'].'\r\n\t\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\t\tand added_by=\"'.$userId.'\" \r\n\t\t\tand is_deleted=\"0\" \r\n\t\t\tand is_canceled=\"0\"';\r\n\t\t\t\r\n\t\t\t//total purchase in amount\r\n\t\t\t$purchaseQuery = 'SELECT sum(invoice_total_value) as total_purchase FROM '.$this->tableNames['client_purchase_invoice'].'\r\n\t\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\t\tand added_by=\"'.$userId.'\"\r\n\t\t\tand is_deleted=\"0\" \r\n\t\t\tand is_canceled=\"0\"';\r\n\r\n\t\t\t$totalSales = $this->get_row($saleQuery,false);\r\n\t\t\t$totalPurchase = $this->get_row($purchaseQuery,false);\r\n\t\t\t\r\n\t\t\tif(empty($totalSales)) {\r\n\t\t\t\t$cashData['sales'] = \"0.00\";\r\n\t\t\t} else {\r\n\t\t\t\t$cashData['sales'] = $totalSales[0];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(empty($totalPurchase)) {\r\n\t\t\t\t$cashData['purchase'] = \"0.00\";\r\n\t\t\t} else {\r\n\t\t\t\t$cashData['purchase'] = $totalPurchase[0];\r\n\t\t\t\t$cashData['month'] = $financial_month;\r\n\t\t\t}\r\n\t\t\tarray_push($arrayData, $cashData);\r\n\t\t\treturn $arrayData;\r\n\t}", "public function fetchLicenseHistory()\n {\n $history = [];\n $query = $this->db->executeQuery(\n \"SELECT\n l.id,\n TO_CHAR(l.creation_date, 'Dy DD Mon YYYY, HH24:MI') AS creation_date,\n TO_CHAR(l.creation_date, 'YYYY-MM-DD HH24:MI:SS') AS creation_date_iso,\n TO_CHAR(l.activation_date, 'Dy DD Mon YYYY, HH24:MI') AS activation_date,\n TO_CHAR(l.activation_date, 'YYYY-MM-DD HH24:MI:SS') AS activation_date_iso,\n TO_CHAR(l.expiry_date, 'Dy DD Mon YYYY, HH24:MI') AS expiry_date,\n TO_CHAR(l.expiry_date, 'YYYY-MM-DD HH24:MI:SS') AS expiry_date_iso,\n array_to_json(l.ip_addr) AS ip_addr,\n array_to_json(l.domains) AS domains,\n array_to_json(array_agg(mi.description\n ORDER BY mi.id ASC)) AS modules_names,\n now() BETWEEN activation_date AND expiry_date AS active\n FROM license l\n LEFT JOIN modules_available mi ON mi.id = ANY (l.modules_installed) AND mi.enabled_by_default=0\n WHERE client_id = :clientId\n GROUP BY l.id\n ORDER BY l.creation_date DESC\",\n [':clientId' => $_POST['clientId']]\n );\n while (($row = $query->fetch()) !== FALSE) {\n $row['modules_names'] = json_decode($row['modules_names'], TRUE);\n $row['ip_addr'] = json_decode($row['ip_addr'], TRUE);\n $row['domains'] = json_decode($row['domains'], TRUE);\n $history[] = $row;\n }\n if (!empty($history)) {\n $history[0]['isLatest'] = TRUE;\n }\n $this->response = [\"licenses\" => $history];\n }", "public function getTransactionStats($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n // transaction count\n $currentTransactionCount = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('status', [$this->successStatus])\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n // ->groupBy('status')\n ->get();\n\n $prevTransactionCount = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('status', [$this->successStatus])\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n // ->groupBy('status')\n ->get();\n\n // total transaction\n $currentTransactionValue = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(total_price), 0), 0) as average'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->get();\n\n $prevTransactionValue = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(total_price), 0), 0) as average'))\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->get();\n\n // transaction status\n $transactionStatus = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('case when order_statuses.status then \\'sukses\\' else order_statuses.name end as status, count(*)'))\n // ->whereIn('status', [$this->successStatus])\n ->whereIn('order_statuses.name', $this->finalTransactionStatus)\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_statuses.name')\n ->groupBy('order_statuses.status')\n ->orderByRaw('count desc')\n ->get();\n\n $statuses = DB::connection('virtual_market')\n ->table('order_statuses')\n ->select(DB::raw('status'))\n ->get();\n\n $statusTrendData = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('status, count(*),'.$dateQuery))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_statuses.status')\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n $statusTrend = [];\n for($i=0; $i<count($statusTrendData); $i++){\n if(($i == 0) || ($prevDate != $statusTrendData[$i]->date)){\n if($i>0)\n array_push($statusTrend, $data);\n $data = array();\n $data['date'] = $statusTrendData[$i]->date;\n }\n $data[$statusTrendData[$i]->status] = $statusTrendData[$i]->count;\n $prevDate = $statusTrendData[$i]->date;\n if($i == count($statusTrendData)-1)\n array_push($statusTrend, $data);\n }\n\n // app platform (mobile / sms)\n $appPlatform = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('order_type as name, count(*)'))\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_type')\n ->get();\n\n $platforms = array();\n array_push($platforms, array('platform'=>'sms'));\n array_push($platforms, array('platform'=>'mobile'));\n\n $platformTrendData = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('order_type as platform, count(*),'.$dateQuery))\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_type')\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $platformTrend = [];\n for($i=0; $i<count($platformTrendData); $i++){\n if(($i == 0) || ($prevDate != $platformTrendData[$i]->date)){\n if($i>0)\n array_push($platformTrend, $data);\n $data = array();\n $data['date'] = $platformTrendData[$i]->date;\n }\n $data[$platformTrendData[$i]->platform] = $platformTrendData[$i]->count;\n $prevDate = $platformTrendData[$i]->date;\n if($i == count($platformTrendData)-1)\n array_push($platformTrend, $data);\n }\n\n\n $data = array();\n $data['transaction'] = array();\n $data['transaction']['count'] = array();\n $data['transaction']['count']['current'] = $currentTransactionCount[0];\n $data['transaction']['count']['prev'] = $prevTransactionCount[0];\n $data['transaction']['value'] = array();\n $data['transaction']['value']['current'] = $currentTransactionValue[0];\n $data['transaction']['value']['prev'] = $prevTransactionValue[0];\n\n $data['transaction_status'] = $transactionStatus;\n $data['transaction_status_trend'] = array();\n $data['transaction_status_trend']['statuses'] = $statuses;\n $data['transaction_status_trend']['granularity'] = $granularity;\n $data['transaction_status_trend']['trend'] = $statusTrend;\n $data['app_platform'] = $appPlatform;\n $data['app_platform_trend'] = array();\n $data['app_platform_trend']['platforms'] = $platforms;\n $data['app_platform_trend']['granularity'] = $granularity;\n $data['app_platform_trend']['trend'] = $platformTrend;\n \n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function getBuyerHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $buyer = DB::connection('virtual_market')\n ->table('orders')\n ->select(DB::raw($dateQuery.',count(distinct customer_id)'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['buyer'] = $buyer;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "function GetYoutubeGraphData($ytUserName,$arrayDate)\n\t\t{\n\t\t\tset_include_path('library');\n\t\t\trequire_once 'Zend/Loader.php';\n\t\t\tZend_Loader::loadClass('Zend_Gdata_YouTube');\n\t\t\t\n\t\t\n\t\t\t\t$this->userName= $ytUserName;\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Uploads & comments\n\t\t\t\t$yt = new Zend_Gdata_YouTube();\n\t\t\t\t$yt->getHttpClient()->setConfig(array('timeout'=>180));\n\t\t\t\t$yt->setMajorProtocolVersion(2);\n\t\t\n\t\t\t\t$this->srVideoList='';\n\t\t\t\t$this->GetUploadDates($yt->getuserUploads($this->channelName));\n\t\t\n\t\t\t\t\n\t\t\t\t// \"Favorite\";\n\t\t\t\t$this->GetFavoriteDates();\n\t\t\t\t\n\t\t\t\t$this->CountDates($arrayDate);\n\t\t\t\t\t\n\t\t\t\treturn $this->graphArray;\n\t\t\t}", "public function getTotalSPerYear(){\n // FROM [mon].[ProjectDetail]\n // GROUP BY YEAR([CreatedAt])\n $result = [];\n $this->db->select(\"YEAR([CreatedAt]) as year, count(ApiKey) as count\");\n $this->db->from($this->TBL_SDEVICEPROFILE);\n $this->db->group_by('YEAR([CreatedAt])');\n $q = $this->db->get();\n return $q->result_array();\n }", "private function getAllPreviousYears($year) {\n $allPreviousYears = $this->backup->getAllPreviousYears($year);\n if (empty($allPreviousYears)) {\n exit('<h1>No Previous Years Available</h1>');\n }\n return $allPreviousYears;\n }", "public function getgraphAction(){\n $params = array(\n 'cht' => 'lc', \t\t\t\t\t// chart type\n 'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0', //background fills for the chart\n // 'chm' => 'B,f4d4b2,0,0,0|B,FF0000,1,1,0|B,00FF00,2,2,0', \t\t// line fills\n 'chco' => 'db4814,1919D1',\t\t\t\t\t//Series Colors\n 'chs' => '587x300',\t\t\t\t// chart size <width>x<height>\n\t\t\t'chxt' => 'x,y',\t\t\t\t\t// visible axes\n\t\t\t//'chof' => 'validate'\t\t\t\t// output format (png,gif,json,html{when chof='validate'})\n );\n \n\t$post=$this->getRequest()->getPost();\n\t\n\t\n\t$timezoneLocal = Mage::app()->getStore()->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);\n\n\t\tlist ($dateStart, $dateEnd) = Mage::getResourceModel('reports/order_collection')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getDateRange($post['range'], '', '', true);\n\n $dateStart->setTimezone($timezoneLocal);\n $dateEnd->setTimezone($timezoneLocal);\n\t\n\t\t$dates = array();\n $datas = array();\n\n while($dateStart->compare($dateEnd) < 0){\n switch ($post['range']) {\n case '24h':\n $d = $dateStart->toString('yyyy-MM-dd HH:00');\n $dateStart->addHour(1);\n break;\n case '7d':\n case '1m':\n $d = $dateStart->toString('yyyy-MM-dd');\n $dateStart->addDay(1);\n break;\n case '1y':\n case '2y':\n $d = $dateStart->toString('yyyy-MM');\n $dateStart->addMonth(1);\n break;\n }\n\n $dates[] = $d;\n }\n\n\t\t$graphData=array();\n\t\t\n\t\t$product_list=array('product1'=>$post['product'],\n\t\t\t\t\t\t\t'product2'=>$post['compare2']\n\t\t\t\t\t\t\t);\t\n\t\t$graphData=Mage::Helper('graphs')->getGraphData($dates,$product_list);\n\n /**\n * setting skip step\n */\n if (count($dates) > 8 && count($dates) < 15) {\n $c = 1;\n } else if (count($dates) >= 15){\n $c = 2;\n } else {\n $c = 0;\n }\n /**\n * skipping some x labels for good reading\n */\n $i=0;\n foreach ($dates as $k => $d) {\n if ($i == $c) {\n $dates[$k] = $d;\n $i = 0;\n } else {\n $dates[$k] = '';\n $i++;\n }\n }\n \n $this->_axisLabels['x'] = $dates;\n\t\t$this->_axisLabels['y'] = $graphData['quantity'][$post['product']];\n\t\t\n\t\tforeach ($graphData['quantity'] as $index => $serie) {\n $localmaxlength[$index] = sizeof($serie);\n $localmaxvalue[$index] = max($serie);\n $localminvalue[$index] = min($serie);\n }\n \n\t\t$maxvalue = max($localmaxvalue);\n\t\t$minvalue = min($localminvalue);\n\n $yrange = 0;\n $yLabels = array();\n $miny = 0;\n $maxy = 0;\n $yorigin = 0;\n\n $maxlength = max($localmaxlength);\n if ($minvalue >= 0 && $maxvalue >= 0) {\n $miny = 0;\n if ($maxvalue > 10) {\n $p = pow(10, $this->_getPow($maxvalue));\n $maxy = (ceil($maxvalue/$p))*$p;\n $yLabels = range($miny, $maxy, $p);\n } else {\n $maxy = ceil($maxvalue+1);\n $yLabels = range($miny, $maxy, 1);\n }\n $yrange = $maxy;\n $yorigin = 0;\n }\n\n \n\t\t\t\n\t\t\t$params['chd'] = \"e:\";\n $dataDelimiter = \"\";\n $dataSetdelimiter = \",\";\n $dataMissing = \"__\";\n \n\t\t\t// EXTENDED ENCODING\n\t\t\tforeach($product_list as $productid){\n\t\t\t\t$chartdata = array();\t\n for ($j = 0; $j < sizeof($graphData['quantity'][$productid]); $j++) {\n $currentvalue = $graphData['quantity'][$productid][$j];\n \n if (is_numeric($currentvalue)) {\n if ($yrange) {\n $ylocation = (4095 * ($yorigin + $currentvalue) / $yrange);\n\n } else {\n $ylocation = 0;\n }\n $firstchar = floor($ylocation / 64);\n $secondchar = $ylocation % 64;\n $mappedchar = substr($this->_extendedEncoding, $firstchar, 1)\n . substr($this->_extendedEncoding, $secondchar, 1);\n array_push($chartdata, $mappedchar . $dataDelimiter);\n } else {\n array_push($chartdata, $dataMissing . $dataDelimiter);\n }\n\n\t\t\t }\n\t\t\t $buffer = implode('', $chartdata);\t\t\t \n\t\t\t\t\t$buffer = rtrim($buffer, $dataSetdelimiter);\n\t\t\t\t\t$buffer = rtrim($buffer, $dataDelimiter);\n\t\t\t\t\t$buffer = str_replace(($dataDelimiter . $dataSetdelimiter), $dataSetdelimiter, $buffer);\n\t\t\t\t\t\n\t\t\t\t\t$params['chd'] .= $buffer.',';\n\t\t\t\t\t$buffer=null;\n\t\t\t\t\t$chartdata=null;\n\t\t\t\t}\n\t\t\t\t\t$labelBuffer = \"\";\n\t\t\t\t\t$valueBuffer = array();\n\t\t\t\t\t$rangeBuffer = \"\";\n \n if (sizeof($this->_axisLabels) > 0) {\n $params['chxt'] = implode(',', array_keys($this->_axisLabels));\n $indexid = 0;\n foreach ($this->_axisLabels as $idx=>$labels){\n\t\t\t\t\n if ($idx == 'x') {\n /**\n * Format date\n */\n foreach ($this->_axisLabels[$idx] as $_index=>$_label) {\n if ($_label != '') {\n switch ($post['range']) {\n case '24h':\n $this->_axisLabels[$idx][$_index] = $this->formatTime(\n new Zend_Date($_label, 'yyyy-MM-dd HH:00'), 'short', false\n );\n break;\n case '7d':\n case '1m':\n $this->_axisLabels[$idx][$_index] = $this->formatDate(\n new Zend_Date($_label, 'yyyy-MM-dd')\n );\n break;\n case '1y':\n case '2y':\n\t\t\t\t\t\t\t\t\t\n $formats = Mage::app()->getLocale()->getTranslationList('datetime');\n $format = isset($formats['yyMM']) ? $formats['yyMM'] : 'MM/yyyy';\n $format = str_replace(array(\"yyyy\", \"yy\", \"MM\"), array(\"Y\", \"y\", \"m\"), $format);\n $this->_axisLabels[$idx][$_index] = date($format, strtotime($_label));\n break;\n }\n } else {\n $this->_axisLabels[$idx][$_index] = '';\n }\n\n }\n\t\t\t\t\t\t\t\t\t\t\n $tmpstring = implode('|', $this->_axisLabels[$idx]);\n\n $valueBuffer[] = $indexid . \":|\" . $tmpstring;\n if (sizeof($this->_axisLabels[$idx]) > 1) {\n $deltaX = 100/(sizeof($this->_axisLabels[$idx])-1);\n } else {\n $deltaX = 100;\n }\n } else if ($idx == 'y') {\n $valueBuffer[] = $indexid . \":|\" . implode('|', $yLabels);\n if (sizeof($yLabels)-1) {\n $deltaY = 100/(sizeof($yLabels)-1);\n } else {\n $deltaY = 100;\n }\n // setting range values for y axis\n $rangeBuffer = $indexid . \",\" . $miny . \",\" . $maxy . \"|\";\n }\n $indexid++;\n }\n $params['chxl'] = implode('|', $valueBuffer);\n }\t\t\t\n\t\t\t\t\t\n\t\tif (isset($deltaX) && isset($deltaY)) {\n $params['chg'] = $deltaX . ',' . $deltaY . ',1,0';\n }\n \n\n\t\t\t$p = array();\n foreach ($params as $name => $value) {\n $p[] = $name . '=' .urlencode($value);\n }\n\n $url= Mage_Adminhtml_Block_Dashboard_Graph::API_URL . '?' . implode('&', $p);\n\n\t\t\t\techo $url;\n\t}", "public function getTotalMPerYear(){\n // FROM [dbo].[MDeviceProfile]\n // GROUP BY YEAR([CreatedAt])\n $result = [];\n $this->db->select(\"YEAR([CreatedAt]) as year, count(DeviceId) as count\");\n $this->db->from($this->TBL_MDEVICEPROFILE);\n $this->db->group_by('YEAR([CreatedAt])');\n $q = $this->db->get();\n return $q->result_array();\n }", "public function list()\n {\n return view('transactions.graphs');\n }", "public function getChartData() {\n $fromDate = Carbon::now()->subMinutes(60);\n $toDate = Carbon::now();\n\n $chart = new TaskActivity;\n $chartData = Auth::user()->tasks()->where('is_complete', 0)->whereBetween('created_at', [$fromDate, $toDate])->get()->pluck('created_at')->toArray();\n $arr = [];\n foreach ($chartData as $k => $c) {\n $add = $k + 1;\n array_push($arr, $add);\n }\n $chart->labels($chartData);\n $chart->dataset('Pending task', 'line', $arr);\n return $chart;\n }", "public function buildVisitorsGraph(): \\Google_Service_Analytics_GaData\n {\n $startDate = Carbon::now()->subDays(7);\n\n $visitorsData = AnalyticsFacade::performQuery(\n Period::create($startDate, $this->endDate),\n 'ga:sessions,ga:pageviews',\n [\n 'dimensions' => 'ga:date',\n 'sort' => 'ga:date'\n ]\n );\n\n $visitorsGraph = [];\n foreach ($visitorsData->rows as $row) {\n $row[0] = Carbon::createFromFormat('Ymd', $row[0]);\n\n array_push($visitorsGraph, $row);\n }\n $visitorsData->rows = array_reverse($visitorsGraph);\n\n return $visitorsData;\n }", "public function getYear() {}", "public function buysOfThisYear() {\n $query = \"SELECT COUNT(*) AS 'BUYS', MONTH(`BUYDATE`) AS 'MONTH' FROM `BUY` WHERE YEAR(BUYDATE) = \" .\n \"YEAR(NOW()) GROUP BY MONTH(`BUYDATE`)\";\n\n $result = parent::query($query);\n\n $toReturn = array();\n\n while ($row = $result->fetch_assoc()) {\n $toReturn[] = array(\n 'month' => $row['MONTH'],\n 'buys' => $row['BUYS']\n );\n }\n\n return $toReturn;\n }", "public function transactions() {\n if ($this->input->get('view')) {\n $id = $this->myencrypt->decrypt_url($this->input->get('transaction_id'));\n $data['transaction'] = $this->account_model->getTransactions(array('ttransactions.ttransaction_id' => $id));\n } else {\n $mfinancialyear_id = null;\n if ($this->session->has_userdata('financialyear')) {\n $financialyear_data = $this->session->userdata('financialyear');\n $mfinancialyear_id = $financialyear_data['mfinancialyear_id'];\n }\n if ($this->input->get('unlimited')) {\n $data['unlimited'] = true;\n $data['transactions'] = $this->account_model->getTransactions(false, array('mfinancialyear_id' => $mfinancialyear_id));\n } else {\n $data['transactions'] = $this->account_model->getTransactions(FALSE, array('mfinancialyear_id' => $mfinancialyear_id), 10);\n }\n }\n $this->view('transactions', $data);\n }", "public function getBuyerHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $buyer = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($dateQuery.',count(distinct buyer_id)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['buyer'] = $buyer;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function getTransaction();", "function get_sale_groupby_ccode($currentdate) {\n\tglobal $db;\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(gp_transaction.gp_trans_datetime) AS year, MONTH(gp_transaction.gp_trans_datetime) AS month, COUNT(DISTINCT gp_transaction.gp_transaction_id) AS transcount, SUM(gp_transaction.gp_amount) AS transamount FROM merchants JOIN gp_transaction ON gp_transaction.gp_merchant_id = merchants.mer_map_id AND gp_transaction.gp_transaction_type IN ('1','s1') AND gp_transaction.gp_status='success' AND MONTH(gp_transaction.gp_trans_datetime) = MONTH('$currentdate') GROUP BY year, month, merchants.currency_code\";\n\t$transactionsDetails = $db->rawQuery($M_R_query);\n\treturn $transactionsDetails;\t\n}", "public function graphyearusedfunc()\n \t{\n \t\t// announce return variable\n \t\t$return \t\t= \tarray();\n \t\t$count \t\t\t=\tarray();\n \t\t// select logger collection \n \t\t$use_data \t\t= \t$this->mongo_db->db->used;\n \t\t// preparing query data\n \t\t$splitday \t\t= \texplode('-', $this->use_date);\n \t\tfor ($i = 1; $i <= 12; $i++) \n \t\t{\n \t\t\tif (strlen($i) == 1) \n \t\t\t{\n \t\t\t\t// use mongoRegex (while like in sql)\n \t\t\t\t$regex_Date \t= \tnew MongoRegex('/^'.$splitday[0].'-0'.$i.'/');\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_date' \t\t=> \t$regex_Date, \n \t\t\t\t\t'use_funcid' \t=> \t$this->use_funcid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t} \n \t\t\telse \n \t\t\t{\n \t\t\t\t// use mongoRegex (while like in sql)\n \t\t\t\t$regex_Date \t= \tnew MongoRegex('/^'.$splitday[0].'-'.$i.'/');\n \t\t\t\t// build query data\n \t\t\t\t$querydata\t \t= \tarray(\n \t\t\t\t\t'use_date' \t\t=> \t$regex_Date, \n \t\t\t\t\t'use_funcid' \t=> \t$this->use_funcid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t}\n \t\t}\n\n \t\t$return\t\t=\tarray(\n \t\t\t'name'\t\t=>\t\t'User',\n \t\t\t'data'\t\t=>\t\t$count\n \t\t\t);\n \t\t\n \t\treturn $return;\t\n \t}", "function get_refundlast_by_ccode($ccode_last,$lastmonthdate) {\r\n\tglobal $db;\r\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.refund_amount) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND merchants.currency_code= '$ccode_last' AND transaction_alipay.transaction_type IN ('2','s2') AND transaction_alipay.result_code='SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$lastmonthdate') GROUP BY year, month\";\r\n\t$transactionsDetails = $db->rawQuery($M_R_query);\r\n\treturn $transactionsDetails;\r\n}", "public function getMyTransactionHistory($patron, $params)\n {\n $pageSize = $params['limit'] ?? 50;\n $offset = isset($params['page']) ? ($params['page'] - 1) * $pageSize : 0;\n $sortOrder = isset($params['sort']) && 'checkout asc' === $params['sort']\n ? 'asc' : 'desc';\n $result = $this->makeRequest(\n ['v3', 'patrons', $patron['id'], 'checkouts', 'history'],\n [\n 'limit' => $pageSize,\n 'offset' => $offset,\n 'sortField' => 'outDate',\n 'sortOrder' => $sortOrder,\n 'fields' => 'item,outDate'\n ],\n 'GET',\n $patron\n );\n if (isset($result['code'])) {\n return [\n 'success' => false,\n 'status' => 146 === $result['code']\n ? 'ils_transaction_history_disabled'\n : 'ils_connection_failed'\n ];\n }\n $transactions = [];\n foreach ($result['entries'] as $entry) {\n $transaction = [\n 'id' => '',\n 'item_id' => $this->extractId($entry['item']),\n 'checkoutDate' => $this->dateConverter->convertToDisplayDate(\n 'Y-m-d', $entry['outDate']\n )\n ];\n // Fetch item information\n $item = $this->makeRequest(\n ['v3', 'items', $transaction['item_id']],\n ['fields' => 'bibIds,varFields'],\n 'GET',\n $patron\n );\n $transaction['volume'] = $this->extractVolume($item);\n if (!empty($item['bibIds'])) {\n $transaction['id'] = $item['bibIds'][0];\n\n // Fetch bib information\n $bib = $this->getBibRecord(\n $transaction['id'], 'title,publishYear', $patron\n );\n if (!empty($bib['title'])) {\n $transaction['title'] = $bib['title'];\n }\n if (!empty($bib['publishYear'])) {\n $transaction['publication_year'] = $bib['publishYear'];\n }\n }\n $transactions[] = $transaction;\n }\n\n return [\n 'count' => $result['total'] ?? 0,\n 'transactions' => $transactions\n ];\n }", "function get_targets_node_per_year($year, $countries, $users = array())\n{\n if (!$year) {\n $year = date('Y');\n }\n\n if (count($users) == 0) {\n global $user;\n $users[] = $user->uid;\n }\n\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'monthly_target')\n ->fieldCondition('field_target_country', 'target_id', $countries, 'IN')\n ->fieldCondition('field_targets_date', 'value', $start_date, '>=')\n ->fieldCondition('field_targets_date', 'value', $end_date, '<=')\n ->addMetaData('account', user_load(1));\n\n if (is_sales_manager($user)) {\n $query->fieldCondition('field_sales_manager', 'target_id', $users, 'IN');\n } elseif (is_regional_lead($user)) {\n $managers = ppt_resources_get_regional_lead_sales_managers($user->uid);\n $uids = array();\n foreach ($managers as $manager) {\n $uids[] = $manager->uid;\n }\n $query->fieldCondition('field_sales_manager', 'target_id', $uids, 'IN');\n } elseif (is_comm_lead($user)) {\n $managers = ppt_resources_get_comm_lead_sales_managers($user->uid);\n $uids = array();\n foreach ($managers as $manager) {\n $uids[] = $manager->uid;\n }\n $query->fieldCondition('field_sales_manager', 'target_id', $uids, 'IN');\n } else {\n // Do nothing, just get all targets of that country.\n }\n\n $records = $query->execute();\n\n if (isset($records['node'])) {\n $targets = array();\n foreach ($records['node'] as $nid => $item) {\n $node = node_load($nid);\n if (isset($node->field_targets_date[LANGUAGE_NONE]) && isset($node->field_targets[LANGUAGE_NONE])) {\n $node_date = $node->field_targets_date[LANGUAGE_NONE][0]['value'];\n $node_month = date(\"m\", strtotime($node_date));\n $targets[$node_month][] = $node;\n }\n }\n return $targets;\n }\n}", "public function fetchNextPage(&$last_page) {\n\n\t\t$transactions = [];\n\n\t\tif (!$this->date) {\n\t\t\tthrow new \\Exception(get_class($this) . ': you need to call setDate() before fetching any transactions');\n\t\t}\n\n\t\t$data = json_decode($this->api->getSales($this->date->toDateString(), NULL, NULL, NULL, NULL, $this->page, $this->page_size), true);\n\t\t$transactions = array_merge(\n\t\t\t$transactions,\n\t\t\t$this->mapTransactionData($data)\n\t\t);\n\n\t\t$data = json_decode($this->api->getLeads($this->date->toDateString(), NULL, NULL, NULL, NULL, $this->page, $this->page_size), true);\n\t\t$transactions = array_merge(\n\t\t\t$transactions,\n\t\t\t$this->mapTransactionData($data)\n\t\t);\n\n\t\t$this->page++;\n\n\t\t$last_page = empty($transactions);\n\n\t\treturn $transactions;\n\t}", "public function get_trend_data_rows()\n\t{\n\t\t$dates = array();\n\t\t$i_rows = array();\n\t\t$sr_rows = array();\n\t\t$trend_data = array();\n\n\t $current_month = date_create()->format('Y-m-d H:i:s');\n\n\t // echo $current_month_first_day=date_create($current_month)\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\t $current_month_first_day=date_create($current_month)\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n\n $dates[] = $current_month_first_day;\n\n //echo\"</br>\";\n \n // echo $current_month_current_day=date_create($current_month)\n // ->format(\"Y-m-d 23:59:59\");\n\n $current_month_current_day=date_create($current_month)\n ->format(\"Y-m-d 23:59:59\");\t\n\n $dates[] = $current_month_current_day;\n\n //echo\"</br></br>\";\n\n // echo $second_month_first_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $second_month_first_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $second_month_first_day;\n\n //echo\"</br>\";\n\n // echo $second_month_last_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n $second_month_last_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $second_month_last_day;\n\n// echo\"</br></br>\";\n\n // echo $third_month_first_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $third_month_first_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $third_month_first_day;\n\n //echo\"</br>\";\n \t\t\t\n // echo $third_month_last_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n\t $third_month_last_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $third_month_last_day;\n\n // echo\"</br>\";\t\n // echo \"<pre>\";\n // print_r($dates);\n\t // echo \"</pre>\";\t\n\t // echo\"</br>\";\t\t\t \n\n for ($i=0; $i <=5 ; $i=$i+2)\n { \t\n \t//echo\"</br>\";\n\n \t$start = new DateTime($dates[$i]);\n \t\n \t//echo\"</br>\";\n\n\t\t$start = date_format($start,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\n\t\t$end = new DateTime($dates[$i+1]);\n\n\t\t//echo\"</br>\";\n\n\t\t$end = date_format($end,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\t\t$i_rows[] = date_create($start)->format(\"F Y\");\n\t\t$i_rows[] = date_create($end)->format(\"F Y\");\n\t\t$i_rows[] = $this->trend_insident_data($start,$end);\n \t$sr_rows[] = date_create($start)->format(\"F Y\");\n\t\t$sr_rows[] = date_create($end)->format(\"F Y\");\n \t$sr_rows[] = $this->trend_sr_data($start,$end);\t\n }\n\n // echo \"<pre>\";\n // \tprint_r($i_rows);\n \t\t// echo \"<h4>SR Array</h4>\";\n \t\t// print_r($sr_rows);\n \t\t// echo \"</pre>\";\n\n \t\t$trend_data[] = $i_rows;\n \t\t$trend_data[] = $sr_rows;\n\n\n \t\treturn $trend_data;\n\n\n // // First day of a specific month\n // $d = new DateTime('2010-01-19');\n // $d->modify('first day of this month');\n // echo $d->format('jS, F Y').\"</br>\";\n\n // // alternatively...\n // echo date_create('2010-01-19')\n // ->modify('first day of this month')\n // ->format('jS, F Y');\n\t\t//exit();\n\t}", "public function getTransactionDataLastMonth($customerId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-30days\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $transactionResource = $this->_transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByDay($from, $to, $customerId);\n $result = $this->_processReceivedTransactionData($data, $result);\n \n $data = $transactionResource->getSpentCreditTransactionsByDay($from, $to, $customerId);\n $result = $this->_processSpentTransactionData($data, $result);\n \n $result = array_values($result);\n return $result;\n }", "public static function GetDashboard() {\n $date = [];\n $num_orders = [];\n $last_month = \\Carbon\\Carbon::today()->subDays(30);\n $orders = Order::where('created_at', '>=', $last_month)->get()\n ->groupBy(function($item) {\n return $item->created_at->format('d-m-y');\n })->toArray();\n foreach ($orders as $key => $value) {\n $date[] = $key;\n $num_orders[] = count($value);\n }\n\n //======= Get income from last month - Chart From DB =======\n $last_month_income = \\Carbon\\Carbon::today()->subDays(30);\n $all_orders = [];\n $orders_income = [];\n $income = [];\n $income_date = [];\n $users_orders = DB::table('users')\n ->join('orders', 'users.id', '=', 'orders.user_id')\n ->select('users.*', 'orders.*')\n ->where('orders.created_at', '>=', $last_month_income)->get();\n foreach ($users_orders as $new_user_order) {\n $all_orders[] = (array) $new_user_order;\n }\n foreach ($all_orders as &$orders_data) {\n $orders_data['data'] = unserialize($orders_data['data']);\n }\n foreach ($all_orders as $order) {\n $order['created_at'] = (new \\DateTime($order['created_at']))->format('Y-m-d');\n $income_date[] = $order['created_at'];\n $sum = 0;\n foreach ($order['data'] as $price) {\n $sum += ($price['price'] * $price['quantity']);\n }\n $income[] = $sum;\n }\n\n for ($i = count($income_date) - 1; $i > 0; $i--) {\n if ($income_date[$i] == $income_date[$i - 1]) {\n unset($income_date[$i]);\n $income[$i - 1] = $income[$i] + $income[$i - 1];\n unset($income[$i]);\n }\n }\n $income = array_values($income);\n $income_date = array_values($income_date);\n\n self::$data['income'] = json_encode($income);\n self::$data['income_date'] = json_encode($income_date);\n\n //======= Get last week new users =======\n $last_week = \\Carbon\\Carbon::today()->subDays(7);\n $weekly_users = User::where('created_at', '>=', $last_week)->get()->toArray();\n\n //======= Get all users except admin =======\n $all_users = User::where('role', '!=', '6')->get()->toArray();\n\n //======= Get last day new orders =======\n $last_day = \\Carbon\\Carbon::today();\n $daily_orders = Order::where('created_at', '>=', $last_day)->get()->toArray();\n\n self::$data['weekly_new_users'] = count($weekly_users);\n self::$data['all_users'] = count($all_users);\n self::$data['daily_orders'] = count($daily_orders);\n self::$data['date'] = json_encode($date);\n self::$data['num_orders'] = json_encode($num_orders);\n self::$data['title'] .= 'CMS';\n self::$data['page_name'] = 'Ski Expert | Main';\n return view('cms.dashboard', self::$data);\n }", "public function all($transactionToken = null)\n {\n $append = '';\n\n if ($transactionToken) {\n $append = '?since_token='.$transactionToken;\n }\n\n return $this->client->get('v1/transactions.json'.$append);\n }", "function get_cancellast_by_ccode($ccode_last,$lastmonthdate) {\r\n\tglobal $db;\r\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.total_fee) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND merchants.currency_code= '$ccode_last' AND transaction_alipay.transaction_type IN ('4','s4') AND transaction_alipay.result_code='SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$lastmonthdate') GROUP BY year, month\";\r\n\t$transactionsDetails = $db->rawQuery($M_R_query);\r\n\treturn $transactionsDetails;\r\n}", "function get_period_balance($cur='IDR',$acc=null,$month=null,$year=null,$emonth=null,$eyear=null)\n {\n// transactions.debit, transactions.credit, transactions.vamount, gls.approved');\n \n $this->db->select_sum('transactions.vamount');\n $this->db->select_sum('transactions.debit');\n $this->db->select_sum('transactions.credit');\n \n $this->db->from('gls, transactions, accounts');\n $this->db->where('gls.id = transactions.gl_id');\n $this->db->where('transactions.account_id = accounts.id');\n $this->cek_between_month($month, $emonth);\n $this->cek_between_year($year, $eyear);\n $this->db->where('gls.currency', $cur);\n// $this->db->where('MONTH(dates)', $month);\n// $this->db->where('YEAR(dates)', $year);\n $this->cek_null($acc,\"transactions.account_id\");\n $this->db->where('gls.approved', 1);\n $this->db->where('accounts.deleted', NULL);\n return $this->db->get(); \n }", "function get_all_by_key_by_year(){\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_set_form_attitude\n\t\t\t\tWHERE sft_pos_id = ? AND sft_pay_id = ?\";\n $query = $this->db->query($sql, array($this->sft_pos_id, $this->sft_pay_id));\n\t\treturn $query;\n\n\t}", "public function getSharedBlock(){\n $output = ''; \n \n // Make year markings for each TrendGraph\n $reference = NULL;\n \n foreach($this->graphs as $graph){\n if ((is_object($graph)) && ($graph instanceof TrendGraph)){\n if($graph->getType() == DataManager::JAAR_TREND)\n $reference = $graph;\n break;\n }\n }\n \n if(is_null($reference)){\n die ('No general graph found');\n }\n \n $referenceSet = $graph->getDataSet();\n \n $zoek = array();\n \n foreach ($referenceSet as $dataPoint) {\n $zoek[$this->JStoPHPyears($dataPoint[0])] = 1;\n }\n \n $jaren = array_keys($zoek);\n \n //Creatie markers\n $markers = 'var markers = [\n ';\n foreach ($jaren as $jaar){\n $stamp = $this->PHPtoJStimestamp($jaar);\n $zoek[$jaar] = $stamp;\n $markers .= '{ color: \"#000\", lineWidth: 1, xaxis: { from: ' . $stamp . ', to: ' . $stamp . ' } },\n ';\n }\n $markers .= '];';\n $this->marks = $zoek;\n \n //To output\n $output .= $markers; \n \n //Add resize trigger to make the new anotations\n $output .= \"\n $(window).resize(function() {\n anoteGraphs();\n $(\\\".tooltip\\\").remove();\n });\n \n var emptyGraph = {\\\"label\\\":\\\"protocol\\\",\\\"data\\\":[]};\n function showTooltip(x, y, contents) {\n $('<div id=\\\"tooltip\\\" class=\\\"tooltip\\\">' + contents + '</div>').css( {\n top: y+5,\n left: x+5,\n }).appendTo(\\\"body\\\").fadeIn(200);\n }\n\n var previousPoint = null;\n var maand=new Array();\n maand[0]=\\\"Januari\\\";\n maand[1]=\\\"Februari\\\";\n maand[2]=\\\"Maart\\\";\n maand[3]=\\\"April\\\";\n maand[4]=\\\"Mei\\\";\n maand[5]=\\\"Juni\\\";\n maand[6]=\\\"Juli\\\";\n maand[7]=\\\"Augustus\\\";\n maand[8]=\\\"September\\\";\n maand[9]=\\\"October\\\";\n maand[10]=\\\"November\\\";\n maand[11]=\\\"December\\\";\n \n function findFlotPoint(value, array){\n for(var i = 0 ; i < array.length; i++) {\n var item = array[i][0];\n if( item == value){\n return i;\n }\n }\n }\n \";\n \n return $output;\n }", "public function OrderYear()\n {//--------------------------------------------------------------Lấy về năm (cái mà có bản ghi trả về)\n\t $arr=array();\n\t $select= \"SELECT DISTINCT(year(orderDate)) As orderYear FROM orders order by orderDate \";\n\t $result=$this->executeSelect($select);\n\t while($row=mysqli_fetch_array($result))\n\t {\n\t\t $year=new ordersDto();\n\t\t $year->setorderYear($row['orderYear']);\n\t\t $arr[]=$year;\n\t }\n\t $this->DisConnectDB();\n\t return $arr;\n }", "function get_all_by_key_by_year() {\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_set_form_g_and_o\n\t\t\t\tWHERE sfg_pos_id = ? AND sfg_pay_id = ?\";\n\t\t$query = $this->db->query($sql, array($this->sfg_pos_id, $this->sfg_pay_id));\n\t\treturn $query;\n\t}", "public function purchaseSalesInvoiceGraph($financial_month, $financialYearDD, $userId)\r\n\t{\r\n\t\t$invoiceArray=array();\r\n\t\t$invoiceData=array();\r\n\t\t\r\n\t\t$saleInvoice='SELECT count(reference_number) as sales_invoice \r\n\t\tFROM '.$this->tableNames['client_invoice'].'\r\n\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\tand added_by=\"'.$userId.'\"\r\n\t\tand is_deleted=\"0\" \r\n\t\tand is_canceled=\"0\"';\r\n\t\t\r\n\t\t//total purchase invoice\r\n\t\t$purchaseInvoice = 'SELECT count(reference_number) as purchase_invoice \r\n\t\tFROM '.$this->tableNames['client_purchase_invoice'].'\r\n\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\tand added_by=\"'.$userId.'\"\r\n\t\tand is_deleted=\"0\" \r\n\t\tand is_canceled=\"0\"';\r\n\r\n\t\t$totalSalesInvoice = $this->get_row($saleInvoice,false);\r\n\t\t$totalPurchaseInvoice = $this->get_row($purchaseInvoice,false);\r\n\t\t\r\n\t\tif(empty($totalSalesInvoice)) {\r\n\t\t\t$invoiceData['sales'] = \"0\";\r\n\t\t} else {\r\n\t\t\t$invoiceData['sales'] = $totalSalesInvoice[0];\r\n\t\t}\r\n\t\t\r\n\t\tif(empty($totalPurchaseInvoice)) {\r\n\t\t\t$invoiceData['purchase'] = \"0.00\";\r\n\t\t} else {\r\n\t\t\t$invoiceData['purchase'] = $totalPurchaseInvoice[0];\r\n\t\t\t$invoiceData['month'] = $financial_month;\r\n\t\t}\r\n\t\tarray_push($invoiceArray, $invoiceData);\r\n\t\treturn $invoiceArray;\r\n\t}", "function getTransactions() {\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_URL => \"https://hackathon-be.mybluemix.net/customer/304fd2e19f1c14fe3345cca788e4e83d/amexprofitability\",\n\t CURLOPT_USERAGENT => 'BankBase BOC Hackathon Request'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$resp_decode = json_decode($resp);\n\treturn $resp_decode;\n}", "function get_data(){\r\n include_once 'config.php';\r\n global $CONFIG;\r\n try{\r\n $db = new PDO('mysql:host='.$CONFIG['dbhost'].';dbname='.$CONFIG['dbname'].';charset=utf8', $CONFIG['dbuser'], $CONFIG['dbpass']);\r\n \r\n if(intval($_GET['last'])>1){\r\n $stmt = $db->query(\"SELECT date, weight FROM graph order by date DESC limit \".intval($_GET['last']));\r\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n $result = array_reverse($result);\r\n }else{\r\n $stmt = $db->query(\"SELECT date, weight FROM graph order by date ASC\");\r\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n }catch(PDOException $e){\r\n var_dump($e);\r\n }\r\n\r\n return $result;\r\n}", "function all(){\n\t\t$query = $this->db->query(\"SELECT * FROM transactions ORDER BY DateTime DESC;\");\n\t\t\n\t\treturn $query->result_array();\n\t}", "function getAllTransactions()\n {\n $transactions = $this->all();\n\n /* Add additional attributes to each Stock */\n foreach ($transactions as $transaction)\n {\n // Add a link to each stock's history page\n $transaction->href = '/transaction/' . $transaction->DateTime;\n }\n\n return $transactions;\n }", "public function index(Request $request)\n {\n $last_year_invoices = Invoice::whereDate('created_at', '>', Carbon::now()->subDays(365))->get();\n $last_month_invoices = Invoice::whereDate('created_at', '>', Carbon::now()->subDays(30))->get();\n $last_month_paid = 0;\n $last_month_unpaid = 0;\n $last_month_total = 0;\n $recurring_invoice = 0;\n $last_year_total = 0;\n $paid_invoice_per_day= []; // for graph\n\n foreach ($last_month_invoices as $last_month_invoice) {\n if ($last_month_invoice->is_paid == 1) {\n\n $last_month_paid = $last_month_paid + $last_month_invoice->total_amount;\n\n // paid invoice graph\n if (array_key_exists($last_month_invoice->created_at->format('M d'), $paid_invoice_per_day)) {\n $paid_invoice_per_day[$last_month_invoice->created_at->format('M d')] = $paid_invoice_per_day[$last_month_invoice->created_at->format('M d')] + $last_month_invoice->total_amount;\n }else{\n $paid_invoice_per_day[$last_month_invoice->created_at->format('M d')] = $last_month_invoice->total_amount;\n }\n\n }else{\n $last_month_unpaid = $last_month_unpaid + $last_month_invoice->total_amount;\n }\n\n // recurring total\n if ($last_month_invoice->is_autometic == 1) {\n $recurring_invoice = $recurring_invoice + $last_month_invoice->total_amount;\n }\n\n }\n $last_month_total = $last_month_paid + $last_month_unpaid;\n\n\n\n foreach ($last_year_invoices as $last_year_invoice) {\n $last_year_total = $last_year_total + $last_year_invoice->total_amount; \n }\n\n // customer list\n $keyword = $request->get('search');\n $perPage = 25;\n if (!empty($keyword)) {\n $customers = Customer::where('name', 'LIKE', \"%$keyword%\")\n ->orWhere('email', 'LIKE', \"%$keyword%\")\n ->orWhere('business_name', 'LIKE', \"%$keyword%\")\n ->orWhere('address', 'LIKE', \"%$keyword%\")\n ->orWhere('city', 'LIKE', \"%$keyword%\")\n ->orWhere('state', 'LIKE', \"%$keyword%\")\n ->orWhere('zip', 'LIKE', \"%$keyword%\")\n ->latest()->paginate($perPage);\n } else {\n $customers = Customer::latest()->paginate($perPage);\n }\n return view('home', compact('last_month_paid','last_month_unpaid','last_month_total','last_year_total', 'customers', 'paid_invoice_per_day', 'recurring_invoice'));\n }", "function getTrendData($indate) {\n $trendarray = [];\n $countryarray = array(\n \"AU\" => \"australia\",\n \"BR\" => \"brazil\",\n \"CA\" => \"canada\",\n \"GB\" => \"inggris\",\n \"ID\" => \"indonesia\",\n \"JP\" => \"jepang\",\n \"MX\" => \"mexico\",\n \"SE\" => \"swedia\",\n \"TR\" => \"turkey\",\n \"US\" => \"amerika\");\n\n foreach ($countryarray as $key => $value) {\n// echo \"\" . $key . \" \" . $value;\n $country = $value;\n $result = $GLOBALS['conn']->query(\"SELECT title, artist FROM `$country` WHERE `position`=1 AND `date`='$indate' LIMIT 1\"); \n if ($result->num_rows > 0) { \n // output data of each row \n $iter = 0; \n while($row = $result->fetch_assoc()) {\n $trendarray += array($key => \"\".$row[\"artist\"].\" - \".$row[\"title\"]);\n } \n } else { \n// echo \"\". $value . \" 0 results\". \"\\n\";\n }\n }\n\n foreach ($trendarray as $key => $value) {\n// echo \"\" . $key . \" \" . $value;\n }\n\n return $trendarray;\n }", "function get_inventory_data($month,$year) {\r\n\t\t\r\n\t\t$query = \"SELECT category, MONTH(auction_date) AS month, YEAR(auction_date) as year,\r\n\t\tSUM(pre_tax_amount) as pre_tax_amount, SUM(tax_amount) AS tax_amount FROM $table_name\r\n\t\tWHERE MONTH(auction_date)=:month AND YEAR(auction_date)=:year\r\n\t\tGROUP BY category ORDER BY category ASC\";\r\n\t\t\r\n\t\t$result = $this->execute_query($query,array(\":year\"=>$year,\":month\"=>$month));\t\r\n\t\t\r\n\t\tif($result === FALSE ) { $this->error_log[] = \"Error or empty result while calling \".__FUNCTION__; return FALSE; }\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $result;\t\r\n\t\t}\r\n\t}", "public function get_sales_data(Request $request){\n\n $sales_graph=$this->all_orders->groupBy(function($item){\n return ($item->created_at->format('Y:m'));\n })->map(function($item,$key){\n return ($item->sum('grand_total'));\n });\n $orders_graph=$this->all_orders->groupBy(function($item){\n return ($item->created_at->format('Y:m'));\n })->map(function($item,$key){\n return ($item->count());\n });\n \n $sales_str=\"[\";\n foreach($sales_graph as $key=>$value){\n\n if($sales_graph->last()==$value)\n $sales_str.='{\"Month\" : \"' . $key . '\", \"Sales\":\"'.$value .'\"}';\n else\n $sales_str.='{\"Month\": \"' . $key . '\", \"Sales\":\"'.$value .'\"},';\n }\n $sales_str.=\"]\";\n \n $orders_str=\"[\";\n \n foreach($orders_graph as $key=>$value){\n\n if($orders_graph->last()==$value)\n $orders_str.='{\"Month\" : \"' . $key . '\", \"Orders\":\"'.$value .'\"}';\n else\n $orders_str.='{\"Month\": \"' . $key . '\", \"Orders\":\"'.$value .'\"},';\n }\n $orders_str.=\"]\";\n\n\n echo json_encode([$sales_str,$orders_str]);\n }", "public function getCurrentMonthData() {\n\t\t//return $this->getDataByInterval($currentMonth, $currentYear, $currentMonth, $currentYear);\n\t\t$dates = getPeriods('CurrentMonth');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear']);\t\t\n\t}", "public function getTransactionStats($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n\n DB::enableQueryLog();\n // execute\n // transaction count\n $currentTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('orderline_statuses.name', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n // ->groupBy('status')\n ->get();\n\n $prevTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('orderline_statuses.name', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n // ->groupBy('status')\n ->get();\n\n\n // total transaction value\n $currentTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->get();\n\n $prevTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->get();\n\n // transaction status\n $transactionStatus = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('orderline_statuses.name, count(*)'))\n // ->whereIn('status', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->groupBy('orderline_statuses.name')\n ->orderByRaw('count desc')\n ->get();\n\n // payment method\n $paymentMethod = DB::connection('marketplace')\n ->table('orders')\n ->join('payment_method_types', 'orders.payment_method_type_id', '=', 'payment_method_types.id')\n ->select(DB::raw('payment_method_types.name, count(*)'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n // ->where('status', '=', $this->successStatus)\n ->groupBy('payment_method_types.name')\n ->orderByRaw('count desc')\n ->get(); \n\n $data = array();\n\n $data['transaction'] = array();\n $data['transaction']['count'] = array();\n $data['transaction']['count']['current'] = $currentTransactionCount[0];\n $data['transaction']['count']['prev'] = $prevTransactionCount[0];\n $data['transaction']['value'] = array();\n $data['transaction']['value']['current'] = $currentTransactionValue[0];\n $data['transaction']['value']['prev'] = $prevTransactionValue[0];\n \n $data['transaction_status'] = $transactionStatus;\n $data['payment_method'] = $paymentMethod;\n \n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "function get_refund_by_ccode($ccode,$currentdate) {\n\tglobal $db;\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(gp_transaction.gp_trans_datetime) AS year, MONTH(gp_transaction.gp_trans_datetime) AS month, COUNT(DISTINCT gp_transaction.gp_transaction_id) AS transcount, SUM(gp_transaction.gp_amount) AS transamount FROM merchants JOIN gp_transaction ON gp_transaction.gp_merchant_id = merchants.mer_map_id AND merchants.currency_code= '$ccode' AND gp_transaction.gp_transaction_type IN ('2','s2') AND gp_transaction.gp_status='success' AND MONTH(gp_transaction.gp_trans_datetime) = MONTH('$currentdate') GROUP BY year, month\";\n\t$transactionsDetails = $db->rawQuery($M_R_query);\n\treturn $transactionsDetails;\n}", "public function getTransactionByAjax()\n {\n $data = [];\n try {\n $orders = Invoice::whereHas('invoiceDetail.testPackage', function ($query) {\n if (Auth::guard('tutor')->check()) {\n $tutor_id = Auth::guard('tutor')->user()->TutorID;\n $query->where('TutorID', $tutor_id);\n }\n })\n ->whereHas('paymentTransaction', function ($query) {\n if (Auth::guard('tutor')->check()) {\n $query->where('ExternalTransactionStatusID', 3);\n }\n })\n ->select(DB::raw(\"convert(date, CreateDate, 105) as sale_date, SUM(Amount) as total_count\"))\n ->groupBy(DB::raw(\"convert(date, CreateDate, 105)\"))\n ->orderBy(DB::raw(\"convert(date, CreateDate, 105)\", 'ASC'))\n ->get()->toArray();\n\n $total = array_column($orders, 'total_count');\n $date = array_column($orders, 'sale_date');\n $data['total'] = $total;\n $data['date'] = $date; \n return $data;\n } catch (\\Exception $e) {\n echo $e->getMessage();\n Log::channel('loginfo')->error('Get date wise total price by ajax.',['PurchasePackagesRepository/getTransactionByAjax', $e->getMessage()]);\n return false;\n }\n return $data;\n }", "public function getTrades(string $date = null): array;", "function get_refund_by_ccode($ccode,$currentdate) {\r\n\tglobal $db;\r\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.refund_amount) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND merchants.currency_code= '$ccode' AND transaction_alipay.transaction_type IN ('2','s2') AND transaction_alipay.result_code='SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$currentdate') GROUP BY year, month\";\r\n\t$transactionsDetails = $db->rawQuery($M_R_query);\r\n\treturn $transactionsDetails;\r\n}", "function get_planned_orders_for_acconuts_per_year($year, $accounts)\n{\n if (!$year) {\n $year = date('Y');\n }\n\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n\n if (empty($accounts)) {\n return [];\n }\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'planned_order')\n ->fieldCondition('field_planned_account', 'target_id', $accounts, 'IN')\n ->fieldCondition('field_planned_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_period', 'value', $end_date, '<=')\n ->fieldCondition('field_planned_actual_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_actual_period', 'value', $end_date, '<=')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n\n if (isset($records['node'])) {\n return $records['node'];\n }\n}", "function get_vehicles_by_year() {\n global $db;\n $query = 'SELECT * FROM vehicles\n ORDER BY year DESC';\n $statement = $db->prepare($query);\n $statement->execute();\n $vehicles = $statement->fetchAll();\n $statement->closeCursor();\n return $vehicles;\n }", "public function get_month_data($month = \"January\", $year = 2015){\n\t\t/* if($year==2015)\n\t\t$year = date('y'); */\n\t\t// echo date( 'F Y');\n\t\t$this->loadModel(\"Invoice.Invoice\");\n\t\t$this->loadModel(\"Transaction.Transaction\");\n\t\t$month_first_day = strtotime( 'first day of ' . $month.' '.$year);\n\t\t$month_last_day = strtotime( 'last day of ' . $month.' '.$year);\n\t\t// echo date('Y-m-d',$month_last_day);\n\t\t// $dt = new DateTime('first Monday of this month');\n\t\t$dt = new DateTime('first Monday of '.$month.' '.$year);\n\t\t// echo $dt->format('Y-m-d');\n\t\t$first_week_start = $dt->getTimestamp(); \n\t\t$week_last = $first_week_start;\n\t\t$this->Invoice->belongsTo = array('Client' => array('className'=>\"Usermgmt.Client\",'foreignKey'=>'client_id'));\n\t\t$this->Transaction->belongsTo = array('Invoice' => array('className'=>\"Invoice.Invoice\",'foreignKey'=>'invoice_id'));\n\t\t$this->Transaction->recursive = 2;\n\t\t$this->Transaction->Behaviors->load('Containable');\n\t\t\n\t\t$all_transactoins = array();\n\t\tfor($current =$month_first_day; ($week_last<$month_last_day && $week_last<time()); $week_last += (7*86400)){\n\t\t\t\n\t\t\t\t$transactions = $this->Transaction->find(\"all\",array(\"conditions\"=>array(\"UNIX_TIMESTAMP(STR_TO_DATE(Transaction.payment_date, '%m-%d-%Y')) >\"=>$current,\"UNIX_TIMESTAMP(STR_TO_DATE(Transaction.payment_date, '%m-%d-%Y')) <\"=>$week_last,'Transaction.status'=>1),'contain'=>array(\"Invoice\"=>array(\"fields\"=>array(\"title\",\"client_id\",\"payment\",\"tax\",\"total\")),\"Invoice.Client\"=>array(\"fields\"=>array(\"first_name\",\"last_name\"))),\"fields\"=>array(\"invoice_id\",\"payment_date\",\"method\")));\n\t\t\t\t\n\t\t\t\t$all_transactoins[date('m/d/Y',$current).'-'.date('m/d/Y',$week_last)] = $transactions;\n\t\t\t\t\n\t\t\t\t// pr($transactions); die;\n\t\t\t\n\t\t\t$current =$week_last;\n\t\t}\n\t\treturn $all_transactoins;\n\t\t\n\t}", "public function findSumByYear(\\DateTime $date);", "public function getTransactions()\n\t{\n\t\treturn $this->data['transactions'];\n\t}", "function get_cancel_by_ccode($ccode,$currentdate) {\n\tglobal $db;\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(gp_transaction.gp_trans_datetime) AS year, MONTH(gp_transaction.gp_trans_datetime) AS month, COUNT(DISTINCT gp_transaction.gp_transaction_id) AS transcount, SUM(gp_transaction.gp_amount) AS transamount FROM merchants JOIN gp_transaction ON gp_transaction.gp_merchant_id = merchants.mer_map_id AND merchants.currency_code= '$ccode' AND gp_transaction.gp_transaction_type IN ('4','s4') AND gp_transaction.gp_status='success' AND MONTH(gp_transaction.gp_trans_datetime) = MONTH('$currentdate') GROUP BY year, month\";\n\t$transactionsDetails = $db->rawQuery($M_R_query);\n\treturn $transactionsDetails;\n}", "public function getStatForDonations() {\r\n // TODO: Move to config\r\n $requiredPerYear = 1000;\r\n $requiredPerMonth = 85;\r\n\r\n // Calculate donations received for current year\r\n $result = $this->dao->query(\"\r\n SELECT\r\n SUM(amount) AS YearDonation,\r\n year(NOW()) AS yearnow,\r\n month(NOW()) AS month,\r\n quarter(NOW()) AS quarter\r\n FROM\r\n donations\r\n WHERE\r\n created > CONCAT(CONCAT(year(NOW()), '-01'), '-01')\r\n \");\r\n $rowYear = $result->fetch(PDB::FETCH_OBJ);\r\n\r\n switch ($rowYear->quarter) {\r\n case 1:\r\n $start = $rowYear->yearnow . \"-01-01\";\r\n $end = $rowYear->yearnow . \"-04-01\";\r\n break;\r\n case 2:\r\n $start = $rowYear->yearnow . \"-04-01\";\r\n $end = $rowYear->yearnow . \"-07-01\";\r\n break;\r\n case 3:\r\n $start = $rowYear->yearnow . \"-07-01\";\r\n $end = $rowYear->yearnow . \"-10-01\";\r\n break;\r\n case 4:\r\n $start = $rowYear->yearnow . \"-10-01\";\r\n $end = $rowYear->yearnow . \"-12-31\";\r\n break;\r\n }\r\n\r\n $query = \"\r\n SELECT\r\n SUM(ROUND(amount)) AS Total,\r\n year(now()) AS year\r\n FROM\r\n donations\r\n WHERE\r\n created >= '$start'\r\n AND\r\n created < '$end'\r\n \";\r\n $result = $this->dao->query($query);\r\n\r\n $row = $result->fetch(PDB::FETCH_OBJ);\r\n $row->QuarterDonation = sprintf(\"%d\", $row->Total);\r\n $row->MonthNeededAmount = $requiredPerMonth;\r\n $row->YearNeededAmount = $requiredPerYear;\r\n $row->QuarterNeededAmount = $requiredPerMonth * 3;\r\n $row->YearDonation = $rowYear->YearDonation;\r\n\r\n return $row;\r\n }", "public function getPaymentHistory(){\r\n\t\t$result = array();\r\n\t\treturn $result;\r\n\t}", "function get_cancel_by_ccode($ccode,$currentdate) {\r\n\tglobal $db;\r\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.total_fee) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND merchants.currency_code= '$ccode' AND transaction_alipay.transaction_type IN ('4','s4') AND transaction_alipay.result_code='SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$currentdate') GROUP BY year, month\";\r\n\t$transactionsDetails = $db->rawQuery($M_R_query);\r\n\treturn $transactionsDetails;\r\n}", "private function getMonthlyActualPaymentsForTheCurrentYear($current_year)\n {\n $actual_expense = Transaction::mine()->where('type', 'expense')\n ->whereYear('transaction_date', $current_year)\n ->select(\n DB::raw('YEAR(transaction_date) year'),\n DB::raw('MONTH(transaction_date) month'),\n DB::raw('sum(amount) as ammount')\n )\n ->orderBy('transaction_date')\n ->groupBy(DB::raw('MONTH(transaction_date)'))\n ->get()->groupBy(function($row){\n return $row->month;\n });\n return $actual_expense;\n }", "public function GetExpertTransactions(){\n\t\tif($this->IsLoggedIn('cashier')){\n\t\t\tif(isset($_GET) && !empty($_GET)){\n\t\t\t\t$where=array(\n\t\t\t\t\t'from_date'\t=>$_GET['from_date'],\n\t\t\t\t\t'to_date'\t\t=> $_GET['to_date']\n\t\t\t\t);\n\t\t\t\t\t$data=$this->CashierModel->GetExpertTransactions($where);\n\t\t\t\t\t$this->ReturnJsonArray(true,false,$data['res_arr']);\n die;\n\t\t\t}else{\n\t\t\t\t$this->ReturnJsonArray(false,true,\"Wrong Method!\");\n\t\t\t\tdie;\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t\telse{\n\t\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t}\n\t}", "public function get_chart($where){\n\t\t\t$this->db->select('SUM(trans_pembayaran) as jumlah, monthname(tgl_trans) as bulan');\n\t\t\t$this->db->where('status = \"done\"');\n\t\t\t$this->db->like('DATE_FORMAT(tgl_trans, \"%Y\")', $where);\n\t\t\t$this->db->group_by('DATE_FORMAT(tgl_trans, \"%m\")');\n\t\t\treturn $this->db->get('transaksi')->result_array();\n\t\t}", "public function getGraphView()\n\t{\n\t\t$chart = new ComboChart();\t\t\n\n\t\t// switch selon le type d'analyse\n\t\tswitch ($this->time) {\n\t\t\t// cas analyse jour\n\t\t\tcase 'day':\t\t\t\t\n\t\t\t $sql = 'SELECT \n\t\t\t\t\t\t\tdate(date_time) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\tgroup by date(date_time)';\n\t\t\t\t\tbreak;\t\t\t\n\t\t\tcase 'month':\n\t\t\t// cas analyse mois\n\t\t\t\t$sql = 'SELECT \n\t\t\t\t\t\t\tleft(date(date_time),7) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\tgroup by left(date(date_time),7)';\n\t\t\t\tbreak;\n\t\t\tcase 'year':\n\t\t\t// cas analyse année\n\t\t\t\t$sql = 'SELECT \n\t\t\t\t\t\t\tleft(date(date_time),4) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\tgroup by left(date(date_time),4)';\n\t\t\t\tbreak;\n\t\t\tcase 'week':\n\t\t\t// cas analyse 7 derniers jours\n\t\t\t\t$date = new dateTime();\n\t\t\t\t$startDate = $date->format('Y-m-d');\n\t \t\t \t$endDate = $date->modify('-1 week');\n\t \t\t \t$endDate = $endDate->format('Y-m-d');\n\n\t\t\t\t$sql = \"SELECT \n\t\t\t\t\t\t\tdate(date_time) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\twhere date_time BETWEEN '\" . $endDate . \"' and '\" . $startDate . \"'\n\t\t\t\t\t\tgroup by date(date_time)\";\n\t\t\t\tbreak;\n\t\t}\n\n\n\t $stmt = $this->em->query($sql);\n\t $views = $stmt->fetchAll();\n\n\t\t// entete du googleGraph\n\t\t$arrayToDataTable[] = ['', 'Montant', ['role' => 'tooltip'], 'Evolution', ['role' => 'tooltip']]; \n\n\t\t//data du googleGraph\n\t\tforeach ($views as $view){\n\t\t\t$arrayToDataTable[] = [$view['date'], intval($view['nb']), intval($view['nb']) .\" vues\", 0, \"evolution\"];\n\t\t}\n\n\t\t$chart->getData()->setArrayToDataTable($arrayToDataTable);\n\t\t$vAxisAmount = new VAxis();\n\t\t$vAxisAmount->setTitle('Nombre de vues');\n\t\t$chart->getOptions()->setVAxes([$vAxisAmount]);\n\n\t\t$seriesAmount = new \\CMEN\\GoogleChartsBundle\\GoogleCharts\\Options\\ComboChart\\Series();\n\t\t$seriesAmount->setType('bars');\n\t\t$seriesAmount->setTargetAxisIndex(0);\n\t\t$seriesEvol = new \\CMEN\\GoogleChartsBundle\\GoogleCharts\\Options\\ComboChart\\Series();\n\t\t$seriesEvol->setType('line');\n\t\t$seriesEvol->setTargetAxisIndex(1);\n\t\t$chart->getOptions()->setSeries([$seriesAmount, $seriesEvol]);\n\t\t$chart->getOptions()->setColors(['black', 'red']);\t\n\n\t\treturn $chart;\t\t\n\t}", "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 }", "protected function getLastYearScope($src_bu) {\n $currentTime = date('Y-m', time());\n //get Arr of last year but same month\n $lastYearArr = array();\n $lastYearFinal = array();\n for ($i = 0; $i < 12; $i++) {\n $lastYearArr[$i] = date('Y-m', strtotime('-1 year, +' . $i . ' month', strtotime($currentTime)));\n }\n foreach ($lastYearArr as $key => $ly) {\n $daysOfMonth = date('t', strtotime($ly));\n $lastYearFinal[$key] = $ly . '-' . $daysOfMonth;\n }\n\n $em = $this->getDoctrine()->getManager();\n $qb = $em->createQueryBuilder();\n $qb->select('date')\n ->from('AlbatrossDailyBundle:Date', 'date')\n ->leftJoin('date.bu', 'bu');\n if ($src_bu == null) {\n $qb->where('bu.id is null');\n } else {\n $qb->where('bu.id = :bid');\n $qb->setParameter('bid', $src_bu->getId());\n }\n $qb->andWhere('date.dailydate IN (:dayArr)')\n ->setParameter('dayArr', $lastYearFinal);\n $query = $qb->getQuery();\n $result = $query->getArrayResult();\n\n $dateIdArr = array();\n foreach ($result as $re) {\n $dateIdArr[] = $re['id'];\n }\n $scopeQb = $em->createQueryBuilder();\n $scopeQb->select('number', 'date2')\n ->from('AlbatrossDailyBundle:Number', 'number')\n ->leftJoin('number.date', 'date2')\n ->leftJoin('number.status', 'status')\n ->where('date2.id IN (:dateId)')\n ->setParameter('dateId', $dateIdArr)\n ->andWhere('status.id = 1');\n $scopeQuery = $scopeQb->getQuery();\n $scopeResult = $scopeQuery->getArrayResult();\n $temp = array_flip($lastYearFinal);\n foreach ($scopeResult as $s) {\n $temp[$s['date']['dailydate']->format('Y-m-d')] = $s['number'];\n }\n $final = array();\n foreach ($temp as $key => $f) {\n if (is_int($f)) {\n $temp[$key] = '0';\n }\n $final[] = $temp[$key];\n }\n\n return $final;\n }" ]
[ "0.63582754", "0.634956", "0.57779545", "0.56938326", "0.5657003", "0.5616629", "0.561383", "0.54926366", "0.5490506", "0.5480437", "0.54111034", "0.53703535", "0.53418267", "0.5303236", "0.52978903", "0.52888536", "0.5286701", "0.52859354", "0.52704364", "0.52629477", "0.52465475", "0.5244771", "0.52238804", "0.52185994", "0.52098596", "0.52061915", "0.5179443", "0.51779383", "0.5175811", "0.51745594", "0.5171647", "0.5171022", "0.5166491", "0.51642466", "0.514347", "0.51372856", "0.51136035", "0.5092994", "0.50830996", "0.50770646", "0.506664", "0.5065798", "0.50652194", "0.5064653", "0.50623375", "0.5061365", "0.50494283", "0.5028754", "0.5008165", "0.4982495", "0.49775082", "0.49629405", "0.49620417", "0.49594948", "0.49588183", "0.49506208", "0.49359363", "0.49256688", "0.49228233", "0.49191722", "0.49190855", "0.49133816", "0.49020442", "0.48963815", "0.48962983", "0.4890824", "0.4889122", "0.48875564", "0.4887182", "0.4886889", "0.4886573", "0.48800802", "0.48786288", "0.48749694", "0.4869429", "0.48605183", "0.48556408", "0.48554823", "0.4853009", "0.4847865", "0.48475748", "0.4844018", "0.48356524", "0.48350978", "0.4833985", "0.4826818", "0.48256359", "0.48235583", "0.48230293", "0.4808015", "0.4802349", "0.4799859", "0.47937948", "0.4793334", "0.47886905", "0.478819", "0.47834036", "0.47824508", "0.4782212", "0.47815996" ]
0.60402113
2
Get transaction data for graph last 2 years
public function getTransactionDataLast2Years($customerId) { $to = $this->_date->date('Y-m-d'); $from = strtotime($to."-2year"); $from = $this->_date->date('Y-m-d', $from); $to .= ' 23:59:59'; $transactionResource = $this->_transactionFactory->create()->getResource(); $result = []; $data = $transactionResource->getReceivedCreditTransactionsByMonth($from, $to, $customerId); $result = $this->_processReceivedTransactionData($data, $result); $data = $transactionResource->getSpentCreditTransactionsByMonth($from, $to, $customerId); $result = $this->_processSpentTransactionData($data, $result); $result = array_values($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLastYearData() {\n\t\t$dates = getPeriods('LastYear');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear'], 12);\t\t\n\t}", "public function getGraphDataForAnAccount($startDate, $endDate, $acc_id){\n\t\t$result = Transaction::where('account_id', '=', $acc_id)->get();\n\t\t$tset = $result->toArray();\n\t\t$tm = new TransactionManager();\n\t $tset = $tm -> sortTransactionsByDates($tset);\n\t $tset = array_reverse($tset);\n\n\t $graphData = array();\n\t $cDate = $startDate;\n\t $prevBalance = 0;\n\t $transactionBeforeStartExists = false;\n\n\t if(empty($tset))\n\t \treturn array();\n\t \n\t foreach($tset as $t){\n\t \t//if cDate is before startDate, skip \n\t \tif($tm->rawDateCompare($t['date'], $startDate) > 0) {\n\t \t\t$prevBalance += $t['amount'];\n\t \t\t$transactionBeforeStartExists = true;\n\t \t\tcontinue;\n\t \t}\n\t \t//if date is after endDate, skip\n\t \tif($tm->rawDateCompare($t['date'], $endDate) < 0)\n\t \t\tcontinue;\n\t \t//transaction is in range, sum it to graphData\n\t \tif(!array_key_exists($t['date'], $graphData))\n\t \t\t$graphData[$t['date']] = 0;\n\t \t$graphData[$t['date']] += $t['amount'];\n\t }\n\t \n\t //cumulate each data point\n\t $net = $prevBalance;\n\t foreach($graphData as &$g){\n\t \t$net += $g;\n\t \t$g = $net;\n\t }\n\t //all data points betwen sDate and earliest transaction are $prevBalance\n\t $paddingLeft = array();\n\t $paddingRight = array();\n\n\t if($transactionBeforeStartExists){\n\t\t if(!array_key_exists($startDate, $graphData))\n\t\t \t$paddingLeft[$startDate] = $prevBalance;\n\t\t}\n\t if(!array_key_exists($endDate, $graphData))\n\t \t$paddingRight[$endDate] = $net;\t \n\t \n\t //all points between latest transaction and fDate are $net\n\t return array_merge($paddingLeft, $graphData, $paddingRight);\n\t}", "public function getTransactionDataLastYear($customerId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-1year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $transactionResource = $this->_transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processReceivedTransactionData($data, $result);\n \n $data = $transactionResource->getSpentCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processSpentTransactionData($data, $result);\n \n $result = array_values($result);\n return $result;\n }", "public function TransactionChart(Request $request)\n {\n \t$year = $request->input('year') ? $request->input('year') : date('Y'); \n \t$chartData = DB::table('trans_peryear_view')\n \t\t\t\t->where('year', $year)\n \t\t\t\t->get();\n\n \treturn response()->json(['chartData' => $chartData], 200);\n }", "public function getBlock()\n\t{\n\t\t$chart = new \\IPS\\Helpers\\Chart;\n\t\t\n\t\t$chart->addHeader( \"Day\", 'date' );\n\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t{\n\t\t\t$chart->addHeader( $currency, 'number' );\n\t\t}\n\t\t\n\t\t$thirtyDaysAgo = \\IPS\\DateTime::create()->sub( new \\DateInterval('P30D') );\n\t\t\t\t\n\t\t$results = array();\n\t\tforeach( \\IPS\\Db::i()->select( \"t_currency, DATE_FORMAT( FROM_UNIXTIME( t_date ), '%e %c %Y' ) AS date, SUM(t_amount)-SUM(t_partial_refund) AS amount\", 'nexus_transactions', array( 't_date>? AND (t_status=? OR t_status=?)', $thirtyDaysAgo->getTimestamp(), \\IPS\\nexus\\Transaction::STATUS_PAID, \\IPS\\nexus\\Transaction::STATUS_PART_REFUNDED ), NULL, NULL, array( 't_currency', 'date' ) ) as $result )\n\t\t{\n\t\t\t$results[ $result['date'] ][ $result['t_currency'] ] = $result['amount'];\n\t\t}\n\t\t\t\t\n\t\t$monthAndYear = date( 'n' ) . ' ' . date( 'Y' );\n\t\tforeach ( range( 30, 0 ) as $daysAgo )\n\t\t{\n\t\t\t$datetime = new \\IPS\\DateTime;\n\t\t\t$datetime->setTime( 0, 0, 0 );\n\t\t\t$datetime->sub( new \\DateInterval( 'P' . $daysAgo . 'D' ) );\n\t\t\t$resultString = $datetime->format('j n Y');\n\t\t\t\n\t\t\tif ( isset( $results[ $resultString ] ) )\n\t\t\t{\n\t\t\t\t$row = array( $datetime );\n\t\t\t\t\n\t\t\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t\t\t{\n\t\t\t\t\tif ( !isset( $results[ $resultString ][ $currency ] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$row[] = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$row[] = $results[ $resultString ][ $currency ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$chart->addRow( $row );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$row = array( $datetime );\n\t\t\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t\t\t{\n\t\t\t\t\t$row[] = 0;\n\t\t\t\t}\n\t\t\t\t$chart->addRow( $row );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $chart->render( 'LineChart' );\n\t}", "public function graphData()\n {\n $dayOfWeek = ['Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo'];\n $colors = [\n 'rgba(201, 203, 207, 0.8)', //gray\n 'rgba(255, 99, 132, 0.8)', //Red\n 'rgba(255, 159, 64, 0.8)', //Orange\n 'rgba(75, 192, 192, 0.8)', //green\n 'rgba(54, 162, 235, 0.8)', //blue\n 'rgba(153, 102, 255, 0.8)', //purple\n 'rgba(255, 205, 86, 0.8)', //yellow\n ];\n $borderColors = [\n 'rgba(201, 203, 207, 1)', //gray\n 'rgba(255, 99, 132, 1)', //Red\n 'rgba(255, 159, 64, 1)', //Orange\n 'rgba(75, 192, 192, 1)', //green\n 'rgba(54, 162, 235, 1)', //blue\n 'rgba(153, 102, 255, 1)', //purple\n 'rgba(255, 205, 86, 1)', //yellow\n ];\n $months = ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'];\n $now = Carbon::now()->timezone($this->timezome);\n $data = [];\n\n switch ($this->graphPeriod) {\n case 'weekly':\n $data = $this->getDataFromWeeklySales($colors, $borderColors);\n break;\n case 'weeklyAccumulated':\n $data = $this->getDataFromWeeklySales($colors, $borderColors, true);\n break;\n case 'monthly':\n $labels = [];\n $date = $now->copy()->subMonths(5)->startOfMonth()->startOfDay();\n $end = $now->copy()->endOfDay();\n $count = 0;\n\n for ($i = 1; $i < 32; $i++) {\n $labels[] = $i;\n }\n\n while ($date->lessThanOrEqualTo($end)) {\n $label = $months[$date->month - 1];\n $data = [];\n $endOfMonth = $date->copy()->endOfMonth()->endOfDay();\n $sale = 0;\n\n while ($date->lessThanOrEqualTo($endOfMonth) && $date->lessThanOrEqualTo($end)) {\n $sale += $this->getSumFromGraphPeriod($date, $this->graphCategory);\n $data[] = $sale;\n $date->addDay();\n }\n\n $datasets[] = [\n 'label' => $label,\n 'backgroundColor' => $colors[$count],\n 'borderColor' => $borderColors[$count],\n 'borderWidth' => 1,\n 'data' => $data,\n 'fill' => false\n ];\n\n $count++;\n }\n\n $data = [\n 'labels' => $labels,\n 'datasets' => $datasets,\n 'type' => 'line'\n ];\n break;\n default:\n # code...\n break;\n }\n return $data;\n }", "public function getAmountsDataLast2Years($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-2year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getAmountsByMonth($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "function charts($data1) {\n\t $startDate = Carbon::now()->subDay(365);\n\t $endDate = Carbon::now();\n\t\n\t\t//THIS RETURNS THE 4 BOXES\n\t\t$month = $data->filter(function($data1){ return $data1->created_at->format('m-y') == date('m-y'); });\n\t\t$lastmonth = $data->filter(function($data1){ return $data1->created_at->format('m-y') == Carbon::now()->firstOfMonth()->subMonth()->format('m-y'); });\n\t\t$year = $data->filter(function($data1){ return $data1->created_at->format('y') == date('y'); });\n\t\t$lastyear = $data->filter(function($data1){ return $data1->created_at->format('y') == Carbon::now()->subYear()->format('y'); });\n\t\n\t}", "public function getOrdersDataLast2Years($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-2year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getNumOfOrderByMonth($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function getTransactions();", "public function getTimeSeries() {\n $series = array();\n foreach($this -> _trades as $trade) {\n \n $month = date('M',$trade['timestamp']);\n if(!isset($series[$month])) {\n $series[$month] = 0;\n }\n if(!empty($trade['delta'])) {\n $series[$month] += $trade['delta'] - (isset($trade['fee']) ? $trade['fee'] : 0);\n }\n }\n return $series;\n }", "public function incomeGraphData()\n {\n $incomes = Income::all();\n $channelingIncomes = $incomes->where('incomeable_type', Incomes::CHANNELING_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n $pharmacyIncomes = $incomes->where('incomeable_type', Incomes::PHARMACY_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n\n return ResponseHelper::findSuccess('Income Graph Data', [\n 'channelingIncomeGraphData' => $channelingIncomes,\n 'pharmacyIncomeGraphData' => $pharmacyIncomes,\n ]);\n }", "public function getTransactionByHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $transaction = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, count(*),'.$dateQuery))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n // ->toSql();\n ->get();\n // dd ($data);\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['transaction'] = $transaction;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function getAnnualSales() {\n\t\t// Query\n\t\t$sql = '\n\t\t\tSELECT \n\t\t\t\tDATE_FORMAT(transactionDate, \"%Y\") AS year, \n\t\t\t\tSUM(amount) AS amount\n\t\t\tFROM \n\t\t\t\ttransactions\n\t\t\tGROUP BY \n\t\t\t\tDATE_FORMAT(transactionDate, \"%Y\")\n\t\t';\n\n\t\t// Return\n\t\treturn DB::select($sql);\n\t}", "abstract protected function getTransactions();", "public function getSaleByMonth2($year = null)\n {\n $date = new \\DateTime(\"now\");\n $currentYear = $date->format('y');\n //If the value of $year is not define then use the current year (default)\n if(!$year){\n $year = $currentYear;\n }\n \n //Get all the STransaction from the DB first.\n $STransactions = $this->em->getRepository('TransactionBundle:STransaction')->findAll();\n $months = array('jan' => 0, 'feb' => 0, 'mar' => 0, 'apr' => 0, 'may' => 0, 'jun' => 0, 'jul'\n => 0, 'aug' => 0, 'sep' => 0, 'oct' => 0, 'nov' => 0, 'dec' => 0);\n foreach ($STransactions as $st){\n $m = $st->getCreatedAt()->format(\"m\");\n $y = $st->getCreatedAt()->format(\"y\");\n if($m == 01 && $y == $year){\n $months['jan'] = $months['jan'] + $st->getTotalAmount();\n }elseif($m == 11 && $y == $year){\n $months['nov'] = $months['nov'] + $st->getTotalAmount();\n }\n }\n \n return $months;\n \n }", "function getSalesByYear() {\n // Function to connect to the DB\n $link = connectToDB();\n\t\n //Initialize <categories> element\n $strCat = \"<categories>\";\n\n //Initialize datasets\n $strAmtDS = \"<dataset seriesname='Revenue'>\";\n $strQtyDS = \"<dataset seriesName='Units Sold' parentYAxis='S'>\";\n\n $strSQL = \"SELECT Year(o.OrderDate) As SalesYear, ROUND(SUM(d.Quantity*p.UnitPrice),0) As Total, SUM(d.Quantity) as Quantity FROM FC_OrderDetails as d,FC_Orders as o,FC_Products as p WHERE o.OrderID=d.OrderID and d.ProductID=p.ProductID GROUP BY Year(o.OrderDate) ORDER BY Year(o.OrderDate)\";\n $result = mysql_query($strSQL) or die(mysql_error());\n\t\n if ($result) {\n while($ors = mysql_fetch_array($result)) {\n $strCat .= \"<category label='\" . $ors['SalesYear'] . \"'/>\";\n\n //Generate the link\n $strLink = urlencode(\"javaScript:updateCharts(\" . $ors['SalesYear'] . \");\");\n $strAmtDS .= \"<set value='\" . $ors['Total'] . \"' link='\" . $strLink . \"'/>\";\n $strQtyDS .= \"<set value='\" . $ors['Quantity'] . \"'/>\";\n }\n }\n mysql_close($link);\n\n\t//Closing elements\n\t$strCat .= \"</categories>\";\n\t$strAmtDS .= \"</dataset>\";\n\t$strQtyDS .= \"</dataset>\";\n\t//Entire XML - concatenation\n\t$strXML = $strCat . $strAmtDS . $strQtyDS;\n\n\treturn $strXML;\n}", "public function getTransactionByHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $transaction = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, count(*),'.$dateQuery))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n // ->toSql();\n ->get();\n // dd ($data);\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['transaction'] = $transaction;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function getAmountsDataLastYear($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-1year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getAmountsByMonth($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function expenseGraphData()\n {\n $expenses = Expense::all();\n $supplierPayments = $expenses->where('expensable_type', Expenses::GOOD_RECEIVE)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n $doctorPayments = $expenses->where('expensable_type', Expenses::SCHEDULE_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n\n return ResponseHelper::findSuccess('Expense Graph Data', [\n 'supplierPaymentsGraphData' => $supplierPayments,\n 'doctorPaymentsGraphData' => $doctorPayments,\n ]);\n }", "public function doctorIncomeGraphData()\n {\n $schedules = Auth::user()->doctor->schedules;\n $channelingIncomeGraphData = Appointment::whereIn('schedule_id', $schedules->pluck('id'))\n ->whereIn('status', [Appointments::PENDING, Appointments::COMPLETED])\n ->get()\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum(function ($appointment) {\n return $appointment->schedule->doctor_fee;\n })\n ];\n })->values()->all();\n $receivedPaymentsGraphData = Expense::whereIn('expensable_id', $schedules->pluck('id'))\n ->get()\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n return ResponseHelper::findSuccess('Items Summary Data', [\n 'channelingIncomeGraphData' => $channelingIncomeGraphData,\n 'receivedPaymentsGraphData' => $receivedPaymentsGraphData,\n ]);\n }", "public function get_trend_data_rows()\n\t{\n\t\t$dates = array();\n\t\t$i_rows = array();\n\t\t$sr_rows = array();\n\t\t$trend_data = array();\n\n\t $current_month = date_create()->format('Y-m-d H:i:s');\n\n\t // echo $current_month_first_day=date_create($current_month)\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\t $current_month_first_day=date_create($current_month)\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n\n $dates[] = $current_month_first_day;\n\n //echo\"</br>\";\n \n // echo $current_month_current_day=date_create($current_month)\n // ->format(\"Y-m-d 23:59:59\");\n\n $current_month_current_day=date_create($current_month)\n ->format(\"Y-m-d 23:59:59\");\t\n\n $dates[] = $current_month_current_day;\n\n //echo\"</br></br>\";\n\n // echo $second_month_first_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $second_month_first_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $second_month_first_day;\n\n //echo\"</br>\";\n\n // echo $second_month_last_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n $second_month_last_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $second_month_last_day;\n\n// echo\"</br></br>\";\n\n // echo $third_month_first_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $third_month_first_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $third_month_first_day;\n\n //echo\"</br>\";\n \t\t\t\n // echo $third_month_last_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n\t $third_month_last_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $third_month_last_day;\n\n // echo\"</br>\";\t\n // echo \"<pre>\";\n // print_r($dates);\n\t // echo \"</pre>\";\t\n\t // echo\"</br>\";\t\t\t \n\n for ($i=0; $i <=5 ; $i=$i+2)\n { \t\n \t//echo\"</br>\";\n\n \t$start = new DateTime($dates[$i]);\n \t\n \t//echo\"</br>\";\n\n\t\t$start = date_format($start,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\n\t\t$end = new DateTime($dates[$i+1]);\n\n\t\t//echo\"</br>\";\n\n\t\t$end = date_format($end,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\t\t$i_rows[] = date_create($start)->format(\"F Y\");\n\t\t$i_rows[] = date_create($end)->format(\"F Y\");\n\t\t$i_rows[] = $this->trend_insident_data($start,$end);\n \t$sr_rows[] = date_create($start)->format(\"F Y\");\n\t\t$sr_rows[] = date_create($end)->format(\"F Y\");\n \t$sr_rows[] = $this->trend_sr_data($start,$end);\t\n }\n\n // echo \"<pre>\";\n // \tprint_r($i_rows);\n \t\t// echo \"<h4>SR Array</h4>\";\n \t\t// print_r($sr_rows);\n \t\t// echo \"</pre>\";\n\n \t\t$trend_data[] = $i_rows;\n \t\t$trend_data[] = $sr_rows;\n\n\n \t\treturn $trend_data;\n\n\n // // First day of a specific month\n // $d = new DateTime('2010-01-19');\n // $d->modify('first day of this month');\n // echo $d->format('jS, F Y').\"</br>\";\n\n // // alternatively...\n // echo date_create('2010-01-19')\n // ->modify('first day of this month')\n // ->format('jS, F Y');\n\t\t//exit();\n\t}", "public function pharmacySalesGraphData()\n {\n $prescriptions = Prescription::whereIn('status',[Prescriptions::PAID_PRESCRIPTION,Prescriptions::ISSUED_PRESCRIPTION])->get();\n $internalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::INTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n $externalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::EXTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n return ResponseHelper::findSuccess('Explorations Data', [\n 'internalPrescriptionsSales' => $internalPrescriptions,\n 'externalPrescriptionsSales' => $externalPrescriptions,\n ]);\n }", "public function getMyTransactionHistory($patron, $params)\n {\n $pageSize = $params['limit'] ?? 50;\n $offset = isset($params['page']) ? ($params['page'] - 1) * $pageSize : 0;\n $sortOrder = isset($params['sort']) && 'checkout asc' === $params['sort']\n ? 'asc' : 'desc';\n $result = $this->makeRequest(\n ['v3', 'patrons', $patron['id'], 'checkouts', 'history'],\n [\n 'limit' => $pageSize,\n 'offset' => $offset,\n 'sortField' => 'outDate',\n 'sortOrder' => $sortOrder,\n 'fields' => 'item,outDate'\n ],\n 'GET',\n $patron\n );\n if (isset($result['code'])) {\n return [\n 'success' => false,\n 'status' => 146 === $result['code']\n ? 'ils_transaction_history_disabled'\n : 'ils_connection_failed'\n ];\n }\n $transactions = [];\n foreach ($result['entries'] as $entry) {\n $transaction = [\n 'id' => '',\n 'item_id' => $this->extractId($entry['item']),\n 'checkoutDate' => $this->dateConverter->convertToDisplayDate(\n 'Y-m-d', $entry['outDate']\n )\n ];\n // Fetch item information\n $item = $this->makeRequest(\n ['v3', 'items', $transaction['item_id']],\n ['fields' => 'bibIds,varFields'],\n 'GET',\n $patron\n );\n $transaction['volume'] = $this->extractVolume($item);\n if (!empty($item['bibIds'])) {\n $transaction['id'] = $item['bibIds'][0];\n\n // Fetch bib information\n $bib = $this->getBibRecord(\n $transaction['id'], 'title,publishYear', $patron\n );\n if (!empty($bib['title'])) {\n $transaction['title'] = $bib['title'];\n }\n if (!empty($bib['publishYear'])) {\n $transaction['publication_year'] = $bib['publishYear'];\n }\n }\n $transactions[] = $transaction;\n }\n\n return [\n 'count' => $result['total'] ?? 0,\n 'transactions' => $transactions\n ];\n }", "public function getChartData() {\n $fromDate = Carbon::now()->subMinutes(60);\n $toDate = Carbon::now();\n\n $chart = new TaskActivity;\n $chartData = Auth::user()->tasks()->where('is_complete', 0)->whereBetween('created_at', [$fromDate, $toDate])->get()->pluck('created_at')->toArray();\n $arr = [];\n foreach ($chartData as $k => $c) {\n $add = $k + 1;\n array_push($arr, $add);\n }\n $chart->labels($chartData);\n $chart->dataset('Pending task', 'line', $arr);\n return $chart;\n }", "public function getgraphAction(){\n $params = array(\n 'cht' => 'lc', \t\t\t\t\t// chart type\n 'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0', //background fills for the chart\n // 'chm' => 'B,f4d4b2,0,0,0|B,FF0000,1,1,0|B,00FF00,2,2,0', \t\t// line fills\n 'chco' => 'db4814,1919D1',\t\t\t\t\t//Series Colors\n 'chs' => '587x300',\t\t\t\t// chart size <width>x<height>\n\t\t\t'chxt' => 'x,y',\t\t\t\t\t// visible axes\n\t\t\t//'chof' => 'validate'\t\t\t\t// output format (png,gif,json,html{when chof='validate'})\n );\n \n\t$post=$this->getRequest()->getPost();\n\t\n\t\n\t$timezoneLocal = Mage::app()->getStore()->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);\n\n\t\tlist ($dateStart, $dateEnd) = Mage::getResourceModel('reports/order_collection')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getDateRange($post['range'], '', '', true);\n\n $dateStart->setTimezone($timezoneLocal);\n $dateEnd->setTimezone($timezoneLocal);\n\t\n\t\t$dates = array();\n $datas = array();\n\n while($dateStart->compare($dateEnd) < 0){\n switch ($post['range']) {\n case '24h':\n $d = $dateStart->toString('yyyy-MM-dd HH:00');\n $dateStart->addHour(1);\n break;\n case '7d':\n case '1m':\n $d = $dateStart->toString('yyyy-MM-dd');\n $dateStart->addDay(1);\n break;\n case '1y':\n case '2y':\n $d = $dateStart->toString('yyyy-MM');\n $dateStart->addMonth(1);\n break;\n }\n\n $dates[] = $d;\n }\n\n\t\t$graphData=array();\n\t\t\n\t\t$product_list=array('product1'=>$post['product'],\n\t\t\t\t\t\t\t'product2'=>$post['compare2']\n\t\t\t\t\t\t\t);\t\n\t\t$graphData=Mage::Helper('graphs')->getGraphData($dates,$product_list);\n\n /**\n * setting skip step\n */\n if (count($dates) > 8 && count($dates) < 15) {\n $c = 1;\n } else if (count($dates) >= 15){\n $c = 2;\n } else {\n $c = 0;\n }\n /**\n * skipping some x labels for good reading\n */\n $i=0;\n foreach ($dates as $k => $d) {\n if ($i == $c) {\n $dates[$k] = $d;\n $i = 0;\n } else {\n $dates[$k] = '';\n $i++;\n }\n }\n \n $this->_axisLabels['x'] = $dates;\n\t\t$this->_axisLabels['y'] = $graphData['quantity'][$post['product']];\n\t\t\n\t\tforeach ($graphData['quantity'] as $index => $serie) {\n $localmaxlength[$index] = sizeof($serie);\n $localmaxvalue[$index] = max($serie);\n $localminvalue[$index] = min($serie);\n }\n \n\t\t$maxvalue = max($localmaxvalue);\n\t\t$minvalue = min($localminvalue);\n\n $yrange = 0;\n $yLabels = array();\n $miny = 0;\n $maxy = 0;\n $yorigin = 0;\n\n $maxlength = max($localmaxlength);\n if ($minvalue >= 0 && $maxvalue >= 0) {\n $miny = 0;\n if ($maxvalue > 10) {\n $p = pow(10, $this->_getPow($maxvalue));\n $maxy = (ceil($maxvalue/$p))*$p;\n $yLabels = range($miny, $maxy, $p);\n } else {\n $maxy = ceil($maxvalue+1);\n $yLabels = range($miny, $maxy, 1);\n }\n $yrange = $maxy;\n $yorigin = 0;\n }\n\n \n\t\t\t\n\t\t\t$params['chd'] = \"e:\";\n $dataDelimiter = \"\";\n $dataSetdelimiter = \",\";\n $dataMissing = \"__\";\n \n\t\t\t// EXTENDED ENCODING\n\t\t\tforeach($product_list as $productid){\n\t\t\t\t$chartdata = array();\t\n for ($j = 0; $j < sizeof($graphData['quantity'][$productid]); $j++) {\n $currentvalue = $graphData['quantity'][$productid][$j];\n \n if (is_numeric($currentvalue)) {\n if ($yrange) {\n $ylocation = (4095 * ($yorigin + $currentvalue) / $yrange);\n\n } else {\n $ylocation = 0;\n }\n $firstchar = floor($ylocation / 64);\n $secondchar = $ylocation % 64;\n $mappedchar = substr($this->_extendedEncoding, $firstchar, 1)\n . substr($this->_extendedEncoding, $secondchar, 1);\n array_push($chartdata, $mappedchar . $dataDelimiter);\n } else {\n array_push($chartdata, $dataMissing . $dataDelimiter);\n }\n\n\t\t\t }\n\t\t\t $buffer = implode('', $chartdata);\t\t\t \n\t\t\t\t\t$buffer = rtrim($buffer, $dataSetdelimiter);\n\t\t\t\t\t$buffer = rtrim($buffer, $dataDelimiter);\n\t\t\t\t\t$buffer = str_replace(($dataDelimiter . $dataSetdelimiter), $dataSetdelimiter, $buffer);\n\t\t\t\t\t\n\t\t\t\t\t$params['chd'] .= $buffer.',';\n\t\t\t\t\t$buffer=null;\n\t\t\t\t\t$chartdata=null;\n\t\t\t\t}\n\t\t\t\t\t$labelBuffer = \"\";\n\t\t\t\t\t$valueBuffer = array();\n\t\t\t\t\t$rangeBuffer = \"\";\n \n if (sizeof($this->_axisLabels) > 0) {\n $params['chxt'] = implode(',', array_keys($this->_axisLabels));\n $indexid = 0;\n foreach ($this->_axisLabels as $idx=>$labels){\n\t\t\t\t\n if ($idx == 'x') {\n /**\n * Format date\n */\n foreach ($this->_axisLabels[$idx] as $_index=>$_label) {\n if ($_label != '') {\n switch ($post['range']) {\n case '24h':\n $this->_axisLabels[$idx][$_index] = $this->formatTime(\n new Zend_Date($_label, 'yyyy-MM-dd HH:00'), 'short', false\n );\n break;\n case '7d':\n case '1m':\n $this->_axisLabels[$idx][$_index] = $this->formatDate(\n new Zend_Date($_label, 'yyyy-MM-dd')\n );\n break;\n case '1y':\n case '2y':\n\t\t\t\t\t\t\t\t\t\n $formats = Mage::app()->getLocale()->getTranslationList('datetime');\n $format = isset($formats['yyMM']) ? $formats['yyMM'] : 'MM/yyyy';\n $format = str_replace(array(\"yyyy\", \"yy\", \"MM\"), array(\"Y\", \"y\", \"m\"), $format);\n $this->_axisLabels[$idx][$_index] = date($format, strtotime($_label));\n break;\n }\n } else {\n $this->_axisLabels[$idx][$_index] = '';\n }\n\n }\n\t\t\t\t\t\t\t\t\t\t\n $tmpstring = implode('|', $this->_axisLabels[$idx]);\n\n $valueBuffer[] = $indexid . \":|\" . $tmpstring;\n if (sizeof($this->_axisLabels[$idx]) > 1) {\n $deltaX = 100/(sizeof($this->_axisLabels[$idx])-1);\n } else {\n $deltaX = 100;\n }\n } else if ($idx == 'y') {\n $valueBuffer[] = $indexid . \":|\" . implode('|', $yLabels);\n if (sizeof($yLabels)-1) {\n $deltaY = 100/(sizeof($yLabels)-1);\n } else {\n $deltaY = 100;\n }\n // setting range values for y axis\n $rangeBuffer = $indexid . \",\" . $miny . \",\" . $maxy . \"|\";\n }\n $indexid++;\n }\n $params['chxl'] = implode('|', $valueBuffer);\n }\t\t\t\n\t\t\t\t\t\n\t\tif (isset($deltaX) && isset($deltaY)) {\n $params['chg'] = $deltaX . ',' . $deltaY . ',1,0';\n }\n \n\n\t\t\t$p = array();\n foreach ($params as $name => $value) {\n $p[] = $name . '=' .urlencode($value);\n }\n\n $url= Mage_Adminhtml_Block_Dashboard_Graph::API_URL . '?' . implode('&', $p);\n\n\t\t\t\techo $url;\n\t}", "public function getLatestTrans($sender, $params)\r\n\t{\r\n\t\t$results = $errors = array ();\r\n\t\ttry {\r\n\t\t\t$transactions = Transaction::getAllByCriteria ('trans.organizationId = ?', array(Core::getOrganization()->getId()), true, 1, 10, array ('trans.id' => 'desc') );\r\n\t\t\t$results ['items'] = array();\r\n\t\t\tforeach($transactions as $trans)\r\n\t\t\t\t$results ['items'][] = $trans->getJson();\r\n\t\t} catch ( Exception $ex ) {\r\n\t\t\t$errors [] = $ex->getMessage ();\r\n\t\t}\r\n\t\t$params->ResponseData = StringUtilsAbstract::getJson ( $results, $errors );\r\n\t}", "public function buildVisitorsGraph(): \\Google_Service_Analytics_GaData\n {\n $startDate = Carbon::now()->subDays(7);\n\n $visitorsData = AnalyticsFacade::performQuery(\n Period::create($startDate, $this->endDate),\n 'ga:sessions,ga:pageviews',\n [\n 'dimensions' => 'ga:date',\n 'sort' => 'ga:date'\n ]\n );\n\n $visitorsGraph = [];\n foreach ($visitorsData->rows as $row) {\n $row[0] = Carbon::createFromFormat('Ymd', $row[0]);\n\n array_push($visitorsGraph, $row);\n }\n $visitorsData->rows = array_reverse($visitorsGraph);\n\n return $visitorsData;\n }", "function get_sale_grouplastby_ccode($lastmonthdate) {\r\n\tglobal $db;\r\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.total_fee) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND transaction_alipay.transaction_type IN ('1','s1') AND transaction_alipay.result_code='SUCCESS' AND transaction_alipay.trade_status='TRADE_SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$lastmonthdate') GROUP BY year, month, merchants.currency_code\";\r\n\t$transactionsDetails = $db->rawQuery($M_R_query);\r\n\treturn $transactionsDetails;\t\r\n}", "public function fetchLicenseHistory()\n {\n $history = [];\n $query = $this->db->executeQuery(\n \"SELECT\n l.id,\n TO_CHAR(l.creation_date, 'Dy DD Mon YYYY, HH24:MI') AS creation_date,\n TO_CHAR(l.creation_date, 'YYYY-MM-DD HH24:MI:SS') AS creation_date_iso,\n TO_CHAR(l.activation_date, 'Dy DD Mon YYYY, HH24:MI') AS activation_date,\n TO_CHAR(l.activation_date, 'YYYY-MM-DD HH24:MI:SS') AS activation_date_iso,\n TO_CHAR(l.expiry_date, 'Dy DD Mon YYYY, HH24:MI') AS expiry_date,\n TO_CHAR(l.expiry_date, 'YYYY-MM-DD HH24:MI:SS') AS expiry_date_iso,\n array_to_json(l.ip_addr) AS ip_addr,\n array_to_json(l.domains) AS domains,\n array_to_json(array_agg(mi.description\n ORDER BY mi.id ASC)) AS modules_names,\n now() BETWEEN activation_date AND expiry_date AS active\n FROM license l\n LEFT JOIN modules_available mi ON mi.id = ANY (l.modules_installed) AND mi.enabled_by_default=0\n WHERE client_id = :clientId\n GROUP BY l.id\n ORDER BY l.creation_date DESC\",\n [':clientId' => $_POST['clientId']]\n );\n while (($row = $query->fetch()) !== FALSE) {\n $row['modules_names'] = json_decode($row['modules_names'], TRUE);\n $row['ip_addr'] = json_decode($row['ip_addr'], TRUE);\n $row['domains'] = json_decode($row['domains'], TRUE);\n $history[] = $row;\n }\n if (!empty($history)) {\n $history[0]['isLatest'] = TRUE;\n }\n $this->response = [\"licenses\" => $history];\n }", "public static function getTransaction()\n {\n $query = new Query;\n return $query->select([ 'c.*', 'u.username', 'u.email','t.transaction_id', 't.transaction_amount',\n 't.payment_date as tn_payment_date'])\n ->from('contest as c')\n ->LeftJoin('transaction_details as t', 't.contest_id=c.id')\n ->LeftJoin('user as u', 'u.id=c.user_id')\n ->orderBy(['t.payment_date' => SORT_DESC]); \n }", "public function findDataLast()\n {\n return $this->getEntityManager()\n ->createQuery(\"SELECT DISTINCT t.number, f.id as finance, f.price as cost, f.gotcarq as gotcarqId\n FROM GazMainBundle:Terminal t\n JOIN GazMainBundle:Finance f WITH f.terminal = t\n\t\t\t\t\t\t\tWHERE (f.gotcarq IS NOT NULL AND f.gotcarq != 0)\n\t\t\t\t\t\t\t AND f.created = (SELECT MIN(f1.created) FROM GazMainBundle:Finance f1\n LEFT JOIN f1.terminal t1\n WHERE t1.id = t.id AND f1.financeType = FALSE)\n\t\t\t\t\t\t\tORDER BY t.number ASC\n \")\n ->getResult();\n }", "public function getTransactionStats($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n // transaction count\n $currentTransactionCount = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('status', [$this->successStatus])\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n // ->groupBy('status')\n ->get();\n\n $prevTransactionCount = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('status', [$this->successStatus])\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n // ->groupBy('status')\n ->get();\n\n // total transaction\n $currentTransactionValue = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(total_price), 0), 0) as average'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->get();\n\n $prevTransactionValue = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(total_price), 0), 0) as average'))\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->get();\n\n // transaction status\n $transactionStatus = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('case when order_statuses.status then \\'sukses\\' else order_statuses.name end as status, count(*)'))\n // ->whereIn('status', [$this->successStatus])\n ->whereIn('order_statuses.name', $this->finalTransactionStatus)\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_statuses.name')\n ->groupBy('order_statuses.status')\n ->orderByRaw('count desc')\n ->get();\n\n $statuses = DB::connection('virtual_market')\n ->table('order_statuses')\n ->select(DB::raw('status'))\n ->get();\n\n $statusTrendData = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('status, count(*),'.$dateQuery))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_statuses.status')\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n $statusTrend = [];\n for($i=0; $i<count($statusTrendData); $i++){\n if(($i == 0) || ($prevDate != $statusTrendData[$i]->date)){\n if($i>0)\n array_push($statusTrend, $data);\n $data = array();\n $data['date'] = $statusTrendData[$i]->date;\n }\n $data[$statusTrendData[$i]->status] = $statusTrendData[$i]->count;\n $prevDate = $statusTrendData[$i]->date;\n if($i == count($statusTrendData)-1)\n array_push($statusTrend, $data);\n }\n\n // app platform (mobile / sms)\n $appPlatform = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('order_type as name, count(*)'))\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_type')\n ->get();\n\n $platforms = array();\n array_push($platforms, array('platform'=>'sms'));\n array_push($platforms, array('platform'=>'mobile'));\n\n $platformTrendData = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', '=', 'order_statuses.id')\n ->select(DB::raw('order_type as platform, count(*),'.$dateQuery))\n ->where('status', '=', $this->successStatus)\n ->whereIn('order_statuses.name', [$this->successName])\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('order_type')\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $platformTrend = [];\n for($i=0; $i<count($platformTrendData); $i++){\n if(($i == 0) || ($prevDate != $platformTrendData[$i]->date)){\n if($i>0)\n array_push($platformTrend, $data);\n $data = array();\n $data['date'] = $platformTrendData[$i]->date;\n }\n $data[$platformTrendData[$i]->platform] = $platformTrendData[$i]->count;\n $prevDate = $platformTrendData[$i]->date;\n if($i == count($platformTrendData)-1)\n array_push($platformTrend, $data);\n }\n\n\n $data = array();\n $data['transaction'] = array();\n $data['transaction']['count'] = array();\n $data['transaction']['count']['current'] = $currentTransactionCount[0];\n $data['transaction']['count']['prev'] = $prevTransactionCount[0];\n $data['transaction']['value'] = array();\n $data['transaction']['value']['current'] = $currentTransactionValue[0];\n $data['transaction']['value']['prev'] = $prevTransactionValue[0];\n\n $data['transaction_status'] = $transactionStatus;\n $data['transaction_status_trend'] = array();\n $data['transaction_status_trend']['statuses'] = $statuses;\n $data['transaction_status_trend']['granularity'] = $granularity;\n $data['transaction_status_trend']['trend'] = $statusTrend;\n $data['app_platform'] = $appPlatform;\n $data['app_platform_trend'] = array();\n $data['app_platform_trend']['platforms'] = $platforms;\n $data['app_platform_trend']['granularity'] = $granularity;\n $data['app_platform_trend']['trend'] = $platformTrend;\n \n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function index()\n\t{\n\t\t$this->load->helper('url');\n\t\t$this->load->library('session');\n\t\t$this->load->database();\n\n\t\t$this->is_logged_in();\n\n\t\t$this->getSalesToday();\n\t\t$sql = $this->db->query(\"SELECT distinct(DATE_FORMAT(tr_at, '%Y-%m')) 'm', SUM(total) 'p' FROM transaction t group by YEAR(tr_at),MONTH(tr_at)\");\n\t\t//$sql = $this->db->query(\"SELECT distinct(DATE_FORMAT(t.tr_at, '%Y-%m')) 'm', b.br_id 'b', SUM(t.total) 'p' FROM transaction t, branch b where t.br_id = b.br_id group by YEAR(t.tr_at),MONTH(t.tr_at), t.br_id;\");\n\n\t\t$rows = json_encode($sql->result());\n\t\t// foreach($rows as $date):\n\t\t// $date->dates;\n\t\t// endforeach;\n\t\t$sql_branch = $this->db->query('SELECT * FROM branch');\n\t\t$branches = $sql_branch->result();\n\n\t\t$transactions = $this->db->query(\"SELECT t.tr_id 'tr_id', t.tr_at 'date', u.firstname 'firstname', u.lastname 'lastname', b.br_name 'branch', t.total 'total' FROM `transaction` t, `users` u, branch b WHERE t.user_id = u.user_id AND t.br_id = b.br_id\");\n\t\t$x = [\n\t\t\t\t'dataforChart' => $rows,\n\t\t\t\t'branches'=> $branches,\n\t\t\t\t'transactions' => $transactions->result(),\n\t\t];\n\n $this->load->view('template/header', $x);\n $this->load->view('dashboard/dashboard', $x);\n $this->load->view('template/footer', $x);\n\n\t}", "public function indexgraphyearAd()\n {\n\n // ->elementLabel(\"amout\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->groupBy('name');\n\n // $bills = Bill::where(DB::raw(\"(DATE_FORMAT(update_at,'%Y'))\"),date('Y'))->get();\n // $chart = Charts::database($bills, 'bar', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->groupByMonth(date('Y'), true);\n\n // $data = Bill::where('updated_at', '2018-12-10')->get();\n // $chart = Charts::create('line', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->labels($data->pluck('updated_at'))\n // ->values($data->pluck('sum'));\n\n $chart = Charts::database(Bill::all(), 'bar', 'highcharts')\n ->elementLabel(\"Total\")\n ->dimensions(1000, 500)\n ->responsive(false)\n ->lastByYear(6);\n\n \n\n // $data = BillDetail::all();\n // $chart = Charts::create('line', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->labels($data->pluck('name'))\n // ->values($data->pluck('amout'));\n\n\n // ->template(\"material\")\n // ->dataset('Element 1', [5,20,100])\n // ->dataset('Element 1', [15,30,80])\n // ->dataset('Element 1', [25,10,40])\n // ->labels(['One', 'Two', 'Three']);\n\n return view('adminPharmacy.a_graphyear', ['chart' => $chart]);\n }", "function get_sale_groupby_ccode($currentdate) {\r\n\tglobal $db;\r\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.total_fee) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND transaction_alipay.transaction_type IN ('1','s1') AND transaction_alipay.result_code='SUCCESS' AND transaction_alipay.trade_status='TRADE_SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$currentdate') GROUP BY year, month, merchants.currency_code\";\r\n\t$transactionsDetails = $db->rawQuery($M_R_query);\r\n\treturn $transactionsDetails;\t\r\n}", "public function GetExpertTransactions(){\n\t\tif($this->IsLoggedIn('cashier')){\n\t\t\tif(isset($_GET) && !empty($_GET)){\n\t\t\t\t$where=array(\n\t\t\t\t\t'from_date'\t=>$_GET['from_date'],\n\t\t\t\t\t'to_date'\t\t=> $_GET['to_date']\n\t\t\t\t);\n\t\t\t\t\t$data=$this->CashierModel->GetExpertTransactions($where);\n\t\t\t\t\t$this->ReturnJsonArray(true,false,$data['res_arr']);\n die;\n\t\t\t}else{\n\t\t\t\t$this->ReturnJsonArray(false,true,\"Wrong Method!\");\n\t\t\t\tdie;\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t\telse{\n\t\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t}\n\t}", "public function graphyearused()\n \t{\n \t\t// announce return variable\n \t\t$return \t= \tarray();\n \t\t$count \t\t=\tarray();\n \t\t// select logger collection \n \t\t$use_data \t= \t$this->mongo_db->db->used;\n \t\t// preparing query data\n \t\t$splitday \t= \texplode('-', $this->use_date);\n \t\tfor ($i = 1; $i <= 12; $i++) \n \t\t{\n \t\t\tif (strlen($i) == 1) \n \t\t\t{\n \t\t\t\t// use mongoRegex (while like in sql)\n \t\t\t\t$regex_Date \t= \tnew MongoRegex('/^'.$splitday[0].'-0'.$i.'/');\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_date' \t=> \t$regex_Date, \n \t\t\t\t\t'use_appid' => \t$this->use_appid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t} \n \t\t\telse \n \t\t\t{\n \t\t\t\t// use mongoRegex (while like in sql)\n \t\t\t\t$regex_Date \t= \tnew MongoRegex('/^'.$splitday[0].'-'.$i.'/');\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_date' \t=> $regex_Date, \n \t\t\t\t\t'use_appid' => $this->use_appid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t}\n \t\t}\n \t\t$return\t\t=\tarray(\n \t\t\t'name'\t\t=>\t\t'User',\n \t\t\t'data'\t\t=>\t\t$count\n \t\t\t);\n\n \t\treturn $return;\t\n \t}", "public function purchaseSalesGraph($financial_month, $financialYearDD, $userId)\r\n\t{\r\n\t\t\r\n\t\t$arrayData=array();\r\n\t\t$cashData=array();\r\n\t\t//total sales in amount\r\n\t\t\t$saleQuery='SELECT sum(invoice_total_value) as total_sales FROM '.$this->tableNames['client_invoice'].'\r\n\t\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\t\tand added_by=\"'.$userId.'\" \r\n\t\t\tand is_deleted=\"0\" \r\n\t\t\tand is_canceled=\"0\"';\r\n\t\t\t\r\n\t\t\t//total purchase in amount\r\n\t\t\t$purchaseQuery = 'SELECT sum(invoice_total_value) as total_purchase FROM '.$this->tableNames['client_purchase_invoice'].'\r\n\t\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\t\tand added_by=\"'.$userId.'\"\r\n\t\t\tand is_deleted=\"0\" \r\n\t\t\tand is_canceled=\"0\"';\r\n\r\n\t\t\t$totalSales = $this->get_row($saleQuery,false);\r\n\t\t\t$totalPurchase = $this->get_row($purchaseQuery,false);\r\n\t\t\t\r\n\t\t\tif(empty($totalSales)) {\r\n\t\t\t\t$cashData['sales'] = \"0.00\";\r\n\t\t\t} else {\r\n\t\t\t\t$cashData['sales'] = $totalSales[0];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(empty($totalPurchase)) {\r\n\t\t\t\t$cashData['purchase'] = \"0.00\";\r\n\t\t\t} else {\r\n\t\t\t\t$cashData['purchase'] = $totalPurchase[0];\r\n\t\t\t\t$cashData['month'] = $financial_month;\r\n\t\t\t}\r\n\t\t\tarray_push($arrayData, $cashData);\r\n\t\t\treturn $arrayData;\r\n\t}", "public function getBuyerHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $buyer = DB::connection('virtual_market')\n ->table('orders')\n ->select(DB::raw($dateQuery.',count(distinct customer_id)'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['buyer'] = $buyer;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function getHistory($fsym, $limit = 29)\n {\n $filtered_data = [];\n\n $response = $this->client->get('data/v2/histoday', [\n 'query' => [\n 'fsym' => $fsym, // Cryptocurrency whose data we want\n 'tsym' => $this->conversion_currency, // Real currency to convert the price to\n 'limit' => $limit // Number of past days to retrieve\n ]\n ]);\n\n $data = json_decode($response->getBody())->Data->Data; // Get data from JSON\n\n // Filter API data to keep only relevent data\n foreach ($data as $index => $day) {\n $date = new Carbon($day->time);\n $filtered_data[$index]['date'] = $date->format('d/m'); // Format the date\n $filtered_data[$index]['rate'] = $day->open; // Price at the date\n }\n\n return $filtered_data;\n }", "function cpay_GetRevise($start,$end) {\r\n $start= strtotime($start);\r\n $start=date('Y:m:d H:i:s',$start);\r\n $end= strtotime($end);\r\n $end=date('Y:m:d H:i:s',$end);\r\n $payments='';\r\n $query=\"SELECT * from `op_transactions` WHERE `paysys` = 'CITYPAY' AND `date` BETWEEN '\".$start.\"' AND '\".$end.\"';\";\r\n $rawData= simple_queryall($query);\r\n if (!empty($rawData)) {\r\n foreach ($rawData as $io=>$each) {\r\n if (cpay_ispos($each['note'], 'date:')) {\r\n $tmpDate=explode('date:',$each['note']);\r\n $transDate=trim($tmpDate[1]);\r\n } else {\r\n $transDate= strtotime($each['date']);\r\n $transDate= date(\"YmdHis\",$transDate);\r\n }\r\n $cleanHash= str_replace('CPAY_', '', $each['hash']);\r\n \r\n $payments.='\r\n <Payment>\r\n <TransactionId>'.$cleanHash.'</TransactionId>\r\n <Account>'.$each['customerid'].'</Account>\r\n <TransactionDate>'.$transDate.'</TransactionDate>\r\n <Amount>'.$each['summ'].'</Amount>\r\n </Payment>\r\n ';\r\n }\r\n }\r\n \r\n $result='\r\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n <Response>\r\n '.$payments.'\r\n </Response>\r\n ';\r\n $result=trim($result);\r\n print($result);\r\n}", "public function transaksi()\n {\n $data = [];\n $date = Akad::selectRaw(\"DATE_FORMAT(tanggal_akad, '%Y-%m') as month\")->orderBy('tanggal_akad', 'desc')->distinct()->get();\n\n foreach ($date as $item) {\n $years = Carbon::parse($item->month)->format('Y');\n $months = Carbon::parse($item->month)->format('m');\n $count = $this->akad->whereYear('tanggal_akad', $years)->whereMonth('tanggal_akad', $months)->count();\n $data[$item->month] = $count;\n }\n\n return $data;\n }", "function get_annual_period_balance($cur='IDR',$acc=null,$eyear=null)\n {\n// transactions.debit, transactions.credit, transactions.vamount, gls.approved');\n \n $this->db->select_sum('transactions.vamount');\n $this->db->select_sum('transactions.debit');\n $this->db->select_sum('transactions.credit');\n \n $this->db->from('gls, transactions, accounts');\n $this->db->where('gls.id = transactions.gl_id');\n $this->db->where('transactions.account_id = accounts.id');\n $this->db->where('YEAR(dates)', $eyear);\n $this->db->where('gls.currency', $cur);\n $this->cek_null($acc,\"transactions.account_id\");\n $this->db->where('gls.approved', 1);\n $this->db->where('accounts.deleted', NULL);\n return $this->db->get(); \n }", "public function getPaymentHistory(){\r\n\t\t$result = array();\r\n\t\treturn $result;\r\n\t}", "public function getOrdersDataLastYear($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-1year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getNumOfOrderByMonth($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public static function GetDashboard() {\n $date = [];\n $num_orders = [];\n $last_month = \\Carbon\\Carbon::today()->subDays(30);\n $orders = Order::where('created_at', '>=', $last_month)->get()\n ->groupBy(function($item) {\n return $item->created_at->format('d-m-y');\n })->toArray();\n foreach ($orders as $key => $value) {\n $date[] = $key;\n $num_orders[] = count($value);\n }\n\n //======= Get income from last month - Chart From DB =======\n $last_month_income = \\Carbon\\Carbon::today()->subDays(30);\n $all_orders = [];\n $orders_income = [];\n $income = [];\n $income_date = [];\n $users_orders = DB::table('users')\n ->join('orders', 'users.id', '=', 'orders.user_id')\n ->select('users.*', 'orders.*')\n ->where('orders.created_at', '>=', $last_month_income)->get();\n foreach ($users_orders as $new_user_order) {\n $all_orders[] = (array) $new_user_order;\n }\n foreach ($all_orders as &$orders_data) {\n $orders_data['data'] = unserialize($orders_data['data']);\n }\n foreach ($all_orders as $order) {\n $order['created_at'] = (new \\DateTime($order['created_at']))->format('Y-m-d');\n $income_date[] = $order['created_at'];\n $sum = 0;\n foreach ($order['data'] as $price) {\n $sum += ($price['price'] * $price['quantity']);\n }\n $income[] = $sum;\n }\n\n for ($i = count($income_date) - 1; $i > 0; $i--) {\n if ($income_date[$i] == $income_date[$i - 1]) {\n unset($income_date[$i]);\n $income[$i - 1] = $income[$i] + $income[$i - 1];\n unset($income[$i]);\n }\n }\n $income = array_values($income);\n $income_date = array_values($income_date);\n\n self::$data['income'] = json_encode($income);\n self::$data['income_date'] = json_encode($income_date);\n\n //======= Get last week new users =======\n $last_week = \\Carbon\\Carbon::today()->subDays(7);\n $weekly_users = User::where('created_at', '>=', $last_week)->get()->toArray();\n\n //======= Get all users except admin =======\n $all_users = User::where('role', '!=', '6')->get()->toArray();\n\n //======= Get last day new orders =======\n $last_day = \\Carbon\\Carbon::today();\n $daily_orders = Order::where('created_at', '>=', $last_day)->get()->toArray();\n\n self::$data['weekly_new_users'] = count($weekly_users);\n self::$data['all_users'] = count($all_users);\n self::$data['daily_orders'] = count($daily_orders);\n self::$data['date'] = json_encode($date);\n self::$data['num_orders'] = json_encode($num_orders);\n self::$data['title'] .= 'CMS';\n self::$data['page_name'] = 'Ski Expert | Main';\n return view('cms.dashboard', self::$data);\n }", "public function getBuyerHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $buyer = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($dateQuery.',count(distinct buyer_id)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['buyer'] = $buyer;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function purchaseSalesInvoiceGraph($financial_month, $financialYearDD, $userId)\r\n\t{\r\n\t\t$invoiceArray=array();\r\n\t\t$invoiceData=array();\r\n\t\t\r\n\t\t$saleInvoice='SELECT count(reference_number) as sales_invoice \r\n\t\tFROM '.$this->tableNames['client_invoice'].'\r\n\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\tand added_by=\"'.$userId.'\"\r\n\t\tand is_deleted=\"0\" \r\n\t\tand is_canceled=\"0\"';\r\n\t\t\r\n\t\t//total purchase invoice\r\n\t\t$purchaseInvoice = 'SELECT count(reference_number) as purchase_invoice \r\n\t\tFROM '.$this->tableNames['client_purchase_invoice'].'\r\n\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\tand added_by=\"'.$userId.'\"\r\n\t\tand is_deleted=\"0\" \r\n\t\tand is_canceled=\"0\"';\r\n\r\n\t\t$totalSalesInvoice = $this->get_row($saleInvoice,false);\r\n\t\t$totalPurchaseInvoice = $this->get_row($purchaseInvoice,false);\r\n\t\t\r\n\t\tif(empty($totalSalesInvoice)) {\r\n\t\t\t$invoiceData['sales'] = \"0\";\r\n\t\t} else {\r\n\t\t\t$invoiceData['sales'] = $totalSalesInvoice[0];\r\n\t\t}\r\n\t\t\r\n\t\tif(empty($totalPurchaseInvoice)) {\r\n\t\t\t$invoiceData['purchase'] = \"0.00\";\r\n\t\t} else {\r\n\t\t\t$invoiceData['purchase'] = $totalPurchaseInvoice[0];\r\n\t\t\t$invoiceData['month'] = $financial_month;\r\n\t\t}\r\n\t\tarray_push($invoiceArray, $invoiceData);\r\n\t\treturn $invoiceArray;\r\n\t}", "public function getTransaction();", "public function getTransactionDataLastMonth($customerId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-30days\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $transactionResource = $this->_transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByDay($from, $to, $customerId);\n $result = $this->_processReceivedTransactionData($data, $result);\n \n $data = $transactionResource->getSpentCreditTransactionsByDay($from, $to, $customerId);\n $result = $this->_processSpentTransactionData($data, $result);\n \n $result = array_values($result);\n return $result;\n }", "public function getTransactionByAjax()\n {\n $data = [];\n try {\n $orders = Invoice::whereHas('invoiceDetail.testPackage', function ($query) {\n if (Auth::guard('tutor')->check()) {\n $tutor_id = Auth::guard('tutor')->user()->TutorID;\n $query->where('TutorID', $tutor_id);\n }\n })\n ->whereHas('paymentTransaction', function ($query) {\n if (Auth::guard('tutor')->check()) {\n $query->where('ExternalTransactionStatusID', 3);\n }\n })\n ->select(DB::raw(\"convert(date, CreateDate, 105) as sale_date, SUM(Amount) as total_count\"))\n ->groupBy(DB::raw(\"convert(date, CreateDate, 105)\"))\n ->orderBy(DB::raw(\"convert(date, CreateDate, 105)\", 'ASC'))\n ->get()->toArray();\n\n $total = array_column($orders, 'total_count');\n $date = array_column($orders, 'sale_date');\n $data['total'] = $total;\n $data['date'] = $date; \n return $data;\n } catch (\\Exception $e) {\n echo $e->getMessage();\n Log::channel('loginfo')->error('Get date wise total price by ajax.',['PurchasePackagesRepository/getTransactionByAjax', $e->getMessage()]);\n return false;\n }\n return $data;\n }", "public function getReportsbyYear()\n {\n $charts = app(ReportChart::class);\n $response = $this->byYear();\n \n $charts->labels($response['ano']);\n \n $charts->dataset('Relatório Anual de Vendas','bar',$response['total'])\n ->backgroundColor($response['colors'])\n ->color('red');\n\n $charts->options([\n 'scales' => [\n 'yAxes' => [\n [\n 'ticks' => [\n 'callback' => $charts->rawObject('myCallback')\n ]\n ]\n ]\n ]\n ]); \n \n return $charts;\n }", "public function getTrades(string $date = null): array;", "function GetYoutubeGraphData($ytUserName,$arrayDate)\n\t\t{\n\t\t\tset_include_path('library');\n\t\t\trequire_once 'Zend/Loader.php';\n\t\t\tZend_Loader::loadClass('Zend_Gdata_YouTube');\n\t\t\t\n\t\t\n\t\t\t\t$this->userName= $ytUserName;\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Uploads & comments\n\t\t\t\t$yt = new Zend_Gdata_YouTube();\n\t\t\t\t$yt->getHttpClient()->setConfig(array('timeout'=>180));\n\t\t\t\t$yt->setMajorProtocolVersion(2);\n\t\t\n\t\t\t\t$this->srVideoList='';\n\t\t\t\t$this->GetUploadDates($yt->getuserUploads($this->channelName));\n\t\t\n\t\t\t\t\n\t\t\t\t// \"Favorite\";\n\t\t\t\t$this->GetFavoriteDates();\n\t\t\t\t\n\t\t\t\t$this->CountDates($arrayDate);\n\t\t\t\t\t\n\t\t\t\treturn $this->graphArray;\n\t\t\t}", "public function list()\n {\n return view('transactions.graphs');\n }", "static function getPaymentBookingHistory() {\n global $wpdb;\n $resultset = $wpdb->get_results(\n \"SELECT t.reservation_id, t.booking_reference, t.first_name, t.last_name, t.email, t.vendor_tx_code, t.payment_amount, a.auth_status, a.auth_status_detail, a.card_type, a.last_4_digits, a.processed_date\n FROM wp_sagepay_transaction t\n INNER JOIN wp_sagepay_tx_auth a ON t.vendor_tx_code = a.vendor_tx_code\n WHERE t.reservation_id IS NOT NULL\n UNION ALL \n SELECT reservation_id, booking_reference, first_name, last_name, email, vendor_tx_code, \n payment_amount, auth_status, auth_status_detail, card_type, last_4_digits, processed_date\n FROM wp_stripe_transaction\n WHERE processed_date IS NOT NULL\n AND booking_reference IS NOT NULL\n ORDER BY processed_date DESC\n LIMIT 100\" );\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n return $resultset;\n }", "public function getTransactionStats($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n\n DB::enableQueryLog();\n // execute\n // transaction count\n $currentTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('orderline_statuses.name', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n // ->groupBy('status')\n ->get();\n\n $prevTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('orderline_statuses.name', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n // ->groupBy('status')\n ->get();\n\n\n // total transaction value\n $currentTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->get();\n\n $prevTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->get();\n\n // transaction status\n $transactionStatus = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('orderline_statuses.name, count(*)'))\n // ->whereIn('status', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->groupBy('orderline_statuses.name')\n ->orderByRaw('count desc')\n ->get();\n\n // payment method\n $paymentMethod = DB::connection('marketplace')\n ->table('orders')\n ->join('payment_method_types', 'orders.payment_method_type_id', '=', 'payment_method_types.id')\n ->select(DB::raw('payment_method_types.name, count(*)'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n // ->where('status', '=', $this->successStatus)\n ->groupBy('payment_method_types.name')\n ->orderByRaw('count desc')\n ->get(); \n\n $data = array();\n\n $data['transaction'] = array();\n $data['transaction']['count'] = array();\n $data['transaction']['count']['current'] = $currentTransactionCount[0];\n $data['transaction']['count']['prev'] = $prevTransactionCount[0];\n $data['transaction']['value'] = array();\n $data['transaction']['value']['current'] = $currentTransactionValue[0];\n $data['transaction']['value']['prev'] = $prevTransactionValue[0];\n \n $data['transaction_status'] = $transactionStatus;\n $data['payment_method'] = $paymentMethod;\n \n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function index()\n\t{\n\t\t\n\t$today_users = Trains_reservation::whereDate('created_at', today())->count()+Planes_reservation::whereDate('created_at', today())->count();\n\t$yesterday_users = Trains_reservation::whereDate('created_at', today()->subDays(1))->count()+Planes_reservation::whereDate('created_at', today()->subDays(1))->count();\n\t$users_2_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(2))->count()+Planes_reservation::whereDate('created_at', today()->subDays(2))->count();\n\t$users_3_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(3))->count()+Planes_reservation::whereDate('created_at', today()->subDays(3))->count();\n\t$users_4_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(4))->count()+Planes_reservation::whereDate('created_at', today()->subDays(4))->count();\n\t$users_5_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(5))->count()+Planes_reservation::whereDate('created_at', today()->subDays(5))->count();\n\t$users_6_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(6))->count()+Planes_reservation::whereDate('created_at', today()->subDays(6))->count();\n\t$users_7_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(7))->count()+Planes_reservation::whereDate('created_at', today()->subDays(7))->count();\n\t$chart = new SampleChart;\n\t$chart->labels(['Tujuh hari lalu','Enam hari lalu','Lima hari lalu','Empat hari lalu','Tiga hari lalu','Dua hari lalu', 'Kemarin', 'Hari Ini']);\n\t$chart->dataset('Laporan Transaksi', 'line', [$users_7_days_ago,$users_6_days_ago,$users_5_days_ago,$users_4_days_ago,$users_3_days_ago,$users_2_days_ago, $yesterday_users, $today_users]);\n\t\treturn view('laporan.hari',compact('chart'));\n\t}", "function getTransactionHistoryRecordsForUser($userAccountID, $userEncryptionKey, $numItemsPerPage, $pageNumber, $globalCurrentDate, $sid, $dbh)\n\t{\n\t\t$transactionsForUser\t\t\t\t\t\t\t\t\t\t\t\t= array();\n\t\t\t\n\t\t$offset\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t\t\n\t\tif ($pageNumber > 1)\n\t\t{\n\t\t\t$beginOffset\t\t\t\t\t\t\t\t\t\t\t\t\t= $pageNumber - 1;\n\t\t\t\n\t\t\t$offset\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= $numItemsPerPage * $beginOffset;\t\n\t\t}\n\t\t\t\n\t\t$numItemsPerPage\t\t\t\t\t\t\t\t\t\t\t\t\t= (int) $numItemsPerPage;\n\t\t$offset\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= (int) $offset;\n\t\t\n\t\ttry\n\t\t{\t\t\n\t\t\t$getTransactionHistoryRecords\t\t\t\t\t\t\t\t\t= $dbh -> prepare(\"SELECT \n\t\ttransactionID,\n\t\ttransactionDate,\n\t\tformattedTransactionDate,\n\t\taction,\n\t\tcryptoAmount,\n\t\tunitPrice,\n\t\tfiatAmount,\n\t\texchange,\n\t\tfees,\n\t\tfeesInPercentage,\n\t\tcapitolGains,\n\t\ttaxDue,\n\t\tFK_AssetTypeID,\n\t\tassetTypeLabel\n\tFROM\n\t(\n\t\tSELECT\n\t\t\tTransactions.transactionID,\n\t\t\tTransactions.transactionDate,\n\t\t\tDATE_FORMAT(Transactions.transactionDate, '%e %b %Y') AS formattedTransactionDate,\n\t\t\tTransactionTypes.displayTransactionTypeLabel AS action,\n\t\t\tTransactions.btcQuantityTransacted AS cryptoAmount,\n\t\t\tTransactions.spotPriceAtTimeOfTransaction AS unitPrice,\n\t\t\tTransactions.usdQuantityTransacted AS fiatAmount,\n\t\t\tTransactionSources.transactionSourceLabel AS exchange,\n\t\t\tTransactions.usdFeeAmount AS fees,\n\t\t\t(Transactions.usdFeeAmount / Transactions.usdQuantityTransacted) * 100 AS feesInPercentage,\n\t\t\toutbound.profitOrLossAmountUSD AS capitolGains,\n\t\t\tCASE\n\t\t\t\tWHEN outbound.profitOrLossAmountUSD > 0 AND outbound.FK_GainTypeID = 2 THEN (outbound.profitOrLossAmountUSD * AccountingMethodForRegionProfile.shortTermGainTaxPercentage) / 100\n\t\t\t\tWHEN outbound.profitOrLossAmountUSD > 0 AND outbound.FK_GainTypeID = 3 THEN (outbound.profitOrLossAmountUSD * AccountingMethodForRegionProfile.longTermGainTaxPercentage) / 100\n\t\t\t\tELSE 0\n\t\t\tEND AS taxDue,\n\t\t\tTransactions.FK_AssetTypeID,\n\t\t\tassetTypes.assetTypeLabel\n\t\tFROM\n\t\t\tTransactions \n\t\t\tINNER JOIN AssetTypes assetTypes ON Transactions.FK_AssetTypeID = assetTypes.assetTypeID AND assetTypes.languageCode = 'EN'\n\t\t\tINNER JOIN TransactionTypes ON Transactions.FK_TransactionTypeID = TransactionTypes.transactionTypeID AND TransactionTypes.languageCode = 'EN'\n\t\t\tINNER JOIN TransactionSources ON Transactions.FK_TransactionSourceID = TransactionSources.transactionSourceID AND TransactionSources.languageCode = 'EN'\n\t\t\tINNER JOIN OutboundTransactionSourceGrouping outbound ON Transactions.transactionID = outbound.FK_OutboundAssetTransactionID\n\t\t\tINNER JOIN UserAccounts ON Transactions.FK_AccountID = UserAccounts.userAccountID\n\t\t\tINNER JOIN CountryForRegionProfile ON UserAccounts.FK_CountryCode = CountryForRegionProfile.FK_CountryID\n\t\t\tINNER JOIN AccountingMethodForRegionProfile ON CountryForRegionProfile.FK_RegionProfileID = AccountingMethodForRegionProfile.FK_RegionProfileID\n\t\t\tINNER JOIN CryptoWallets toWallet ON Transactions.FK_DestinationAddressID = toWallet.walletID\n\t\t\tINNER JOIN CryptoWallets fromWallet ON Transactions.FK_SourceAddressID = fromWallet.walletID\n\t\t\tLEFT JOIN AssetTypes toWalletAssetType ON toWallet.FK_AssetTypeID = toWalletAssetType.assetTypeID\n\t\t\tLEFT JOIN AssetTypes fromWalletAssetType ON fromWallet.FK_AssetTypeID = fromWalletAssetType.assetTypeID\n\t\tWHERE\n\t\t\tTransactions.FK_AccountID = :accountID\n\tUNION\n\t\tSELECT\n\t\t\tTransactions.transactionID,\n\t\t\tTransactions.transactionDate,\n\t\t\tDATE_FORMAT(Transactions.transactionDate, '%e %b %Y') AS formattedTransactionDate,\n\t\t\tTransactionTypes.displayTransactionTypeLabel AS action,\n\t\t\tTransactions.btcQuantityTransacted AS cryptoAmount,\n\t\t\tTransactions.spotPriceAtTimeOfTransaction AS unitPrice,\n\t\t\tTransactions.usdQuantityTransacted AS fiatAmount,\n\t\t\tTransactionSources.transactionSourceLabel AS exchange,\n\t\t\tTransactions.usdFeeAmount AS fees,\n\t\t\t(Transactions.usdFeeAmount / Transactions.usdQuantityTransacted) * 100 AS feesInPercentage,\n\t\t\tinbound.profitOrLossAmountUSD AS capitolGains,\n\t\t\tCASE\n\t\t\t\tWHEN inbound.profitOrLossAmountUSD > 0 AND inbound.FK_GainTypeID = 2 THEN (inbound.profitOrLossAmountUSD * AccountingMethodForRegionProfile.shortTermGainTaxPercentage) / 100\n\t\t\t\tWHEN inbound.profitOrLossAmountUSD > 0 AND inbound.FK_GainTypeID = 3 THEN (inbound.profitOrLossAmountUSD * AccountingMethodForRegionProfile.longTermGainTaxPercentage) / 100\n\t\t\t\tELSE 0\n\t\t\tEND AS taxDue,\n\t\t\tTransactions.FK_AssetTypeID,\n\t\t\tassetTypes.assetTypeLabel\n\t\tFROM\n\t\t\tTransactions \n\t\t\tINNER JOIN AssetTypes assetTypes ON Transactions.FK_AssetTypeID = assetTypes.assetTypeID AND assetTypes.languageCode = 'EN'\n\t\t\tINNER JOIN TransactionTypes ON Transactions.FK_TransactionTypeID = TransactionTypes.transactionTypeID AND TransactionTypes.languageCode = 'EN'\n\t\t\tINNER JOIN TransactionSources ON Transactions.FK_TransactionSourceID = TransactionSources.transactionSourceID AND TransactionSources.languageCode = 'EN'\n\t\t\tINNER JOIN OutboundTransactionSourceGrouping inbound ON Transactions.transactionID = inbound.FK_InboundAssetTransactionID\n\t\t\tINNER JOIN UserAccounts ON Transactions.FK_AccountID = UserAccounts.userAccountID\n\t\t\tINNER JOIN CountryForRegionProfile ON UserAccounts.FK_CountryCode = CountryForRegionProfile.FK_CountryID\n\t\t\tINNER JOIN AccountingMethodForRegionProfile ON CountryForRegionProfile.FK_RegionProfileID = AccountingMethodForRegionProfile.FK_RegionProfileID\n\t\t\tINNER JOIN CryptoWallets toWallet ON Transactions.FK_DestinationAddressID = toWallet.walletID\n\t\t\tINNER JOIN CryptoWallets fromWallet ON Transactions.FK_SourceAddressID = fromWallet.walletID\n\t\t\tLEFT JOIN AssetTypes toWalletAssetType ON toWallet.FK_AssetTypeID = toWalletAssetType.assetTypeID\n\t\t\tLEFT JOIN AssetTypes fromWalletAssetType ON fromWallet.FK_AssetTypeID = fromWalletAssetType.assetTypeID\n\t\tWHERE\n\t\t\tTransactions.FK_AccountID = :accountID\n\tUNION\n\t\tSELECT\n\t\t\tTransactions.transactionID,\n\t\t\tTransactions.transactionDate,\n\t\t\tDATE_FORMAT(Transactions.transactionDate, '%e %b %Y') AS formattedTransactionDate,\n\t\t\tTransactionTypes.displayTransactionTypeLabel AS action,\n\t\t\tTransactions.btcQuantityTransacted AS cryptoAmount,\n\t\t\tTransactions.spotPriceAtTimeOfTransaction AS unitPrice,\n\t\t\tTransactions.usdQuantityTransacted AS fiatAmount,\n\t\t\tTransactionSources.transactionSourceLabel AS exchange,\n\t\t\tTransactions.usdFeeAmount AS fees,\n\t\t\t(Transactions.usdFeeAmount / Transactions.usdQuantityTransacted) * 100 AS feesInPercentage,\n\t\t\t0 AS capitolGains,\n\t\t\t0 AS taxDue,\n\t\t\tTransactions.FK_AssetTypeID,\n\t\t\tassetTypes.assetTypeLabel\n\t\tFROM\n\t\t\tTransactions \n\t\t\tINNER JOIN AssetTypes assetTypes ON Transactions.FK_AssetTypeID = assetTypes.assetTypeID AND assetTypes.languageCode = 'EN'\n\t\t\tINNER JOIN TransactionTypes ON Transactions.FK_TransactionTypeID = TransactionTypes.transactionTypeID AND TransactionTypes.languageCode = 'EN'\n\t\t\tINNER JOIN TransactionSources ON Transactions.FK_TransactionSourceID = TransactionSources.transactionSourceID AND TransactionSources.languageCode = 'EN'\n\t\t\tINNER JOIN UserAccounts ON Transactions.FK_AccountID = UserAccounts.userAccountID\n\t\t\tINNER JOIN CountryForRegionProfile ON UserAccounts.FK_CountryCode = CountryForRegionProfile.FK_CountryID\n\t\t\tINNER JOIN AccountingMethodForRegionProfile ON CountryForRegionProfile.FK_RegionProfileID = AccountingMethodForRegionProfile.FK_RegionProfileID\n\t\t\tINNER JOIN CryptoWallets toWallet ON Transactions.FK_DestinationAddressID = toWallet.walletID\n\t\t\tINNER JOIN CryptoWallets fromWallet ON Transactions.FK_SourceAddressID = fromWallet.walletID\n\t\t\tLEFT JOIN AssetTypes toWalletAssetType ON toWallet.FK_AssetTypeID = toWalletAssetType.assetTypeID\n\t\t\tLEFT JOIN AssetTypes fromWalletAssetType ON fromWallet.FK_AssetTypeID = fromWalletAssetType.assetTypeID\n\t\t\tLEFT JOIN OutboundTransactionSourceGrouping inbound ON Transactions.transactionID = inbound.FK_InboundAssetTransactionID\n\t\t\t\n\t\tWHERE\n\t\t\tTransactions.FK_AccountID = :accountID AND\n\t\t\tTransactions.isDebit = 0 AND\n\t\t\tinbound.FK_InboundAssetTransactionID IS NULL\n\t) a\n\tORDER BY\n\t\ttransactionDate, transactionID\n\tLIMIT\n\t\t:limit\n\tOFFSET\n\t\t:offset\");\n\t\t\n\t\t\t$getTransactionHistoryRecords -> bindValue(':accountID', $userAccountID, PDO::PARAM_INT);\n\t\t\t$getTransactionHistoryRecords -> bindValue(':userEncryptionKey', $userEncryptionKey);\n\t\t\t$getTransactionHistoryRecords -> bindValue(':limit', $numItemsPerPage, PDO::PARAM_INT);\n\t\t\t$getTransactionHistoryRecords -> bindValue(':offset', $offset, PDO::PARAM_INT);\n\t\t\n\t\t\tif ($getTransactionHistoryRecords -> execute() && $getTransactionHistoryRecords -> rowCount() > 0)\n\t\t\t{\n\t\t\t\twhile ($row = $getTransactionHistoryRecords -> fetchObject())\n\t\t\t\t{\n\t\t\t\t\t$transactionArray\t\t\t\t\t\t= array();\n\t\t\t\t\t\n\t\t\t\t\t$transactionID\t\t\t\t\t\t\t= $row->transactionID;\n\t\t\t\t\t$transactionDate\t\t\t\t\t\t= $row->formattedTransactionDate;\n\t\t\t\t\t$action\t\t\t\t\t\t\t\t\t= $row->action;\n\t\t\t\t\t$cryptoAmount\t\t\t\t\t\t\t= $row->cryptoAmount;\n\t\t\t\t\t$unitPrice\t\t\t\t\t\t\t\t= $row->unitPrice;\n\t\t\t\t\t$fiatAmount\t\t\t\t\t\t\t\t= $row->fiatAmount;\n\t\t\t\t\t$exchange\t\t\t\t\t\t\t\t= $row->exchange;\n\t\t\t\t\t$fees\t\t\t\t\t\t\t\t\t= $row->fees;\n\t\t\t\t\t$feesInPercentage\t\t\t\t\t\t= $row->feesInPercentage;\n\t\t\t\t\t$capitolGains\t\t\t\t\t\t\t= $row->capitolGains;\n\t\t\t\t\t$taxDue\t\t\t\t\t\t\t\t\t= $row->taxDue;\t\n\t\t\t\t\t$assetTypeID\t\t\t\t\t\t\t= $row->FK_AssetTypeID;\n\t\t\t\t\t$assetTypeLabel\t\t\t\t\t\t\t= $row->assetTypeLabel;\n\t\t\t\t\t\n\t\t\t\t\t$transactionArray['transactionID']\t\t= $transactionID;\n\t\t\t\t\t$transactionArray['transactionDate']\t= $transactionDate;\n\t\t\t\t\t$transactionArray['action']\t\t\t\t= $action;\n\t\t\t\t\t$transactionArray['cryptoAmount']\t\t= $cryptoAmount;\n\t\t\t\t\t$transactionArray['unitPrice']\t\t\t= $unitPrice;\t\n\t\t\t\t\t$transactionArray['fiatAmount']\t\t\t= $fiatAmount;\n\t\t\t\t\t$transactionArray['exchange']\t\t\t= $exchange;\n\t\t\t\t\t$transactionArray['fees']\t\t\t\t= $fees;\n\t\t\t\t\t$transactionArray['feesInPercentage']\t= $feesInPercentage;\n\t\t\t\t\t$transactionArray['capitolGains']\t\t= $capitolGains;\n\t\t\t\t\t$transactionArray['taxDue']\t\t\t\t= $taxDue;\n\t\t\t\t\t$transactionArray['assetTypeLabel']\t\t= $assetTypeLabel;\n\n\t\t\t\t\t$transactionsForUser[]\t\t\t\t\t= $transactionArray;\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t}\n\t catch (PDOException $e) \n\t {\n\t \terrorLog($e -> getMessage());\n\t\t}\n\t\t\n\t\treturn $transactionsForUser;\t\t\n\t}", "function get_data(){\r\n include_once 'config.php';\r\n global $CONFIG;\r\n try{\r\n $db = new PDO('mysql:host='.$CONFIG['dbhost'].';dbname='.$CONFIG['dbname'].';charset=utf8', $CONFIG['dbuser'], $CONFIG['dbpass']);\r\n \r\n if(intval($_GET['last'])>1){\r\n $stmt = $db->query(\"SELECT date, weight FROM graph order by date DESC limit \".intval($_GET['last']));\r\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n $result = array_reverse($result);\r\n }else{\r\n $stmt = $db->query(\"SELECT date, weight FROM graph order by date ASC\");\r\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n }catch(PDOException $e){\r\n var_dump($e);\r\n }\r\n\r\n return $result;\r\n}", "public function buysOfThisYear() {\n $query = \"SELECT COUNT(*) AS 'BUYS', MONTH(`BUYDATE`) AS 'MONTH' FROM `BUY` WHERE YEAR(BUYDATE) = \" .\n \"YEAR(NOW()) GROUP BY MONTH(`BUYDATE`)\";\n\n $result = parent::query($query);\n\n $toReturn = array();\n\n while ($row = $result->fetch_assoc()) {\n $toReturn[] = array(\n 'month' => $row['MONTH'],\n 'buys' => $row['BUYS']\n );\n }\n\n return $toReturn;\n }", "public function statistics()\n\t{\n\t\t// $sql_query .= \"FROM transactions \";\n\t\t// $sql_query .= \"WHERE date(date_ordered) > date_ordered - INTERVAL 30 DAY \";\n\t\t// $sql_query .= \"GROUP BY date(date_ordered) \";\n\t\t// $sql_query .= \"ORDER BY date_ordered DESC \";\n\n\t\t// $new_cust_30_days = DB::select($sql_query);\n\n\t\t// $new_customers_30_days = array();\n\n\t\t// for ($i=0; $i<30; $i++) {\n\t\t// $timestamp = mktime(0, 0, 0, date(\"m\") , date(\"d\") - $i, date(\"Y\"));\n\t\t// $days30[] = date(\"Y-m-d\", $timestamp);;\n\t\t// }\n\t\t// foreach ($new_cust_30_days as $result) {\n\t\t// \t$arr_keys[$result->date_ordered] = $result->count;\n\t\t// }\n\t\t// foreach ($days30 as $day) {\n\t\t// \t(isset($arr_keys[$day])) ? $new_customers_30_days[$day] = $arr_keys[$day] : $new_customers_30_days[$day] = 0;\n\t\t// }\n\n\n\t\t// ============================================================================\n\n\t\t$new_customers_past_months = array();\n\t\t$sql_query = \"SELECT DATE_FORMAT(date_ordered, '%Y-%m') AS date_ordered, \";\n\t\t$sql_query .= \"COUNT(DISTINCT date_ordered) as count \";\n\t\t$sql_query .= \"FROM transactions \";\n\t\t$sql_query .= \"WHERE status != 'cancelled' \";\n\t\t$sql_query .= \"AND status != 'removed' \";\n\t\t$sql_query .= \"GROUP BY DATE_FORMAT(date_ordered, '%Y-%m') \";\n\t\t$sql_query .= \"ORDER BY date_ordered DESC \";\n\t\t$new_customers_past_months = DB::select($sql_query);\n\n\t\t// ============================================================================\n\n\t\t$new_customers_this_month = array();\n\t\t$sql_query = \"SELECT date_ordered, user_email, user_firstname, user_lastname, count(*) AS amount_of_products \";\n\t\t$sql_query .= \"FROM transactions \";\n\t\t$sql_query .= \"WHERE (date_ordered BETWEEN DATE_FORMAT(NOW() ,'%Y-%m-01') AND NOW() ) \";\n\t\t$sql_query .= \"AND status != 'cancelled' \";\n\t\t$sql_query .= \"AND status != 'removed' \";\n\t\t$sql_query .= \"GROUP BY date_ordered \";\n\t\t$sql_query .= \"ORDER BY date_ordered DESC \";\n\t\t$new_customers_this_month = DB::select($sql_query);\n\n// print \"<pre>\";\n// print_R($new_customers_this_month);\n// exit;\n\n\n\t\t// ============================================================================\n\n\t\t$new_customers_last_30_days = array();\n\t\t$sql_query = \"SELECT date_ordered, user_email, user_firstname, user_lastname, count(*) AS amount_of_products \";\n\t\t$sql_query .= \"FROM transactions \";\n\t\t$sql_query .= \"WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= date_ordered \";\n\t\t$sql_query .= \"AND status != 'cancelled' \";\n\t\t$sql_query .= \"AND status != 'removed' \";\n\t\t$sql_query .= \"GROUP BY date_ordered \";\n\t\t$sql_query .= \"ORDER BY date_ordered DESC \";\n\t\t$new_customers_last_30_days = DB::select($sql_query);\n\n\t\t$pass_variables = array(\n//\t\t\t'new_customers_30_days' => $new_customers_30_days,\n\t\t\t'new_customers_last_30_days' => $new_customers_last_30_days,\n\t\t\t'new_customers_past_months' => $new_customers_past_months,\n\t\t\t'new_customers_this_month' => $new_customers_this_month\n\t\t);\n\t\treturn view('activities_statistics', $pass_variables );\n\t}", "function get_refundlast_by_ccode($ccode_last,$lastmonthdate) {\r\n\tglobal $db;\r\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.refund_amount) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND merchants.currency_code= '$ccode_last' AND transaction_alipay.transaction_type IN ('2','s2') AND transaction_alipay.result_code='SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$lastmonthdate') GROUP BY year, month\";\r\n\t$transactionsDetails = $db->rawQuery($M_R_query);\r\n\treturn $transactionsDetails;\r\n}", "public function fetchNextPage(&$last_page) {\n\n\t\t$transactions = [];\n\n\t\tif (!$this->date) {\n\t\t\tthrow new \\Exception(get_class($this) . ': you need to call setDate() before fetching any transactions');\n\t\t}\n\n\t\t$data = json_decode($this->api->getSales($this->date->toDateString(), NULL, NULL, NULL, NULL, $this->page, $this->page_size), true);\n\t\t$transactions = array_merge(\n\t\t\t$transactions,\n\t\t\t$this->mapTransactionData($data)\n\t\t);\n\n\t\t$data = json_decode($this->api->getLeads($this->date->toDateString(), NULL, NULL, NULL, NULL, $this->page, $this->page_size), true);\n\t\t$transactions = array_merge(\n\t\t\t$transactions,\n\t\t\t$this->mapTransactionData($data)\n\t\t);\n\n\t\t$this->page++;\n\n\t\t$last_page = empty($transactions);\n\n\t\treturn $transactions;\n\t}", "public function getDebitData()\n {\n $where = \"(SELECT DATEDIFF(sales_order.`due_date`, '$this->curDate') AS days) < 14 AND sales_order.`status_paid` = 0 AND sales_order.`active` = 1\";\n $this->db->where($where);\n $this->db->from('sales_order');\n $query = $this->db->get();\n\n $data['sum'] = 0;\n $data['count'] = 0;\n\n if ($query->num_rows() > 0) {\n foreach ($query->result() as $row) {\n $data['count']++;\n $data['sum'] += ($row->grand_total - $row->paid);\n }\n }\n return $data;\n }", "function getTransactions() {\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_URL => \"https://hackathon-be.mybluemix.net/customer/304fd2e19f1c14fe3345cca788e4e83d/amexprofitability\",\n\t CURLOPT_USERAGENT => 'BankBase BOC Hackathon Request'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$resp_decode = json_decode($resp);\n\treturn $resp_decode;\n}", "public function getLastTransactions($number) {\n\t\treturn new \\Doctrine\\Common\\Collections\\ArrayCollection($this->transactions->slice(0,$number));\n\t}", "public function getSharedBlock(){\n $output = ''; \n \n // Make year markings for each TrendGraph\n $reference = NULL;\n \n foreach($this->graphs as $graph){\n if ((is_object($graph)) && ($graph instanceof TrendGraph)){\n if($graph->getType() == DataManager::JAAR_TREND)\n $reference = $graph;\n break;\n }\n }\n \n if(is_null($reference)){\n die ('No general graph found');\n }\n \n $referenceSet = $graph->getDataSet();\n \n $zoek = array();\n \n foreach ($referenceSet as $dataPoint) {\n $zoek[$this->JStoPHPyears($dataPoint[0])] = 1;\n }\n \n $jaren = array_keys($zoek);\n \n //Creatie markers\n $markers = 'var markers = [\n ';\n foreach ($jaren as $jaar){\n $stamp = $this->PHPtoJStimestamp($jaar);\n $zoek[$jaar] = $stamp;\n $markers .= '{ color: \"#000\", lineWidth: 1, xaxis: { from: ' . $stamp . ', to: ' . $stamp . ' } },\n ';\n }\n $markers .= '];';\n $this->marks = $zoek;\n \n //To output\n $output .= $markers; \n \n //Add resize trigger to make the new anotations\n $output .= \"\n $(window).resize(function() {\n anoteGraphs();\n $(\\\".tooltip\\\").remove();\n });\n \n var emptyGraph = {\\\"label\\\":\\\"protocol\\\",\\\"data\\\":[]};\n function showTooltip(x, y, contents) {\n $('<div id=\\\"tooltip\\\" class=\\\"tooltip\\\">' + contents + '</div>').css( {\n top: y+5,\n left: x+5,\n }).appendTo(\\\"body\\\").fadeIn(200);\n }\n\n var previousPoint = null;\n var maand=new Array();\n maand[0]=\\\"Januari\\\";\n maand[1]=\\\"Februari\\\";\n maand[2]=\\\"Maart\\\";\n maand[3]=\\\"April\\\";\n maand[4]=\\\"Mei\\\";\n maand[5]=\\\"Juni\\\";\n maand[6]=\\\"Juli\\\";\n maand[7]=\\\"Augustus\\\";\n maand[8]=\\\"September\\\";\n maand[9]=\\\"October\\\";\n maand[10]=\\\"November\\\";\n maand[11]=\\\"December\\\";\n \n function findFlotPoint(value, array){\n for(var i = 0 ; i < array.length; i++) {\n var item = array[i][0];\n if( item == value){\n return i;\n }\n }\n }\n \";\n \n return $output;\n }", "function get_period_balance($cur='IDR',$acc=null,$month=null,$year=null,$emonth=null,$eyear=null)\n {\n// transactions.debit, transactions.credit, transactions.vamount, gls.approved');\n \n $this->db->select_sum('transactions.vamount');\n $this->db->select_sum('transactions.debit');\n $this->db->select_sum('transactions.credit');\n \n $this->db->from('gls, transactions, accounts');\n $this->db->where('gls.id = transactions.gl_id');\n $this->db->where('transactions.account_id = accounts.id');\n $this->cek_between_month($month, $emonth);\n $this->cek_between_year($year, $eyear);\n $this->db->where('gls.currency', $cur);\n// $this->db->where('MONTH(dates)', $month);\n// $this->db->where('YEAR(dates)', $year);\n $this->cek_null($acc,\"transactions.account_id\");\n $this->db->where('gls.approved', 1);\n $this->db->where('accounts.deleted', NULL);\n return $this->db->get(); \n }", "public function getconnectTransactions() {\n $yesterday = new \\DateTime('yesterday');\n $start_date = $yesterday->format('Y-m-d');\n $today = new \\DateTime('now');\n $end_date = $today->format('Y-m-d');\n $status = ApplaneConstentInterface::COMPLETED;\n //create the query\n $query = $this->createQueryBuilder('c');\n $query->select()\n ->Where('c.date >=:create_at', 'c.date <:end_at', 'c.status =:status')\n ->setParameter('create_at', $start_date)\n ->setParameter('end_at', $end_date)\n ->setParameter('status', $status);\n\n $result = $query->getQuery();\n $result_res = $result->getResult();\n return $result_res;\n }", "function getTrendData($indate) {\n $trendarray = [];\n $countryarray = array(\n \"AU\" => \"australia\",\n \"BR\" => \"brazil\",\n \"CA\" => \"canada\",\n \"GB\" => \"inggris\",\n \"ID\" => \"indonesia\",\n \"JP\" => \"jepang\",\n \"MX\" => \"mexico\",\n \"SE\" => \"swedia\",\n \"TR\" => \"turkey\",\n \"US\" => \"amerika\");\n\n foreach ($countryarray as $key => $value) {\n// echo \"\" . $key . \" \" . $value;\n $country = $value;\n $result = $GLOBALS['conn']->query(\"SELECT title, artist FROM `$country` WHERE `position`=1 AND `date`='$indate' LIMIT 1\"); \n if ($result->num_rows > 0) { \n // output data of each row \n $iter = 0; \n while($row = $result->fetch_assoc()) {\n $trendarray += array($key => \"\".$row[\"artist\"].\" - \".$row[\"title\"]);\n } \n } else { \n// echo \"\". $value . \" 0 results\". \"\\n\";\n }\n }\n\n foreach ($trendarray as $key => $value) {\n// echo \"\" . $key . \" \" . $value;\n }\n\n return $trendarray;\n }", "public function getTimeSeries()\n {\n return $this->time_series;\n }", "public function getTimeSeries()\n {\n return $this->time_series;\n }", "function getAllTransactions()\n {\n $transactions = $this->all();\n\n /* Add additional attributes to each Stock */\n foreach ($transactions as $transaction)\n {\n // Add a link to each stock's history page\n $transaction->href = '/transaction/' . $transaction->DateTime;\n }\n\n return $transactions;\n }", "public function getTransactions()\n\t{\n\t\treturn $this->data['transactions'];\n\t}", "public function get_wallet_history_info($token) {\n $wallet = $this->db->select('id,token,user_provider_id,type,current_wallet,credit_wallet,debit_wallet,avail_wallet,total_amt,fee_amt,reason,created_at')->from('wallet_transaction_history')->\n where('token', $token)->order_by('id', 'DESC')->\n get()->result_array();\n return $wallet;\n }", "private function getStatistik() {\n $SHOW_DAYS = 365;\n self::$today = new DateTime();\n $resultHtml = \"\";\n\n // Jetzt Berechnungen pro Budget:\n $budgets = Persistence::getInstances(\"BUD\", \"name\", false);\n $werte = array();\n $jahre = array();\n $budgetNames = array();\n $budgetAmount = array();\n foreach ($budgets as $budget) {\n $budgetName = $budget->getProperty(\"name\", \"unbekannt\");\n $budgetNames[\"\" . $budgetName] = \"$budgetName\";\n $budgetZeitraum = $budget->getProperty(\"zeitraum\", \"\") == \"\" ? \"\" : \" \" . $budget->getProperty(\"zeitraum\", \"\");\n $budgetAmount[\"\" . $budgetName] = $budget->getProperty(\"btotal\", \"\") . $budgetZeitraum;\n if (!isset($werte[\"$budgetName\"])) {\n $werte[\"$budgetName\"] = array();\n }\n $instances = Persistence::getInstances(\"ARB\", \"datum\", false, $budget->getId(), true);\n $resultData = array();\n foreach ($instances as $instance) {\n $h = $instance->getProperty(ARB::PROPERTY_STUNDEN, 0);\n $kaz = $instance->getProperty(ARB::PROPERTY_KAZ, 0);\n list($tag, $monat, $jahr) = explode(\".\", $instance->getProperty(ARB::PROPERTY_DATUM, \"01.01.1800\"));\n if ($jahr >= \"2017\") {\n $jahre[\"\" . $jahr] = \"\" . \"$jahr\";\n if (!isset($werte[\"$budgetName\"][\"\" . $jahr])) {\n $werte[\"$budgetName\"][\"\" . $jahr][\"Jahr\"] = 0;\n $werte[\"$budgetName\"][\"\" . $jahr][\"monate\"] = array();\n }\n if (!isset($werte[\"$budgetName\"][\"\" . $jahr][\"monate\"][\"\" . $monat])) {\n $werte[\"$budgetName\"][\"\" . $jahr][\"monate\"][\"\" . $monat] = 0;\n }\n $wert = $kaz != \"\" && $h != \"\" ? ($kaz > $h ? $kaz : $h) : ($kaz != \"\" ? $kaz : ($h != \"\" ? $h : 0));\n $werte[\"$budgetName\"][\"\" . $jahr][\"monate\"][\"\" . $monat] += $wert;\n $werte[\"$budgetName\"][\"\" . $jahr][\"Jahr\"] += $wert;\n }\n }\n }\n ksort($jahre);\n $monatWerte = array();\n $jahresWerte = array();\n foreach ($budgetNames as $budgetName) {\n $budgetWert[$budgetName] = array();\n foreach ($jahre as $jahr) {\n foreach (array(\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\") as $monat) {\n // Monatswerte nur fuer die letzten 365 Tage aufnehmen:\n if (!self::isOlder($jahr, $monat, $SHOW_DAYS)) {\n $monatWerte[$budgetName][$jahr . \"\"][\"\" . $monat] = 0;\n }\n }\n $jahresWerte[$budgetName][$jahr . \"\"] = 0;\n }\n }\n foreach ($werte as $budgetName => $jahrWerte) {\n foreach ($jahrWerte as $jahr => $jahrUndMonatWerte) {\n $jahresWerte[$budgetName][$jahr . \"\"] = $jahrUndMonatWerte[\"Jahr\"];\n foreach ($jahrUndMonatWerte[\"monate\"] as $monat => $wert) {\n // Monatswerte nur fuer die letzten 365 Tage aufnehmen:\n if (!self::isOlder($jahr, $monat, $SHOW_DAYS)) {\n $monatWerte[$budgetName][\"\" . $jahr][\"\" . $monat] = $wert;\n }\n }\n }\n }\n\n // Summen über alle ARB Instanzen berechnen (Budget unabhaengig, da ARB Instanzen\n // mehreren Budgets gleichzeitig zugeordnet sein koennen\n $monatSumme = array();\n $jahrSumme = array();\n foreach ($jahre as $jahr) {\n foreach (array(\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\") as $monat) {\n // Monatswerte nur fuer die letzten 365 Tage aufnehmen:\n $monatSumme[\"$jahr-$monat\"] = 0;\n }\n $jahrSumme[\"$jahr\"] = 0;\n }\n $arbInstances = Persistence::getInstances(\"ARB\", \"datum\", false, \"\", true);\n foreach ($arbInstances as $instance) {\n $h = $instance->getProperty(ARB::PROPERTY_STUNDEN, 0);\n list($tag, $monat, $jahr) = explode(\".\", $instance->getProperty(ARB::PROPERTY_DATUM, \"01.01.1800\"));\n if ($jahr >= 2017 && is_numeric($h)) {\n $jahrSumme[\"$jahr\"] += $h;\n $monatSumme[\"$jahr-$monat\"] += $h;\n }\n }\n\n // Darstellung:\n $table = \"<table>\";\n foreach ($monatWerte as $budgetName => $jahrWerte) {\n $table .= \"<tr><td>Budget</td><td style='width: 90px;'>Max</td>\";\n foreach ($jahrWerte as $jahr => $monate) {\n foreach ($monate as $monat => $wert) {\n $table .= \"<td>\" . $monat . \"/\" . ($jahr - 2000) . \"</td>\";\n }\n }\n foreach ($jahresWerte[$budgetName] as $jahr => $wert) {\n $table .= \"<td>$jahr</td>\";\n }\n break;\n }\n $table .= \"</tr>\";\n\n $trclass = \"odd\";\n foreach ($monatWerte as $budgetName => $jahrWerte) {\n $trclass = $trclass == \"odd\" ? \"even\" : \"odd\";\n $strong = \"\";\n foreach (array(\"#022\", \"#028\", \"#030\", \"#034\", \"#039\", \"400059\", \"412622\") as $s) {\n if (strpos($budgetName, $s) !== false) {\n $strong = \"strong\";\n }\n }\n $tr = \"<tr class='$trclass $strong'><td><span title='$budgetName'><span style='padding-right: 20px;'>\" . substr($budgetName, 0, 80) . \"</span></td>\";\n $tr .= \"<td>\" . $budgetAmount[\"\" . $budgetName] . \"</td>\";\n foreach ($jahrWerte as $jahr => $monate) {\n foreach ($monate as $monat => $wert) {\n // fuer unproduktive auch die % darstellen:\n $prozentm= (stripos($budgetName, \"unproduktiv\") !== false && $monatSumme[\"$jahr-$monat\"] > 0) ? round(($wert / $monatSumme[\"$jahr-$monat\"]) * 100, 0) . \"%\" : \"\";\n $title = \"$prozentm = $wert/\" . $monatSumme[\"$jahr-$monat\"] . \" h @ \";\n $title .= \"$jahr-$monat: $budgetName\";\n $tr .= \"<td title='$title' style='width: 60px;'>$wert<br><strong>$prozentm</strong></td>\";\n }\n }\n foreach ($jahresWerte[$budgetName] as $jahr => $wert) {\n // fuer unproduktive auch die % darstellen:\n $prozent = $jahrSumme[\"$jahr\"] > 0 ? round((($wert / $jahrSumme[\"$jahr\"]) * 100), 1) . \"%\" : \"\";\n $title = (stripos($budgetName, \"unproduktiv\") !== false ? \"$prozent = $wert/\" . $jahrSumme[\"$jahr\"] . \" h\" : \"\");\n $text = $title == \"\" ? \"\" : \"<br><strong>$prozent</strong>\";\n $tr .= \"<td title='$title' style='width: 80px;'>$wert$text</td>\";\n }\n $tr .= \"</tr>\";\n $table .= \"$tr\";\n }\n $table .= \"</table>\";\n\n return \"$table\";\n }", "public function getBuyerStats($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n\n DB::enableQueryLog();\n // execute\n $uniqueBuyers = array();\n $uniqueBuyers['current_period'] = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', 'order_statuses.id')\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->where('order_statuses.status', '=', $this->successStatus )\n ->whereIn('order_statuses.name', [$this->successName])\n ->distinct('customer_id')\n ->count('customer_id');\n\n $uniqueBuyers['prev_period'] = DB::connection('virtual_market')\n ->table('orders')\n ->join('order_statuses', 'orders.order_status', 'order_statuses.id')\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->where('order_statuses.status', '=', $this->successStatus )\n ->whereIn('order_statuses.name', [$this->successName])\n ->distinct('customer_id')\n ->count('customer_id');\n\n\n // buyers who make transactions more than once\n $returningBuyers = array(); \n $returningBuyers['current_period'] = DB::connection('virtual_market')\n ->table('orders')\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('customer_id')\n ->havingRaw('count(customer_id) > 1')\n ->distinct('customer_id')\n ->count('customer_id');\n\n $returningBuyers['prev_period'] = DB::connection('virtual_market')\n ->table('orders')\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->groupBy('customer_id')\n ->havingRaw('count(customer_id) > 1')\n ->distinct('customer_id')\n ->count('customer_id');\n\n $data = array();\n $data['unique_buyers'] = $uniqueBuyers;\n $data['returning_buyers'] = $returningBuyers;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function get_month_data($month = \"January\", $year = 2015){\n\t\t/* if($year==2015)\n\t\t$year = date('y'); */\n\t\t// echo date( 'F Y');\n\t\t$this->loadModel(\"Invoice.Invoice\");\n\t\t$this->loadModel(\"Transaction.Transaction\");\n\t\t$month_first_day = strtotime( 'first day of ' . $month.' '.$year);\n\t\t$month_last_day = strtotime( 'last day of ' . $month.' '.$year);\n\t\t// echo date('Y-m-d',$month_last_day);\n\t\t// $dt = new DateTime('first Monday of this month');\n\t\t$dt = new DateTime('first Monday of '.$month.' '.$year);\n\t\t// echo $dt->format('Y-m-d');\n\t\t$first_week_start = $dt->getTimestamp(); \n\t\t$week_last = $first_week_start;\n\t\t$this->Invoice->belongsTo = array('Client' => array('className'=>\"Usermgmt.Client\",'foreignKey'=>'client_id'));\n\t\t$this->Transaction->belongsTo = array('Invoice' => array('className'=>\"Invoice.Invoice\",'foreignKey'=>'invoice_id'));\n\t\t$this->Transaction->recursive = 2;\n\t\t$this->Transaction->Behaviors->load('Containable');\n\t\t\n\t\t$all_transactoins = array();\n\t\tfor($current =$month_first_day; ($week_last<$month_last_day && $week_last<time()); $week_last += (7*86400)){\n\t\t\t\n\t\t\t\t$transactions = $this->Transaction->find(\"all\",array(\"conditions\"=>array(\"UNIX_TIMESTAMP(STR_TO_DATE(Transaction.payment_date, '%m-%d-%Y')) >\"=>$current,\"UNIX_TIMESTAMP(STR_TO_DATE(Transaction.payment_date, '%m-%d-%Y')) <\"=>$week_last,'Transaction.status'=>1),'contain'=>array(\"Invoice\"=>array(\"fields\"=>array(\"title\",\"client_id\",\"payment\",\"tax\",\"total\")),\"Invoice.Client\"=>array(\"fields\"=>array(\"first_name\",\"last_name\"))),\"fields\"=>array(\"invoice_id\",\"payment_date\",\"method\")));\n\t\t\t\t\n\t\t\t\t$all_transactoins[date('m/d/Y',$current).'-'.date('m/d/Y',$week_last)] = $transactions;\n\t\t\t\t\n\t\t\t\t// pr($transactions); die;\n\t\t\t\n\t\t\t$current =$week_last;\n\t\t}\n\t\treturn $all_transactoins;\n\t\t\n\t}", "public function graphyearusedfunc()\n \t{\n \t\t// announce return variable\n \t\t$return \t\t= \tarray();\n \t\t$count \t\t\t=\tarray();\n \t\t// select logger collection \n \t\t$use_data \t\t= \t$this->mongo_db->db->used;\n \t\t// preparing query data\n \t\t$splitday \t\t= \texplode('-', $this->use_date);\n \t\tfor ($i = 1; $i <= 12; $i++) \n \t\t{\n \t\t\tif (strlen($i) == 1) \n \t\t\t{\n \t\t\t\t// use mongoRegex (while like in sql)\n \t\t\t\t$regex_Date \t= \tnew MongoRegex('/^'.$splitday[0].'-0'.$i.'/');\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_date' \t\t=> \t$regex_Date, \n \t\t\t\t\t'use_funcid' \t=> \t$this->use_funcid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t} \n \t\t\telse \n \t\t\t{\n \t\t\t\t// use mongoRegex (while like in sql)\n \t\t\t\t$regex_Date \t= \tnew MongoRegex('/^'.$splitday[0].'-'.$i.'/');\n \t\t\t\t// build query data\n \t\t\t\t$querydata\t \t= \tarray(\n \t\t\t\t\t'use_date' \t\t=> \t$regex_Date, \n \t\t\t\t\t'use_funcid' \t=> \t$this->use_funcid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t}\n \t\t}\n\n \t\t$return\t\t=\tarray(\n \t\t\t'name'\t\t=>\t\t'User',\n \t\t\t'data'\t\t=>\t\t$count\n \t\t\t);\n \t\t\n \t\treturn $return;\t\n \t}", "public function fetchNextPage(&$last_page) {\n\n\t\tif (!$this->from_date || !$this->to_date) {\n\t\t\tthrow new \\Exception(get_class($this) . ': you have to call setDate or setDateRange before you can fetch any data');\n\t\t}\n\n\t\t$transactions = $this->mapTransactionData($this->soap_client->getFullEarnings(\n\t\t\t$this->from_date->toDateString(),\n\t\t\t$this->to_date->toDateString(),\n\t\t\t$this->conf['campaignId'],\n\t\t\t$this->conf['login'],\n\t\t\t$this->conf['password']\n\t\t));\n\n\t\t$last_page = true;\n\n\t\treturn $transactions;\n\t}", "function get_sale_groupby_ccode($currentdate) {\n\tglobal $db;\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(gp_transaction.gp_trans_datetime) AS year, MONTH(gp_transaction.gp_trans_datetime) AS month, COUNT(DISTINCT gp_transaction.gp_transaction_id) AS transcount, SUM(gp_transaction.gp_amount) AS transamount FROM merchants JOIN gp_transaction ON gp_transaction.gp_merchant_id = merchants.mer_map_id AND gp_transaction.gp_transaction_type IN ('1','s1') AND gp_transaction.gp_status='success' AND MONTH(gp_transaction.gp_trans_datetime) = MONTH('$currentdate') GROUP BY year, month, merchants.currency_code\";\n\t$transactionsDetails = $db->rawQuery($M_R_query);\n\treturn $transactionsDetails;\t\n}", "function get_refund_by_ccode($ccode,$currentdate) {\n\tglobal $db;\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(gp_transaction.gp_trans_datetime) AS year, MONTH(gp_transaction.gp_trans_datetime) AS month, COUNT(DISTINCT gp_transaction.gp_transaction_id) AS transcount, SUM(gp_transaction.gp_amount) AS transamount FROM merchants JOIN gp_transaction ON gp_transaction.gp_merchant_id = merchants.mer_map_id AND merchants.currency_code= '$ccode' AND gp_transaction.gp_transaction_type IN ('2','s2') AND gp_transaction.gp_status='success' AND MONTH(gp_transaction.gp_trans_datetime) = MONTH('$currentdate') GROUP BY year, month\";\n\t$transactionsDetails = $db->rawQuery($M_R_query);\n\treturn $transactionsDetails;\n}", "function get_years_to_search() {\n global $DB;\n $sql = \"SELECT date AS fecha FROM {report_user_statistics};\";\n $dates = $DB->get_records_sql($sql);\n $result = array();\n foreach ($dates as $date) {\n $fecha = new DateTime(\"@$date->fecha\");\n $result[$fecha->format('Y')] = $fecha->format('Y');\n }\n return $result;\n}", "function showLast30($data){\ntry{\n $sym = $data[\"Symbol\"];\n $symbol = getInfo($sym);\n $newObj = json_decode($symbol);\n\n //How many days are we returning?\n $days = 30;\n\n $Close = array();\n\n //Populate a new object with the necesary information\n for ($i = 0; $i < $days;$i++)\n {\n array_push($Close, $newObj->Close[$i]); \n }\n} catch (Exception $e){\n echo \"Error : \" . $e->getMessage();\n }\n return json_encode($Close);\n}", "public function trending(){\n\n $response = Http::get(self::baseURL.'/trending?api_key='.self::api_key.'&limit='.self::limit.'&rating=g');\n \n return $response->json();\n \n }", "public function getCurrentMonthData() {\n\t\t//return $this->getDataByInterval($currentMonth, $currentYear, $currentMonth, $currentYear);\n\t\t$dates = getPeriods('CurrentMonth');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear']);\t\t\n\t}", "public function makeChart(){\n\n //$monthcreated_at->format('d');\n $data= \\DB::table(\"donations\")\n\n ->select(DB::raw(\"HOUR(created_at) as months\"),DB::raw(\"(SUM(amount)) as total\"))\n\n ->groupBy(DB::raw(\"HOUR(created_at)\"))\n\n ->get();\n\n\nreturn ($data); \n \n }", "public function getHistories($user_id = null ,$fromDate = null ,$toDate = null,$params = array())\n {\n \n $condition = array();\n $condition =\" 1=1 \";\n if ($user_id != null)\n {\n $condition .= \" AND his.user_id = \".$user_id;\n }\n if ($fromDate != null)\n {\n $condition .= \" AND DATEDIFF(DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d'),'\".$fromDate.\"')>=0\";\n }\n if ($toDate != null)\n {\n $condition .= \" AND DATEDIFF(DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d'),'\".$toDate.\"')<=0\";\n }\n foreach($params as $key=>$value)\n {\n if ( $key != 'limit' && $key!='group_by')\n $condition .= $value;\n }\n if(!isset($params['limit']))\n $params['limit'] = 50;\n $count = 0;\n if(!isset($params['group_by']))\n {\n $count = 0;\n $t_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music');\n $t_name = $t_table->info('name');\n $select = $t_table->select()->setIntegrityCheck(false)\n ->from(\"$t_name as his\",array(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d' ) as pDate\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='song' and item_id>0 and transaction_status =1) as selling_sold_songs\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='album' and item_id>0 and transaction_status =1) as selling_sold_albums\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 0) as selling_transaction_fail\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 1) as selling_transaction_succ\",\n \"(SELECT sum(amount) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and (item_type='song' or item_type='album') and item_id>0 and transaction_status = 1 ) as selling_total_amount\"\n ));\n $select ->where($condition)\n ->group(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d')\")\n ->order(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d') DESC\")\n ->limit($params['limit']);\n $histories = $t_table->fetchAll($select)->toArray();\n $count = count($histories); \n return array($histories,$count);\n }\n else\n {\n $count = 0; \n $t_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music');\n $t_name = $t_table->info('name');\n $select = $t_table->select()->setIntegrityCheck(false)\n ->from(\"$t_name as his\",array(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d' ) as pDate\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='song' and item_id>0 and transaction_status =1) as selling_sold_songs\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='album' and item_id>0 and transaction_status =1) as selling_sold_albums\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 0) as selling_transaction_fail\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 1) as selling_transaction_succ\",\n \"(SELECT sum(amount) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and (item_type='song' or item_type='album') and item_id>0 and transaction_status = 1 ) as selling_total_amount\"\n ));\n $select ->where($condition)\n ->group($params['group_by'])\n ->order(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d') ASC\")\n ->limit($params['limit']);\n $histories = $t_table->fetchAll($select)->toArray();\n $count = count($histories); \n return array($histories,$count);\n }\n \n }", "public function index(Request $request)\n {\n $last_year_invoices = Invoice::whereDate('created_at', '>', Carbon::now()->subDays(365))->get();\n $last_month_invoices = Invoice::whereDate('created_at', '>', Carbon::now()->subDays(30))->get();\n $last_month_paid = 0;\n $last_month_unpaid = 0;\n $last_month_total = 0;\n $recurring_invoice = 0;\n $last_year_total = 0;\n $paid_invoice_per_day= []; // for graph\n\n foreach ($last_month_invoices as $last_month_invoice) {\n if ($last_month_invoice->is_paid == 1) {\n\n $last_month_paid = $last_month_paid + $last_month_invoice->total_amount;\n\n // paid invoice graph\n if (array_key_exists($last_month_invoice->created_at->format('M d'), $paid_invoice_per_day)) {\n $paid_invoice_per_day[$last_month_invoice->created_at->format('M d')] = $paid_invoice_per_day[$last_month_invoice->created_at->format('M d')] + $last_month_invoice->total_amount;\n }else{\n $paid_invoice_per_day[$last_month_invoice->created_at->format('M d')] = $last_month_invoice->total_amount;\n }\n\n }else{\n $last_month_unpaid = $last_month_unpaid + $last_month_invoice->total_amount;\n }\n\n // recurring total\n if ($last_month_invoice->is_autometic == 1) {\n $recurring_invoice = $recurring_invoice + $last_month_invoice->total_amount;\n }\n\n }\n $last_month_total = $last_month_paid + $last_month_unpaid;\n\n\n\n foreach ($last_year_invoices as $last_year_invoice) {\n $last_year_total = $last_year_total + $last_year_invoice->total_amount; \n }\n\n // customer list\n $keyword = $request->get('search');\n $perPage = 25;\n if (!empty($keyword)) {\n $customers = Customer::where('name', 'LIKE', \"%$keyword%\")\n ->orWhere('email', 'LIKE', \"%$keyword%\")\n ->orWhere('business_name', 'LIKE', \"%$keyword%\")\n ->orWhere('address', 'LIKE', \"%$keyword%\")\n ->orWhere('city', 'LIKE', \"%$keyword%\")\n ->orWhere('state', 'LIKE', \"%$keyword%\")\n ->orWhere('zip', 'LIKE', \"%$keyword%\")\n ->latest()->paginate($perPage);\n } else {\n $customers = Customer::latest()->paginate($perPage);\n }\n return view('home', compact('last_month_paid','last_month_unpaid','last_month_total','last_year_total', 'customers', 'paid_invoice_per_day', 'recurring_invoice'));\n }", "function get_refund_by_ccode($ccode,$currentdate) {\r\n\tglobal $db;\r\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.refund_amount) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND merchants.currency_code= '$ccode' AND transaction_alipay.transaction_type IN ('2','s2') AND transaction_alipay.result_code='SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$currentdate') GROUP BY year, month\";\r\n\t$transactionsDetails = $db->rawQuery($M_R_query);\r\n\treturn $transactionsDetails;\r\n}", "public function purchaseSalesCancelInvoiceGraph($financial_month, $financialYearDD, $userId)\r\n\t{\r\n\t\t$cancelInvoiceArray=array();\r\n\t\t$cancelInvoiceData=array();\r\n\t\t\r\n\t\t$cancelSaleInvoice='SELECT count(reference_number) as sales_invoice FROM '.$this->tableNames['client_invoice'].'\r\n\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\tand added_by=\"'.$userId.'\"\r\n\t\tand is_deleted=\"0\" \r\n\t\tand is_canceled=\"1\"';\r\n\t\t\r\n\t\t//total purchase invoice\r\n\t\t$cancelPurchaseInvoice = 'SELECT count(reference_number) as purchase_invoice \r\n\t\tFROM '.$this->tableNames['client_purchase_invoice'].'\r\n\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\tand added_by=\"'.$userId.'\"\r\n\t\tand is_deleted=\"0\" \r\n\t\tand is_canceled=\"1\"';\r\n\r\n\t\t$totalCancelSalesInvoice = $this->get_row($cancelSaleInvoice,false);\r\n\t\t$totalCancelPurchaseInvoice = $this->get_row($cancelPurchaseInvoice,false);\r\n\t\t\r\n\t\tif(empty($totalCancelSalesInvoice)) {\r\n\t\t\t$cancelInvoiceData['sales'] = \"0\";\r\n\t\t} else {\r\n\t\t\t$cancelInvoiceData['sales'] = $totalCancelSalesInvoice[0];\r\n\t\t}\r\n\t\t\r\n\t\tif(empty($totalCancelPurchaseInvoice)) {\r\n\t\t\t$invoiceData['purchase'] = \"0.00\";\r\n\t\t} else {\r\n\t\t\t$cancelInvoiceData['purchase'] = $totalCancelPurchaseInvoice[0];\r\n\t\t\t$cancelInvoiceData['month'] = $financial_month;\r\n\t\t}\r\n\t\tarray_push($cancelInvoiceArray, $cancelInvoiceData);\r\n\t\treturn $cancelInvoiceArray;\r\n\t}", "function getGraph1Data(&$countries,&$ill){\n\n global $db;\n $countries = array();\n $ill = array();\n\n //vyber nazvu krajiny, populacie a poctu nakazenych z posledneho zaznamu pe kazdu krajinu\n $query = \"SELECT countryname, population, SUM(confirmed) AS 'ill'\n FROM data AS MainData INNER JOIN place ON place_id = place.id \n WHERE reportdate = ( \n SELECT MAX(reportdate) FROM data AS SubData \n WHERE SubData.place_id = MainData.place_id \n ) \n GROUP BY countryname,population\n ORDER BY countryname DESC\";\n $results = $db->query($query)->fetchAll(PDO::FETCH_ASSOC);\n\n //z kazdeho zaznamu sa zoberie populacia a pocet nakazenych\n $records = array();\n foreach ($results as $result){\n if ($result[\"population\"]>0){\n $cases = 100000.0*$result[\"ill\"]/$result[\"population\"];\n }\n else{\n /*ak v tabulke nie je uvedena populacia, pocet pripadov bude 0 (taketo pripady nastavaju iba zriedka,\n ked sa v datach z Githubu vyskytuje krajina, ktora nie je v tabulke z Worldometers) */\n $cases = 0;\n }\n $records[$result[\"countryname\"]] = $cases;\n }\n\n $countries = array_keys($records);\n $ill = array_values($records);\n\n}", "public function get_income_expenditure_report_data($year)\n\t{\n\t\t$this->db->where('td_fee_collection.session', $year);\n\t\t$this->db->select('tb_fin_head.name as name, SUM(td_fee_subfunds.amount) as amount');\n\t\t$this->db->group_by('td_fee_subfunds.fee_head_id');\n\t\t$this->db->order_by('tb_fin_head.name', 'asc');\n\t\t$this->db->from('td_fee_collection');\n\t\t$this->db->join('td_fee_subfunds', 'td_fee_subfunds.fee_id = td_fee_collection.fee_id', 'inner');\n\t\t$this->db->join('tb_fin_head', 'tb_fin_head.id = td_fee_subfunds.fee_head_id', 'inner');\n\t\t$query=$this->db->get();\n\t\treturn $query->result();\n\t}", "function get_cancellast_by_ccode($ccode_last,$lastmonthdate) {\r\n\tglobal $db;\r\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.total_fee) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND merchants.currency_code= '$ccode_last' AND transaction_alipay.transaction_type IN ('4','s4') AND transaction_alipay.result_code='SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$lastmonthdate') GROUP BY year, month\";\r\n\t$transactionsDetails = $db->rawQuery($M_R_query);\r\n\treturn $transactionsDetails;\r\n}", "public function all($transactionToken = null)\n {\n $append = '';\n\n if ($transactionToken) {\n $append = '?since_token='.$transactionToken;\n }\n\n return $this->client->get('v1/transactions.json'.$append);\n }", "function all(){\n\t\t$query = $this->db->query(\"SELECT * FROM transactions ORDER BY DateTime DESC;\");\n\t\t\n\t\treturn $query->result_array();\n\t}", "public function transactions() {\n if ($this->input->get('view')) {\n $id = $this->myencrypt->decrypt_url($this->input->get('transaction_id'));\n $data['transaction'] = $this->account_model->getTransactions(array('ttransactions.ttransaction_id' => $id));\n } else {\n $mfinancialyear_id = null;\n if ($this->session->has_userdata('financialyear')) {\n $financialyear_data = $this->session->userdata('financialyear');\n $mfinancialyear_id = $financialyear_data['mfinancialyear_id'];\n }\n if ($this->input->get('unlimited')) {\n $data['unlimited'] = true;\n $data['transactions'] = $this->account_model->getTransactions(false, array('mfinancialyear_id' => $mfinancialyear_id));\n } else {\n $data['transactions'] = $this->account_model->getTransactions(FALSE, array('mfinancialyear_id' => $mfinancialyear_id), 10);\n }\n }\n $this->view('transactions', $data);\n }", "public function get_sales_data(Request $request){\n\n $sales_graph=$this->all_orders->groupBy(function($item){\n return ($item->created_at->format('Y:m'));\n })->map(function($item,$key){\n return ($item->sum('grand_total'));\n });\n $orders_graph=$this->all_orders->groupBy(function($item){\n return ($item->created_at->format('Y:m'));\n })->map(function($item,$key){\n return ($item->count());\n });\n \n $sales_str=\"[\";\n foreach($sales_graph as $key=>$value){\n\n if($sales_graph->last()==$value)\n $sales_str.='{\"Month\" : \"' . $key . '\", \"Sales\":\"'.$value .'\"}';\n else\n $sales_str.='{\"Month\": \"' . $key . '\", \"Sales\":\"'.$value .'\"},';\n }\n $sales_str.=\"]\";\n \n $orders_str=\"[\";\n \n foreach($orders_graph as $key=>$value){\n\n if($orders_graph->last()==$value)\n $orders_str.='{\"Month\" : \"' . $key . '\", \"Orders\":\"'.$value .'\"}';\n else\n $orders_str.='{\"Month\": \"' . $key . '\", \"Orders\":\"'.$value .'\"},';\n }\n $orders_str.=\"]\";\n\n\n echo json_encode([$sales_str,$orders_str]);\n }" ]
[ "0.60202193", "0.58048856", "0.57760024", "0.57711565", "0.5679172", "0.5591546", "0.55611396", "0.5534792", "0.55335593", "0.5418142", "0.53831774", "0.5345678", "0.53005767", "0.52926964", "0.5277447", "0.5244677", "0.5233765", "0.523042", "0.5188856", "0.5172038", "0.5154821", "0.5154716", "0.5100729", "0.50936955", "0.5083283", "0.5068172", "0.5066109", "0.50651205", "0.5064697", "0.5013628", "0.5010261", "0.5007283", "0.5004127", "0.5002651", "0.49960986", "0.49956474", "0.49947044", "0.4991887", "0.49853685", "0.4976069", "0.49721047", "0.49551845", "0.49435136", "0.49203682", "0.49176982", "0.4916322", "0.49144334", "0.49121183", "0.48836634", "0.48791778", "0.48775262", "0.48701435", "0.4855297", "0.48443824", "0.48348686", "0.48236176", "0.48222154", "0.4801383", "0.47959107", "0.47914514", "0.47910926", "0.47903013", "0.47899392", "0.47892308", "0.47872385", "0.47851214", "0.4779177", "0.47629362", "0.47526738", "0.47510493", "0.47501722", "0.474923", "0.47436467", "0.47436467", "0.47420502", "0.47351518", "0.47299227", "0.47282737", "0.4725356", "0.47203892", "0.4716555", "0.47123516", "0.47117493", "0.4710404", "0.47102067", "0.47099966", "0.47089535", "0.47083604", "0.4708338", "0.47023585", "0.46970397", "0.46968383", "0.46944472", "0.46870646", "0.46841466", "0.46774083", "0.46747172", "0.4673625", "0.46717748", "0.46712565" ]
0.6082251
0
Process received transactions data
protected function _processOrderData($data = []) { $key = ''; foreach ($data as $trans) { if (!$key) { $key = $trans['time']; } $result[$trans['time']] = [ 'y' => $trans['time'], 'order_num' => isset($trans['order_num'])?$trans['order_num']:0, 'amount' => isset($trans['amount'])?$trans['amount']:0, ]; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processTransaction($data){\n\n\t\t$bmtProducts = array( // todo add more products \n\t\t\t91390007 => '50',\n\t\t\t91390006 => '10',\n\t\t\t91390005 => '25',\n\t\t\t91390009 => '100',\n\t\t\t91390008 => '75',\n\t\t\t\n\t\t);\n\t \n\t $sessionId = $data['ccom'];\n\t $pid = $data['productid'];\n\t \n\t $value = $bmtProducts[$pid];\n\t \n\t \t$file = 'people.log';\n\t\t$person = \"\".json_encode($data).\"\\n\";\n\n\t\tfile_put_contents($file, $person, FILE_APPEND | LOCK_EX);\n\t\t\n\t\t/** get member info by session ID **/\n\t\t$rows = getMemberInfoBySessionId($sessionId);\n\t\taddPoints($data, $rows, $value);\n\n\t\t\n\t}", "public function transaction_process()\n {\n $this->_post_vars = array_merge($_GET, $_POST);\n\n if (!isset($this->_post_vars['cart_order_id'])) {\n //process as an INS signal\n return $this->_processINS();\n }\n //Need to add <base ...> tag so it displays correctly\n geoView::getInstance()->addBaseTag = true;\n\n //VARIABLES PASSED-BACK\n //order_number - 2Checkout order number\n //card_holder_name\n //street_address\n //city\n //state\n //zip\n //country\n //email\n //phone\n //cart_order_id\n //credit_card_processed\n //total\n //ship_name\n //ship_street_address\n //ship_city\n //ship_state\n //ship_country\n //ship_zip\n trigger_error('DEBUG TRANSACTION: Top of transaction_process.');\n\n if (!$this->get('testing_mode')) {\n //check the hash\n $hash = $this->_genHash(false);\n if (!$hash || ($this->_post_vars['key'] !== $hash)) {\n //NOTE: if testing mode turned on, it will skip the normal demo mode checks.\n trigger_error('DEBUG TRANSACTION: Payment failure, secret word/MD5 hash checks failed.');\n self::_failure($transaction, 2, \"No response from server, check vendor settings\");\n return;\n }\n //gets this far, the md5 hash check passed, so safe to proceed.\n }\n\n //true if $_SERVER['HTTP_REFERER'] is blank or contains a value from $referer_array\n trigger_error('DEBUG TRANSACTION: MD5 hash check was successful.');\n\n trigger_error('DEBUG TRANSACTION: 2checkout vars: ' . print_r($this->_post_vars, 1));\n //get objects\n $transaction = geoTransaction::getTransaction($this->_post_vars['cart_order_id']);\n if (!$transaction || $transaction->getID() == 0) {\n //failed to reacquire the transaction, or transaction does not exist\n trigger_error('DEBUG TRANSACTION: Could not find transaction using: ' . $this->_post_vars['cart_order_id']);\n self::_failure($transaction, 2, \"No response from server\");\n return;\n }\n $invoice = $transaction->getInvoice();\n $order = $invoice->getOrder();\n\n //store transaction data\n $transaction->set('twocheckout_response', $this->_post_vars);\n //transaction will be saved when order is saved.\n\n if (($this->_post_vars[\"order_number\"]) && ($this->_post_vars[\"cart_order_id\"])) {\n //if ($this->_post_vars[\"credit_card_processed\"] == \"Y\")\n if (strcmp($this->_post_vars[\"credit_card_processed\"], \"Y\") == 0) {\n //CC processed ok, now do stuff on our end\n //Might want to add further checks, like to check MD5 hash (if possible),\n //or check that the total is correct.\n trigger_error('DEBUG TRANSACTION: Payment success!');\n //let the objects do their thing to make this active\n self::_success($order, $transaction, $this);\n } else {\n //error in transaction, possibly declined\n trigger_error('DEBUG TRANSACTION: Payment failure, credit card not processed.');\n self::_failure($transaction, $this->_post_vars[\"credit_card_processed\"], \"2Checkout: Card not approved\");\n }\n } else {\n trigger_error('DEBUG TRANSACTION: Payment failure, no order number or cart order ID.');\n self::_failure($transaction, 2, \"No response from server\");\n }\n }", "public function processData() {}", "public function doProcessData() {}", "function en_send_transdata() {\n\t// Handle sending of data\n}", "public function transaction_process()\n {\n //treat as a robot, to avoid redirection or cookie issues.\n //shouldn't need to do this anymore\n //define('IS_ROBOT',true);\n\n //transId\n //transStatus\n // Y - successful\n // C - cancelled\n //transTime\n //authAmount\n //authCurrency\n //authAmountString\n //rawAuthMessage\n //rawAuthCode\n //callbackPW\n //cardType\n //countryString\n //countryMatch\n // Y - match\n // N - no match\n // B - comparison not available\n // I - contact country not supplied\n // S - card issue country not available\n //AVS\n // 1234\n // 1 - card verification\n // 2 - postcode AVS check\n // 3 - address AVS check\n // 4 - country comparison check\n // values\n // 0 - not supported\n // 1 - not checked\n // 2 - matched\n // 4 - not matched\n // 8 - partially matched\n //cartId\n //M_sessionId\n //M_customerId\n //name\n //address\n //postcode\n //country\n //tel\n //fax\n //email\n //amount\n //currency\n //description\n\n trigger_error('DEBUG TRANSACTION: start worldpay transaction process');\n\n $response = $_POST;\n\n //Check to make sure this is valid\n if (!($response[\"cartId\"]) && ($response[\"M_customerId\"])) {\n //Not stuff returned\n return;\n }\n\n if (strlen(trim($this->get(\"callback_password\"))) > 0) {\n if ($this->get(\"callback_password\") != $response[\"callbackPW\"]) {\n //password does not match\n return false;\n }\n }\n\n //transaction id is saved by \"cartId\"\n $trans_id = intval($response[\"cartId\"]);\n $transaction =& geoTransaction::getTransaction($trans_id);\n trigger_error('DEBUG TRANSACTION: paypal:transaction_process() - right AFTER - transaction: ' . print_r($transaction, 1));\n\n //save response data\n $transaction->set('worldpay_response', $response);\n $transaction->save();\n\n //make sure all of transaction info matches with what was passed back.\n if ($transaction->getUser() != $response[\"M_customerId\"]) {\n //something is wrong, do not proceed\n trigger_error('ERROR TRANSACTION: Invalid user set for transaction: ' . $trans_id);\n return;\n }\n if ($transaction->getGatewayTransaction() != $response[\"M_sessionId\"]) {\n //something is wrong, do not proceed\n trigger_error('ERROR TRANSACTION: Invalid session id set for transaction: ' . $trans_id);\n return;\n }\n if ($transaction->getAmount() != $response[\"authAmount\"] || $transaction->getStatus()) {\n //something is wrong, do not proceed\n trigger_error('ERROR TRANSACTION: Invalid transaction data returned for transaction: ' . $trans_id);\n return;\n }\n\n //worldpay transloads whatever result page is shown onto their own server, and displays it without CSS for \"security.\"\n //it *does* complete this POST, though, so we can go ahead right now and mark the transaction as success/failed in the database\n //but set our normal success/failure functions to not render the page -- instead echo just a redirect to transaction_result.php to return the user fully to the local site\n\n if ($response[\"transStatus\"] == \"C\") {\n //cancelled -- fail\n self::_failure($transaction, $response[\"transStatus\"], \"Worldpay said: \" . $response['rawAuthMessage'], true);\n } elseif ($response[\"transStatus\"] != \"Y\") {\n //fail\n self::_failure($transaction, $response[\"transStatus\"], \"Worldpay said: \" . $response['rawAuthMessage'], true);\n } else {\n //success\n self::_success($transaction->getInvoice()->getOrder(), $transaction, geoPaymentGateway::getPaymentGateway(self::getType()), true);\n }\n\n $db = DataAccess::getInstance();\n $target = str_replace($db->get_site_setting('classifieds_file_name'), 'transaction_result.php?transaction=' . $transaction->getId(), $db->get_site_setting('classifieds_url'));\n echo '<meta http-equiv=\"refresh\" content=\"1; url=' . $target . '\">';\n }", "function processData() ;", "public function shellProcessTransactions() {\n\t\t\t$response = $this->_processTransactions();\n\t\t\treturn $response;\n\t\t}", "protected function processReceivedData() {\n\n parent::processReceivedData();\n }", "function handle_transaction()\n\t{\t\n\t\tif ((file_exists(get_file_base().'/data_custom/ecommerce.log')) && (is_writable_wrap(get_file_base().'/data_custom/ecommerce.log')))\n\t\t{\n\t\t\t$myfile=fopen(get_file_base().'/data_custom/ecommerce.log','at');\n\t\t\tfwrite($myfile,serialize($_POST).chr(10));\n\t\t\tfclose($myfile);\n\t\t}\n\n\t\t// assign posted variables to local variables\n\t\t$purchase_id=post_param('custom','-1');\n\n\t\t$txn_type=post_param('txn_type',NULL);\n\n\t\tif ($txn_type=='cart')\n\t\t{\t\n\t\t\trequire_lang('shopping');\n\t\t\t$item_name=do_lang('CART_ORDER',$purchase_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$item_name=(substr(post_param('txn_type',''),0,6)=='subscr')?'':post_param('item_name','');\n\t\t}\n\n\t\t$payment_status=post_param('payment_status',''); // May be blank for subscription\n\t\t$reason_code=post_param('reason_code','');\n\t\t$pending_reason=post_param('pending_reason','');\n\t\t$memo=post_param('memo','');\n\t\t$mc_gross=post_param('mc_gross',''); // May be blank for subscription\n\t\t$tax=post_param('tax','');\n\t\tif (($tax!='') && (intval($tax)>0) && ($mc_gross!='')) $mc_gross=float_to_raw_string(floatval($mc_gross)-floatval($tax));\n\t\t$mc_currency=post_param('mc_currency',''); // May be blank for subscription\n\t\t$txn_id=post_param('txn_id',''); // May be blank for subscription\n\t\t$parent_txn_id=post_param('parent_txn_id','-1');\n\t\t$receiver_email=post_param('receiver_email',null);\n\t\tif ($receiver_email===null) $receiver_email=post_param('business');\n\n\t\t// post back to PayPal system to validate\n\t\tif (!ecommerce_test_mode())\n\t\t{\n\t\t\trequire_code('files');\n\t\t\t$pure_post=isset($GLOBALS['PURE_POST'])?$GLOBALS['PURE_POST']:$_POST;\n\t\t\t$x=0;\n\t\t\t$res=mixed();\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$res=http_download_file('https://'.(ecommerce_test_mode()?'www.sandbox.paypal.com':'www.paypal.com').'/cgi-bin/webscr',NULL,false,false,'ocPortal',$pure_post+array('cmd'=>'_notify-validate'));\n\t\t\t\t$x++;\n\t\t\t}\n\t\t\twhile ((is_null($res)) && ($x<3));\n\t\t\tif (is_null($res)) my_exit(do_lang('IPN_SOCKET_ERROR'));\n\t\t\tif (!(strcmp($res,'VERIFIED')==0))\n\t\t\t{\n\t\t\t\tif (post_param('txn_type','')=='send_money') exit('Unexpected'); // PayPal has been seen to mess up on send_money transactions, making the IPN unverifiable\n\t\t\t\tmy_exit(do_lang('IPN_UNVERIFIED').' - '.$res.' - '.flatten_slashed_array($pure_post),strpos($res,'<html')!==false);\n\t\t\t}\n\t\t}\n\n\t\t$txn_type=str_replace('-','_',post_param('txn_type'));\n\t\tif ($txn_type=='subscr-modify')\n\t\t{\n\t\t\t$payment_status='SModified';\n\t\t\t$txn_id=post_param('subscr_id').'-m';\n\t\t}\n\t\telseif ($txn_type=='subscr_signup')\n\t\t{\n\t\t\t$payment_status='Completed';\n\t\t\t$mc_gross=post_param('mc_amount3');\n\t\t\tif (post_param_integer('recurring')!=1) my_exit(do_lang('IPN_SUB_RECURRING_WRONG'));\n\t\t\t$txn_id=post_param('subscr_id');\n\t\t}\n\t\telseif ($txn_type=='subscr_eot' || $txn_type=='recurring_payment_suspended_due_to_max_failed_payment')\n\t\t{\n\t\t\t$payment_status='SCancelled';\n\t\t\t$txn_id=post_param('subscr_id').'-c';\n\t\t}\n\t\telseif ($txn_type=='subscr_payment' || $txn_type=='subscr_failed' || $txn_type=='subscr_cancel')\n\t\t{\n\t\t\texit();\n\t\t}\n\n\t\t$primary_paypal_email=get_value('primary_paypal_email');\n\n\t\tif (!is_null($primary_paypal_email))\n\t\t{\n\t\t\tif ($receiver_email!=$primary_paypal_email) my_exit(do_lang('IPN_EMAIL_ERROR'));\n\t\t} else\n\t\t{\n\t\t\tif ($receiver_email!=$this->_get_payment_address()) my_exit(do_lang('IPN_EMAIL_ERROR'));\n\t\t}\n\n\t\tif (addon_installed('shopping'))\n\t\t{\n\t\t\tif (preg_match('#'.str_replace('xxx','.*',preg_quote(do_lang('shopping:CART_ORDER','xxx'),'#')).'#',$item_name)!=0)\n\t\t\t{\n\t\t\t\t$this->store_shipping_address($purchase_id);\n\t\t\t}\n\t\t}\n\n\t\treturn array($purchase_id,$item_name,$payment_status,$reason_code,$pending_reason,$memo,$mc_gross,$mc_currency,$txn_id,$parent_txn_id);\n\t}", "public function DoTransaction(){\t\t\n\t\tif($this->IsLoggedIn('cashier')){\t\t\t\n\t\t\tif(isset($_POST) && !empty($_POST)){\n\t\t\t\t$customer_id = $_POST['txn_data']['txn_customer_id'];\t\t\t\t\t\t\t\n\t\t\t\t$count=1;\n\t\t\t\tforeach($_POST['cart_data'] as $key => $value)\n\t\t\t\t{\n\t\t\t\t\tif($key){\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// end\n\t\t\t\t$business_admin_id = $this->session->userdata['logged_in']['business_outlet_id'];\n\t\t\t\t$result = $this->CashierModel->BillingTransaction($_POST,$this->session->userdata['logged_in']['business_outlet_id'],$this->session->userdata['logged_in']['business_admin_id']);\n\n\t\t\t\tif($result['success'] == 'true'){\n\t\t\t\t\t$transcation_detail = $this->CashierModel->GetBilledServicesByTxnId($result['res_arr']['res_arr']['insert_id']);\n\t\t\t\t\t\n\t\t\t\t\t$cart_data['transaction_id'] = $result['res_arr']['res_arr']['insert_id'];\n\t\t\t\t\t$cart_data['outlet_admin_id'] = $business_admin_id;\t\t\t\t\t\n\t\t\t\t\t$cart_data['transaction_time'] = $transcation_detail['res_arr'][0]['txn_datetime'];\n\t\t\t\t\t$cart_data['cart_data'] = json_encode($_POST['cart_data']);\n\t\t\t\t\t$cart_detail = $this->CashierModel->Insert($cart_data,'mss_transaction_cart');\n\t\t\t\t\tif($cart_detail['success'] == 'true'){\n\t\t\t\t\t\t$this->session->set_userdata('loyalty_point',$transcation_detail['res_arr'][0]['txn_loyalty_points']);\n\t\t\t\t\t\t$this->session->set_userdata('cashback',$transcation_detail['res_arr'][0]['txn_loyalty_cashback']);\n\t\t\t\t\t\t$detail_id = $cart_detail['res_arr']['insert_id'];\n\t\t\t\t\t\t$bill_url = base_url().\"Cashier/generateBill/$customer_id/\".base64_encode($detail_id);\n\t\t\t\t\t\t$bill_url = str_replace(\"https\", \"http\", $bill_url);\n\t\t\t\t\t\t$bill_url = shortUrl($bill_url);\n\t\t\t\t\t}\n\n\t\t\t\t\t//1.Unset the payment session\n\t\t \t\t\tif(isset($this->session->userdata['payment'])){\n\t\t \t\t\t\t$this->session->unset_userdata('payment');\n\t\t\t\t\t }\n\t\t\t\t\t //j\n\t\t\t\t\t //Memebership Package Loyalty Calculation\n if(isset($this->session->userdata['cart'][$customer_id]))\n { \n $data = $this->CashierModel->GetCustomerPackages($customer_id);\n if($data['success'] == 'false')\n {\n // $this->PrettyPrintArray(\"Customer Does not have special membership\");\n }\n else{\n if(!empty($data['res_arr']))\n {\n if(isset($this->session->userdata['cart'][$customer_id]))\n {\n $curr_sess_cart = $this->session->userdata['cart'][$customer_id];\n $cart_data = array();\n $i = 0;\n $j = 0;\n $total_product = 0;\n $total_points = 0;\n for($j;$j<count($curr_sess_cart);$j++)\n {\n $service_details = $this->CashierModel->DetailsById($curr_sess_cart[$j]['service_id'],'mss_services','service_id');\n if(isset($service_details['res_arr']))\n {\n // print_r($service_details['res_arr']);\n if($service_details['res_arr']['service_type'] == 'otc')\n {\n $total_product += $curr_sess_cart[$j]['service_total_value'];\n $total_points+= ($curr_sess_cart[$j]['service_total_value']*$data['res_arr'][$i]['service_discount'])/100;\n $curr_sess_cart[$j] += ['service_discount'=>$data['res_arr'][$i]['service_discount']];\n \n array_push($cart_data,$curr_sess_cart[$j]);\n // array_push($cart_data,$data['res_arr'][$i]['service_discount']);\n }\n }\n }\n \n if(!empty($cart_data))\n {\n foreach($cart_data as $key=>$value)\n {\n }\n }\n $update = array(\n 'total_points' => $total_points,\n 'txn_id' => $result['res_arr']['res_arr']['insert_id'],\n 'customer_id' => $customer_id\n );\n $result_2 = $this->CashierModel->SpecialLoyaltyPoints($update,$this->session->userdata['logged_in']['business_outlet_id'],$this->session->userdata['logged_in']['business_admin_id']);\n // $this->PrettyPrintArray($cart_data);\n // exit;\n }\n }\n \n }\n \n }\n\t\t\t\t\t //end\n \n // 2.Then unset the cart session\n\t\t \t\t\tif(isset($this->session->userdata['cart'][$customer_id])){\n\t\t \t\t\t\t$curr_sess_cart_data = $this->session->userdata['cart'];\n\t\t \t\t\t\tunset($curr_sess_cart_data[''.$customer_id.'']);\n\t\t \t\t\t\t$this->session->set_userdata('cart',$curr_sess_cart_data);\n\t\t \t\t\t}\n if(isset($this->session->userdata['recommended_ser'][$customer_id])){\n\t\t\t\t\t\t$curr_sess_cart_data = $this->session->userdata['recommended_ser'];\n\t\t\t\t\t\tunset($curr_sess_cart_data[''.$customer_id.'']);\n\t\t\t\t\t\t$this->session->set_userdata('recommended_ser',$curr_sess_cart_data);\n\t\t\t\t\t}\n\t\t\t\t\t//3.Then unset the customer session from POS\n\t\t \t\t\tif(isset($this->session->userdata['POS'])){\n\t\t \t\t\t\t$curr_sess_cust_data = $this->session->userdata['POS'];\n\t\t \t\t\t\t\n\t\t \t\t\t\t$key = array_search($customer_id, array_column($curr_sess_cust_data, 'customer_id'));\n\t\t \t\t\t\t\n\t\t \t\t\t\tunset($curr_sess_cust_data[$key]);\n\t\t \t\t\t\t$curr_sess_cust_data = array_values($curr_sess_cust_data);\n\t\t \t\t\t\t\n\t\t \t\t\t\t$this->session->set_userdata('POS',$curr_sess_cust_data);\n\t\t \t\t\t}\n\n\t\t \t\t\t//These 2 call will be used for the further enhancement of message sending architecture.\n\t\t \t\t\t$outlet_details = $this->GetCashierDetails();\n\t\t\t\t\t$customer_details = $this->GetCustomerBilling($_POST['customer_pending_data']['customer_id']);\n\t\t\t\t\t//4.Send a msg\n\t\t\t\t\t$this->session->set_userdata('bill_url',$bill_url);\n\t\t\t\t\t$sms_status = $this->db->select('*')->from('mss_business_outlets')->where('business_outlet_id',$this->session->userdata['logged_in']['business_outlet_id'])->get()->row_array();\n\t\t\t\t\t\t// $this->PrettyPrintArray($sms_status);\n\t\t\t\t\tif($sms_status['business_outlet_sms_status']==1 && $sms_status['whats_app_sms_status']==0){\n\t\t\t\t\t\tif($_POST['send_sms'] === 'true' && $_POST['cashback']>0){\n\t\t\t\t\t\t\tif($_POST['txn_data']['txn_value']==0){\n\t\t\t\t\t\t\t$this->SendPackageTransactionSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['cart_data'][0]['salon_package_name'],$count,$customer_details['customer_name'],$_POST['cart_data'][0]['service_count'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$this->SendSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\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\tif($_POST['send_sms'] === 'true' && $_POST['cashback']==0){\n\t\t\t\t\t\t\tif($_POST['txn_data']['txn_value']==0){\n\t\t\t\t\t\t\t$this->SendPackageTransactionSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['cart_data'][0]['salon_package_name'],$count,$customer_details['customer_name'],$_POST['cart_data'][0]['service_count'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t\t\t}else{\t\t\n\t\t\t\t\t\t\t$this->SendSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}elseif($sms_status['business_outlet_sms_status']==1 && $sms_status['whats_app_sms_status']==1){\n\t\t\t\t\t\t$this->SendSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\n\t\t\t\t\t\t$this->SendWhatsAppSms($sms_status['client_id'],$sms_status['whatsapp_userid'],$sms_status['whatsapp_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\n\t\t\t\t\t}elseif($sms_status['business_outlet_sms_status']==0 && $sms_status['whats_app_sms_status']==1 ){\n\t\t\t\t\t\t$this->SendWhatsAppSms($sms_status['client_id'],$sms_status['whatsapp_userid'],$sms_status['whatsapp_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t}\n\t\t\t\t\t//\n \n\t\t\t\t\t$this->ReturnJsonArray(true,false,\"Transaction is successful!\");\n\t\t\t\t\tdie;\n\t\t\t\t}\n\t\t\t\telseif ($result['error'] == 'true') {\n\t\t\t\t\t$this->ReturnJsonArray(false,true,$result['message']);\n\t\t\t\t\tdie;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t}\n\t}", "function en_receive_upload() {\n\t// Handle incoming upload transaction\n\t\n\t//! Insert the upload job into the queue.\n\n\t//! Connect to PgSQL\n\t$dbconn = new en_connection();\n\t\n\t//! Prepare the query and make the insertions\n\t$query = 'INSERT INTO en_upload_queue VALUES (nextval(\\'en_upload_queue_trid_seq\\'::regclass), ?, ?, ?, ?, ?, ?, \\'0\\') RETURNING trid;';\n/*\n\t$sth = $dbconn->con->prepare($query);\n\t$sth->execute(array($time,$vaule));\n\t$result = $sth->fetchAll();\n */\n\t\n\t$enqueue = $dbconn->con->prepare($query);\n\t$enqueue->execute(array(\n\t\t$_POST['en_inputformat'],\n\t\t$_POST['en_productformat'],\n\t\t$_POST['dataproduct_id'],\n\t\t$_POST['observation'],\n\t\t$_POST['api_id'],\n\t\t$_POST['signature']\n\t));\n\t$row = $enqueue->fetchAll();\n\ten_debug(\"Incoming to queue - APIID: \".$_POST['api_id'].\" - Product: \".$_POST['dataproduct_id'].\" - Transaction ID: \".$row[0]['trid']);\n\t\n\techo $row[0]['trid'];\n\t\n\t//!@todo AMONG OTHERS, CHECK IF SELECTED DATAPRODUCT SUPPORTS THE UPLOAD FORMAT ID\n}", "abstract protected function getTransactions();", "protected function processTransactionUpdate(\\XLite\\Model\\Payment\\Transaction $transaction, $data)\n {\n $transaction->setDataCell('status', 'Transaction successful', 'X-Payments message', 'C');\n\n if (isset($data['advinfo']) && is_array($data['advinfo'])) {\n\n if (!empty($data['advinfo']['Error'])) {\n $transaction->setDataCell('status', $data['advinfo']['Error'], 'X-Payments error', 'C');\n $transaction->setNote($data['advinfo']['Error']);\n }\n\n if (!empty($data['advinfo']['Message'])) {\n $transaction->setDataCell('status', $data['advinfo']['Message'], 'X-Payments message', 'C');\n $transaction->setNote($data['advinfo']['Message']);\n }\n }\n\n $transactionData = array(\n 'xpc_authorized' => $data['authorized'],\n 'xpc_captured' => $data['capturedAmount'],\n 'xpc_charged' => $data['chargedAmount'] + $data['refundedAmount'],\n 'xpc_voided' => $data['voidedAmount'],\n 'xpc_refunded' => $data['refundedAmount'],\n 'xpc_can_capture' => $data['capturedAmountAvail'],\n 'xpc_can_void' => $data['voidedAmountAvail'], \n 'xpc_can_refund' => $data['refundedAmountAvail'],\n 'xpc_is_fraud_status' => $data['isFraudStatus'],\n ); \n\n if (\n isset($data['isFraudStatus'])\n && '1' == $data['isFraudStatus']\n ) {\n // Set default fraud \"review\" for the backwards compatibility\n $transaction->getOrder()->setFraudTypeXpc(\\XLite\\Module\\CDev\\XPaymentsConnector\\Model\\Payment\\FraudCheckData::CODE_GATEWAY);\n $transaction->getOrder()->setFraudStatusXpc(\\XLite\\Model\\Order::FRAUD_STATUS_REVIEW);\n }\n\n if (\n version_compare(\\XLite\\Core\\Config::getInstance()->CDev->XPaymentsConnector->xpc_api_version, '1.6') <= 0\n && $transaction->getDataCell('xpc_txnid')\n ) {\n\n // API 1.6 backwards compatiblity Kount info update\n\n $transactions = array();\n $kountData = false;\n\n $info = $this->client->requestPaymentAdditionalInfo($transaction->getDataCell('xpc_txnid')->getValue()); \n\n if ($info->isSuccess()) {\n $response = $info->getResponse();\n if (\n !empty($response['transactions'])\n && is_array($response['transactions'])\n ) {\n $transactions = $response['transactions'];\n }\n }\n\n // Search for KOUNT data thru transactions\n foreach ($transactions as $tr) {\n\n if (\n isset($tr['fields'])\n && !empty($tr['fields'])\n && is_array($tr['fields'])\n ) {\n $kountData = $this->processKountData($transaction, $tr);\n\n if ((bool)$kountData) {\n $transactionData['xpc_kount'] = serialize($kountData);\n break;\n }\n }\n }\n }\n\n foreach ($transactionData as $key => $value) {\n $transaction->setXpcDataCell($key, $value);\n }\n\n $this->processCardValidationData($transaction, $data);\n\n $this->processMaskedCardData($transaction, $data);\n\n $this->process3dSecureData($transaction, $data);\n\n $this->processFraudCheckData($transaction, $data);\n }", "public function addTransactionChildren($data)\n\t{\n\t\t$oTransactionStatus = new Transactions_Status();\n\t\t$oTransactionStatus->setTransactionStatus($data['tr_id'], Transaction_Statuses::STATUS_SUBMITTED);\n\n\t\t$oProperties = new Transaction_Properties();\n\t\tforeach($data['properties'] as $value)\n\t\t{\n\t\t\t$oProperties->addProperty($data['tr_id'], $value['id'], $value['value']);\n\t\t}\n\t\t$oProperties->addProperty($data['tr_id'], 'transaction_password', $this->generatePassword());\n\n\t\t$oRelationship = new Transaction_Relationships();\n\t\t$relationship_id = $oRelationship->addRelationship($data);\n\t\t$oRelationship->handleRelationshipUploadedFiles(\n\t\t\t$relationship_id,\n\t\t\t$data['case_id'],\n\t\t\t$data['relationship_documents'],\n\t\t\t$this->getUploadedFiles('relationship_documents')\n\t\t);\n\n\t\t$oParty = new Transaction_Relationship_Parties();\n\t\t$data['rel_id'] = $relationship_id;\n\n\n\t\tforeach($data['parties'] as $party_data)\n\t\t{\n\t\t\t$party_data['rel_id'] = $relationship_id;\n\t\t\t$party_id = $oParty->addParty($party_data);\n\n\t\t\t$oSubjects = new Transaction_Relationship_Party_Subjects();\n\t\t\tforeach($party_data['data'] as $item)\n\t\t\t{\n\t\t\t\t$item['party_id'] = $party_id;\n\t\t\t\t$subject_id = $oSubjects->addSubject($item);\n\n\t\t\t\t$oSubjects->handleSubjectUploadedFiles(\n\t\t\t\t\t$subject_id,\n\t\t\t\t\t$data['case_id'],\n\t\t\t\t\t$item['fileData']['existing_files'],\n\t\t\t\t\t$this->getUploadedFiles($item['hash'])\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\n\t\t// objects part\n\t\t$oObject = new Transaction_Relationship_Objects();\n\t\tforeach($data['objects'] as $item)\n\t\t{\n\t\t\t$data['rel_id'] = $relationship_id;\n\t\t\t$data['object_type'] = $item['objectType'];\n\t\t\t$object_id = $oObject->addObject($data, $item['objectData']);\n\n\t\t\t$oObject->handleObjectUploadedFiles(\n\t\t\t\t$object_id,\n\t\t\t\t$data['case_id'],\n\t\t\t\t$item['fileData']['existing_files'],\n\t\t\t\t$this->getUploadedFiles($item['hash'])\n\t\t\t);\n\t\t}\n\t}", "public function process($data,$config){\n\t\t\t\n\t\t\t// Set the transaction details into \n\t\t\t// a serialized array for posting to\n\t\t\t// the order\n\t\t\t\t$details = array(\n\t\t\t\t\t\t\t\t\t\"Method\" => \"AlertPay IPN\" \n\t\t\t\t\t\t\t\t);\n\n\t\t\t// Return the trans details \n\t\t\t\t$trans = array(\n\t\t\t\t\t\t\t\t\t'status' => -1, \n\t\t\t\t\t\t\t\t\t'transaction_id' => $data[\"transaction_id\"],\n\t\t\t\t\t\t\t\t\t'payment_card' => \"\",\n\t\t\t\t\t\t\t\t\t'payment_type' => 'AlertPay IPN', \n\t\t\t\t\t\t\t\t\t'amount' => $data[\"order_total\"],\n\t\t\t\t\t\t\t\t\t'details' => serialize($details), \n\t\t\t\t\t\t\t\t\t'approval' => \"\" \n\t\t\t\t\t\t\t\t);\n\t\t\treturn $trans;\n\t\t}", "private function __processTransaction($txnId){\n\t\t$this->log(\"Processing Trasaction: {$txnId}\", 'paypal');\n\t\t//Put the afterPaypalNotification($txnId) into your app_controller.php\n\t\t$this->afterPaypalNotification($txnId);\n\t}", "public function process($data);", "public function process() {\n\n\t\t\t/**\n\t\t\t * Decode all data from JSON\n\t\t\t *\n\t\t\t * @var array $data\n\t\t\t */\n\t\t\t$data = json_decode($this->getData(), true);\n\n\t\t\t/**\n\t\t\t * Get keys from first row of data set\n\t\t\t *\n\t\t\t * @var array $columNames\n\t\t\t */\n\t\t\t$columnNames = array_keys($data[0]);\n\n\t\t\t/**\n\t\t\t * Generate tablename from given columns\n\t\t\t *\n\t\t\t * @var string $tableName\n\t\t\t */\n\t\t\t$tableName = \"tmp_plista_api_\" . md5(implode($columnNames));\n\n\t\t\t/**\n\t\t\t * Building the query for creating the temporary Table\n\t\t\t * Note: This function does not fires a DROP TABLE. If the\n\t\t\t * table already exists the data gets filled in again. So the\n\t\t\t * client is responsible for droping the table after usage\n\t\t\t *\n\t\t\t * @var string $sql\n\t\t\t */\n\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS `\" . $tableName . \"`\n\t\t\t(\" . implode( $columnNames, \" VARCHAR(255), \" ) . \" VARCHAR(255))\n\t\t\tENGINE=MEMORY\n\t\t\tDEFAULT CHARSET=utf8;\";\n\n\t\t\t/**\n\t\t\t * Build the query for inserting data into the temporary table\n\t\t\t *\n\t\t\t * @var string $sql\n\t\t\t */\n\t\t\tforeach ($data as $row) {\n\t\t\t\t$sql .= \"\\nINSERT INTO $tableName (\" . implode($columnNames, \", \") . \") VALUES ('\" . implode($row, \"', '\") . \"');\";\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * set the data\n\t\t\t */\n\t\t\t$this->setData(\n\t\t\t\tarray(\n\t\t\t\t\t\"table_name\"\t=> $tableName,\n\t\t\t\t\t\"query\"\t\t=> $sql\n\t\t\t\t)\n\t\t\t);\n\t\t}", "protected function _processTransactionPaymentCompleted($parameters) {\n\t\t\t$invoiceItemData = $invoiceOrderData = $pendingTransactions = array();\n\t\t\t$invoiceTotalPaid = false;\n\n\t\t\tif (!empty($parameters['subscription_id'])) {\n\t\t\t\t$existingSubscription = $this->fetch('subscriptions', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'id' => $parameters['subscription_id']\n\t\t\t\t\t),\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'payment_attempts'\n\t\t\t\t\t)\n\t\t\t\t));\n\n\t\t\t\tif (!empty($existingSubscription['count'])) {\n\t\t\t\t\t$subscriptionData = array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => $parameters['subscription_id'],\n\t\t\t\t\t\t\t'payment_attempts' => 0\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t$this->save('subscriptions', $subscriptionData);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($parameters['invoice_id'])) {\n\t\t\t\t$invoice = $this->_call('invoices', array(\n\t\t\t\t\t'methodName' => 'invoice',\n\t\t\t\t\t'methodParameters' => array(\n\t\t\t\t\t\t'invoices',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t\t\t'id' => $parameters['invoice_id'],\n\t\t\t\t\t\t\t\t'payable' => true\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttrue\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t\t$invoiceWarningLevel = $invoice['data']['invoice']['warning_level'];\n\n\t\t\t\tif (!empty($invoice['data'])) {\n\t\t\t\t\t$invoiceData = array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'amount_paid' => $invoice['data']['invoice']['amount_paid'] + $parameters['payment_amount'],\n\t\t\t\t\t\t\t'id' => $invoice['data']['invoice']['id']\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t$total = !empty($invoice['data']['invoice']['total_pending']) ? $invoice['data']['invoice']['total_pending'] : $invoice['data']['invoice']['total'];\n\n\t\t\t\t\tif (is_numeric($invoice['data']['invoice']['remainder_pending'])) {\n\t\t\t\t\t\t$invoiceData[0]['remainder_pending'] = max(0, round(($invoice['data']['invoice']['remainder_pending'] - $parameters['payment_amount']) * 100) / 100);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t!empty($invoice['data']['invoice']['user_id']) &&\n\t\t\t\t\t\t!empty($parameters['user']) &&\n\t\t\t\t\t\t$amountToApplyToBalance = max(0, min($parameters['payment_amount'], round(($invoiceData[0]['amount_paid'] - $total) * 100) / 100))\n\t\t\t\t\t) {\n\t\t\t\t\t\tif (empty($invoice['data']['orders'])) {\n\t\t\t\t\t\t\t$amountToApplyToBalance = $parameters['payment_amount'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$userData = array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'id' => $parameters['user']['id'],\n\t\t\t\t\t\t\t\t'balance' => ($parameters['user']['balance'] + $amountToApplyToBalance)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->save('users', $userData);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t$invoiceData[0]['amount_paid'] >= $total ||\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\tisset($invoiceData[0]['remainder_pending']) &&\n\t\t\t\t\t\t\t\t$invoiceData[0]['remainder_pending'] === 0\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) &&\n\t\t\t\t\t\t$this->delete('invoice_items', array(\n\t\t\t\t\t\t\t'invoice_id' => $invoiceData[0]['id']\n\t\t\t\t\t\t))\n\t\t\t\t\t) {\n\t\t\t\t\t\t$invoiceData = array(\n\t\t\t\t\t\t\tarray_merge($invoiceData[0], array(\n\t\t\t\t\t\t\t\t'remainder_pending' => null,\n\t\t\t\t\t\t\t\t'shipping' => (!empty($invoice['data']['invoice']['shipping_pending']) ? $invoice['data']['invoice']['shipping_pending'] : $invoice['data']['invoice']['shipping']),\n\t\t\t\t\t\t\t\t'shipping_pending' => null,\n\t\t\t\t\t\t\t\t'status' => 'paid',\n\t\t\t\t\t\t\t\t'subtotal' => (!empty($invoice['data']['invoice']['subtotal_pending']) ? $invoice['data']['invoice']['subtotal_pending'] : $invoice['data']['invoice']['subtotal']),\n\t\t\t\t\t\t\t\t'subtotal_pending' => null,\n\t\t\t\t\t\t\t\t'tax' => (!empty($invoice['data']['invoice']['tax_pending']) ? $invoice['data']['invoice']['tax_pending'] : $invoice['data']['invoice']['tax']),\n\t\t\t\t\t\t\t\t'tax_pending' => null,\n\t\t\t\t\t\t\t\t'total' => (!empty($invoice['data']['invoice']['total_pending']) ? $invoice['data']['invoice']['total_pending'] : $invoice['data']['invoice']['total']),\n\t\t\t\t\t\t\t\t'total_pending' => null,\n\t\t\t\t\t\t\t\t'warning_level' => 0\n\t\t\t\t\t\t\t))\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tforeach ($invoice['data']['orders'] as $orderKey => $order) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\tis_numeric($order['quantity_pending']) &&\n\t\t\t\t\t\t\t\t\t$order['quantity_pending'] > $order['quantity_active'] &&\n\t\t\t\t\t\t\t\t\t($quantity = ($order['quantity_pending'] - $order['quantity_active']))\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\t$order['status'] !== 'active' &&\n\t\t\t\t\t\t\t\t\t($quantity = $order['quantity'])\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$quantity = (!empty($order['quantity_pending']) ? $order['quantity_pending'] : $order['quantity']);\n\t\t\t\t\t\t\t\t$orderData = array(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'currency' => $order['currency'],\n\t\t\t\t\t\t\t\t\t\t'id' => $order['id'],\n\t\t\t\t\t\t\t\t\t\t'interval_type' => (!empty($order['interval_type_pending']) ? $order['interval_type_pending'] : $order['interval_type']),\n\t\t\t\t\t\t\t\t\t\t'interval_type_pending' => null,\n\t\t\t\t\t\t\t\t\t\t'interval_value' => (!empty($order['interval_value_pending']) ? $order['interval_value_pending'] : $order['interval_value']),\n\t\t\t\t\t\t\t\t\t\t'interval_value_pending' => null,\n\t\t\t\t\t\t\t\t\t\t'ip_version' => $order['ip_version'],\n\t\t\t\t\t\t\t\t\t\t'previous_action' => null,\n\t\t\t\t\t\t\t\t\t\t'price' => ($price = (!empty($order['price_pending']) ? $order['price_pending'] : $order['price'])),\n\t\t\t\t\t\t\t\t\t\t'price_active' => min($order['price_active'] + $parameters['payment_amount'], $price),\n\t\t\t\t\t\t\t\t\t\t'price_pending' => null,\n\t\t\t\t\t\t\t\t\t\t'quantity' => $quantity,\n\t\t\t\t\t\t\t\t\t\t'quantity_active' => $order['quantity_active'],\n\t\t\t\t\t\t\t\t\t\t'quantity_allocated' => $order['quantity_allocated'],\n\t\t\t\t\t\t\t\t\t\t'quantity_pending' => null,\n\t\t\t\t\t\t\t\t\t\t'shipping' => (!empty($order['shipping_pending']) ? $order['shipping_pending'] : $order['shipping']),\n\t\t\t\t\t\t\t\t\t\t'shipping_pending' => null,\n\t\t\t\t\t\t\t\t\t\t'status' => 'active',\n\t\t\t\t\t\t\t\t\t\t'tax' => (!empty($order['tax_pending']) ? $order['tax_pending'] : $order['tax']),\n\t\t\t\t\t\t\t\t\t\t'tax_pending' => null,\n\t\t\t\t\t\t\t\t\t\t'user_id' => $order['user_id']\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\t$invoice['data']['orders'][$orderKey] = array_merge($invoice['data']['orders'][$orderKey], $orderData[0]);\n\t\t\t\t\t\t\t\t$invoiceItemData[] = array_merge(array_intersect_key($orderData[0], array(\n\t\t\t\t\t\t\t\t\t'currency' => true,\n\t\t\t\t\t\t\t\t\t'interval_type' => true,\n\t\t\t\t\t\t\t\t\t'interval_value' => true,\n\t\t\t\t\t\t\t\t\t'price' => true,\n\t\t\t\t\t\t\t\t\t'quantity' => true\n\t\t\t\t\t\t\t\t)), array(\n\t\t\t\t\t\t\t\t\t'invoice_id' => $invoiceData[0]['id'],\n\t\t\t\t\t\t\t\t\t'order_id' => $order['id'],\n\t\t\t\t\t\t\t\t\t'name' => $order['name']\n\t\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t\t\tif (is_numeric($order['quantity_pending'])) {\n\t\t\t\t\t\t\t\t\t$action = $orderData[0]['previous_action'] = ($order['quantity_pending'] > $order['quantity_active'] ? 'upgrade' : 'downgrade');\n\t\t\t\t\t\t\t\t\t$pendingTransactions[] = array(\n\t\t\t\t\t\t\t\t\t\t'customer_email' => $parameters['user']['email'],\n\t\t\t\t\t\t\t\t\t\t'details' => 'Order ' . $action . ' successful for order <a href=\"' . $this->settings['base_url'] . 'orders/' . $order['id'] . '\">#' . $order['id'] . '</a>.<br>' . $order['quantity'] . ' ' . $order['name'] . ' to ' . $order['quantity_pending'] . ' ' . $order['name'] . '<br>' . number_format($order['price'], 2, '.', '') . ' ' . $order['currency'] . ' for ' . $order['interval_value'] . ' ' . $order['interval_type'] . ($order['interval_value'] !== 1 ? 's' : '') . ' to ' . number_format($order['price_pending'], 2, '.', '') . ' ' . $order['currency'] . ' for ' . $order['interval_value_pending'] . ' ' . $order['interval_type_pending'] . ($order['interval_value_pending'] !== 1 ? 's' : ''),\n\t\t\t\t\t\t\t\t\t\t'id' => uniqid() . time(),\n\t\t\t\t\t\t\t\t\t\t'initial_invoice_id' => $invoiceData[0]['id'],\n\t\t\t\t\t\t\t\t\t\t'invoice_id' => $invoiceData[0]['id'],\n\t\t\t\t\t\t\t\t\t\t'payment_amount' => 0,\n\t\t\t\t\t\t\t\t\t\t'payment_currency' => $this->settings['billing']['currency'],\n\t\t\t\t\t\t\t\t\t\t'payment_status' => 'completed',\n\t\t\t\t\t\t\t\t\t\t'payment_status_message' => 'Order ' . $action . ' successful.',\n\t\t\t\t\t\t\t\t\t\t'processed' => true,\n\t\t\t\t\t\t\t\t\t\t'transaction_charset' => $this->settings['database']['charset'],\n\t\t\t\t\t\t\t\t\t\t'transaction_date' => date('Y-m-d H:i:s', strtotime('+1 second')),\n\t\t\t\t\t\t\t\t\t\t'transaction_method' => 'PaymentCompleted',\n\t\t\t\t\t\t\t\t\t\t'user_id' => $parameters['user']['id']\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 (\n\t\t\t\t\t\t\t\t\t$this->save('orders', $orderData) &&\n\t\t\t\t\t\t\t\t\t$this->save('transactions', $pendingTransactions)\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t$actionData = array(\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'chunks' => ($chunks = ceil(($itemCount = (abs($order['quantity'] - (integer) $order['quantity_pending']))) / 10000)),\n\t\t\t\t\t\t\t\t\t\t\t'encoded_parameters' => json_encode(array(\n\t\t\t\t\t\t\t\t\t\t\t\t'action' => 'allocate',\n\t\t\t\t\t\t\t\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'order' => $orderData[0]\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'item_count' => $itemCount,\n\t\t\t\t\t\t\t\t\t\t\t\t'table' => ($itemCount === 1 ? 'proxy' : 'proxies')\n\t\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t\t'foreign_key' => 'order_id',\n\t\t\t\t\t\t\t\t\t\t\t'foreign_value' => $order['id'],\n\t\t\t\t\t\t\t\t\t\t\t'processed' => ($processOrder = ($chunks == 1)),\n\t\t\t\t\t\t\t\t\t\t\t'progress' => ($processOrder ? 100 : 0),\n\t\t\t\t\t\t\t\t\t\t\t'user_id' => $parameters['user']['id']\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tif ($processOrder) {\n\t\t\t\t\t\t\t\t\t\t$this->_call('proxies', array(\n\t\t\t\t\t\t\t\t\t\t\t'methodName' => 'allocate',\n\t\t\t\t\t\t\t\t\t\t\t'methodParameters' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'proxies',\n\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'order' => $orderData[0]\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}\n\n\t\t\t\t\t\t\t\t\t$this->save('actions', $actionData);\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\t\t\t\t\t$invoiceOrders = $this->fetch('invoice_orders', array(\n\t\t\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t\t\t'invoice_id' => array_unique(array_filter(array(\n\t\t\t\t\t\t\t\t\t$invoice['data']['invoice']['id'],\n\t\t\t\t\t\t\t\t\t$invoice['data']['invoice']['initial_invoice_id'],\n\t\t\t\t\t\t\t\t\t$invoice['data']['invoice']['merged_invoice_id']\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'fields' => array(\n\t\t\t\t\t\t\t\t'id',\n\t\t\t\t\t\t\t\t'initial_invoice_id',\n\t\t\t\t\t\t\t\t'invoice_id',\n\t\t\t\t\t\t\t\t'order_id'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\tif (!empty($invoiceOrders['count'])) {\n\t\t\t\t\t\t\t$invoiceOrderData = array_replace_recursive($invoiceOrders['data'], array_fill(0, $invoiceOrders['count'], array(\n\t\t\t\t\t\t\t\t'initial_invoice_id' => null\n\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$invoiceTotalPaid = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t$invoiceTotalPaid &&\n\t\t\t\t\t\tempty($invoiceItemData) &&\n\t\t\t\t\t\tcount($invoice['data']['orders']) === 1 &&\n\t\t\t\t\t\t($order = $invoice['data']['orders'][0]) &&\n\t\t\t\t\t\t$order['quantity_active'] === $order['quantity_pending']\n\t\t\t\t\t) {\n\t\t\t\t\t\t$invoiceItemData[] = array_merge(array_intersect_key($order, array(\n\t\t\t\t\t\t\t'interval_type' => true,\n\t\t\t\t\t\t\t'interval_value' => true,\n\t\t\t\t\t\t\t'price' => true,\n\t\t\t\t\t\t\t'quantity' => true\n\t\t\t\t\t\t)), array(\n\t\t\t\t\t\t\t'invoice_id' => $invoiceData[0]['id'],\n\t\t\t\t\t\t\t'order_id' => $order['id'],\n\t\t\t\t\t\t\t'name' => $order['name']\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t$this->save('invoices', $invoiceData) &&\n\t\t\t\t\t\t$this->save('invoice_items', $invoiceItemData) &&\n\t\t\t\t\t\t$this->save('invoice_orders', $invoiceOrderData)\n\t\t\t\t\t) {\n\t\t\t\t\t\t$invoice['data']['invoice'] = array_merge($invoice['data']['invoice'], $invoiceData[0]);\n\t\t\t\t\t\t$invoiceData = array();\n\n\t\t\t\t\t\tif ($invoiceTotalPaid) {\n\t\t\t\t\t\t\t$additionalDueInvoices = $this->_call('invoices', array(\n\t\t\t\t\t\t\t\t'methodName' => 'retrieveDueInvoices',\n\t\t\t\t\t\t\t\t'methodParameters' => array(\n\t\t\t\t\t\t\t\t\t$invoice['data']['invoice']\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$intervalType = $invoice['data']['orders'][0]['interval_type'];\n\n\t\t\t\t\t\t\tif (!empty($additionalDueInvoices)) {\n\t\t\t\t\t\t\t\t$invoiceData = array_replace_recursive($additionalDueInvoices, array_fill(0, count($additionalDueInvoices), array(\n\t\t\t\t\t\t\t\t\t'due' => null,\n\t\t\t\t\t\t\t\t\t'warning_level' => 5\n\t\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tin_array($intervalType, array(\n\t\t\t\t\t\t\t\t\t'day',\n\t\t\t\t\t\t\t\t\t'month',\n\t\t\t\t\t\t\t\t\t'week',\n\t\t\t\t\t\t\t\t\t'year'\n\t\t\t\t\t\t\t\t)) &&\n\t\t\t\t\t\t\t\t!empty($intervalValue = $invoice['data']['orders'][0]['interval_value'])\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tempty($additionalDueInvoices) ||\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t!empty($additionalDueInvoices[0]['warning_level']) &&\n\t\t\t\t\t\t\t\t\t\t$additionalDueInvoices[0]['warning_level'] === 5\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\t\tif (\n\t\t\t\t\t\t\t\t\t\t$invoiceWarningLevel === 5 ||\n\t\t\t\t\t\t\t\t\t\tempty($invoice['data']['invoice']['initial_invoice_id'])\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t$invoice['data']['invoice']['due'] = null;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$invoiceData[] = array(\n\t\t\t\t\t\t\t\t\t\t'cart_items' => $invoice['data']['invoice']['cart_items'],\n\t\t\t\t\t\t\t\t\t\t'currency' => $invoice['data']['invoice']['currency'],\n\t\t\t\t\t\t\t\t\t\t'due' => date('Y-m-d H:i:s', strtotime($invoice['data']['invoice']['due'] . ' +' . $intervalValue . ' ' . $intervalType)),\n\t\t\t\t\t\t\t\t\t\t'initial_invoice_id' => !empty($invoice['data']['invoice']['initial_invoice_id']) ? $invoice['data']['invoice']['initial_invoice_id'] : $invoice['data']['invoice']['id'],\n\t\t\t\t\t\t\t\t\t\t'shipping' => $invoice['data']['invoice']['shipping'],\n\t\t\t\t\t\t\t\t\t\t'status' => 'unpaid',\n\t\t\t\t\t\t\t\t\t\t'subtotal' => $invoice['data']['invoice']['subtotal'],\n\t\t\t\t\t\t\t\t\t\t'tax' => $invoice['data']['invoice']['tax'],\n\t\t\t\t\t\t\t\t\t\t'total' => $invoice['data']['invoice']['total'],\n\t\t\t\t\t\t\t\t\t\t'user_id' => $invoice['data']['invoice']['user_id'],\n\t\t\t\t\t\t\t\t\t\t'warning_level' => 0\n\t\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\tunset($invoiceData[0]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (!empty($invoiceData)) {\n\t\t\t\t\t\t\t\t$this->save('invoices', $invoiceData);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$invoice['data']['transactions'][] = $transaction = array_merge($parameters, array(\n\t\t\t\t\t\t\t'payment_method' => $this->_retrieveTransactionPaymentMethod($parameters['payment_method_id'])\n\t\t\t\t\t\t));\n\t\t\t\t\t\t$invoice['data'] = $this->_call('invoices', array(\n\t\t\t\t\t\t\t'methodName' => 'calculateInvoicePaymentDetails',\n\t\t\t\t\t\t\t'methodParameters' => array(\n\t\t\t\t\t\t\t\t$invoice['data']\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\tif ($parameters['payment_amount'] > 0) {\n\t\t\t\t\t\t\t$mailParameters = array(\n\t\t\t\t\t\t\t\t'from' => $this->settings['from_email'],\n\t\t\t\t\t\t\t\t'subject' => 'Invoice #' . $invoice['data']['invoice']['id'] . ' payment confirmation',\n\t\t\t\t\t\t\t\t'template' => array(\n\t\t\t\t\t\t\t\t\t'name' => 'payment_successful',\n\t\t\t\t\t\t\t\t\t'parameters' => array(\n\t\t\t\t\t\t\t\t\t\t'invoice' => $invoice['data']['invoice'],\n\t\t\t\t\t\t\t\t\t\t'transaction' => array_merge($transaction, array(\n\t\t\t\t\t\t\t\t\t\t\t'amount_applied_to_balance' => $amountToApplyToBalance\n\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t'transactions' => $invoice['data']['transactions'],\n\t\t\t\t\t\t\t\t\t\t'user' => $parameters['user']\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\t'to' => $parameters['user']['email']\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->_sendMail($mailParameters);\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\treturn;\n\t\t}", "public function processTransaction() {\n // Uses the CURL library for php to establish a connection,\n // submit the post, and record the response.\n if(function_exists('curl_init') && extension_loaded('curl')) {\n $request = curl_init($this->getEnvironment()); // Initiate curl object\n curl_setopt($request, CURLOPT_HEADER, 0); // Set to 0 to eliminate header info from response\n curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)\n curl_setopt($request, CURLOPT_POSTFIELDS, $this->getNVP()); // Use HTTP POST to send the data\n curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); // Uncomment this line if you get no gateway response.\n $postResponse = curl_exec($request); // Execute curl post and store results in $post_response\n \n // Additional options may be required depending upon your server configuration\n // you can find documentation on curl options at http://www.php.net/curl_setopt\n curl_close($request); // close curl object\n \n // Get the response.\n $this->response = $postResponse; \n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "public function mapTransactionData($data) {\n\n\t\t$transactions = [];\n\n\t\tif (is_array($data)) {\n\n\t\t\tforeach ($data as $item) {\n\n\t\t\t\t$tdata = [];\n\t\t\t\t$tdata['network'] = self::NETWORK_NAME;\n\t\t\t\t$tdata['network_tid'] = object_get($item, \"transactionID\");\n\t\t\t\t$tdata['network_status'] = object_get($item, 'paymentStatus');\n\t\t\t\t$tdata['amount'] = object_get($item, 'saleValue');\n\t\t\t\t$tdata['currency'] = self::DEFAULT_CURRENCY;\n\t\t\t\t$tdata['clickdate'] = (empty($item->date) ? null : Carbon::parse(object_get($item, 'date')));\n\t\t\t\t$tdata['commission'] = object_get($item, 'commission');\n\t\t\t\t$tdata['program_name'] = object_get($item, 'programName');\n\t\t\t\t$tdata['program_id'] = object_get($item, 'programID');\n\t\t\t\tif (preg_match(\"/shopid(\\d+).*userid(\\d+)/\", object_get($item, 'clickRef'), $matches) === 1) {\n\t\t\t\t\t$tdata['shop_id'] = $matches[1];\n\t\t\t\t\t$tdata['user_id'] = $matches[2];\n\t\t\t\t}\n\t\t\t\t$tr = new MerchantTransaction($tdata);\n\t\t\t\t$tr->_rawData = $item;\n\t\t\t\t$transactions[] = $tr;\n\t\t\t}\n\t\t}\n\n\t\treturn $transactions;\n\t}", "function _process($data)\n {\t\t\n\t\t$post = JFactory::getApplication()->input->get($_POST);\n \t\n \t$orderpayment_id = @$data['ssl_invoice_number'];\n \t\n \t$errors = array();\n \t$send_email = false;\n \t\n \t// load the orderpayment record and set some values\n JTable::addIncludePath( JPATH_ADMINISTRATOR.'/components/com_tienda/tables' );\n $orderpayment = JTable::getInstance('OrderPayments', 'TiendaTable');\n $orderpayment->load( $orderpayment_id );\n if (empty($orderpayment_id) || empty($orderpayment->orderpayment_id))\n {\n $errors[] = JText::_('VIRTUALMERCHANT MESSAGE INVALID ORDERPAYMENTID');\n return count($errors) ? implode(\"\\n\", $errors) : '';\n }\n $orderpayment->transaction_details = $data['ssl_result_message'];\n $orderpayment->transaction_id = $data['ssl_txn_id'];\n $orderpayment->transaction_status = $data['ssl_result'];\n \n // check the stored amount against the payment amount \n \tTienda::load( 'TiendaHelperBase', 'helpers._base' );\n $stored_amount = TiendaHelperBase::number( $orderpayment->get('orderpayment_amount'), array( 'thousands'=>'' ) );\n $respond_amount = TiendaHelperBase::number( $data['ssl_amount'], array( 'thousands'=>'' ) );\n if ($stored_amount != $respond_amount ) {\n \t$errors[] = JText::_('VIRTUALMERCHANT MESSAGE AMOUNT INVALID');\n \t$errors[] = $stored_amount . \" != \" . $respond_amount;\n }\n \n // set the order's new status and update quantities if necessary\n Tienda::load( 'TiendaHelperOrder', 'helpers.order' );\n Tienda::load( 'TiendaHelperCarts', 'helpers.carts' );\n $order = JTable::getInstance('Orders', 'TiendaTable');\n $order->load( $orderpayment->order_id );\n if (count($errors)) \n {\n // if an error occurred \n $order->order_state_id = $this->params->get('failed_order_state', '10'); // FAILED\n }\n\t\telse\n {\n $order->order_state_id = $this->params->get('payment_received_order_state', '17');; // PAYMENT RECEIVED\n\n // do post payment actions\n $setOrderPaymentReceived = true;\n \n // send email\n $send_email = true;\n }\n\n // save the order\n if (!$order->save())\n {\n \t$errors[] = $order->getError();\n }\n \n // save the orderpayment\n if (!$orderpayment->save())\n {\n \t$errors[] = $orderpayment->getError(); \n }\n \n if (!empty($setOrderPaymentReceived))\n {\n $this->setOrderPaymentReceived( $orderpayment->order_id );\n }\n \n if ($send_email)\n {\n // send notice of new order\n Tienda::load( \"TiendaHelperBase\", 'helpers._base' );\n $helper = TiendaHelperBase::getInstance('Email');\n $model = Tienda::getClass(\"TiendaModelOrders\", \"models.orders\");\n $model->setId( $orderpayment->order_id );\n $order = $model->getItem();\n $helper->sendEmailNotices($order, 'new_order');\n }\n\n return count($errors) ? implode(\"\\n\", $errors) : ''; \n\n \treturn true;\n }", "private function processPayment($data){\n $p_cust_id_cliente = env('EPAYCO_P_CUST_ID_CLIENTE');\n $p_key = env('EPAYCO_P_KEY');\n $x_ref_payco = $data->x_ref_payco;\n $x_transaction_id = $data->x_transaction_id;\n $x_amount = $data->x_amount;\n $x_currency_code = $data->x_currency_code;\n $x_signature = $data->x_signature;\n $signature = hash('sha256', $p_cust_id_cliente . '^' . $p_key . '^' . $x_ref_payco . '^' . $x_transaction_id . '^' . $x_amount . '^' . $x_currency_code);\n $x_response = $data->x_response;\n $x_response_reason_text = $data->x_response_reason_text;\n $x_id_invoice = $data->x_id_invoice;\n $x_autorizacion = $data->x_approval_code;\n\n //Validamos la firma\n if ($x_signature != $signature) {\n die(\"Firma no valida\");\n }\n\n $this->saveTransaction($data);\n NotificationController::notify('delivery', $data->x_extra3, $x_amount,$data->x_extra5,\"0\");\n\n return response()->json([\n 'success' => true,\n 'message' => 'transacción procesada'\n ],200);\n\n }", "protected function _processReceivedTransactionData($data = [], $result = [])\n {\n $key = '';\n foreach ($data as $trans) {\n if (!$key) {\n $key = $trans['time'];\n }\n $result[$trans['time']] = [\n 'y' => $trans['time'],\n 'received' => $trans['credit'],\n 'spent' => 0,\n ];\n }\n return $result;\n }", "public function processPayment();", "public function controller_processReceivedData() {\n // validate received form data\n // update data model\n }", "protected abstract function handleData();", "public function TransferStockTransaction($post){\r\n\t\t$db=$this->getAdapter();\r\n\t\t$session_user = new Zend_Session_Namespace('auth');\r\n\t\t$userName = $session_user->user_name;\r\n\t\t$GetUserId = $session_user->user_id;\r\n\t\r\n\t\t$db_global = new Application_Model_DbTable_DbGlobal();\r\n\t\t\n\t\tif($post['from_location']!== $post['to_location']){\n\t\t\t//try{\n\t\t\t\n\t\t\t\t\tif($post['invoce_num']!=\"\"){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$tr_no=$post['invoce_num'];\n\t\t\t\t\t}\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t$date= new Zend_Date();\r\n\t\t\t\t\t\t$tr_no=\"TR\".$date->get('hh-mm-ss');\r\n\t\t\t\t\t}\n\t\t\t\t $data_transfer=array(\r\n\t\t\t\t\t\t\t\t\t\t'invoice_num'\t=> $tr_no,\r\n\t\t\t\t\t\t\t\t\t\t'transfer_date' => $post['transfer_date'],\r\n\t\t\t\t\t\t\t\t\t\t'from_location'\t=> $post['from_location'],\r\n\t\t\t\t\t\t\t\t\t\t'to_location'\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t\t'user_id' \t\t=> $GetUserId,\r\n\t\t\t\t\t\t\t\t\t\t'mod_date'\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t\t'remark'\t => $post['remark_transfer']\r\n\t\t\t\t\t\t\t\t );\r\n\t\t\t\t\t$transfer_id = $db_global->addRecord($data_transfer, \"tb_stocktransfer\");\r\n\t\t\t\t unset($data_transfer);\n\t\t\t\t $identity = explode(',',$post['identity']);\r\n\t\t\t\t\tforeach($identity as $i){\r\n\t\t\t\t\t \t\t\t\t$data_item=array(\r\n\t\t\t\t\t\t\t\t\t\t'transfer_id'\t => $transfer_id,\n\t\t\t\t\t\t\t\t\t\t'pro_id'\t\t => $post['item_id_'.$i],\r\n\t\t\t\t\t \t\t\t\t\t'qty'\t\t\t => $post['qty_id_'.$i],\r\n\t\t\t\t\t \t\t\t\t\t'remark_transfer'=> $post['remark_'.$i]\r\n\t\t\r\n\t\t\t\t\t\t\t\t\t );\r\n\t\t\t\t \t\t\t\t $db->insert(\"tb_transfer_item\", $data_item);\r\n\t\t\t\t\t \t\t\t\tunset($data_item);\r\n\t\t\r\n\t\t\t\t\t$rows = $db_global ->porductLocationExist($post['item_id_'.$i], $post['from_location']);\r\n\t\t\t\t\tif($rows){\r\n\t\t\t\t\t\t//update poduct location from\r\n\t\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t\t'qty' \t\t\t=>\t$rows['qty']- $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $rows[\"qty_avaliable\"]- $post['qty_id_'.$i],\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db_global->updateRecord($data_qty_location, $rows['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//add move history\r\n\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['from_location'],\r\n\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_before' => $rows['qty'],\r\n\t\t\t\t\t\t\t\t'qty_after' \t=> $rows['qty']- $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tunset($data_qty_location);unset($rows);unset($data_history);\r\n\t\t\t\t\t\t//update product location to\r\n\t\t\t\t\t\t$rows_gets_qty=$db_global -> porductLocationExist($post['item_id_'.$i], $post['to_location']);\r\n\t\t\r\n\t\t\t\t\t\tif($rows_gets_qty){\r\n\t\t\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t\t\t'qty' \t\t\t=>\t$rows_gets_qty['qty']\t\t\t+ $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $rows_gets_qty[\"qty_avaliable\"]\t+ $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$itemid=$db_global->updateRecord($data_qty_location, $rows_gets_qty['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\r\n\t\t\t\t\t\t\t//add move history\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],//can't add remark cos short table in form\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_before' => $rows_gets_qty['qty'],\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $rows_gets_qty['qty']+ $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($rows_gets_qty);unset($data_history);\r\n\t\t\t\t\t\t}//if recieve deosn't exist in product location\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'LocationId' => $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'qty' => $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\r\n\t\t\t\t\t\t\t//if receive not have\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_before' => 0,\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($add_pro_location); unset($data_history);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{//if from doesn't exist\r\n\t\t\t\t\t\t//add qty in location if from doesn't exist\r\n\t\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t'LocationId' => $post['from_location'],\r\n\t\t\t\t\t\t\t\t'qty' => -$post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t'qty_avaliable'\t=> - $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\r\n\t\t\t\t\t\tunset($add_pro_location);\r\n\t\t\t\t\t\t//echeck for get product location\r\n\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t'transaction_type' => 1,\r\n\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['from_location'],\r\n\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_after' \t=> -$post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\r\n\t\t\t\t\t\tunset($data_history);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//for get stock\r\n\t\t\t\t\t\t$rows_gets_qty=$db_global -> porductLocationExist($post['item_id_'.$i], $post['to_location']);\r\n\t\t\t\t\t\tif($rows_gets_qty){\r\n\t\t\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t\t\t'qty' =>$rows_gets_qty['qty']+ $post['qty_id_'.$i]\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db_global->updateRecord($data_qty_location, $rows_gets_qty['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\r\n\t\t\t\t\t\t\t//add move history\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t( \t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_before' => $rows_gets_qty['qty'],\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $rows_gets_qty['qty']+ $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($rows_gets_qty);unset($data_qty_location);\r\n\t\t\t\t\t\t}//if recieve deosn't exist in product location\r\n\t\t\t\t\t\telse{ //if doesn't exist from and to\r\n\t\t\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'LocationId' => $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'qty' => $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\n\t\t\t\t\t\t\tunset($add_pro_location);\r\n\t\t\t\t\t\t\t//if doesn't exist from and to\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'transaction_type' => 1,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($data_history);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//forforeach\n\t\t\t\t//$db->commit();\n\t\t /*}//try\n\t\t catch (Exception $e) {\n\t\t \t$db->rollBack();\n\t\t \t$this->view->msg = $e->getMessage();\r\n\t\t }*/\r\n\t\t}//for if\r\n\t}", "abstract public function determineTransaction();", "function process() // OK\n { \n if(! $this->validate()) {\n\t $this->_errors->addError('Failed at event validation.');\n\t return false;\n }\n \n $this->_getTransactions();\n \n// -- added\n if(! $this->validate()) {\n\t $this->_errors->addError('Failed after dynamic validations.');\n\t return false;\n }\n// --\n if (! $this->_executeTransactions()) return false;\n else return $this->storeEventDetail();\n }", "protected function processReceivedData() \n {\n parent::processReceivedData();\n // to do: call processReceivedData() for all members\n }", "protected function processReceivedData() \r\n {\r\n parent::processReceivedData();\r\n // to do: call processReceivedData() for all members\r\n }", "public function process($data)\n {\n // Delete previous set\n $this->deleteWhere('serial_number=?', $this->serial_number);\n\n // Parse log data\n $start = ''; // Start date\n $errors = array();\n $now = time();\n $four_weeks = $now + 3600 * 24 * 7 * 4;\n\n foreach (explode(\"\\n\", $data) as $line) {\n if ($line) {\n $parts = explode(\"\\t\", $line);\n\n if (count($parts) !== 3) {\n echo 'Invalid log entry: '.$line;\n } else {\n // Convert unix timestamp string to int\n $this->cert_exp_time = intval($parts[0]);\n // Trim path to 255 chars\n $this->cert_path = substr($parts[1], 0, 254);\n // Get common name out of subject\n if (preg_match('/subject= CN = ([^,]+)/', $parts[2], $matches)) {\n $this->cert_cn = $matches[1];\n } else {\n $this->cert_cn = 'Unknown';\n }\n\n $this->id = '';\n $this->timestamp = time();\n $this->create();\n \n // Check for errors\n if ($this->cert_exp_time < $now) {\n $errors[] = array(\n 'type' => 'danger',\n 'msg' => 'cert.expired',\n 'data' => json_encode(array(\n 'name' => $this->cert_cn,\n 'timestamp' => $this->cert_exp_time\n ))\n );\n } elseif ($this->cert_exp_time < $four_weeks) {\n $errors[] = array(\n 'type' => 'warning',\n 'msg' => 'cert.expire_warning',\n 'data' => json_encode(array(\n 'name' => $this->cert_cn,\n 'timestamp' => $this->cert_exp_time\n ))\n );\n }\n }\n }\n }// end foreach()\n \n if (! $errors) {\n $this->delete_event();\n } else {\n if (count($errors) == 1) {\n $error = array_pop($errors);\n $this->store_event($error['type'], $error['msg'], $error['data']);\n } else {\n // Loop through errors and submit stats\n $error_count = 0;\n $last_error = array();\n $warning_count = 0;\n // Search through errors and warnings\n foreach ($errors as $error) {\n if ($error['type'] == 'danger') {\n $last_error = $error;\n $error_count ++;\n }\n if ($error['type'] == 'warning') {\n $warning_count ++;\n }\n }\n // If errors, ignore warnings\n if ($error_count) {\n $type = 'error';\n if ($error_count == 1) {\n $msg = $last_error['msg'];\n $data = $last_error['data'];\n } else {\n $msg = 'cert.multiple_errors';\n $data = $error_count;\n }\n } else {\n $type = 'warning';\n $msg = 'cert.multiple_warnings';\n $data = $warning_count;\n }\n $this->store_event($type, $msg, $data);\n }\n }\n }", "function after_process() {\n\t\t $requestParamList = array(\"MID\" => MODULE_PAYMENT_PAYTM_MERCHANT_ID , \"ORDERID\" => $_POST['ORDERID']);\n\n\t\t $paytmParamsStatus = array();\n /* body parameters */\n $paytmParamsStatus[\"body\"] = array(\n /* Find your MID in your Paytm Dashboard at https://dashboard.paytm.com/next/apikeys */\n \"mid\" => $requestParamList['MID'],\n /* Enter your order id which needs to be check status for */\n \"orderId\" => $requestParamList['ORDERID'],\n );\n $checksumStatus = PaytmChecksum::generateSignature(json_encode($paytmParamsStatus[\"body\"], JSON_UNESCAPED_SLASHES), MODULE_PAYMENT_PAYTM_MERCHANT_KEY);\n /* head parameters */\n $paytmParamsStatus[\"head\"] = array(\n /* put generated checksum value here */\n \"signature\" => $checksumStatus\n );\n /* prepare JSON string for request */\n $post_data_status = json_encode($paytmParamsStatus, JSON_UNESCAPED_SLASHES);\n $paytstsusmurl = $this->paytmurl.PaytmConstants::ORDER_STATUS_URL; \n $ch = curl_init($paytstsusmurl);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data_status);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n $responseJson = curl_exec($ch);\n $responseStatusArray = json_decode($responseJson, true);\n\t\t if($responseStatusArray['body']['resultInfo']['resultStatus']=='TXN_SUCCESS' && $responseStatusArray['body']['txnAmount']==$_POST['TXNAMOUNT'])\n\t\t {\n\t\t \tglobal $insert_id;\n\t\t\t $status_comment=array();\n\t\t\t if(isset($_POST)){\n\t\t\t\t if(isset($_POST['ORDERID'])){\n\t\t\t\t \t$status_comment[]=\"Order Id: \" . $_POST['ORDERID'];\n\t\t\t\t }\n\t\t\t\t\n\t\t\t\t if(isset($_POST['TXNID'])){\n\t\t\t\t\t $status_comment[]=\"Paytm TXNID: \" . $_POST['TXNID'];\n\t\t\t\t }\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$sql_data_array = array('orders_id' => $insert_id,\n 'orders_status_id' => MODULE_PAYMENT_PAYTM_ORDER_STATUS_ID,\n 'date_added' => 'now()',\n 'customer_notified' => '0',\n 'comments' => implode(\"\\n\", $status_comment));\n\n\t\t\tzen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);\n\t\t}\n\t\telse{\n\t\t\tzen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, 'error_message=' . urlencode(\"It seems some issue in server to server communication. Kindly connect with administrator.\"), 'SSL', true, false));\n\t\t}\n }", "public function processRequests() {\n\t\t$receivedRequests = $this->receivedRequestMapper->findAll();\n\t\tforeach ($receivedRequests as $receivedRequest) {\n\t\t\t$id = $receivedRequest->getId();\n\t\t\t$sendingLocation = $receivedRequest->getSendingLocation();\n\t\t\t$type = $receivedRequest->getRequestType();\n\t\t\t$addedAt = $receivedRequest->getAddedAt();\n\t\t\t$field1 = $receivedRequest->getField1();\n\t\t\t\n\t\t\tswitch ($type) {\n\t\t\t\tcase Request::USER_EXISTS: //Want same behavior for these two queries\n\t\t\t\tcase Request::FETCH_USER: //for login for a user that doesn't exist in the db\n\t\t\t\t\t$userExists = $this->api->userExists($field1) ? '1' : '0';\t\n\n\t\t\t\t\t$this->api->beginTransaction();\n\t\t\t\t\t$response = new QueuedResponse($id, $sendingLocation, (string) $userExists, $this->api->microTime());\n\t\t\t\t\t$this->queuedResponseMapper->save($response); //Does not throw Exception if already exists\n\n\t\t\t\t\tif ($userExists) {\n\t\t\t\t\t\t$userUpdate = $this->userUpdateMapper->find($field1);\n\t\t\t\t\t\t$displayName = $this->api->getDisplayName($field1);\n\t\t\t\t\t\t$password = $this->api->getPassword($field1);\n\t\t\t\t\t\t$queuedUser = new QueuedUser($field1, $displayName, $password, $userUpdate->getUpdatedAt(), $sendingLocation); \n\t\t\t\t\t\t$this->queuedUserMapper->save($queuedUser); //Does not throw Exception if already exists\n\t\t\t\t\t}\n\t\t\t\t\t$this->api->commit();\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->api->log(\"Invalid request_type {$type} for request from {$sendingLocation} added_at {$addedAt}, field1 = {$field1}\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request = $this->receivedRequestMapper->delete($receivedRequest);\n\t\t}\n\t}", "private function _processINS()\n {\n //like is needed for normal signal...\n if (!isset($this->_post_vars['message_type']) || $this->_post_vars['message_type'] !== 'ORDER_CREATED') {\n //don't care about this signal, it is not related to order created.\n trigger_error(\"DEBUG TRANSACTION: Ignoring signal, appears to be INS but NOT the order_created signal.\");\n return;\n }\n\n trigger_error(\"DEBUG TRANSACTION: Processing signal as INS signal. Var details:\\n\" . print_r($this->_post_vars, 1));\n\n //make sure it is valid...\n $hash = $this->_genHash(true);\n if (!$hash || $hash !== $this->_post_vars['md5_hash']) {\n trigger_error('DEBUG TRANSACTION: Authentication check failed, MD5 hash did not match. Check secret word settings for gateway.');\n return;\n }\n\n if (!isset($this->_post_vars['vendor_order_id'])) {\n trigger_error(\"DEBUG TRANSACTION: No vendor_order_id present, not able to process signal any further.\");\n return;\n }\n //get the transaction...\n $parts = explode(self::ORDER_SEP, $this->_post_vars['vendor_order_id']);\n if (!isset($parts[1])) {\n trigger_error(\"DEBUG TRANSACTION: vendor_order_id does not contain transaction id, cannot process INS signal. Value is {$this->_post_vars['vendor_order_id']}.\");\n return;\n }\n $transaction = geoTransaction::getTransaction((int)$parts[1]);\n if (!$transaction) {\n trigger_error(\"DEBUG TRANSACTION: Problem getting transaction for ID {$parts[1]}\");\n return;\n }\n if ($transaction->getStatus()) {\n trigger_error(\"DEBUG TRANSACTION: Transaction already active! Nothing is needed for this INS signal as the main signal already processed successfully.\");\n return;\n }\n $order = geoOrder::getOrder($parts[0]);\n if (!$order) {\n trigger_error(\"DEBUG TRANSACTION: First part of vendor_order_id, for the order ID, not able to get order from it. Value: {$parts[0]}\");\n return;\n }\n trigger_error(\"DEBUG TRANSACTION: INS Approved! Activating transaction, INS payment signal is valid and for transaction not already approved.\");\n $transaction->set('ins_data', $post_vars);\n self::_success($order, $transaction, $this, true);\n }", "function _processSale() {\n\t\t$this->autoload();\t\t\n\t\tJbPaymentxxsourcexxLib::write_log('xxsourcexx.txt', 'IPN: '.json_encode($_REQUEST));\n\t\t\n\t\t$input = jfactory::getApplication()->input;\t\t\n\t\t$status = $input->getString('xxsourcexx_transactionStatus');\n\t\t\n\t\t$success_status = array('CO','PA');\n\t\t\n\t\tif(in_array($status, $success_status)){\n\t\t\t$order_number = $input->getString('_itemId');\n\t\t\t$order_jb = JbPaymentxxsourcexxLib::getOrder($order_number);\n\t\t\t$order_jb->pay_status = 'SUCCESS';\n\t\t\t$order_jb->order_status = 'CONFIRMED';\n\t\t\t$order_jb->tx_id = $tnxref;\n\t\t\t$order_jb->store ();\n\t\t\treturn $order_jb;\t\n\t\t}else{\n\t\t\texit;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function orderCommitEtProcess($order_data, $bid)\r\n {\r\n $sysUtil = new SysUtility();\r\n $orderSet = new Order1InfoSet($bid);\r\n $result = array();\r\n\r\n $orderSet->setBusinessId($bid);\r\n $orderSet->setProductName($order_data->product_name_id);\r\n $orderSet->setMonthTerm($order_data->service_term_id);\r\n $orderSet->setStoreQuantity($order_data->store_quantity_id);\r\n $orderSet->setTotalAmount($order_data->amount_id);\r\n $orderSet->setTaxRate(CommonDefinition::TAX_RATE_CANADA);\r\n $orderSet->setAmountPaid(CommonDefinition::ZERO_NUM); // Assume no payment received yet\r\n $orderSet->setPaymentMethod(CommonDefinition::PAY_METHOD_EMAIL); // paid by email\r\n // transfer\r\n $orderSet->setOrderStatus(NeoDefinition::ORDER_STATUS_EMAIL_COMMIT); // set order status\r\n\r\n $temp = $sysUtil->generateDb1OrderId($bid);\r\n\r\n // Set the order ID\r\n $orderSet->setOrderId($temp);\r\n $orderSet->setOrderNote(NeoDefinition::ET_ORDER_NOTE_1);\r\n $orderSet->setPaymentInfo(NeoDefinition::ET_ORDER_PAYMENT_INFO_1);\r\n\r\n $tblName = $sysUtil->getNeoDb1OrderTblName();\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($tblName);\r\n $queryResult = $neoModel->addDashboard1OrderById($orderSet);\r\n\r\n if ($queryResult) {\r\n $result[\"status\"] = CommonDefinition::SUCCESS;\r\n $result[\"info\"] = NeoDefinition::ET_ORDER_ADD_SUCCESS . NeoDefinition::EMAIL_INTERAC_LINK;\r\n\r\n // get the total order number after this submit if add order success\r\n\r\n $queryResult = $neoModel->getDashboard1OrderNumberByBid($bid);\r\n if (! is_bool($queryResult)) {\r\n session_start();\r\n $_SESSION[\"total_order\"] = $queryResult;\r\n }\r\n } else {\r\n $result[\"status\"] = CommonDefinition::ERROR;\r\n $result[\"info\"] = NeoDefinition::ET_ORDER_ADD_FAIL;\r\n }\r\n\r\n $neoModel->close();\r\n return ($result);\r\n }", "public function process()\n {\n // check order configurations for funny PT case\n foreach ($this->order_configurations as $config) {\n $products = $config->getProductArray(true);\n $hasPreceptorTraining = in_array(\"9\", $products);\n\n // we found preceptor training and other products\n //(we need an addtional serial number, therefor an additional config)\n if (count($products) > 1 && $hasPreceptorTraining && !$this->upgrade_purchase) {\n $this->addPreceptorTrainingConfig($config->quantity);\n }\n }\n\n //Mark order as completed\n $this->completed = true;\n $this->order_date = new \\DateTime();\n\n //Either apply upgrades or generate new serial numbers\n if ($this->upgrade_purchase) {\n $this->applyUpgradesAndDowngrades();\n } else {\n $this->generateSerialNumbers();\n }\n\n //Send email to interested parties, unless this is an instant order by Staff\n if ($this->order_type->id != 3) {\n $this->emailSerialNumbers();\n }\n\n //Generate invoice number and email the invoice if appropriate\n if ($this->payment_method->id == 1 && !$this->isFreeOrder()) {\n $this->generateInvoiceNumber();\n $this->emailInvoicePdf();\n }\n \n $session = new \\Zend_Session_Namespace(\"OrdersController\");\n $session->unsetAll();\n }", "public function handleData();", "public function syncTransactions(): void\n\t{\n\t\tif (!$this->checkTransactions()) {\n\t\t\treturn;\n\t\t}\n\n\t\t$transactions = $this->getTransactionList();\n\n\t\t/** @var array<\\Eshop\\DB\\Order> $orders */\n\t\t$orders = $this->orderRepository->many()->setIndex('this.code')->toArrayOf('uuid');\n\t\t/** @var array<\\Eshop\\DB\\EHubTransaction> $existingTransactions */\n\t\t$existingTransactions = $this->EHubTransactionRepository->many()->toArray();\n\n\t\t$newTransactionsValues = [];\n\n\t\tforeach ($transactions as $transaction) {\n\t\t\t$transactionPK = DIConnection::generateUuid('eHubTransactionId', $transaction['id']);\n\t\t\t$transactionValues = [\n\t\t\t\t'order' => null,\n\t\t\t];\n\n\t\t\tif (isset($existingTransactions[$transactionPK])) {\n\t\t\t\t$transactionValues = $existingTransactions[$transactionPK]->toArray();\n\t\t\t}\n\n\t\t\t$transactionValues['transactionId'] = $transaction['id'];\n\t\t\t$transactionValues['status'] = $transaction['status'];\n\t\t\t$transactionValues['createdTs'] = (new Carbon($transaction['dateTime']))->format('Y-m-d G:i');\n\t\t\t$transactionValues['clickDateTime'] = (new Carbon($transaction['clickDateTime']))->format('Y-m-d G:i');\n\t\t\t$transactionValues['orderAmount'] = (float) $transaction['orderAmount'];\n\t\t\t$transactionValues['originalOrderAmount'] = $transaction['originalOrderAmount'] ?? null;\n\t\t\t$transactionValues['originalCurrency'] = $transaction['originalCurrency'] ?? null;\n\t\t\t$transactionValues['commission'] = isset($transaction['commission']) ? (float) $transaction['commission'] : null;\n\t\t\t$transactionValues['type'] = $transaction['type'];\n\t\t\t$transactionValues['orderId'] = $transaction['orderId'] ?? null;\n\t\t\t$transactionValues['couponCode'] = $transaction['couponCode'] ?? null;\n\t\t\t$transactionValues['newCustomer'] = $transaction['newCustomer'] ?? null;\n\n\t\t\tif (isset($orders[$transaction['orderId']])) {\n\t\t\t\t$transactionValues['order'] = $orders[$transaction['orderId']];\n\t\t\t}\n\n\t\t\t$newTransactionsValues[] = $transactionValues;\n\t\t}\n\n\t\t$this->EHubTransactionRepository->syncMany($newTransactionsValues);\n\t}", "public function populateTransaction($data = array())\n\t{\n\t\ttry {\n\t\t\t$data = EMerchantPayHelper::sanitizeData($data, $this);\n\n\t\t\t// Check if transaction exists\n\t\t\t$insert_query = $this->db->query(\"\n\t\t\t\tSELECT\n\t\t\t\t\t*\n\t\t\t\tFROM\n\t\t\t\t\t`\" . DB_PREFIX . \"emerchantpay_checkout_transactions`\n\t\t\t\tWHERE\n\t\t\t\t\t`unique_id` = '\" . $data['unique_id'] . \"'\n\t\t\t\");\n\n\t\t\tif ($insert_query->rows) {\n\t\t\t\t$this->updateTransaction($data);\n\t\t\t} else {\n\t\t\t\t$this->addTransaction($data);\n\t\t\t}\n\t\t} catch (Exception $exception) {\n\t\t\t$this->logEx($exception);\n\t\t}\n\t}", "public function execute() {\n $request = $this->getRequest()->getParams();\n \n $order_id = strip_tags($request[\"orderId\"]);\n $order = $this->objectManagement->create('Magento\\Sales\\Model\\Order')->loadByIncrementId($order_id);\n $validateOrder = $this->validateWebhook($request, $order);\n\n $transactionId = $request['referenceId'];\n\n $mageOrderStatus = $order->getStatus();\n\n if($mageOrderStatus === 'pending') {\n\n if(!empty($validateOrder['status']) && $validateOrder['status'] === true) {\n if($request['txStatus'] == 'SUCCESS') {\n $request['additional_data']['cf_transaction_id'] = $transactionId;\n $this->logger->info(\"Cashfree Notify processing started for cashfree transaction_id(:$transactionId)\");\n $this->processPayment($transactionId, $order);\n $this->logger->info(\"Cashfree Notify processing complete for cashfree transaction_id(:$transactionId)\");\n return;\n } elseif($request['txStatus'] == 'FAILED' || $request['txStatus'] == 'CANCELLED') {\n $orderStatus = self::STATE_CANCELED;\n $this->processWebhookStatus($orderStatus, $order);\n $this->logger->info(\"Cashfree Notify change magento order status to (:$orderStatus) cashfree transaction_id(:$transactionId)\");\n return;\n } elseif($request['txStatus'] == 'USER_DROPPED') {\n $orderStatus = self::STATE_CLOSED;\n $this->processWebhookStatus($orderStatus, $order);\n $this->logger->info(\"Cashfree Notify change magento order status to (:$orderStatus) cashfree transaction_id(:$transactionId)\");\n return;\n } else {\n $orderStatus = self::STATE_PENDING_PAYMENT;\n $this->processWebhookStatus($orderStatus, $order);\n $this->logger->info(\"Cashfree Notify change magento order status to (:$orderStatus) cashfree transaction_id(:$transactionId)\");\n return;\n }\n } else {\n $errorMsg = $validateOrder['errorMsg'];\n $this->logger->info(\"Cashfree Notify processing payment for cashfree transaction_id(:$transactionId) is failed due to ERROR(: $errorMsg)\");\n return;\n }\n } else {\n $this->logger->info(\"Order has been already in processing state for cashfree transaction_id(:$transactionId)\");\n return;\n }\n }", "protected function postProcessUpdateReceipt()\n {\n }", "public function process()\n {\n // Get all orders not yet sent to Flow within the valid time period\n $orders = Order::get()\n ->filter([\n 'Scheduled' => 0,\n 'IsCart' => 0\n ]);\n\n // run through and schedule\n /** @var Order|\\Isobar\\Flow\\Extensions\\OrderExtension $order */\n foreach ($orders as $order) {\n if ($order->UnpaidTotal()->getDecimalValue() <= 0) {\n echo 'Order #' . $order->ID . ' to be scheduled' . \"\\n\";\n\n $order->scheduleOrder();\n }\n }\n }", "protected function runTransactionBuild()\n {\n $this->request->transaction = new Transaction($this->request); /* Write the transaction record to disk */\n }", "public function processResponses() {\n\t\t$receivedResponses = $this->receivedResponseMapper->findAll();\n\t\tforeach ($receivedResponses as $receivedResponse) {\n\t\t\t$requestId = $receivedResponse->getRequestId();\n\t\t\t$answer = $receivedResponse->getAnswer();\n\t\t\n\t\t\t$queuedRequest = $this->queuedRequestMapper->find($requestId);\n\t\t\tif ($queuedRequest) {\n\t\t\t\t$type = $queuedRequest->getRequestType();\n\t\t\t\t$field1 = $queuedRequest->getField1();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//request no longer exists, so just delete response\n\t\t\t\t$this->receivedResponseMapper->delete($receivedResponse);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tswitch ($type) {\n\t\t\t\tcase Request::USER_EXISTS:\n\t\t\t\t\tif ($answer !== \"1\" AND $answer !== \"0\") {\n\t\t\t\t\t\t$this->api->log(\"ReceivedResponse for Request USER_EXISTS, request_id = {$receivedResponse->getId()} had invalid response = {$answer}\"); \n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ($answer === \"0\") {\n\t\t\t\t\t\t$friendships = $this->friendshipMapper->findAllByUser($field1);\n\t\t\t\t\t\tforeach ($friendships as $friendship) {\n\t\t\t\t\t\t\t$this->friendshipMapper->delete($friendship);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->api->beginTransaction();\n\t\t\t\t\t//Don't need destination for delete since they should all be this instance\n\t\t\t\t\t$this->receivedResponseMapper->delete($receivedResponse);\n \t\t\t\t\t$this->queuedRequestMapper->delete($receivedResponse);\n\t\t\t\t\t$this->api->commit();\n\t\t\t\t\tbreak;\n\t\t\t\tcase Request::FETCH_USER: \n\t\t\t\t\tif ($answer !== \"1\" AND $answer !== \"0\") {\n\t\t\t\t\t\t$this->api->log(\"ReceivedResponse for Request FETCH_USER, request_id = {$receivedResponse->getId()} had invalid response = {$answer}\"); \n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->api->beginTransaction();\n\t\t\t\t\t//Don't need destination for delete since they should all be this instance\n\t\t\t\t\t$this->receivedResponseMapper->delete($receivedResponse);\n \t\t\t\t\t$this->queuedRequestMapper->delete($receivedResponse);\n\t\t\t\t\t$this->api->commit();\n\t\t\t\t\t\n\t\t\t\t\tbreak;\t\n\t\t\t\tdefault:\n\t\t\t\t\t$this->api->log(\"Invalid request_type {$type} for request id {$requestId}\");\n\t\t\t\t\tcontinue;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function storeIncomingData() {}", "private function parseResponses() \r\n {\r\n $validStates = array('Response', 'Response30');\r\n $messages = $this->MessageQueue->find('all', array(\r\n 'fields' => array('messageIdentity', 'message', 'processState', 'isCopied', 'sourceDeviceAlias'),\r\n 'conditions' => array(\r\n 'mailbox' => $this->CurrentDevice->deviceAlias,\r\n 'processState' => $validStates\r\n ),\r\n 'order' => 'createDate'\r\n ));\r\n \r\n // Start a transaction\r\n $this->MessageQueue->transaction(null, true);\r\n\r\n // Process all the messages. Any messages that fail will be placed into the $errors array.\r\n $errors = array();\r\n $processed = array();\r\n foreach($messages as $message)\r\n {\r\n $message = $message['MessageQueue'];\r\n\r\n try\r\n {\r\n libxml_use_internal_errors(true);\r\n $xml = Xml::build($message['message']);\r\n $namespaces = array_flip($xml->getNamespaces(true));\r\n\r\n // Convert the XML to an array and pass the resulting message to the correct processing function.\r\n $payload = Set::reverse($xml);\r\n // Set messageQuery to the payload array for message handling.\r\n $this->messageQuery[] = $payload['LawEnforcementTransaction']['Transaction']['Response'];\r\n\r\n if ($this->{\"handle{$message['processState']}\"}($message, $payload, $namespaces))\r\n $processed[] = $message['messageIdentity'];\r\n else\r\n $errors[] = array(\r\n 'message' => $message,\r\n 'error' => 'Message id ' . $message['messageIdentity'] . ' failed to process.'\r\n );\r\n }\r\n catch(Exception $e)\r\n {\r\n $errors[] = array(\r\n 'message' => $message,\r\n 'error' => 'Exception thrown while processing Message id ' . $message['messageIdentity'] . ': '\r\n . $e->getMessage()\r\n );\r\n }\r\n }\r\n \r\n // Just send the raw LawEnforcementTransaction to the user as is with a statement indicating the error.\r\n if (!empty($errors))\r\n {\r\n $copy = $errors;\r\n foreach($copy as $index => $error) {\r\n try\r\n {\r\n $this->queueErrorResponse($error['error'], $error['message']);\r\n $processed[] = $error['message']['messageIdentity'];\r\n unset($copy[$index]);\r\n }\r\n catch(Exception $e)\r\n {\r\n $errors[$index]['error'] = \"Failed to enqueue message that failed processing. \" \r\n . \"Original Error:\\n\\n\" . $error['error'];\r\n }\r\n }\r\n }\r\n\r\n // Dequeue all processed messages.\r\n if (!empty($processed))\r\n $this->MessageQueue->deleteAll(array('messageIdentity' => $processed));\r\n \r\n // Deal with any errors that failed to get directed towards the user. All we can do is change them in the queu\r\n // to a new state (so they're not lost) and log them in the CLIPS error log.\r\n //\r\n // This should almost never happen.\r\n if (!empty($errors)) {\r\n $ids = Set::extract($errors, '{n}.message.messageIdentity');\r\n \r\n // Log each of the messages that failed\r\n foreach($errors as $id => $error) {\r\n CakeLog::write('error', \"Message (id {$error['message']['messageIdentity']}) failed to process. \" \r\n . \"{$error['error']}\\n{$error['message']['message']}\");\r\n }\r\n \r\n // UpdateAll doesn't behave like other Cake model functions. We have to quote the param ourself.\r\n $this->MessageQueue->updateAll(\r\n array('processState' => '\\'CLIPS_Error\\''),\r\n array('messageIdentity' => $ids)\r\n );\r\n }\r\n\r\n return $this->MessageQueue->transaction(true, true);\r\n }", "function TransactionRecordLoad( &$data ) {\n\t\t$table = BIT_DB_PREFIX.\"task_transaction\";\n\t\t\n\t\t$pDataHash['data_store']['ticket_id'] = $data[0];\n\t\t$pDataHash['data_store']['transact_no'] = $data[1];\n\t\t$pDataHash['data_store']['transact'] = $data[2];\n\t\t$pDataHash['data_store']['ticket_ref'] = $data[3];\n\t\t$pDataHash['data_store']['staff_id'] = $data[4];\n\t\t$pDataHash['data_store']['previous'] = $data[5];\n\t\t$pDataHash['data_store']['room'] = $data[6];\n\t\t$pDataHash['data_store']['applet'] = $data[7];\n\t\t$pDataHash['data_store']['office'] = $data[8];\n\t\t$pDataHash['data_store']['ticket_no'] = $data[9];\n\t\tif ( $data[10] == '[null]' )\n\t\t\t$pDataHash['data_store']['proom'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['proom'] = $data[10];\n\t\tif ( $data[11] == '[null]' )\n\t\t\t$pDataHash['data_store']['tags'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['tags'] = $data[11];\n\t\tif ( $data[12] == '[null]' )\n\t\t\t$pDataHash['data_store']['clearance'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['clearance'] = $data[12];\n\t\t$result = $this->mDb->associateInsert( $table, $pDataHash['data_store'] );\n\t}", "public function process_gateway_notification() {\r\n\t\t$order_id = self::get_post_var( 'OrderID' );\r\n\t\t$message = self::get_post_var( 'Message' );\r\n\t\t$status_code = self::get_post_var( 'StatusCode' );\r\n\t\t$prev_status_code = self::get_post_var( 'PreviousStatusCode' );\r\n\t\t$session_id = explode( ' ', self::get_post_var( 'OrderDescription' ) );\r\n\r\n\t\tif ( is_numeric( $status_code ) ) {\r\n\t\t\t$processed = WPSC_Purchase_Log::INCOMPLETE_SALE;\r\n\t\t\tswitch ( $status_code ) {\r\n\t\t\t\tcase PS_TRX_RESULT_SUCCESS:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::ACCEPTED_PAYMENT;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_REFERRED:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::PAYMENT_DECLINED;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_DECLINED:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::PAYMENT_DECLINED;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_DUPLICATE:\r\n\t\t\t\t\t$processed = ( PS_TRX_RESULT_SUCCESS === $prev_status_code )\r\n\t\t\t\t\t\t? WPSC_Purchase_Log::ACCEPTED_PAYMENT\r\n\t\t\t\t\t\t: WPSC_Purchase_Log::PAYMENT_DECLINED;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_FAILED:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::INCOMPLETE_SALE;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\twp_die( 'Unsupported StatusCode. Please contact support.',\r\n\t\t\t\t\t\t'Unsupported StatusCode',\r\n\t\t\t\t\t\tarray( 'response' => 400 )\r\n\t\t\t\t\t);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t$data = array(\r\n\t\t\t\t'processed' => $processed,\r\n\t\t\t\t'transactid' => $order_id,\r\n\t\t\t\t'notes' => $message,\r\n\t\t\t\t'date' => time(),\r\n\t\t\t);\r\n\t\t\twpsc_update_purchase_log_details( $session_id[4], $data, 'sessionid' );\r\n\r\n\t\t\tswitch ( $processed ) {\r\n\t\t\t\tcase WPSC_Purchase_Log::ACCEPTED_PAYMENT:\r\n\t\t\t\t\ttransaction_results( $session_id, false, $order_id );\r\n\t\t\t\t\t// Thank you for purchasing.\r\n\t\t\t\t\t$this->go_to_transaction_results( $session_id[4] );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase WPSC_Purchase_Log::PAYMENT_DECLINED:\r\n\t\t\t\t\t// Sorry, your transaction was not accepted.\r\n\t\t\t\t\t$this->go_to_transaction_results( null );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t// Thank you, your purchase is pending.\r\n\t\t\t\t\t$this->go_to_transaction_results( $session_id[4] );\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\twp_die( 'Unexpected response from the payment gateway. Please contact support.',\r\n\t\t\t\t'Unexpected response from the payment gateway',\r\n\t\t\t\tarray( 'response' => 400 )\r\n\t\t\t);\r\n\t\t}\r\n\t}", "public function run()\n {\n $elements = [\n ['from_id' => 1, 'to_id' => 2, 'details' => 'sample transaction', 'amount' => 14],\n ['from_id' => 1, 'to_id' => 2, 'details' => 'sample transaction 2', 'amount' => 24],\n ['from_id' => 2, 'to_id' => 1, 'details' => 'sample transaction 3', 'amount' => 15],\n ];\n foreach($elements as $element){\n $item = new \\App\\Transaction();\n $item->from_id = $element['from_id'];\n $item->to_id = $element['to_id'];\n $item->details = $element['details'];\n $item->amount = $element['amount'];\n $item->save();\n }\n }", "public function process($data)\n {\n if (! $data) {\n throw new Exception(\"Error Processing Request: No data found\", 1);\n } else if (substr( $data, 0, 30 ) != '<?xml version=\"1.0\" encoding=\"' ) { // Else if old style text, process with old text based handler\n \n // Translate network strings to db fields\n $translate = array(\n ' agrCtlRSSI: ' => 'agrctlrssi',\n ' agrExtRSSI: ' => 'agrextrssi',\n ' agrCtlNoise: ' => 'agrctlnoise',\n ' agrExtNoise: ' => 'agrextnoise',\n ' state: ' => 'state',\n ' op mode: ' => 'op_mode',\n ' lastTxRate: ' => 'lasttxrate',\n ' maxRate: ' => 'maxrate',\n 'lastAssocStatus: ' => 'lastassocstatus',\n ' 802.11 auth: ' => 'x802_11_auth',\n ' link auth: ' => 'link_auth',\n ' BSSID: ' => 'bssid',\n ' SSID: ' => 'ssid',\n ' MCS: ' => 'mcs',\n ' channel: ' => 'channel');\n\n // Delete previous entries\n\n // Parse data\n foreach (explode(\"\\n\", $data) as $line) {\n // Translate standard entries\n foreach ($translate as $search => $field) {\n if (strpos($line, $search) === 0) {\n $value = substr($line, strlen($search));\n\n $this->$field = $value;\n break;\n }\n }\n } //end foreach explode lines\n $this->save();\n } else { // Else process with new XML handler\n\n // Process incoming wifi.plist\n $parser = new CFPropertyList();\n $parser->parse($data, CFPropertyList::FORMAT_XML);\n $plist = $parser->toArray();\n\n // Process each of the items\n foreach (array('agrctlrssi', 'agrextrssi', 'agrctlnoise', 'agrextnoise', 'state', 'op_mode', 'lasttxrate', 'lastassocstatus', 'maxrate', 'x802_11_auth', 'link_auth', 'bssid', 'ssid', 'mcs', 'channel', 'snr', 'known_networks') as $item) {\n\n // If key exists and is zero, set it to zero\n if ( array_key_exists($item, $plist) && $plist[$item] === 0) {\n $this->$item = 0;\n // Else if key does not exist in $plist, null it\n } else if (! array_key_exists($item, $plist) || $plist[$item] == '' || $plist[$item] == \"{}\" || $plist[$item] == \"[]\") {\n $this->$item = null;\n\n // Set the db fields to be the same as those in the preference file\n } else {\n $this->$item = $plist[$item];\n }\n }\n\n // Save the data because bumblebees are fuzzy\n $this->save();\n }\n }", "function saveTransaction($orderid, $payment) {\n\n\t//Get order from database\n $order = db_getOrderById($orderid); \n\n //Get buyer info from database\n $userId = \"\";\n\t $order_ordernumber = \"\";\n\t foreach($order as $o){\n\t\t$userId = $o['userid'];\n\t\t$order_ordernumber = $o['ordernumber'];\n\t }\n\n //Get order items\n $orderitems = db_getOrderItems($orderid);\n\n \t//Initialize array that will hold all order items ids and if the web service saved them succesfully\n $orderItemsSuccess = array();\n \n //Initialize array that will hold items that will be set through the web service with rollback false\n $itemsArr = array();\n \n //Initialize index of order items array\n $itemIndex = 0;\n \n \n $itemsIndexArr = array();\n \n //print_r($orderitems);\n \n //Iterate thorugh $orderItems obtained from db\n foreach ($orderitems as $orderitem) {\n \n \t//Get item from database\n\t\t\n $item = refactored_db_getItem($orderitem['itemid']);\n\n //print_r($item);\n \n //Initialize item success assuming it will be true\n $orderItemsSuccess[$itemIndex] = array(\"id\"=>$item['id'], \"success\"=>false);\n \n //Get item type to see if it is a package or not\n $type = $item['type'];\n //echo $item->name.\"-\".$item->type;\n \n if ($type == \"ITEM\") {\n\t\t\t//Save item in itemsArr to send the request to the web service\n $quantity = $orderitem['quantity'];\n array_push($itemsArr, array(\"creditTypeId\"=>$item['referenceid'],\n\t\t\t\t\t\t\t \"quantity\"=>$quantity, \n\t\t\t\t\t\t\t \"purchaseId\"=>$order_ordernumber, \n\t\t\t\t\t\t\t \"active\"=>false));\n \tarray_push($itemsIndexArr, \t$itemIndex);\n \t\n } else if ($type == \"PACKAGE\") {\n \t\n \t$orderItemsSuccess[$itemIndex][\"success\"]=true;\n\n \t//Get package items\n $packageitems = db_getPackageItems($item['id']);\n\n //Initialize array to send a ws request for package items only with rollback true\n $packageItemsArr = array();\n\n //Initialize the response\n $success = true;\n \n //Save items in request array\n foreach ($packageitems as $packageitem) {\n\n $item = refactored_db_getItem($packageitem['itemid']);\n\n $quantity = $orderitem['quantity']*$packageitem['quantity'];\n array_push($packageItemsArr, array(\"creditTypeId\"=>$item['referenceid'],\n\t\t\t\t\t\t\t\t\t \"quantity\"=>$quantity, \n\t\t\t\t\t\t\t\t\t \"purchaseId\"=>$order_ordernumber.\"\".$orderitem['itemid'], \n\t\t\t\t\t\t\t\t\t \"active\"=>false)); \n }\n \n //Send request for package\n $response = ws_assignQuota($packageItemsArr, $userId, $payment, true);\n \n //print_r($response);\n \n //Check if an item failed to be saved, if it did set success to False\n foreach ($response as $r) {\n \t\n \tif(!$r->active){ \t\n\t \t$orderItemsSuccess[$itemIndex][\"success\"]=$r->active;\n\t \tbreak;\n \t}\n } \n }\n\n //echo \"Item success = \".$orderItemsSuccess[$itemIndex][\"success\"];\n\t\t$itemIndex++;\n }\n \n \n //print_r($orderItemsSuccess);\n //print_r($itemsIndexArr);\n \n //echo \"Single Items :\";\n //print_r($itemsArr);\n \n //Send request for order items that were not packages. if there are any\n $successIndex = 0;\n\t$assignments = array();\n if(count($itemsArr)>0){\n \t$response = ws_assignQuota($itemsArr, $userId,$payment, false);\n \t\n \tif(is_array($response)){\n \t\t$assignments = array_merge($assignments,$response);\n \t}else{\n \t\tarray_push($assignments, $response);\n \t}\n \t\n \t\n \t//print_r(\"assign quota response \".$assignments);\n \t\n \t$i = 0; \t \n \t//Go thorugh the response to check which item failed\n \tforeach ($assignments as $assignment) {\n \t\t\n \t\t$index = $itemsIndexArr[$i++];\n \t\t\n \t\t//print_r(\"index \".$index);\n \t\t\n \t\t$orderItemsSuccess[$index][\"success\"]=$assignment->active;\n \t}\n \t \t\n }\n\n //echo \"OrderItemsSuccess :\";\n //print_r($orderItemsSuccess);\n return $orderItemsSuccess;\n}", "public function insertTransactionJson($input){\r\n try{\r\n foreach($input[\"transactionsresponse\"] as $key=>$trans){\r\n $storeId = (string)$trans['storeId'];\r\n $transactionDate = (string)$trans['transactionDate'];\r\n $amount = (string)$trans['amount'];\r\n $fee = (string)$trans['fee'];\r\n $amountToPrincipal = (string)$trans['amountToPrincipal'];\r\n $amountToEscrow = (string)$trans['amountToEscrow'];\r\n $amountToInterest = (string)$trans['amountToInterest'];\r\n $ledgerBalance = (string)$trans['ledgerBalance'];\r\n $checkNumber = (string)$trans['checkNumber'];\r\n $transactionType = (string)$trans['transactionType'];\r\n $pending = (string)$trans['pending'];\r\n $generatedDescription = (string)$trans['generatedDescription'];\r\n $transactionId = (string)$trans['transactionId'];\r\n $intradayOrderId = (string)$trans['intradayOrderId'];\r\n $exportTNUM = (string)$trans['exportTNUM'];\r\n $depositSlipIdentifier = (string)$trans['depositSlipIdentifier'];\r\n $checkImageIdentifier = (string)$trans['checkImageIdentifier'];\r\n $creditTransaction = (string)$trans['creditTransaction'];\r\n \r\n //convert date format from mm/dd/yyyy to yyyy-mm-dd\r\n $transactionDate = explode('/', $transactionDate);\r\n $transactionDate = [$transactionDate[2], $transactionDate[0], $transactionDate[1]];\r\n $transactionDate = join( '-', $transactionDate);\r\n\r\n if(!$this->insertTransaction( \r\n $storeId, \r\n $transactionDate, \r\n $amount, \r\n $fee, \r\n $amountToPrincipal, \r\n $amountToEscrow, \r\n $amountToInterest, \r\n $ledgerBalance, \r\n $checkNumber, \r\n $transactionType, \r\n $pending, \r\n $generatedDescription, \r\n $transactionId, \r\n $intradayOrderId, \r\n $exportTNUM, \r\n $depositSlipIdentifier, \r\n $checkImageIdentifier, \r\n $creditTransaction )){\r\n throw new Exception();\r\n }\r\n }\r\n }\r\n catch(Exception $ex) {\r\n return false;\r\n }\r\n \r\n return true;\r\n }", "public function query_in_transactions(){\n\t\t$response = $this->execute($this->query_in_transaction_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 processReceivedData(&$myAddress)\n {\n\t\tif (isset($_REQUEST['Address']) && \n\t\t\tisset($_REQUEST['ShoppingCart']))\n\t\t{\n\t\t\t$myAddress = $_REQUEST['Address'];\n\t\t\t$Address = $this->_database->real_escape_string($_REQUEST['Address']);\n\t\t\t$Sql = \"\n\t\t\t\tINSERT INTO `order` (address) \n\t\t\t\tVALUES ('$Address');\n\t\t\t\";\n\t\t\t$this->_database->query ($Sql);\n\t\t\tif ($this->_database->errno) \n\t\t\t{\n\t\t\t throw new Exception(\"BlockShoppingCart::processReceivedData INSERT order failed: \".$this->_database->error.\"\\n\".$Sql);\n\t\t\t}\n\t\t\t$orderid = $this->_database->insert_id;\n\n\t\t\t$Names = $_REQUEST['ShoppingCart'];\n\t\t\tfor ($i = 0; $i < count($Names); $i++) {\n\t\t\t\t$Name = $this->_database->real_escape_string($Names[$i]);\n\t\t\t\t$Sql = \"\n\t\t\t\t\tINSERT INTO pizza (orderid, name, `status`) \n\t\t\t\t\tVALUES ('$orderid', '$Name', '1b');\n\t\t\t\t\";\n\t\t\t\t$this->_database->query ($Sql);\n\t\t\t\tif ($this->_database->errno) \n\t\t\t\t{\n\t\t\t\t throw new Exception(\"BlockShoppingCart::processReceivedData INSERT pizza failed: \".$this->_database->error.\"\\n\".$Sql);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }", "public function processAndComplete()\n {\n if ($this->withdrawal->status == Withdrawal::STATUS_CREATED) {\n // update withdrawal model\n $this->withdrawal->status = Withdrawal::STATUS_COMPLETED;\n $this->withdrawal->save();\n }\n }", "public function process()\n {\n //If they don't order 7 days after sign up, the points disappear\n //send sms before 1-2days if not order placed\n $orderTable = $this->getServiceLocator()->get('Api\\Table\\LoyaltyPointTable');\n $accounts = $orderTable->getAccountsForCreditExpiry();\n if (!$accounts) {\n echo $msg = 'CreditsExpiryController: Not orders available, skipping '. $this->orderId .\"\\n\";\n $this->logger->debug($msg);\n return;\n }\n \n foreach ($accounts['list'] as $account) {\n if ($account['no_order_days_since_signup'] == 5) {\n $this->sendSms($account['contact_no']);\n } else if ($account['no_order_days_since_signup'] >= 7) {\n $this->removeCredits($account['account_id'], $account['points']);\n } \n }\n }", "public function transactionProcess (&$errorMessage);", "final public function removeTransaction(array $data):array{\n try {\n if (!isset($data['tokenTr'])) {\n throw new Exception('Could not Process(0)');\n \n }\n\n if (!Func::decodeNumber($data['tokenTr'])) {\n throw new Exception('Could not Proces (1)'); \n }\n\n $token = Func::decodeNumber($data['tokenTr']);\n } catch (Exception $e) {\n return ['success'=>0,'message'=>$e->getMessage()];\n }\n\n $this->db->delete('jc_transacciones','tr_id='.intval($token).' and tr_id_user='.$this->user.' and tr_status=0');\n return ['success'=>1,'message'=>'This transaction has been successfully removed'];\n}", "function execute()\n{\n\t\n\n\n\n\n\t$arr = array_merge($this->amount,$this->customer,$this->creditCard,$this->options);\n\t\n\t$collection = Braintree_Transaction::search(array(\n Braintree_TransactionSearch::customerId()->is($arr['customer']['id']),\n));\nif($collection->maximumCount() > 0)\n{\n\n$result = Braintree_Transaction::sale(\n array(\n 'customerId' => $arr['customer']['id'],\n 'amount' => $arr['amount']\n )\n);\nif ($result->success) {\necho json_encode(array('type'=>'success','response'=>'payment amount: '.$arr['amount'].' Your transaction id : '.$result->transaction->id));\n\tdo_action('payment_made',array('message'=>'payment amount: '.$arr['amount'].' transaction id : '.$result->transaction->id));\n\n}elseif ($result->transaction) \n{\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n} else {\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n\t\n}\n}else{\n\n$result = Braintree_Transaction::sale($arr);\n\nif ($result->success) {\n\tdo_action('payment_made',array('message'=>'payment amount: '.$arr['amount'].' transaction id : '.$result->transaction->id));\n\t\necho json_encode(array('type'=>'success','response'=>'Payment Amount : '.$arr['amount'].'Your transaction id : '.$result->transaction->id));\n}elseif ($result->transaction) \n{\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n} else {\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n\t\n}\n\n\n\n\t\n}\n\t\n}", "public function run()\n {\n while (($payload = array_shift($this->payloads)) !== null) {\n list($ttr, $message) = $payload;\n $this->startedId = $this->finishedId + 1;\n $this->handleMessage($this->startedId, $message, $ttr, 1);\n $this->finishedId = $this->startedId;\n $this->startedId = 0;\n }\n }", "public function dataTransact($data)\n\t\t{\n\t\t\t$this->connection->autocommit(false);\n\t\t\tif($this->connection->query('BEGIN;'))\n\t\t\t{\n\t\t\t\tif($this->connection->multi_query($data))\n\t\t\t\t{\n\t\t\t\t\tdo {\n\t\t\t\t\t\t/* almacenar primer juego de resultados */\n\t\t\t\t\t\tif ($result = $this->connection->store_result()) {\n\t\t\t\t\t\t\twhile ($row = $result->fetch_row()) {\n\t\t\t\t\t\t\t\techo $row[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$result->free();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} while ($this->connection->more_results() && $this->connection->next_result());\n\n\t\t\t\t\t$this->connection->commit();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$error = $this->connection->error;\n\t\t\t\t\t//echo \"Chiales esto trono!\";\n\t\t\t\t\t$this->connection->rollback();\n\t\t\t\t\treturn $error;\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$error = $this->connection->error;\n\t\t\t\t$this->connection->rollback();\n\t\t\t\treturn $error;\n\t\t\t}\n\t\t}", "function handleIncomingFundsERP(\n $tid, $created, $serialnumber, $paymentmethod_id, $amount\n ) {\n debug_print(\"Entry: handlingIncomingFundsERP ( tid = $tid )\");\n\n debug_print(\"Creating debtor transaction record\");\n\n $paymentmethod = loadPaymentMethod($paymentmethod_id);\n if ($paymentmethod === false)\n return false;\n\n $meter = loadMeterInformation($serialnumber);\n if ($meter === false)\n return false;\n\n $account = loadAccount($meter['account_id']);\n if ($account === false)\n return false;\n\n $branch = loadCustomerBranch($account['customerbranch_id']);\n if ($branch === false)\n return false;\n\n $branchcode = $branch['code'];\n $new_date = date('Y-m-d', strtotime($created));\n $period_id = fgetPeriod_id($new_date, __FILE__, __LINE__);\n $reference = substr($paymentmethod['code'], 0, 7) . ' ' . $tid;\n $salesorder_id = 0;\n $gst = 0.00;\n $freight = 0.00;\n $rate = 1.00;\n $invtext = '';\n $settled = 0;\n $discount = 0;\n $invtext = 'ReceivedMeter:' . $serialnumber . '(' . $branchcode . ')';\n $invtextevent = 'Received';\n $invtextserialnumber = $serialnumber;\n $invtextbranchcode = $branchcode;\n $meter_id = $meter['meter_id'];\n $posted = 1;\n\n $dtid = insertDebtorTrans(\n $tid, $paymentmethod['transactiontype_id'], $account['customerbranch_id'], $created, $period_id, $reference, $salesorder_id, \n (-($amount)), $gst, $freight, $rate, $invtext, $settled, $discount, $invtextevent, $invtextserialnumber, $invtextbranchcode, $meter_id\n );\n\n debug_print(\"Creating GL transaction records\");\n\n $vatapplicable_id = 5;\n\n if (doesGlExist($paymentmethod['erpglaccountcredit']) &&\n doesGlExist($paymentmethod['erpglaccountdebit'])) {\n $rc = insertGLTrans(\n $paymentmethod['transactiontype_id'], $tid, $new_date, $period_id, $invtext, $posted, $vatapplicable_id, $postings = array(\n array($paymentmethod['erpglaccountcredit'] => -$amount),\n array($paymentmethod['erpglaccountdebit'] => $amount)\n )\n );\n }\n\n debug_print(\"Returning transaction id $tid\");\n debug_print(\"Exit: handleIncomingFundsERP\");\n return $tid;\n }", "function the_incomplete_transaction() {\n\n // Get codeigniter object instance\n $CI = &get_instance();\n\n // Verify if flash data exists\n if ( $CI->session->flashdata('incomplete_transaction') ) {\n\n // Get incomplete transaction\n $transaction = $CI->session->flashdata('incomplete_transaction');\n\n // Verify if pay's data exists\n if ( isset($transaction['pay']['amount']) && isset($transaction['pay']['currency']) ) {\n\n // Prepare data to save\n $transaction_params = array(\n 'user_id' => $CI->user_id,\n 'amount' => $CI->security->xss_clean($transaction['pay']['amount']),\n 'currency' => $CI->security->xss_clean($transaction['pay']['currency']),\n 'created' => time()\n );\n\n // Try to save the transaction\n $transaction_id = $CI->base_model->insert('transactions', $transaction_params);\n\n // Verify if the transaction was created\n if ( $transaction_id ) {\n\n // Verify if the transaction has fields\n if ( !empty($transaction['fields']) ) {\n\n // List all fields\n foreach ( $transaction['fields'] as $field_name => $field_value ) {\n\n // Prepare data to save\n $transaction_field = array(\n 'transaction_id' => $transaction_id,\n 'field_name' => $CI->security->xss_clean($field_name),\n 'field_value' => $CI->security->xss_clean($field_value)\n );\n\n // Try to save the transaction's field\n $CI->base_model->insert('transactions_fields', $transaction_field);\n\n }\n\n }\n\n // Verify if the transaction has options\n if ( !empty($transaction['options']) ) {\n\n // List all options\n foreach ( $transaction['options'] as $option_name => $option_value ) {\n\n // Prepare data to save\n $transaction_option = array(\n 'transaction_id' => $transaction_id,\n 'option_name' => $CI->security->xss_clean($option_name),\n 'option_value' => $CI->security->xss_clean($option_value)\n );\n\n // Try to save the transaction's option\n $CI->base_model->insert('transactions_options', $transaction_option);\n\n }\n \n }\n\n // Set the transaction's id\n $transaction['transaction_id'] = $transaction_id;\n\n // Set transaction data which will be used if gateway uses ajax for a better security\n $CI->session->set_flashdata('incomplete_transaction_saved', $transaction);\n\n // Return transaction\n return $transaction;\n\n }\n\n }\n\n }\n\n return false;\n \n }", "function testTransactions() {\n $rcv_num = \n // Create a transaction as the vendor\n $tr = Transaction::create(self::$vendor, 5.0, true);\n // Send code back to vendor\n SMSHelper::send(SMSHelper::smsUrl($tr));\n // Receive code from client\n\n $tr2 = Transaction::find($tr->code);\n // Accept the transaction on behalf of the client\n $tr2->accept(self::$client);\n // Check balances are updated OK\n $this->assertEquals(self::$vendor->balance(), 47.0);\n $this->assertEquals(self::$client->balance(), 37.0);\n }", "function CommitTrans()\n\t{\n\t\tif ($this->__transCount > 0) {\n\t\t\t$this->__connection->commit();\n\t\t\t$this->__transCount--;\n\t\t}\n\t}", "private function processTransaction($arTransaction, $lineNumber = \"Unknown\") {\n $date = false;\n if (preg_match(\"/([0-9]{1,2})\\.([0-9]{1,2})\\.([0-9]{2,4})/\", $arTransaction[\"DATE\"], $arMatches)) {\n // dd.mm.yyyy\n $date = $arMatches[3].\"-\".$arMatches[2].\"-\".$arMatches[1];\n } else if (preg_match(\"/([0-9]{1,2})\\/([0-9]{1,2})\\/([0-9]{2,4})/\", $arTransaction[\"DATE\"], $arMatches)) {\n // mm/dd/yyyy\n $date = $arMatches[3].\"-\".$arMatches[1].\"-\".$arMatches[2];\n } else if (preg_match(\"/([0-9]{2,4})\\.([0-9]{1,2})\\.([0-9]{1,2})/\", $arTransaction[\"DATE\"], $arMatches)) {\n // yyyy-mm-dd\n $date = $arMatches[1].\"-\".$arMatches[2].\"-\".$arMatches[3];\n } else {\n $this->errors[] = \"Invalid date in line \".$lineNumber.\": \".$arTransaction[\"DATE\"];\n return false;\n }\n $dateStamp = strtotime($date);\n if ($dateStamp <= $this->dateStartStamp) {\n // Already imported, skip.\n return true;\n }\n // Convert amount to float\n $amount = false;\n if (preg_match(\"/^[+-]?[0-9\\.]+\\,[0-9]{2}$/\", $arTransaction[\"AMOUNT\"])) {\n // e.g. 1.000,00 = 1000\n $amount = floatval( str_replace(\",\", \".\", str_replace(\".\", \"\", $arTransaction[\"AMOUNT\"])) );\n } else if (preg_match(\"/^[+-]?[0-9\\,]+\\.[0-9]{2}$/\", $arTransaction[\"AMOUNT\"])) {\n // e.g. 1,000.00 = 1000\n $amount = floatval( str_replace(\".\", \",\", str_replace(\",\", \"\", $arTransaction[\"AMOUNT\"])) );\n } else {\n $this->errors[] = \"Invalid amount in line \".$lineNumber.\": \".$arTransaction[\"AMOUNT\"];\n return false;\n }\n // Get subject\n $subject = $arTransaction[\"SUBJECT\"];\n // Process\n $id_target = null;\n $result = true;\n $action = \"SKIP\";\n $notice = \"\";\n if ($date == $this->dateToday) {\n $action = \"PENDING\";\n $notice = \"Umsätze vom aktuellen Tag werden noch nicht verarbeitet.\";\n } else if ($amount > 0) {\n // Received payment\n if (preg_match(\"/\".preg_quote($this->configBankTransfer[\"PREFIX\"]).\"\\-([0-9]+)\\-([0-9]+)/i\", $subject, $arMatches)) {\n $action = \"SUCCESS\";\n $id_user = (int)$arMatches[1];\n $id_target = (int)$arMatches[2];\n $id_transaction = md5(\"I\".$id_target.\"_D\".$date.\"_A\".$amount);\n $billingInvoiceManagement = BillingInvoiceManagement::getInstance($this->db);\n $ar_invoice = $billingInvoiceManagement->fetchById($id_target);\n if ($ar_invoice === false) {\n $notice = \"Ungültige Rechnungs-Nr \".$id_target.\" (Zeile \".$lineNumber.\")\";\n $action = \"ERROR\";\n } else if ($ar_invoice[\"FK_USER\"] != $id_user) {\n $notice = \"Ungültiger Benutzer für \".$this->getLink(\"invoice\", $id_target).\" (Zeile \".$lineNumber.\")\";\n $action = \"ERROR\";\n } else {\n $billingInvoiceTransactionManagement = BillingInvoiceTransactionManagement::getInstance($this->db);\n if ($billingInvoiceTransactionManagement->countByParam(array(\"TRANSACTION_ID\" => $id_transaction)) == 0) {\n // New payment\n $paymentResult = $billingInvoiceTransactionManagement->createInvoiceTransaction(array(\n 'FK_BILLING_INVOICE' => $id_target,\n 'TYPE' => BillingInvoiceTransactionManagement::TYPE_DEFAULT,\n 'STAMP_CREATE' => $date,\n 'DESCRIPTION' => $subject,\n 'TRANSACTION_ID' => $id_transaction,\n 'PRICE' => $amount\n ));\n if ($paymentResult === null) {\n $notice = \"Fehler beim hinzufügen der Zahlung für \".$this->getLink(\"invoice\", $id_target).\"! (Zeile \".$lineNumber.\")\";\n $action = \"ERROR\";\n }\n } else {\n $notice = \"Identische Zahlung für \".$this->getLink(\"invoice\", $id_target).\" bereits gebucht (Zeile \".$lineNumber.\")\";\n $action = \"NOTICE\";\n }\n }\n }\n }\n $this->addProcess($action, $id_target, $arTransaction[\"NAME\"], $arTransaction[\"ACCOUNT\"], $arTransaction[\"BANK\"], $date, $amount, $subject, $notice);\n return $result;\n }", "public function successAction() {\n \n //Grab the database ID\n $collection = Mage::getModel('CardstreamHosted/CardstreamHosted_Trans')->getCollection();\n $collection->addFilter('transactionunique', $_POST['transactionUnique']);\n $transrow = $collection->toArray();\n \n //Grab the database ID\n \n if( isset( $transrow['items'][0]['id'] ) ){\n \n $transid = $transrow['items'][0]['id'];\n \n }else{\n \n $transid = false;\n \n }\n\n if( $transid ){\n \n //We have a transaction ID\n \n $trans = $transrow['items'][0];\n \n // Get the last four of the card used.\n if( isset( $_POST['cardNumberMask'] ) ){\n \n $lastfour = substr($_POST['cardNumberMask'], -4, strlen($_POST['cardNumberMask']) );\n \n }else{\n \n $lastfour = false;\n \n }\n \n //If threeDSEnrolled has been sent, insert it into the database. Otherwise, insert nothing.\n \n if( isset( $_POST['threeDSEnrolled'] ) ){\n \n $threeDSEnrolled = $_POST['threeDSEnrolled'];\n \n }else{\n \n $threeDSEnrolled = false;\n \n }\n \n //If threeDSAuthenticated has been sent, insert it into the database. Otherwise, insert nothing.\n \n if( isset( $_POST['threeDSAuthenticated'] ) ){\n \n $threeDSAuthenticated = $_POST['threeDSAuthenticated'];\n \n }else{\n \n $threeDSAuthenticated = false;\n \n }\n \n //If cardType has been sent, insert it into the database. Otherwise, insert nothing.\n if( isset( $_POST['cardType'] ) ){\n \n $cardType = $_POST['cardType'];\n \n }else{\n \n $cardType = false;\n \n }\n \n //Update the database with the transaction result\n $trn = Mage::getModel('CardstreamHosted/CardstreamHosted_Trans')->loadById( $trans['id'] );\n $trn->setxref( $_POST['xref'] )\n ->setresponsecode( $_POST['responseCode'] )\n ->setmessage( $_POST['responseMessage'] )\n ->setthreedsenrolled( $threeDSEnrolled )\n ->setthreedsauthenticated( $threeDSAuthenticated )\n ->setlastfour( $lastfour )\n ->setcardtype( $cardType )\n ->save();\n\n if( $_POST['responseCode'] === \"0\") {\n\n if( $_POST['amountReceived'] == $trans['amount'] ){\n\n //Load order\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId( $trans['orderid'] );\n\n if( $order->getId() ){\n\n $order->sendNewOrderEmail();\n $order->true;\n\n if( !$order->canInvoice() ) {\n\n //Add order comment and update status - Although we cant invoice, its important to record the transaction outcome.\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/successfulpaymentstatus'), $this->buildordermessage(), 0);\n $order->save();\n\n //when order cannot create invoice, need to have some logic to take care\n $order->addStatusToHistory(\n $order->getStatus(),\n Mage::helper('CardstreamHosted')->__('Order cannot create invoice')\n );\n\n }else{\n\n //need to save transaction id\n $order->getPayment()->setTransactionId( $_POST['xref'] );\n $order->save();\n $converter = Mage::getModel('sales/convert_order');\n $invoice = $converter->toInvoice($order);\n\n foreach($order->getAllItems() as $orderItem) {\n\n if(!$orderItem->getQtyToInvoice()) {\n continue;\n }\n\n $item = $converter->itemToInvoiceItem($orderItem);\n $item->setQty($orderItem->getQtyToInvoice());\n $invoice->addItem($item);\n }\n\n $invoice->collectTotals();\n $invoice->register()->capture();\n $CommentData = \"Invoice \" . $invoice->getIncrementId() . \" was created\";\n\n Mage::getModel('core/resource_transaction')\n ->addObject($invoice)\n ->addObject($invoice->getOrder())\n ->save();\n\n //Add order comment and update status.\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/successfulpaymentstatus'), $this->buildordermessage(), 0);\n\n $order->save();\n\n }\n\n }\n\n $this->_redirect('checkout/onepage/success');\n\n }else{\n\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId( $trans['orderid'] );\n\n if( $order->getId() ){\n\n //Add order comment and update status\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/order_status'), $this->buildordermessage(), 0);\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/order_status'), \"The amount paid did not match the amount due.\", 0);\n\n $order->save();\n\n }\n\n $session = Mage::getSingleton('checkout/session');\n $session->setQuoteId( $trans['quoteid'] );\n Mage::getModel('sales/quote')->load($session->getQuoteId())->setIsActive(true)->save();\n\n $message = \"The amount paid did not match the amount due. Please contact us for more information\";\n $session->addError($message);\n $this->_redirect('checkout/cart');\n\n }\n \n }else{\n \n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId( $trans['orderid'] );\n\n if( $order->getId() ){\n\n //Add order comment and update status.\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/unsuccessfulpaymentstatus'), $this->buildordermessage(), 0);\n $order->save(); \n\n }\n\n $session = Mage::getSingleton('checkout/session');\n $session->setQuoteId( $trans['quoteid'] );\n Mage::getModel('sales/quote')->load($session->getQuoteId())->setIsActive(true)->save();\n\n $this->loadLayout();\n\n $block = $this->getLayout()->createBlock(\n 'Mage_Core_Block_Template',\n 'CardstreamHosted/standard_failure',\n array('template' => 'CardstreamHosted/standard/failure.phtml')\n );\n\n $this->getLayout()->getBlock('content')->append($block);\n\n $this->renderLayout();\n \n }\n \n }else{\n \n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId( Mage::getSingleton('checkout/session')->getCardstreamHostedOrderId() );\n\n if( $order->getId() ){\n\n //Add order comment and update status.\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/order_status'), $this->buildordermessage(), 0);\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/order_status'), \"Unable to locate the transaction in the CardstreamHosted table\", 0);\n $order->save(); \n\n }\n \n $session = Mage::getSingleton('checkout/session');\n $session->setQuoteId( Mage::getSingleton('checkout/session')->getCardstreamHostedQuoteId() );\n Mage::getModel('sales/quote')->load($session->getQuoteId())->setIsActive(true)->save();\n \n $message = \"Unable to locate transaction. Please contact us for payment status.\";\n $session->addError($message);\n $this->_redirect('checkout/cart');\n \n }\n \n }", "function transfer_eth($currency=\"\",$transdata){\r\n\r\n\r\n \t\t$bitcoin_row \t\t= get_cn_data($currency);\r\n\t\t\t$bitcoin_portnumber = insep_decode($bitcoin_row[\"port\"]);\r\n\t\t\t$bitcoin_ipaddress \t= insep_decode($bitcoin_row[\"ip\"]);\t\r\n\t\t\t $adminEthAddr \t\t= $this->get_currancy_address($currency);\t\t\t\r\n\t\t\r\n\r\n\t\t\t\r\n \t\t\t$amountdata=$transdata->row();\r\n \t\t$sendAmount=$amountdata->transfer_amount;\r\n \t\t$currencyToAddress=$amountdata->to_address;\r\n \t\t$key=trim($this->input->post(\"password\"));\r\n\r\n\t\t\t$data1 \t = array('port'=>$bitcoin_portnumber,'from'=>$adminEthAddr,'sendaddress'=>$currencyToAddress,'withdraw_amount'=>$sendAmount,'keyword' => '98543423','name'=>'bitcocyrus.com','key'=>$key,'method'=>'ethwithdraw');\r\n\t\t\t$output = connecteth('ethwithdraw',$data1);\r\n\r\n\t\t\r\n\t\t\t\t $txn_id \t= $output->result;\r\n\t\t\t\t\tif($output->type == 'success') {\r\n\t\t\t\t\t\tif($txn_id != '') {\r\n\t\t\t\t\t\t\treturn $txn_id;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$this->session->set_flashdata(\"error\",$output);\r\n\t\t\t\t\t\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\t\t\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}else\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->session->set_flashdata(\"error\",$output);\r\n\t\t\t\t\t\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\t\r\n\r\n\t\t\t}\r\n\r\n\t}", "public function run()\n {\n # Temp iterator\n $data = [];\n\n DB::connection()->disableQueryLog();\n\n foreach( $this->getIterator() as $rowNumber => $row){\n # push the element into the row\n $data[] = $row;\n # Chunk the handling\n if (($rowNumber % $this->readChunk) == 0){\n # Handle the Data\n $this->handleData($data);\n # Reset data container\n $data = [];\n }\n }\n\n # Residue $data\n if(!empty($data)){\n $this->handleData( $data );\n }\n\n return $this->getMessages();\n }", "abstract protected function _start_transaction();", "abstract public function commitTransaction();", "public function __processTransaction(CakeEvent $event) {\n\t\t$txnId = $event->subject()->id;\n\t\t$this->log(__d('paypal_ipn', 'Processing Trasaction: %s', $txnId), 'paypal');\n\t\t//Put the afterPaypalNotification($txnId) into your AppController.php\n\t\tif (method_exists($this, 'afterPaypalNotification')) {\n\t\t\t$this->afterPaypalNotification($txnId);\n\t\t}\n\t}", "public function saveTransactionFromRequest($request_id,$message,$status,$adminccount)\n {\n list($count,$request) = Mp3music_Api_Cart::getFinanceAccountRequests(\"paymentrequest_id = \".$request_id,\"\",1,1);\n $re = $request[0];\n $insert_item = array($re['request_date'],$re['request_user_id'],$adminccount['user_id'],'','',$re['request_amount'],$re['request_payment_acount_id'],$adminccount['paymentaccount_id'],$status,'request') ;\n //print_r($insert_item); die;\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction(); \n $l_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music'); \n $list = $l_table->createRow();\n $list->transaction_date = $insert_item[0];\n $list->user_seller = $insert_item[1];\n $list->user_buyer = $insert_item[2];\n $list->item_id = $insert_item[3];\n $list->item_type = $insert_item[4];\n $list->amount = $insert_item[5];\n $list->account_seller_id = $insert_item[6];\n $list->account_buyer_id = $insert_item[7];\n $list->transaction_status = $insert_item[8];\n $list->params = $insert_item[9];\n $list->save();\n try {\n $db->commit();\n } catch (Exception $ex) {\n $db->rollback();\n break;\n } \n }", "public function insert_receive_order($received_order_info,$order_id)\n\t{\n\t\t\n\t$log=new Log(\"receiveorder.log\");\n\n\t\t$log->write($received_order_info);\n\t\tif($received_order_info['order_receive_date'] != '')\n\t\t{\n\t\t\t$received_order_info['order_receive_date'] = strtotime($received_order_info['order_receive_date']);\n\t\t\t$received_order_info['order_receive_date'] = date('Y-m-d',$received_order_info['order_receive_date']);\n\t\t}\n\t\t$inner_loop_limit = count($received_order_info['received_quantities']);\n\t\t$quantities = array();\n\t\t$quantity = 0;\n\t\t$this->db->query(\"UPDATE oc_po_order SET receive_date = '\" .$received_order_info['order_receive_date'].\"', receive_bit = \" . 1 . \", pending_bit = \" . 0 . \" WHERE id = \" . $order_id);\n\t\t$log->write(\"UPDATE oc_po_order SET receive_date = '\" .$received_order_info['order_receive_date'].\"', receive_bit = \" . 1 . \", pending_bit = \" . 0 . \" WHERE id = \" . $order_id);\t\t\n\t\t//if pre selected supplier\n\t\tif(count($received_order_info['received_quantities']) != count($received_order_info['suppliers_ids']))\n\t\t{\n\t\t\n\n\t\t\tfor($i =0; $i<count($received_order_info['prices']); $i++)\n\t\t\t{\n\t\t\t\tif($received_order_info['prices'][$i] != \"next product\")\n\t\t\t\t{\n\t\t\t\t\t$prices[$i] = $received_order_info['prices'][$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$log->write($received_order_info['received_quantities']);\n\t\t\tfor($i =0; $i<count($received_order_info['received_quantities']); $i++)\n\t\t\t{\n\t\t\t\tif($received_order_info['received_quantities'][$i] != \"next product\")\n\t\t\t\t{\n\t\t\t\t\t$received_quantities[$i] = $received_order_info['received_quantities'][$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$prices = array_values($prices);\n\t\t\t$received_quantities = array_values($received_quantities);\n\t\t\n\t\t\t$log->write($prices);\t\t\n\t\t\t$log->write(\"after price\");\n\t\t\t$log->write($received_quantities);\t\t\n\n\n\t\t\tfor($i =0; $i<count($received_quantities); $i++)\n\t\t\t{\n\t\t\t$log->write(\"in for loop\");\n\n\t\t\t\t$log->write(\"UPDATE oc_po_receive_details SET price =\" .$prices[$i]. \", quantity = \".$received_quantities[$i].\" WHERE product_id =\".$received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t\t\t$this->db->query(\"UPDATE oc_po_receive_details SET quantity = \".$received_quantities[$i].\" WHERE product_id =\".$received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t\t\t$query = $this->db->query(\"SELECT quantity FROM oc_po_receive_details WHERE product_id = \" . $received_order_info['received_product_ids'][$i] . \" AND order_id =\" . $order_id);\n\t\t\t\t$quantities[$i] = $query->row['quantity'];\n\t\t\t$log->write(\"quantity\");\t\n\t\t\t$log->write($quantities[$i]);\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_receive_details WHERE order_id=\".$order_id);\n\t\t\t\t\t$log->write(\"update order info done select \".$query);\n\t\t\tif(count($query->rows) > 0)\n\t\t\t{\n\t\t\t\t$this->db->query(\"DELETE FROM oc_po_receive_details WHERE order_id=\".$order_id);\n\t\t\t}\n\t\t\n\t\t\tfor($j = 0; $j<count($received_order_info['received_product_ids']); $j++)\n\t\t\t{\n\t\t\t\tfor($k = 0; $k<$inner_loop_limit; $k++)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif($received_order_info['received_quantities'][$k] != 'next product')\n\t\t\t\t\t{\n\t\t\t\t\t\t//\"INSERT INTO oc_po_receive_details (quantity,price,product_id,supplier_id,order_id) VALUES(\".$received_order_info['received_quantities'][$k].\",\".$received_order_info['prices'][$k].\",\".$received_order_info['received_product_ids'][$j].\",\".$received_order_info['suppliers_ids'][$k].\",\".$order_id.\")\"\n\t\t\t\t\t\t$this->db->query(\"INSERT INTO oc_po_receive_details (quantity,product_id,supplier_id,order_id,store_id) VALUES(\".$received_order_info['received_quantities'][$k].\",\".$received_order_info['received_product_ids'][$j].\",\".$received_order_info['suppliers_ids'][$k].\",\".$order_id.\",\".$query->rows[$j][\"store_id\"].\")\");\n\t\t\t\t\t\t$quantity = $quantity + $received_order_info['received_quantities'][$k];\n\t\t\t\t\t\tunset($received_order_info['received_quantities'][$k]);\n\t\t\t\t\t\tunset($received_order_info['suppliers_ids'][$k]);\n\t\t\t\t\t\tunset($received_order_info['prices'][$k]);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($received_order_info['received_quantities'][$k]);\n\t\t\t\t\t\tunset($received_order_info['suppliers_ids'][$k]);\n\t\t\t\t\t\tunset($received_order_info['prices'][$k]);\n\t\t\t\t\t\t$received_order_info['received_quantities'] = array_values($received_order_info['received_quantities']);\n\t\t\t\t\t\t$received_order_info['suppliers_ids'] = array_values($received_order_info['suppliers_ids']);\n\t\t\t\t\t\t$received_order_info['prices'] = array_values($received_order_info['prices']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$quantities[$j] = $quantity;\n\t\t\t\t$quantity = 0;\n\t\t\t}\n\t\t}\n\t\t$bool = false;\n\t\tfor($i=0; $i<count($quantities); $i++)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT DISTINCT( product_id), store_id FROM oc_po_product WHERE product_id = \" . $received_order_info['received_product_ids'][$i]);\n\t\t\t$product_ids[$i] = $query->row;\n\t\t\t$query1 = $this->db->query(\"UPDATE oc_po_product SET received_products = \" . $quantities[$i] . \" WHERE product_id = \" . $received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t}\n\t\t\t$totalamount=0;\n\t\tfor($i=0; $i<count($product_ids); $i++)\n\t\t{\n\t\t\t\n\t\t\t$log->write(\"SELECT quantity FROM \".DB_PREFIX.\"product_to_store WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$query = $this->db->query(\"SELECT quantity FROM \".DB_PREFIX.\"product_to_store WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$quantity = $quantities[$i];//$query->row['quantity'] ;''+\n\t\t\t//$log->write(\"UPDATE \".DB_PREFIX.\"product SET quantity = quantity + \" . $quantity . \" WHERE product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t//$query1 = $this->db->query(\"UPDATE \".DB_PREFIX.\"product SET quantity = quantity + \" . $quantity . \" WHERE product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$log->write(\"UPDATE \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$query2 = $this->db->query(\"UPDATE \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$log->write(\"no product\");\n\t\t\t\t$log->write($query2);\n\t\t\tif($query2->num_rows==0)\n\t\t\t{\t\n\t\t\t\t$log->write(\"insert into \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" , store_id=\".$product_ids[$i]['store_id'].\" ,product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t$this->db->query(\"insert into \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" , store_id=\".$product_ids[$i]['store_id'].\" ,product_id = \" . $product_ids[$i]['product_id']);\n\n\t\t\t}\n\t\t\tif($query && $query2)\n\t\t\t\t{\n\t\t\t\t\t$log->write(\"before credit change in \");\n\t\t\t\t\t$log->write(\"SELECT * FROM \".DB_PREFIX.\"product_to_store p2s left join \".DB_PREFIX.\"product p on p.product_id =p2s.product_id WHERE store_id=\".$product_ids[$i]['store_id'].\" AND p2s.product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t\t//upadte current credit\n\t\t\t\t\t\t//get product details\n\t\t\t\t\t$queryprd = $this->db->query(\"SELECT * FROM \".DB_PREFIX.\"product_to_store p2s left join \".DB_PREFIX.\"product p on p.product_id =p2s.product_id WHERE store_id=\".$product_ids[$i]['store_id'].\" AND p2s.product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t\t$log->write($queryprd);\n\t\t\t\t\t$tax=round($this->tax->getTax($queryprd->row['price'], $queryprd->row['tax_class_id']));\n\t\t\t\t\t$totalamount=$totalamount+($quantity*$queryprd->row['price'])+($quantity*$tax);\n\t\t\t\t\t$log->write($totalamount);\n\n\t\t\t\t}\n\n\t\t\tif($query && $query2)\n\t\t\t\t$bool = true;\n\t\t}\n\t\tif($bool)\n\t\t\t{\n\t\t\t\t//update credit price\n\t\t\t\t$log->write(\"UPDATE \".DB_PREFIX.\"store SET currentcredit = currentcredit + \" . $totalamount . \" WHERE store_id=\".$this->user->getStoreId());\n\t\t\t\t$this->db->query(\"UPDATE \".DB_PREFIX.\"store SET currentcredit = currentcredit + \" . $totalamount . \" WHERE store_id=\".$this->user->getStoreId());\t\n\t\t\t\t//insert store transaction\n\t\t\t\t$sql=\"insert into oc_store_trans set `store_id`='\".$this->user->getStoreId().\"',`amount`='\".$totalamount.\"',`transaction_type`='1',`cr_db`='CR',`user_id`='\".$this->session->data['user_id'].\"' \";\n\t\t\t\t$log->write($sql);\n\t\t\t\t$this->db->query($sql);\n\t\t\t}\n\t\tif($bool)\n\t\t\treturn true;\n\t}", "public function decode_callback()\r\n\t{\r\n\t\t$post = file_get_contents(\"php://input\");\r\n\t\t$json = json_decode($post);\r\n\r\n\r\n\t\t// Send callback POST data by email for testing\r\n\t\tob_start();\r\n\t\techo '<pre>';\r\n\t\tprint_r($post);\r\n\t\techo '</pre>';\r\n\t\t$message = ob_get_clean();\r\n\t\t$this->emailer_model->send(\r\n\t\t\t$mail_to = '[email protected]',\r\n\t\t\t$mail_subject = 'Test API',\r\n\t\t\t$mail_message = $message,\r\n\t\t\t$mail_from_email = '[email protected]',\r\n\t\t\t$mail_from_name = 'Babes for Bitcoin',\r\n\t\t\t$tag = 'testing'\r\n\t\t);\r\n\r\n\r\n\t\tif (!is_object($json))\r\n\t\t{\r\n\t\t\t// We didn't receive a valid JSON object\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\t$transaction = $this->coinbase->getTransaction($json->order->transaction->id);\r\n\r\n // Send callback POST data by email for testing\r\n ob_start();\r\n echo '<pre>';\r\n print_r($transaction);\r\n echo '</pre>';\r\n $message = ob_get_clean();\r\n $this->emailer_model->send(\r\n $mail_to = '[email protected]',\r\n $mail_subject = 'Test API - transaction',\r\n $mail_message = $message,\r\n $mail_from_email = '[email protected]',\r\n $mail_from_name = 'Babes for Bitcoin',\r\n $tag = 'testing'\r\n );\r\n\t\tif (!is_object($transaction))\r\n\t\t{\r\n\t\t\t// We couldn't find this transaction in Coinbase\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\tif ($json->order->status == 'completed' && $transaction->status != 'complete')\r\n\t\t{\r\n\t\t\t// Found transaction, but it wasn't really completed\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\t$compare = number_format($json->order->total_btc->cents / 100000000, 8, '.', '');\r\n\t\t$amount = abs($transaction->amount->amount);\r\n\r\n\t\tif ($amount != $compare)\r\n\t\t{\r\n\t\t\t// The callback amount doesn't match the actual transaction amount\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\treturn $json->order;\r\n\t}", "public function processPCTWalletTransfer($payload)\n\t{\n\t # Load user model\n\t $this->load->model('user');\n\t \n\t $result = $this->user->sign_in($this->input->post('user-name'), $this->input->post('user-password'));\n\t \n\t if(!$result)\n\t {\n\t $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_FAILED_LOGIN_ERROR);\n\t return $response;\n\t }\n\t \n\t $txnId = \"PCTINT\".time();\n\t $fromUser = $result;\n\t $toUser = $this->input->post('to-account');\n\t $txnType = 'User To User Transfer';\n\t $txnPoints = $this->input->post('pct-transfer-points');\n\t $txnTopic = $this->input->post('pct-topic');\n\t $txnMessage = $this->input->post('pct-message');\n\t \n\t # Now before actually making the transaction store, we need to add points to users account\n\t \n\t $profile = $this->user->getUserProfile($result);\n\t \n\t $walletAmount = $profile->{User::_PCT_WALLET_AMOUNT};\n\t \n\t if($txnPoints > $walletAmount){\n\t $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_TRANSFER_FAILURE_INSUFFICIENT_FUND);\n\t return $response;\n\t }\n\t \n\t $toUserProfile = $this->user->getUserProfile($toUser);\n\t \n\t $this->db->where(User::_ID, $toUser)->update(User::_TABLE, array(User::_PCT_WALLET_AMOUNT => $toUserProfile->{User::_PCT_WALLET_AMOUNT} + $txnPoints));\n\t $this->db->where(User::_ID, $fromUser)->update(User::_TABLE, array(User::_PCT_WALLET_AMOUNT => ($walletAmount- $txnPoints)));\n\t \n\t \n\t # Load pct-transaction model\n\t $this->load->model('pct_transaction');\n\t $result = $this->pct_transaction->create_transaction($fromUser, $toUser, $txnId, $txnType, $txnPoints, $txnTopic, $txnMessage);\n\t \n\t # Now once the payment is successfull, we should get the balance once again and pass this\n\t \n\t $profile = $this->user->getUserProfile($fromUser);\t \n\t $walletAmount = $profile->{User::_PCT_WALLET_AMOUNT};\n\t \n\t \n\t if($result) $response = array('flag'=>1, 'message'=>Message::PCT_PAYMENT_TRANSFER_SUCCESS, 'walletAmount'=>$walletAmount);\n\t else $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_TRANSFER_FAILURE);\n\t \n\t return $response;\n\t}", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}", "protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}", "public function actionPostBillResponse() {\n\n $post_bill_response = file_get_contents(\"php://input\");\n\n\n $queryg6 = \"insert into gepg_bill6(response_message,date_created) value \"\n . \"('{$post_bill_response}','\" . date('Y-m-d H:i:s') . \"')\";\n Yii::$app->db->createCommand($queryg6)->execute();\n\n //new start here\n $datatag = \"gepgBillSubResp\";\n if ($this->verifyContent($post_bill_response, $datatag)) {\n //end new\n\n $xml = (array) simplexml_load_string($post_bill_response);\n\n Producer::queue(\"GePGControllNumberQueue\", $xml);\n\n // echo '<gepgBillSubRespAck><TrxStsCode>7101</TrxStsCode> </gepgBillSubRespAck>';\n $cert_store = file_get_contents(Yii::$app->params['auth_certificate']);\n if (openssl_pkcs12_read($cert_store, $cert_info, Yii::$app->params['auth_certificate_pswd'])) {\n $content = \"<gepgBillSubRespAck><TrxStsCode>7101</TrxStsCode> </gepgBillSubRespAck>\";\n openssl_sign($content, $signature, $cert_info['pkey'], \"sha1WithRSAEncryption\");\n $signature = base64_encode($signature);\n\n $response = \"<Gepg>\" . $content . \"<gepgSignature>\" . $signature . \"</gepgSignature></Gepg>\";\n\n echo $response;\n }\n\n\n //new start\n } else {\n\n // echo '<gepgBillSubRespAck><TrxStsCode>7101</TrxStsCode> </gepgBillSubRespAck>';\n $cert_store = file_get_contents(Yii::$app->params['auth_certificate']);\n if (openssl_pkcs12_read($cert_store, $cert_info, Yii::$app->params['auth_certificate_pswd'])) {\n $content = \"<gepgBillSubRespAck><TrxStsCode>7201</TrxStsCode> </gepgBillSubRespAck>\";\n openssl_sign($content, $signature, $cert_info['pkey'], \"sha1WithRSAEncryption\");\n $signature = base64_encode($signature);\n\n $response = \"<Gepg>\" . $content . \"<gepgSignature>\" . $signature . \"</gepgSignature></Gepg>\";\n\n echo $response;\n }\n }\n //end new\n //exit();\n }", "public function proceed(): void\n {\n try {\n if ($this->isOrderCanceled()) {\n $this->handleOrderCancel();\n }\n\n if (array_key_exists('oID', $_POST) && $this->_isProcessable($_POST['oID'])) {\n $this->_handleOrderLines();\n }\n\n parent::proceed();\n } catch (Exception $exception) {\n $messageDesc = 'mollie.payment.integration.event.notification.order_line_changed_error.description';\n $this->pushMessage('error', $messageDesc, $exception);\n }\n }", "public function process()\n {\n $this->send_status();\n $this->send_headers();\n $this->send_content();\n exit(0);\n }", "static function STKPush_processrequest($timestamp, $account_ref, $transaction_desc, $amount, $phone_number, $callbackurl)\n {\n $url = 'https://' . env('MPESA_SUBDOMAIN') . '.safaricom.co.ke/mpesa/stkpush/v1/processrequest';\n\n $access_token = self::generate_access_token();\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json', 'Authorization:Bearer ' . $access_token)); //setting custom header\n\n $curl_post_data = array(\n //Fill in the request parameters with valid values\n 'BusinessShortCode' => self::$business_shortcode,\n 'Password' => self::generate_mpesa_password($timestamp),\n 'Timestamp' => $timestamp,\n 'TransactionType' => 'CustomerPayBillOnline',\n 'Amount' => $amount,\n 'PartyA' => $phone_number,\n 'PartyB' => self::$business_shortcode,\n 'PhoneNumber' => $phone_number,\n 'CallBackURL' => $callbackurl,\n 'AccountReference' => $account_ref,\n 'TransactionDesc' => $transaction_desc\n );\n\n Log::debug('Request Body',['body'=>$curl_post_data]);\n\n $data_string = json_encode($curl_post_data);\n\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);\n\n if (config('app.env') === 'local') {\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);\n }\n $curl_response = curl_exec($curl);\n if (config('app.env') === 'local') Log::info($curl_response);\n return json_decode($curl_response);\n }", "protected function parse_transaction() {\n\n\t\tif ( ! empty( $this->args['transaction'] ) ) {\n\t\t\t$this->args['transaction__in'] = array( $this->args['transaction'] );\n\t\t}\n\n\t\treturn $this->parse_in_or_not_in_query( 'transaction', $this->args['transaction__in'], $this->args['transaction__not_in'] );\n\t}", "function createTransaction( $db, $tx_data, $wallet_id ) {\r\n // Insert the transaction data\r\n $db->insert( 'transactions', $tx_data );\r\n // TODO: Record this transaction in the logs\r\n // Now get the current wallet balance\r\n $current_balance = $db->get( 'wallets','balance',[ 'id' => $wallet_id ]);\r\n // Update the wallet with the new Balance\r\n $db->update( 'wallets',\r\n [\r\n 'balance[+]' => $tx_data['amount'],\r\n 'activated' => 1\r\n ],\r\n [ 'id' => $wallet_id ]\r\n );\r\n // If all went well, return an array with the transaction status\r\n return [\r\n 'success' => true,\r\n 'data' => [\r\n 'ref_no' => $tx_data['ref_no'],\r\n 'prev_bal' => $current_balance,\r\n 'currency' => $tx_data['currency'],\r\n 'new_bal' => ( $current_balance + $tx_data['amount'] )\r\n ]\r\n ];\r\n}", "public function callback() {\r\n\t\t//1 pending,2 processing,3 shipped,4 \"\",5 complete,6 \"\",7 canceled,8 denied,9 Canceled Reversal,10 Failed,11 Refunded,12 Reversed,13 Chargeback,14 Expired,15 Processed,16 Voided,17 \"\",\r\n\t\t$this->load->model('checkout/order');\r\n\r\n\t\t\tif (isset($this->request->get['Ds_Order'])) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t// Recogemos la clave del comercio para autenticar\r\n\t\t\t\t$clave = $this->config->get('redsys_clave');\t\r\n\t\t\t\t// Recogemos datos de respuesta\r\n\t\t\t\t$total = $_GET[\"Ds_Amount\"];\r\n\t\t\t\t$pedido = $_GET[\"Ds_Order\"];\r\n\t\t\t\t$codigo = $_GET[\"Ds_MerchantCode\"];\r\n\t\t\t\t$moneda = $_GET[\"Ds_Currency\"];\r\n\t\t\t\t$respuesta = $_GET[\"Ds_Response\"];\r\n\t\t\t\t$firma_remota = $_GET[\"Ds_Signature\"];\r\n\t\t\t\t$fecha= $_GET[\"Ds_Date\"];\r\n\t\t\t\t$hora= $_GET[\"Ds_Hour\"];\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t// Cálculo del SHA1\r\n\t\t\t\t$mensaje = $total . $pedido . $codigo . $moneda . $respuesta . $clave;\r\n\t\t\t\t$firma_local = strtoupper(sha1($mensaje));\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif ($firma_local == $firma_remota){\r\n\t\t\t\t\t\t\t// Formatear variables\r\n\t\t\t\t\t\t\t$respuesta = intval($respuesta);\r\n\r\n\t\t\t\t\t\t\tif ($respuesta < 101){\r\n\t\t\t\t\t\t\t\t\t//$this->model_checkout_order->addOrderHistory($idPedido, 5);\r\n\t\t\t\t\t\t\t\t\t$this->response->redirect($this->url->link('checkout/success'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\t\r\n\t\t\t\t\t\t\t\t\t//$this->model_checkout_order->addOrderHistory($idPedido, 7);\r\n\t\t\t\t\t\t\t\t\t$this->response->redirect($this->url->link('checkout/failure'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}// if (firma_local=firma_remota)\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t//$this->model_checkout_order->addOrderHistory($idPedido, 7);\r\n\t\t\t\t\t\t\t\t\t$this->response->redirect($this->url->link('checkout/failure'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} \r\n\t\t\telse if (isset($this->request->post['Ds_Order'])){\r\n\t\t\t\t\r\n\t\t\t\t//Recuperamos Id_pedido\r\n\t\t\t\t$idPedido=$this->request->post['Ds_Order'];\r\n\t\t\t\t$idPedido=substr($idPedido,0,8);\r\n\t\t\t\t$idPedido=ltrim($idPedido,\"0\");\r\n\t\t\t\t$order = $this->model_checkout_order->getOrder($idPedido);\r\n\t\t\t\t\r\n\t\t\t\t// Recogemos la clave del comercio para autenticar\r\n\t\t\t\t$clave = $this->config->get('redsys_clave');\t\r\n\t\t\t\t// Recogemos datos de respuesta\r\n\t\t\t\t$total = $_POST[\"Ds_Amount\"];\r\n\t\t\t\t$pedido = $_POST[\"Ds_Order\"];\r\n\t\t\t\t$codigo = $_POST[\"Ds_MerchantCode\"];\r\n\t\t\t\t$moneda = $_POST[\"Ds_Currency\"];\r\n\t\t\t\t$respuesta = $_POST[\"Ds_Response\"];\r\n\t\t\t\t$firma_remota = $_POST[\"Ds_Signature\"];\r\n\t\t\t\t$fecha= $_POST[\"Ds_Date\"];\r\n\t\t\t\t$hora= $_POST[\"Ds_Hour\"];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t// Cálculo del SHA1\r\n\t\t\t\t$mensaje = $total . $pedido . $codigo . $moneda . $respuesta . $clave;\r\n\t\t\t\t$firma_local = strtoupper(sha1($mensaje));\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif ($firma_local == $firma_remota){\r\n\t\t\t\t\t\t\t// Formatear variables\r\n\t\t\t\t\t\t\t$respuesta = intval($respuesta);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($respuesta < 101){\r\n\t\t\t\t\t\t\t\t\t$this->model_checkout_order->addOrderHistory($idPedido, 5);\r\n\t\t\t\t\t\t\t\t\t//$this->response->redirect($this->url->link('checkout/success'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t$this->model_checkout_order->addOrderHistory($idPedido, 7);\r\n\t\t\t\t\t\t\t\t\t//$this->response->redirect($this->url->link('checkout/failure'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}// if (firma_local=firma_remota)\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t$this->model_checkout_order->addOrderHistory($idPedido, 7);\r\n\t\t\t\t\t\t\t\t\t//$this->response->redirect($this->url->link('checkout/failure'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\techo (\"No hay respuesta del TPV\");\r\n\t\t\t}\t\t\r\n\t\t\r\n\t}", "function _processSale() {\n// \t\tAndroidHelper::write_log('braintree.txt', 'Payment_method_nonce: '.$_POST['payment_method_nonce']);\t\n\t\t$this->autoload();\n\t\t$input = JFactory::getApplication()->input;\n\t\t$order_id = $input->getString('order_number');\n\t\t\n\t\t$orderComplex = AndroidHelper::getOrderDetail($order_id);\n\t\tAImporter::classes('order');\n\t\t$order = new BookproOrder();\n\t\t\n\t\t$this->setConfig();\n\t\tif($this->sale($orderComplex)){\n\t\t\t$result = array(\n\t\t\t\t\t'status'=>1,\n\t\t\t\t\t'tx_id'=>$paymentId,\n\t\t\t\t\t'desc'=>$transaction[0]->description,\n\t\t\t\t\t'total'=>$transaction[0]->getAmount()->getTotal(),\n\t\t\t\t\t'currency'=>$transaction[0]->getAmount()->getCurrency(),\n\t\t\t\t\t'created'=>$payment->getCreateTime(),\n\t\t\t\t\t'method'=>$payment->getPayer()->getPaymentMethod()\n\t\t\t);\n\t\t\t$cardinfo = $payment->getPayer()->getFundingInstruments();\n\t\t\tif($cardinfo[0]){\n\t\t\t\t$result['card_info']['type'] = $cardinfo[0]->getCreditCardToken()->getType();\n\t\t\t\t$result['card_info']['last4'] = $cardinfo[0]->getCreditCardToken()->getLast4();\n\t\t\t}\n\t\t\treturn $result;\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function process_queue()\r\n {\r\n error_reporting(0);\r\n\r\n // TODO: Prefill information is stored in this array. It's nasty, but it works for now.\r\n // This will need to be cleaned up somehow, later.\r\n $this->prefillRequests = array();\r\n\r\n $this->parseResponses();\r\n\r\n // Array of keys that need to be included in the response.\r\n $include = array('request', 'class', 'hit');\r\n $responseQuery = [];\r\n foreach($this->messageQuery as $response) {\r\n // Switch all keys to lower case to prevent possible case errors.\r\n $responseArr = array_change_key_case($response, CASE_LOWER);\r\n // returns an array that intersects with the keys from the $include array\r\n $responseQuery[] = array_intersect_key($responseArr, array_flip($include));\r\n }\r\n\r\n $requestSummary = $this->ArchiveResponse->ArchiveRequest->Request->getSummary(\r\n $this->CurrentAgency->agencyId,\r\n $this->CurrentDevice->agencyDeviceId);\r\n\r\n $summary = array(\r\n 'requests' => $requestSummary,\r\n 'response' => $responseQuery,\r\n 'prefill' => $this->prefillRequests\r\n );\r\n $this->set('summary', $summary);\r\n }", "function process_data($data) {\n // Implement in children classes\n }", "abstract protected function doTransload();", "public function handle()\n {\n //\n $soheads = Salesorder_hxold::where('status', '<>', -10)->get();\n// $soheads = Salesorder_hxold::all();\n $receiptPeopleArray = [];\n foreach ($soheads as $sohead)\n {\n $this->info($sohead->id);\n// if ($sohead->id != 7527 && $sohead->id != 7538)\n// continue;\n\n $soheadAmount = $sohead->amount;\n $receivedAmount = $sohead->receiptpayments()->sum('amount');\n $msgList = [];\n $toWuHL = false;\n $notReceiveAmountForWarning = 0.0;\n // 获取付款方式\n $paywayasses = Paywayass_hxold::where('paywayass_order_id', $sohead->id)->orderBy('payway_seq')->get();\n $percentSum = 0.0;\n foreach ($paywayasses as $paywayass)\n {\n $this->info(' ' . $paywayass->paywayass_id);\n $paywayId = $paywayass->paywayass_payway_id;\n $percentSum += $paywayass->paywayass_value;\n// Log::info(\"percentSum: \" . $percentSum);\n\n $bWarning = false;\n $amountDest = $sohead->amount * $percentSum;\n $notReceivedAmount = $amountDest - $receivedAmount;\n// Log::info(\"notReceivedAmount: \" . $notReceivedAmount);\n\n $this->info(' ' . $paywayId);\n switch ($paywayId)\n {\n case 1: // 预付款: 合同签订后10天\n $orderDate = Carbon::parse($sohead->orderdate);\n if (Carbon::now()->gt($orderDate->addDay(10)))\n $bWarning = true;\n break;\n case 2: // 提资款: 合同签订后20天\n $orderDate = Carbon::parse($sohead->orderdate);\n if (Carbon::now()->gt($orderDate->addDay(20)))\n $bWarning = true;\n break;\n case 15: // 设计结束款: 技术部与电气部都已完成\n // 目前数据库中的电气部似乎都没有显示完成,所以先不考虑电气部的完成情况\n if ($sohead->techdept_status == 1 && $sohead->elecdept_status == 1)\n// if ($sohead->techdept_status == 1)\n {\n $bWarning = true;\n }\n break;\n case 3: // 进度款: 已填写开工日期\n case 4: // 发货前款: 已填写开工日期\n $startDate = Carbon::parse($sohead->startDate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($startDate->gt($baseDate))\n $bWarning = true;\n break;\n case 13: // 部分到货款: 已勾选发货\n case 5: // 全部到货款: 已勾选发货\n if ($sohead->delivery_status == 1)\n {\n $bWarning = true;\n }\n break;\n case 14: // 安装结束款: 已填写安装日期\n $installeddate = Carbon::parse($sohead->installeddate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($installeddate->gt($baseDate))\n {\n $bWarning = true;\n }\n break;\n case 7: // 调试后: 已填写项目投运日期(72+24小时完成日)\n // Carbon使用方法: https://9iphp.com/web/laravel/php-datetime-package-carbon.html\n $this->info(' ' . $sohead->debugend_date);\n $debugendDate = Carbon::parse($sohead->debugend_date);\n $this->info(' ' . $debugendDate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($debugendDate->gt($baseDate))\n {\n $bWarning = true;\n }\n break;\n case 23: // 通烟气款: 已填写通烟气日期\n $passgasDate = Carbon::parse($sohead->passgasDate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($passgasDate->gt($baseDate))\n $bWarning = true;\n break;\n case 21: // 滤料质保金: 已填写通烟气日期后两年\n $passgasDate = Carbon::parse($sohead->passgasDate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($passgasDate->gt($baseDate) && Carbon::now()->gt($passgasDate->addYear(2)))\n $bWarning = true;\n break;\n case 8: // 72小时后款: 已填写项目投运日期\n // Carbon使用方法: https://9iphp.com/web/laravel/php-datetime-package-carbon.html\n $this->info(' ' . $sohead->debugend_date);\n $debugendDate = Carbon::parse($sohead->debugend_date);\n $this->info(' ' . $debugendDate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($debugendDate->gt($baseDate))\n {\n $bWarning = true;\n }\n break;\n case 22: // 性能验收后: 已填写性能验收日期\n $performanceAcceptDate = Carbon::parse($sohead->performanceAcceptDate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($performanceAcceptDate->gt($baseDate))\n $bWarning = true;\n break;\n case 17: // 运行3个月: 已填写已填写项目投运日期后3个月\n $debugendDate = Carbon::parse($sohead->debugend_date);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($debugendDate->gt($baseDate) && Carbon::now()->gt($debugendDate->addMonth(3)))\n $bWarning = true;\n break;\n case 18: // 运行半年: 已填写已填写项目投运日期后6个月\n $debugendDate = Carbon::parse($sohead->debugend_date);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($debugendDate->gt($baseDate) && Carbon::now()->gt($debugendDate->addMonth(6)))\n $bWarning = true;\n break;\n case 9: // 运行1年\n // Carbon使用方法: https://9iphp.com/web/laravel/php-datetime-package-carbon.html\n $debugendDate = Carbon::parse($sohead->debugend_date);\n $this->info(' ' . $debugendDate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($debugendDate->gt($baseDate) && Carbon::now()->gt($debugendDate->addMonth(12)))\n {\n $bWarning = true;\n }\n break;\n case 12: // 环保验收: 已填写环保验收日期\n // Carbon使用方法: https://9iphp.com/web/laravel/php-datetime-package-carbon.html\n $environmentalProtectionCollectionDate = Carbon::parse($sohead->environmentalProtectionCollectionDate);\n $this->info(' ' . $environmentalProtectionCollectionDate);\n $baseDate = Carbon::create(1900, 1, 1);\n if ($environmentalProtectionCollectionDate->gt($baseDate) && Carbon::now()->gt($environmentalProtectionCollectionDate))\n {\n $this->info(\"\\t\\t\\tneed warning: \" . $environmentalProtectionCollectionDate);\n $bWarning = true;\n }\n break;\n case 10: // 质保金: 质保金到期日期. 不知道为什么质保金日期在后台里很多订单是 1901-01-01, 而不是 1900\n $quolityDate = Carbon::parse($sohead->quolityDate);\n $baseDate = Carbon::create(1901, 1, 1);\n if ($quolityDate->gt($baseDate) && Carbon::now()->gt($quolityDate))\n {\n $bWarning = true;\n }\n break;\n case 19: // 第1年质保金: quolityDate\n $quolityDate = Carbon::parse($sohead->quolityDate);\n $baseDate = Carbon::create(1901, 1, 1);\n if ($quolityDate->gt($baseDate) && Carbon::now()->gt($quolityDate->addYear(1)))\n {\n $bWarning = true;\n }\n break;\n case 20: // 第2年质保金: quolityDate\n $quolityDate = Carbon::parse($sohead->quolityDate);\n $baseDate = Carbon::create(1901, 1, 1);\n if ($quolityDate->gt($baseDate) && Carbon::now()->gt($quolityDate->addYear(2)))\n {\n $bWarning = true;\n }\n break;\n case 11:\n break;\n default:\n break;\n }\n\n if ($bWarning && $notReceivedAmount > $sohead->amount * 0.01)\n {\n $notReceiveAmountForWarning = $notReceivedAmount;\n $msgTemp = \"应收\" . $paywayass->payway_name . \"款\" . $amountDest . \"万, \" .\n \"实收\" . $receivedAmount . \"万, 未收\" . $notReceivedAmount . \"万\";\n// Log::info($msgTemp);\n $msgTemp = \"累计可收\" . $amountDest . \"万(\" . $amountDest / $soheadAmount * 100.0 . \"%), \" .\n \"累计实收\" . doubleval($receivedAmount) . \"万(\" . number_format($receivedAmount / $soheadAmount * 100.0, 2) . \"%), \" .\n \"差\" . $notReceivedAmount . \"万(\" . number_format($notReceivedAmount / $soheadAmount * 100.0, 2) . \"%).\";\n// if ($notReceivedAmount > 50.0)\n $toWuHL = true;\n array_push($msgList, $msgTemp);\n }\n }\n\n if (count($msgList) > 0)\n {\n// $msg = ($sohead->projectjc == \"\" ? $sohead->descrip : $sohead->projectjc) . \", \" .\n// \"合同\" . $sohead->amount . \"万, 于\" . $sohead->orderdate . \"签订. \" .\n// implode(',', $msgList) .\n// \", 请抓紧催收. 1\";\n// $msg = ($sohead->projectjc == \"\" ? $sohead->descrip : $sohead->projectjc) . \", \" .\n// \"合同\" . $sohead->amount . \"万, 累计可收\" . $amountDest . \"万, 累计实收\" . $receivedAmount .\n// \"万, 差\" . $notReceivedAmount . \"万. 2\";\n\n $msg = ($sohead->projectjc == \"\" ? $sohead->descrip : $sohead->projectjc) . \", \" .\n \"合同\" . doubleval($soheadAmount) . \"万, \" . array_pop($msgList) . \" \\n付款方式: \" . $sohead->paymethod;\n// $msg = ($sohead->projectjc == \"\" ? $sohead->descrip : $sohead->projectjc) . \", \" .\n// \"合同\" . $sohead->amount . \"万, \" . implode(',', $msgList) . \"\";\n\n// Log::info($msg);\n\n $salesmanager_id = $sohead->salesmanager_id;\n if (!array_key_exists($sohead->salesmanager_id, $receiptPeopleArray))\n {\n $receiptPeopleArray[$salesmanager_id] = [];\n $receiptPeopleArray[$salesmanager_id]['msg'] = [];\n $receiptPeopleArray[$salesmanager_id]['total'] = 0.0;\n }\n array_push($receiptPeopleArray[$sohead->salesmanager_id]['msg'], ($sohead->projectjc == \"\" ? $sohead->descrip : $sohead->projectjc) . $notReceiveAmountForWarning . \"万元\") ;\n $receiptPeopleArray[$salesmanager_id]['total'] += $notReceiveAmountForWarning;\n\n // 向销售经理发送消息\n $this->sendMsg($msg, $sohead->salesmanager_id);\n $this->sendMsg($msg, 8); // to WuHL\n $this->sendMsg($msg, 16); // to LiY\n\n }\n }\n// Log::info(json_encode($receiptPeopleArray));\n\n $totalCompany = 0.0;\n $msgCompany = [];\n foreach ($receiptPeopleArray as $key => $value)\n {\n Log::info($key . implode(\", \", $value['msg']) . $value['total']);\n $totalCompany += $value['total'];\n\n // 向销售经理发送消息\n $salesmanager_hxold = Userold::where('user_hxold_id', $key)->first();\n if (isset($salesmanager_hxold))\n {\n $salesmanager = User::where('id', $salesmanager_hxold->user_id)->first();\n if (isset($salesmanager))\n {\n $msg = $salesmanager->name . \"可收\" . $value['total'] . \"万元, 明细: \" . implode(\", \", $value['msg']) . \".\";\n array_push($msgCompany, $salesmanager->name . $value['total'] . \"万元\");\n \n if ($this->option('debug'))\n {\n $touser = User::where('email', $this->argument('useremail'))->first();\n if (isset($touser)) {\n DingTalkController::send($touser->dtuserid, '',\n $msg,\n config('custom.dingtalk.agentidlist.erpmessage'));\n }\n }\n else\n {\n DingTalkController::send($salesmanager->dtuserid, '',\n $msg,\n config('custom.dingtalk.agentidlist.erpmessage'));\n\n $touser = User::where('email', '[email protected]')->first();\n if (isset($touser))\n DingTalkController::send($touser->dtuserid, '',\n $msg,\n config('custom.dingtalk.agentidlist.erpmessage'));\n\n $touser = User::where('email', '[email protected]')->first();\n if (isset($touser))\n DingTalkController::send($touser->dtuserid, '',\n $msg,\n config('custom.dingtalk.agentidlist.erpmessage'));\n }\n\n\n }\n\n }\n }\n\n $msg = \"公司应收\" . $totalCompany . \"万元, 明细为: \" . implode(\", \", $msgCompany) . \".\";\n Log::info($msg);\n if ($this->option('debug'))\n {\n $touser = User::where('email', $this->argument('useremail'))->first();\n if (isset($touser)) {\n DingTalkController::send($touser->dtuserid, '',\n $msg,\n config('custom.dingtalk.agentidlist.erpmessage'));\n }\n }\n else\n {\n $touser = User::where('email', '[email protected]')->first();\n if (isset($touser))\n DingTalkController::send($touser->dtuserid, '',\n $msg,\n config('custom.dingtalk.agentidlist.erpmessage'));\n\n $touser = User::where('email', '[email protected]')->first();\n if (isset($touser))\n DingTalkController::send($touser->dtuserid, '',\n $msg,\n config('custom.dingtalk.agentidlist.erpmessage'));\n }\n\n\n// DingTalkController::send('manager1200', '',\n// '来自的付款单需要您审批.',\n// config('custom.dingtalk.agentidlist.approval'));\n }", "private function transactions()\n {\n $invoiceModel = new InvoiceModel();\n $transactions = $invoiceModel->getAllInvoices();\n\n $csvData = [];\n $csvData[] = [\"Invoice ID\", \"Company Name\", \"Invoice Amount\"];\n if (!empty($transactions)) {\n foreach ($transactions as $transaction) {\n $csvData[] = [$transaction[\"id\"], $transaction[\"client\"], $transaction[\"invoice_amount_plus_vat\"]];\n }\n }\n\n $this->getCsvFile($csvData, \"transactions_\" . time() . \".csv\");\n }", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }", "public function insert_receive_order_mo($received_order_info,$order_id)\n\t{\n\t\t\n\t$log=new Log(\"receiveorder.log\");\n\n\t\t$log->write($received_order_info);\n\t\tif($received_order_info['order_receive_date'] != '')\n\t\t{\n\t\t\t$received_order_info['order_receive_date'] = strtotime($received_order_info['order_receive_date']);\n\t\t\t$received_order_info['order_receive_date'] = date('Y-m-d',$received_order_info['order_receive_date']);\n\t\t}\n\t\t$inner_loop_limit = count($received_order_info['received_quantities']);\n\t\t$quantities = array();\n\t\t$quantity = 0;\n\t\t//$this->db->query(\"UPDATE oc_po_order SET receive_date = '\" .$received_order_info['order_receive_date'].\"', receive_bit = \" . 1 . \", pending_bit = \" . 0 . \" WHERE id = \" . $order_id);\n\t\t//$log->write(\"UPDATE oc_po_order SET receive_date = '\" .$received_order_info['order_receive_date'].\"', receive_bit = \" . 1 . \", pending_bit = \" . 0 . \" WHERE id = \" . $order_id);\t\t\n\t\t//if pre selected supplier\n\t\tif(count($received_order_info['received_quantities']) != count($received_order_info['suppliers_ids']))\n\t\t{\n\t\t\n\n\t\t\tfor($i =0; $i<count($received_order_info['prices']); $i++)\n\t\t\t{\n\t\t\t\tif($received_order_info['prices'][$i] != \"next product\")\n\t\t\t\t{\n\t\t\t\t\t$prices[$i] = $received_order_info['prices'][$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$log->write($received_order_info['received_quantities']);\n\t\t\tfor($i =0; $i<count($received_order_info['received_quantities']); $i++)\n\t\t\t{\n\t\t\t\tif($received_order_info['received_quantities'][$i] != \"next product\")\n\t\t\t\t{\n\t\t\t\t\t$received_quantities[$i] = $received_order_info['received_quantities'][$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$prices = array_values($prices);\n\t\t\t$received_quantities = array_values($received_quantities);\n\t\t\n\t\t\t$log->write($prices);\t\t\n\t\t\t$log->write(\"after price\");\n\t\t\t$log->write($received_quantities);\t\t\n\n\n\t\t\tfor($i =0; $i<count($received_quantities); $i++)\n\t\t\t{\n\t\t\t$log->write(\"in for loop\");\n\n\t\t\t\t$log->write(\"UPDATE oc_po_receive_details SET price =\" .$prices[$i]. \", quantity = \".$received_quantities[$i].\" WHERE product_id =\".$received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t\t\t$this->db->query(\"UPDATE oc_po_receive_details SET quantity = \".$received_quantities[$i].\" WHERE product_id =\".$received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t\t\t$query = $this->db->query(\"SELECT quantity FROM oc_po_receive_details WHERE product_id = \" . $received_order_info['received_product_ids'][$i] . \" AND order_id =\" . $order_id);\n\t\t\t\t$quantities[$i] = $query->row['quantity'];\n\t\t\t$log->write(\"quantity\");\t\n\t\t\t$log->write($quantities[$i]);\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_receive_details WHERE order_id=\".$order_id);\n\t\t\t\t\t$log->write(\"update order info done select \".$query);\n\t\t\tif(count($query->rows) > 0)\n\t\t\t{\n\t\t\t\t$this->db->query(\"DELETE FROM oc_po_receive_details WHERE order_id=\".$order_id);\n\t\t\t}\n\t\t\n\t\t\tfor($j = 0; $j<count($received_order_info['received_product_ids']); $j++)\n\t\t\t{\n\t\t\t\tfor($k = 0; $k<$inner_loop_limit; $k++)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif($received_order_info['received_quantities'][$k] != 'next product')\n\t\t\t\t\t{\n\t\t\t\t\t\t//\"INSERT INTO oc_po_receive_details (quantity,price,product_id,supplier_id,order_id) VALUES(\".$received_order_info['received_quantities'][$k].\",\".$received_order_info['prices'][$k].\",\".$received_order_info['received_product_ids'][$j].\",\".$received_order_info['suppliers_ids'][$k].\",\".$order_id.\")\"\n\t\t\t\t\t\t$this->db->query(\"INSERT INTO oc_po_receive_details (quantity,product_id,supplier_id,order_id,store_id) VALUES(\".$received_order_info['received_quantities'][$k].\",\".$received_order_info['received_product_ids'][$j].\",\".$received_order_info['suppliers_ids'][$k].\",\".$order_id.\",\".$query->rows[$j][\"store_id\"].\")\");\n\t\t\t\t\t\t$quantity = $quantity + $received_order_info['received_quantities'][$k];\n\t\t\t\t\t\tunset($received_order_info['received_quantities'][$k]);\n\t\t\t\t\t\tunset($received_order_info['suppliers_ids'][$k]);\n\t\t\t\t\t\tunset($received_order_info['prices'][$k]);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($received_order_info['received_quantities'][$k]);\n\t\t\t\t\t\tunset($received_order_info['suppliers_ids'][$k]);\n\t\t\t\t\t\tunset($received_order_info['prices'][$k]);\n\t\t\t\t\t\t$received_order_info['received_quantities'] = array_values($received_order_info['received_quantities']);\n\t\t\t\t\t\t$received_order_info['suppliers_ids'] = array_values($received_order_info['suppliers_ids']);\n\t\t\t\t\t\t$received_order_info['prices'] = array_values($received_order_info['prices']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$quantities[$j] = $quantity;\n\t\t\t\t$quantity = 0;\n\t\t\t}\n\t\t}\n\t\t$bool = false;\n\t\tfor($i=0; $i<count($quantities); $i++)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT DISTINCT( product_id), store_id FROM oc_po_product WHERE product_id = \" . $received_order_info['received_product_ids'][$i]);\n\t\t\t$product_ids[$i] = $query->row;\n\t\t\t$query1 = $this->db->query(\"UPDATE oc_po_product SET item_status = 3 WHERE product_id = \" . $received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t}\n\t\t\t$totalamount=0;\n\t\tfor($i=0; $i<count($product_ids); $i++)\n\t\t{\n\t\t\t\n\t\t\t$log->write(\"SELECT quantity FROM \".DB_PREFIX.\"product_to_store WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$query = $this->db->query(\"SELECT quantity FROM \".DB_PREFIX.\"product_to_store WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$quantity = $quantities[$i];//$query->row['quantity'] ;''+\n\t\t\t//$log->write(\"UPDATE \".DB_PREFIX.\"product SET quantity = quantity + \" . $quantity . \" WHERE product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t//$query1 = $this->db->query(\"UPDATE \".DB_PREFIX.\"product SET quantity = quantity + \" . $quantity . \" WHERE product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$log->write(\"UPDATE \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$query2 = $this->db->query(\"UPDATE \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$log->write(\"no product\");\n\t\t\t\t$log->write($query2);\n\t\t\tif($query2->num_rows==0)\n\t\t\t{\t\n\t\t\t\t$log->write(\"insert into \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" , store_id=\".$product_ids[$i]['store_id'].\" ,product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t$this->db->query(\"insert into \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" , store_id=\".$product_ids[$i]['store_id'].\" ,product_id = \" . $product_ids[$i]['product_id']);\n\n\t\t\t}\n\t\t\tif($query && $query2)\n\t\t\t\t{\n\t\t\t\t\t$log->write(\"before credit change in \");\n\t\t\t\t\t$log->write(\"SELECT * FROM \".DB_PREFIX.\"product_to_store p2s left join \".DB_PREFIX.\"product p on p.product_id =p2s.product_id WHERE store_id=\".$product_ids[$i]['store_id'].\" AND p2s.product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t\t//upadte current credit\n\t\t\t\t\t\t//get product details\n\t\t\t\t\t$queryprd = $this->db->query(\"SELECT * FROM \".DB_PREFIX.\"product_to_store p2s left join \".DB_PREFIX.\"product p on p.product_id =p2s.product_id WHERE store_id=\".$product_ids[$i]['store_id'].\" AND p2s.product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t\t$log->write($queryprd);\n\t\t\t\t\t$tax=round($this->tax->getTax($queryprd->row['price'], $queryprd->row['tax_class_id']));\n\t\t\t\t\t$totalamount=$totalamount+($quantity*$queryprd->row['price'])+($quantity*$tax);\n\t\t\t\t\t$log->write($totalamount);\n\n\t\t\t\t}\n\n\t\t\tif($query && $query2)\n\t\t\t\t$bool = true;\n\t\t}\n\t\tif($bool)\n\t\t\t{\n\t\t\t\t//update credit price\n\t\t\t\t$log->write(\"UPDATE \".DB_PREFIX.\"store SET currentcredit = currentcredit + \" . $totalamount . \" WHERE store_id=\".$this->user->getStoreId());\n\t\t\t\t$this->db->query(\"UPDATE \".DB_PREFIX.\"store SET currentcredit = currentcredit + \" . $totalamount . \" WHERE store_id=\".$this->user->getStoreId());\t\n\t\t\t\t//insert store transaction\n\t\t\t\t$sql=\"insert into oc_store_trans set `store_id`='\".$this->user->getStoreId().\"',`amount`='\".$totalamount.\"',`transaction_type`='1',`cr_db`='CR',`user_id`='\".$this->session->data['user_id'].\"' \";\n\t\t\t\t$log->write($sql);\n\t\t\t\t$this->db->query($sql);\n\t\t\t}\n\t\tif($bool)\n\t\t\treturn true;\n\t}", "public static function populateTransaction($data = array())\n {\n global $db;\n\n try {\n // Check if transaction exists\n $insertQuery = $db->Execute(\"\n SELECT\n *\n FROM\n `\" . static::$table_name . \"`\n WHERE\n `unique_id` = '\" . $data['unique_id'] . \"'\n \");\n\n if ($insertQuery->RecordCount() > 0) {\n static::updateTransaction($data);\n } else {\n static::addTransaction($data);\n }\n } catch (\\Exception $exception) {\n //$this->logEx($exception);\n }\n }", "public function process()\n {\n $this->logger->addInfo(\"*** Processing uniques tables ***\");\n foreach ($this->arrTables as $tableName) {\n $this->processTable($tableName);\n }\n\n $this->logger->addInfo(\"*** Processing uniques tables done ***\");\n }", "public function handleTransactionWebhook(Wallet $wallet, $payload);" ]
[ "0.6781948", "0.6701362", "0.6361216", "0.6347485", "0.620456", "0.6199414", "0.61197317", "0.60036254", "0.60004485", "0.59847015", "0.5842665", "0.5772446", "0.57524115", "0.5746092", "0.57354873", "0.57333404", "0.568481", "0.56506306", "0.5636272", "0.5615098", "0.5572615", "0.55682606", "0.55618185", "0.5548411", "0.5544537", "0.55204576", "0.54950714", "0.5494805", "0.5474495", "0.5456965", "0.5453056", "0.5421021", "0.54190516", "0.5412209", "0.53994036", "0.5382671", "0.53802866", "0.53748953", "0.5374635", "0.5367368", "0.5347659", "0.53459084", "0.5343713", "0.53161055", "0.53119016", "0.5311417", "0.5305263", "0.5304348", "0.5295622", "0.5283102", "0.5268364", "0.52614695", "0.52612877", "0.52594", "0.52488136", "0.5245965", "0.5226362", "0.5225672", "0.52235985", "0.5215457", "0.5211405", "0.5209284", "0.52001137", "0.51876545", "0.5183987", "0.51832145", "0.51825285", "0.51771915", "0.51690245", "0.51626515", "0.5162554", "0.5157228", "0.51562417", "0.5145549", "0.5144111", "0.51426435", "0.5142267", "0.51353973", "0.51351875", "0.51335377", "0.5133329", "0.5124366", "0.5124366", "0.512298", "0.51174647", "0.5115321", "0.5111114", "0.5109953", "0.5105847", "0.5103915", "0.5101057", "0.50995183", "0.50974065", "0.5090272", "0.5090243", "0.508645", "0.508594", "0.5085863", "0.5084766", "0.5078097", "0.50775033" ]
0.0
-1
Get order data last 24 hours
public function getOrdersDataLast24Hours($vendorId) { $to = $this->_date->date('Y-m-d H:i:s'); $from = strtotime($to."-24hours"); $from = $this->_date->date('Y-m-d H:i:s', $from); $orderResource = $this->_vendorOrderFactory->create()->getResource(); $data = $orderResource->getNumOfOrderByHour($from, $to, $vendorId); $result = $this->_processOrderData($data); $result = array_values($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_recent_orders(){\n\t $orders = $this->Order->get_recent_orders();\n\t if($this->params['requested']){\n\t return $orders;\n\t }else{\n\t $this->set('orders', $orders);\n\t }\n \n\t}", "public static function get24HoursAgo(){\n return date('Y-m-d H:i:s',strtotime(\"-1 days\"));\n }", "public function getAmountsDataLast24Hours($vendorId)\n {\n $to = $this->_date->date('Y-m-d H:i:s');\n $from = strtotime($to.\"-24hours\");\n $from = $this->_date->date('Y-m-d H:i:s', $from);\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getAmountsByHour($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function getTransactionsDataLast24Hours($customerId)\n {\n $to = $this->_date->date('Y-m-d H:i:s');\n $from = strtotime($to.\"-24hours\");\n $from = $this->_date->date('Y-m-d H:i:s', $from);\n \n $transactionResource = $this->_transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByHour($from, $to, $customerId);\n $result = $this->_processReceivedTransactionData($data, $result);\n \n $data = $transactionResource->getSpentCreditTransactionsByHour($from, $to, $customerId);\n $result = $this->_processSpentTransactionData($data, $result);\n \n $result = array_values($result);\n return $result;\n }", "public function getExpiringSoon()\n {\n return Item::join('item_batches', 'items.id', '=', 'item_batches.item_id')\n ->join('measurement_units', 'items.unit_id', '=', 'measurement_units.id')\n ->where('item_batches.expiry_date', '<', Carbon::now()->addMonths(3))\n ->where('item_batches.expiry_date', '>', Carbon::now())\n ->where('item_batches.current_quantity', '!=', 0)\n ->select('items.description', 'item_batches.current_quantity', 'measurement_units.short_name', 'item_batches.expiry_date')\n ->get();\n }", "public function get_hours_of_operation() {\n\n return json_decode($this->hours_of_operation);\n \n }", "function last24hours()\r\n{\r\n\tglobal $CURUSER, $last24cache, $last24record ;\r\n\r\n\t$last24cache\t= ROOT_DIR.'/cache/last24/'.date('dmY').'.txt';\r\n\t$last24record\t= ROOT_DIR.'/cache/last24record.txt';\r\n\t$_last24\t\t= (file_exists($last24cache) ? unserialize(file_get_contents($last24cache)) : array());\r\n\t$_last24record\t= (file_exists($last24record) ? unserialize(file_get_contents($last24record)) : array('num'=>0,'date'=>0));\r\n\r\n\tif(!isset($_last24[$CURUSER['id']]) || empty($_last24[$CURUSER['id']]))\r\n\t{\r\n\t\t$_last24[$CURUSER['id']] = array($CURUSER['username'],$CURUSER['class']);\r\n\t\t$_newcount = count($_last24);\r\n\r\n\t\tif(isset($_last24record['num']) && $_last24record['num']<$_newcount)\r\n\t\t{\r\n\t\t\t$_last24record['num'] = $_newcount;\r\n\t\t\t$_last24record['date'] = time();\r\n\r\n\t\t\tfile_put_contents($last24record,serialize($_last24record));\r\n\t\t}\r\n\t\t\tfile_put_contents($last24cache,serialize($_last24));\r\n\t}\r\n}", "public function getForRestApi()\n {\n $dateForApi = new Tiramizoo_Shipping_Model_Date($this->get());\n $sign = strpos($dateForApi->get('P'), '+') == 0 ? '-' : '+';\n\n $dateForApi->modify($sign . (intval($dateForApi->get('Z')) / 3600) . ' hours');\n\n return $dateForApi->get('Y-m-d\\TH:i:s\\Z');\n }", "function getOrdersData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n $total=0;\n if($varAction=='today' || $varAction=='yesterday'){\n if($varAction=='today'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n \n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $arrClms = array('TIME(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded < \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$i]['time'][]=$arrData;\n $arrRes['data'][$i]['count']=$count;\n $total +=$count;\n }\n $arrRes['total']=$total;\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_week'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$count;\n $total +=$count;\n }\n $arrRes['total']=$total;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_month'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $lastMonth.'=='.$lastMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$count;\n $total +=$count; \n }\n $arrRes['total']=$total;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "public function getLastOrder();", "public function getTodayRevisitOrders()\n {\n return \\DB::select(\"SELECT a.id, a.propaddress1, a.propaddress2, a.propcity, a.propstate, a.propzip, s.descrip as status_name FROM appr_dashboard_delay_order d LEFT JOIN appr_order a ON (a.id=d.orderid) LEFT JOIN order_status s ON (a.status=s.id) WHERE d.created_date BETWEEN :from AND :to AND d.delay_date BETWEEN :t AND :b\", [':from' => strtotime('today'), ':to' => strtotime('tomorrow'), ':t' => strtotime('today'), ':b' => strtotime('tomorrow')]);\n }", "public function getOrderInfoById($orderId)\n {\n $ordersQuery = DB::table('orders')\n ->leftJoin(\n DB::raw('(SELECT locations.id, locations.full_address, locations.longitude, locations.latitude FROM locations) as location_destination'),\n 'location_destination.id',\n '=',\n 'orders.location_destination_id'\n )\n ->leftJoin(\n DB::raw('(SELECT locations.id, locations.full_address, locations.longitude, locations.latitude FROM locations) as location_arrival'),\n 'location_arrival.id',\n '=',\n 'orders.location_arrival_id'\n )\n ->leftJoin('vehicle', 'orders.vehicle_id', '=', 'vehicle.id')\n ->where([\n ['orders.id', '=', $orderId],\n ['orders.del_flag', '=', '0'],\n ['vehicle.del_flag', '=', '0']\n ]);\n $order = $ordersQuery->get([\n 'orders.id as order_id', 'order_code', 'orders.status as status',\n 'orders.ETD_date', 'orders.ETD_time', 'location_destination.full_address as location_destination', 'location_destination.longitude as location_destination_longitude', 'location_destination.latitude as location_destination_latitude',\n 'orders.ETA_date', 'orders.ETA_time', 'location_arrival.full_address as location_arrival', 'location_arrival.longitude as location_arrival_longitude', 'location_arrival.latitude as location_arrival_latitude',\n 'vehicle.latitude as current_latitude', 'vehicle.longitude as current_longitude', 'vehicle.current_location as current_location'\n ])->first();\n return $order;\n }", "public function getHistoricalHourly($options = [])\n {\n return $this->send(\n $this->endpoint.\"/histohour\",\n 'GET',\n ['query' => array_merge($this->getEndpointConfiguration(), $options)]\n );\n }", "public function getDailyOrdersData($id=null)\n {\n $startDate = date(\"Y-m-d H:i:s\", strtotime('-7 day', time()));\n $endDate = date('Y-m-d H:i:s');\n\n $userData = User::find()->andFilterWhere(['u_id' => $id, 'u_type' => 2])->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n \\Yii::$app->data->getMwsDetails($user->u_mws_seller_id, $user->u_mws_auth_token);\n $orderList = \\Yii::$app->api->getOrdersList('Created', $startDate, $endDate);\n foreach ($orderList as $order) {\n $orderDetail = false;\n $order = (array)$order;\n $order = array_shift($order);\n if($order) {\n $model = AllOrdesList::findOne(['aol_amazon_order_id' => $order['AmazonOrderId'], 'aol_user_id' => $user->u_id]);\n if (!$model) {\n $model = new AllOrdesList();\n }\n $model->aol_amazon_order_id = (key_exists('AmazonOrderId', $order)) ? $order['AmazonOrderId'] : null;\n $model->aol_seller_order_id = (key_exists('SellerOrderId', $order)) ? $order['SellerOrderId'] : null;\n $model->aol_purchase_date = (key_exists('PurchaseDate', $order)) ? $order['PurchaseDate'] : null;\n $model->aol_last_updated_date = (key_exists('LastUpdateDate', $order)) ? $order['LastUpdateDate'] : null;\n $model->aol_order_status = (key_exists('OrderStatus', $order)) ? $order['OrderStatus'] : null;\n $model->aol_fulfilment_channel = (key_exists('FulfillmentChannel', $order)) ? $order['FulfillmentChannel'] : null;\n $model->aol_sales_channel = (key_exists('SalesChannel', $order)) ? $order['SalesChannel'] : null;\n $model->aol_ship_service = (key_exists('ShipServiceLevel', $order)) ? $order['ShipServiceLevel'] : null;\n $model->aol_order_total = (key_exists('OrderTotal', $order)) ? $order['OrderTotal']['Amount'] : 0;\n $model->aol_shipped_items = (key_exists('NumberOfItemsShipped', $order)) ? $order['NumberOfItemsShipped'] : null;\n $model->aol_unshipped_items = (key_exists('NumberOfItemsUnshipped', $order)) ? $order['NumberOfItemsUnshipped'] : null;\n if($model->aol_order_status == 'Shipped') {\n $model->aol_shipping_username = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['Name'] : null;\n $model->aol_shipping_address_1 = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['AddressLine1'] : null;\n $model->aol_shipping_address_2 = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['AddressLine2'] : null;\n $model->aol_shipping_address_3 = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['AddressLine3'] : null;\n $model->aol_city = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['City'] : null;\n $model->aol_country = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['County'] : null;\n $model->aol_district = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['District'] : null;\n $model->aol_state_or_region = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['StateOrRegion'] : null;\n $model->aol_postal_code = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['PostalCode'] : null;\n $model->aol_country_code =(key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['CountryCode'] : null;\n $model->aol_phone = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['Phone'] : null;\n $model->aol_buyer_name = key_exists('BuyerName', $order) ? $order['BuyerName'] : null;\n $model->aol_buyer_email = key_exists('BuyerEmail', $order) ? $order['BuyerEmail'] : null;\n $orderDetail = true;\n }\n $model->aol_user_id = $user->u_id;\n if($model->save(false)) {\n $olModel = OrderDataLog::findOne(['odl_order_id' => $model->aol_amazon_order_id, 'odl_user_id' => $user->u_id]);\n if (!$olModel) {\n $olModel = new OrderDataLog();\n $olModel->odl_order_id = $model->aol_amazon_order_id;\n $olModel->odl_user_id = $user->u_id;\n if($orderDetail) {\n $olModel->odl_shipped_order_data = 1;\n }\n if($olModel->save(false)) {\n echo $model->aol_amazon_order_id.\" Log is Saved. \";\n }\n }\n echo $model->aol_amazon_order_id.\" is Saved. \";\n }\n }\n }\n echo \"Done..\";\n }\n }", "public static function getOrderHistoryOfUser() {\n return $allOrders = Order::where(\"user_id\", Auth::id())\n ->select(\"*\")->orderBy(\"created_at\", \"desc\")->get();\n }", "public function getExpired()\n {\n return Item::join('item_batches', 'items.id', '=', 'item_batches.item_id')\n ->join('measurement_units', 'items.unit_id', '=', 'measurement_units.id')\n ->where('item_batches.expiry_date', '<', Carbon::now())\n ->where('item_batches.current_quantity', '!=', 0)\n ->select('items.description', 'item_batches.current_quantity', 'measurement_units.short_name', 'item_batches.expiry_date')\n ->get();\n }", "public function getLastData()\n {\n $last = DB::table('iots')->latest('created_at')->first();\n return response()->json(['result' => $last, 'status' => 'successfull']);\n\n }", "public function hourOfBuys() {\n\n $query = \"SELECT COUNT(*) AS BUYS, HOUR(BUYDATE) AS HOUR FROM `BUY` WHERE 1 GROUP BY HOUR(BUYDATE)\";\n\n $result = parent::query($query);\n\n $toReturn = array();\n\n while ($row = $result->fetch_assoc()) {\n $toReturn[] = array(\n 'hour' => $row['HOUR'],\n 'buys' => $row['BUYS']\n );\n }\n\n return $toReturn;\n\n }", "function getTimeOrderPay(){\n\treturn campo('config_system','id','1','time_in_minutes_pending_order_payable');\n}", "function getTimeOrderPay(){\n\treturn campo('config_system','id','1','time_in_minutes_pending_order_payable');\n}", "public function getLastbuy()\n {\n return $this->get(self::_LASTBUY);\n }", "function get_hour()\n {\n $datearray=getdate($this->timestamp);\n return $datearray[\"hours\"];\n }", "public static function getRecentDoneOrders() {\n\n\t\treturn Order::fullActive()\n\t\t\t\t\t->where('state', '=', '3')\n\t\t\t\t\t->orderBy('date', 'desc')\n\t\t\t\t\t->take(10)\n\t\t\t\t\t->get();\n\t}", "public function retrieveOrders() {\r\n $client = new Client(\r\n str_replace('/public', '', get_site_url()),\r\n // get_site_url(),\r\n $this->consumer_key,\r\n $this->consumer_secret,\r\n [\r\n 'wp_api' => true,\r\n 'version' => 'wc/v3',\r\n 'query_string_auth' => true,\r\n 'timeout' => PADBSYNC_CURL_TIMEOUT\r\n ]\r\n );\r\n \r\n global $wpdb;\r\n \r\n $query = \"SELECT ID FROM {$wpdb->prefix}posts WHERE profaktura_status = %d AND post_type = %s ORDER BY post_date DESC\";\r\n \r\n $sql = $wpdb->prepare($query, [0, 'shop_order']);\r\n \r\n $dbOrdersProStatZero = $wpdb->get_results($sql);\r\n \r\n $allOrders = $client->get('orders');\r\n \r\n $orders = [];\r\n \r\n if (count($allOrders) > 0 && count($dbOrdersProStatZero) > 0) {\r\n foreach ($allOrders as $o) {\r\n foreach ($dbOrdersProStatZero as $d) {\r\n if ($o->id == $d->ID) {\r\n $orders[] = $o;\r\n continue;\r\n }\r\n }\r\n } \r\n }\r\n \r\n if (count($orders) < 1) {\r\n return new WP_REST_Response(['message' => 'No orders found!']);\r\n }\r\n \r\n return new WP_REST_Response($orders);\r\n }", "public function getTickerData()\n {\n return clone $this->last();\n }", "public function last24hours($dateP)\n {\n\n $comments = Comment::all();\n $data = $comments->toArray();\n\n\t\t$data = Comment::where('created_at', '>', $dateP)\n ->groupBy(\\DB::raw('DATE(created_at)'))\n ->count();\n\n $response = [\n 'date' => $dateP,\n 'commentsNumber' => $data\n ];\n\n return response()->json($response, 200);\n }", "public function getLastGetTime()\n {\n return $this->get(self::_LAST_GET_TIME);\n }", "function get_sensor_data_last_hour($id){\r\n $sensor_json_url = 'https://data.melbourne.vic.gov.au/resource/d6mv-s43h.json';\r\n\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_URL,$sensor_json_url . '?sensor_id=' . $id);\r\n $result=curl_exec($ch);\r\n curl_close($ch);\r\n return json_decode($result);\r\n}", "function getPastEvents()\n {\n //1. Define the query\n $sql = \"SELECT * FROM events WHERE endtime < CURRENT_DATE AND archive != 1 ORDER BY starttime DESC\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //4. Execute the query\n $statement->execute();\n\n //5. Process the results (get OrderID)\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getLatestRecord();", "function aggregate_latest_24h() {\n //DELETE OLD DATA\n $sql = \"DELETE FROM results_latest_24h\n WHERE ts_trunc < concat(left(unix_timestamp()-24*60*60,7),'000');\";\n $this->dbhandler->query($sql);\n //INSTEAD OF TRUNCATING AND RE-CREATING THE WHOLE TABLE WE GET THE MAX TIMESTAMP\n //AND WE CONTINUE FROM THAT POINT\n //IF NULL IS RETURNED WE GET THE TS-24h TRUNCATED TO AGGREGATE DATA IN BIGGER PERIOD THAN EVERY SEC\n $sql = \"SELECT\n IFNULL(MAX(ts_trunc),\n CONCAT(LEFT(UNIX_TIMESTAMP()-24*60*60, 7), '000')) AS max_ts,\n CONCAT(LEFT(UNIX_TIMESTAMP(), 7), '000') AS current_ts\n FROM\n results_latest_24h;\";\n $row = $this->dbhandler->query($sql)->fetch(PDO::FETCH_ASSOC);\n $max_ts = $row[\"max_ts\"];\n $current_ts = $row[\"current_ts\"];\n if ($max_ts == $current_ts) {\n //NOTHING TO AGGREGATE FOR THE MOMENT....\n return true;\n }\n //Populate table\n $sql = \"INSERT INTO results_latest_24h (id_host, ts_trunc,reply_avg,NOK,TOT,generated_ts)\n SELECT\n id_host,\n (LEFT(ts_check_triggered, 7) * 1000) AS ts_trunc,\n ROUND(AVG(reply_average), 3) AS reply_avg,\n SUM(IF(result = 'NOK', 1, 0)) AS 'NOK',\n SUM(1) AS 'TOT',\n UNIX_TIMESTAMP() AS generated_ts\n FROM\n results_temp\n WHERE\n (LEFT(ts_check_triggered, 7) * 1000) > $max_ts\n and (LEFT(ts_check_triggered, 7) * 1000) < $current_ts\n GROUP BY id_host , ts_trunc;\";\n $r = $this->dbhandler->query($sql);\n if ($r === false) {\n $this->last_error = implode(\"\\n\", $this->dbhandler->errorInfo());\n\n return false;\n }\n $this->records_found = $r->rowCount();\n\n return true;\n }", "function get_sensors_data_last_day(){\r\n $sensor_json_url = 'https://data.melbourne.vic.gov.au/resource/b2ak-trbp.json';\r\n $last_available_data_time = get_last_available_with_time(0)->date_time;\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_URL,$sensor_json_url . '?$where=date_time%20>%20\"' . gmdate(\"Y-m-d\\TH:i:s\", strtotime('-1 day', strtotime($last_available_data_time))) . '\"');\r\n $result=curl_exec($ch);\r\n curl_close($ch);\r\n return json_decode($result);\r\n}", "public function get_latest_orders()\n\t{\n\t\t$where = 'orders.order_status_id != 4 AND orders.order_status_id = order_status.order_status_id AND customer.customer_id = orders.customer_id AND orders.vendor_id = '.$this->session->userdata('vendor_id');\n\t\t$table = 'orders, order_status, customer';\n\t\t\n\t\t//retrieve all orders\n\t\t$this->db->from($table);\n\t\t$this->db->select('orders.*, orders.order_status_id AS status,customer.customer_first_name AS first_name, customer.customer_surname AS other_names, order_status.order_status_name');\n\t\t$this->db->where($where);\n\t\t$this->db->order_by('orders.order_created', 'DESC');\n\t\t$query = $this->db->get('', 20);\n\t\t\n\t\treturn $query;\n\t}", "public function LastOrder($includeUnsubmittedOrders = false)\n {\n //limit to 10\n if ($includeUnsubmittedOrders) {\n $orders = Order::get_datalist_of_orders_with_submit_record(false);\n } else {\n $orders = Order::get_datalist_of_orders_with_submit_record(true);\n }\n\n return $orders\n ->Filter(['MemberID' => $this->owner->ID])\n ->First()\n ;\n }", "public function getLatestDeliveryTime()\n {\n return $this->latestDeliveryTime;\n }", "function getOldOpenOrders($minutes)\n\t{\n\t\t$threshold_timestamp = time()-($minutes*60);\n\t\t$threshold_dt_tm = date(\"Y-m-d H:i:s\",$threshold_timestamp);\n\t\t$old_order_data['status'] = 'O';\n\t\t$old_order_data['created'] = array(\"<\"=>$threshold_dt_tm);\n\t\t$options[TONIC_FIND_BY_METADATA] = \t$old_order_data;\n\t\t$options[TONIC_JOIN_STATEMENT] = \" JOIN Merchant ON Orders.merchant_id = Merchant.merchant_id \";\n\t\t$options[TONIC_FIND_STATIC_FIELD] = \" Merchant.time_zone, Merchant.state \";\n\n\t\t$default_timezone_string = date_default_timezone_get();\n\n\t\t$old_order_resources = Resource::findAll($this,'',$options);\n\t\t$old_open_orders = array();\n\t\tforeach ($old_order_resources as $order_resource)\n\t\t{\n\t\t\tsetTheDefaultTimeZone($order_resource->time_zone,$order_resource->state);\n\t\t\t$pickup_timestamp = strtotime($order_resource->pickup_dt_tm);\n\t\t\tif ($pickup_timestamp < $threshold_timestamp)\n\t\t\t{\n\t\t\t\tmyerror_log(\"we have an open order that was scheduled to be picke up over $minutes minutes ago\");\n\t\t\t\t$old_open_orders[] = $order_resource;\n\t\t\t}\n\t\t}\n\t\tdate_default_timezone_set($default_timezone_string);\n\t\treturn $old_open_orders;\n\n\t}", "protected function getLastOrder(){\n return $this->_orderFactory->create('Magento\\Sales\\Model\\Order')->loadByIncrementId($this->onepage->getLastOrderId());\n }", "public function fetchHours(){\n $sql = $this->db->query(\"SELECT * FROM posible_fisio ORDER BY dia, hora_i\");\n $list_db = $sql->fetchAll(PDO::FETCH_ASSOC);\n\n if($list_db != NULL) {\n return $list_db;\n } else {\n return NULL;\n }\n }", "public function getOutstandingOrders()\n {\n $order = $this->db->prepare(<<<SQL\nSELECT orders.order_id, orders.order_date, orders.arrival_date, orders.student_number\nFROM orders\nWHERE orders.arrival_date IS NULL\nORDER BY orders.order_date;\nSQL\n );\n $order->execute();\n return $order->fetchAll(\\PDO::FETCH_OBJ);\n }", "public function f_get_woDtls()\n {\n\n $sql = $this->db->query(\"SELECT DISTINCT order_no, order_dt FROM td_dm_work_order \");\n return $sql->result();\n\n }", "public function getRecurringOrders();", "function getOrderModifiedDate($orders_id) {\n\t\t$sel_ord_query = tep_db_query(\"SELECT MAX(date_added) as modified_date FROM \" . TABLE_ORDERS_STATUS_HISTORY . \" WHERE orders_id = '\".$orders_id.\"' LIMIT 0,1\");\n\t\t$rst_arr = tep_db_fetch_array($sel_ord_query);\n\t\treturn $rst_arr['modified_date'];\n\t}", "public static function get_close_today()\n\t{\n\t\ttry\n\t\t{\n\t\t\t//raw query\n\t\t\t$q = DB::query( \"SELECT close, device_id, port FROM humidity_deltas \n\t\t\t\t\tWHERE DATE(time) = DATE(NOW()) \n\t\t\t\t\");\n\n\t\t\treturn $q;\n\t\t}\n\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tLog::write('error', $e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function getRemainingHoursOfNewOrd(){\n return 0;\n }", "public function getDailyOrders($id=null)\n {\n $startDate = date(\"Y-m-d H:i:s\", strtotime('-1 month', time()));\n $endDate = date('Y-m-d H:i:s');\n\n $userData = User::find()->andFilterWhere(['u_id' => $id])->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n \\Yii::$app->data->getMwsDetails($user->u_mws_seller_id, $user->u_mws_auth_token);\n\n $orderList = \\Yii::$app->api->getOrdersList('Created', $startDate, $endDate);\n foreach ($orderList as $order) {\n $order = (array)$order;\n $order = array_shift($order);\n if ($order) {\n\n $model = AllOrdesList::findOne(['aol_amazon_order_id' => $order['AmazonOrderId'], 'aol_user_id' => $user->u_id]);\n if (!$model) {\n $model = new AllOrdesList();\n }\n $model->aol_amazon_order_id = (key_exists('AmazonOrderId', $order)) ? $order['AmazonOrderId'] : null;\n $model->aol_seller_order_id = (key_exists('SellerOrderId', $order)) ? $order['SellerOrderId'] : null;\n $model->aol_purchase_date = (key_exists('PurchaseDate', $order)) ? $order['PurchaseDate'] : null;\n $model->aol_last_updated_date = (key_exists('LastUpdateDate', $order)) ? $order['LastUpdateDate'] : null;\n $model->aol_order_status = (key_exists('OrderStatus', $order)) ? $order['OrderStatus'] : null;\n $model->aol_fulfilment_channel = (key_exists('FulfillmentChannel', $order)) ? $order['FulfillmentChannel'] : null;\n $model->aol_sales_channel = (key_exists('SalesChannel', $order)) ? $order['SalesChannel'] : null;\n $model->aol_ship_service = (key_exists('ShipServiceLevel', $order)) ? $order['ShipServiceLevel'] : null;\n $model->aol_order_total = (key_exists('OrderTotal', $order)) ? $order['OrderTotal']['Amount'] : 0;\n $model->aol_shipped_items = (key_exists('NumberOfItemsShipped', $order)) ? $order['NumberOfItemsShipped'] : null;\n $model->aol_unshipped_items = (key_exists('NumberOfItemsUnshipped', $order)) ? $order['NumberOfItemsUnshipped'] : null;\n $model->aol_user_id = $user->u_id;\n if($model->save(false)) {\n echo $model->aol_amazon_order_id.\" is Saved. \";\n }\n\n $model = AllOrdesList::findOne($model->aol_amazon_order_id);\n if($model) {\n sleep(2);\n /**\n * Get Finance Event Data\n */\n $financeEventData = \\Yii::$app->api->getFinanceEventList($model->aol_amazon_order_id);\n $amazonOrderId = $sellerOrderId = $shipmentRefundId = null;\n\n if ($financeEventData) {\n // print_r($financeEventData); exit();\n /**\n * Store Shipment Event Data 111-8188019-0760241\n */\n if ($shipmentData = $financeEventData['shipmentEventData']) {\n foreach ($shipmentData as $sVal) {\n $modelSR = new ShipmentRefundEventData();\n $modelSR->sred_amazon_order_id = $amazonOrderId = $sVal['AmazonOrderId'];\n $modelSR->sred_seller_order_id = $sellerOrderId = $sVal['SellerOrderId'];\n $modelSR->sred_marketplace_name = $sVal['MarketplaceName'];\n $modelSR->sred_shipment_posted_date = $sVal['PostedDate'];\n $modelSR->sred_event_type = 'Order';\n\n if ($modelSR->save(false)) {\n $shipmentRefundId = $modelSR->sred_id;\n if (key_exists('ShipmentItemList', $sVal) && is_array($sVal['ShipmentItemList']) && $shipmentItemData = $sVal['ShipmentItemList']) {\n foreach ($shipmentItemData as $sItem) {\n $sellerSku = $sItem['SellerSKU'];\n $orderItemId = $sItem['OrderItemId'];\n $shippedQuantity = $sItem['QuantityShipped'];\n\n if (key_exists('ItemChargeList', $sItem) && is_array($sItem['ItemChargeList']) && $itemChargeData = $sItem['ItemChargeList']) {\n foreach ($itemChargeData as $iData) {\n $itemModel = new ItemChargeListData();\n $itemModel->icld_quantity_shipped = $shippedQuantity;\n $itemModel->icld_seller_sku = $sellerSku;\n $itemModel->icld_order_item_id = $orderItemId;\n $itemModel->icld_amazon_order_id = $modelSR->sred_amazon_order_id;\n $itemModel->icld_seller_order_id = $modelSR->sred_seller_order_id;\n $itemModel->icld_item_charge_type = $iData['ChargeType'];\n $itemModel->icld_charge_amount = $iData['Amount'];\n $itemModel->icld_currency = $iData['CurrencyCode'];\n $itemModel->icld_transaction_type = 'Order';\n $itemModel->icld_item_type = 'Shipment';\n $itemModel->icld_shipment_refund_event_data_id = $modelSR->sred_id;\n if ($itemModel->save(false)) {\n echo \"Item Charge Saved.\";\n }\n } //$itemChargeData\n }\n\n if (key_exists('ItemFeeList', $sItem) && is_array($sItem['ItemFeeList']) && $itemFeeChargeData = $sItem['ItemFeeList']) {\n foreach ($itemFeeChargeData as $ifData) {\n $feeModel = new ItemFeeListData();\n $feeModel->ifld_quantity_shipped = $shippedQuantity;\n $feeModel->ifld_seller_sku = $sellerSku;\n $feeModel->ifld_order_item_id = $orderItemId;\n $feeModel->ifld_amazon_order_id = $modelSR->sred_amazon_order_id;\n $feeModel->ifld_seller_order_id = $modelSR->sred_seller_order_id;\n $feeModel->ifld_fee_type = $ifData['FeeType'];\n $feeModel->ifld_fee_amount = $ifData['Amount'];\n $feeModel->ifld_currency = $ifData['CurrencyCode'];\n $feeModel->ifld_transaction_type = 'Order';\n $feeModel->ifld_item_type = 'Shipment';\n $feeModel->ifld_shipment_refund_event_id = $modelSR->sred_id;\n if ($feeModel->save(false)) {\n echo \"Item Fee Saved.\";\n }\n } // $itemFeeChargeData\n }\n } // $shipmentItemData\n }\n }\n } //$shipmentData\n } // if : $shipmentData\n\n /**\n * Store Refund Event Data\n */\n if ($refundData = $financeEventData['refundEventData']) {\n foreach ($refundData as $rValue) {\n $modelSR = new ShipmentRefundEventData();\n $modelSR->sred_amazon_order_id = $rValue['AmazonOrderId'];\n $modelSR->sred_seller_order_id = $rValue['SellerOrderId'];\n $modelSR->sred_marketplace_name = $rValue['MarketplaceName'];\n $modelSR->sred_refund_posted_date = $rValue['PostedDate'];\n $modelSR->sred_event_type = 'Refund';\n\n if ($model->save(false)) {\n /*$vnModel = new VaNotification();\n $vnModel->vn_amazon_order_id = $modelSR->sred_amazon_order_id;\n $vnModel->vn_refund_posted_date = $modelSR->sred_refund_posted_date;\n $vnModel->vn_shipment_refund_event_data_id = $modelSR->sred_id;\n $vnModel->save(false);*/\n\n if (key_exists('ShipmentItemAdjustmentList', $rValue) && is_array($rValue['ShipmentItemAdjustmentList']) && $shipmentItemData = $rValue['ShipmentItemAdjustmentList']) {\n foreach ($shipmentItemData as $sItem) {\n $sellerSku = $sItem['SellerSKU'];\n $orderItemId = (key_exists('OrderAdjustmentItemId', $sItem)) ? $sItem['OrderAdjustmentItemId'] : null;\n $shippedQuantity = (key_exists('QuantityShipped', $sItem)) ? $sItem['QuantityShipped'] : null;\n\n if (key_exists('ItemChargeAdjustmentList', $sItem) && is_array($sItem['ItemChargeAdjustmentList']) && $itemChargeData = $sItem['ItemChargeAdjustmentList']) {\n foreach ($itemChargeData as $iData) {\n $itemModel = new ItemChargeListData();\n $itemModel->icld_quantity_shipped = $shippedQuantity;\n $itemModel->icld_seller_sku = $sellerSku;\n $itemModel->icld_order_adjustment_item_id = $orderItemId;\n $itemModel->icld_amazon_order_id = $modelSR->sred_amazon_order_id;\n $itemModel->icld_seller_order_id = $modelSR->sred_seller_order_id;\n $itemModel->icld_item_charge_type = $iData['ChargeType'];\n $itemModel->icld_charge_amount = $iData['Amount'];\n $itemModel->icld_currency = $iData['CurrencyCode'];\n $itemModel->icld_transaction_type = 'Refund';\n $itemModel->icld_item_type = 'Refund';\n $itemModel->icld_shipment_refund_event_data_id = $modelSR->sred_id;\n if ($itemModel->save(false)) {\n echo \"Refund Item Charge Saved.\";\n }\n } //$itemChargeData\n }\n\n if (key_exists('ItemFeeAdjustmentList', $sItem) && is_array($sItem['ItemFeeAdjustmentList']) && $itemFeeChargeData = $sItem['ItemFeeAdjustmentList']) {\n foreach ($itemFeeChargeData as $ifData) {\n $feeModel = new ItemFeeListData();\n $feeModel->ifld_quantity_shipped = $shippedQuantity;\n $feeModel->ifld_seller_sku = $sellerSku;\n $feeModel->ifld_order_adjustment_item_id = $orderItemId;\n $feeModel->ifld_amazon_order_id = $modelSR->sred_amazon_order_id;\n $feeModel->ifld_seller_order_id = $modelSR->sred_seller_order_id;\n $feeModel->ifld_fee_type = $ifData['FeeType'];\n $feeModel->ifld_fee_amount = $ifData['Amount'];\n $feeModel->ifld_currency = $ifData['CurrencyCode'];\n $feeModel->ifld_transaction_type = 'Refund';\n $feeModel->ifld_item_type = 'Refund';\n $feeModel->ifld_shipment_refund_event_id = $modelSR->sred_id;\n if ($feeModel->save(false)) {\n echo \"Refund Item Fee Saved.\";\n }\n } // $itemFeeChargeData\n }\n } // $shipmentItemData\n }\n }\n }\n } // if : Refund Event\n\n /*\n * Store Service Fee Event Data\n */\n if ($serviceFeeEventData = $financeEventData['serviceFeeEventData']) {\n foreach ($serviceFeeEventData as $rValue) {\n $aOrderId = $rValue['AmazonOrderId'];\n $feeReason = $rValue['FeeReason'];\n $sellerSku = $rValue['SellerSKU'];\n $fnSku = $rValue['FnSKU'];\n $feeDesc = $rValue['FeeDescription'];\n $asin = $rValue['ASIN'];\n\n if (key_exists('FeeList', $rValue) && is_array($rValue['FeeList']) && $itemChargeData = $rValue['FeeList']) {\n foreach ($itemChargeData as $iData) {\n $sModel = new ServiceFeeData();\n $sModel->sfd_amazon_order_id = $aOrderId;\n $sModel->sfd_seller_order_id = $sellerOrderId;\n $sModel->sfd_fee_reason = $feeReason;\n $sModel->sfd_seller_sku = $sellerSku;\n $sModel->sfd_fnsku = $fnSku;\n $sModel->sfd_fee_description = $feeDesc;\n $sModel->sfd_asin = $asin;\n $sModel->sfd_fee_type = $iData['FeeType'];\n $sModel->sfd_fee_amount = $iData['Amount'];\n $sModel->sfd_currency = $iData['CurrencyCode'];\n $sModel->sfd_shipment_refund_event_data_id = $shipmentRefundId;\n if ($sModel->save(false)) {\n echo \"Service Fee Data Saved.\";\n }\n }\n }\n }\n } // if : service Fee Event\n\n /**\n * Adjustment Event Data\n */\n if ($adjustmentEventData = $financeEventData['adjustmentEventData']) {\n foreach ($adjustmentEventData as $raValue) {\n $adModel = new OrderAdjustmentEventData();\n $adModel->oaed_amazon_order_id = $amazonOrderId;\n $adModel->oaed_seller_order_id = $sellerOrderId;\n $adModel->oaed_adjustment_type = $raValue['AdjustmentType'];\n $adModel->oaed_amount = $raValue['Amount'];\n $adModel->oaed_currency = $raValue['CurrencyCode'];\n\n if ($adModel->save(false)) {\n if (key_exists('AdjustmentItemList', $raValue) && is_array($raValue['AdjustmentItemList']) && $AdjustmentItemList = $raValue['AdjustmentItemList']) {\n foreach ($AdjustmentItemList as $siItem) {\n $adIModel = new OrderAdjustmentItemListData();\n $adIModel->oaild_amazon_order_id = $amazonOrderId;\n $adIModel->oaild_seller_order_id = $sellerOrderId;\n $adIModel->oaild_quantity = $siItem['Quantity'];\n $adIModel->oaild_per_unit_amount = $siItem['PerUnitAmount']['Amount'];\n $adIModel->oaild_total_amount = $siItem['TotalAmount']['Amount'];\n $adIModel->oaild_currency = $siItem['TotalAmount']['CurrencyCode'];\n $adIModel->oaild_seller_sku = $siItem['SellerSKU'];\n $adIModel->oaild_fnsku = $siItem['FnSKU'];\n $adIModel->oaild_product_description = $siItem['ProductDescription'];\n $adIModel->oaild_asin = $siItem['ASIN'];\n $adIModel->order_adjustment_event_data_id = $adModel->oaed_id;\n $adIModel->oaild_shipment_refund_event_data_id = $shipmentRefundId;\n if ($adIModel->save(false)) {\n echo \"Adjustment Item Data Saved.\";\n }\n }\n }\n }\n }\n } // if : adjustment Event Data\n\n } // main if : $financeEventData\n\n $model = AllOrdesList::findOne(['aol_amazon_order_id' => $amazonOrderId]);\n if($model) {\n $model->aol_status = 1; // Finance Event Data Pulled.\n if ($model->save(false)) {\n echo \"Finance Event Data of Order No: \" . $model->aol_amazon_order_id . \" is Saved.\";\n }\n }\n sleep(3);\n\n /**\n * Get Shipped Order Details\n */\n $model = AllOrdesList::findOne(['aol_amazon_order_id' => $model->aol_amazon_order_id]);\n if ($model && $model->aol_order_status == 'Shipped') {\n $orderDetails = \\Yii::$app->api->getOrderDetails($model->aol_amazon_order_id);\n $orderItemAsin = \\Yii::$app->api->getOrderItems($model->aol_amazon_order_id);\n if ($orderDetails) {\n $model->aol_shipping_username = key_exists('Name', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['Name'] : null;\n $model->aol_shipping_address_1 = key_exists('AddressLine1', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['AddressLine1'] : null;\n $model->aol_shipping_address_2 = key_exists('AddressLine2', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['AddressLine2'] : null;\n $model->aol_shipping_address_3 = key_exists('AddressLine3', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['AddressLine3'] : null;\n $model->aol_city = key_exists('City', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['City'] : null;\n $model->aol_country = key_exists('County', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['County'] : null;\n $model->aol_district = key_exists('District', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['District'] : null;\n $model->aol_state_or_region = key_exists('StateOrRegion', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['StateOrRegion'] : null;\n $model->aol_postal_code = key_exists('PostalCode', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['PostalCode'] : null;\n $model->aol_country_code = key_exists('CountryCode', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['CountryCode'] : null;\n $model->aol_phone = key_exists('Phone', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['Phone'] : null;\n $model->aol_buyer_name = key_exists('BuyerName', $orderDetails) ? $orderDetails['BuyerName'] : null;\n $model->aol_buyer_email = key_exists('BuyerEmail', $orderDetails) ? $orderDetails['BuyerEmail'] : null;\n $model->aol_asin = $orderItemAsin;\n $model->aol_shipped_status = 1; //Order Details Pulled\n if ($model->save(false))\n echo $model->aol_amazon_order_id . \" Details Saved.\";\n }\n sleep(3);\n\n /**\n * Get All ASIN for Order\n */\n $orderItemAsinData = \\Yii::$app->api->getOrderItems($model->aol_amazon_order_id, true);\n if ($orderItemAsinData) {\n foreach ($orderItemAsinData as $asinData) {\n $modelOI = OrderItemsAsin::findOne(['oia_order_id' => $model->aol_amazon_order_id]);\n if (!$modelOI) {\n $modelOI = new OrderItemsAsin();\n }\n $modelOI->oia_order_id = $model->aol_amazon_order_id;\n $modelOI->oia_asin = $asinData['ASIN'];\n $catData = ($modelOI->oia_asin) ? \\Yii::$app->api->getProductCategory($modelOI->oia_asin) : null;\n if ($catData) {\n $modelP = FbaAllListingData::findOne(['asin1' => $modelOI->oia_asin]);\n $sPrice = ($modelP) ? $modelP->price : 0;\n $fees = GetApiData::mwsFeesEstimate($modelOI->oia_asin, $sPrice);\n $referralFee = ($fees) ? $fees['ReferralFee'] : 0;\n\n $modelOI->oia_referral_fee = $referralFee;\n $modelOI->oia_category = $catData;\n $modelOI->oia_purchase_date = $model->aol_purchase_date;\n\n $productDimensionData = \\Yii::$app->api->getProductDimensions($modelOI->oia_asin);\n if ($productDimensionData) {\n $modelOI->oia_item_height = $productDimensionData['ItemHeight'];\n $modelOI->oia_item_length = $productDimensionData['ItemLength'];\n $modelOI->oia_item_weight = $productDimensionData['ItemWeight'];\n $modelOI->oia_item_width = $productDimensionData['ItemWidth'];\n $modelOI->oia_package_height = $productDimensionData['PackageHeight'];\n $modelOI->oia_package_length = $productDimensionData['PackageLength'];\n $modelOI->oia_package_weight = $productDimensionData['PackageWeight'];\n $modelOI->oia_package_width = $productDimensionData['PackageWidth'];\n }\n }\n if ($modelOI->save(false)) {\n echo \"ASIN Saved.\";\n }\n sleep(3);\n }\n }\n }\n }\n }\n }\n\n /*if($id) {\n $user->order_cron_status = 1;\n $user->save(false);\n }*/\n }\n echo \"Done..\";\n }", "public function getAllDeliveriesExpired() //get delivery more than 3 days not received by toko\n {\n // join sma_sales on sma_deliveries.sale_id = sma_sales.id and sma_sales.client_id = \"aksestoko\"\n // where DATE(sma_deliveries.date + INTERVAL 3 DAY) < current_date\n $this->db->select('sma_deliveries.id as do_id, sma_deliveries.do_reference_no as do_ref, sma_purchases.id as purchase_id');\n $this->db->join('sma_sales', 'sma_deliveries.sale_id = sma_sales.id and sma_sales.client_id = \"aksestoko\"');\n $this->db->join('sma_purchases', 'sma_purchases.cf1 = sma_sales.reference_no and sma_purchases.supplier_id = sma_sales.biller_id');\n $this->db->where('DATE(sma_deliveries.date + INTERVAL 3 DAY) < NOW() AND sma_deliveries.date > \"2019-08-01\" AND sma_deliveries.receive_status is null');\n $q = $this->db->get('sma_deliveries');\n if ($q->num_rows() > 0) {\n return $q->result();\n }\n return [];\n }", "public function getOrdersDataLast7Days($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-7days\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getNumOfOrderByDay($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function getExpired();", "public function getTimesheetRecent(){\n $emp_id = Auth::user()->id;\n $data['response'] = $this->timesheet->getInformRecent($emp_id);\n $data = $this->formatDate($data);\n return $data;\n }", "public function buyer_orders()\n {\n $query = $this->db->where('buyer_id', $this->current_user->user_id)\n ->order_by('time desc')\n //->order_by('progress asc, time desc')\n ->get('orders');\n #echo $this->db->last_query();\n return ($query->num_rows() > 0) ? $this->build_array($query->result_array()) : array();\n\n }", "public function getDeliveryHours()\n {\n return $this->apiClient->doCall(\n \"GET\",\n \"deliveryhours\"\n );\n }", "public function OrderList(Request $request){\n // 'user_id' => 'required',\n // ]);\n // if($validation->fails()) {\n // return array('status'=>500,'message'=>'Validation Alert','image_base_prefix_url'=>'http://technodeviser.com/grocerydelivery/','data'=>$validation->getMessageBag());\n // }\n $user = auth('api')->user();\n $user_id = $user->user_id;\n $orders = DB::connection('mysql_sec')->table('orders')\n ->where('user_id',$user_id)->orderBy('order_id', 'DESC')->get();\n foreach($orders as $order){\n $time_id =$order->time_slot;\n $time = DB::connection('mysql_sec')->table('store_time_slot')\n ->where(['id'=>$time_id])->first();\n if($time){\n $order->time_slot = $time->opening_time.' - '.$time->closing_time;\n }\n }\n return apiResponse(true,202,$orders);\n }", "public function _get_past_prices_details(){\n \t$past_prices = $this\n\t\t\t->past_price\n\t\t\t->select('id, price, created')\n\t\t\t->order_by('created', 'desc')\n\t\t\t->get();\n\n\t\t$values = array();\n\t\tforeach($past_prices as $past_price){\n\t\t\t$values[] = format_currency($past_price->price) . ' - ' . format_date($past_price->created, 'default_date_format');\n\t\t}\n\t\treturn ul($values);\n }", "public function getLatestTimestamp()\n {\n return DB::table('product_models')->orderBy('updated', 'desc')->value('updated');\n }", "public function getRecentAirData($req){\r\n $int_timestamp = $_SERVER['REQUEST_TIME'] - 10;\r\n $datetime_timestamp = date('Y-m-d H:i:s', $int_timestamp);\r\n $sql = 'SELECT *\r\n FROM airq_data JOIN registration \r\n WHERE user_id = ? AND timestamp = ?';\r\n $stmt = $this->getReadConnection()->prepare($sql);\r\n $stmt->setFetchMode(\\PDO::FETCH_ASSOC);\r\n // fetch records that saves 10 seconds before.\r\n $isSuccess = $stmt->execute(array($req->{'user-id'}, $datetime_timestamp));\r\n if ($isSuccess){\r\n return $stmt->fetch();\r\n }\r\n else {\r\n throw new \\Exception(\"submit form is invalid\", 203);\r\n }\r\n }", "public function getDownTimeToday(){\n return Notification::calculateDailyDowntime($this);\n }", "public function findAllWithStatusFromLastHour()\n {\n $time = new \\DateTime();\n $time->sub(new \\DateInterval('PT1H'));\n\n return $this->createQueryBuilder('t')\n ->innerJoin('t.statuses', 's')\n ->addSelect('s')\n ->where('s.measuredAt > :time')\n ->setParameter('time', $time)\n ->getQuery()\n ->getResult();\n }", "public function getExpiration();", "private function getTempExtremsToday() {\n //get last update date\n $update = explode(\" \", $this->lastUpdateStr())[0];\n\n $statement = $this->db->prepare('SELECT max(\"amount\") as \"high\", min(\"amount\") as \"low\" FROM \"temperature\" WHERE date(\"created\") = ?');\n $statement->bindValue(1, $update);\n $result = $statement->execute();\n return $result->fetchArray(SQLITE3_ASSOC);\n }", "public function getExpired() {\n\t\t\n\t}", "public function orderhistorybyemail(){\n\t\t$this->db->where('OrderEmail', $this->session->userdata('useremail'));\n\t\t$this->db->order_by('OrderId', 'desc');\n\t\t$query=$this->db->get('tbl_order_summery');\n\t\treturn $query->result();\n\t}", "public function getOrders() \n {\n return $this->_fields['Orders']['FieldValue'];\n }", "public function getTodoData(){\n $id = Auth::user()->id;\n\n return TodoList::latest('updated_at')->where('cid', $id)->get();\n }", "function get_end_tp($order) \n\t{\n\t return $this->db->select('last_order_number,first_order_number,tp_start,tp_end')\n\t\t ->from('pamm_tp') \n\t\t ->where(\"first_order_number\",$order)\n\t\t ->get()->result();\n\t}", "public function getLastStatistics() \n { \n $m = MinerStatistics::where('user_id', auth()->user()->id)\n ->where('created_at','>=', Carbon::now()->subSeconds(90))\n ->get()\n ->groupBy('rigname');\n\n $response = [];\n foreach($m as $miner) {\n $miner = $miner->first();\n $miner->data = json_decode($miner->data);\n $response[] = $miner;\n }\n \n return $response;\n }", "public function getTodaybuy()\n {\n return $this->get(self::_TODAYBUY);\n }", "public function getOrderDetails()\n {\n return Orders::getOrderdetails($this->getOrderId());\n }", "function getOrders() {\n\t\t$orders = Mage::getModel ( 'sales/order' )->getCollection ()->addAttributeToSelect ( \"*\" )->addAttributeToFilter ( 'status', array ('complete') );\n\t\t$orders_data = $this->preapreOrdersTosend ( $orders );\n\t\treturn $orders_data;\n\t}", "function getMarketDay($json) {\n $mktTime = $json['optionChain']['result'][0]['quote']['regularMarketTime'];\n return utcToDate($mktTime);\n}", "public function getServerHour(){\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT DATE_FORMAT(NOW(), '%k:%i:%s') AS hora\");\n\t\t$stmt->execute();\n\t\treturn $stmt->fetch()[0]; //respuesta\n\t}", "public function findDataLast()\n {\n return $this->getEntityManager()\n ->createQuery(\"SELECT DISTINCT t.number, f.id as finance, f.price as cost, f.gotcarq as gotcarqId\n FROM GazMainBundle:Terminal t\n JOIN GazMainBundle:Finance f WITH f.terminal = t\n\t\t\t\t\t\t\tWHERE (f.gotcarq IS NOT NULL AND f.gotcarq != 0)\n\t\t\t\t\t\t\t AND f.created = (SELECT MIN(f1.created) FROM GazMainBundle:Finance f1\n LEFT JOIN f1.terminal t1\n WHERE t1.id = t.id AND f1.financeType = FALSE)\n\t\t\t\t\t\t\tORDER BY t.number ASC\n \")\n ->getResult();\n }", "public static function getNewOrders($lastVisit) {\n\n\t\treturn Order::fullActive()\n\t\t ->whereBetween('date', [$lastVisit, Carbon::now()])\n\t\t ->get();\n\t}", "public function getOrderDate()\n {\n return $this->order_date;\n }", "function getOrderEvents($order_shopify_id){\n $_url = 'https://f1d486bdbc7147e7d601cda568c738d0:[email protected]/admin/orders/' . $order_shopify_id . '/events.json';\n return json_decode(file_get_page($_url),true);\n}", "public function orderDetailsProduct($order_id){\n \n $data = Orderdetails::with('product')->where('order_id',$order_id)->latest()->get();\n return response()->json($data);\n\n }", "public function getExpiration()\n {\n }", "public function getDeliveryOrder();", "public function hourly()\n {\n $hourly = [];\n if ($this->hourly && isset($this->hourly[\"data\"])) {\n $this->hourly[\"data\"] = array_slice($this->hourly[\"data\"], 0, 12);\n $hours = count($this->hourly[\"data\"]);\n for ($i=0; $i < $hours; $i++) {\n setlocale(LC_ALL, 'sv_SV');\n $time = $this->hourly[\"data\"][$i][\"time\"];\n if ($time) {\n $this->parseDate(\"hourly\", $i, $time);\n $weekday = strftime(self::$dayFormat, $time);\n $weeknr = strftime(\"%w\", $time);\n\n $hourly[\"days\"][$weeknr][\"hours\"][$i] = $this->pushInfo(\n $this->hourly[\"data\"][$i],\n [\n \"icon\",\n \"timeofday\",\n \"summary\",\n \"temperature\",\n \"apparentTemperature\",\n \"date\",\n \"weekday\",\n \"timeofday\"\n ]\n );\n $hourly[\"days\"][$weeknr][\"day\"] = ucfirst($weekday);\n }\n }\n }\n return $hourly;\n }", "public function getTradeAt()\n {\n return $this->trade_at;\n }", "public function get_recent_deals($params){\n \t$endpoint = 'deal/recent/modified';\n \ttry{\n \t\treturn json_decode($this->execute_get_request($this->get_request_url($endpoint,$params)));\n \t}\n \tcatch(HubSpotException $e){\n \t\tthrow new HubSpotException('Unable to get deals: '.$e);\n \t}\n }", "public function getOrderdate()\n {\n return $this->orderdate;\n }", "public function getFutureRevisitOrders()\n {\n return \\DB::select(\"SELECT a.id, a.propaddress1, a.propaddress2, a.propcity, a.propstate, a.propzip, s.descrip as status_name FROM appr_dashboard_delay_order d LEFT JOIN appr_order a ON (a.id=d.orderid) LEFT JOIN order_status s ON (a.status=s.id) WHERE d.created_date BETWEEN :from AND :to AND d.delay_date > :today\", [':from' => strtotime('today'), ':to' => strtotime('tomorrow'), ':today' => strtotime('tomorrow')]);\n }", "public function getEvent(string $orderId): array;", "public function getEndTime(){\n //the object and not return a new one, we\n //need to clone the object and modify a copy\n //so we can keep the original DateTime obj\n $date=clone $this->dateTime;\n $date->add(\\DateInterval::createFromDateString(\"1 hour\"));\n\n return $date;\n }", "protected function getViewData()\n {\n if (isset($_SESSION['session'])) {\n $session = $_SESSION['session'];\n $stmt = $this->_database->prepare('SELECT\n angebot.name, angebot.id, angebot_bestellung.id,\n angebot_bestellung.status, angebot_bestellung.bestellung_id, bestellung.status\n FROM angebot_bestellung\n INNER JOIN angebot ON angebot.id = angebot_bestellung.angebot_id\n INNER JOIN bestellung\n ON bestellung.id = angebot_bestellung.bestellung_id\n WHERE bestellung.session_id = ? AND (bestellung.status <=1 || bestellung.status IS NULL)');\n $stmt->bind_param('i', $session);\n \n if ($stmt->execute()) {\n $stmt->bind_result($name, $supplyId, $id, $pizzastatus, $orderId ,$orderstatus);\n $this->_orders = array();\n \n while ($stmt->fetch()) {\n if (!isset($this->_orders[$orderId])) {\n $this->_orders[$orderId] = array();\n }\n $pizzastatus = $orderstatus == 1 ? 3 : $pizzastatus;\n $this->_orders[$orderId][$id] = array(\n 'id' => $supplyId,\n 'name' => $name,\n 'status' => $pizzastatus\n );\n }\n }\n }\n else{\n echo'<script>console.log(\"session NOT set!\");</script>'; \n }\n }", "public function getFOrders()\n {\n // 花店管理员身份验证\n if (session(\"admin_level\") == 3){\n $toFlower = M('weixin_order');\n $data = $toFlower->where('type = 0')->select();\n $this->assign('data',$data);\n }\n\n $toTrade = M('pub_trade_logs');\n $con['uid'] = session('uid');\n //$this->ajaxReturn(0 , $con['uid'] , 1);\n $TradeLogs = $toTrade->query(\"SELECT `xt_pub_trade_logs`.* ,`xt_pub`.`title` FROM `xt_pub_trade_logs` left join `xt_pub` on `xt_pub_trade_logs`.`pub_id` = `xt_pub`.`pub_id` WHERE 1\");\n // $this->ajaxReturn(0 , $TradeLogs , 1);\n\n $this->assign('tradelogs',$TradeLogs);\n $this->display();\n }", "public function getOrders(){\n if ( is_null($this->orders) ){\n $db = $this->getTable()->getAdapter();\n $sid = $this->getCourier()->getId();\n\n //get all orders of courier service\n $sql = sprintf(\"select id from orders\n where (billCourier=0 or billCourier is NULL)\n and courierId = %d\",$sid);\n \n $rows = $db->fetchAll($sql);\n $orders = new SplObjectStorage();\n foreach($rows as $o){\n try{\n $order = new Yourdelivery_Model_Order($o['id']);\n\n if ( $order->getMode() == \"great\" && $order->getState() != 2 &&\n //check for great which do not provide pfand\n //kreiner, gela\n !in_array($order->getCourier()->getId(),array(12123,12115)) ){\n continue;\n }\n\n if ( $order->getState() < 0 ){\n continue;\n }\n\n if ( $order->getDeliverTime() > $this->until ){\n continue;\n }\n\n $orders->attach($order);\n }\n catch ( Yourdelivery_Exception_Database_Inconsistency $e ){\n\n }\n }\n $this->orders = $orders;\n }\n return $this->orders;\n }", "public function makeChart(){\n\n //$monthcreated_at->format('d');\n $data= \\DB::table(\"donations\")\n\n ->select(DB::raw(\"HOUR(created_at) as months\"),DB::raw(\"(SUM(amount)) as total\"))\n\n ->groupBy(DB::raw(\"HOUR(created_at)\"))\n\n ->get();\n\n\nreturn ($data); \n \n }", "public function getLastBtTime()\n {\n return $this->get(self::_LAST_BT_TIME);\n }", "function get_last_available_with_time($time){\r\n $sensor_json_url = 'https://data.melbourne.vic.gov.au/resource/b2ak-trbp.json';\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_URL,$sensor_json_url . '?$limit=1&$order=:id%20DESC&time=' . $time );\r\n $result=curl_exec($ch);\r\n curl_close($ch);\r\n if(isset(json_decode($result)[0]))\r\n return json_decode($result)[0];\r\n else return NULL;\r\n}", "private function GetOrders()\n\t{\t$orders = array();\n\t\t$where = array();\n\t\t\n\t\tif ($this->startdate)\n\t\t{\t$where[] = 'orderdate>=\"' . $this->startdate . ' 00:00:00\"';\n\t\t}\n\t\tif ($this->enddate)\n\t\t{\t$where[] = 'orderdate<=\"' . $this->enddate . ' 23:59:59\"';\n\t\t}\n\t\tif (!$this->showunpaid)\n\t\t{\t$where[] = 'NOT paiddate=\"0000-00-00 00:00:00\"';\n\t\t}\n\t\t\n\t\t$sql = 'SELECT * FROM storeorders';\n\t\tif ($wstr = implode(' AND ', $where))\n\t\t{\t$sql .= ' WHERE ' . $wstr;\n\t\t}\n\t\t$sql .= ' ORDER BY orderdate DESC';\n\t\t\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\t$orders[$row['id']] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $orders;\n\t}", "function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}", "public function getTicketOrderInfo() {\n return $this->get(self::TICKET_ORDER_INFO);\n }", "public function getOrders()\n {\n return $this->orders;\n }", "function getTodaysPendingOrder($storeId = null) {\n if ($storeId) {\n App::import('Model', 'Order');\n $this->Order = new Order();\n $current_date = date(\"Y-m-d\", (strtotime($this->storeTimeZone($storeId,'', date('Y-m-d H:i:s')))));\n $totalorders = $this->Order->getTodaysPendingOrder($storeId, $current_date);\n return $totalorders;\n }\n }", "protected function list_orders() {\r\n // Get response\r\n $dt = new DataTableResponse( $this->user );\r\n\r\n $website_order = new WebsiteOrder();\r\n\r\n // Set Order by\r\n $dt->order_by( '`website_order_id`', '`total_cost`', '`status`', '`date_created`' );\r\n $dt->add_where( ' AND `website_id` = ' . (int) $this->user->account->id );\r\n $dt->search( array( '`website_order_id`' => false ) );\r\n\r\n // Get items\r\n $website_orders = $website_order->list_all( $dt->get_variables() );\r\n $dt->set_row_count( $website_order->count_all( $dt->get_count_variables() ) );\r\n\r\n // Set initial data\r\n $data = false;\r\n\r\n /**\r\n * @var WebsiteOrder $order\r\n */\r\n if ( is_array( $website_orders ) )\r\n foreach ( $website_orders as $order ) {\r\n switch ( $order->status ) {\r\n case WebsiteOrder::STATUS_DECLINED:\r\n $status = 'Declined';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_PURCHASED:\r\n $status = 'Purchased';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_PENDING:\r\n $status = 'Pending';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_DELIVERED:\r\n $status = 'Delivered';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_RECEIVED:\r\n $status = 'Received';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_SHIPPED:\r\n $status = 'Shipped';\r\n break;\r\n\r\n default:\r\n $status = 'Error';\r\n break;\r\n }\r\n\r\n $date = new DateTime( $order->date_created );\r\n\r\n $link_text = '';\r\n if ( $order->is_ashley_express() ) {\r\n $link_text = \" - Express Delivery\";\r\n }\r\n\r\n $data[] = array(\r\n '<a href=\"' . url::add_query_arg( 'woid', $order->id, '/shopping-cart/orders/view/' ) . '\" title=\"' . _('View') . '\">' . $order->id . '</a>' . $link_text\r\n , $order->name\r\n , '$' . number_format( $order->total_cost, 2 )\r\n , $status\r\n , $date->format('F jS, Y')\r\n );\r\n }\r\n\r\n // Send response\r\n $dt->set_data( $data );\r\n\r\n return $dt;\r\n }", "public function vendor_orders()\n {\n $query = $this->db->where('vendor_hash', $this->current_user->user_hash)\n ->where('progress >', '0')\n ->order_by('time desc')\n ->get('orders');\n\n if ($query->num_rows() > 0) {\n $row = $query->result_array();\n return $this->build_array($row);\n } else {\n return array();\n }\n }", "public function getHistoricalDailyForTimestamp($options = [])\n {\n return $this->send(\n $this->endpoint.\"/pricehistorical\",\n 'GET',\n ['query' => array_merge($this->getEndpointConfiguration(), $options)]\n );\n }", "function show_estimated_ship_date_under_view_order_for_subscriptions( $order_id ) {\n $order = wc_get_order( $order_id );\n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}", "public static function getLastItemCount($adminId, $hours = 24, $typeId = '') {\n $db = DI::getDefault()->getShared('db');\n\n if($typeId != '' && $typeId >= 1 && $typeId <= 3 ){\n $query = \"SELECT COUNT(`id`) FROM `\" . self::getTableNameStatic() . \"` WHERE `typeId` = ? AND `senderId` = ? AND `regTime` >= ?\";\n $data = $db->query($query, array(Transaction::Type_Withdrawal, $adminId, date('Y-m-d H:i:s', (time() - ($hours * 60 * 60) ) )) )->fetch();\n } else {\n $query = \"SELECT COUNT(`id`) FROM `\" . self::getTableNameStatic() . \"` WHERE `senderId` = ? AND `regTime` >= ?\";\n $data = $db->query($query, array($adminId, date('Y-m-d H:i:s', (time() - ($hours * 60 * 60) ) )) )->fetch();\n }\n return $data[0];\n\n }" ]
[ "0.6115435", "0.5914363", "0.5797083", "0.5697635", "0.5637294", "0.5628435", "0.5624406", "0.5550792", "0.55285096", "0.55255234", "0.5479182", "0.5447161", "0.54254276", "0.5407645", "0.5390537", "0.538642", "0.5371739", "0.53544015", "0.5353523", "0.5353523", "0.53225225", "0.53220654", "0.53074086", "0.5302134", "0.52956986", "0.5294732", "0.52754045", "0.52712536", "0.5268704", "0.5264739", "0.52644426", "0.5258372", "0.52505183", "0.5249359", "0.52381504", "0.52376944", "0.52331996", "0.5217814", "0.5212504", "0.5205869", "0.52055997", "0.5186661", "0.5171783", "0.5170721", "0.5169171", "0.51354504", "0.51309425", "0.51257896", "0.51223606", "0.5120164", "0.51099366", "0.5109244", "0.5105841", "0.5105107", "0.5093112", "0.5074866", "0.5070145", "0.5068096", "0.5067478", "0.5064846", "0.50408584", "0.50322473", "0.5026754", "0.5019677", "0.5019503", "0.50114065", "0.50003904", "0.49997684", "0.49978518", "0.49887434", "0.498322", "0.49829924", "0.497135", "0.49702916", "0.49656212", "0.4964985", "0.49622557", "0.4962085", "0.49598637", "0.49501416", "0.49499813", "0.4942161", "0.4939275", "0.49328005", "0.49306288", "0.4930263", "0.492433", "0.49213415", "0.4918589", "0.49182996", "0.4916546", "0.49115157", "0.4909356", "0.4908255", "0.49066082", "0.4905955", "0.4901047", "0.48989606", "0.48969164", "0.48931023" ]
0.6659961
0
Get order data last 7 days
public function getOrdersDataLast7Days($vendorId) { $to = $this->_date->date('Y-m-d'); $from = strtotime($to."-7days"); $from = $this->_date->date('Y-m-d', $from); $to .= ' 23:59:59'; $orderResource = $this->_vendorOrderFactory->create()->getResource(); $data = $orderResource->getNumOfOrderByDay($from, $to, $vendorId); $result = $this->_processOrderData($data); $result = array_values($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLastSevenDaysRevenue() {\n $userClient = Auth::user()->clientID;\n\n if($userClient == 1) {\n \t\n $result = DB::select(\"SELECT calendar.datefield AS DATE,IFNULL(SUM(r.amount),0) AS total FROM request_logs r RIGHT JOIN calendar ON (DATE(r.date_created) = calendar.datefield) inner join transactions t on t.requestlogID = r.requestlogID inner join client_channels_reference ccr on t.channel_ref_id=ccr.channel_ref_id GROUP BY DATE DESC LIMIT 7\");\n } else {\n\n $result = DB::select(\"SELECT calendar.datefield AS DATE,IFNULL(SUM(r.amount),0) AS total FROM request_logs r RIGHT JOIN calendar ON (DATE(r.date_created) = calendar.datefield) inner join transactions t on t.requestlogID = r.requestlogID inner join client_channels_reference ccr on t.channel_ref_id=ccr.channel_ref_id WHERE ccr.clientID='$userClient' or ccr.destinationClientID='$userClient' GROUP BY DATE DESC LIMIT 7\");\n }\n\n \treturn $result;\n\n }", "public function get_last7Days($type, $array_data, $auth) {\n $date = date('Y-m-d', strtotime('-7 days'));\n $today = date('Y-m-d');\n\n if ($type == 1) {\n\n $exception = '';\n $exception2 = '';\n if ($auth['id'] == '2') {\n $exception = ' AND affiliate=\"0\"';\n //$exception2 = ' WHERE affiliate=\"0\" AND insertDate=\"' . $today . '\"';\n }\n\n //last 7 days\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE insertDate >= \"' . $date . '\"' . $exception . ' GROUP BY insertDate');\n\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n /*\n //today\n //clicks\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, SUM( clicks ) AS clicks FROM MainReport INNER JOIN Sources ON source=Sources.id ' . $exception2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n //conversions\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id ' . $exception2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n /*\n //last 7 days\n $statement = $this->getDi()->getDb()->prepare('SELECT insert_date as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM Agr__MainReport INNER JOIN tinas__Sources ON source=tinas__Sources.id WHERE insert_date >= \"' . $date . '\"' . $exception . ' GROUP BY insert_date');\n\n $exe = $this->getDi()->getDb()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n //today\n //clicks\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS clicks FROM ClicksDaily INNER JOIN Sources ON fkSource=Sources.id ' . $exception2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n //conversions\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS conversions, SUM( ccpa ) AS revenue FROM ConversionsDaily INNER JOIN Sources ON fkSource=Sources.id ' . $exception2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n\n foreach ($array_ret as $key => $value) {\n $cr = $value['conversions'] / $value['clicks'];\n\n $array_ret[$key]['cr'] = $cr;\n\n $array_ret[$key]['revenue'] = number_format($array_ret[$key]['revenue'], 2, '.', '');\n $array_ret[$key]['cr'] = number_format($array_ret[$key]['cr'] * 100, 3, '.', '');\n }\n\n //$cr = $array_ret_conversions[0]['conversions'] / $array_ret_clicks[0]['clicks'];\n //array_push($array_ret, array('date' => $array_ret_clicks[0]['date'] , 'clicks' => $array_ret_clicks[0]['clicks'], 'conversions' => $array_ret_conversions[0]['conversions'], 'revenue' => number_format($array_ret_conversions[0]['revenue'], 2, '.', ''), 'cr' => $cr * 100));\n\n return $array_ret;\n } else if ($type == 2) {\n\n $sql = '';\n\n if ($array_data[0]['sources'] != '') {\n $sources = str_replace(',', '\",\"', $auth['sources']);\n $sources = ' AND source IN (\"' . $sources . '\")';\n $sql .= $sources;\n }\n\n if ($array_data[0]['countries'] != '') {\n $countries = str_replace(',', '\",\"', $auth['countries']);\n $countries = ' AND campaign_country IN (\"' . $countries . '\")';\n $sql .= $countries;\n }\n\n if ($array_data[0]['aggregators'] != '') {\n $aggregators = str_replace(',', '\",\"', $auth['aggregators']);\n $aggregators = ' AND agregator IN (\"' . $aggregators . '\")';\n $sql .= $aggregators;\n }\n\n /*\n //last 7 days\n\n $statement = $this->getDi()->getDb()->prepare('SELECT insert_date as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM Agr__MainReport INNER JOIN tinas__Sources ON source=tinas__Sources.id WHERE insert_date >= \"' . $date . '\" ' . $sql . ' AND affiliate=\"0\" GROUP BY insert_date');\n $exe = $this->getDi()->getDb()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n */\n\n //last 7 days\n $sqlstr = 'SELECT insertDate as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE insertDate >= \"' . $date . '\" ' . $sql . ' AND affiliate=\"0\" GROUP BY insertDate';\n //mail('[email protected]', 'str', $sqlstr);\n $statement = $this->getDi()->getDb4()->prepare($sqlstr);\n\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n /*\n //today\n //clicks\n $sql = '';\n if($array_data[0]['sources'] != '') {\n $sources = str_replace(',', '\",\"', $auth['sources']);\n $sources = (($sql != \"\")) ? (' AND source IN (\"' . $sources . '\")') : (' WHERE source IN (\"' . $sources . '\")');\n $sql .= $sources;\n }\n\n if($array_data[0]['countries'] != '') {\n $countries = str_replace(',', '\",\"', $auth['countries']);\n $countries = (($sql != \"\")) ? (' AND campaign_country IN (\"' . $countries . '\")') : (' WHERE campaign_country IN (\"' . $countries . '\")');\n $sql .= $countries;\n }\n\n if($array_data[0]['aggregators'] != '') {\n $aggregators = str_replace(',', '\",\"', $auth['aggregators']);\n $aggregators = (($sql != \"\")) ? (' AND agregator IN (\"' . $aggregators . '\")') : (' WHERE agregator IN (\"' . $aggregators . '\")');\n $sql .= $aggregators;\n }\n\n $date = (($sql != \"\")) ? (' AND insertDate=\"' . $today . '\"') : (' WHERE insertDate =\"' . $today . '\"');\n $sql .= $date;\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS clicks FROM MainReport ' . $sql);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS clicks FROM ClicksDaily ' . $sql);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n //conversions\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS conversions, SUM( ccpa ) AS revenue FROM ConversionsDaily ' . $sql);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n //conversions\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS conversions, SUM( revenue ) AS revenue FROM MainReport ' . $sql);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n foreach ($array_ret as $key => $value) {\n $cr = $value['conversions'] / $value['clicks'];\n\n $array_ret[$key]['cr'] = $cr;\n\n $array_ret[$key]['revenue'] = number_format($array_ret[$key]['revenue'], 2, '.', '');\n $array_ret[$key]['cr'] = number_format($array_ret[$key]['cr'] * 100, 3, '.', '');\n }\n\n //$cr = ($array_ret_clicks[0]['clicks'] == 0) ? 0 : ($array_ret_conversions[0]['conversions'] / ($array_ret_clicks[0]['clicks']));\n //array_push($array_ret, array('date' => $array_ret_clicks[0]['date'] , 'clicks' => $array_ret_clicks[0]['clicks'], 'conversions' => $array_ret_conversions[0]['conversions'], 'revenue' => number_format($array_ret_conversions[0]['revenue'], 2, '.', ''), 'cr' => $cr * 100));\n\n return $array_ret;\n } else if ($type == 3) {\n //last 7 days\n /*\n $statement = $this->getDi()->getDb()->prepare('SELECT insert_date as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM Agr__MainReport INNER JOIN tinas__Sources ON source=tinas__Sources.id WHERE insert_date >= \"' . $date . '\" AND affiliate=\"1\" GROUP BY insert_date');\n $exe = $this->getDi()->getDb()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE insertDate >= \"' . $date . '\" AND affiliate=\"1\" GROUP BY insertDate');\n\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n /*\n //today\n //clicks\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS clicks FROM ClicksDaily INNER JOIN Sources ON fkSource=Sources.id WHERE affiliate=\"1\"');\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS clicks FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE affiliate=\"1\" AND insertDate=\"' . $today . '\"');\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n //conversions\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS conversions, SUM( ccpa ) AS revenue FROM ConversionsDaily INNER JOIN Sources ON fkSource=Sources.id WHERE affiliate=\"1\"');\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE affiliate=\"1\" AND insertDate=\"' . $today . '\"');\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n foreach ($array_ret as $key => $value) {\n $cr = $value['conversions'] / (($value['clicks'] == 0) ? 1 : $value['clicks']);\n\n $array_ret[$key]['cr'] = $cr;\n\n $array_ret[$key]['revenue'] = number_format($array_ret[$key]['revenue'], 2, '.', '');\n $array_ret[$key]['cr'] = number_format($array_ret[$key]['cr'] * 100, 3, '.', '');\n }\n\n //$cr = ($array_ret_clicks[0]['clicks'] == 0) ? 0 : ($array_ret_conversions[0]['conversions'] / ($array_ret_clicks[0]['clicks']));\n //array_push($array_ret, array('date' => $array_ret_clicks[0]['date'] , 'clicks' => $array_ret_clicks[0]['clicks'], 'conversions' => $array_ret_conversions[0]['conversions'], 'revenue' => number_format($array_ret_conversions[0]['revenue'], 2, '.', ''), 'cr' => $cr * 100));\n\n return $array_ret;\n } else if ($type == 4) {\n\n\n $sqlDb = '';\n $sqlDb2 = '';\n if ($array_data[0]['sources'] != '') {\n $sources = str_replace(',', '\",\"', $auth['sources']);\n $sqlDb .= ' AND source IN (\"' . $sources . '\") ';\n //$sqlDb2 .= ' AND source IN (\"' . $sources . '\") AND insertDate=\"' . $today . '\"';\n }\n\n //last 7 days\n /*\n $statement = $this->getDi()->getDb()->prepare('SELECT insert_date as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM Agr__MainReport INNER JOIN tinas__Sources ON source=tinas__Sources.id WHERE insert_date >= \"' . $date . '\" AND affiliate=\"2\" ' . $sqlDb . ' GROUP BY insert_date');\n $exe = $this->getDi()->getDb()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE insertDate >= \"' . $date . '\" AND affiliate=\"2\" ' . $sqlDb . ' GROUP BY insertDate');\n\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n /*\n //today\n //clicks\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS clicks FROM ClicksDaily INNER JOIN Sources ON fkSource=Sources.id WHERE affiliate=\"2\" ' . $sqlDb2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS clicks FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE affiliate=\"2\" ' . $sqlDb2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n //conversions\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS conversions, SUM( ccpa ) AS revenue FROM ConversionsDaily INNER JOIN Sources ON fkSource=Sources.id WHERE affiliate=\"2\" ' . $sqlDb2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE affiliate=\"2\" ' . $sqlDb2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n foreach ($array_ret as $key => $value) {\n $cr = $value['conversions'] / (($value['clicks'] == 0) ? 1 : $value['clicks']);\n\n $array_ret[$key]['cr'] = $cr;\n\n $array_ret[$key]['revenue'] = number_format($array_ret[$key]['revenue'], 2, '.', '');\n $array_ret[$key]['cr'] = number_format($array_ret[$key]['cr'] * 100, 3, '.', '');\n }\n\n //$cr = $array_ret_conversions[0]['conversions'] / $array_ret_clicks[0]['clicks'];\n //array_push($array_ret, array('date' => $array_ret_clicks[0]['date'] , 'clicks' => $array_ret_clicks[0]['clicks'], 'conversions' => $array_ret_conversions[0]['conversions'], 'revenue' => number_format($array_ret_conversions[0]['revenue'], 2, '.', ''), 'cr' => $cr * 100));\n\n return $array_ret;\n } else if ($type == 5) {\n\n $sqlDb = '';\n $sqlDb2 = '';\n if ($array_data[0]['aggregators'] != '') {\n $aggregators = str_replace(',', '\",\"', $auth['aggregators']);\n $sqlDb .= ' AND agregator IN (\"' . $aggregators . '\") ';\n //$sqlDb2 .= ' WHERE agregator IN (\"' . $aggregators . '\") AND insertDate=\"' . $today . '\"';\n }\n\n //last 7 days\n /*\n $statement = $this->getDi()->getDb()->prepare('SELECT insert_date as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM Agr__MainReport WHERE insert_date >= \"' . $date . '\" ' . $sqlDb . ' GROUP BY insert_date');\n $exe = $this->getDi()->getDb()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n $sqlstr = 'SELECT insertDate as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE insertDate >= \"' . $date . '\" ' . $sqlDb . ' GROUP BY insertDate';\n $statement = $this->getDi()->getDb4()->prepare($sqlstr);\n //mail('[email protected]', 'sql', $sqlstr);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n /*\n //today\n //clicks\n\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS clicks FROM ClicksDaily INNER JOIN Sources ON fkSource=Sources.id ' . $sqlDb2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS clicks FROM MainReport INNER JOIN Sources ON source=Sources.id ' . $sqlDb2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n //conversions\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS conversions, SUM( ccpa ) AS revenue FROM ConversionsDaily INNER JOIN Sources ON fkSource=Sources.id ' . $sqlDb2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id ' . $sqlDb2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n foreach ($array_ret as $key => $value) {\n $cr = $value['conversions'] / (($value['clicks'] == 0) ? 1 : $value['clicks']);\n\n $array_ret[$key]['cr'] = $cr;\n\n $array_ret[$key]['revenue'] = number_format($array_ret[$key]['revenue'], 2, '.', '');\n $array_ret[$key]['cr'] = number_format($array_ret[$key]['cr'] * 100, 3, '.', '');\n }\n\n //$cr = $array_ret_conversions[0]['conversions'] / $array_ret_clicks[0]['clicks'];\n //array_push($array_ret, array('date' => $array_ret_clicks[0]['date'] , 'clicks' => $array_ret_clicks[0]['clicks'], 'conversions' => $array_ret_conversions[0]['conversions'], 'revenue' => number_format($array_ret_conversions[0]['revenue'], 2, '.', ''), 'cr' => $cr * 100));\n\n return $array_ret;\n }\n }", "public function getTodayRevisitOrders()\n {\n return \\DB::select(\"SELECT a.id, a.propaddress1, a.propaddress2, a.propcity, a.propstate, a.propzip, s.descrip as status_name FROM appr_dashboard_delay_order d LEFT JOIN appr_order a ON (a.id=d.orderid) LEFT JOIN order_status s ON (a.status=s.id) WHERE d.created_date BETWEEN :from AND :to AND d.delay_date BETWEEN :t AND :b\", [':from' => strtotime('today'), ':to' => strtotime('tomorrow'), ':t' => strtotime('today'), ':b' => strtotime('tomorrow')]);\n }", "public function getTransactionDataLast7Days($customerId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-7days\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $transactionResource = $this->_transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByDay($from, $to, $customerId);\n $result = $this->_processReceivedTransactionData($data, $result);\n \n $data = $transactionResource->getSpentCreditTransactionsByDay($from, $to, $customerId);\n $result = $this->_processSpentTransactionData($data, $result);\n \n $result = array_values($result);\n return $result;\n }", "function getReportLastWeek(){\n global $db;\n \n $get = getWeekSale();//Pulls most recent week from purchasing table\n $week = $get['week'];\n \n $stmt=$db->prepare(\"SELECT week, SUM(expense) AS 'expense', SUM(revenue) AS 'revenue' FROM invoices WHERE week = :week\");\n \n $binds=array(\n \":week\"=>$week\n );\n $results= false;\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n }\n return $results;\n }", "function get_recent_orders(){\n\t $orders = $this->Order->get_recent_orders();\n\t if($this->params['requested']){\n\t return $orders;\n\t }else{\n\t $this->set('orders', $orders);\n\t }\n \n\t}", "public function getFutureRevisitOrders()\n {\n return \\DB::select(\"SELECT a.id, a.propaddress1, a.propaddress2, a.propcity, a.propstate, a.propzip, s.descrip as status_name FROM appr_dashboard_delay_order d LEFT JOIN appr_order a ON (a.id=d.orderid) LEFT JOIN order_status s ON (a.status=s.id) WHERE d.created_date BETWEEN :from AND :to AND d.delay_date > :today\", [':from' => strtotime('today'), ':to' => strtotime('tomorrow'), ':today' => strtotime('tomorrow')]);\n }", "public function getAmountsDataLast7Days($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-7days\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getAmountsByDay($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "function showLast7($data){\ntry{\n $sym = $data[\"Symbol\"];\n $symbol = getInfo($sym);\n $newObj = json_decode($symbol);\n\n //How many days are we returning?\n $days = 7;\n\n $Close = array();\n\n //Populate a new object with the necesary information\n for ($i = 0; $i < 7;$i++)\n {\n array_push($Close, $newObj->Close[$i]); \n }\n} catch (Exception $e){\n echo \"Error : \" . $e->getMessage();\n }\n return json_encode($Close);\n}", "function getOrdersData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n $total=0;\n if($varAction=='today' || $varAction=='yesterday'){\n if($varAction=='today'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n \n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $arrClms = array('TIME(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded < \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$i]['time'][]=$arrData;\n $arrRes['data'][$i]['count']=$count;\n $total +=$count;\n }\n $arrRes['total']=$total;\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_week'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$count;\n $total +=$count;\n }\n $arrRes['total']=$total;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_month'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $lastMonth.'=='.$lastMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$count;\n $total +=$count; \n }\n $arrRes['total']=$total;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "public function f_get_woDtls()\n {\n\n $sql = $this->db->query(\"SELECT DISTINCT order_no, order_dt FROM td_dm_work_order \");\n return $sql->result();\n\n }", "public static function getLastSevenDays()\n {\n $arrDuration = [];\n $previous_week = strtotime(\"-1 week +1 day\");\n\n for($i = 0; $i < 7; $i++)\n {\n $arrDuration[date('Y-m-d', $previous_week)] = date('D', $previous_week);\n $previous_week = strtotime(date('Y-m-d', $previous_week) . \" +1 day\");\n }\n\n return $arrDuration;\n }", "public static function getRecentDoneOrders() {\n\n\t\treturn Order::fullActive()\n\t\t\t\t\t->where('state', '=', '3')\n\t\t\t\t\t->orderBy('date', 'desc')\n\t\t\t\t\t->take(10)\n\t\t\t\t\t->get();\n\t}", "public function getRecurringOrders();", "public function weekly_deposits()\n\t{\n\t\t// $date->format('Y-m-d'); \n\n\t\t// $date = strtotime(\"-6 day\");\n\t\t // date(\"Y-m-d\", $date);\n\t\t \n\t\t$today = date(\"Y-m-d\");\n\t\t$newDate = date(\"Y-m-d\",strtotime($today.\"-6 day\"));\n\t\t\n\t\t//`date_transaction` BETWEEN '$newDate' AND '$today'\n\t\t//OR\n\t\t//`date_transaction` > DATE_SUB(NOW(), INTERVAL 1 WEEK)\t\n\t\t\n\t\t$query = $this->db->prepare(\"SELECT * FROM `statement` WHERE `credit` <> 0 AND `date_transaction` > DATE_SUB(NOW(), INTERVAL 1 WEEK) ORDER BY `date_transaction` DESC\");\n\n\t\ttry{\n\t\t\t\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchAll();\n\t\t\t\n\t\t\t\n\t\t}catch(PDOException $e){\n\t\t\tdie($e->getMessage());\n\t\t}\n\n\t}", "public function findDataLast()\n {\n return $this->getEntityManager()\n ->createQuery(\"SELECT DISTINCT t.number, f.id as finance, f.price as cost, f.gotcarq as gotcarqId\n FROM GazMainBundle:Terminal t\n JOIN GazMainBundle:Finance f WITH f.terminal = t\n\t\t\t\t\t\t\tWHERE (f.gotcarq IS NOT NULL AND f.gotcarq != 0)\n\t\t\t\t\t\t\t AND f.created = (SELECT MIN(f1.created) FROM GazMainBundle:Finance f1\n LEFT JOIN f1.terminal t1\n WHERE t1.id = t.id AND f1.financeType = FALSE)\n\t\t\t\t\t\t\tORDER BY t.number ASC\n \")\n ->getResult();\n }", "public function getDataWeek()\n {\n return $this->model()->where('created_at', '>=', Carbon::now()->startOfWeek())->get();\n }", "public function notificacionesExpiradas()\n\t{\n\t\t$fechahoy = Carbon::now()->toDateString();\n\n\t\t$notificaciones = Notificacion::where('expiradate','<', $fechahoy)->orWhere('estatus_visto','=',\"visto\")->get();\n\n\t\treturn $notificaciones;\n\t}", "public function getAllDeliveriesExpired() //get delivery more than 3 days not received by toko\n {\n // join sma_sales on sma_deliveries.sale_id = sma_sales.id and sma_sales.client_id = \"aksestoko\"\n // where DATE(sma_deliveries.date + INTERVAL 3 DAY) < current_date\n $this->db->select('sma_deliveries.id as do_id, sma_deliveries.do_reference_no as do_ref, sma_purchases.id as purchase_id');\n $this->db->join('sma_sales', 'sma_deliveries.sale_id = sma_sales.id and sma_sales.client_id = \"aksestoko\"');\n $this->db->join('sma_purchases', 'sma_purchases.cf1 = sma_sales.reference_no and sma_purchases.supplier_id = sma_sales.biller_id');\n $this->db->where('DATE(sma_deliveries.date + INTERVAL 3 DAY) < NOW() AND sma_deliveries.date > \"2019-08-01\" AND sma_deliveries.receive_status is null');\n $q = $this->db->get('sma_deliveries');\n if ($q->num_rows() > 0) {\n return $q->result();\n }\n return [];\n }", "public function getLastOrder();", "public function recent()\n {\n $this->options['WHERE'] = 'created_at >= ADDDATE( NOW( ) , INTERVAL -1 WEEK )';\n $this->options['ORDER BY'] = 'created_at DESC';\n return $this;\n }", "function getAttnDataLast(){\n\t\t\n\t\t$lim= isset($_REQUEST['limit'])?$_REQUEST['limit']:'0';\n\t\t$orgid = isset($_REQUEST['refno'])?$_REQUEST['refno']:'0';\n\t\t$datafor= isset($_REQUEST['datafor'])?$_REQUEST['datafor']:'';\n\t\t//$datafor= isset($_REQUEST['datafor'])?$_REQUEST['datafor']:'';\n\t\t$zone = getTimeZone($orgid);\n date_default_timezone_set($zone);\n\t\t$end = date(\"Y-m-d\");\n $start = date(\"Y-m-d\");\n\t\t$data=array();\n\t\tif($lim=='l7'){ // Last 7 days\n\t\t\t$end = date(\"Y-m-d\", strtotime(\"-1 days\"));\n\t\t\t$end1 = date(\"Y-m-d\", strtotime(\"-1 days\"));\n $start = date(\"Y-m-d\", strtotime('-6 day', strtotime($end)));\n $start1 = date(\"Y-m-d\", strtotime('-6 day', strtotime($end)));\n\t\t\t$start = \\DateTime::createFromFormat('Y-m-d', $start);\n $end = \\DateTime::createFromFormat('Y-m-d', $end);\n\t\t}else if($lim=='l30'){ // Last 30 days\n\t\t\t$end = date(\"Y-m-d\", strtotime(\"-1 days\"));\n $start = date(\"Y-m-d\", strtotime('-29 day', strtotime($end)));\n\t\t\t$end1 = date(\"Y-m-d\", strtotime(\"-1 days\"));\n $start1 = date(\"Y-m-d\", strtotime('-29 day', strtotime($end)));\n\t\t\t$start = \\DateTime::createFromFormat('Y-m-d', $start);\n $end = \\DateTime::createFromFormat('Y-m-d', $end);\n\t\t}\n\t\t$datePeriod = new \\DatePeriod($start, new \\DateInterval('P1D'), $end->modify('+1day'));\n\t\t///////getting data\n\t\t\t\n\t\t\tif($datafor=='present'){\n\t\t\t\t$res = array();\n\t\t\t\tforeach ($datePeriod as $date) {\n\t\t\t\t\t$dt = $date->format('Y-m-d');\n\t\t\t\t\t$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , `TimeIn`, `TimeOut` ,AttendanceDate FROM `AttendanceMaster` WHERE `AttendanceDate` ='\" . $dt . \"' and `OrganizationId`=\" . $orgid . \" and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = $orgid AND Is_Delete = 0) order by DATE(AttendanceDate) desc,name\");\n\t\t\t\t\t//$res[] = $query->result();\n\t\t\t\t\t$data['elist'][] = $query->result();\n\t\t\t\t}\n\t\t\t}else if($datafor=='absent'){\n\t\t\t\t$res = array();\n\n\t\t\t\t$query = $this->db->query(\"SELECT EmployeeId , AttendanceDate FROM `AttendanceMaster` WHERE OrganizationId = ? and AttendanceStatus in (2,6,7) and `AttendanceDate` between ? and ? AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = $orgid AND Is_Delete = 0) order by AttendanceDate \", array($orgid , $start1 , $end1));\n\t\t\t\tforeach ($query->result() as $row) {\n\t\t\t\t\t\t\t$data1 = array();\n\t\t\t\t\t\t\t//$data['name']=ucwords(getEmpName($row->Id));\n\t\t\t\t\t\t\t$data1['name'] = getEmpName($row->EmployeeId);\n\t\t\t\t\t\t\t$data1['AttendanceDate'] = date(\"Y-m-d\", strtotime($row->AttendanceDate));\n\t\t\t\t\t\t\t$data1['TimeIn'] = '-';\n\t\t\t\t\t\t\t$data1['TimeOut'] = '-';\n\t\t\t\t\t\t\t$res[] = $data1;\n\t\t\t\t\t\t}\n\t\t\t\t$data['elist'][] =array_reverse($res);\n\t\t\t}else if($datafor=='latecomings'){\n\t\t\t\t$res = array();\n\t\t\t\tforeach ($datePeriod as $date) {\n\t\t\t\t\t$dt = $date->format('Y-m-d');\n\t\t\t\t\t$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , `TimeIn`, `TimeOut` ,AttendanceDate FROM `AttendanceMaster` WHERE (time(TimeIn) > (select time(TimeIn) from ShiftMaster where ShiftMaster.Id=shiftId)) and `AttendanceDate` ='\" . $dt . \"' and `OrganizationId`=\" . $orgid . \" and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = $orgid AND Is_Delete = 0) order by DATE(AttendanceDate) desc,name\");\n\t\t\t\t\t$res[] = $query->result();\n\t\t\t\t}\n\t\t\t\t$data['elist'] = $res;\n\t\t\t}else if($datafor=='earlyleavings'){\n\t\t\t\t$res = array();\n\t\t\t\tforeach ($datePeriod as $date) {\n\t\t\t\t\t$dt = $date->format('Y-m-d');\n\t\t\t\t\t\t$query = $this->db->query(\"select Shift,Id , FirstName , LastName from EmployeeMaster where OrganizationId = $orgid and Id IN (select EmployeeId from AttendanceMaster where OrganizationId = $orgid and AttendanceDate='$dt ' and TimeIn != '00:00:00' ) AND is_Delete=0 order by FirstName\");\n\t\t\t\t\t $innerarr = array();\n\t\t\t\t\t $cond = '';\n\t\t\t\t\tforeach ($query->result() as $row) {\n\t\t\t\t\t\t$ShiftId = $row->Shift;\n\t\t\t\t\t\t$EId = $row->Id;\n\t\t\t\t\t\t$query = $this->db->query(\"select TimeIn,TimeOut,shifttype from ShiftMaster where Id = $ShiftId\");\n\t\t\t\t\t\tif ($data123 = $query->row()) {\n\t\t\t\t\t\t\t$shiftout = $data123->TimeOut;\n\t\t\t\t\t\t\t$shiftout1 = $dt. ' '.$data123->TimeOut;\n\t\t\t\t\t\t\tif($data123->shifttype==2)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$nextdate = date('Y-m-d',strtotime($dt . \"+1 days\"));\n\t\t\t\t\t\t\t\t $shiftout1 = $nextdate.' '.$data123->TimeOut;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$shift = substr($data123->TimeIn, 0, 5) . ' - ' . substr($data123->TimeOut, 0, 5);\n\t\t\t\t\t\t\t$ct = date('H:i:s');\n\t\t\t\t\t\t\t\t$query333 = $this->db->query(\"select SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out from AttendanceMaster where EmployeeId =$EId and if(timeoutdate = '0000-00-00' , TimeOut < '$shiftout' , CONCAT(timeoutdate,' ' ,TimeOut) < '$shiftout1' ) and AttendanceDate='$dt' and TimeOut !='00:00:00' \");\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\tif ($row333 = $query333->row()) {\n\t\t\t\t\t\t\t\t\t$a = new DateTime($row333->TimeOut);\n\t\t\t\t\t\t\t\t\t$b = new DateTime($data123->TimeOut);\n\t\t\t\t\t\t\t\t\t$interval = $a->diff($b);\n\t\t\t\t\t\t\t\t\t$data1['earlyby'] = $interval->format(\"%H:%I\");\n\t\t\t\t\t\t\t\t\t$data1['timeout'] = substr($row333->TimeOut, 0, 5);\n\t\t\t\t\t\t\t\t\t$data1['name'] = $row->FirstName . ' ' . $row->LastName;\n\t\t\t\t\t\t\t\t\t$data1['shift'] = $shift;\n\t\t\t\t\t\t\t\t\t$data1['status'] = $row333->status;\n\t\t\t\t\t\t\t\t\t$data1['TimeIn'] = $row333->TimeIn;\n\t\t\t\t\t\t\t\t\t$data1['TimeOut'] = $row333->TimeOut;\n\t\t\t\t\t\t\t\t\t$data1['AttendanceDate'] = $dt;\n\t\t\t\t\t\t\t\t\t$innerarr[] = $data1;\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$res[] = $innerarr;\n\t\t\t\t}\n\t\t\t\t$data['elist'] = $res;\n\t\t\t}\n\t\t\t\n\t\t///////getting data/\n\t\techo json_encode($data);\n\t\t////////////\n\n\t}", "public function get_last_ten_entries()\r\n\t{\r\n\t\t$query = $this->db->get(\"email_workflow\", 10);\r\n\r\n\t\treturn $query->result();\r\n\t}", "public static function Get_four_Notify()\n{\n $notfit= NotificationBackent::where('seen',0)->orderBy('created_at','desc')->take(7)->get();\n return $notfit;\n}", "public function searchDate(Request $request){\n \n $date = $request->order_date;\n $newdate = new DateTime($date);\n $get_date = $newdate->format('d F Y');\n $result = Order::with('customer')->where('order_date',$get_date)->latest()->get();\n return response()->json($result);\n\n }", "private function data()\n {\n return [\n 'start_date'=>date('Y-m-d', strtotime('-7 days')),\n 'end_date'=>date('Y-m-d')\n ];\n }", "function getProfitLastWeek(){\n global $db;\n \n $get = getWeek();//Pulls most recent week from purchasing table\n $week = $get['week'];\n \n $stmt=$db->prepare(\"SELECT SUM(revenue) - SUM(expense) AS 'profit' FROM invoices WHERE week = :week\");\n \n $binds=array(\n \":week\"=>$week\n );\n $results= false;\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n }\n return $results;\n }", "function getFilterDatePast($top){\n\tif(!$top)\n\t\t$top=20;\n\n\t$data = M('event');\n\t$date_set = Array();\n\t$condition = Array('event_date' => Array('elt', todayDate()));\n\t$result = $data->where($condition)->group('event_date')->limit($top)->order('event_date desc')->select();\n\tforeach($result as $value)\n\t\tarray_push($date_set, $value['event_date']);\n\n\treturn $date_set;\n}", "function get_pnh_unorderdfran()\r\n\t{\r\n\t\t$unorderd_fran_res=$this->db->query(\"SELECT DISTINCT b.pnh_franchise_id,a.franchise_id,b.franchise_name,login_mobile1,login_mobile2,actiontime,FROM_UNIXTIME(actiontime,'%d/%m/%Y %h:%i %p') AS last_orderd\r\n\t\t\t\tFROM king_transactions a\r\n\t\t\t\tRIGHT JOIN `pnh_m_franchise_info`b ON b.franchise_id=a.franchise_id\r\n\t\t\t\tWHERE a.is_pnh=1 AND FROM_UNIXTIME(init)<=(CURDATE()-INTERVAL 7 DAY)\r\n\t\t\t\tGROUP BY pnh_franchise_id\r\n\t\t\t\t\");\r\n\t\tif($unorderd_fran_res->num_rows())\r\n\t\t{\r\n\t\t\treturn $unorderd_fran=$unorderd_fran_res->result_array();\r\n\t\t\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "public static function getOrderHistoryOfUser() {\n return $allOrders = Order::where(\"user_id\", Auth::id())\n ->select(\"*\")->orderBy(\"created_at\", \"desc\")->get();\n }", "function previousWeek(){ return $this->_getDate(-7); }", "public function upcomingDebit()\n {\n $where = \"(SELECT DATEDIFF(so.`due_date`, '$this->curDate') AS days) < 14 AND so.`status_paid` = 0 AND so.active = 1\";\n $so = $this->db\n ->from('sales_order so')\n ->join('customer c', 'c.id_customer = so.id_customer')\n ->where($where)\n ->order_by('so.id_sales_order asc')\n ->get()\n ->result();\n\n return $so;\n }", "public function getExpiringSoon()\n {\n return Item::join('item_batches', 'items.id', '=', 'item_batches.item_id')\n ->join('measurement_units', 'items.unit_id', '=', 'measurement_units.id')\n ->where('item_batches.expiry_date', '<', Carbon::now()->addMonths(3))\n ->where('item_batches.expiry_date', '>', Carbon::now())\n ->where('item_batches.current_quantity', '!=', 0)\n ->select('items.description', 'item_batches.current_quantity', 'measurement_units.short_name', 'item_batches.expiry_date')\n ->get();\n }", "public function get_latest_orders()\n\t{\n\t\t$where = 'orders.order_status_id != 4 AND orders.order_status_id = order_status.order_status_id AND customer.customer_id = orders.customer_id AND orders.vendor_id = '.$this->session->userdata('vendor_id');\n\t\t$table = 'orders, order_status, customer';\n\t\t\n\t\t//retrieve all orders\n\t\t$this->db->from($table);\n\t\t$this->db->select('orders.*, orders.order_status_id AS status,customer.customer_first_name AS first_name, customer.customer_surname AS other_names, order_status.order_status_name');\n\t\t$this->db->where($where);\n\t\t$this->db->order_by('orders.order_created', 'DESC');\n\t\t$query = $this->db->get('', 20);\n\t\t\n\t\treturn $query;\n\t}", "public function futureRevisit()\n {\n return \\DB::selectOne(\"SELECT COUNT(id) as total FROM appr_dashboard_delay_order WHERE created_date BETWEEN :from AND :to AND delay_date > :today\", [':from' => strtotime('today'), ':to' => strtotime('tomorrow'), ':today' => strtotime('tomorrow')])->total;\n }", "public function getTimesheetRecent(){\n $emp_id = Auth::user()->id;\n $data['response'] = $this->timesheet->getInformRecent($emp_id);\n $data = $this->formatDate($data);\n return $data;\n }", "public function findLatest(): array\n {\n\n return $this->createQueryBuilder('p')\n ->orderBy('p.created_at', 'DESC')\n ->setMaxResults(8)\n ->getQuery()\n ->getResult();\n }", "public function getThrendsDaily(Request $request) {\n\n\n if (($request->has('fr') && $request->has('to')) && (is_iso_date($request->input('fr')) && is_iso_date($request->input('to')))) {\n\n $this->dr->fr = carbonCheckorNow($request->input('fr'));\n $this->dr->to = carbonCheckorNow($request->input('to'));\n\n if ($this->dr->fr->gt($this->dr->to))\n return 'fr is gt to';\n\n $len = $this->dr->to->diffInDays($this->dr->fr);\n } else {\n\n $date = carbonCheckorNow($request->input('date'));\n $len = 6;\n if ($request->has('len') && $request->input('len')>0 && $request->input('len')<90)\n $len = $request->input('len');\n\n $this->dr->to = $date;\n $this->dr->fr = $date->copy()->subDays($len);\n } \n\n $datas = [];\n\n\n // return $this->dr->to->diffInDays($this->dr->fr);\n\n // return $this->dr->fr;\n // return $this->dr->fr->copy()->subDay();\n\n $dailysales = $this->repo\n // ->skipCache()\n ->getAllByDr($this->dr->fr->copy()->subDay(), $this->dr->to, ['sales', 'branchid', 'date']);\n\n // $branchs = \\App\\Models\\Boss\\Branch::select(['code', 'descriptor', 'id'])->active()->orderBy('code')->get();\n $branchs = \\App\\Models\\Branch::select(['code', 'descriptor', 'id'])->whereIn('id', collect($dailysales->pluck('branchid'))->unique()->toArray())->orderBy('code')->get();\n\n foreach($branchs as $key => $branch) {\n $datas[$key]['code'] = $branch->code;\n $datas[$key]['descriptor'] = $branch->descriptor;\n\n $to_date = $this->dr->to->copy();\n for ($i=0; $i<=$len+1; $i++) {\n $to = $to_date->copy()->subDay($i);\n \n $datas[$key]['dss'][$i]['date'] = $to;\n\n $filtered = $dailysales->filter(function ($item) use ($to, $branch) {\n return ($item->branchid == $branch->id) && ($item->date->format('Y-m-d') == $to->format('Y-m-d'))\n ? $item : null;\n });\n\n $f = $filtered->first();\n\n $datas[$key]['dss'][$i]['sales'] = is_null($f) ? NULL : $f->sales;\n }\n }\n\n\n // return $datas;\n\n\n foreach($datas as $j => $data) {\n foreach($data['dss'] as $k => $ds) {\n if ($k==0 && is_null($datas[$j]['dss'][$k]['sales'])) {\n $prev_sales = NULL;\n } else {\n if (($k)<=$len)\n $prev_sales = is_null($datas[$j]['dss'][($k+1)]['sales']) ? 0 : $datas[$j]['dss'][($k+1)]['sales'];\n else\n $prev_sales = 0;\n }\n $datas[$j]['dss'][$k]['prev_sales'] = $prev_sales;\n $datas[$j]['dss'][$k]['diff'] = $datas[$j]['dss'][$k]['sales'] - $prev_sales;\n $datas[$j]['dss'][$k]['pct'] = $prev_sales>0 ? ($datas[$j]['dss'][$k]['diff']/$prev_sales)*100 : 0;\n }\n }\n\n foreach($datas as $l => $data) {\n unset($datas[$l]['dss'][$len+1]);\n }\n\n // return $datas;\n\n /*\n if (!in_array($request->user()->id, ['41F0FB56DFA811E69815D19988DDBE1E', '11E943EA14DDA9E4EAAFBD26C5429A67'])) {\n\n $email = [\n 'body' => $request->user()->name.' '.$this->dr->fr->format('Y-m-d').' '.$this->dr->to->format('Y-m-d')\n ];\n\n \\Mail::queue('emails.notifier', $email, function ($m) {\n $m->from('[email protected]', 'GI App - Boss');\n $m->to('[email protected]')->subject('Sales Trend');\n });\n }\n */\n\n\n $view = view('report.trends-all-daily')\n ->with('datas', $datas);\n return $this->setViewWithDR($view);\n\n return $datas[0]['dss'];\n }", "private function getTempExtremsToday() {\n //get last update date\n $update = explode(\" \", $this->lastUpdateStr())[0];\n\n $statement = $this->db->prepare('SELECT max(\"amount\") as \"high\", min(\"amount\") as \"low\" FROM \"temperature\" WHERE date(\"created\") = ?');\n $statement->bindValue(1, $update);\n $result = $statement->execute();\n return $result->fetchArray(SQLITE3_ASSOC);\n }", "public function order()\n {\n return 7;\n }", "public function scopeLastWeek($query)\n {\n return $query->whereBetween('posted_at', [Carbon::now()->subWeek(), Carbon::now()])\n ->latest();\n }", "function get_delivery_date_withing_week_page($cDate,$lWeek){\n $query = \"\n SELECT\n view_delivery_dates.mgo_file_ref,\n view_delivery_dates.dos_file_ref,\n view_delivery_dates.vote_id,\n view_delivery_dates.vote_head,\n view_delivery_dates.vote_name,\n view_delivery_dates.item_id,\n view_delivery_dates.item_code,\n view_delivery_dates.item_name,\n view_delivery_dates.quantity,\n view_delivery_dates.unit_type_id,\n view_delivery_dates.unit_name,\n view_delivery_dates.tndr_open_date,\n view_delivery_dates.ho_date,\n view_delivery_dates.date_of_doc_ho,\n view_delivery_dates.tec_due_date,\n view_delivery_dates.received_tec_date,\n view_delivery_dates.forward_tec_date,\n view_delivery_dates.recomma_due_date,\n view_delivery_dates.rece_rec_date,\n view_delivery_dates.fwd_tb_date,\n view_delivery_dates.tb_approval_date,\n view_delivery_dates.appd_sup_id,\n view_delivery_dates.supplier_ref,\n view_delivery_dates.supplier_name,\n view_delivery_dates.appd_sup_remarks,\n view_delivery_dates.delivery_date\n FROM\n view_delivery_dates\n WHERE view_delivery_dates.delivery_date BETWEEN '$cDate' AND '$lWeek'\n \";\n $query_result = $this->mDbm->setData($query);\n return $query_result;\n }", "public static function getFirstAndLastDaysOfTheWeek(){\n $date = new \\DateTime('2020-09-01');\n $week = [];\n for($i = 1; $i <= 50; $i++){\n $date = $date->modify('this week');\n $week[$i]['start'] = $date->modify('this week')->format('Y-m-d');\n $week[$i]['end'] = $date->modify('this week + 6 days')->format('Y-m-d');\n $date = $date->modify('+ 1 day');\n }\n return $week;\n }", "function getPastEvents()\n {\n //1. Define the query\n $sql = \"SELECT * FROM events WHERE endtime < CURRENT_DATE AND archive != 1 ORDER BY starttime DESC\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //4. Execute the query\n $statement->execute();\n\n //5. Process the results (get OrderID)\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "function jx_pnh_getfranchiseordersbydate()\r\n\t{\r\n\t\t$data['stat'] = $this->input->post('stat');\r\n\t\t$data['fid'] = $this->input->post('fid');\r\n\t\t$data['st_ts'] = strtotime($this->input->post('ord_fil_from').' 00:00:00');\r\n\t\t$data['en_ts'] = strtotime($this->input->post('ord_fil_to').' 23:59:59');\r\n\t\t$this->load->view(\"admin/body/jx_pnh_franchiseorderlist\",$data);\r\n\t}", "function getBestSellingLastWeek($week){\n global $db;\n \n $stmt=$db->prepare(\"SELECT `week`, sales.idItem, inventory.`name`, SUM(sales.amount) AS totalAmount FROM sales INNER JOIN inventory ON sales.idItem=inventory.idItem WHERE `week` = 1 GROUP BY sales.idItem ORDER BY totalAmount DESC;\");\n \n $binds = array(\n \":week\" => $week\n );\n \n $results=[];\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $results;\n }\n }", "public function getOrdersDataLast24Hours($vendorId)\n {\n $to = $this->_date->date('Y-m-d H:i:s');\n $from = strtotime($to.\"-24hours\");\n $from = $this->_date->date('Y-m-d H:i:s', $from);\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getNumOfOrderByHour($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "function getOrder()\n {\n return 7;\n }", "function getOrder()\n {\n return 7;\n }", "public function getDeleteDaysAfterLastModification();", "public function getLatestDeliveryDate()\n {\n return $this->latestDeliveryDate;\n }", "public function fetchWeatherWeekly(){\n\t $url = \"http://opendata.cwb.gov.tw/opendata/MFC/F-C0032-005.xml\"; // 7days\n\t $forecasting = $this->fetchWeather($url);\n\t \n\t return $forecasting;\n\t}", "public function getTotalWeeklyDelivery()\n {\n return DB::table('delivery_orders')\n ->select([\n DB::raw('YEAR(delivery_orders.created_at) AS year'),\n DB::raw('WEEK(delivery_orders.created_at) AS week'),\n DB::raw('COUNT(delivery_orders.id) AS total'),\n ])\n ->groupBy([\n DB::raw('YEAR(delivery_orders.created_at)'),\n DB::raw('WEEK(delivery_orders.created_at)'),\n ])\n ->orderByDesc('year')\n ->orderBy('week');\n }", "function getFilterDate($top){\n\tif(!$top)\n\t\t$top=20;\n\n\t$data = M('event');\n\t$date_set = Array();\n\t$condition = Array('event_date' => Array('egt', todayDate()));\n\t$result = $data->where($condition)->group('event_date')->limit($top)->order('event_date asc')->select();\n\tforeach($result as $value)\n\t\tarray_push($date_set, $value['event_date']);\n\n\treturn $date_set;\n}", "function get_delivery_date_withing_week($cDate,$lWeek){\n $query = \"\n\t\t\tSELECT\n\t\t\t\ttbl_delivery_date.delivery_date_mgo_ref,\n\t\t\t\ttbl_tender_basic_details.dos_file_ref,\n\t\t\t\ttbl_vote_master.vote_name,\n\t\t\t\ttbl_items_list.item_name,\n\t\t\t\ttbl_tender_basic_details.quantity,\n\t\t\t\ttbl_unit_types.unit_name,\n\t\t\t\ttbl_tender_basic_details.tndr_open_date,\n\t\t\t\ttbl_tec_due_date.tec_due_date,\n\t\t\t\ttbl_received_tec.received_tec_date,\n\t\t\t\ttbl_forward_to_tender_bd.fwd_tb_date,\n\t\t\t\ttbl_tender_board_approval.tb_approval_date,\n\t\t\t\ttbl_delivery_date.delivery_date,\n\t\t\t\ttbl_delivery_date.delivery_remarks\n\t\t\tFROM\n\t\t\t\ttbl_delivery_date\n\t\t\t\tINNER JOIN tbl_tender_basic_details ON tbl_delivery_date.delivery_date_mgo_ref = tbl_tender_basic_details.mgo_file_ref\n\t\t\t\tINNER JOIN tbl_items_list ON tbl_tender_basic_details.item_id = tbl_items_list.item_id\n\t\t\t\tINNER JOIN tbl_vote_master ON tbl_vote_master.vote_id = tbl_tender_basic_details.vote_id\n\t\t\t\tINNER JOIN tbl_tender_board_approval ON tbl_tender_board_approval.tb_approval_mgo_ref = tbl_delivery_date.delivery_date_mgo_ref\n\t\t\t\tINNER JOIN tbl_forward_to_tender_bd ON tbl_forward_to_tender_bd.fwd_tb_mgo_ref = tbl_tender_board_approval.tb_approval_mgo_ref\n\t\t\t\tINNER JOIN tbl_unit_types ON tbl_tender_basic_details.unit_type_id = tbl_unit_types.unit_id\n\t\t\t\tINNER JOIN tbl_received_tec ON tbl_received_tec.received_tec_mgo_ref = tbl_delivery_date.delivery_date_mgo_ref\n\t\t\t\tINNER JOIN tbl_tec_due_date ON tbl_tec_due_date.tec_due_mgo_ref = tbl_delivery_date.delivery_date_mgo_ref\n\t\t\tWHERE delivery_date BETWEEN '$cDate' AND '$lWeek' \n \";\n $query_result = $this->mDbm->setData($query);\n return $query_result;\n }", "public static function recentProducts(){\n $recent = Product::find()\n ->where(['>=','actual_date',time()]) // show before actual_date\n ->orderBy(['created_at'=>SORT_DESC, 'updated_at'=>SORT_DESC])\n ->limit( self::SHOW_NUMBER_OF_FOOTER_PRODUCT)\n ->all();\n return $recent;\n }", "public function getDailyOrdersData($id=null)\n {\n $startDate = date(\"Y-m-d H:i:s\", strtotime('-7 day', time()));\n $endDate = date('Y-m-d H:i:s');\n\n $userData = User::find()->andFilterWhere(['u_id' => $id, 'u_type' => 2])->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n \\Yii::$app->data->getMwsDetails($user->u_mws_seller_id, $user->u_mws_auth_token);\n $orderList = \\Yii::$app->api->getOrdersList('Created', $startDate, $endDate);\n foreach ($orderList as $order) {\n $orderDetail = false;\n $order = (array)$order;\n $order = array_shift($order);\n if($order) {\n $model = AllOrdesList::findOne(['aol_amazon_order_id' => $order['AmazonOrderId'], 'aol_user_id' => $user->u_id]);\n if (!$model) {\n $model = new AllOrdesList();\n }\n $model->aol_amazon_order_id = (key_exists('AmazonOrderId', $order)) ? $order['AmazonOrderId'] : null;\n $model->aol_seller_order_id = (key_exists('SellerOrderId', $order)) ? $order['SellerOrderId'] : null;\n $model->aol_purchase_date = (key_exists('PurchaseDate', $order)) ? $order['PurchaseDate'] : null;\n $model->aol_last_updated_date = (key_exists('LastUpdateDate', $order)) ? $order['LastUpdateDate'] : null;\n $model->aol_order_status = (key_exists('OrderStatus', $order)) ? $order['OrderStatus'] : null;\n $model->aol_fulfilment_channel = (key_exists('FulfillmentChannel', $order)) ? $order['FulfillmentChannel'] : null;\n $model->aol_sales_channel = (key_exists('SalesChannel', $order)) ? $order['SalesChannel'] : null;\n $model->aol_ship_service = (key_exists('ShipServiceLevel', $order)) ? $order['ShipServiceLevel'] : null;\n $model->aol_order_total = (key_exists('OrderTotal', $order)) ? $order['OrderTotal']['Amount'] : 0;\n $model->aol_shipped_items = (key_exists('NumberOfItemsShipped', $order)) ? $order['NumberOfItemsShipped'] : null;\n $model->aol_unshipped_items = (key_exists('NumberOfItemsUnshipped', $order)) ? $order['NumberOfItemsUnshipped'] : null;\n if($model->aol_order_status == 'Shipped') {\n $model->aol_shipping_username = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['Name'] : null;\n $model->aol_shipping_address_1 = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['AddressLine1'] : null;\n $model->aol_shipping_address_2 = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['AddressLine2'] : null;\n $model->aol_shipping_address_3 = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['AddressLine3'] : null;\n $model->aol_city = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['City'] : null;\n $model->aol_country = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['County'] : null;\n $model->aol_district = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['District'] : null;\n $model->aol_state_or_region = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['StateOrRegion'] : null;\n $model->aol_postal_code = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['PostalCode'] : null;\n $model->aol_country_code =(key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['CountryCode'] : null;\n $model->aol_phone = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['Phone'] : null;\n $model->aol_buyer_name = key_exists('BuyerName', $order) ? $order['BuyerName'] : null;\n $model->aol_buyer_email = key_exists('BuyerEmail', $order) ? $order['BuyerEmail'] : null;\n $orderDetail = true;\n }\n $model->aol_user_id = $user->u_id;\n if($model->save(false)) {\n $olModel = OrderDataLog::findOne(['odl_order_id' => $model->aol_amazon_order_id, 'odl_user_id' => $user->u_id]);\n if (!$olModel) {\n $olModel = new OrderDataLog();\n $olModel->odl_order_id = $model->aol_amazon_order_id;\n $olModel->odl_user_id = $user->u_id;\n if($orderDetail) {\n $olModel->odl_shipped_order_data = 1;\n }\n if($olModel->save(false)) {\n echo $model->aol_amazon_order_id.\" Log is Saved. \";\n }\n }\n echo $model->aol_amazon_order_id.\" is Saved. \";\n }\n }\n }\n echo \"Done..\";\n }\n }", "public function __construct(){\n\n $this->all_orders='App\\UserOrder'::with('get_order_details.get_product_details')->whereDate('created_at','>',Carbon::today()->subYear(1)->toDateString())->orderBy('created_at','desc')->get();\n }", "public static function get_close_today()\n\t{\n\t\ttry\n\t\t{\n\t\t\t//raw query\n\t\t\t$q = DB::query( \"SELECT close, device_id, port FROM humidity_deltas \n\t\t\t\t\tWHERE DATE(time) = DATE(NOW()) \n\t\t\t\t\");\n\n\t\t\treturn $q;\n\t\t}\n\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tLog::write('error', $e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t}", "public static function getWeeklyOrders()\n\t{\n\t\tTools::displayAsDeprecated();\n\t\t$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('\n\t\tSELECT COUNT(`id_order`) as nb\n\t\tFROM `'._DB_PREFIX_.'orders`\n\t\tWHERE YEARWEEK(`date_add`) = YEARWEEK(NOW())');\n\n\t\treturn isset($result['nb']) ? $result['nb'] : 0;\n\t}", "function get_sensors_data_last_day(){\r\n $sensor_json_url = 'https://data.melbourne.vic.gov.au/resource/b2ak-trbp.json';\r\n $last_available_data_time = get_last_available_with_time(0)->date_time;\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_URL,$sensor_json_url . '?$where=date_time%20>%20\"' . gmdate(\"Y-m-d\\TH:i:s\", strtotime('-1 day', strtotime($last_available_data_time))) . '\"');\r\n $result=curl_exec($ch);\r\n curl_close($ch);\r\n return json_decode($result);\r\n}", "public function getDayHistory(\\DateTime $date, Restaurant $restaurant) {\r\n $repo = $this->em->getRepository('IOOrderBundle:OrderData');\r\n $qb = $repo->createQueryBuilder('order_item');\r\n $qb->where('order_item.restaurant = :restaurant')\r\n ->andWhere('DAY(order_item.orderDate) = :day')\r\n ->andWhere('MONTH(order_item.orderDate) = :month')\r\n ->andWhere('YEAR(order_item.orderDate) = :year')\r\n ->setParameter('restaurant', $restaurant)\r\n ->setParameter('day', $date->format('d'))\r\n ->setParameter('month', $date->format('m'))\r\n ->setParameter('year', $date->format('Y'));\r\n \r\n $orders = $qb->getQuery()->getResult();\r\n return $orders;\r\n }", "protected function getLastOrder(){\n return $this->_orderFactory->create('Magento\\Sales\\Model\\Order')->loadByIncrementId($this->onepage->getLastOrderId());\n }", "function getOrder($object) {\n //foreach($answerObject->Orders as $order) {\n //\n // $myOrder = new Bestellung();\n // ....\n // $object->addCollectionEntry($myOrder); \n //}\n \n $bestelldatum = new DateTime(); \n $lieferdatum = new DateTime(); \n $lieferdatum->add(new DateInterval('P4D'));\n\n $myOrder = new Bestellung();\n\n $myOrder->ShopId = 'sampleOrderId_'.rand(1000, 9999);\n $myOrder->Gesammtkosten = 9.37; \n $myOrder->Versandkosten = 4.99; \n $myOrder->VersandDienstleister = 'DHL National';\n $myOrder->Lieferdatum = $lieferdatum->format('Y-m-d H:i:s'); \n $myOrder->Zahlungsart = Zahlungsart::Nachnahme;\n $myOrder->Waehrung = Waehrung::EURO;\n $myOrder->Status = Status::EingegangenUndFreigegeben;\n $myOrder->Rechnungsnummer = 'sampleInvoiceId_'.rand(1000, 9999);\n $myOrder->Kundenbemerkung = 'Please send the products as fast as you can! Thank you, regards, your buyer'; \n $myOrder->Händlerbemerkung = 'We\\'ll send it tomorow! Regards, your merchant'; \n $myOrder->Bestelldatum = $bestelldatum->format('Y-m-d H:i:s'); \n \n $myOrder->Kunde = new Kunde(); \n\n $myOrder->Kunde->Kundennummer = 'sampleClientId_'.rand(1000, 9999);\n $myOrder->Kunde->Firma = 'Die Testfirma GmbH';\n $myOrder->Kunde->FirmenZusatz = 'wir testen das!'; \n $myOrder->Kunde->Titel = 'Prof. Dr.';\n $myOrder->Kunde->Vorname = 'Testina';\n $myOrder->Kunde->Nachname = 'Testerin';\n $myOrder->Kunde->Geschlecht = Geschlecht::Weiblich;\n $myOrder->Kunde->Zhd = 'Hr. Einkäufer (Buchhaltung)'; \n $myOrder->Kunde->UStId = 'DE 123456789';\n $myOrder->Kunde->Email = '[email protected]_'.rand(1000, 9999);\n $myOrder->Kunde->Telefon = '012 / 345 678 - 9';\n $myOrder->Kunde->Fax = '012 / 987 654 - 3';\n $myOrder->Kunde->Geburtstag = '07.07.1977';\n $myOrder->Kunde->Mobil = '0170 123 456';\n \n $myOrder->Kunde->Adresse = new Adresse();\n \n $myOrder->Kunde->Adresse->Straße = 'Am Testgelände';\n $myOrder->Kunde->Adresse->Hausnummer = '12a';\n $myOrder->Kunde->Adresse->Anmerkung = 'Gebäudekomplex \"Anton\"';\n $myOrder->Kunde->Adresse->PLZ = '12345';\n $myOrder->Kunde->Adresse->Ort = 'Testort';\n $myOrder->Kunde->Adresse->Bundesland = 'Nordrhein-Westfalen';\n $myOrder->Kunde->Adresse->Land = Land::DE();\n\n $myOrder->Lieferanschrift = new Anschrift();\n \n $myOrder->Lieferanschrift->Firma = 'Lagerfirma UG';\n $myOrder->Lieferanschrift->FirmenZusatz = 'denn lagern ist Leidenschaft!'; \n $myOrder->Lieferanschrift->Titel = 'Dipl.-Ing.';\n $myOrder->Lieferanschrift->Vorname = 'Ludwig';\n $myOrder->Lieferanschrift->Nachname = 'Lagerist';\n $myOrder->Lieferanschrift->Geschlecht = Geschlecht::Männlich; \n $myOrder->Lieferanschrift->Email = '[email protected]_'.rand(1000, 9999);\n $myOrder->Lieferanschrift->Telefon = '098 / 765 432 - 1';\n $myOrder->Lieferanschrift->Fax = '098 / 123 456 - 7';\n $myOrder->Lieferanschrift->Mobil = '0151 654 321';\n \n $myOrder->Lieferanschrift->Adresse = new Adresse();\n \n $myOrder->Lieferanschrift->Adresse->Straße = 'Lagerstraße';\n $myOrder->Lieferanschrift->Adresse->Hausnummer = '211';\n $myOrder->Lieferanschrift->Adresse->Anmerkung = 'Tor 4';\n $myOrder->Lieferanschrift->Adresse->PLZ = '5432';\n $myOrder->Lieferanschrift->Adresse->Ort = 'Lagerstadt';\n $myOrder->Lieferanschrift->Adresse->Bundesland = 'Tirol';\n $myOrder->Lieferanschrift->Adresse->Land = Land::AT();\n \n $myGutschein = new Gutschein();\n \n $myGutschein->GutscheinNummer = 'sampleCouponId_'.rand(1000, 9999); \n $myGutschein->Rabatt = 9.99; \n $myGutschein->Code = 'sampleCouponCode_'.rand(1000, 9999); \n $myGutschein->Bemerkung = 'unicorn 2 is great - coupon!'; \n \n array_push($myOrder->Gutscheine, $myGutschein);\n \n $myArtikel_1 = new Artikel();\n \n $myArtikel_1->ShopId = 'yourArticleIdOnMarketplace_1'; // the returned articleId from function addArticle($article) \n $myArtikel_1->ArtikelNummer = 'productArtNo_1';\n $myArtikel_1->Name = 'sampleProduct_1';\n $myArtikel_1->Hinweis = 'with gift package'; \n $myArtikel_1->Menge = 2; \n $myArtikel_1->Preis = 2.69; // Brutto (with tax included)\n $myArtikel_1->GesammtPreis = 5.38;\n $myArtikel_1->MwSt = Steuer::MwSt7();\n \n array_push($myOrder->Artikel, $myArtikel_1);\n \n $myArtikel_2 = new Artikel();\n \n $myArtikel_2->ShopId = 'yourArticleIdOnMarketplace_2';\n $myArtikel_2->ArtikelNummer = 'productArtNo_2';\n $myArtikel_2->Name = 'sampleProduct_2 with variations Color: blue Size: XXL';\n $myArtikel_2->Menge = 1; \n $myArtikel_2->Preis = 8.99;\n $myArtikel_2->GesammtPreis = 8.99;\n $myArtikel_2->MwSt = Steuer::MwSt19(); \n \n $myVakoArtikel = new VakoArtikel();\n \n $myVakoArtikel->ShopId = 'yourVariationIdOnMarketplace'; // the returned variantId from function addArticle($article) on adding this explicit variation \n $myVakoArtikel->Aktiv = true;\n \n $myVakoEigenschaftName_1 = new EigenschaftBase();\n $myVakoEigenschaftName_1->Name = 'Color';\n $myVakoWertEigenschaft_1 = new WertEigenschaft();\n \n $myVakoWertEigenschaft_1->Name = 'Color';\n $myVakoWertEigenschaft_1->Wert = new Eigenschaftswert();\n $myVakoWertEigenschaft_1->Wert->Aktiv = true;\n $myVakoWertEigenschaft_1->Wert->Wert = 'blue';\n \n $myVakoEigenschaftName_2 = new EigenschaftBase();\n $myVakoEigenschaftName_2->Name = 'Size'; \n $myVakoWertEigenschaft_2 = new WertEigenschaft();\n\n $myVakoWertEigenschaft_2->Name = 'Size';\n $myVakoWertEigenschaft_2->Wert = new Eigenschaftswert();\n $myVakoWertEigenschaft_2->Wert->Aktiv = true;\n $myVakoWertEigenschaft_2->Wert->Wert = 'XXL';\n \n array_push($myVakoArtikel->Eigenschaften, $myVakoWertEigenschaft_1, $myVakoWertEigenschaft_2);\n \n array_push($myArtikel_2->EigenschaftenNamen, $myVakoEigenschaftName_1, $myVakoEigenschaftName_2);\n \n array_push($myArtikel_2->VakoArtikel, $myVakoArtikel);\n \n array_push($myOrder->Artikel, $myArtikel_2);\n\n $object->addCollectionEntry($myOrder); \n \n $myOrder2 = new Bestellung();\n\n $myOrder2->ShopId = 'sampleOrderId_2_'.rand(1000, 9999);\n $myOrder2->Gesammtkosten = 34.95; \n $myOrder2->Versandkosten = 14.99; \n $myOrder2->VersandDienstleister = 'DPD Kurier';\n $myOrder2->Zahlungsart = Zahlungsart::Vorkasse;\n $myOrder2->Waehrung = Waehrung::EURO;\n $myOrder2->Status = Status::EingegangenUndFreigegeben;\n $myOrder2->Rechnungsnummer = 'sampleInvoiceId_2_'.rand(1000, 9999);\n $myOrder2->Kundenbemerkung = 'Bitte schnellstmöglich versenden, Danke!'; \n $myOrder2->Bestelldatum = $bestelldatum->format('Y-m-d H:i:s'); \n \n $myOrder2->Kunde = new Kunde(); \n\n $myOrder2->Kunde->Kundennummer = 'sampleClientId_2_'.rand(1000, 9999);\n $myOrder2->Kunde->Vorname = 'Arno';\n $myOrder2->Kunde->Nachname = 'Nym';\n $myOrder2->Kunde->Geschlecht = Geschlecht::Männlich; \n $myOrder2->Kunde->Email = '[email protected]_'.rand(1000, 9999);\n \n $myOrder2->Kunde->Adresse = new Adresse();\n \n $myOrder2->Kunde->Adresse->Straße = 'Am geheimen Weg';\n $myOrder2->Kunde->Adresse->Hausnummer = '1';\n $myOrder2->Kunde->Adresse->PLZ = '13373';\n $myOrder2->Kunde->Adresse->Ort = 'Geheim';\n $myOrder2->Kunde->Adresse->Land = Land::DE();\n \n $myOrder2->Lieferanschrift = new Anschrift();\n\n $myOrder2->Lieferanschrift->Vorname = 'Arno';\n $myOrder2->Lieferanschrift->Nachname = 'Nym';\n $myOrder2->Lieferanschrift->Geschlecht = Geschlecht::Männlich; \n $myOrder2->Lieferanschrift->Email = '[email protected]_'.rand(1000, 9999);\n \n $myOrder2->Lieferanschrift->Adresse = new Adresse();\n \n $myOrder2->Lieferanschrift->Adresse->Straße = 'Am geheimen Weg';\n $myOrder2->Lieferanschrift->Adresse->Hausnummer = '1';\n $myOrder2->Lieferanschrift->Adresse->PLZ = '13373';\n $myOrder2->Lieferanschrift->Adresse->Ort = 'Geheim';\n $myOrder2->Lieferanschrift->Adresse->Land = Land::DE();\n \n $myArtikel = new Artikel();\n \n $myArtikel->ShopId = 'yourArticleIdOnMarketplace_1_2';\n $myArtikel->ArtikelNummer = 'productArtNo_1_2';\n $myArtikel->Name = 'sampleProduct_1_2'; \n $myArtikel->Menge = 4; \n $myArtikel->Preis = 4.99;\n $myArtikel->GesammtPreis = 19.96;\n $myArtikel->MwSt = Steuer::MwSt10P7();\n \n array_push($myOrder2->Artikel, $myArtikel);\n\n $object->addCollectionEntry($myOrder2); \n}", "public function getMaxFeedDate()\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$query = \" SELECT max(date_given)\r\n\t\t\t\t\t\t\tFROM feed_transaction\";\r\n\t\t\t\t$result = mysqli_query($link, $query);\r\n\t\t\t\t$f = array();\r\n\t\t\t\t$f_arr = array();\r\n\t\t\t\twhile($row = mysqli_fetch_row($result)){\r\n\t\t\t\t\t$f['fdate'] = $row[0];\r\n\t\t\t\t\t$f_arr[] = $f;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\r\n\t\t\t\treturn $f_arr;\r\n\t\t\t\t\r\n\t\t}", "function get_weekday_stats(){\n if(!DashboardCommon::is_su()) return null;\n \n $sat = strtotime(\"last saturday\");\n $sat = date('w', $sat) == date('w') ? $sat + 7 * 86400 : $sat;\n $fri = strtotime(date(\"Y-m-d\", $sat) . \" +6 days\");\n $from = date(\"Y-m-d\", $sat);//for current week only\n $to = date(\"Y-m-d\", $fri);//for current week only\n $sql = \"SELECT DAYNAME(atr.call_start) as dayname,count(*) as total \n FROM week_days wd \n LEFT JOIN ( SELECT * FROM calls WHERE call_start >= '\" . $this->from . \"' AND call_start <= '\" . $this->to . \"') atr\n ON wd.week_day_num = DAYOFWEEK(atr.call_start)\n GROUP BY\n DAYOFWEEK(atr.call_start)\";\n\n $this_week_rec = DashboardCommon::db()->Execute($sql);\n $saturday = $sunday = $monday = $tuesday = $wednesday = 0;\n $thursday = $friday = 0;\n// $data = array();\n// while (!$this_week_rec->EOF) {\n// $k = $this_week_rec->fields['dayname'];\n// $data[$k]= $this_week_rec->fields['total'];\n// $this_week_rec->MoveNext();\n// }\n// \n// return array_keys($data, max($data));\n\n while (!$this_week_rec->EOF) {\n $daynames = $this_week_rec->fields['dayname'];\n $totalcalls = $this_week_rec->fields['total'];\n if ($daynames == 'Saturday') {\n $saturday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Sunday') {\n $sunday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Monday') {\n $monday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Tuesday') {\n $tuesday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Wednesday') {\n $wednesday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Thursday') {\n $thursday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Friday') {\n $friday = $this_week_rec->fields['total'];\n }\n\n $this_week_rec->MoveNext();\n }\n\n $arr = array('Saturday' => $saturday,\n 'Sunday' => $sunday,\n 'Monday' => $monday,\n 'Tuesday' => $tuesday,\n 'Wednesday' => $wednesday,\n 'Thursday' => $thursday,\n 'Friday' => $friday\n );\n $max_day = array_keys($arr, max($arr));\n \n $avg_calltime_sql = \"SELECT sum(duration) as total_call_time, count(*) as total_records, \n sum(duration) / count(*) as avg_time\n FROM \n (\n SELECT call_end-call_start as duration\n FROM calls\n WHERE call_start >= '\".$this->from.\"' AND call_start <= '\".$this->to.\"'\n ) as dt\";\n $avg_calltime_res = DashboardCommon::db()->Execute($avg_calltime_sql);\n \n \n return array('weekday'=>$max_day[0],'avg_call_time'=>$avg_calltime_res->fields['avg_time']);\n \n }", "function getOrderModifiedDate($orders_id) {\n\t\t$sel_ord_query = tep_db_query(\"SELECT MAX(date_added) as modified_date FROM \" . TABLE_ORDERS_STATUS_HISTORY . \" WHERE orders_id = '\".$orders_id.\"' LIMIT 0,1\");\n\t\t$rst_arr = tep_db_fetch_array($sel_ord_query);\n\t\treturn $rst_arr['modified_date'];\n\t}", "public function getDeliveryOrder();", "public function get_lastThree() {\n\n $query = $this->db->query('SELECT * FROM recipes WHERE recipes.published ORDER BY recipes.lastModDate DESC LIMIT 3');\n\n return $result = $query->result();\n }", "function get_umur($no_medrec){\n\t\t\treturn $this->db->query(\"select datediff(now(),tgl_lahir) as umurday from data_pasien where no_medrec='$no_medrec'\");\n\t\t}", "function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}", "public function getOrderdate()\n {\n return $this->orderdate;\n }", "public function f_get_workOrder()\n {\n\n $sql = $this->db->query(\"SELECT DISTINCT a.dist_cd, a.order_no, a.order_dt, b.district_name FROM td_dm_work_order a , md_district b\n WHERE a.dist_cd = b.district_code ORDER BY order_dt \");\n return $sql->result();\n\n }", "protected function getData()\n\t{\n\t\t$today = $this->get(\"events\", array(\n\t\t\t\"per_page\" => -1,\n\t\t\t\"date\" => date(\"Y-m-d\", time())\n\t\t));\n\n\t\t$tomorrow = $this->get(\"events\", array(\n\t\t\t\"per_page\" => -1,\n\t\t\t\"date\" => date(\"Y-m-d\", strtotime(\"+1 day\"))\n\t\t));\n\n\t\t// if it's not friday, return\n\t\tif (date(\"N\", time()) != 5) {\n\t\t\treturn $this->combineData(array($today, $tomorrow));\n\t\t}\n\n\n\t\t// if today is friday, also get sunday and monday's events\n\t\t$sunday = $this->get(\"events\", array(\n\t\t\t\"per_page\" => -1,\n\t\t\t\"date\" => date(\"Y-m-d\", strtotime(\"+2 days\"))\n\t\t));\n\n\t\t$monday = $this->get(\"events\", array(\n\t\t\t\"per_page\" => -1,\n\t\t\t\"date\" => date(\"Y-m-d\", strtotime(\"+3 days\"))\n\t\t));\n\n\t\treturn $this->combineData(array($today, $tomorrow, $sunday, $monday));\n\t}", "public function orderhistorybyemail(){\n\t\t$this->db->where('OrderEmail', $this->session->userdata('useremail'));\n\t\t$this->db->order_by('OrderId', 'desc');\n\t\t$query=$this->db->get('tbl_order_summery');\n\t\treturn $query->result();\n\t}", "public function LastOrder($includeUnsubmittedOrders = false)\n {\n //limit to 10\n if ($includeUnsubmittedOrders) {\n $orders = Order::get_datalist_of_orders_with_submit_record(false);\n } else {\n $orders = Order::get_datalist_of_orders_with_submit_record(true);\n }\n\n return $orders\n ->Filter(['MemberID' => $this->owner->ID])\n ->First()\n ;\n }", "public function get_last_old(){\n\t\t$this->db->select('ok,valorx,valory,teta,q1,q2,q3,q4,ftang,fnormal');\n\t\t$dato = $this->db->limit(1)->order_by('id','desc')->get('plataforma')->row_array();\n\t\treturn $dato;\n\t}", "function getOrders() {\n\t\t$orders = Mage::getModel ( 'sales/order' )->getCollection ()->addAttributeToSelect ( \"*\" )->addAttributeToFilter ( 'status', array ('complete') );\n\t\t$orders_data = $this->preapreOrdersTosend ( $orders );\n\t\treturn $orders_data;\n\t}", "function getNotification() {\r\n return $this->DBObject->readCursor(\"product_actions.getUnreadableOrders\", null);\r\n }", "public function last(): array\n {\n return $this->single('date DESC');\n }", "public function getTheDateOfThisOrder($order_id,$product_id){\n \n $criteria = new CDbCriteria();\n $criteria->select = '*';\n $criteria->condition='order_id=:id and product_id=:product';\n $criteria->params = array(':id'=>$order_id,':product'=>$product_id);\n $order= OrderHasProducts::model()->find($criteria);\n \n return $order['date_ordered'];\n \n }", "public function getSixMonthsData() {\n\t\t$dates = getPeriods('SixMonths');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear'], 6);\t\t\n\t}", "function getLastPeriod($period) {\n $queryBuilder = $this->getQueryBuilder();\n $queryBuilder\n ->addSelect('i')\n ->andWhere('i.enabled = 1')\n ->andWhere('i.period = :periodo')\n ->andWhere('i.tmp = 0')\n ->orderBy('i.ref')\n ->setParameter('periodo', $period)\n ;\n //$queryBuilder->orderBy('i.ref');\n\n return $queryBuilder;\n }", "public function get_latest_notifications($hos_id){\n\t\tglobal $con;\n\n\t\t$query=\"SELECT notification_id FROM referral_notifications \n\t\t\t\tWHERE receiver_hospital=\\\"$hos_id\\\" ORDER BY referral_id DESC LIMIT 5\";\n\t\t$result=array();\n\t\t$result=$this->select($con,$query);\n\n\t\treturn $result;\n\t}", "public function scopeLastWeek(Builder $query): Builder\n {\n return $query->whereBetween('posted_at', [now()->subWeek(), now()])\n ->latest();\n }", "function getHighestProfitLastWeek($week){\n global $db;\n \n $stmt=$db->prepare(\"SELECT inventory.`name`, SUM(sales.money) AS totalMoney, SUM(sales.money) - (inventory.unitPrice * SUM(sales.amount)) AS totalProfit FROM sales INNER JOIN inventory ON sales.idItem=inventory.idItem WHERE `week` = :week GROUP BY sales.idItem ORDER BY totalProfit DESC;\");\n \n $binds = array(\n \":week\" => $week\n );\n \n $results=[];\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n }\n return $results;\n }", "function getOrderProcessedDate($orders_id) {\n\t\t$sel_ord_query = tep_db_query(\"SELECT MAX(date_added) as processing_date FROM \" . TABLE_ORDERS_STATUS_HISTORY . \" WHERE orders_id = '\".$orders_id.\"' AND orders_status_id='2' LIMIT 0,1\");\n\t\t$rst_arr = tep_db_fetch_array($sel_ord_query);\n\t\treturn $rst_arr['processing_date'];\n\t}", "private function _getEventData()\n {\n $query = $this->app->query->newSelect();\n $query->cols(['*'])\n ->from('events')\n ->orderBy(['event_date desc', 'post_date desc'])\n ->limit(3);\n\n return $this->app->db->fetchAll($query);\n }", "public function getnewlastweekreg()\n {\n if(Request::ajax()){\n\n $req = Request::all();\n\n $req = json_encode($req);\n\n $req = json_decode($req);\n\n $user=Auth::user();\n\n $id_cliente = $this->getIdcliente();\n\n if($req->desde and $req->hasta){\n\n $req->desde = (new DateTime($req->desde))->format('Y-m-d');\n\n $req->hasta = (new DateTime($req->hasta))->format('Y-m-d');\n\n $sql = \"SELECT date_format(`fecha_registro`,'%m-%d-%Y'), count(date_format(`fecha_registro`,'%m-%d-%Y'))\n FROM `primer_registro_email`\n WHERE `id_cliente` = \".$id_cliente.\n \" AND date_format(`fecha_registro`,'%m-%d-%Y') between date_format( '\".$req->desde.\"' ,'%m-%d-%Y') and date_format( '\".$req->hasta.\"' ,'%m-%d-%Y')\n GROUP BY date_format(`fecha_registro`,'%m-%d-%Y')\";\n }else\n if($req->desde){\n\n $req->desde = (new DateTime($req->desde))->format('Y-m-d');\n\n $sql = \"SELECT date_format(`fecha_registro`,'%m-%d-%Y'), count(date_format(`fecha_registro`,'%m-%d-%Y'))\n FROM `primer_registro_email`\n WHERE `id_cliente` = \".$id_cliente.\n \" AND date_format(`fecha_registro`,'%m-%d-%Y') > date_format( '\".$req->desde.\"' ,'%m-%d-%Y') \n GROUP BY date_format(`fecha_registro`,'%m-%d-%Y')\";\n }else\n if($req->hasta){\n\n $req->hasta = (new DateTime($req->hasta))->format('Y-m-d');\n\n $sql = \"SELECT date_format(`fecha_registro`,'%m-%d-%Y'), count(date_format(`fecha_registro`,'%m-%d-%Y'))\n FROM `primer_registro_email`\n WHERE `id_cliente` = \".$id_cliente.\n \" AND date_format(`fecha_registro`,'%m-%d-%Y') < date_format( '\".$req->hasta.\"' ,'%m-%d-%Y')\n GROUP BY date_format(`fecha_registro`,'%m-%d-%Y')\";\n }else{\n $sql = \"SELECT date_format(`fecha_registro`,'%m-%d-%Y'), count(date_format(`fecha_registro`,'%m-%d-%Y'))\n FROM `primer_registro_email`\n WHERE `id_cliente` = \".$id_cliente.\n \" AND date_format(`fecha_registro`,'%m-%d-%Y') between date_format(now()-interval 7 day,'%m-%d-%Y') and date_format(now(),'%m-%d-%Y')\n GROUP BY date_format(`fecha_registro`,'%m-%d-%Y')\";\n }\n\n \n \n $results = DB::select($sql);\n\n return $results;\n\n\n }\n }", "function get_pedido_data()\n {\n $date = Carbon::now();\n $currentDate = $date->format('Y-m-d');\n $pedido_data = DB::table('pedidos')->whereRaw('DATE(\"created_at\") = ?',[$currentDate])->get();\n return $pedido_data;\n }", "public function getFOrders()\n {\n // 花店管理员身份验证\n if (session(\"admin_level\") == 3){\n $toFlower = M('weixin_order');\n $data = $toFlower->where('type = 0')->select();\n $this->assign('data',$data);\n }\n\n $toTrade = M('pub_trade_logs');\n $con['uid'] = session('uid');\n //$this->ajaxReturn(0 , $con['uid'] , 1);\n $TradeLogs = $toTrade->query(\"SELECT `xt_pub_trade_logs`.* ,`xt_pub`.`title` FROM `xt_pub_trade_logs` left join `xt_pub` on `xt_pub_trade_logs`.`pub_id` = `xt_pub`.`pub_id` WHERE 1\");\n // $this->ajaxReturn(0 , $TradeLogs , 1);\n\n $this->assign('tradelogs',$TradeLogs);\n $this->display();\n }", "function getRevenueData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n \n if($varAction=='today' || $varAction=='yesterday'){\n if($varAction=='today'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n \n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $arrClms = array('TIME(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded < \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$i]['time'][]=$arrData;\n $arrRes[$i]['count']=$count;\n }\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_week'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$key]['dates']=$arrData;\n $arrRes[$key]['count']=$count;\n }\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_month'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $lastMonth.'=='.$lastMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$key]['dates']=$arrData;\n $arrRes[$key]['count']=$count;\n }\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "public function return_most_recent() {\n\n // query database to return just the most recent work item\n $query_args = array(\n 'post_type' => 'invoice_item',\n 'meta_query' => array(\n array(\n 'key' => 'client_id',\n 'value' => $this->id\n ),\n 'ii_date' => array(\n 'key' => 'date',\n )\n ),\n 'orderby' => 'ii_date',\n 'order' => 'DSC',\n 'posts_per_page' => 1\n );\n $query = new WP_Query($query_args);\n\n // populate return array and return\n while ($query->have_posts()) {\n $query->the_post();\n $invoice_item = new InvoiceItem(get_the_id());\n update_post_meta($this->id, 'most_recent', strtotime($invoice_item->date));\n $return = array(\n 'id' => get_the_id(),\n 'permalink' => get_the_permalink(),\n 'value' => $invoice_item->value,\n 'title' => $invoice_item->ii_title,\n 'date' => $invoice_item->date,\n );\n return $return;\n }\n\n }", "function filter_where($where = '') {\n global $popular_days;\n //posts in the last X days\n $where .= \" AND post_date > '\" . date('Y-m-d', strtotime('-'.$popular_days.' days')) . \"'\";\n return $where;\n}", "public function index()\n {\n $now = Carbon::now();\n\n $place = $this->getPlace();\n\n $query1 = Order::query()\n ->where('place_id', $place->id)\n ->status('draft', '!=');\n\n $d1 = $now->copy();\n $res[] = [\n 'title' => 'Заказы сегодня:',\n 'dates' => [$d1->format('Y-m-d')],\n 'count' => (clone $query1)->whereDate('created_at', $d1)->count(),\n 'amount' => (clone $query1)->whereDate('created_at', $d1)->sum('amount'),\n ];\n $d1 = $now->copy()->addDays(-1);\n $res[] = [\n 'title' => 'Заказы вчера:',\n 'dates' => [$d1->format('Y-m-d')],\n 'count' => (clone $query1)->whereDate('created_at', $d1)->count(),\n 'amount' => (clone $query1)->whereDate('created_at', $d1)->sum('amount'),\n ];\n $d1 = $now->copy()->startOfWeek();\n $d2 = $now->copy()->endOfWeek();\n $res[] = [\n 'title' => 'За эту неделю:',\n 'dates' => [$d1->format('Y-m-d'), $d2->format('Y-m-d')],\n 'count' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->count(),\n 'amount' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->sum('amount'),\n ];\n $d1 = $now->copy()->addDays(-7)->startOfWeek();\n $d2 = $now->copy()->addDays(-7)->endOfWeek();\n $res[] = [\n 'title' => 'За прошлую неделю:',\n 'dates' => [$d1->format('Y-m-d'), $d2->format('Y-m-d')],\n 'count' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->count(),\n 'amount' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->sum('amount'),\n ];\n $d1 = $now->copy()->startOfMonth();\n $d2 = $now->copy()->endOfMonth();\n $res[] = [\n 'title' => 'За этот месяц:',\n 'dates' => [$d1->format('Y-m-d'), $d2->format('Y-m-d')],\n 'count' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->count(),\n 'amount' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->sum('amount'),\n ];\n $d1 = $now->copy()->addMonths(-1)->startOfMonth();\n $d2 = $now->copy()->addMonths(-1)->endOfMonth();\n $res[] = [\n 'title' => 'За прошлый месяц:',\n 'dates' => [$d1->format('Y-m-d'), $d2->format('Y-m-d')],\n 'count' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->count(),\n 'amount' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->sum('amount'),\n ];\n\n return [\n 'data' => $res\n ];\n }", "public function buysOfThisWeek() {\n $query = \"SELECT COUNT(*) AS 'BUYS', DAYOFWEEK(`BUYDATE`) AS 'DAY' FROM `BUY` WHERE WEEK(BUYDATE)\"\n . \" = WEEK(NOW()) GROUP BY DAYOFWEEK(`BUYDATE`)\";\n\n $result = parent::query($query);\n\n $toReturn = array();\n\n while ($row = $result->fetch_assoc()) {\n $toReturn[] = array(\n 'day' => $row['DAY'],\n 'buys' => $row['BUYS']\n );\n }\n\n return $toReturn;\n }", "public function getOrderDate()\n {\n return $this->order_date;\n }", "public function upcomingCredit()\n {\n $where = \"(SELECT DATEDIFF(po.`due_date`, '$this->curDate') AS days) < 14 AND po.`status_paid` = 0\";\n $po = $this->db\n ->from('purchase_order po')\n ->join('principal p', 'p.id_principal = po.id_principal')\n ->where($where)\n ->order_by('po.id_purchase_order asc')\n ->get()\n ->result();\n return $po;\n }", "public function findLatest(): array\n {\n\n return $this->createQueryBuilder('p')\n ->where('p.isOnline = true')\n ->orderBy('p.created_at', 'DESC')\n ->setMaxResults(6)\n ->getQuery()\n ->getResult();\n }", "function daylist_get() {\n $condition = \"\";\n $fromdate = $this->get('fromdate');\n $todate = $this->get('todate');\n $status = $this->get('status');\n $store = $this->get('store');\n $total_cost = 0.00;\n\n if ($status != \"\") {\n if ($status == \"Delivered\") {\n $condition .= \" and o.status='Delivered' and o.delivery_accept='1' \"; // and delivery_recieved='1'\n }else if ($status == \"Rejected\") {\n $condition .= \" and o.status='Delivered' and o.delivery_reject='1'\";\n }else{\n $condition .= \" and o.status='$status'\"; \n }\n \n };\n \n\n if ($store != \"\")\n $condition .= \" and o.orderedby='$store'\";\n if ($fromdate != \"\" && $todate == \"\") {\n $fromdate = date(\"Y-m-d\", strtotime($fromdate));\n if($status == \"Delivered\") {\n $condition .= \" and o.`deliveredon` between '$fromdate 00:00:00' and '$fromdate 23:59:59'\";\n }else{\n $condition .= \" and o.`orderedon` between '$fromdate 00:00:00' and '$fromdate 23:59:59'\";\n }\n \n } else if ($fromdate != \"\" && $todate != \"\") {\n $fromdate = date(\"Y-m-d\", strtotime($fromdate));\n $todate = date(\"Y-m-d\", strtotime($todate));\n if($status == \"Delivered\") {\n $condition .= \" and o.`deliveredon` between '$fromdate 00:00:00' and '$todate 23:59:59'\";\n }else{\n $condition .= \" and o.`orderedon` between '$fromdate 00:00:00' and '$todate 23:59:59'\";\n }\n } else if ($fromdate == \"\" && $todate == \"\") {\n\n $fromdate = date(\"Y-m-d\");\n if($status == \"Delivered\") {\n $condition .= \" and o.`deliveredon` between '$fromdate 00:00:00' and '$fromdate 23:59:59'\";\n }else{\n $condition .= \" and o.`orderedon` between '$fromdate 00:00:00' and '$fromdate 23:59:59'\";\n }\n \n }\n // echo \"select o.id,o.order_id,o.`orderedon`,s.name as store,o.order_value from orders o,stores s where o.orderedby = s.id $condition\";\n $result_set = $this->model_all->getTableDataFromQuery(\"select o.id,o.order_id,o.`orderedon`,s.name as store,o.order_value from orders o,stores s where o.orderedby = s.id $condition\");\n //echo $this->db->last_query();\n if ($result_set->num_rows() > 0) {\n $result[\"status\"] = 1;\n $result[\"message\"] = \"Records Found\";\n $result[\"total_records\"] = $result_set->num_rows();\n foreach ($result_set->result_array() as $row) {\n $row['orderedon'] = date(\"d-m-Y\", strtotime($row['orderedon']));\n $total_cost = $total_cost + $row['order_value'];\n $result[\"records\"][] = $row;\n }\n $result[\"total_cost\"] = \"Rs \" . $total_cost . \" /-\";\n\n $this->response($result, 200);\n exit;\n } else {\n $result[\"status\"] = 0;\n $result[\"message\"] = \"No records Found\";\n $this->response($result, 200);\n exit;\n }\n }" ]
[ "0.6258321", "0.6032126", "0.5924634", "0.5919259", "0.5840765", "0.58389056", "0.58226204", "0.5803716", "0.57998663", "0.5730479", "0.56885207", "0.56826484", "0.5654919", "0.5624115", "0.5619001", "0.5585667", "0.5570741", "0.54992676", "0.5497031", "0.5445543", "0.5427387", "0.5423302", "0.540848", "0.5388937", "0.5369095", "0.53223324", "0.53054523", "0.5297318", "0.52972686", "0.5287969", "0.5259199", "0.5259094", "0.52583224", "0.5250222", "0.52374774", "0.5228434", "0.52177715", "0.521099", "0.51747936", "0.5170705", "0.5170103", "0.5166674", "0.51657933", "0.51633877", "0.5160515", "0.51485306", "0.5146762", "0.5145109", "0.5145109", "0.51190865", "0.51176584", "0.51114815", "0.5108018", "0.5100074", "0.50831217", "0.5078166", "0.50674635", "0.5060875", "0.50546503", "0.5050536", "0.5044929", "0.5043634", "0.5040982", "0.50387704", "0.50382775", "0.503382", "0.5031902", "0.50304997", "0.50283134", "0.5020415", "0.5019395", "0.5008933", "0.50048906", "0.5004134", "0.4998086", "0.49965188", "0.49955982", "0.49850547", "0.49735504", "0.49728248", "0.49659726", "0.49652785", "0.49613234", "0.49583468", "0.49576104", "0.4957446", "0.4955543", "0.4953824", "0.49526218", "0.49517608", "0.49405712", "0.49387705", "0.4936682", "0.4928184", "0.49267408", "0.49251455", "0.49249545", "0.49195418", "0.4919539", "0.49151275" ]
0.6676397
0
Get order data for graph last month
public function getOrdersDataLastMonth($vendorId) { $to = $this->_date->date('Y-m-d'); $from = strtotime($to."-30days"); $from = $this->_date->date('Y-m-d', $from); $to .= ' 23:59:59'; $orderResource = $this->_vendorOrderFactory->create()->getResource(); $data = $orderResource->getNumOfOrderByDay($from, $to, $vendorId); $result = $this->_processOrderData($data); $result = array_values($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDataMonth()\n {\n return $this->model()->where('created_at', '>=', Carbon::now()->startOfMonth())->get();\n }", "public function graphData()\n {\n $dayOfWeek = ['Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo'];\n $colors = [\n 'rgba(201, 203, 207, 0.8)', //gray\n 'rgba(255, 99, 132, 0.8)', //Red\n 'rgba(255, 159, 64, 0.8)', //Orange\n 'rgba(75, 192, 192, 0.8)', //green\n 'rgba(54, 162, 235, 0.8)', //blue\n 'rgba(153, 102, 255, 0.8)', //purple\n 'rgba(255, 205, 86, 0.8)', //yellow\n ];\n $borderColors = [\n 'rgba(201, 203, 207, 1)', //gray\n 'rgba(255, 99, 132, 1)', //Red\n 'rgba(255, 159, 64, 1)', //Orange\n 'rgba(75, 192, 192, 1)', //green\n 'rgba(54, 162, 235, 1)', //blue\n 'rgba(153, 102, 255, 1)', //purple\n 'rgba(255, 205, 86, 1)', //yellow\n ];\n $months = ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'];\n $now = Carbon::now()->timezone($this->timezome);\n $data = [];\n\n switch ($this->graphPeriod) {\n case 'weekly':\n $data = $this->getDataFromWeeklySales($colors, $borderColors);\n break;\n case 'weeklyAccumulated':\n $data = $this->getDataFromWeeklySales($colors, $borderColors, true);\n break;\n case 'monthly':\n $labels = [];\n $date = $now->copy()->subMonths(5)->startOfMonth()->startOfDay();\n $end = $now->copy()->endOfDay();\n $count = 0;\n\n for ($i = 1; $i < 32; $i++) {\n $labels[] = $i;\n }\n\n while ($date->lessThanOrEqualTo($end)) {\n $label = $months[$date->month - 1];\n $data = [];\n $endOfMonth = $date->copy()->endOfMonth()->endOfDay();\n $sale = 0;\n\n while ($date->lessThanOrEqualTo($endOfMonth) && $date->lessThanOrEqualTo($end)) {\n $sale += $this->getSumFromGraphPeriod($date, $this->graphCategory);\n $data[] = $sale;\n $date->addDay();\n }\n\n $datasets[] = [\n 'label' => $label,\n 'backgroundColor' => $colors[$count],\n 'borderColor' => $borderColors[$count],\n 'borderWidth' => 1,\n 'data' => $data,\n 'fill' => false\n ];\n\n $count++;\n }\n\n $data = [\n 'labels' => $labels,\n 'datasets' => $datasets,\n 'type' => 'line'\n ];\n break;\n default:\n # code...\n break;\n }\n return $data;\n }", "public static function GetDashboard() {\n $date = [];\n $num_orders = [];\n $last_month = \\Carbon\\Carbon::today()->subDays(30);\n $orders = Order::where('created_at', '>=', $last_month)->get()\n ->groupBy(function($item) {\n return $item->created_at->format('d-m-y');\n })->toArray();\n foreach ($orders as $key => $value) {\n $date[] = $key;\n $num_orders[] = count($value);\n }\n\n //======= Get income from last month - Chart From DB =======\n $last_month_income = \\Carbon\\Carbon::today()->subDays(30);\n $all_orders = [];\n $orders_income = [];\n $income = [];\n $income_date = [];\n $users_orders = DB::table('users')\n ->join('orders', 'users.id', '=', 'orders.user_id')\n ->select('users.*', 'orders.*')\n ->where('orders.created_at', '>=', $last_month_income)->get();\n foreach ($users_orders as $new_user_order) {\n $all_orders[] = (array) $new_user_order;\n }\n foreach ($all_orders as &$orders_data) {\n $orders_data['data'] = unserialize($orders_data['data']);\n }\n foreach ($all_orders as $order) {\n $order['created_at'] = (new \\DateTime($order['created_at']))->format('Y-m-d');\n $income_date[] = $order['created_at'];\n $sum = 0;\n foreach ($order['data'] as $price) {\n $sum += ($price['price'] * $price['quantity']);\n }\n $income[] = $sum;\n }\n\n for ($i = count($income_date) - 1; $i > 0; $i--) {\n if ($income_date[$i] == $income_date[$i - 1]) {\n unset($income_date[$i]);\n $income[$i - 1] = $income[$i] + $income[$i - 1];\n unset($income[$i]);\n }\n }\n $income = array_values($income);\n $income_date = array_values($income_date);\n\n self::$data['income'] = json_encode($income);\n self::$data['income_date'] = json_encode($income_date);\n\n //======= Get last week new users =======\n $last_week = \\Carbon\\Carbon::today()->subDays(7);\n $weekly_users = User::where('created_at', '>=', $last_week)->get()->toArray();\n\n //======= Get all users except admin =======\n $all_users = User::where('role', '!=', '6')->get()->toArray();\n\n //======= Get last day new orders =======\n $last_day = \\Carbon\\Carbon::today();\n $daily_orders = Order::where('created_at', '>=', $last_day)->get()->toArray();\n\n self::$data['weekly_new_users'] = count($weekly_users);\n self::$data['all_users'] = count($all_users);\n self::$data['daily_orders'] = count($daily_orders);\n self::$data['date'] = json_encode($date);\n self::$data['num_orders'] = json_encode($num_orders);\n self::$data['title'] .= 'CMS';\n self::$data['page_name'] = 'Ski Expert | Main';\n return view('cms.dashboard', self::$data);\n }", "public function getCurrentMonthTotalOrder() : int;", "public function getCurrentMonthData() {\n\t\t//return $this->getDataByInterval($currentMonth, $currentYear, $currentMonth, $currentYear);\n\t\t$dates = getPeriods('CurrentMonth');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear']);\t\t\n\t}", "function getOrders() {\n\t\t$orders = Mage::getModel ( 'sales/order' )->getCollection ()->addAttributeToSelect ( \"*\" )->addAttributeToFilter ( 'status', array ('complete') );\n\t\t$orders_data = $this->preapreOrdersTosend ( $orders );\n\t\treturn $orders_data;\n\t}", "public function graphmonthused()\n \t{\n \t\t// announce return variable\n \t\t$return \t= \tarray();\n \t\t$count \t\t=\tarray();\n \t\t// select logger collection \n \t\t$use_data \t= \t$this->mongo_db->db->used;\n \t\t// preparing query data\n \t\t$splitday \t= \texplode('-', $this->use_date);\n \t\t// check day in month\n \t\t$lastday \t= \tcal_days_in_month(CAL_GREGORIAN,$splitday[1],$splitday[0]);\n \t\tfor ($i = 1; $i <= $lastday; $i++) \n \t\t{\n \t\t\tif (strlen($i) == 1) \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t= \tarray(\n \t\t\t\t\t'use_date' \t\t=> \t\t$splitday[0].'-'.$splitday[1].'-0'.$i, \n \t\t\t\t\t'use_appid' \t=> \t\t$this->use_appid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t} \n \t\t\telse \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_date' \t=> \t$splitday[0].'-'.$splitday[1].'-'.$i, \n \t\t\t\t\t'use_appid' => \t$this->use_appid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t}\n \t\t}\n\n \t\t$return\t\t=\tarray(\n \t\t\t'lastday'\t=>\t$lastday,\n \t\t\t'data'\t\t=>\tarray(\n\t\t\t\t'name'\t\t=>\t\t'User',\n \t\t\t\t'data'\t\t=>\t\t$count\n \t\t\t\t)\n \t\t\t);\n\n \t\treturn $return;\t\n \t}", "public function getSalesByMonth()\n {\n\n $dataPoints = DB::select('SELECT date_format(created_at, \\'%Y\\') as year, date_format(created_at, \\'%m\\') as month, count(id) as pocount, sum(total) as monthtotal from purchase_orders group by date_format(created_at, \\'%Y-%m\\')');\n\n\n return response()->json($dataPoints);\n\n }", "public function get_sales_data(Request $request){\n\n $sales_graph=$this->all_orders->groupBy(function($item){\n return ($item->created_at->format('Y:m'));\n })->map(function($item,$key){\n return ($item->sum('grand_total'));\n });\n $orders_graph=$this->all_orders->groupBy(function($item){\n return ($item->created_at->format('Y:m'));\n })->map(function($item,$key){\n return ($item->count());\n });\n \n $sales_str=\"[\";\n foreach($sales_graph as $key=>$value){\n\n if($sales_graph->last()==$value)\n $sales_str.='{\"Month\" : \"' . $key . '\", \"Sales\":\"'.$value .'\"}';\n else\n $sales_str.='{\"Month\": \"' . $key . '\", \"Sales\":\"'.$value .'\"},';\n }\n $sales_str.=\"]\";\n \n $orders_str=\"[\";\n \n foreach($orders_graph as $key=>$value){\n\n if($orders_graph->last()==$value)\n $orders_str.='{\"Month\" : \"' . $key . '\", \"Orders\":\"'.$value .'\"}';\n else\n $orders_str.='{\"Month\": \"' . $key . '\", \"Orders\":\"'.$value .'\"},';\n }\n $orders_str.=\"]\";\n\n\n echo json_encode([$sales_str,$orders_str]);\n }", "public function makeChart(){\n\n //$monthcreated_at->format('d');\n $data= \\DB::table(\"donations\")\n\n ->select(DB::raw(\"HOUR(created_at) as months\"),DB::raw(\"(SUM(amount)) as total\"))\n\n ->groupBy(DB::raw(\"HOUR(created_at)\"))\n\n ->get();\n\n\nreturn ($data); \n \n }", "public function getgraphAction(){\n $params = array(\n 'cht' => 'lc', \t\t\t\t\t// chart type\n 'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0', //background fills for the chart\n // 'chm' => 'B,f4d4b2,0,0,0|B,FF0000,1,1,0|B,00FF00,2,2,0', \t\t// line fills\n 'chco' => 'db4814,1919D1',\t\t\t\t\t//Series Colors\n 'chs' => '587x300',\t\t\t\t// chart size <width>x<height>\n\t\t\t'chxt' => 'x,y',\t\t\t\t\t// visible axes\n\t\t\t//'chof' => 'validate'\t\t\t\t// output format (png,gif,json,html{when chof='validate'})\n );\n \n\t$post=$this->getRequest()->getPost();\n\t\n\t\n\t$timezoneLocal = Mage::app()->getStore()->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);\n\n\t\tlist ($dateStart, $dateEnd) = Mage::getResourceModel('reports/order_collection')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getDateRange($post['range'], '', '', true);\n\n $dateStart->setTimezone($timezoneLocal);\n $dateEnd->setTimezone($timezoneLocal);\n\t\n\t\t$dates = array();\n $datas = array();\n\n while($dateStart->compare($dateEnd) < 0){\n switch ($post['range']) {\n case '24h':\n $d = $dateStart->toString('yyyy-MM-dd HH:00');\n $dateStart->addHour(1);\n break;\n case '7d':\n case '1m':\n $d = $dateStart->toString('yyyy-MM-dd');\n $dateStart->addDay(1);\n break;\n case '1y':\n case '2y':\n $d = $dateStart->toString('yyyy-MM');\n $dateStart->addMonth(1);\n break;\n }\n\n $dates[] = $d;\n }\n\n\t\t$graphData=array();\n\t\t\n\t\t$product_list=array('product1'=>$post['product'],\n\t\t\t\t\t\t\t'product2'=>$post['compare2']\n\t\t\t\t\t\t\t);\t\n\t\t$graphData=Mage::Helper('graphs')->getGraphData($dates,$product_list);\n\n /**\n * setting skip step\n */\n if (count($dates) > 8 && count($dates) < 15) {\n $c = 1;\n } else if (count($dates) >= 15){\n $c = 2;\n } else {\n $c = 0;\n }\n /**\n * skipping some x labels for good reading\n */\n $i=0;\n foreach ($dates as $k => $d) {\n if ($i == $c) {\n $dates[$k] = $d;\n $i = 0;\n } else {\n $dates[$k] = '';\n $i++;\n }\n }\n \n $this->_axisLabels['x'] = $dates;\n\t\t$this->_axisLabels['y'] = $graphData['quantity'][$post['product']];\n\t\t\n\t\tforeach ($graphData['quantity'] as $index => $serie) {\n $localmaxlength[$index] = sizeof($serie);\n $localmaxvalue[$index] = max($serie);\n $localminvalue[$index] = min($serie);\n }\n \n\t\t$maxvalue = max($localmaxvalue);\n\t\t$minvalue = min($localminvalue);\n\n $yrange = 0;\n $yLabels = array();\n $miny = 0;\n $maxy = 0;\n $yorigin = 0;\n\n $maxlength = max($localmaxlength);\n if ($minvalue >= 0 && $maxvalue >= 0) {\n $miny = 0;\n if ($maxvalue > 10) {\n $p = pow(10, $this->_getPow($maxvalue));\n $maxy = (ceil($maxvalue/$p))*$p;\n $yLabels = range($miny, $maxy, $p);\n } else {\n $maxy = ceil($maxvalue+1);\n $yLabels = range($miny, $maxy, 1);\n }\n $yrange = $maxy;\n $yorigin = 0;\n }\n\n \n\t\t\t\n\t\t\t$params['chd'] = \"e:\";\n $dataDelimiter = \"\";\n $dataSetdelimiter = \",\";\n $dataMissing = \"__\";\n \n\t\t\t// EXTENDED ENCODING\n\t\t\tforeach($product_list as $productid){\n\t\t\t\t$chartdata = array();\t\n for ($j = 0; $j < sizeof($graphData['quantity'][$productid]); $j++) {\n $currentvalue = $graphData['quantity'][$productid][$j];\n \n if (is_numeric($currentvalue)) {\n if ($yrange) {\n $ylocation = (4095 * ($yorigin + $currentvalue) / $yrange);\n\n } else {\n $ylocation = 0;\n }\n $firstchar = floor($ylocation / 64);\n $secondchar = $ylocation % 64;\n $mappedchar = substr($this->_extendedEncoding, $firstchar, 1)\n . substr($this->_extendedEncoding, $secondchar, 1);\n array_push($chartdata, $mappedchar . $dataDelimiter);\n } else {\n array_push($chartdata, $dataMissing . $dataDelimiter);\n }\n\n\t\t\t }\n\t\t\t $buffer = implode('', $chartdata);\t\t\t \n\t\t\t\t\t$buffer = rtrim($buffer, $dataSetdelimiter);\n\t\t\t\t\t$buffer = rtrim($buffer, $dataDelimiter);\n\t\t\t\t\t$buffer = str_replace(($dataDelimiter . $dataSetdelimiter), $dataSetdelimiter, $buffer);\n\t\t\t\t\t\n\t\t\t\t\t$params['chd'] .= $buffer.',';\n\t\t\t\t\t$buffer=null;\n\t\t\t\t\t$chartdata=null;\n\t\t\t\t}\n\t\t\t\t\t$labelBuffer = \"\";\n\t\t\t\t\t$valueBuffer = array();\n\t\t\t\t\t$rangeBuffer = \"\";\n \n if (sizeof($this->_axisLabels) > 0) {\n $params['chxt'] = implode(',', array_keys($this->_axisLabels));\n $indexid = 0;\n foreach ($this->_axisLabels as $idx=>$labels){\n\t\t\t\t\n if ($idx == 'x') {\n /**\n * Format date\n */\n foreach ($this->_axisLabels[$idx] as $_index=>$_label) {\n if ($_label != '') {\n switch ($post['range']) {\n case '24h':\n $this->_axisLabels[$idx][$_index] = $this->formatTime(\n new Zend_Date($_label, 'yyyy-MM-dd HH:00'), 'short', false\n );\n break;\n case '7d':\n case '1m':\n $this->_axisLabels[$idx][$_index] = $this->formatDate(\n new Zend_Date($_label, 'yyyy-MM-dd')\n );\n break;\n case '1y':\n case '2y':\n\t\t\t\t\t\t\t\t\t\n $formats = Mage::app()->getLocale()->getTranslationList('datetime');\n $format = isset($formats['yyMM']) ? $formats['yyMM'] : 'MM/yyyy';\n $format = str_replace(array(\"yyyy\", \"yy\", \"MM\"), array(\"Y\", \"y\", \"m\"), $format);\n $this->_axisLabels[$idx][$_index] = date($format, strtotime($_label));\n break;\n }\n } else {\n $this->_axisLabels[$idx][$_index] = '';\n }\n\n }\n\t\t\t\t\t\t\t\t\t\t\n $tmpstring = implode('|', $this->_axisLabels[$idx]);\n\n $valueBuffer[] = $indexid . \":|\" . $tmpstring;\n if (sizeof($this->_axisLabels[$idx]) > 1) {\n $deltaX = 100/(sizeof($this->_axisLabels[$idx])-1);\n } else {\n $deltaX = 100;\n }\n } else if ($idx == 'y') {\n $valueBuffer[] = $indexid . \":|\" . implode('|', $yLabels);\n if (sizeof($yLabels)-1) {\n $deltaY = 100/(sizeof($yLabels)-1);\n } else {\n $deltaY = 100;\n }\n // setting range values for y axis\n $rangeBuffer = $indexid . \",\" . $miny . \",\" . $maxy . \"|\";\n }\n $indexid++;\n }\n $params['chxl'] = implode('|', $valueBuffer);\n }\t\t\t\n\t\t\t\t\t\n\t\tif (isset($deltaX) && isset($deltaY)) {\n $params['chg'] = $deltaX . ',' . $deltaY . ',1,0';\n }\n \n\n\t\t\t$p = array();\n foreach ($params as $name => $value) {\n $p[] = $name . '=' .urlencode($value);\n }\n\n $url= Mage_Adminhtml_Block_Dashboard_Graph::API_URL . '?' . implode('&', $p);\n\n\t\t\t\techo $url;\n\t}", "public function getChartData() {\n $fromDate = Carbon::now()->subMinutes(60);\n $toDate = Carbon::now();\n\n $chart = new TaskActivity;\n $chartData = Auth::user()->tasks()->where('is_complete', 0)->whereBetween('created_at', [$fromDate, $toDate])->get()->pluck('created_at')->toArray();\n $arr = [];\n foreach ($chartData as $k => $c) {\n $add = $k + 1;\n array_push($arr, $add);\n }\n $chart->labels($chartData);\n $chart->dataset('Pending task', 'line', $arr);\n return $chart;\n }", "public function graphmonthused_dashboard()\n \t{\n \t\t// announce return variable\n \t\t$return \t= \tarray();\n \t\t$count \t\t=\tarray();\n \t\t// select logger collection \n \t\t$use_data \t= \t$this->mongo_db->db->used;\n \t\t// preparing query data\n \t\t$splitday \t= \texplode('-', $this->use_date);\n \t\t// check day in month\n \t\t$lastday \t= \tcal_days_in_month(CAL_GREGORIAN,$splitday[1],$splitday[0]);\n \t\tfor ($i = 1; $i <= $lastday; $i++) \n \t\t{\n \t\t\tif (strlen($i) == 1) \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t= \tarray(\n \t\t\t\t\t'use_date' \t=> \t$splitday[0].'-'.$splitday[1].'-0'.$i\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t} \n \t\t\telse \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t= \tarray(\n \t\t\t\t\t'use_date' \t=> \t$splitday[0].'-'.$splitday[1].'-'.$i\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t}\n \t\t}\n\n \t\t$return\t\t=\tarray(\n \t\t\t'lastday'\t=>\t$lastday,\n \t\t\t'data'\t\t=>\tarray(\n\t\t\t\t'name'\t\t=>\t\t'User',\n \t\t\t\t'data'\t\t=>\t\t$count\n \t\t\t\t)\n \t\t\t);\n\n \t\treturn $return;\t\n \t}", "function get_recent_orders(){\n\t $orders = $this->Order->get_recent_orders();\n\t if($this->params['requested']){\n\t return $orders;\n\t }else{\n\t $this->set('orders', $orders);\n\t }\n \n\t}", "public static function getNewOrders($lastVisit) {\n\n\t\treturn Order::fullActive()\n\t\t ->whereBetween('date', [$lastVisit, Carbon::now()])\n\t\t ->get();\n\t}", "function charts($data1) {\n\t $startDate = Carbon::now()->subDay(365);\n\t $endDate = Carbon::now();\n\t\n\t\t//THIS RETURNS THE 4 BOXES\n\t\t$month = $data->filter(function($data1){ return $data1->created_at->format('m-y') == date('m-y'); });\n\t\t$lastmonth = $data->filter(function($data1){ return $data1->created_at->format('m-y') == Carbon::now()->firstOfMonth()->subMonth()->format('m-y'); });\n\t\t$year = $data->filter(function($data1){ return $data1->created_at->format('y') == date('y'); });\n\t\t$lastyear = $data->filter(function($data1){ return $data1->created_at->format('y') == Carbon::now()->subYear()->format('y'); });\n\t\n\t}", "public function getLastOrder();", "public function get_chart($where){\n\t\t\t$this->db->select('SUM(trans_pembayaran) as jumlah, monthname(tgl_trans) as bulan');\n\t\t\t$this->db->where('status = \"done\"');\n\t\t\t$this->db->like('DATE_FORMAT(tgl_trans, \"%Y\")', $where);\n\t\t\t$this->db->group_by('DATE_FORMAT(tgl_trans, \"%m\")');\n\t\t\treturn $this->db->get('transaksi')->result_array();\n\t\t}", "static function orderStatistics( $year = false, $month = false )\n {\n if ( $year == false )\n {\n $startDate = 0;\n $stopDate = mktime( 0, 0, 0, 12, 31, 2037 );\n }\n else if ( $year != false and $month == false )\n {\n $startDate = mktime( 0, 0, 0, 1, 1, $year );\n $stopDate = mktime( 0, 0, 0, 1, 1, $year + 1 );\n }\n else if ( $year != false and $month != false )\n {\n $startDate = mktime( 0, 0, 0, $month, 1, $year );\n $stopDate = mktime( 23, 59, 59, $month + 1, 0, $year );\n }\n\n $db = eZDB::instance();\n $productArray = $db->arrayQuery( \"SELECT ezproductcollection_item.*, ignore_vat, ezorder.created, currency_code FROM ezorder, ezproductcollection_item, ezproductcollection\n WHERE ezproductcollection.id=ezproductcollection_item.productcollection_id\n AND ezproductcollection_item.productcollection_id=ezorder.productcollection_id\n AND is_temporary='0'\n AND ezorder.created >= '$startDate' AND ezorder.created < '$stopDate'\n ORDER BY contentobject_id, currency_code\" );\n $currentContentObjectID = 0;\n $productItemArray = array();\n $itemCount = 0;\n $name = false;\n $productInfo = array();\n $totalSumInfo = array();\n $firstPass = true;\n // Hash of ContentObject ID, the value will be replaced by the correct object once all IDs are known.\n $contentObjectIDHash = array();\n foreach( $productArray as $productItem )\n {\n $itemCount++;\n $contentObjectID = $productItem['contentobject_id'];\n\n if ( $firstPass )\n {\n $contentObjectIDHash[$currentContentObjectID] = true;\n $currentContentObjectID = $contentObjectID;\n $firstPass = false;\n }\n\n if ( $currentContentObjectID != $contentObjectID && $itemCount != 1 )\n {\n $productItemArray[] = array(\n 'name' => $name,\n // Reference to the entry that will contain the ContentObject at the end\n 'product' => &$contentObjectIDHash[$currentContentObjectID],\n 'product_info' => $productInfo\n );\n $productInfo = array();\n $name = $productItem['name'];\n $currentContentObjectID = $contentObjectID;\n $contentObjectIDHash[$currentContentObjectID] = true;\n }\n\n $currencyCode = $productItem['currency_code'];\n if ( $currencyCode == '' )\n {\n $currencyCode = eZOrder::fetchLocaleCurrencyCode();\n }\n\n if ( !isset( $productInfo[$currencyCode] ) )\n {\n $productInfo[$currencyCode] = array( 'sum_count' => 0,\n 'sum_ex_vat' => 0,\n 'sum_inc_vat' => 0 );\n }\n if ( !isset( $totalSumInfo[$currencyCode] ) )\n {\n $totalSumInfo[$currencyCode] = array( 'sum_ex_vat' => 0,\n 'sum_inc_vat' => 0 );\n }\n\n if ( $productItem['ignore_vat']== true )\n {\n $vatValue = 0;\n }\n else\n {\n $vatValue = $productItem['vat_value'];\n }\n\n $price = $productItem['price'];\n\n if ( $productItem['is_vat_inc'] )\n {\n $priceExVAT = $price / ( 100 + $vatValue ) * 100;\n $priceIncVAT = $price;\n\n }\n else\n {\n $priceExVAT = $price;\n $priceIncVAT = $price * ( 100 + $vatValue ) / 100;\n }\n\n $count = $productItem['item_count'];\n $realPricePercent = ( 100 - $productItem['discount'] ) / 100;\n $totalPriceExVAT = round( $count * $priceExVAT * $realPricePercent, 2 );\n $totalPriceIncVAT = round( $count * $priceIncVAT * $realPricePercent, 2 );\n $totalSumInfo[$currencyCode]['sum_ex_vat'] += $totalPriceExVAT;\n $totalSumInfo[$currencyCode]['sum_inc_vat'] += $totalPriceIncVAT;\n\n $productInfo[$currencyCode]['sum_count'] += $count;\n $productInfo[$currencyCode]['sum_ex_vat'] += $totalPriceExVAT;\n $productInfo[$currencyCode]['sum_inc_vat'] += $totalPriceIncVAT;\n }\n\n // add last product info\n if ( !empty( $productArray ) )\n {\n $productItemArray[] = array(\n 'name' => $name,\n // Reference to the entry that will contain the ContentObject at the end\n 'product' => &$contentObjectIDHash[$currentContentObjectID],\n 'product_info' => $productInfo\n );\n\n // Fetching all ContentObject ids in one query, filling the hash with the corresponding ContentObject\n foreach ( eZContentObject::fetchList( true, array( \"id\" => array( array_keys( $contentObjectIDHash ) ) ) ) as $contentObject )\n {\n $contentObjectIDHash[$contentObject->ID] = $contentObject;\n }\n }\n\n return array(\n array(\n 'product_list' => $productItemArray,\n 'total_sum_info' => $totalSumInfo\n )\n );\n }", "public function getTimeSeries() {\n $series = array();\n foreach($this -> _trades as $trade) {\n \n $month = date('M',$trade['timestamp']);\n if(!isset($series[$month])) {\n $series[$month] = 0;\n }\n if(!empty($trade['delta'])) {\n $series[$month] += $trade['delta'] - (isset($trade['fee']) ? $trade['fee'] : 0);\n }\n }\n return $series;\n }", "public function get_trend_data_rows()\n\t{\n\t\t$dates = array();\n\t\t$i_rows = array();\n\t\t$sr_rows = array();\n\t\t$trend_data = array();\n\n\t $current_month = date_create()->format('Y-m-d H:i:s');\n\n\t // echo $current_month_first_day=date_create($current_month)\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\t $current_month_first_day=date_create($current_month)\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n\n $dates[] = $current_month_first_day;\n\n //echo\"</br>\";\n \n // echo $current_month_current_day=date_create($current_month)\n // ->format(\"Y-m-d 23:59:59\");\n\n $current_month_current_day=date_create($current_month)\n ->format(\"Y-m-d 23:59:59\");\t\n\n $dates[] = $current_month_current_day;\n\n //echo\"</br></br>\";\n\n // echo $second_month_first_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $second_month_first_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $second_month_first_day;\n\n //echo\"</br>\";\n\n // echo $second_month_last_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n $second_month_last_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $second_month_last_day;\n\n// echo\"</br></br>\";\n\n // echo $third_month_first_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $third_month_first_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $third_month_first_day;\n\n //echo\"</br>\";\n \t\t\t\n // echo $third_month_last_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n\t $third_month_last_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $third_month_last_day;\n\n // echo\"</br>\";\t\n // echo \"<pre>\";\n // print_r($dates);\n\t // echo \"</pre>\";\t\n\t // echo\"</br>\";\t\t\t \n\n for ($i=0; $i <=5 ; $i=$i+2)\n { \t\n \t//echo\"</br>\";\n\n \t$start = new DateTime($dates[$i]);\n \t\n \t//echo\"</br>\";\n\n\t\t$start = date_format($start,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\n\t\t$end = new DateTime($dates[$i+1]);\n\n\t\t//echo\"</br>\";\n\n\t\t$end = date_format($end,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\t\t$i_rows[] = date_create($start)->format(\"F Y\");\n\t\t$i_rows[] = date_create($end)->format(\"F Y\");\n\t\t$i_rows[] = $this->trend_insident_data($start,$end);\n \t$sr_rows[] = date_create($start)->format(\"F Y\");\n\t\t$sr_rows[] = date_create($end)->format(\"F Y\");\n \t$sr_rows[] = $this->trend_sr_data($start,$end);\t\n }\n\n // echo \"<pre>\";\n // \tprint_r($i_rows);\n \t\t// echo \"<h4>SR Array</h4>\";\n \t\t// print_r($sr_rows);\n \t\t// echo \"</pre>\";\n\n \t\t$trend_data[] = $i_rows;\n \t\t$trend_data[] = $sr_rows;\n\n\n \t\treturn $trend_data;\n\n\n // // First day of a specific month\n // $d = new DateTime('2010-01-19');\n // $d->modify('first day of this month');\n // echo $d->format('jS, F Y').\"</br>\";\n\n // // alternatively...\n // echo date_create('2010-01-19')\n // ->modify('first day of this month')\n // ->format('jS, F Y');\n\t\t//exit();\n\t}", "public function actionIndex()\n {\n if(empty($ordersMonth)){\n $begin = new \\DateTime( date('Y-m-d h:i:s').' -3 weeks' );\n $end = new \\DateTime( date('Y-m-d h:i:s').' +1 day' );\n } else {\n $begin = new \\DateTime( date($ordersMonth.'-01 h:i:s') );\n $end = new \\DateTime( date($ordersMonth.'-t h:i:s'));\n }\n\n $interval = \\DateInterval::createFromDateString('1 day');\n $period = new \\DatePeriod($begin, $interval, $end);\n $orderStats = [];\n foreach ( $period as $dt ){\n $beginOfDay = $dt->setTime(0,0,1)->format( \"Y-m-d H:i:s\\n\" );\n $endOfDay = $dt->setTime(23,59,59)->format( \"Y-m-d H:i:s\\n\" );\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['all'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['done'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>5])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['cancelled'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>1])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['new'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>3])->sum('order_amount');\n }\n\n return $this->render('index', ['orderStats'=>$orderStats, 'begin'=>$begin->format( \"Y-m-d H:i:s\\n\" ), 'end'=>$end->format( \"Y-m-d H:i:s\\n\" )]);\n }", "public function indexgraphmonthAd()\n {\n\n // ->elementLabel(\"amout\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->groupBy('name');\n\n // $bills = Bill::where(DB::raw(\"(DATE_FORMAT(updated_at,'%Y'))\"),date('Y'))->get();\n // $chart = Charts::database($bills, 'bar', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->groupByMonth(date('Y'), true);\n\n // $data = Bill::where('updated_at', '2018-12-10')->get();\n // $chart = Charts::create('line', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->labels($data->pluck('updated_at'))\n // ->values($data->pluck('sum'));\n\n $chart = Charts::database(Bill::all(), 'bar', 'highcharts')\n ->elementLabel(\"Total\")\n ->dimensions(1000, 500)\n ->responsive(false)\n ->lastByMonth(12, true);\n\n \n\n // $data = BillDetail::all();\n // $chart = Charts::create('line', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->labels($data->pluck('name'))\n // ->values($data->pluck('amout'));\n\n\n // ->template(\"material\")\n // ->dataset('Element 1', [5,20,100])\n // ->dataset('Element 1', [15,30,80])\n // ->dataset('Element 1', [25,10,40])\n // ->labels(['One', 'Two', 'Three']);\n\n return view('adminPharmacy.a_graphmonth', ['chart' => $chart]);\n }", "public function getOrder(): array;", "public function get_main_chart() {\n\t\tglobal $wp_locale;\n\n\t\t// Get orders and dates in range - we want the SUM of order totals, COUNT of order items, COUNT of orders, and the date\n\t\t$orders = $this->get_order_report_data( array(\n\t\t\t'data' => array(\n\t\t\t\t'ID' => array(\n\t\t\t\t\t'type' => 'post_data',\n\t\t\t\t\t'function' => 'COUNT',\n\t\t\t\t\t'name' => 'total_orders',\n\t\t\t\t\t'distinct' => true,\n\t\t\t\t),\n\t\t\t\t'post_date' => array(\n\t\t\t\t\t'type' => 'post_data',\n\t\t\t\t\t'function' => '',\n\t\t\t\t\t'name' => 'post_date'\n\t\t\t\t),\n\t\t\t),\n\t\t\t'group_by' => $this->group_by_query,\n\t\t\t'order_by' => 'post_date ASC',\n\t\t\t'query_type' => 'get_results',\n\t\t\t'filter_range' => true\n\t\t) );\n\n\t\t// Get Abadoned Carts in range 1 years\n\t\t$abandoned_carts_items = CartModel::get_carts_one_year();\n\t\t$ee_abandoned_posts = array();\n\n\t\tif ( $abandoned_carts_items ) {\n\n\t\t\tforeach ( $abandoned_carts_items as $order_item ) {\n\t\t\t\t$date = date( 'Y-m-d h:i:s', $order_item->post_date );\n\n\t\t\t\t$obj = new stdClass();\n\t\t\t\t$obj->post_date = $date;\n\t\t\t\t$obj->abandoned_cart_itms = 1;\n\n\t\t\t\t$ee_abandoned_posts[] = $obj;\n\t\t\t}\n\t\t}\t\n\n\t\t// Prepare data for report\n\t\t$order_counts = $this->prepare_chart_data( $orders, 'post_date', 'total_orders', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t$abandoned_carts_encoded = $this->prepare_chart_data( $ee_abandoned_posts, 'post_date', 'abandoned_cart_itms', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t\n\t\t// Encode in json format\n\t\t$chart_data = json_encode( array(\n\t\t\t'order_counts' => array_values( $order_counts ),\n\t\t\t'abandoned_cart_itms' => array_values( $abandoned_carts_encoded )\n\t\t) );\n\t\t?>\n\n\t\t<?php //echo $chart_data; ?>\n\t\t<div class=\"chart-container\">\n\t\t\t<div class=\"chart-placeholder main\"></div>\n\t\t</div>\n\t\t<script type=\"text/javascript\">\n\n\t\t\tvar main_chart;\n\n\t\t\tjQuery(function(){\n\t\t\t\tvar order_data = jQuery.parseJSON( '<?php echo $chart_data; ?>' );\n\t\t\t\tvar drawGraph = function( highlight ) {\n\t\t\t\t\tvar series = [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"<?php echo esc_js( __( 'Number of conversions', 'cart_converter' ) ) ?>\",\n\t\t\t\t\t\t\tdata: order_data.order_counts,\n\t\t\t\t\t\t\tcolor: '<?php echo $this->chart_colours['order_counts']; ?>',\n\t\t\t\t\t\t\tbars: { fillColor: '<?php echo $this->chart_colours['order_counts']; ?>', fill: true, show: true, lineWidth: 0, barWidth: <?php echo $this->barwidth; ?> * 0.5, align: 'center' },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\thoverable: true\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"<?php echo esc_js( __( 'Abandoned Carts', 'cart_converter' ) ) ?>\",\n\t\t\t\t\t\t\tdata: order_data.abandoned_cart_itms,\n\t\t\t\t\t\t\tcolor: '<?php echo $this->chart_colours['abandoned_carts']; ?>',\n\t\t\t\t\t\t\tpoints: { show: true, radius: 5, lineWidth: 3, fillColor: '#fff', fill: true },\n\t\t\t\t\t\t\tlines: { show: true, lineWidth: 4, fill: false },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\thoverable: true\n\t\t\t\t\t\t}\n\t\t\t\t\t];\n\n\t\t\t\t\tif ( highlight !== 'undefined' && series[ highlight ] ) {\n\t\t\t\t\t\thighlight_series = series[ highlight ];\n\n\t\t\t\t\t\thighlight_series.color = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.bars )\n\t\t\t\t\t\t\thighlight_series.bars.fillColor = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.lines ) {\n\t\t\t\t\t\t\thighlight_series.lines.lineWidth = 5;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmain_chart = jQuery.plot(\n\t\t\t\t\t\tjQuery('.chart-placeholder.main'),\n\t\t\t\t\t\tseries,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\tshow: false\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t grid: {\n\t\t\t\t\t\t color: '#aaa',\n\t\t\t\t\t\t borderColor: 'transparent',\n\t\t\t\t\t\t borderWidth: 0,\n\t\t\t\t\t\t hoverable: true\n\t\t\t\t\t\t },\n\t\t\t\t\t\t xaxes: [ {\n\t\t\t\t\t\t \tcolor: '#aaa',\n\t\t\t\t\t\t \tposition: \"bottom\",\n\t\t\t\t\t\t \ttickColor: 'transparent',\n\t\t\t\t\t\t\t\tmode: \"time\",\n\t\t\t\t\t\t\t\ttimeformat: \"<?php if ( $this->chart_groupby == 'day' ) echo '%d %b'; else echo '%b'; ?>\",\n\t\t\t\t\t\t\t\tmonthNames: <?php echo json_encode( array_values( $wp_locale->month_abbrev ) ) ?>,\n\t\t\t\t\t\t\t\ttickLength: 1,\n\t\t\t\t\t\t\t\tminTickSize: [1, \"<?php echo $this->chart_groupby; ?>\"],\n\t\t\t\t\t\t\t\tfont: {\n\t\t\t\t\t\t \t\tcolor: \"#aaa\"\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t} ],\n\t\t\t\t\t\t yaxes: [\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t \t\tmin: 0,\n\t\t\t\t\t\t \t\tminTickSize: 1,\n\t\t\t\t\t\t \t\ttickDecimals: 0,\n\t\t\t\t\t\t \t\tcolor: '#d4d9dc',\n\t\t\t\t\t\t \t\tfont: { color: \"#aaa\" }\n\t\t\t\t\t\t \t},\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t \t\tposition: \"right\",\n\t\t\t\t\t\t \t\tmin: 0,\n\t\t\t\t\t\t \t\ttickDecimals: 2,\n\t\t\t\t\t\t \t\talignTicksWithAxis: 1,\n\t\t\t\t\t\t \t\tcolor: 'transparent',\n\t\t\t\t\t\t \t\tfont: { color: \"#aaa\" }\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\n\t\t\t\t\tjQuery('.chart-placeholder').resize();\n\t\t\t\t}\n\n\t\t\t\tdrawGraph();\n\n\t\t\t\tjQuery('.highlight_series').hover(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph( jQuery(this).data('series') );\n\t\t\t\t\t},\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}", "public function graphmonthusedfunc()\n \t{\n \t\t// announce return variable\n \t\t$return \t\t= \tarray();\n \t\t$count \t\t\t=\tarray();\n \t\t// select logger collection \n \t\t$use_data \t\t= \t$this->mongo_db->db->used;\n \t\t// preparing query data\n \t\t$splitday \t\t= \texplode('-', $this->use_date);\n \t\t// check day in month\n \t\t$lastday \t\t= \tcal_days_in_month(CAL_GREGORIAN,$splitday[1],$splitday[0]);\n \t\tfor ($i = 1; $i <= $lastday; $i++) \n \t\t{\n \t\t\tif (strlen($i) == 1) \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t= \tarray(\n \t\t\t\t\t'use_date' \t\t=> \t$splitday[0].'-'.$splitday[1].'-0'.$i, \n \t\t\t\t\t'use_funcid' \t=> \t$this->use_funcid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t} \n \t\t\telse \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t= \tarray(\n \t\t\t\t\t'use_date' \t\t=> \t$splitday[0].'-'.$splitday[1].'-'.$i, \n \t\t\t\t\t'use_funcid' \t=> \t$this->use_funcid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t}\n \t\t}\n\n \t\t$return\t\t=\tarray(\n \t\t\t'lastday'\t=>\t$lastday,\n \t\t\t'data'\t\t=>\tarray(\n\t\t\t\t'name'\t\t=>\t\t'User',\n \t\t\t\t'data'\t\t=>\t\t$count\n \t\t\t\t)\n \t\t\t);\n\n \t\treturn $return;\t\n \t}", "public static function getMonth() {\n\n return Model\\Event::whereMonth('start_date', '=', date('n'))\n ->orderBy('start_date', 'desc')\n\t\t\t\t\t\t ->take(3)\n ->get();\n\n }", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function searchMonth(Request $request){\n $result = Order::with('customer')->where('order_month',$request->order_month)->where('order_year',$request->order_year)->latest()->get();\n return response()->json($result);\n\n }", "public function totalOrdersByDate()\n {\n $data = [\n 'ano' => (int)date('Y'),\n 'mes' => (int)date('m'),\n 'dia' => (int)date('d'),\n ];\n\n /*$ano = Pedido\n ::selectRaw('YEAR(created_at) as ano, COUNT(*) as count')\n ->whereIn('status', [1,2,3])\n ->whereIn(DB::raw('YEAR(created_at)'), [$data['ano'], $data['ano'] - 1])\n ->groupBy(DB::raw('YEAR(created_at)'))\n ->orderBy(DB::raw('YEAR(created_at)'), 'DESC')\n ->get()->toArray();\n\n if (count($ano) == 1 && $data['ano'] == $ano[0]['ano']) {\n $ano[] = [\n 'ano' => $data['ano'] - 1,\n 'count' => 0\n ];\n }*/\n\n $mes = Pedido\n ::selectRaw('MONTH(created_at) as mes, COUNT(*) as count')\n ->whereIn('status', [1,2,3])\n ->whereIn(DB::raw('MONTH(created_at)'), [$data['mes'], $data['mes'] - 1])\n ->where(DB::raw('YEAR(created_at)'), '=', $data['ano'])\n ->groupBy(DB::raw('MONTH(created_at)'))\n ->orderBy(DB::raw('MONTH(created_at)'), 'DESC')\n ->get()->toArray();\n\n if (!isset($mes[0])) {\n $mes[] = [\n 'mes' => $data['mes'],\n 'count' => 0\n ];\n }\n\n if (count($mes) == 1) {\n if ($data['mes'] == $mes[0]['mes']) {\n $mes[] = [\n 'mes' => $data['mes'] - 1,\n 'count' => 0\n ];\n } elseif (($data['mes'] - 1) == $mes[0]['mes']) {\n $mes[] = $mes[0];\n\n $mes[0] = [\n 'mes' => $data['mes'],\n 'count' => 0\n ];\n }\n }\n\n if ($mes[1]['mes'] === 0) {\n $mes[1]['count'] = Pedido\n ::selectRaw('MONTH(created_at) as mes, COUNT(*) as count')\n ->whereIn('status', [1,2,3])\n ->where(DB::raw('MONTH(created_at)'), '=', 12)\n ->where(DB::raw('YEAR(created_at)'), '=', ($data['ano'] - 1))\n ->groupBy(DB::raw('MONTH(created_at)'))\n ->orderBy(DB::raw('MONTH(created_at)'), 'DESC')\n ->get()->toArray();\n\n $mes[1]['count'] = $mes[1]['count'][0]['count'];\n $mes[1]['mes'] = 12;\n }\n\n $dia = Pedido\n ::selectRaw('DAY(created_at) as dia, COUNT(*) as count')\n ->whereIn('status', [1,2,3])\n ->whereIn(DB::raw('DAY(created_at)'), [$data['dia'], $data['dia'] - 1])\n ->where(DB::raw('MONTH(created_at)'), '=', $data['mes'])\n ->where(DB::raw('YEAR(created_at)'), '=', $data['ano'])\n ->groupBy(DB::raw('DAY(created_at)'))\n ->orderBy(DB::raw('DAY(created_at)'), 'DESC')\n ->get()->toArray();\n\n if (!isset($dia[0])) {\n $dia[] = [\n 'dia' => $data['dia'],\n 'count' => 0\n ];\n }\n\n if (count($dia) == 1) {\n if ($data['dia'] == $dia[0]['dia']) {\n $dia[] = [\n 'dia' => $data['dia'] - 1,\n 'count' => 0\n ];\n } elseif (($data['dia'] - 1) == $dia[0]['dia']) {\n $dia[] = $dia[0];\n\n $dia[0] = [\n 'dia' => $data['dia'],\n 'count' => 0\n ];\n }\n }\n\n $mesesExtenso = Config::get('core.meses');\n\n $pedidos = [\n /*'ano' => [\n 'atual' => [$ano[0]['ano'], $ano[0]['count']],\n 'ultimo' => [$ano[1]['ano'], $ano[1]['count']],\n ],*/\n 'mes' => [\n 'atual' => [$mesesExtenso[(int)$mes[0]['mes']], $mes[0]['count']],\n 'ultimo' => [$mesesExtenso[(int)$mes[1]['mes']], $mes[1]['count']],\n ],\n 'dia' => [\n 'atual' => [$dia[0]['dia'], $dia[0]['count']],\n 'ultimo' => [$dia[1]['dia'], $dia[1]['count']],\n ]\n ];\n\n return $this->listResponse($pedidos);\n }", "function getOrder();", "public function getOpenOrders(): array;", "public function index()\r\n {\r\n $orders = Order::orderBy('created_at', 'desc')->get();\r\n\r\n // Stats\r\n $stats = [];\r\n\r\n // Stats - Orders - Processing\r\n $stats['orders_processing'] = Order::where('status', 'processing')->count();\r\n\r\n // Stats - Orders - Processing - Total\r\n $stats['orders_processing_total'] = Order::where('status', 'processing')->sum('total');\r\n\r\n // Stats - Orders - Month to Date\r\n $stats['orders_month_to_date'] = Order::where('created_at', '>=', Carbon::now('America/Los_Angeles')->startOfMonth())->count();\r\n //$stats['orders_month_to_date'] = Order::where('created_at', '>=', $now->modify('first day of this month'))->count(); //this works\r\n\r\n // Stats - Orders - Month to Date - Total\r\n $stats['orders_month_to_date_total'] = Order::where('created_at', '>=', Carbon::now('America/Los_Angeles')->startOfMonth())->sum('total');\r\n\r\n // Stats - Orders - Lifetime - Count\r\n $stats['orders_lifetime'] = Order::count();\r\n\r\n // Stats - Orders - Lifetime - Total\r\n $stats['orders_lifetime_total'] = Order::sum('total');\r\n\r\n return view('admin.orders.index', [\r\n 'orders' => $orders,\r\n 'stats' => $stats\r\n ]);\r\n }", "private function GetOrders()\n\t{\t$orders = array();\n\t\t$where = array();\n\t\t\n\t\tif ($this->startdate)\n\t\t{\t$where[] = 'orderdate>=\"' . $this->startdate . ' 00:00:00\"';\n\t\t}\n\t\tif ($this->enddate)\n\t\t{\t$where[] = 'orderdate<=\"' . $this->enddate . ' 23:59:59\"';\n\t\t}\n\t\tif (!$this->showunpaid)\n\t\t{\t$where[] = 'NOT paiddate=\"0000-00-00 00:00:00\"';\n\t\t}\n\t\t\n\t\t$sql = 'SELECT * FROM storeorders';\n\t\tif ($wstr = implode(' AND ', $where))\n\t\t{\t$sql .= ' WHERE ' . $wstr;\n\t\t}\n\t\t$sql .= ' ORDER BY orderdate DESC';\n\t\t\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\t$orders[$row['id']] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $orders;\n\t}", "public function exportOrders()\n\t{\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.OrderEvent' );\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.ProductEvent' );\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.ProspectExportEvent' );\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.OrderHistoryEvent' );\n\t\t\n\t\t$baseURL = Yii::app()->request->hostInfo;\n\t\t$pageSize = 100;\n\n\t\t$allOrders = Yii::app()->db->createCommand()\n\t\t ->select('o.id, o.user_id, o.name, o.email, o.sum, o.date_create, o.status_id')\n\t\t ->from('kalitniki_order AS o')\n\t\t ->group('o.id');\n\t\n\t $allOrders = $allOrders->queryAll();\n\n\t $orderCount = count( $allOrders );\n\t \n\t $pages = ( $orderCount % $pageSize ) > 0 ? floor( $orderCount / $pageSize ) + 1 : $orderCount / $pageSize;\n\t \n\t for ( $currentPage = 0; $currentPage <= $pages - 1; $currentPage++ )\n\t {\n\t \t$dataExport = new OrderHistoryEvent;\n\t \t\n\t \t$offset = $currentPage * $pageSize;\n\t \t$collection = array_slice( $allOrders, $offset, $pageSize );\n\t \t\n\t\t foreach ( $collection as $order )\n\t\t {\n\t\t \t$orderProducts = Yii::app()->db->createCommand()\n\t\t\t ->select('op.name AS product_name, op.price, op.count, op.sum,\n\t\t\t \t\t\tp.id, p.url, p.articul, p.notice, i.name AS img, s.name AS section')\n\t\t\t ->from('kalitniki_order_product AS op')\n\t\t\t ->where('op.order_id = ' . $order['id'])\n\t\t\t ->join('kalitniki_product AS p', 'op.name = p.name')\n\t\t\t ->join('kalitniki_product_img AS i', 'p.id = i.parent')\n\t\t\t ->join('kalitniki_product_assignment AS a', 'p.id = a.product_id')\n\t\t\t ->join('kalitniki_product_section AS s', 's.id = a.section_id')\n\t\t\t ->group('p.id');\n\t\t\t $orderProducts = $orderProducts->queryAll();\n\t\t\t \n\t\t\t $qtyTotal = 0;\n\t\t\t \n\t\t\t $customer = Yii::app()->db->createCommand()\n\t\t\t ->select('c.user_id AS id, c.name, c.email')\n\t\t\t ->from('kalitniki_order AS c')\n\t\t\t ->where('c.id = ' . $order['id']);\n\t\t\t $customer = $customer->queryAll();\n\t\t\t $customer = $customer[0];\n\t\t\t\t\n\t\t\t\t$customer['date_create'] = null;\n\t\t\t\t\n\t\t\t\tif ( $customer['id'] )\n\t\t\t\t{\n\t\t\t\t\t$dateCreate = Yii::app()->db->createCommand()\n\t\t\t\t ->select('u.date_create')\n\t\t\t\t ->from('kalitniki_user AS u')\n\t\t\t\t ->where('u.id = ' . $customer['id']);\n\t\t\t\t $dateCreate = $dateCreate->queryAll();\n\t\t\t\t $dateCreate = $dateCreate[0];\n\t\t\t\t $customer['date_create'] = $dateCreate['date_create'];\n\t\t\t\t}\n\t\t\t \n\t\t\t $dataCustomer = new ProspectExportEvent;\n\t\t\t $dataCustomer->customer_id = $customer['id'];\n\t\t $dataCustomer->customer_first_name = $customer['name'];\n\t\t $dataCustomer->customer_last_name = \"\";\n\t\t $dataCustomer->customer_email = $customer['email'];\n\t\t $dataCustomer->customer_date_created = $customer['date_create'];\n\t\t $dataCustomer->customer_last_login_date = \"\";\n \n\t\t\t $data = new OrderEvent;\n\t\t\t $data->customer = $dataCustomer;\n\t\t\t $data->order_id = $order['id'];\n\t\t\t $data->date_created = $order['date_create'];\n\t\t\t $data->status = $this->getOrderStatus( $order['status_id'] );\n\t\t\t $data->price_total = $order['sum'];\n\t\t\t $data->qty_total = $qtyTotal;\n\t\t\t $data->products = array();\n\t\t\t \n\t\t\t foreach ($orderProducts as $orderProduct)\n\t\t\t {\n\t\t\t \t$productCategories = array();\n \t\t\t$productCategories[] = $orderProduct['section'];\n\t\t\t \t\n\t\t\t \t$dataProduct = new ProductEvent;\n\t\t \t$dataProduct->product_id = $orderProduct['id'];\n\t\t \t$dataProduct->product_name = $orderProduct['product_name'];\n\t\t \t$dataProduct->product_desc = $orderProduct['notice'];\n\t\t \t$dataProduct->product_sku = $orderProduct['articul'];\n\t\t \t$dataProduct->product_image = $baseURL . '/' . $orderProduct['img'];\n\t\t \t$dataProduct->product_url = $baseURL . '/' . $orderProduct['url'];\n\t\t \t$dataProduct->product_qty = (int) $orderProduct['count'];\n\t\t \t$dataProduct->product_price = $orderProduct['price'];\n\t\t \t$dataProduct->product_total_val = $orderProduct['sum'];\n\t\t \t$dataProduct->product_categories = $productCategories;\n\t\t \t\n\t\t \t$data->products[] = $dataProduct;\n \t\t\t$data->qty_total += $dataProduct->product_qty;\n\t\t\t }\n\n\t\t\t $dataExport->orders[] = $data;\n\t\t }\n\t\t \n\t\t $this->client->sendEvent( $dataExport );\n\t }\n\t}", "public function getPriorMonthData($store_id = 0) {\n\t\t// $startMonth = 1;\n\t\t// $startYear = 2017;\n\t\t// $endMonth = 1;\n\t\t// $endYear = 2017;\n\t\t// return $this->getDataByInterval($startMonth, $startYear, $endMonth, $endYear,$store_id);\n\t\t$dates = getPeriods('PriorMonth');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear'],$store_id);\n\t}", "public function buildOperatingSystemGraph(): array\n {\n $startDate = Carbon::now()->subMonths(7);\n\n $operatingSystemData = AnalyticsFacade::performQuery(\n Period::create($startDate, $this->endDate),\n 'ga:pageviews',\n [\n 'dimensions' => 'ga:operatingSystem,ga:yearMonth',\n 'sort' => '-ga:operatingSystem',\n 'filters' => 'ga:operatingSystem==Windows,'\n .'ga:operatingSystem==Macintosh,'\n .'ga:operatingSystem==Linux'\n ]\n );\n\n $operatingSystemGraph = [];\n for ($i = 0; $i < 8; $i++) {\n $date = Carbon::now()->subMonths($i);\n\n $operatingSystemGraph[$date->format('Ym')] = [\n 'period' => $date->format('Y-m-d'),\n 'Windows' => 0,\n 'Macintosh' => 0,\n 'Linux' => 0\n ];\n }\n\n foreach ($operatingSystemData->rows as $os) {\n $operatingSystemGraph[$os[1]][$os[0]] = $os[2];\n }\n $operatingSystemGraph = array_reverse($operatingSystemGraph);\n\n return $operatingSystemGraph;\n }", "public function findAllOrders()\n {\n return $this->createQueryBuilder('o')\n ->orderBy('o.createdDate' , 'DESC');\n }", "public function woocommerce_reports_monthly_sales_orders($orders, $month) {\n\t\tglobal $wpdb;\n\n\t\t$this->set_reporting_flag(true);\n\n\t\t// If no data was retrieved by WooCommerce, just return the empty dataset\n\t\tif(empty($orders)) {\n\t\t\treturn $orders;\n\t\t}\n\n\t\t$start_date = $month . '01000000';\n\t\t$end_date = date('Ymd000000', strtotime($start_date . ' +1 month'));\n\n\t\t$SQL = \"\n\t\t\tSELECT\n\t\t\t\tSUM(meta_order.meta_value) AS total_sales\n\t\t\t\t,COUNT(posts.ID) AS total_orders\n\t\t\tFROM\n\t\t\t\t$wpdb->posts AS posts\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->postmeta AS meta_order ON\n\t\t\t\t\t(meta_order.post_id = posts.ID) AND\n\t\t\t\t\t(meta_order.meta_key = '_order_total_base_currency')\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->term_relationships AS rel ON\n\t\t\t\t\t(rel.object_ID = posts.ID)\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->term_taxonomy AS taxonomy ON\n\t\t\t\t\t(taxonomy.term_taxonomy_id = rel.term_taxonomy_id)\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->terms AS term ON\n\t\t\t\t\t(term.term_id = taxonomy.term_id)\n\t\t\tWHERE\n\t\t\t\t(posts.post_type = 'shop_order') AND\n\t\t\t\t(posts.post_status = 'publish') AND\n\t\t\t\t(taxonomy.taxonomy = 'shop_order_status') AND\n\t\t\t\t(term.slug IN ('\" . implode(\"','\", apply_filters('woocommerce_reports_order_statuses', array('completed', 'processing', 'on-hold'))) . \"')) AND\n\t\t\t\t(posts.post_date >= $start_date) AND\n\t\t\t\t(posts.post_date < $end_date)\n\t\t\";\n\n\t\t$orders = $wpdb->get_row($SQL);\n\t\t$this->set_reporting_flag(false);\n\n\t\treturn $orders;\n\t}", "public function buyer_orders()\n {\n $query = $this->db->where('buyer_id', $this->current_user->user_id)\n ->order_by('time desc')\n //->order_by('progress asc, time desc')\n ->get('orders');\n #echo $this->db->last_query();\n return ($query->num_rows() > 0) ? $this->build_array($query->result_array()) : array();\n\n }", "function get_historical_views_chart() {\r\n\tif (current_user_authored($post)){\r\n\t\tglobal $wp_query;\r\n\t\tget_and_store_page_views(false, true);\r\n\t\t$historical_views = get_user_meta($wp_query->get_queried_object_id(), 'ga_author_historical_views');\r\n\r\n\t\tif(empty($historical_views)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$page_views_string = \"'\" . implode ( \"', '\", array_keys($historical_views[0]) ) . \"'\";\r\n\t\t$dates_string = implode( ',', $historical_views[0] );\r\n\r\n\t\t$result = '<section class=\"stats_charts\">\r\n\t\t\t\t\t\t<h2 class=\"kicker\">All articles by month</h2>\r\n\t\t\t\t\t\t<div class=\"graphic\">\r\n\t\t\t\t\t\t\t<canvas id=\"monthly-views\" width=\"800\" height=\"450\"></canvas>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</section>';\r\n\t\t$result.= '<script>\r\n\t\t\t\t\t\tnew Chart(document.getElementById(\"monthly-views\"), {\r\n\t\t\t\t\t\t\ttype: \"line\",\r\n\t\t\t\t\t\t\tdata: {\r\n\t\t\t\t\t\t\t\tlabels: [' . $page_views_string . '],\r\n\t\t\t\t\t\t\t\tdatasets: [{ \r\n\t\t\t\t\t\t\t\t\tdata: [' . $dates_string . '],\r\n\t\t\t\t\t\t\t\t\tlabel: \"Users\",\r\n\t\t\t\t\t\t\t\t\tborderColor: \"#BF2528\",\r\n\t\t\t\t\t\t\t\t\tfill: true\r\n\t\t\t\t\t\t\t\t},\r\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\toptions: {\r\n\t\t\t\t\t\t\t\ttitle: {\r\n\t\t\t\t\t\t\t\tdisplay: false,\r\n\t\t\t\t\t\t\t\ttext: \"Monthly views\"\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\tlegend: {\r\n\t\t\t\t\t\t\t\t\t\tdisplay: false\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\tlayout: {\r\n\t\t\t\t\t\t\t\t\tpadding: {\r\n\t\t\t\t\t\t\t\t\t\tleft: 5,\r\n\t\t\t\t\t\t\t\t\t\tright: 5,\r\n\t\t\t\t\t\t\t\t\t\ttop: 25,\r\n\t\t\t\t\t\t\t\t\t\tbottom: 5\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\t\t\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t</script>';\r\n\t\treturn $result;\r\n\t}\r\n}", "public function getOutstandingOrders()\n {\n $order = $this->db->prepare(<<<SQL\nSELECT orders.order_id, orders.order_date, orders.arrival_date, orders.student_number\nFROM orders\nWHERE orders.arrival_date IS NULL\nORDER BY orders.order_date;\nSQL\n );\n $order->execute();\n return $order->fetchAll(\\PDO::FETCH_OBJ);\n }", "public function getTransactionDataLastMonth($customerId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-30days\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $transactionResource = $this->_transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByDay($from, $to, $customerId);\n $result = $this->_processReceivedTransactionData($data, $result);\n \n $data = $transactionResource->getSpentCreditTransactionsByDay($from, $to, $customerId);\n $result = $this->_processSpentTransactionData($data, $result);\n \n $result = array_values($result);\n return $result;\n }", "function get_data(){\r\n include_once 'config.php';\r\n global $CONFIG;\r\n try{\r\n $db = new PDO('mysql:host='.$CONFIG['dbhost'].';dbname='.$CONFIG['dbname'].';charset=utf8', $CONFIG['dbuser'], $CONFIG['dbpass']);\r\n \r\n if(intval($_GET['last'])>1){\r\n $stmt = $db->query(\"SELECT date, weight FROM graph order by date DESC limit \".intval($_GET['last']));\r\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n $result = array_reverse($result);\r\n }else{\r\n $stmt = $db->query(\"SELECT date, weight FROM graph order by date ASC\");\r\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n }catch(PDOException $e){\r\n var_dump($e);\r\n }\r\n\r\n return $result;\r\n}", "public function allOrder()\n {\n $orders = Order::where('id','!=',0)\n ->orderBy('id','desc')\n ->get()\n ->groupBy(function ($data){\n return $data->created_at->format('M-Y');\n });\n\n return view('user.admin.order.all-order',[\n 'orders' => $orders\n ]);\n }", "public static function data_last_month() {\n\t$month = date('m');\n\t$year = date('Y');\n\t$day = date(\"d\", mktime(0,0,0, $month+1, 0, $year));\n\n\treturn date('Y-m-d', mktime(0,0,0, $month, $day, $year));\n}", "public function getTodayRevisitOrders()\n {\n return \\DB::select(\"SELECT a.id, a.propaddress1, a.propaddress2, a.propcity, a.propstate, a.propzip, s.descrip as status_name FROM appr_dashboard_delay_order d LEFT JOIN appr_order a ON (a.id=d.orderid) LEFT JOIN order_status s ON (a.status=s.id) WHERE d.created_date BETWEEN :from AND :to AND d.delay_date BETWEEN :t AND :b\", [':from' => strtotime('today'), ':to' => strtotime('tomorrow'), ':t' => strtotime('today'), ':b' => strtotime('tomorrow')]);\n }", "function getOrderings() ;", "public function woocommerce_dashboard_sales() {\n\t\t$screen = get_current_screen();\n\t\tif (!$screen || $screen->id!=='dashboard') return;\n\n\t\tglobal $woocommerce, $wp_locale;\n\t\tglobal $current_month_offset, $the_month_num, $the_year;\n\t\t$this->set_reporting_flag(true);\n\n\t\t// Get orders to display in widget\n\t\tadd_filter('posts_where', 'orders_this_month');\n\n\t\t$args = array(\n\t\t\t\t'numberposts' => -1,\n\t\t\t\t'orderby' => 'post_date',\n\t\t\t\t'order' => 'DESC',\n\t\t\t\t'post_type' => 'shop_order',\n\t\t\t\t'post_status' => 'publish' ,\n\t\t\t\t'suppress_filters' => false,\n\t\t\t\t'tax_query' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'taxonomy' => 'shop_order_status',\n\t\t\t\t\t'terms' => apply_filters('woocommerce_reports_order_statuses', array('completed', 'processing', 'on-hold')),\n\t\t\t\t\t'field' => 'slug',\n\t\t\t\t\t'operator' => 'IN'\n\t\t\t\t)\n\t\t\t\t)\n\t\t);\n\t\t$orders = get_posts($args);\n\n\t\t$order_counts = array();\n\t\t$order_amounts = array();\n\n\t\t// Blank date ranges to begin\n\t\t$month = $the_month_num;\n\t\t$year = (int) $the_year;\n\n\t\t$first_day = strtotime(\"{$year}-{$month}-01\");\n\t\t$last_day = strtotime('-1 second', strtotime('+1 month', $first_day));\n\n\t\tif ((date('m') - $the_month_num)==0) :\n\t\t\t$up_to = date('d', strtotime('NOW'));\n\t\telse :\n\t\t\t$up_to = date('d', $last_day);\n\t\tendif;\n\t\t$count = 0;\n\n\t\twhile ($count < $up_to) :\n\t\t\t$time = strtotime(date('Ymd', strtotime('+ '.$count.' DAY', $first_day))).'000';\n\n\t\t\t$order_counts[$time] = 0;\n\t\t\t$order_amounts[$time] = 0;\n\n\t\t\t$count++;\n\t\tendwhile;\n\n\t\tif ($orders) :\n\t\t\tforeach ($orders as $order) :\n\t\t\t\t$order_data = new Aelia_Order($order->ID);\n\n\t\t\t\tif ($order_data->status=='cancelled' || $order_data->status=='refunded') continue;\n\n\t\t\t\t$time = strtotime(date('Ymd', strtotime($order->post_date))).'000';\n\n\t\t\t\tif (isset($order_counts[$time])) :\n\t\t\t\t\t$order_counts[$time]++;\n\t\t\t\telse :\n\t\t\t\t\t$order_counts[$time] = 1;\n\t\t\t\tendif;\n\n\t\t\t\tif (isset($order_amounts[$time])) :\n\t\t\t\t\t$order_amounts[$time] = $order_amounts[$time] + $order_data->order_total_base_currency;\n\t\t\t\telse :\n\t\t\t\t\t$order_amounts[$time] = (float) $order_data->order_total_base_currency;\n\t\t\t\tendif;\n\n\t\t\tendforeach;\n\t\tendif;\n\n\t\tremove_filter('posts_where', 'orders_this_month');\n\n\t\t/* Script variables */\n\t\t$params = array(\n\t\t\t'currency_symbol' \t=> get_woocommerce_currency_symbol(),\n\t\t\t'number_of_sales' \t=> absint(array_sum($order_counts)),\n\t\t\t'sales_amount' \t=> woocommerce_price(array_sum($order_amounts)),\n\t\t\t'sold' \t\t\t\t=> __('Sold', 'woocommerce'),\n\t\t\t'earned' \t\t=> __('Earned', 'woocommerce'),\n\t\t\t'month_names' \t=> array_values($wp_locale->month_abbrev),\n\t\t);\n\n\t\t$order_counts_array = array();\n\t\tforeach ($order_counts as $key => $count) :\n\t\t\t$order_counts_array[] = array($key, $count);\n\t\tendforeach;\n\n\t\t$order_amounts_array = array();\n\t\tforeach ($order_amounts as $key => $amount) :\n\t\t\t$order_amounts_array[] = array($key, $amount);\n\t\tendforeach;\n\n\t\t$order_data = array('order_counts' => $order_counts_array, 'order_amounts' => $order_amounts_array);\n\n\t\t$params['order_data'] = json_encode($order_data);\n\n\t\t// Queue scripts\n\t\t$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';\n\n\t\twp_register_script('woocommerce_dashboard_sales', $woocommerce->plugin_url() . '/assets/js/admin/dashboard_sales' . $suffix . '.js', array('jquery', 'flot', 'flot-resize'), '1.0');\n\t\twp_register_script('flot', $woocommerce->plugin_url() . '/assets/js/admin/jquery.flot'.$suffix.'.js', 'jquery', '1.0');\n\t\twp_register_script('flot-resize', $woocommerce->plugin_url() . '/assets/js/admin/jquery.flot.resize'.$suffix.'.js', 'jquery', '1.0');\n\n\t\twp_localize_script('woocommerce_dashboard_sales', 'params', $params);\n\n\t\twp_print_scripts('woocommerce_dashboard_sales');\n\t\t$this->set_reporting_flag(false);\n\t}", "public function getOrder()\n {\n // TODO: Implement getOrder() method.\n }", "public function getOrder()\n {\n // TODO: Implement getOrder() method.\n }", "public function getOrder()\n {\n // TODO: Implement getOrder() method.\n }", "function get_totals(){\r\n $this_month = date('n', time()) - 1;\r\n\r\n $this->payments_this_month = $this->payment_totals_by_month[$this_month];\r\n\r\n $last_month = $this_month > 0 ? $this_month - 1 : false;\r\n if($last_month){\r\n $payments_last_month = $this->payment_totals_by_month[$last_month];\r\n\r\n if($payments_last_month > 0)\r\n $this->payments_this_month_change_percentage = (($this->payments_this_month/$payments_last_month) - 1) * 100;\r\n else $this->payments_this_month_change_percentage = 0;\r\n }\r\n }", "function getOrder()\n{\n\n}", "function getOrdersData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n $total=0;\n if($varAction=='today' || $varAction=='yesterday'){\n if($varAction=='today'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n \n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $arrClms = array('TIME(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded < \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$i]['time'][]=$arrData;\n $arrRes['data'][$i]['count']=$count;\n $total +=$count;\n }\n $arrRes['total']=$total;\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_week'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$count;\n $total +=$count;\n }\n $arrRes['total']=$total;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_month'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $lastMonth.'=='.$lastMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$count;\n $total +=$count; \n }\n $arrRes['total']=$total;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "public static function select_count_by_current_month(){\n return DB::table('tb_order')\n ->whereRaw('month(datetime) = month(now()) and year(datetime) = year(now())', [])\n //->where('month(datetime)', 'month(now())')\n //->where('year(datetime)', 'year(now())')\n ->count();\n\t}", "protected function obtainDataOrders()\n\t{\n\t\t$this->dbQueryResult['ORDERS'] = CSaleOrder::GetList(array($this->sortBy => $this->sortOrder), $this->filter);\n\t\t$this->dbQueryResult['ORDERS']->NavStart($this->arParams[\"ORDERS_PER_PAGE\"], false);\n\n\t\tif(empty($this->dbQueryResult['ORDERS']))\n\t\t\treturn;\n\n\t\twhile ($arOrder = $this->dbQueryResult['ORDERS']->GetNext())\n\t\t{\n\t\t\t$arOBasket = array();\n\t\t\t$dbBasket = CSaleBasket::GetList(array('NAME' => 'asc'), array(\"ORDER_ID\"=>$arOrder[\"ID\"]), false, false, array('*'));\n\t\t\twhile ($arBasket = $dbBasket->Fetch())\n\t\t\t{\n\t\t\t\tif (CSaleBasketHelper::isSetItem($arBasket))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$arOBasket[] = $arBasket;\n\t\t\t}\n\n\t\t\t$this->dbResult['ORDERS'][] = array(\n\t\t\t\t\"ORDER\" => $arOrder,\n\t\t\t\t\"BASKET_ITEMS\" => $arOBasket,\n\t\t\t);\n\t\t}\n\t}", "public function getOrders() \n {\n return $this->_fields['Orders']['FieldValue'];\n }", "public function getMomentsByMonth() {\n\t\ttry {\n\t\t\t$timezone = \\Auth::User()->station->getStationTimezone();\n\n\t\t\t$station_time = new \\DateTime('now', new \\DateTimeZone($timezone));\n\t\t\t$offset = $station_time->getOffset();\n\n\t\t\t$date = Carbon::now($timezone);\n\n\t\t\t$year_start = $date->copy()->startOfMonth()->subMonths(12);\n\n\t\t\t//If station is Nova we want to start at March 11 since this is when we launched with them\n\t\t\tif(\\Auth::User()->station->id == 8 && $year_start->lt(Carbon::parse('2016-03-11'))) {\n\t\t\t\t$year_start = Carbon::parse('2016-03-11');\n\t\t\t}\n\t\t\t$year_end = $date;\n\n\t\t\t$moments = \\DB::table('airshr_events')\n\t\t\t\t->select(\\DB::raw('MONTH(FROM_UNIXTIME(record_timestamp)) AS month, \n\t\t\t\tYEAR(FROM_UNIXTIME(record_timestamp)) AS year,\n\t\t\t\tWEEK(FROM_UNIXTIME(record_timestamp)) as week, \n\t\t\t\tCOUNT(*) as count'))\n\t\t\t\t->where('station_id', '=', \\Auth::User()->station->id)\n//\t\t\t\t->where('event_data_status', '=', 1)\n\t\t\t\t->where('record_timestamp', '>=', $year_start->timestamp)\n\t\t\t\t->where('record_timestamp', '<=', $year_end->timestamp)\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) >= 6')\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) < 22')\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) >= 6*60*60\") //\"MOD(record_timestamp + {$offset}, 86400)\" gets seconds since midnight\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) < 22*60*60\") // We then compare the hours from midnight to check if it is between the hours we want\n\t\t\t\t->groupBy('week')\n\t\t\t\t->orderBy('year')\n\t\t\t\t->orderBy('month')\n\t\t\t\t->orderBy('week')\n\t\t\t\t->get();\n\n\t\t\t$total_moments = 0;\n\t\t\t$moments_this_month = 0;\n\n\t\t\tforeach($moments as $moment) {\n\t\t\t\t$total_moments += $moment->count;\n\t\t\t\tif($moment->month == $date->month && $moment->year == $date->year) {\n\t\t\t\t\t$moments_this_month += $moment->count;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn response()->json(array('code' => 0,\n\t\t\t\t'moments' => $moments,\n\t\t\t\t'moments_this_month' => $moments_this_month,\n\t\t\t\t'total_moments' => $total_moments\n\t\t\t\t));\n\t\t\t\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}", "public function actionGetOrders(): \\yii\\web\\Response\n {\n return $this->asJson(CommerceReports::$plugin->orders->getOrders());\n }", "public static function getOrderHistoryOfUser() {\n return $allOrders = Order::where(\"user_id\", Auth::id())\n ->select(\"*\")->orderBy(\"created_at\", \"desc\")->get();\n }", "public function chartApiOutput() {\n\n $user = Auth::user();\n $chart = new DataChart();\n $mounthOutput = $this->getQueryChart($user);\n $chart->dataset('Last Mounth output', 'line', $mounthOutput->values())\n ->color('rgb(0,123,255)');;\n return json_decode($chart->api());\n }", "public function OrderMonth_Year()\n {\n\t $arrMonth=array();\n\t $year=$this->OrderYear();\n\t foreach($year as $a)\n\t {\n\t\t $arr=array();\n\t\t $select= \"SELECT DISTINCT(month(orderDate)) As orderMonth FROM orders \n\t\t \t\t\twhere year(orderDate)=\".$a->getorderYear(). \" order by orderDate\";\n\t\t $result=$this->executeSelect($select);\n\t\t while($row=mysqli_fetch_array($result))\n\t\t {\n\t\t\t $month=new ordersDto();\n\t\t\t $month->setorderMonth($row['orderMonth']);\n\t\t\t $arr[]=$month;\n\t\t }\n\t\t $this->DisConnectDB();\n\t\t $arrMonth[]=$arr;\n\t }\n/*\t\tfor( $i=0; $i<count($arrMonth); $i++)\n\t\t for($j=0; $j<count($arrMonth[$i]); $j++)\n\t\t\t echo $arrMonth[$i][$j]->getorderMonth();\n\t Thử kiểm tra xem có lấy đc các tháng trong các năm hay k -->>Lấy được\n*/\t\t\n\treturn $arrMonth;\n }", "private static function getAllOldSystem(): array\n {\n $ordersList = [];\n\n $args = [\n 'post_type' => 'shop_order',\n 'post_status' => self::$ordersStatuses,\n 'posts_per_page' => self::$limit,\n 'paged' => self::$currentPage,\n 'orderby' => 'date',\n 'order' => 'DESC',\n 'meta_query' => [\n 'relation' => 'OR',\n [\n 'key' => '_moloni_sent',\n 'compare' => 'NOT EXISTS'\n ],\n [\n 'key' => '_moloni_sent',\n 'value' => '0',\n 'compare' => '='\n ]\n ],\n ];\n\n $args = apply_filters('moloni_before_pending_orders_fetch', $args);\n\n $query = new WP_Query($args);\n self::$totalPages = $query->max_num_pages;\n\n foreach ($query->posts as $order) {\n $ordersList[] = new WC_Order($order->ID);\n }\n\n return $ordersList;\n }", "public function getOrders()\n {\n return $this->orders;\n }", "public function vendor_orders()\n {\n $query = $this->db->where('vendor_hash', $this->current_user->user_hash)\n ->where('progress >', '0')\n ->order_by('time desc')\n ->get('orders');\n\n if ($query->num_rows() > 0) {\n $row = $query->result_array();\n return $this->build_array($row);\n } else {\n return array();\n }\n }", "public static function getChartData(Request $request)\n {\n $user = auth()->user();\n $chart = new Chart($request);\n $query_params = $chart->setQueryParams();\n\n $query = (new Order())->newQuery();\n\n if (Bouncer::is($user)->an('editor')) {\n $query->where('client_id', $user->clientId());\n }\n\n $orders = $query->select('total', 'created_at')\n ->whereBetween('created_at', [$query_params['from'], $query_params['to']])\n ->orderBy('created_at')\n ->get()\n ->groupBy(function ($val) use ($query_params) {\n return Carbon::parse($val->created_at)->format($query_params['group']);\n });\n\n return $chart->returnQueryData($query_params['iterator'], $orders);\n }", "function ppt_resources_get_next_planned_orders($data)\n{\n global $user;\n $months = array(\n \"01\" => 'December',\n \"02\" => 'January',\n \"03\" => 'February',\n \"04\" => 'March',\n \"05\" => 'April',\n \"06\" => 'May',\n \"07\" => 'June',\n \"08\" => 'July',\n \"09\" => 'August',\n \"10\" => 'September',\n \"11\" => 'October',\n \"12\" => 'November',\n );\n\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n if (empty($data['accounts'])) {\n return services_error('Accounts is not defined!', 500);\n }\n\n if (empty($data['products'])) {\n return services_error('Products is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = $data['accounts'];\n $products = $data['products'];\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'planned_order')\n ->fieldCondition('field_planned_account', 'target_id', $accounts, 'IN')\n ->fieldCondition('field_planned_product', 'target_id', $products, 'IN')\n ->fieldCondition('field_planned_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_period', 'value', $end_date, '<=')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n $final_arr = [];\n\n if (isset($records['node'])) {\n $nodes_ids = array_keys($records['node']);\n $nodes = node_load_multiple($nodes_ids);\n\n foreach ($nodes as $node) {\n // Get node planned product name.\n $planned_product_tid = $node->field_planned_product['und'][0]['target_id'];\n $planned_product = taxonomy_term_load($planned_product_tid);\n $planned_product_name = $planned_product->name;\n\n // Get node date for product (planned).\n if (isset($node->field_planned_period['und'])) {\n $node_date = $node->field_planned_period['und'][0]['value'];\n $planned_month = date(\"F\", strtotime($node_date));\n }\n\n // Get node values for planned quantity.\n $planned_quantity = 0;\n if (isset($node->field_planned_quantity['und'])) {\n $planned_quantity = $node->field_planned_quantity['und'][0]['value'];\n }\n\n // If product already exists, update its values for node months.\n if (isset($final_arr['planned'][$planned_product_name])) {\n if (isset($final_arr['planned'][$planned_product_name][$planned_month])) {\n $final_arr['planned'][$planned_product_name][$planned_month][0] += (int) $planned_quantity;\n } else {\n $final_arr['planned'][$planned_product_name][$planned_month][0] = [(int) $planned_quantity];\n }\n } else {\n // Initialze product array with 0 for all months, then update it with current node data.\n $final_arr['planned'][$planned_product_name] = [];\n for ($i = 1; $i <= 12; $i++) {\n $month = $months[sprintf('%02d', $i)];\n $final_arr['planned'][$planned_product_name][$month] = [0];\n }\n $final_arr['planned'][$planned_product_name][$planned_month] = [(int) $planned_quantity];\n }\n }\n }\n return $final_arr;\n}", "public static function totalPreMonth(){\n $data = DB::table('auctions')->select(DB::raw('substr(date,1,2) as month'), DB::raw('SUM(tax_amount) as total'))->groupBy(\"month\")->get();\n return $data;\n }", "private static function getAllNewSystem(): array\n {\n $args = [\n 'post_status' => self::$ordersStatuses,\n 'posts_per_page' => self::$limit,\n 'paged' => self::$currentPage,\n 'orderby' => 'date',\n 'paginate' => true,\n 'order' => 'DESC',\n 'meta_query' => [\n 'relation' => 'OR',\n [\n 'key' => '_moloni_sent',\n 'compare' => 'NOT EXISTS'\n ],\n [\n 'key' => '_moloni_sent',\n 'value' => '0',\n 'compare' => '='\n ]\n ],\n ];\n\n $args = apply_filters('moloni_before_pending_orders_fetch', $args);\n\n $results = wc_get_orders($args);\n\n self::$totalPages = $results->max_num_pages;\n\n return $results->orders;\n }", "private function bottomGridData() {\r\n\t\t\r\n $result = $this->getLatestPeriod();\r\n \r\n if (is_array($result) && !empty($result))\r\n {\r\n $periodResult = array_column($result, \"period\");\r\n $query = \"SELECT \".$this->accountIdField.\" AS SKUID \" .\r\n \",MAX(\".$this->accountNameField.\") AS ACCOUNT \" .\r\n \",\".$this->settingVars->tesco_po_details.\".purchase_order_number AS PON \" .\r\n \",MAX(\".$this->settingVars->tesco_po_details.\".depot_number) AS DEPOT_NO \" .\r\n \",\".$this->settingVars->tesco_po_details.\".period AS PERIOD \" .\r\n \",MAX(\".$this->settingVars->tesco_po_details.\".delivered_on_time) AS DOT \" .\r\n \",SUM((CASE WHEN period IN('\" . implode(\"','\", $periodResult) . \"') THEN total_placed_orders_Cases ELSE 0 END)) AS ORDERED \" .\r\n \",SUM((CASE WHEN period IN('\" . implode(\"','\", $periodResult) . \"') THEN delivered_on_time ELSE 0 END)) AS DELIVERED \" .\r\n \" FROM \".$this->settingVars->tesco_po_details.\", \".$this->settingVars->skutable.\" WHERE \".$this->settingVars->tesco_po_details.\".GID = \".$this->settingVars->skutable.\".GID AND \".$this->settingVars->tesco_po_details.\".skuID = \".$this->settingVars->skutable.\".PIN AND \".$this->settingVars->skutable.\".clientID = '\".$this->settingVars->clientID.\"' AND \".$this->settingVars->skutable.\".GID = \".$this->settingVars->GID.\" AND \".$this->settingVars->tesco_po_details.\".skuID = '\".$_REQUEST['selectedSKUID'].\"' AND \".$this->settingVars->tesco_po_details.\".period IN ('\".implode(\"','\", $periodResult).\"') AND \".$this->commonQueryPart.\" GROUP BY SKUID, PERIOD, PON ORDER BY PERIOD DESC\";\r\n //echo $query; exit;\r\n $redisOutput = $this->redisCache->checkAndReadByQueryHashFromCache($query);\r\n if ($redisOutput === false) {\r\n $result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\r\n $this->redisCache->setDataForHash($result);\r\n } else {\r\n $result = $redisOutput;\r\n }\r\n \r\n if (is_array($result) && !empty($result))\r\n {\r\n foreach($result as $data)\r\n {\r\n $tmp = array();\r\n $tmp[\"SKUID\"] = $data[\"SKUID\"];\r\n $tmp[\"ACCOUNT\"] = $data[\"ACCOUNT\"];\r\n $tmp[\"PO\"] = (int)$data[\"PON\"];\r\n $tmp[\"DEPOT\"] = (int)$data[\"DEPOT_NO\"];\r\n $tmp[\"PERIOD\"] = (int)$data[\"PERIOD\"];\r\n $tmp[\"ORDERED\"] = (int)$data[\"ORDERED\"];\r\n $tmp[\"DOT\"] = (int)$data[\"DOT\"];\r\n $tmp[\"DOT_PER\"] = ($data[\"ORDERED\"] != 0) ? ($data[\"DELIVERED\"]/$data[\"ORDERED\"])*100 : 0;\r\n $tmp[\"DOT_PER\"] = (double)number_format($tmp[\"DOT_PER\"], 1, '.', '');\r\n $tmp[\"SHORT_CASES\"] = $data[\"ORDERED\"]-$data[\"DOT\"];\r\n $finalData[] = $tmp;\r\n }\r\n }\r\n $this->jsonOutput['bottomGridData'] = $finalData;\r\n }\r\n }", "public function findDataLast()\n {\n return $this->getEntityManager()\n ->createQuery(\"SELECT DISTINCT t.number, f.id as finance, f.price as cost, f.gotcarq as gotcarqId\n FROM GazMainBundle:Terminal t\n JOIN GazMainBundle:Finance f WITH f.terminal = t\n\t\t\t\t\t\t\tWHERE (f.gotcarq IS NOT NULL AND f.gotcarq != 0)\n\t\t\t\t\t\t\t AND f.created = (SELECT MIN(f1.created) FROM GazMainBundle:Finance f1\n LEFT JOIN f1.terminal t1\n WHERE t1.id = t.id AND f1.financeType = FALSE)\n\t\t\t\t\t\t\tORDER BY t.number ASC\n \")\n ->getResult();\n }", "public function actionChart()\n {\n $data = Account::find()->where('id_user='.Yii::$app->user->id)->all();\n $accounts = ArrayHelper::map($data, 'id', 'title');\n\n $operationsByAccount = [];\n foreach($accounts as $id_account=>$title){\n $operations = OperationController::findOperationsOfAccount($id_account);\n $operationsByAccount[$title] = $this->splitValueByMonths($operations);\n }\n\n $chart = new Chart($operationsByAccount);\n $data = $chart->data;\n\n return $this->render('chart', [\n 'data' => $data,\n ]);\n }", "public function getLastYearData() {\n\t\t$dates = getPeriods('LastYear');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear'], 12);\t\t\n\t}", "public function AllClosed_Orders_get() {\n extract($_GET);\n $result = $this->feeds_model->AllClosed_Orders();\n return $this->response($result);\n }", "protected function getLastOrder(){\n return $this->_orderFactory->create('Magento\\Sales\\Model\\Order')->loadByIncrementId($this->onepage->getLastOrderId());\n }", "public function get_month_data($month = \"January\", $year = 2015){\n\t\t/* if($year==2015)\n\t\t$year = date('y'); */\n\t\t// echo date( 'F Y');\n\t\t$this->loadModel(\"Invoice.Invoice\");\n\t\t$this->loadModel(\"Transaction.Transaction\");\n\t\t$month_first_day = strtotime( 'first day of ' . $month.' '.$year);\n\t\t$month_last_day = strtotime( 'last day of ' . $month.' '.$year);\n\t\t// echo date('Y-m-d',$month_last_day);\n\t\t// $dt = new DateTime('first Monday of this month');\n\t\t$dt = new DateTime('first Monday of '.$month.' '.$year);\n\t\t// echo $dt->format('Y-m-d');\n\t\t$first_week_start = $dt->getTimestamp(); \n\t\t$week_last = $first_week_start;\n\t\t$this->Invoice->belongsTo = array('Client' => array('className'=>\"Usermgmt.Client\",'foreignKey'=>'client_id'));\n\t\t$this->Transaction->belongsTo = array('Invoice' => array('className'=>\"Invoice.Invoice\",'foreignKey'=>'invoice_id'));\n\t\t$this->Transaction->recursive = 2;\n\t\t$this->Transaction->Behaviors->load('Containable');\n\t\t\n\t\t$all_transactoins = array();\n\t\tfor($current =$month_first_day; ($week_last<$month_last_day && $week_last<time()); $week_last += (7*86400)){\n\t\t\t\n\t\t\t\t$transactions = $this->Transaction->find(\"all\",array(\"conditions\"=>array(\"UNIX_TIMESTAMP(STR_TO_DATE(Transaction.payment_date, '%m-%d-%Y')) >\"=>$current,\"UNIX_TIMESTAMP(STR_TO_DATE(Transaction.payment_date, '%m-%d-%Y')) <\"=>$week_last,'Transaction.status'=>1),'contain'=>array(\"Invoice\"=>array(\"fields\"=>array(\"title\",\"client_id\",\"payment\",\"tax\",\"total\")),\"Invoice.Client\"=>array(\"fields\"=>array(\"first_name\",\"last_name\"))),\"fields\"=>array(\"invoice_id\",\"payment_date\",\"method\")));\n\t\t\t\t\n\t\t\t\t$all_transactoins[date('m/d/Y',$current).'-'.date('m/d/Y',$week_last)] = $transactions;\n\t\t\t\t\n\t\t\t\t// pr($transactions); die;\n\t\t\t\n\t\t\t$current =$week_last;\n\t\t}\n\t\treturn $all_transactoins;\n\t\t\n\t}", "function getAllOrders()\n {\n $dataService = new OrderDataService();\n\n return $dataService->getAllOrders();\n }", "public function monthlyConsumption(Request $request){\n $year = date('Y');\n //List all registered ModBus Gateway\n $gateway = Gateway::where('MANUFACTURER_ID',2)->get();\n //Loop all registered ModBus Gateway\n foreach ($gateway as $modBusIP) {\n $gatewayID = $modBusIP->GATEWAY_ID;\n $floorID = $modBusIP->FLOOR_ID;\n //List all registered Electric Meters in a modbus gateway\n $meters = ElectricMeter::where('GATEWAY_ID',$gatewayID)\n ->where('REG_FLAG',1)->get();\n $months = [];\n //Loop 12times (January to December)\n for($i=1;$i<=12; $i++){\n $perMonthData = 0;\n // Get data of each electric meter per month\n foreach ($meters as $meter) {\n $meterID = $meter->SLAVE_ID;\n //Get the latest reading of electric meter in current month iteration\n $res = EMeterData::where('METER_ID', $meterID)\n ->whereMonth('CREATED_AT', '=', $i)\n ->whereYear('CREATED_AT', '=', $year)\n ->latest()->first();\n if(!empty($res) || $res == !null ){\n //Sum of electric meters\n $perMonthData += $res->CURRENT_MONTH_KWH;\n $perMonthData = round($perMonthData, 4);\n }\n }\n //Random floating number of 1.00 to 10.00 for no month data\n if($perMonthData == 0){\n // $perMonthData = number_format((float)(1 + mt_rand() / mt_getrandmax() * (10 - 1)), 2, '.', '');\n }\n $json = array('months' => substr(date('F', mktime(0, 0, 0,\n $i, 1)),0,3), 'floor_data' => $perMonthData);\n array_push($months, $json);\n }\n return $months;\n }\n }", "private function getOrdersArray(){\n $connection = new Connection();\n $link = $connection->connect();\n $my_id = $this->user->getId();\n $count = $link->query(\"SELECT count(*) FROM transaction WHERE registered_for = '$my_id'\")->fetchColumn();\n if($count > 0){\n $result = $link->query(\"SELECT id FROM transaction WHERE registered_for = '$my_id' ORDER BY date_registered DESC LIMIT $this->ordersCount\");\n $orders = [];\n while($record = $result->fetch()){\n $orders[] = $record;\n }\n $connection = null;\n return $orders;\n }\n else{\n return FALSE;\n }\n }", "public function orders()\n {\n return $this->hasMany(Order::class)->orderBy('created_at', 'DESC');\n }", "public function getPaymentHistory(){\r\n\t\t$result = array();\r\n\t\treturn $result;\r\n\t}", "public function getOrder()\n {\n return $this->__get(\"order\");\n }", "public function getDailyOrdersData($id=null)\n {\n $startDate = date(\"Y-m-d H:i:s\", strtotime('-7 day', time()));\n $endDate = date('Y-m-d H:i:s');\n\n $userData = User::find()->andFilterWhere(['u_id' => $id, 'u_type' => 2])->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n \\Yii::$app->data->getMwsDetails($user->u_mws_seller_id, $user->u_mws_auth_token);\n $orderList = \\Yii::$app->api->getOrdersList('Created', $startDate, $endDate);\n foreach ($orderList as $order) {\n $orderDetail = false;\n $order = (array)$order;\n $order = array_shift($order);\n if($order) {\n $model = AllOrdesList::findOne(['aol_amazon_order_id' => $order['AmazonOrderId'], 'aol_user_id' => $user->u_id]);\n if (!$model) {\n $model = new AllOrdesList();\n }\n $model->aol_amazon_order_id = (key_exists('AmazonOrderId', $order)) ? $order['AmazonOrderId'] : null;\n $model->aol_seller_order_id = (key_exists('SellerOrderId', $order)) ? $order['SellerOrderId'] : null;\n $model->aol_purchase_date = (key_exists('PurchaseDate', $order)) ? $order['PurchaseDate'] : null;\n $model->aol_last_updated_date = (key_exists('LastUpdateDate', $order)) ? $order['LastUpdateDate'] : null;\n $model->aol_order_status = (key_exists('OrderStatus', $order)) ? $order['OrderStatus'] : null;\n $model->aol_fulfilment_channel = (key_exists('FulfillmentChannel', $order)) ? $order['FulfillmentChannel'] : null;\n $model->aol_sales_channel = (key_exists('SalesChannel', $order)) ? $order['SalesChannel'] : null;\n $model->aol_ship_service = (key_exists('ShipServiceLevel', $order)) ? $order['ShipServiceLevel'] : null;\n $model->aol_order_total = (key_exists('OrderTotal', $order)) ? $order['OrderTotal']['Amount'] : 0;\n $model->aol_shipped_items = (key_exists('NumberOfItemsShipped', $order)) ? $order['NumberOfItemsShipped'] : null;\n $model->aol_unshipped_items = (key_exists('NumberOfItemsUnshipped', $order)) ? $order['NumberOfItemsUnshipped'] : null;\n if($model->aol_order_status == 'Shipped') {\n $model->aol_shipping_username = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['Name'] : null;\n $model->aol_shipping_address_1 = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['AddressLine1'] : null;\n $model->aol_shipping_address_2 = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['AddressLine2'] : null;\n $model->aol_shipping_address_3 = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['AddressLine3'] : null;\n $model->aol_city = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['City'] : null;\n $model->aol_country = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['County'] : null;\n $model->aol_district = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['District'] : null;\n $model->aol_state_or_region = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['StateOrRegion'] : null;\n $model->aol_postal_code = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['PostalCode'] : null;\n $model->aol_country_code =(key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['CountryCode'] : null;\n $model->aol_phone = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['Phone'] : null;\n $model->aol_buyer_name = key_exists('BuyerName', $order) ? $order['BuyerName'] : null;\n $model->aol_buyer_email = key_exists('BuyerEmail', $order) ? $order['BuyerEmail'] : null;\n $orderDetail = true;\n }\n $model->aol_user_id = $user->u_id;\n if($model->save(false)) {\n $olModel = OrderDataLog::findOne(['odl_order_id' => $model->aol_amazon_order_id, 'odl_user_id' => $user->u_id]);\n if (!$olModel) {\n $olModel = new OrderDataLog();\n $olModel->odl_order_id = $model->aol_amazon_order_id;\n $olModel->odl_user_id = $user->u_id;\n if($orderDetail) {\n $olModel->odl_shipped_order_data = 1;\n }\n if($olModel->save(false)) {\n echo $model->aol_amazon_order_id.\" Log is Saved. \";\n }\n }\n echo $model->aol_amazon_order_id.\" is Saved. \";\n }\n }\n }\n echo \"Done..\";\n }\n }", "public function orderReport()\n {\n // gunakan startofmonth utk mengambil tanggal 1\n $start = Carbon::now()->startOfMonth()->format('Y-m-d H:i:s');\n //endofmonth untuk mengambil tanggal terakhir dibulan yg berlaku saat ini\n $end = Carbon::now()->endOfMonth()->format('Y-m-d H:i:s');\n //jika user melakukan filter manual, maka parameter date akan terisi\n if(request()->date !=''){\n //maka formating tglnya berdasarkan filter user\n $date = explode(' - ',request()->date);\n $start = Carbon::parse($date[0])->format('Y-m-d'). ' 00:00:01';\n $end = Carbon::parse($date[1])->format('Y-m-d'). ' 23:59:59';\n }\n //dibuat query utk DB menggunakan wherebetween from tgl filter\n $orders = Order::with(['customer.district'])->whereBetween('created_at', [$start, $end])->get();\n return view('report.order',compact('orders'));\n }", "private function grab_data(){\n\t\t$y=0;\n\t\tfor($i=$this->startingmonth;$i>=0;$i--){\n\t\t\t$this->searchmonth = date(\"n\")-$i;\n\t\t\t$this->searchyear = date(\"Y\");\n\t\t\tif(0 >= $this->searchmonth){\n\t\t\t\twhile(0 >= $this->searchmonth){\n\t\t\t\t\t$this->searchmonth += 12;\n\t\t\t\t\t$this->searchyear--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->count_chrono_records();\n\t\t\t$this->monthlyrecordvolume[$i] = intval($this->volume_of_records_in_timerange);\n\t\t\tif(0==$this->max_month_value or $this->monthlyrecordvolume[$i] > $this->max_month_value){\n\t\t\t\t$this->max_month_value = $this->monthlyrecordvolume[$i];\n\t\t\t}\n\t\t\t$this->monthaggregator += $this->monthlyrecordvolume[$i];\n\t\t\t\n\t\t\t$this->count_months_recorded_this_year++;\n\t\t\tif(12 == $this->searchmonth or 0 == $i ){\n\t\t\t\t$this->ave_this_year[$y]['volume'] = intval($this->monthaggregator / $this->count_months_recorded_this_year);\n\t\t\t\t$this->ave_this_year[$y]['month'] = $i;\n\t\t\t\t$this->ave_this_year[$y]['year'] = $this->searchyear;\n\t\t\t\t$this->monthaggregator = 0;\n\t\t\t\t$this->count_months_recorded_this_year = 0;\n\t\t\t\t$y++;\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}", "public function getOrder()\n {\n\n }", "public function getAmountsDataLastMonth($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-30days\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getAmountsByDay($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "function last_month()\n{\n global $db; // golbalize db variable:\n $thisMonth = array(\n \"start\" => date('Y-m-d', strtotime('first day of last month', strtotime(date('Y-m-d')))),\n \"end\" => date('Y-m-d', strtotime('last day of last month', strtotime(date('Y-m-d'))))\n );\n $datesIds = $db->getMany(DATES, [\n 'date' => $thisMonth['start'],\n 'dates.date' => $thisMonth['end']\n ], ['id', 'date'], ['date' => '>=', 'dates.date' => '<=']);\n\n if ($db->count > 0) {\n return $datesIds;\n }\n}", "function orders() {\n\t \treturn $this->hook(\"/{$this->subject_slug}/v1/orders.xml?api_key={$this->api_key}\",\"order\");\n\t}", "public function fetch_orders_date(Request $request) {\n $data['orders'] = Order::whereBetween('created_at', array($request->from, $request->to))->get();\n $data['areas'] = Area::where('deleted', 0)->orderBy('id', 'desc')->get();\n $data['from'] = '';\n $data['to'] = '';\n if (isset($request->from)) {\n $data['from'] = $request->from;\n $data['to'] = $request->to;\n }\n $data['sum_price'] = Order::whereBetween('created_at', array($request->from, $request->to))->sum('subtotal_price');\n $data['sum_delivery'] = Order::whereBetween('created_at', array($request->from, $request->to))->sum('delivery_cost');\n $data['sum_total'] = Order::whereBetween('created_at', array($request->from, $request->to))->sum('total_price');\n return view('admin.orders' , ['data' => $data]);\n }", "function ppt_resources_get_delivered_planned_orders($data)\n{\n global $user;\n $months = array(\n \"01\" => 'December',\n \"02\" => 'January',\n \"03\" => 'February',\n \"04\" => 'March',\n \"05\" => 'April',\n \"06\" => 'May',\n \"07\" => 'June',\n \"08\" => 'July',\n \"09\" => 'August',\n \"10\" => 'September',\n \"11\" => 'October',\n \"12\" => 'November',\n );\n\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n if (empty($data['accounts'])) {\n return services_error('Accounts is not defined!', 500);\n }\n\n if (empty($data['products'])) {\n return services_error('Products is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = $data['accounts'];\n $products = $data['products'];\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'planned_order')\n ->fieldCondition('field_planned_account', 'target_id', $accounts, 'IN')\n ->fieldCondition('field_planned_product', 'target_id', $products, 'IN')\n ->fieldCondition('field_planned_actual_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_actual_period', 'value', $end_date, '<=')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n $final_arr = [];\n\n if (isset($records['node'])) {\n $nodes_ids = array_keys($records['node']);\n $nodes = node_load_multiple($nodes_ids);\n\n foreach ($nodes as $node) {\n // Get node planned product name.\n $planned_product_tid = $node->field_planned_product['und'][0]['target_id'];\n $planned_product = taxonomy_term_load($planned_product_tid);\n $planned_product_name = $planned_product->name;\n\n // Get node date for product (planned).\n if (isset($node->field_planned_actual_period['und'])) {\n $node_date = $node->field_planned_actual_period['und'][0]['value'];\n $delivered_month = date(\"F\", strtotime($node_date));\n }\n\n // Get node values for planned quantity.\n $delivered_quantity = 0;\n if (isset($node->field_planned_delivered_quantity['und'])) {\n $delivered_quantity = $node->field_planned_delivered_quantity['und'][0]['value'];\n }\n\n // If product already exists, update its values for node months.\n if (isset($final_arr['delivered'][$planned_product_name])) {\n if (isset($final_arr['delivered'][$planned_product_name][$delivered_month])) {\n $final_arr['delivered'][$planned_product_name][$delivered_month][0] += (int) $delivered_quantity;\n } else {\n $final_arr['delivered'][$planned_product_name][$delivered_month][0] = [(int) $delivered_quantity];\n }\n } else {\n // Initialze product array with 0 for all months, then update it with current node data.\n $final_arr['delivered'][$planned_product_name] = [];\n for ($i = 1; $i <= 12; $i++) {\n $month = $months[sprintf('%02d', $i)];\n $final_arr['delivered'][$planned_product_name][$month] = [0];\n }\n $final_arr['delivered'][$planned_product_name][$delivered_month] = [(int) $delivered_quantity];\n }\n }\n }\n return $final_arr;\n}", "public function getRecurringOrders();", "public function actionOrder()\n {\n $request = Yii::$app->getRequest();\n $requestParams = $request->getBodyParams();\n \n if (empty($requestParams)) {\n $requestParams = $request->getQueryParams();\n }\n \n $query = Order::find()\n ->where(['customer_id' => $this->customer_id])\n ->andWhere(['<>', 'status_id', Order::STATUS_DRAFT])\n // filter based on date range\n ->andFilterWhere([\n 'between',\n 'ordered_at',\n $request->getBodyParam('order_from'),\n $request->getBodyParam('order_to')\n ]);\n \n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => ['params' => $requestParams],\n 'sort' => ['params' => $requestParams],\n ]);\n \n return $dataProvider;\n }", "public function getPaymentData(\\Magento\\Sales\\Api\\Data\\OrderPaymentInterface $orderPayment)\n {\n $expMonth = $orderPayment->getCcExpMonth();\n $expMonth = is_null($expMonth) ? '' : $expMonth;\n return $expMonth;\n }" ]
[ "0.63019407", "0.62294954", "0.6180937", "0.6114102", "0.60551393", "0.5959811", "0.5848587", "0.58300054", "0.57639945", "0.5739747", "0.5709766", "0.5689291", "0.5674271", "0.5672121", "0.5668826", "0.56526935", "0.56256413", "0.56184655", "0.5602932", "0.55902594", "0.5541491", "0.5535693", "0.55243635", "0.55125517", "0.55074394", "0.54775333", "0.54760104", "0.5470746", "0.5470746", "0.5470746", "0.5470746", "0.5470746", "0.5470746", "0.54537463", "0.54229015", "0.5405396", "0.5405342", "0.5403895", "0.53914434", "0.53792316", "0.5376852", "0.5371368", "0.53651637", "0.53585076", "0.5357161", "0.5351904", "0.5336838", "0.5334002", "0.5332991", "0.5331772", "0.53225774", "0.53129745", "0.5309243", "0.5307559", "0.52797", "0.52797", "0.52797", "0.52742976", "0.52683973", "0.5259795", "0.5255568", "0.5254847", "0.52476865", "0.5245974", "0.52430815", "0.523999", "0.5237497", "0.52348965", "0.52311724", "0.522937", "0.5216025", "0.51956314", "0.5190715", "0.51840067", "0.51803064", "0.51737404", "0.51691777", "0.51606995", "0.51589704", "0.5157532", "0.515657", "0.51530915", "0.5152341", "0.5143538", "0.51390785", "0.51353765", "0.51315707", "0.51270646", "0.5124941", "0.5123103", "0.5122888", "0.512173", "0.51195353", "0.5117067", "0.5112662", "0.51075745", "0.5106057", "0.5096681", "0.5093859", "0.509309" ]
0.5981382
5
Get orders data for graph last year
public function getOrdersDataLastYear($vendorId) { $to = $this->_date->date('Y-m-d'); $from = strtotime($to."-1year"); $from = $this->_date->date('Y-m-d', $from); $to .= ' 23:59:59'; $orderResource = $this->_vendorOrderFactory->create()->getResource(); $data = $orderResource->getNumOfOrderByMonth($from, $to, $vendorId); $result = $this->_processOrderData($data); $result = array_values($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOrders() {\n\t\t$orders = Mage::getModel ( 'sales/order' )->getCollection ()->addAttributeToSelect ( \"*\" )->addAttributeToFilter ( 'status', array ('complete') );\n\t\t$orders_data = $this->preapreOrdersTosend ( $orders );\n\t\treturn $orders_data;\n\t}", "public function getOrdersDataLast2Years($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-2year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getNumOfOrderByMonth($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function searchYear(Request $request){\n $result = Order::with('customer')->where('order_year',$request->search_year)->latest()->get();\n return response()->json($result);\n\n }", "public function OrderYear()\n {//--------------------------------------------------------------Lấy về năm (cái mà có bản ghi trả về)\n\t $arr=array();\n\t $select= \"SELECT DISTINCT(year(orderDate)) As orderYear FROM orders order by orderDate \";\n\t $result=$this->executeSelect($select);\n\t while($row=mysqli_fetch_array($result))\n\t {\n\t\t $year=new ordersDto();\n\t\t $year->setorderYear($row['orderYear']);\n\t\t $arr[]=$year;\n\t }\n\t $this->DisConnectDB();\n\t return $arr;\n }", "public function getLastYearData() {\n\t\t$dates = getPeriods('LastYear');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear'], 12);\t\t\n\t}", "function getSalesByYear() {\n // Function to connect to the DB\n $link = connectToDB();\n\t\n //Initialize <categories> element\n $strCat = \"<categories>\";\n\n //Initialize datasets\n $strAmtDS = \"<dataset seriesname='Revenue'>\";\n $strQtyDS = \"<dataset seriesName='Units Sold' parentYAxis='S'>\";\n\n $strSQL = \"SELECT Year(o.OrderDate) As SalesYear, ROUND(SUM(d.Quantity*p.UnitPrice),0) As Total, SUM(d.Quantity) as Quantity FROM FC_OrderDetails as d,FC_Orders as o,FC_Products as p WHERE o.OrderID=d.OrderID and d.ProductID=p.ProductID GROUP BY Year(o.OrderDate) ORDER BY Year(o.OrderDate)\";\n $result = mysql_query($strSQL) or die(mysql_error());\n\t\n if ($result) {\n while($ors = mysql_fetch_array($result)) {\n $strCat .= \"<category label='\" . $ors['SalesYear'] . \"'/>\";\n\n //Generate the link\n $strLink = urlencode(\"javaScript:updateCharts(\" . $ors['SalesYear'] . \");\");\n $strAmtDS .= \"<set value='\" . $ors['Total'] . \"' link='\" . $strLink . \"'/>\";\n $strQtyDS .= \"<set value='\" . $ors['Quantity'] . \"'/>\";\n }\n }\n mysql_close($link);\n\n\t//Closing elements\n\t$strCat .= \"</categories>\";\n\t$strAmtDS .= \"</dataset>\";\n\t$strQtyDS .= \"</dataset>\";\n\t//Entire XML - concatenation\n\t$strXML = $strCat . $strAmtDS . $strQtyDS;\n\n\treturn $strXML;\n}", "public function getOutstandingOrders()\n {\n $order = $this->db->prepare(<<<SQL\nSELECT orders.order_id, orders.order_date, orders.arrival_date, orders.student_number\nFROM orders\nWHERE orders.arrival_date IS NULL\nORDER BY orders.order_date;\nSQL\n );\n $order->execute();\n return $order->fetchAll(\\PDO::FETCH_OBJ);\n }", "public function get_sales_data(Request $request){\n\n $sales_graph=$this->all_orders->groupBy(function($item){\n return ($item->created_at->format('Y:m'));\n })->map(function($item,$key){\n return ($item->sum('grand_total'));\n });\n $orders_graph=$this->all_orders->groupBy(function($item){\n return ($item->created_at->format('Y:m'));\n })->map(function($item,$key){\n return ($item->count());\n });\n \n $sales_str=\"[\";\n foreach($sales_graph as $key=>$value){\n\n if($sales_graph->last()==$value)\n $sales_str.='{\"Month\" : \"' . $key . '\", \"Sales\":\"'.$value .'\"}';\n else\n $sales_str.='{\"Month\": \"' . $key . '\", \"Sales\":\"'.$value .'\"},';\n }\n $sales_str.=\"]\";\n \n $orders_str=\"[\";\n \n foreach($orders_graph as $key=>$value){\n\n if($orders_graph->last()==$value)\n $orders_str.='{\"Month\" : \"' . $key . '\", \"Orders\":\"'.$value .'\"}';\n else\n $orders_str.='{\"Month\": \"' . $key . '\", \"Orders\":\"'.$value .'\"},';\n }\n $orders_str.=\"]\";\n\n\n echo json_encode([$sales_str,$orders_str]);\n }", "public function getOpenOrders(): array;", "public static function GetDashboard() {\n $date = [];\n $num_orders = [];\n $last_month = \\Carbon\\Carbon::today()->subDays(30);\n $orders = Order::where('created_at', '>=', $last_month)->get()\n ->groupBy(function($item) {\n return $item->created_at->format('d-m-y');\n })->toArray();\n foreach ($orders as $key => $value) {\n $date[] = $key;\n $num_orders[] = count($value);\n }\n\n //======= Get income from last month - Chart From DB =======\n $last_month_income = \\Carbon\\Carbon::today()->subDays(30);\n $all_orders = [];\n $orders_income = [];\n $income = [];\n $income_date = [];\n $users_orders = DB::table('users')\n ->join('orders', 'users.id', '=', 'orders.user_id')\n ->select('users.*', 'orders.*')\n ->where('orders.created_at', '>=', $last_month_income)->get();\n foreach ($users_orders as $new_user_order) {\n $all_orders[] = (array) $new_user_order;\n }\n foreach ($all_orders as &$orders_data) {\n $orders_data['data'] = unserialize($orders_data['data']);\n }\n foreach ($all_orders as $order) {\n $order['created_at'] = (new \\DateTime($order['created_at']))->format('Y-m-d');\n $income_date[] = $order['created_at'];\n $sum = 0;\n foreach ($order['data'] as $price) {\n $sum += ($price['price'] * $price['quantity']);\n }\n $income[] = $sum;\n }\n\n for ($i = count($income_date) - 1; $i > 0; $i--) {\n if ($income_date[$i] == $income_date[$i - 1]) {\n unset($income_date[$i]);\n $income[$i - 1] = $income[$i] + $income[$i - 1];\n unset($income[$i]);\n }\n }\n $income = array_values($income);\n $income_date = array_values($income_date);\n\n self::$data['income'] = json_encode($income);\n self::$data['income_date'] = json_encode($income_date);\n\n //======= Get last week new users =======\n $last_week = \\Carbon\\Carbon::today()->subDays(7);\n $weekly_users = User::where('created_at', '>=', $last_week)->get()->toArray();\n\n //======= Get all users except admin =======\n $all_users = User::where('role', '!=', '6')->get()->toArray();\n\n //======= Get last day new orders =======\n $last_day = \\Carbon\\Carbon::today();\n $daily_orders = Order::where('created_at', '>=', $last_day)->get()->toArray();\n\n self::$data['weekly_new_users'] = count($weekly_users);\n self::$data['all_users'] = count($all_users);\n self::$data['daily_orders'] = count($daily_orders);\n self::$data['date'] = json_encode($date);\n self::$data['num_orders'] = json_encode($num_orders);\n self::$data['title'] .= 'CMS';\n self::$data['page_name'] = 'Ski Expert | Main';\n return view('cms.dashboard', self::$data);\n }", "public function __construct(){\n\n $this->all_orders='App\\UserOrder'::with('get_order_details.get_product_details')->whereDate('created_at','>',Carbon::today()->subYear(1)->toDateString())->orderBy('created_at','desc')->get();\n }", "function getPrevOrders()\n\t{\n\t\t$gid = mysql_real_escape_string($_GET['gid']);\n\t\t\n\t\t$query = \"SELECT *\n\t\t\t\t\tFROM games\n\t\t\t\t\tWHERE gid=$gid;\";\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$year = mysql_result($result, 0, \"year\");\n\t\t$season = mysql_result($result, 0, \"season\");\n\t\t\n\t\tif($season == \"s\")\n\t\t{\n\t\t\t$year--;\n\t\t\t$season = \"f\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$season = \"s\";\n\t\t}\n\t\t\n\t\t$query = \"SELECT *\n\t\t\t\t\tFROM orders\n\t\t\t\t\tWHERE gid=$gid and year=$year and season='$season';\";\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$orders = array();\n\t\tfor($i = 0; $i < mysql_num_rows($result); $i++)\n\t\t{\n\t\t\tarray_push($orders, mysql_fetch_assoc($result));\n\t\t} \n\t\t\n\t\treturn $orders;\n\t}", "function charts($data1) {\n\t $startDate = Carbon::now()->subDay(365);\n\t $endDate = Carbon::now();\n\t\n\t\t//THIS RETURNS THE 4 BOXES\n\t\t$month = $data->filter(function($data1){ return $data1->created_at->format('m-y') == date('m-y'); });\n\t\t$lastmonth = $data->filter(function($data1){ return $data1->created_at->format('m-y') == Carbon::now()->firstOfMonth()->subMonth()->format('m-y'); });\n\t\t$year = $data->filter(function($data1){ return $data1->created_at->format('y') == date('y'); });\n\t\t$lastyear = $data->filter(function($data1){ return $data1->created_at->format('y') == Carbon::now()->subYear()->format('y'); });\n\t\n\t}", "function get_recent_orders(){\n\t $orders = $this->Order->get_recent_orders();\n\t if($this->params['requested']){\n\t return $orders;\n\t }else{\n\t $this->set('orders', $orders);\n\t }\n \n\t}", "static function orderStatistics( $year = false, $month = false )\n {\n if ( $year == false )\n {\n $startDate = 0;\n $stopDate = mktime( 0, 0, 0, 12, 31, 2037 );\n }\n else if ( $year != false and $month == false )\n {\n $startDate = mktime( 0, 0, 0, 1, 1, $year );\n $stopDate = mktime( 0, 0, 0, 1, 1, $year + 1 );\n }\n else if ( $year != false and $month != false )\n {\n $startDate = mktime( 0, 0, 0, $month, 1, $year );\n $stopDate = mktime( 23, 59, 59, $month + 1, 0, $year );\n }\n\n $db = eZDB::instance();\n $productArray = $db->arrayQuery( \"SELECT ezproductcollection_item.*, ignore_vat, ezorder.created, currency_code FROM ezorder, ezproductcollection_item, ezproductcollection\n WHERE ezproductcollection.id=ezproductcollection_item.productcollection_id\n AND ezproductcollection_item.productcollection_id=ezorder.productcollection_id\n AND is_temporary='0'\n AND ezorder.created >= '$startDate' AND ezorder.created < '$stopDate'\n ORDER BY contentobject_id, currency_code\" );\n $currentContentObjectID = 0;\n $productItemArray = array();\n $itemCount = 0;\n $name = false;\n $productInfo = array();\n $totalSumInfo = array();\n $firstPass = true;\n // Hash of ContentObject ID, the value will be replaced by the correct object once all IDs are known.\n $contentObjectIDHash = array();\n foreach( $productArray as $productItem )\n {\n $itemCount++;\n $contentObjectID = $productItem['contentobject_id'];\n\n if ( $firstPass )\n {\n $contentObjectIDHash[$currentContentObjectID] = true;\n $currentContentObjectID = $contentObjectID;\n $firstPass = false;\n }\n\n if ( $currentContentObjectID != $contentObjectID && $itemCount != 1 )\n {\n $productItemArray[] = array(\n 'name' => $name,\n // Reference to the entry that will contain the ContentObject at the end\n 'product' => &$contentObjectIDHash[$currentContentObjectID],\n 'product_info' => $productInfo\n );\n $productInfo = array();\n $name = $productItem['name'];\n $currentContentObjectID = $contentObjectID;\n $contentObjectIDHash[$currentContentObjectID] = true;\n }\n\n $currencyCode = $productItem['currency_code'];\n if ( $currencyCode == '' )\n {\n $currencyCode = eZOrder::fetchLocaleCurrencyCode();\n }\n\n if ( !isset( $productInfo[$currencyCode] ) )\n {\n $productInfo[$currencyCode] = array( 'sum_count' => 0,\n 'sum_ex_vat' => 0,\n 'sum_inc_vat' => 0 );\n }\n if ( !isset( $totalSumInfo[$currencyCode] ) )\n {\n $totalSumInfo[$currencyCode] = array( 'sum_ex_vat' => 0,\n 'sum_inc_vat' => 0 );\n }\n\n if ( $productItem['ignore_vat']== true )\n {\n $vatValue = 0;\n }\n else\n {\n $vatValue = $productItem['vat_value'];\n }\n\n $price = $productItem['price'];\n\n if ( $productItem['is_vat_inc'] )\n {\n $priceExVAT = $price / ( 100 + $vatValue ) * 100;\n $priceIncVAT = $price;\n\n }\n else\n {\n $priceExVAT = $price;\n $priceIncVAT = $price * ( 100 + $vatValue ) / 100;\n }\n\n $count = $productItem['item_count'];\n $realPricePercent = ( 100 - $productItem['discount'] ) / 100;\n $totalPriceExVAT = round( $count * $priceExVAT * $realPricePercent, 2 );\n $totalPriceIncVAT = round( $count * $priceIncVAT * $realPricePercent, 2 );\n $totalSumInfo[$currencyCode]['sum_ex_vat'] += $totalPriceExVAT;\n $totalSumInfo[$currencyCode]['sum_inc_vat'] += $totalPriceIncVAT;\n\n $productInfo[$currencyCode]['sum_count'] += $count;\n $productInfo[$currencyCode]['sum_ex_vat'] += $totalPriceExVAT;\n $productInfo[$currencyCode]['sum_inc_vat'] += $totalPriceIncVAT;\n }\n\n // add last product info\n if ( !empty( $productArray ) )\n {\n $productItemArray[] = array(\n 'name' => $name,\n // Reference to the entry that will contain the ContentObject at the end\n 'product' => &$contentObjectIDHash[$currentContentObjectID],\n 'product_info' => $productInfo\n );\n\n // Fetching all ContentObject ids in one query, filling the hash with the corresponding ContentObject\n foreach ( eZContentObject::fetchList( true, array( \"id\" => array( array_keys( $contentObjectIDHash ) ) ) ) as $contentObject )\n {\n $contentObjectIDHash[$contentObject->ID] = $contentObject;\n }\n }\n\n return array(\n array(\n 'product_list' => $productItemArray,\n 'total_sum_info' => $totalSumInfo\n )\n );\n }", "public function graphData()\n {\n $dayOfWeek = ['Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo'];\n $colors = [\n 'rgba(201, 203, 207, 0.8)', //gray\n 'rgba(255, 99, 132, 0.8)', //Red\n 'rgba(255, 159, 64, 0.8)', //Orange\n 'rgba(75, 192, 192, 0.8)', //green\n 'rgba(54, 162, 235, 0.8)', //blue\n 'rgba(153, 102, 255, 0.8)', //purple\n 'rgba(255, 205, 86, 0.8)', //yellow\n ];\n $borderColors = [\n 'rgba(201, 203, 207, 1)', //gray\n 'rgba(255, 99, 132, 1)', //Red\n 'rgba(255, 159, 64, 1)', //Orange\n 'rgba(75, 192, 192, 1)', //green\n 'rgba(54, 162, 235, 1)', //blue\n 'rgba(153, 102, 255, 1)', //purple\n 'rgba(255, 205, 86, 1)', //yellow\n ];\n $months = ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'];\n $now = Carbon::now()->timezone($this->timezome);\n $data = [];\n\n switch ($this->graphPeriod) {\n case 'weekly':\n $data = $this->getDataFromWeeklySales($colors, $borderColors);\n break;\n case 'weeklyAccumulated':\n $data = $this->getDataFromWeeklySales($colors, $borderColors, true);\n break;\n case 'monthly':\n $labels = [];\n $date = $now->copy()->subMonths(5)->startOfMonth()->startOfDay();\n $end = $now->copy()->endOfDay();\n $count = 0;\n\n for ($i = 1; $i < 32; $i++) {\n $labels[] = $i;\n }\n\n while ($date->lessThanOrEqualTo($end)) {\n $label = $months[$date->month - 1];\n $data = [];\n $endOfMonth = $date->copy()->endOfMonth()->endOfDay();\n $sale = 0;\n\n while ($date->lessThanOrEqualTo($endOfMonth) && $date->lessThanOrEqualTo($end)) {\n $sale += $this->getSumFromGraphPeriod($date, $this->graphCategory);\n $data[] = $sale;\n $date->addDay();\n }\n\n $datasets[] = [\n 'label' => $label,\n 'backgroundColor' => $colors[$count],\n 'borderColor' => $borderColors[$count],\n 'borderWidth' => 1,\n 'data' => $data,\n 'fill' => false\n ];\n\n $count++;\n }\n\n $data = [\n 'labels' => $labels,\n 'datasets' => $datasets,\n 'type' => 'line'\n ];\n break;\n default:\n # code...\n break;\n }\n return $data;\n }", "public function AllOpen_Orders_get() {\n extract($_GET);\n $result = $this->feeds_model->AllOpen_Orders();\n return $this->response($result);\n }", "public function woocommerce_reports_category_sales_order_items($orders) {\n\t\tglobal $wpdb;\n\t\t$this->set_reporting_flag(true);\n\n\t\t// If no data was retrieved by WooCommerce, just return the empty dataset\n\t\tif(empty($orders)) {\n\t\t\treturn $orders;\n\t\t}\n\n\t\t// This report requires one year to retrieve the data, but such information\n\t\t// is not passed by the apply_filter() call. It's therefore necessary to\n\t\t// extract it from the data that was retrieved by WooCommerce, using the\n\t\t// first date found in the dataset\n\t\t$order = $orders[0];\n\t\t$reference_date = DateTime::createFromFormat('Y-m-d H:i:s', get_value('post_date', $orders[0]));\n\t\t$year_to_retrieve = $reference_date->format('Y');\n\n\t\t// Calculate the first date of year passed as a parameter and the start date\n\t\t// of next one\n\t\t$start_date = $year_to_retrieve . '0101000000';\n\t\t$end_date = date('Ymd000000', strtotime($start_date . ' +1 year'));\n\n\t\t$SQL = \"\n\t\t\tSELECT\n\t\t\t\torder_item_meta_2.meta_value as product_id\n\t\t\t\t,posts.post_date\n\t\t\t\t-- ,SUM(order_item_meta_3.meta_value) AS line_total\n\t\t\t\t-- Return Line total converted to base currency\n\t\t\t\t,SUM(order_item_meta_3.meta_value * meta_order_base_curr.meta_value / meta_order.meta_value) AS line_total\n\t\t\tFROM\n\t\t\t\t{$wpdb->prefix}woocommerce_order_items AS order_items\n\t\t\tJOIN\n\t\t\t\t{$wpdb->prefix}woocommerce_order_itemmeta as order_item_meta_2 ON\n\t\t\t\t\t(order_item_meta_2.order_item_id = order_items.order_item_id) AND\n\t\t\t\t\t(order_item_meta_2.meta_key = '_product_id')\n\t\t\tJOIN\n\t\t\t\t{$wpdb->prefix}woocommerce_order_itemmeta as order_item_meta_3 ON\n\t\t\t\t\t(order_item_meta_3.order_item_id = order_items.order_item_id) AND\n\t\t\t\t\t(order_item_meta_3.meta_key = '_line_total')\n\t\t\tJOIN\n\t\t\t\t$wpdb->posts AS posts ON\n\t\t\t\t\t(posts.ID = order_items.order_id) AND\n\t\t\t\t\t(posts.post_type = 'shop_order') AND\n\t\t\t\t\t(posts.post_status = 'publish') AND\n\t\t\t\t\t(posts.post_date >= $start_date) AND\n\t\t\t\t\t(posts.post_date < $end_date)\n\t\t\tJOIN\n\t\t\t\t$wpdb->postmeta AS meta_order ON\n\t\t\t\t\t(meta_order.post_id = posts.ID) AND\n\t\t\t\t\t(meta_order.meta_key = '_order_total')\n\t\t\tJOIN\n\t\t\t\t$wpdb->postmeta AS meta_order_base_curr ON\n\t\t\t\t\t(meta_order_base_curr.post_id = posts.ID) AND\n\t\t\t\t\t(meta_order_base_curr.meta_key = '_order_total_base_currency')\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->term_relationships AS rel ON\n\t\t\t\t\t(rel.object_ID = posts.ID)\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->term_taxonomy AS taxonomy ON\n\t\t\t\t\t(taxonomy.term_taxonomy_id = rel.term_taxonomy_id) AND\n\t\t\t\t\t(taxonomy.taxonomy = 'shop_order_status')\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->terms AS term ON\n\t\t\t\t\t(term.term_id = taxonomy.term_id) AND\n\t\t\t\t\t(term.slug IN ('\" . implode(\"','\", apply_filters('woocommerce_reports_order_statuses', array('completed', 'processing', 'on-hold'))) . \"'))\n\t\t\tWHERE\n\t\t\t\t(order_items.order_item_type = 'line_item')\n\t\t\tGROUP BY\n\t\t\t\torder_items.order_item_id\n\t\t\tORDER BY\n\t\t\t\tposts.post_date ASC\n\t\t\";\n\n\t\t$orders_base_curr = $wpdb->get_results($SQL);\n\t\t$this->set_reporting_flag(false);\n\n\t\treturn $orders_base_curr;\n\t}", "public function getDailyOrdersData($id=null)\n {\n $startDate = date(\"Y-m-d H:i:s\", strtotime('-7 day', time()));\n $endDate = date('Y-m-d H:i:s');\n\n $userData = User::find()->andFilterWhere(['u_id' => $id, 'u_type' => 2])->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n \\Yii::$app->data->getMwsDetails($user->u_mws_seller_id, $user->u_mws_auth_token);\n $orderList = \\Yii::$app->api->getOrdersList('Created', $startDate, $endDate);\n foreach ($orderList as $order) {\n $orderDetail = false;\n $order = (array)$order;\n $order = array_shift($order);\n if($order) {\n $model = AllOrdesList::findOne(['aol_amazon_order_id' => $order['AmazonOrderId'], 'aol_user_id' => $user->u_id]);\n if (!$model) {\n $model = new AllOrdesList();\n }\n $model->aol_amazon_order_id = (key_exists('AmazonOrderId', $order)) ? $order['AmazonOrderId'] : null;\n $model->aol_seller_order_id = (key_exists('SellerOrderId', $order)) ? $order['SellerOrderId'] : null;\n $model->aol_purchase_date = (key_exists('PurchaseDate', $order)) ? $order['PurchaseDate'] : null;\n $model->aol_last_updated_date = (key_exists('LastUpdateDate', $order)) ? $order['LastUpdateDate'] : null;\n $model->aol_order_status = (key_exists('OrderStatus', $order)) ? $order['OrderStatus'] : null;\n $model->aol_fulfilment_channel = (key_exists('FulfillmentChannel', $order)) ? $order['FulfillmentChannel'] : null;\n $model->aol_sales_channel = (key_exists('SalesChannel', $order)) ? $order['SalesChannel'] : null;\n $model->aol_ship_service = (key_exists('ShipServiceLevel', $order)) ? $order['ShipServiceLevel'] : null;\n $model->aol_order_total = (key_exists('OrderTotal', $order)) ? $order['OrderTotal']['Amount'] : 0;\n $model->aol_shipped_items = (key_exists('NumberOfItemsShipped', $order)) ? $order['NumberOfItemsShipped'] : null;\n $model->aol_unshipped_items = (key_exists('NumberOfItemsUnshipped', $order)) ? $order['NumberOfItemsUnshipped'] : null;\n if($model->aol_order_status == 'Shipped') {\n $model->aol_shipping_username = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['Name'] : null;\n $model->aol_shipping_address_1 = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['AddressLine1'] : null;\n $model->aol_shipping_address_2 = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['AddressLine2'] : null;\n $model->aol_shipping_address_3 = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['AddressLine3'] : null;\n $model->aol_city = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['City'] : null;\n $model->aol_country = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['County'] : null;\n $model->aol_district = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['District'] : null;\n $model->aol_state_or_region = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['StateOrRegion'] : null;\n $model->aol_postal_code = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['PostalCode'] : null;\n $model->aol_country_code =(key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['CountryCode'] : null;\n $model->aol_phone = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['Phone'] : null;\n $model->aol_buyer_name = key_exists('BuyerName', $order) ? $order['BuyerName'] : null;\n $model->aol_buyer_email = key_exists('BuyerEmail', $order) ? $order['BuyerEmail'] : null;\n $orderDetail = true;\n }\n $model->aol_user_id = $user->u_id;\n if($model->save(false)) {\n $olModel = OrderDataLog::findOne(['odl_order_id' => $model->aol_amazon_order_id, 'odl_user_id' => $user->u_id]);\n if (!$olModel) {\n $olModel = new OrderDataLog();\n $olModel->odl_order_id = $model->aol_amazon_order_id;\n $olModel->odl_user_id = $user->u_id;\n if($orderDetail) {\n $olModel->odl_shipped_order_data = 1;\n }\n if($olModel->save(false)) {\n echo $model->aol_amazon_order_id.\" Log is Saved. \";\n }\n }\n echo $model->aol_amazon_order_id.\" is Saved. \";\n }\n }\n }\n echo \"Done..\";\n }\n }", "private function GetOrders()\n\t{\t$orders = array();\n\t\t$where = array();\n\t\t\n\t\tif ($this->startdate)\n\t\t{\t$where[] = 'orderdate>=\"' . $this->startdate . ' 00:00:00\"';\n\t\t}\n\t\tif ($this->enddate)\n\t\t{\t$where[] = 'orderdate<=\"' . $this->enddate . ' 23:59:59\"';\n\t\t}\n\t\tif (!$this->showunpaid)\n\t\t{\t$where[] = 'NOT paiddate=\"0000-00-00 00:00:00\"';\n\t\t}\n\t\t\n\t\t$sql = 'SELECT * FROM storeorders';\n\t\tif ($wstr = implode(' AND ', $where))\n\t\t{\t$sql .= ' WHERE ' . $wstr;\n\t\t}\n\t\t$sql .= ' ORDER BY orderdate DESC';\n\t\t\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\t$orders[$row['id']] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $orders;\n\t}", "public function AllClosed_Orders_get() {\n extract($_GET);\n $result = $this->feeds_model->AllClosed_Orders();\n return $this->response($result);\n }", "public function getDailyOrders($id=null)\n {\n $startDate = date(\"Y-m-d H:i:s\", strtotime('-1 month', time()));\n $endDate = date('Y-m-d H:i:s');\n\n $userData = User::find()->andFilterWhere(['u_id' => $id])->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n \\Yii::$app->data->getMwsDetails($user->u_mws_seller_id, $user->u_mws_auth_token);\n\n $orderList = \\Yii::$app->api->getOrdersList('Created', $startDate, $endDate);\n foreach ($orderList as $order) {\n $order = (array)$order;\n $order = array_shift($order);\n if ($order) {\n\n $model = AllOrdesList::findOne(['aol_amazon_order_id' => $order['AmazonOrderId'], 'aol_user_id' => $user->u_id]);\n if (!$model) {\n $model = new AllOrdesList();\n }\n $model->aol_amazon_order_id = (key_exists('AmazonOrderId', $order)) ? $order['AmazonOrderId'] : null;\n $model->aol_seller_order_id = (key_exists('SellerOrderId', $order)) ? $order['SellerOrderId'] : null;\n $model->aol_purchase_date = (key_exists('PurchaseDate', $order)) ? $order['PurchaseDate'] : null;\n $model->aol_last_updated_date = (key_exists('LastUpdateDate', $order)) ? $order['LastUpdateDate'] : null;\n $model->aol_order_status = (key_exists('OrderStatus', $order)) ? $order['OrderStatus'] : null;\n $model->aol_fulfilment_channel = (key_exists('FulfillmentChannel', $order)) ? $order['FulfillmentChannel'] : null;\n $model->aol_sales_channel = (key_exists('SalesChannel', $order)) ? $order['SalesChannel'] : null;\n $model->aol_ship_service = (key_exists('ShipServiceLevel', $order)) ? $order['ShipServiceLevel'] : null;\n $model->aol_order_total = (key_exists('OrderTotal', $order)) ? $order['OrderTotal']['Amount'] : 0;\n $model->aol_shipped_items = (key_exists('NumberOfItemsShipped', $order)) ? $order['NumberOfItemsShipped'] : null;\n $model->aol_unshipped_items = (key_exists('NumberOfItemsUnshipped', $order)) ? $order['NumberOfItemsUnshipped'] : null;\n $model->aol_user_id = $user->u_id;\n if($model->save(false)) {\n echo $model->aol_amazon_order_id.\" is Saved. \";\n }\n\n $model = AllOrdesList::findOne($model->aol_amazon_order_id);\n if($model) {\n sleep(2);\n /**\n * Get Finance Event Data\n */\n $financeEventData = \\Yii::$app->api->getFinanceEventList($model->aol_amazon_order_id);\n $amazonOrderId = $sellerOrderId = $shipmentRefundId = null;\n\n if ($financeEventData) {\n // print_r($financeEventData); exit();\n /**\n * Store Shipment Event Data 111-8188019-0760241\n */\n if ($shipmentData = $financeEventData['shipmentEventData']) {\n foreach ($shipmentData as $sVal) {\n $modelSR = new ShipmentRefundEventData();\n $modelSR->sred_amazon_order_id = $amazonOrderId = $sVal['AmazonOrderId'];\n $modelSR->sred_seller_order_id = $sellerOrderId = $sVal['SellerOrderId'];\n $modelSR->sred_marketplace_name = $sVal['MarketplaceName'];\n $modelSR->sred_shipment_posted_date = $sVal['PostedDate'];\n $modelSR->sred_event_type = 'Order';\n\n if ($modelSR->save(false)) {\n $shipmentRefundId = $modelSR->sred_id;\n if (key_exists('ShipmentItemList', $sVal) && is_array($sVal['ShipmentItemList']) && $shipmentItemData = $sVal['ShipmentItemList']) {\n foreach ($shipmentItemData as $sItem) {\n $sellerSku = $sItem['SellerSKU'];\n $orderItemId = $sItem['OrderItemId'];\n $shippedQuantity = $sItem['QuantityShipped'];\n\n if (key_exists('ItemChargeList', $sItem) && is_array($sItem['ItemChargeList']) && $itemChargeData = $sItem['ItemChargeList']) {\n foreach ($itemChargeData as $iData) {\n $itemModel = new ItemChargeListData();\n $itemModel->icld_quantity_shipped = $shippedQuantity;\n $itemModel->icld_seller_sku = $sellerSku;\n $itemModel->icld_order_item_id = $orderItemId;\n $itemModel->icld_amazon_order_id = $modelSR->sred_amazon_order_id;\n $itemModel->icld_seller_order_id = $modelSR->sred_seller_order_id;\n $itemModel->icld_item_charge_type = $iData['ChargeType'];\n $itemModel->icld_charge_amount = $iData['Amount'];\n $itemModel->icld_currency = $iData['CurrencyCode'];\n $itemModel->icld_transaction_type = 'Order';\n $itemModel->icld_item_type = 'Shipment';\n $itemModel->icld_shipment_refund_event_data_id = $modelSR->sred_id;\n if ($itemModel->save(false)) {\n echo \"Item Charge Saved.\";\n }\n } //$itemChargeData\n }\n\n if (key_exists('ItemFeeList', $sItem) && is_array($sItem['ItemFeeList']) && $itemFeeChargeData = $sItem['ItemFeeList']) {\n foreach ($itemFeeChargeData as $ifData) {\n $feeModel = new ItemFeeListData();\n $feeModel->ifld_quantity_shipped = $shippedQuantity;\n $feeModel->ifld_seller_sku = $sellerSku;\n $feeModel->ifld_order_item_id = $orderItemId;\n $feeModel->ifld_amazon_order_id = $modelSR->sred_amazon_order_id;\n $feeModel->ifld_seller_order_id = $modelSR->sred_seller_order_id;\n $feeModel->ifld_fee_type = $ifData['FeeType'];\n $feeModel->ifld_fee_amount = $ifData['Amount'];\n $feeModel->ifld_currency = $ifData['CurrencyCode'];\n $feeModel->ifld_transaction_type = 'Order';\n $feeModel->ifld_item_type = 'Shipment';\n $feeModel->ifld_shipment_refund_event_id = $modelSR->sred_id;\n if ($feeModel->save(false)) {\n echo \"Item Fee Saved.\";\n }\n } // $itemFeeChargeData\n }\n } // $shipmentItemData\n }\n }\n } //$shipmentData\n } // if : $shipmentData\n\n /**\n * Store Refund Event Data\n */\n if ($refundData = $financeEventData['refundEventData']) {\n foreach ($refundData as $rValue) {\n $modelSR = new ShipmentRefundEventData();\n $modelSR->sred_amazon_order_id = $rValue['AmazonOrderId'];\n $modelSR->sred_seller_order_id = $rValue['SellerOrderId'];\n $modelSR->sred_marketplace_name = $rValue['MarketplaceName'];\n $modelSR->sred_refund_posted_date = $rValue['PostedDate'];\n $modelSR->sred_event_type = 'Refund';\n\n if ($model->save(false)) {\n /*$vnModel = new VaNotification();\n $vnModel->vn_amazon_order_id = $modelSR->sred_amazon_order_id;\n $vnModel->vn_refund_posted_date = $modelSR->sred_refund_posted_date;\n $vnModel->vn_shipment_refund_event_data_id = $modelSR->sred_id;\n $vnModel->save(false);*/\n\n if (key_exists('ShipmentItemAdjustmentList', $rValue) && is_array($rValue['ShipmentItemAdjustmentList']) && $shipmentItemData = $rValue['ShipmentItemAdjustmentList']) {\n foreach ($shipmentItemData as $sItem) {\n $sellerSku = $sItem['SellerSKU'];\n $orderItemId = (key_exists('OrderAdjustmentItemId', $sItem)) ? $sItem['OrderAdjustmentItemId'] : null;\n $shippedQuantity = (key_exists('QuantityShipped', $sItem)) ? $sItem['QuantityShipped'] : null;\n\n if (key_exists('ItemChargeAdjustmentList', $sItem) && is_array($sItem['ItemChargeAdjustmentList']) && $itemChargeData = $sItem['ItemChargeAdjustmentList']) {\n foreach ($itemChargeData as $iData) {\n $itemModel = new ItemChargeListData();\n $itemModel->icld_quantity_shipped = $shippedQuantity;\n $itemModel->icld_seller_sku = $sellerSku;\n $itemModel->icld_order_adjustment_item_id = $orderItemId;\n $itemModel->icld_amazon_order_id = $modelSR->sred_amazon_order_id;\n $itemModel->icld_seller_order_id = $modelSR->sred_seller_order_id;\n $itemModel->icld_item_charge_type = $iData['ChargeType'];\n $itemModel->icld_charge_amount = $iData['Amount'];\n $itemModel->icld_currency = $iData['CurrencyCode'];\n $itemModel->icld_transaction_type = 'Refund';\n $itemModel->icld_item_type = 'Refund';\n $itemModel->icld_shipment_refund_event_data_id = $modelSR->sred_id;\n if ($itemModel->save(false)) {\n echo \"Refund Item Charge Saved.\";\n }\n } //$itemChargeData\n }\n\n if (key_exists('ItemFeeAdjustmentList', $sItem) && is_array($sItem['ItemFeeAdjustmentList']) && $itemFeeChargeData = $sItem['ItemFeeAdjustmentList']) {\n foreach ($itemFeeChargeData as $ifData) {\n $feeModel = new ItemFeeListData();\n $feeModel->ifld_quantity_shipped = $shippedQuantity;\n $feeModel->ifld_seller_sku = $sellerSku;\n $feeModel->ifld_order_adjustment_item_id = $orderItemId;\n $feeModel->ifld_amazon_order_id = $modelSR->sred_amazon_order_id;\n $feeModel->ifld_seller_order_id = $modelSR->sred_seller_order_id;\n $feeModel->ifld_fee_type = $ifData['FeeType'];\n $feeModel->ifld_fee_amount = $ifData['Amount'];\n $feeModel->ifld_currency = $ifData['CurrencyCode'];\n $feeModel->ifld_transaction_type = 'Refund';\n $feeModel->ifld_item_type = 'Refund';\n $feeModel->ifld_shipment_refund_event_id = $modelSR->sred_id;\n if ($feeModel->save(false)) {\n echo \"Refund Item Fee Saved.\";\n }\n } // $itemFeeChargeData\n }\n } // $shipmentItemData\n }\n }\n }\n } // if : Refund Event\n\n /*\n * Store Service Fee Event Data\n */\n if ($serviceFeeEventData = $financeEventData['serviceFeeEventData']) {\n foreach ($serviceFeeEventData as $rValue) {\n $aOrderId = $rValue['AmazonOrderId'];\n $feeReason = $rValue['FeeReason'];\n $sellerSku = $rValue['SellerSKU'];\n $fnSku = $rValue['FnSKU'];\n $feeDesc = $rValue['FeeDescription'];\n $asin = $rValue['ASIN'];\n\n if (key_exists('FeeList', $rValue) && is_array($rValue['FeeList']) && $itemChargeData = $rValue['FeeList']) {\n foreach ($itemChargeData as $iData) {\n $sModel = new ServiceFeeData();\n $sModel->sfd_amazon_order_id = $aOrderId;\n $sModel->sfd_seller_order_id = $sellerOrderId;\n $sModel->sfd_fee_reason = $feeReason;\n $sModel->sfd_seller_sku = $sellerSku;\n $sModel->sfd_fnsku = $fnSku;\n $sModel->sfd_fee_description = $feeDesc;\n $sModel->sfd_asin = $asin;\n $sModel->sfd_fee_type = $iData['FeeType'];\n $sModel->sfd_fee_amount = $iData['Amount'];\n $sModel->sfd_currency = $iData['CurrencyCode'];\n $sModel->sfd_shipment_refund_event_data_id = $shipmentRefundId;\n if ($sModel->save(false)) {\n echo \"Service Fee Data Saved.\";\n }\n }\n }\n }\n } // if : service Fee Event\n\n /**\n * Adjustment Event Data\n */\n if ($adjustmentEventData = $financeEventData['adjustmentEventData']) {\n foreach ($adjustmentEventData as $raValue) {\n $adModel = new OrderAdjustmentEventData();\n $adModel->oaed_amazon_order_id = $amazonOrderId;\n $adModel->oaed_seller_order_id = $sellerOrderId;\n $adModel->oaed_adjustment_type = $raValue['AdjustmentType'];\n $adModel->oaed_amount = $raValue['Amount'];\n $adModel->oaed_currency = $raValue['CurrencyCode'];\n\n if ($adModel->save(false)) {\n if (key_exists('AdjustmentItemList', $raValue) && is_array($raValue['AdjustmentItemList']) && $AdjustmentItemList = $raValue['AdjustmentItemList']) {\n foreach ($AdjustmentItemList as $siItem) {\n $adIModel = new OrderAdjustmentItemListData();\n $adIModel->oaild_amazon_order_id = $amazonOrderId;\n $adIModel->oaild_seller_order_id = $sellerOrderId;\n $adIModel->oaild_quantity = $siItem['Quantity'];\n $adIModel->oaild_per_unit_amount = $siItem['PerUnitAmount']['Amount'];\n $adIModel->oaild_total_amount = $siItem['TotalAmount']['Amount'];\n $adIModel->oaild_currency = $siItem['TotalAmount']['CurrencyCode'];\n $adIModel->oaild_seller_sku = $siItem['SellerSKU'];\n $adIModel->oaild_fnsku = $siItem['FnSKU'];\n $adIModel->oaild_product_description = $siItem['ProductDescription'];\n $adIModel->oaild_asin = $siItem['ASIN'];\n $adIModel->order_adjustment_event_data_id = $adModel->oaed_id;\n $adIModel->oaild_shipment_refund_event_data_id = $shipmentRefundId;\n if ($adIModel->save(false)) {\n echo \"Adjustment Item Data Saved.\";\n }\n }\n }\n }\n }\n } // if : adjustment Event Data\n\n } // main if : $financeEventData\n\n $model = AllOrdesList::findOne(['aol_amazon_order_id' => $amazonOrderId]);\n if($model) {\n $model->aol_status = 1; // Finance Event Data Pulled.\n if ($model->save(false)) {\n echo \"Finance Event Data of Order No: \" . $model->aol_amazon_order_id . \" is Saved.\";\n }\n }\n sleep(3);\n\n /**\n * Get Shipped Order Details\n */\n $model = AllOrdesList::findOne(['aol_amazon_order_id' => $model->aol_amazon_order_id]);\n if ($model && $model->aol_order_status == 'Shipped') {\n $orderDetails = \\Yii::$app->api->getOrderDetails($model->aol_amazon_order_id);\n $orderItemAsin = \\Yii::$app->api->getOrderItems($model->aol_amazon_order_id);\n if ($orderDetails) {\n $model->aol_shipping_username = key_exists('Name', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['Name'] : null;\n $model->aol_shipping_address_1 = key_exists('AddressLine1', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['AddressLine1'] : null;\n $model->aol_shipping_address_2 = key_exists('AddressLine2', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['AddressLine2'] : null;\n $model->aol_shipping_address_3 = key_exists('AddressLine3', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['AddressLine3'] : null;\n $model->aol_city = key_exists('City', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['City'] : null;\n $model->aol_country = key_exists('County', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['County'] : null;\n $model->aol_district = key_exists('District', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['District'] : null;\n $model->aol_state_or_region = key_exists('StateOrRegion', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['StateOrRegion'] : null;\n $model->aol_postal_code = key_exists('PostalCode', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['PostalCode'] : null;\n $model->aol_country_code = key_exists('CountryCode', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['CountryCode'] : null;\n $model->aol_phone = key_exists('Phone', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['Phone'] : null;\n $model->aol_buyer_name = key_exists('BuyerName', $orderDetails) ? $orderDetails['BuyerName'] : null;\n $model->aol_buyer_email = key_exists('BuyerEmail', $orderDetails) ? $orderDetails['BuyerEmail'] : null;\n $model->aol_asin = $orderItemAsin;\n $model->aol_shipped_status = 1; //Order Details Pulled\n if ($model->save(false))\n echo $model->aol_amazon_order_id . \" Details Saved.\";\n }\n sleep(3);\n\n /**\n * Get All ASIN for Order\n */\n $orderItemAsinData = \\Yii::$app->api->getOrderItems($model->aol_amazon_order_id, true);\n if ($orderItemAsinData) {\n foreach ($orderItemAsinData as $asinData) {\n $modelOI = OrderItemsAsin::findOne(['oia_order_id' => $model->aol_amazon_order_id]);\n if (!$modelOI) {\n $modelOI = new OrderItemsAsin();\n }\n $modelOI->oia_order_id = $model->aol_amazon_order_id;\n $modelOI->oia_asin = $asinData['ASIN'];\n $catData = ($modelOI->oia_asin) ? \\Yii::$app->api->getProductCategory($modelOI->oia_asin) : null;\n if ($catData) {\n $modelP = FbaAllListingData::findOne(['asin1' => $modelOI->oia_asin]);\n $sPrice = ($modelP) ? $modelP->price : 0;\n $fees = GetApiData::mwsFeesEstimate($modelOI->oia_asin, $sPrice);\n $referralFee = ($fees) ? $fees['ReferralFee'] : 0;\n\n $modelOI->oia_referral_fee = $referralFee;\n $modelOI->oia_category = $catData;\n $modelOI->oia_purchase_date = $model->aol_purchase_date;\n\n $productDimensionData = \\Yii::$app->api->getProductDimensions($modelOI->oia_asin);\n if ($productDimensionData) {\n $modelOI->oia_item_height = $productDimensionData['ItemHeight'];\n $modelOI->oia_item_length = $productDimensionData['ItemLength'];\n $modelOI->oia_item_weight = $productDimensionData['ItemWeight'];\n $modelOI->oia_item_width = $productDimensionData['ItemWidth'];\n $modelOI->oia_package_height = $productDimensionData['PackageHeight'];\n $modelOI->oia_package_length = $productDimensionData['PackageLength'];\n $modelOI->oia_package_weight = $productDimensionData['PackageWeight'];\n $modelOI->oia_package_width = $productDimensionData['PackageWidth'];\n }\n }\n if ($modelOI->save(false)) {\n echo \"ASIN Saved.\";\n }\n sleep(3);\n }\n }\n }\n }\n }\n }\n\n /*if($id) {\n $user->order_cron_status = 1;\n $user->save(false);\n }*/\n }\n echo \"Done..\";\n }", "protected function obtainDataOrders()\n\t{\n\t\t$this->dbQueryResult['ORDERS'] = CSaleOrder::GetList(array($this->sortBy => $this->sortOrder), $this->filter);\n\t\t$this->dbQueryResult['ORDERS']->NavStart($this->arParams[\"ORDERS_PER_PAGE\"], false);\n\n\t\tif(empty($this->dbQueryResult['ORDERS']))\n\t\t\treturn;\n\n\t\twhile ($arOrder = $this->dbQueryResult['ORDERS']->GetNext())\n\t\t{\n\t\t\t$arOBasket = array();\n\t\t\t$dbBasket = CSaleBasket::GetList(array('NAME' => 'asc'), array(\"ORDER_ID\"=>$arOrder[\"ID\"]), false, false, array('*'));\n\t\t\twhile ($arBasket = $dbBasket->Fetch())\n\t\t\t{\n\t\t\t\tif (CSaleBasketHelper::isSetItem($arBasket))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$arOBasket[] = $arBasket;\n\t\t\t}\n\n\t\t\t$this->dbResult['ORDERS'][] = array(\n\t\t\t\t\"ORDER\" => $arOrder,\n\t\t\t\t\"BASKET_ITEMS\" => $arOBasket,\n\t\t\t);\n\t\t}\n\t}", "public function getSalesByMonth()\n {\n\n $dataPoints = DB::select('SELECT date_format(created_at, \\'%Y\\') as year, date_format(created_at, \\'%m\\') as month, count(id) as pocount, sum(total) as monthtotal from purchase_orders group by date_format(created_at, \\'%Y-%m\\')');\n\n\n return response()->json($dataPoints);\n\n }", "function ppt_resources_get_next_planned_orders($data)\n{\n global $user;\n $months = array(\n \"01\" => 'December',\n \"02\" => 'January',\n \"03\" => 'February',\n \"04\" => 'March',\n \"05\" => 'April',\n \"06\" => 'May',\n \"07\" => 'June',\n \"08\" => 'July',\n \"09\" => 'August',\n \"10\" => 'September',\n \"11\" => 'October',\n \"12\" => 'November',\n );\n\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n if (empty($data['accounts'])) {\n return services_error('Accounts is not defined!', 500);\n }\n\n if (empty($data['products'])) {\n return services_error('Products is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = $data['accounts'];\n $products = $data['products'];\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'planned_order')\n ->fieldCondition('field_planned_account', 'target_id', $accounts, 'IN')\n ->fieldCondition('field_planned_product', 'target_id', $products, 'IN')\n ->fieldCondition('field_planned_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_period', 'value', $end_date, '<=')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n $final_arr = [];\n\n if (isset($records['node'])) {\n $nodes_ids = array_keys($records['node']);\n $nodes = node_load_multiple($nodes_ids);\n\n foreach ($nodes as $node) {\n // Get node planned product name.\n $planned_product_tid = $node->field_planned_product['und'][0]['target_id'];\n $planned_product = taxonomy_term_load($planned_product_tid);\n $planned_product_name = $planned_product->name;\n\n // Get node date for product (planned).\n if (isset($node->field_planned_period['und'])) {\n $node_date = $node->field_planned_period['und'][0]['value'];\n $planned_month = date(\"F\", strtotime($node_date));\n }\n\n // Get node values for planned quantity.\n $planned_quantity = 0;\n if (isset($node->field_planned_quantity['und'])) {\n $planned_quantity = $node->field_planned_quantity['und'][0]['value'];\n }\n\n // If product already exists, update its values for node months.\n if (isset($final_arr['planned'][$planned_product_name])) {\n if (isset($final_arr['planned'][$planned_product_name][$planned_month])) {\n $final_arr['planned'][$planned_product_name][$planned_month][0] += (int) $planned_quantity;\n } else {\n $final_arr['planned'][$planned_product_name][$planned_month][0] = [(int) $planned_quantity];\n }\n } else {\n // Initialze product array with 0 for all months, then update it with current node data.\n $final_arr['planned'][$planned_product_name] = [];\n for ($i = 1; $i <= 12; $i++) {\n $month = $months[sprintf('%02d', $i)];\n $final_arr['planned'][$planned_product_name][$month] = [0];\n }\n $final_arr['planned'][$planned_product_name][$planned_month] = [(int) $planned_quantity];\n }\n }\n }\n return $final_arr;\n}", "public function indexgraphyearAd()\n {\n\n // ->elementLabel(\"amout\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->groupBy('name');\n\n // $bills = Bill::where(DB::raw(\"(DATE_FORMAT(update_at,'%Y'))\"),date('Y'))->get();\n // $chart = Charts::database($bills, 'bar', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->groupByMonth(date('Y'), true);\n\n // $data = Bill::where('updated_at', '2018-12-10')->get();\n // $chart = Charts::create('line', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->labels($data->pluck('updated_at'))\n // ->values($data->pluck('sum'));\n\n $chart = Charts::database(Bill::all(), 'bar', 'highcharts')\n ->elementLabel(\"Total\")\n ->dimensions(1000, 500)\n ->responsive(false)\n ->lastByYear(6);\n\n \n\n // $data = BillDetail::all();\n // $chart = Charts::create('line', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->labels($data->pluck('name'))\n // ->values($data->pluck('amout'));\n\n\n // ->template(\"material\")\n // ->dataset('Element 1', [5,20,100])\n // ->dataset('Element 1', [15,30,80])\n // ->dataset('Element 1', [25,10,40])\n // ->labels(['One', 'Two', 'Three']);\n\n return view('adminPharmacy.a_graphyear', ['chart' => $chart]);\n }", "public function vendor_orders()\n {\n $query = $this->db->where('vendor_hash', $this->current_user->user_hash)\n ->where('progress >', '0')\n ->order_by('time desc')\n ->get('orders');\n\n if ($query->num_rows() > 0) {\n $row = $query->result_array();\n return $this->build_array($row);\n } else {\n return array();\n }\n }", "public function actionGetOrders(): \\yii\\web\\Response\n {\n return $this->asJson(CommerceReports::$plugin->orders->getOrders());\n }", "function get_vehicles_by_year() {\n global $db;\n $query = 'SELECT * FROM vehicles\n ORDER BY year DESC';\n $statement = $db->prepare($query);\n $statement->execute();\n $vehicles = $statement->fetchAll();\n $statement->closeCursor();\n return $vehicles;\n }", "public function buyer_orders()\n {\n $query = $this->db->where('buyer_id', $this->current_user->user_id)\n ->order_by('time desc')\n //->order_by('progress asc, time desc')\n ->get('orders');\n #echo $this->db->last_query();\n return ($query->num_rows() > 0) ? $this->build_array($query->result_array()) : array();\n\n }", "public function getReportsbyYear()\n {\n $charts = app(ReportChart::class);\n $response = $this->byYear();\n \n $charts->labels($response['ano']);\n \n $charts->dataset('Relatório Anual de Vendas','bar',$response['total'])\n ->backgroundColor($response['colors'])\n ->color('red');\n\n $charts->options([\n 'scales' => [\n 'yAxes' => [\n [\n 'ticks' => [\n 'callback' => $charts->rawObject('myCallback')\n ]\n ]\n ]\n ]\n ]); \n \n return $charts;\n }", "public function get_main_chart() {\n\t\tglobal $wp_locale;\n\n\t\t// Get orders and dates in range - we want the SUM of order totals, COUNT of order items, COUNT of orders, and the date\n\t\t$orders = $this->get_order_report_data( array(\n\t\t\t'data' => array(\n\t\t\t\t'ID' => array(\n\t\t\t\t\t'type' => 'post_data',\n\t\t\t\t\t'function' => 'COUNT',\n\t\t\t\t\t'name' => 'total_orders',\n\t\t\t\t\t'distinct' => true,\n\t\t\t\t),\n\t\t\t\t'post_date' => array(\n\t\t\t\t\t'type' => 'post_data',\n\t\t\t\t\t'function' => '',\n\t\t\t\t\t'name' => 'post_date'\n\t\t\t\t),\n\t\t\t),\n\t\t\t'group_by' => $this->group_by_query,\n\t\t\t'order_by' => 'post_date ASC',\n\t\t\t'query_type' => 'get_results',\n\t\t\t'filter_range' => true\n\t\t) );\n\n\t\t// Get Abadoned Carts in range 1 years\n\t\t$abandoned_carts_items = CartModel::get_carts_one_year();\n\t\t$ee_abandoned_posts = array();\n\n\t\tif ( $abandoned_carts_items ) {\n\n\t\t\tforeach ( $abandoned_carts_items as $order_item ) {\n\t\t\t\t$date = date( 'Y-m-d h:i:s', $order_item->post_date );\n\n\t\t\t\t$obj = new stdClass();\n\t\t\t\t$obj->post_date = $date;\n\t\t\t\t$obj->abandoned_cart_itms = 1;\n\n\t\t\t\t$ee_abandoned_posts[] = $obj;\n\t\t\t}\n\t\t}\t\n\n\t\t// Prepare data for report\n\t\t$order_counts = $this->prepare_chart_data( $orders, 'post_date', 'total_orders', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t$abandoned_carts_encoded = $this->prepare_chart_data( $ee_abandoned_posts, 'post_date', 'abandoned_cart_itms', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t\n\t\t// Encode in json format\n\t\t$chart_data = json_encode( array(\n\t\t\t'order_counts' => array_values( $order_counts ),\n\t\t\t'abandoned_cart_itms' => array_values( $abandoned_carts_encoded )\n\t\t) );\n\t\t?>\n\n\t\t<?php //echo $chart_data; ?>\n\t\t<div class=\"chart-container\">\n\t\t\t<div class=\"chart-placeholder main\"></div>\n\t\t</div>\n\t\t<script type=\"text/javascript\">\n\n\t\t\tvar main_chart;\n\n\t\t\tjQuery(function(){\n\t\t\t\tvar order_data = jQuery.parseJSON( '<?php echo $chart_data; ?>' );\n\t\t\t\tvar drawGraph = function( highlight ) {\n\t\t\t\t\tvar series = [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"<?php echo esc_js( __( 'Number of conversions', 'cart_converter' ) ) ?>\",\n\t\t\t\t\t\t\tdata: order_data.order_counts,\n\t\t\t\t\t\t\tcolor: '<?php echo $this->chart_colours['order_counts']; ?>',\n\t\t\t\t\t\t\tbars: { fillColor: '<?php echo $this->chart_colours['order_counts']; ?>', fill: true, show: true, lineWidth: 0, barWidth: <?php echo $this->barwidth; ?> * 0.5, align: 'center' },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\thoverable: true\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"<?php echo esc_js( __( 'Abandoned Carts', 'cart_converter' ) ) ?>\",\n\t\t\t\t\t\t\tdata: order_data.abandoned_cart_itms,\n\t\t\t\t\t\t\tcolor: '<?php echo $this->chart_colours['abandoned_carts']; ?>',\n\t\t\t\t\t\t\tpoints: { show: true, radius: 5, lineWidth: 3, fillColor: '#fff', fill: true },\n\t\t\t\t\t\t\tlines: { show: true, lineWidth: 4, fill: false },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\thoverable: true\n\t\t\t\t\t\t}\n\t\t\t\t\t];\n\n\t\t\t\t\tif ( highlight !== 'undefined' && series[ highlight ] ) {\n\t\t\t\t\t\thighlight_series = series[ highlight ];\n\n\t\t\t\t\t\thighlight_series.color = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.bars )\n\t\t\t\t\t\t\thighlight_series.bars.fillColor = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.lines ) {\n\t\t\t\t\t\t\thighlight_series.lines.lineWidth = 5;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmain_chart = jQuery.plot(\n\t\t\t\t\t\tjQuery('.chart-placeholder.main'),\n\t\t\t\t\t\tseries,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\tshow: false\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t grid: {\n\t\t\t\t\t\t color: '#aaa',\n\t\t\t\t\t\t borderColor: 'transparent',\n\t\t\t\t\t\t borderWidth: 0,\n\t\t\t\t\t\t hoverable: true\n\t\t\t\t\t\t },\n\t\t\t\t\t\t xaxes: [ {\n\t\t\t\t\t\t \tcolor: '#aaa',\n\t\t\t\t\t\t \tposition: \"bottom\",\n\t\t\t\t\t\t \ttickColor: 'transparent',\n\t\t\t\t\t\t\t\tmode: \"time\",\n\t\t\t\t\t\t\t\ttimeformat: \"<?php if ( $this->chart_groupby == 'day' ) echo '%d %b'; else echo '%b'; ?>\",\n\t\t\t\t\t\t\t\tmonthNames: <?php echo json_encode( array_values( $wp_locale->month_abbrev ) ) ?>,\n\t\t\t\t\t\t\t\ttickLength: 1,\n\t\t\t\t\t\t\t\tminTickSize: [1, \"<?php echo $this->chart_groupby; ?>\"],\n\t\t\t\t\t\t\t\tfont: {\n\t\t\t\t\t\t \t\tcolor: \"#aaa\"\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t} ],\n\t\t\t\t\t\t yaxes: [\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t \t\tmin: 0,\n\t\t\t\t\t\t \t\tminTickSize: 1,\n\t\t\t\t\t\t \t\ttickDecimals: 0,\n\t\t\t\t\t\t \t\tcolor: '#d4d9dc',\n\t\t\t\t\t\t \t\tfont: { color: \"#aaa\" }\n\t\t\t\t\t\t \t},\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t \t\tposition: \"right\",\n\t\t\t\t\t\t \t\tmin: 0,\n\t\t\t\t\t\t \t\ttickDecimals: 2,\n\t\t\t\t\t\t \t\talignTicksWithAxis: 1,\n\t\t\t\t\t\t \t\tcolor: 'transparent',\n\t\t\t\t\t\t \t\tfont: { color: \"#aaa\" }\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\n\t\t\t\t\tjQuery('.chart-placeholder').resize();\n\t\t\t\t}\n\n\t\t\t\tdrawGraph();\n\n\t\t\t\tjQuery('.highlight_series').hover(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph( jQuery(this).data('series') );\n\t\t\t\t\t},\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}", "public function AllOrders_get() {\n extract($_GET);\n $result = $this->feeds_model->AllOrders($per_page, $offset);\n return $this->response($result);\n }", "public function findAllOrders()\n {\n return $this->createQueryBuilder('o')\n ->orderBy('o.createdDate' , 'DESC');\n }", "function ppt_resources_get_delivered_planned_orders($data)\n{\n global $user;\n $months = array(\n \"01\" => 'December',\n \"02\" => 'January',\n \"03\" => 'February',\n \"04\" => 'March',\n \"05\" => 'April',\n \"06\" => 'May',\n \"07\" => 'June',\n \"08\" => 'July',\n \"09\" => 'August',\n \"10\" => 'September',\n \"11\" => 'October',\n \"12\" => 'November',\n );\n\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n if (empty($data['accounts'])) {\n return services_error('Accounts is not defined!', 500);\n }\n\n if (empty($data['products'])) {\n return services_error('Products is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = $data['accounts'];\n $products = $data['products'];\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'planned_order')\n ->fieldCondition('field_planned_account', 'target_id', $accounts, 'IN')\n ->fieldCondition('field_planned_product', 'target_id', $products, 'IN')\n ->fieldCondition('field_planned_actual_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_actual_period', 'value', $end_date, '<=')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n $final_arr = [];\n\n if (isset($records['node'])) {\n $nodes_ids = array_keys($records['node']);\n $nodes = node_load_multiple($nodes_ids);\n\n foreach ($nodes as $node) {\n // Get node planned product name.\n $planned_product_tid = $node->field_planned_product['und'][0]['target_id'];\n $planned_product = taxonomy_term_load($planned_product_tid);\n $planned_product_name = $planned_product->name;\n\n // Get node date for product (planned).\n if (isset($node->field_planned_actual_period['und'])) {\n $node_date = $node->field_planned_actual_period['und'][0]['value'];\n $delivered_month = date(\"F\", strtotime($node_date));\n }\n\n // Get node values for planned quantity.\n $delivered_quantity = 0;\n if (isset($node->field_planned_delivered_quantity['und'])) {\n $delivered_quantity = $node->field_planned_delivered_quantity['und'][0]['value'];\n }\n\n // If product already exists, update its values for node months.\n if (isset($final_arr['delivered'][$planned_product_name])) {\n if (isset($final_arr['delivered'][$planned_product_name][$delivered_month])) {\n $final_arr['delivered'][$planned_product_name][$delivered_month][0] += (int) $delivered_quantity;\n } else {\n $final_arr['delivered'][$planned_product_name][$delivered_month][0] = [(int) $delivered_quantity];\n }\n } else {\n // Initialze product array with 0 for all months, then update it with current node data.\n $final_arr['delivered'][$planned_product_name] = [];\n for ($i = 1; $i <= 12; $i++) {\n $month = $months[sprintf('%02d', $i)];\n $final_arr['delivered'][$planned_product_name][$month] = [0];\n }\n $final_arr['delivered'][$planned_product_name][$delivered_month] = [(int) $delivered_quantity];\n }\n }\n }\n return $final_arr;\n}", "public function getTransactionDataLastYear($customerId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-1year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $transactionResource = $this->_transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processReceivedTransactionData($data, $result);\n \n $data = $transactionResource->getSpentCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processSpentTransactionData($data, $result);\n \n $result = array_values($result);\n return $result;\n }", "function getOrderings() ;", "public function buysOfThisYear() {\n $query = \"SELECT COUNT(*) AS 'BUYS', MONTH(`BUYDATE`) AS 'MONTH' FROM `BUY` WHERE YEAR(BUYDATE) = \" .\n \"YEAR(NOW()) GROUP BY MONTH(`BUYDATE`)\";\n\n $result = parent::query($query);\n\n $toReturn = array();\n\n while ($row = $result->fetch_assoc()) {\n $toReturn[] = array(\n 'month' => $row['MONTH'],\n 'buys' => $row['BUYS']\n );\n }\n\n return $toReturn;\n }", "public function getTodayRevisitOrders()\n {\n return \\DB::select(\"SELECT a.id, a.propaddress1, a.propaddress2, a.propcity, a.propstate, a.propzip, s.descrip as status_name FROM appr_dashboard_delay_order d LEFT JOIN appr_order a ON (a.id=d.orderid) LEFT JOIN order_status s ON (a.status=s.id) WHERE d.created_date BETWEEN :from AND :to AND d.delay_date BETWEEN :t AND :b\", [':from' => strtotime('today'), ':to' => strtotime('tomorrow'), ':t' => strtotime('today'), ':b' => strtotime('tomorrow')]);\n }", "function show_orders() {\n\n\t\t$connection = new MySQLDataSource();\n $connection->connect($GLOBALS['db']['default']['hostname'],\n $GLOBALS['db']['default']['username'],\n $GLOBALS['db']['default']['password'],\n $GLOBALS['db']['default']['database']);\n\t\t$query = \"SELECT * FROM orders ORDER BY date;\";\n\t\t$connection->execute_query($query);\n\t\t$row = $connection->next();\n\t\t$i = 0;\n\n\t\tif(!$row) {\n\n\t\t\t$connection->disconnect();\n\t\t\treturn false;\n\n\t\t} else {\n\n\t\t\twhile($row) {\n\n\t\t\t\t$orders[$i] = new Order();\n\t\t\t\t$orders[$i]->setIdOrder($row->id_order);\n\t\t\t\t$orders[$i]->setDate($row->date);\n\t\t\t\t$orders[$i]->setIdCustomer($row->id_customer);\n\t\t\t\t$orders[$i]->setAmount($row->amount);\n\t\t\t\t$row = $connection->next();\n\t\t\t\t$i++;\n\n\t\t\t}\n\n\t\t\t$connection->disconnect();\n\t\t\treturn $orders;\n\n\t\t}\n\t}", "function getAllOrders()\n {\n $dataService = new OrderDataService();\n\n return $dataService->getAllOrders();\n }", "function get_planned_orders_for_acconuts_per_year($year, $accounts)\n{\n if (!$year) {\n $year = date('Y');\n }\n\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n\n if (empty($accounts)) {\n return [];\n }\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'planned_order')\n ->fieldCondition('field_planned_account', 'target_id', $accounts, 'IN')\n ->fieldCondition('field_planned_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_period', 'value', $end_date, '<=')\n ->fieldCondition('field_planned_actual_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_actual_period', 'value', $end_date, '<=')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n\n if (isset($records['node'])) {\n return $records['node'];\n }\n}", "public function allOrder()\n {\n $orders = Order::where('id','!=',0)\n ->orderBy('id','desc')\n ->get()\n ->groupBy(function ($data){\n return $data->created_at->format('M-Y');\n });\n\n return view('user.admin.order.all-order',[\n 'orders' => $orders\n ]);\n }", "protected function list_orders() {\r\n // Get response\r\n $dt = new DataTableResponse( $this->user );\r\n\r\n $website_order = new WebsiteOrder();\r\n\r\n // Set Order by\r\n $dt->order_by( '`website_order_id`', '`total_cost`', '`status`', '`date_created`' );\r\n $dt->add_where( ' AND `website_id` = ' . (int) $this->user->account->id );\r\n $dt->search( array( '`website_order_id`' => false ) );\r\n\r\n // Get items\r\n $website_orders = $website_order->list_all( $dt->get_variables() );\r\n $dt->set_row_count( $website_order->count_all( $dt->get_count_variables() ) );\r\n\r\n // Set initial data\r\n $data = false;\r\n\r\n /**\r\n * @var WebsiteOrder $order\r\n */\r\n if ( is_array( $website_orders ) )\r\n foreach ( $website_orders as $order ) {\r\n switch ( $order->status ) {\r\n case WebsiteOrder::STATUS_DECLINED:\r\n $status = 'Declined';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_PURCHASED:\r\n $status = 'Purchased';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_PENDING:\r\n $status = 'Pending';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_DELIVERED:\r\n $status = 'Delivered';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_RECEIVED:\r\n $status = 'Received';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_SHIPPED:\r\n $status = 'Shipped';\r\n break;\r\n\r\n default:\r\n $status = 'Error';\r\n break;\r\n }\r\n\r\n $date = new DateTime( $order->date_created );\r\n\r\n $link_text = '';\r\n if ( $order->is_ashley_express() ) {\r\n $link_text = \" - Express Delivery\";\r\n }\r\n\r\n $data[] = array(\r\n '<a href=\"' . url::add_query_arg( 'woid', $order->id, '/shopping-cart/orders/view/' ) . '\" title=\"' . _('View') . '\">' . $order->id . '</a>' . $link_text\r\n , $order->name\r\n , '$' . number_format( $order->total_cost, 2 )\r\n , $status\r\n , $date->format('F jS, Y')\r\n );\r\n }\r\n\r\n // Send response\r\n $dt->set_data( $data );\r\n\r\n return $dt;\r\n }", "public function searchMonth(Request $request){\n $result = Order::with('customer')->where('order_month',$request->order_month)->where('order_year',$request->order_year)->latest()->get();\n return response()->json($result);\n\n }", "public function getFulfilledOrders()\n {\n $order = $this->db->prepare(<<<SQL\nSELECT orders.order_id, orders.order_date, orders.arrival_date, orders.student_number\nFROM orders\nWHERE orders.arrival_date IS NOT NULL\nORDER BY orders.order_date;\nSQL\n );\n $order->execute();\n return $order->fetchAll(\\PDO::FETCH_OBJ);\n }", "public function list_client_desc(){\n\n$this->db->order_by(\"year\", \"desc\");\n\t\n$result\t= $this->db->get('client');\n\n\t\treturn $result->result();\t\n}", "public function getAmountsDataLastYear($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-1year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getAmountsByMonth($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public static function getChartData(Request $request)\n {\n $user = auth()->user();\n $chart = new Chart($request);\n $query_params = $chart->setQueryParams();\n\n $query = (new Order())->newQuery();\n\n if (Bouncer::is($user)->an('editor')) {\n $query->where('client_id', $user->clientId());\n }\n\n $orders = $query->select('total', 'created_at')\n ->whereBetween('created_at', [$query_params['from'], $query_params['to']])\n ->orderBy('created_at')\n ->get()\n ->groupBy(function ($val) use ($query_params) {\n return Carbon::parse($val->created_at)->format($query_params['group']);\n });\n\n return $chart->returnQueryData($query_params['iterator'], $orders);\n }", "public function fetch_orders_date(Request $request) {\n $data['orders'] = Order::whereBetween('created_at', array($request->from, $request->to))->get();\n $data['areas'] = Area::where('deleted', 0)->orderBy('id', 'desc')->get();\n $data['from'] = '';\n $data['to'] = '';\n if (isset($request->from)) {\n $data['from'] = $request->from;\n $data['to'] = $request->to;\n }\n $data['sum_price'] = Order::whereBetween('created_at', array($request->from, $request->to))->sum('subtotal_price');\n $data['sum_delivery'] = Order::whereBetween('created_at', array($request->from, $request->to))->sum('delivery_cost');\n $data['sum_total'] = Order::whereBetween('created_at', array($request->from, $request->to))->sum('total_price');\n return view('admin.orders' , ['data' => $data]);\n }", "public function getRecurringOrders();", "public function allOrders()\n\t{\n\t\trequire 'Database.php';\n\n\t\t$req = $db->prepare(\"SELECT lol_server,lol_summoner,lol_account,lol_password,order_id, order_queue, order_boost, order_type, order_wins, start_league, start_division, desired_league, desired_division, order_date, DATE_FORMAT(order_date, '%d/%m/%Y') AS date, order_price, order_status, order_pause FROM orders WHERE user_id = ? ORDER BY order_status\");\n\t\t$req->execute(array($_SESSION['id']));\n\n\t\treturn $req->fetchAll();\n\t}", "public function actionIndex()\n {\n if(empty($ordersMonth)){\n $begin = new \\DateTime( date('Y-m-d h:i:s').' -3 weeks' );\n $end = new \\DateTime( date('Y-m-d h:i:s').' +1 day' );\n } else {\n $begin = new \\DateTime( date($ordersMonth.'-01 h:i:s') );\n $end = new \\DateTime( date($ordersMonth.'-t h:i:s'));\n }\n\n $interval = \\DateInterval::createFromDateString('1 day');\n $period = new \\DatePeriod($begin, $interval, $end);\n $orderStats = [];\n foreach ( $period as $dt ){\n $beginOfDay = $dt->setTime(0,0,1)->format( \"Y-m-d H:i:s\\n\" );\n $endOfDay = $dt->setTime(23,59,59)->format( \"Y-m-d H:i:s\\n\" );\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['all'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['done'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>5])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['cancelled'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>1])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['new'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>3])->sum('order_amount');\n }\n\n return $this->render('index', ['orderStats'=>$orderStats, 'begin'=>$begin->format( \"Y-m-d H:i:s\\n\" ), 'end'=>$end->format( \"Y-m-d H:i:s\\n\" )]);\n }", "public function retrieveOrders() {\r\n $client = new Client(\r\n str_replace('/public', '', get_site_url()),\r\n // get_site_url(),\r\n $this->consumer_key,\r\n $this->consumer_secret,\r\n [\r\n 'wp_api' => true,\r\n 'version' => 'wc/v3',\r\n 'query_string_auth' => true,\r\n 'timeout' => PADBSYNC_CURL_TIMEOUT\r\n ]\r\n );\r\n \r\n global $wpdb;\r\n \r\n $query = \"SELECT ID FROM {$wpdb->prefix}posts WHERE profaktura_status = %d AND post_type = %s ORDER BY post_date DESC\";\r\n \r\n $sql = $wpdb->prepare($query, [0, 'shop_order']);\r\n \r\n $dbOrdersProStatZero = $wpdb->get_results($sql);\r\n \r\n $allOrders = $client->get('orders');\r\n \r\n $orders = [];\r\n \r\n if (count($allOrders) > 0 && count($dbOrdersProStatZero) > 0) {\r\n foreach ($allOrders as $o) {\r\n foreach ($dbOrdersProStatZero as $d) {\r\n if ($o->id == $d->ID) {\r\n $orders[] = $o;\r\n continue;\r\n }\r\n }\r\n } \r\n }\r\n \r\n if (count($orders) < 1) {\r\n return new WP_REST_Response(['message' => 'No orders found!']);\r\n }\r\n \r\n return new WP_REST_Response($orders);\r\n }", "public static function getNewOrders($lastVisit) {\n\n\t\treturn Order::fullActive()\n\t\t ->whereBetween('date', [$lastVisit, Carbon::now()])\n\t\t ->get();\n\t}", "public function getOrders()\n {\n $response = $this->orderDesk->get( \"orders\" );\n $orders = $response[ \"orders\" ];\n $values = [];\n\n if (!empty($orders)) {\n foreach ( $orders as $order ) {\n\n $value = [\n $order[\"shipping\"][\"first_name\"],\n $order[\"shipping\"][\"last_name\"],\n $order[\"email\"],\n $order[\"shipping_method\"],\n $order[\"payment_type\"],\n $order[\"order_total\"]\n ];\n \n array_push( $values, $value );\n }\n \n $this->updateGoogleSheets( $values );\n } else {\n return $response['message'];\n }\n }", "public function index()\r\n {\r\n $orders = Order::orderBy('created_at', 'desc')->get();\r\n\r\n // Stats\r\n $stats = [];\r\n\r\n // Stats - Orders - Processing\r\n $stats['orders_processing'] = Order::where('status', 'processing')->count();\r\n\r\n // Stats - Orders - Processing - Total\r\n $stats['orders_processing_total'] = Order::where('status', 'processing')->sum('total');\r\n\r\n // Stats - Orders - Month to Date\r\n $stats['orders_month_to_date'] = Order::where('created_at', '>=', Carbon::now('America/Los_Angeles')->startOfMonth())->count();\r\n //$stats['orders_month_to_date'] = Order::where('created_at', '>=', $now->modify('first day of this month'))->count(); //this works\r\n\r\n // Stats - Orders - Month to Date - Total\r\n $stats['orders_month_to_date_total'] = Order::where('created_at', '>=', Carbon::now('America/Los_Angeles')->startOfMonth())->sum('total');\r\n\r\n // Stats - Orders - Lifetime - Count\r\n $stats['orders_lifetime'] = Order::count();\r\n\r\n // Stats - Orders - Lifetime - Total\r\n $stats['orders_lifetime_total'] = Order::sum('total');\r\n\r\n return view('admin.orders.index', [\r\n 'orders' => $orders,\r\n 'stats' => $stats\r\n ]);\r\n }", "public function getOrdersSince($startDate) {\n $apiUrl = sprintf('%s/orderExtend?full=1&excludeAbandonedCart=1&limit=200&createdAtMin=%s&createdAtMax=%s', env('SHOPRENTER_API'), $startDate->toDateTimeLocalString(), Carbon::now()->toDateTimeLocalString());\n $data = [\n 'data' => [\n 'requests' => [],\n ],\n ];\n\n // Megrendelések 1. oldala lekérése\n $ch = curl_init();\n curl_setopt_array($ch, [\n CURLOPT_URL => $apiUrl,\n CURLOPT_HTTPHEADER => ['Content-Type:application/json', 'Accept:application/json'],\n CURLOPT_USERPWD => sprintf('%s:%s', env('SHOPRENTER_USER'), env('SHOPRENTER_PASSWORD')),\n CURLOPT_TIMEOUT => 120,\n CURLOPT_RETURNTRANSFER => true,\n ]);\n $response = json_decode(curl_exec($ch), true);\n $orders = array_key_exists('items', $response) ? $response['items'] : null;\n curl_close($ch);\n\n // Többi megrendelés hozzácsatolása\n if (array_key_exists('pageCount', $response) && $response['pageCount'] > 1) {\n for ($i = 1; $i <= $response['pageCount']; $i++) {\n $nextUrl = str_replace('page=1', 'page='.$i, $response['next']['href']);\n\n $data['data']['requests'][] = [\n 'method' => 'GET',\n 'uri' => $nextUrl,\n ];\n }\n }\n\n $ch = curl_init();\n curl_setopt_array($ch, [\n CURLOPT_URL => sprintf('%s/batch', env('SHOPRENTER_API')),\n CURLOPT_HTTPHEADER => ['Accept:application/json'],\n CURLOPT_USERPWD => sprintf('%s:%s', env('SHOPRENTER_USER'), env('SHOPRENTER_PASSWORD')),\n CURLOPT_TIMEOUT => 120,\n CURLOPT_POST => 1,\n CURLOPT_RETURNTRANSFER => true,\n ]);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));\n $response = json_decode(curl_exec($ch), true);\n curl_close($ch);\n if ($response) {\n foreach ($response['requests']['request'] as $responseData) {\n if ($responseData['response']['header']['statusCode'] == 200) {\n // Összerakjuk\n $orders = array_merge($orders, $responseData['response']['body']['items']);\n }\n }\n }\n\n // Státuszok\n foreach ($orders as $order) {\n $data['data']['requests'][] = [\n 'method' => 'GET',\n 'uri' => str_replace('orderStatuses/', 'orderStatusDescriptions?orderStatusId=', $order['orderStatus']['href']).'&full=1',\n ];\n }\n $ch = curl_init();\n curl_setopt_array($ch, [\n CURLOPT_URL => sprintf('%s/batch', env('SHOPRENTER_API')),\n CURLOPT_HTTPHEADER => ['Accept:application/json'],\n CURLOPT_USERPWD => sprintf('%s:%s', env('SHOPRENTER_USER'), env('SHOPRENTER_PASSWORD')),\n CURLOPT_TIMEOUT => 120,\n CURLOPT_POST => 1,\n CURLOPT_RETURNTRANSFER => true,\n ]);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));\n $response = json_decode(curl_exec($ch), true);\n curl_close($ch);\n if ($response) {\n foreach ($response['requests']['request'] as $responseData) {\n if ($responseData['response']['header']['statusCode'] == 200) {\n // Megkeressük, h melyik megrendeléshez való\n $found = false;\n foreach ($orders as &$order) {\n if ($order['orderStatus']['href'] == $responseData['response']['body']['items'][0]['orderStatus']['href']) {\n $order['statusData'] = $responseData['response']['body']['items'][0];\n $found = true;\n }\n }\n\n if (! $found) {\n Log::info('Nem található státusz egyik megrendeléshez sem:');\n Log::info('- ID: '.$responseData['response']['body']['items'][0]['id']);\n }\n }\n }\n }\n\n return $orders;\n }", "public function get_latest_orders()\n\t{\n\t\t$where = 'orders.order_status_id != 4 AND orders.order_status_id = order_status.order_status_id AND customer.customer_id = orders.customer_id AND orders.vendor_id = '.$this->session->userdata('vendor_id');\n\t\t$table = 'orders, order_status, customer';\n\t\t\n\t\t//retrieve all orders\n\t\t$this->db->from($table);\n\t\t$this->db->select('orders.*, orders.order_status_id AS status,customer.customer_first_name AS first_name, customer.customer_surname AS other_names, order_status.order_status_name');\n\t\t$this->db->where($where);\n\t\t$this->db->order_by('orders.order_created', 'DESC');\n\t\t$query = $this->db->get('', 20);\n\t\t\n\t\treturn $query;\n\t}", "public function TransactionChart(Request $request)\n {\n \t$year = $request->input('year') ? $request->input('year') : date('Y'); \n \t$chartData = DB::table('trans_peryear_view')\n \t\t\t\t->where('year', $year)\n \t\t\t\t->get();\n\n \treturn response()->json(['chartData' => $chartData], 200);\n }", "public function getgraphAction(){\n $params = array(\n 'cht' => 'lc', \t\t\t\t\t// chart type\n 'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0', //background fills for the chart\n // 'chm' => 'B,f4d4b2,0,0,0|B,FF0000,1,1,0|B,00FF00,2,2,0', \t\t// line fills\n 'chco' => 'db4814,1919D1',\t\t\t\t\t//Series Colors\n 'chs' => '587x300',\t\t\t\t// chart size <width>x<height>\n\t\t\t'chxt' => 'x,y',\t\t\t\t\t// visible axes\n\t\t\t//'chof' => 'validate'\t\t\t\t// output format (png,gif,json,html{when chof='validate'})\n );\n \n\t$post=$this->getRequest()->getPost();\n\t\n\t\n\t$timezoneLocal = Mage::app()->getStore()->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);\n\n\t\tlist ($dateStart, $dateEnd) = Mage::getResourceModel('reports/order_collection')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getDateRange($post['range'], '', '', true);\n\n $dateStart->setTimezone($timezoneLocal);\n $dateEnd->setTimezone($timezoneLocal);\n\t\n\t\t$dates = array();\n $datas = array();\n\n while($dateStart->compare($dateEnd) < 0){\n switch ($post['range']) {\n case '24h':\n $d = $dateStart->toString('yyyy-MM-dd HH:00');\n $dateStart->addHour(1);\n break;\n case '7d':\n case '1m':\n $d = $dateStart->toString('yyyy-MM-dd');\n $dateStart->addDay(1);\n break;\n case '1y':\n case '2y':\n $d = $dateStart->toString('yyyy-MM');\n $dateStart->addMonth(1);\n break;\n }\n\n $dates[] = $d;\n }\n\n\t\t$graphData=array();\n\t\t\n\t\t$product_list=array('product1'=>$post['product'],\n\t\t\t\t\t\t\t'product2'=>$post['compare2']\n\t\t\t\t\t\t\t);\t\n\t\t$graphData=Mage::Helper('graphs')->getGraphData($dates,$product_list);\n\n /**\n * setting skip step\n */\n if (count($dates) > 8 && count($dates) < 15) {\n $c = 1;\n } else if (count($dates) >= 15){\n $c = 2;\n } else {\n $c = 0;\n }\n /**\n * skipping some x labels for good reading\n */\n $i=0;\n foreach ($dates as $k => $d) {\n if ($i == $c) {\n $dates[$k] = $d;\n $i = 0;\n } else {\n $dates[$k] = '';\n $i++;\n }\n }\n \n $this->_axisLabels['x'] = $dates;\n\t\t$this->_axisLabels['y'] = $graphData['quantity'][$post['product']];\n\t\t\n\t\tforeach ($graphData['quantity'] as $index => $serie) {\n $localmaxlength[$index] = sizeof($serie);\n $localmaxvalue[$index] = max($serie);\n $localminvalue[$index] = min($serie);\n }\n \n\t\t$maxvalue = max($localmaxvalue);\n\t\t$minvalue = min($localminvalue);\n\n $yrange = 0;\n $yLabels = array();\n $miny = 0;\n $maxy = 0;\n $yorigin = 0;\n\n $maxlength = max($localmaxlength);\n if ($minvalue >= 0 && $maxvalue >= 0) {\n $miny = 0;\n if ($maxvalue > 10) {\n $p = pow(10, $this->_getPow($maxvalue));\n $maxy = (ceil($maxvalue/$p))*$p;\n $yLabels = range($miny, $maxy, $p);\n } else {\n $maxy = ceil($maxvalue+1);\n $yLabels = range($miny, $maxy, 1);\n }\n $yrange = $maxy;\n $yorigin = 0;\n }\n\n \n\t\t\t\n\t\t\t$params['chd'] = \"e:\";\n $dataDelimiter = \"\";\n $dataSetdelimiter = \",\";\n $dataMissing = \"__\";\n \n\t\t\t// EXTENDED ENCODING\n\t\t\tforeach($product_list as $productid){\n\t\t\t\t$chartdata = array();\t\n for ($j = 0; $j < sizeof($graphData['quantity'][$productid]); $j++) {\n $currentvalue = $graphData['quantity'][$productid][$j];\n \n if (is_numeric($currentvalue)) {\n if ($yrange) {\n $ylocation = (4095 * ($yorigin + $currentvalue) / $yrange);\n\n } else {\n $ylocation = 0;\n }\n $firstchar = floor($ylocation / 64);\n $secondchar = $ylocation % 64;\n $mappedchar = substr($this->_extendedEncoding, $firstchar, 1)\n . substr($this->_extendedEncoding, $secondchar, 1);\n array_push($chartdata, $mappedchar . $dataDelimiter);\n } else {\n array_push($chartdata, $dataMissing . $dataDelimiter);\n }\n\n\t\t\t }\n\t\t\t $buffer = implode('', $chartdata);\t\t\t \n\t\t\t\t\t$buffer = rtrim($buffer, $dataSetdelimiter);\n\t\t\t\t\t$buffer = rtrim($buffer, $dataDelimiter);\n\t\t\t\t\t$buffer = str_replace(($dataDelimiter . $dataSetdelimiter), $dataSetdelimiter, $buffer);\n\t\t\t\t\t\n\t\t\t\t\t$params['chd'] .= $buffer.',';\n\t\t\t\t\t$buffer=null;\n\t\t\t\t\t$chartdata=null;\n\t\t\t\t}\n\t\t\t\t\t$labelBuffer = \"\";\n\t\t\t\t\t$valueBuffer = array();\n\t\t\t\t\t$rangeBuffer = \"\";\n \n if (sizeof($this->_axisLabels) > 0) {\n $params['chxt'] = implode(',', array_keys($this->_axisLabels));\n $indexid = 0;\n foreach ($this->_axisLabels as $idx=>$labels){\n\t\t\t\t\n if ($idx == 'x') {\n /**\n * Format date\n */\n foreach ($this->_axisLabels[$idx] as $_index=>$_label) {\n if ($_label != '') {\n switch ($post['range']) {\n case '24h':\n $this->_axisLabels[$idx][$_index] = $this->formatTime(\n new Zend_Date($_label, 'yyyy-MM-dd HH:00'), 'short', false\n );\n break;\n case '7d':\n case '1m':\n $this->_axisLabels[$idx][$_index] = $this->formatDate(\n new Zend_Date($_label, 'yyyy-MM-dd')\n );\n break;\n case '1y':\n case '2y':\n\t\t\t\t\t\t\t\t\t\n $formats = Mage::app()->getLocale()->getTranslationList('datetime');\n $format = isset($formats['yyMM']) ? $formats['yyMM'] : 'MM/yyyy';\n $format = str_replace(array(\"yyyy\", \"yy\", \"MM\"), array(\"Y\", \"y\", \"m\"), $format);\n $this->_axisLabels[$idx][$_index] = date($format, strtotime($_label));\n break;\n }\n } else {\n $this->_axisLabels[$idx][$_index] = '';\n }\n\n }\n\t\t\t\t\t\t\t\t\t\t\n $tmpstring = implode('|', $this->_axisLabels[$idx]);\n\n $valueBuffer[] = $indexid . \":|\" . $tmpstring;\n if (sizeof($this->_axisLabels[$idx]) > 1) {\n $deltaX = 100/(sizeof($this->_axisLabels[$idx])-1);\n } else {\n $deltaX = 100;\n }\n } else if ($idx == 'y') {\n $valueBuffer[] = $indexid . \":|\" . implode('|', $yLabels);\n if (sizeof($yLabels)-1) {\n $deltaY = 100/(sizeof($yLabels)-1);\n } else {\n $deltaY = 100;\n }\n // setting range values for y axis\n $rangeBuffer = $indexid . \",\" . $miny . \",\" . $maxy . \"|\";\n }\n $indexid++;\n }\n $params['chxl'] = implode('|', $valueBuffer);\n }\t\t\t\n\t\t\t\t\t\n\t\tif (isset($deltaX) && isset($deltaY)) {\n $params['chg'] = $deltaX . ',' . $deltaY . ',1,0';\n }\n \n\n\t\t\t$p = array();\n foreach ($params as $name => $value) {\n $p[] = $name . '=' .urlencode($value);\n }\n\n $url= Mage_Adminhtml_Block_Dashboard_Graph::API_URL . '?' . implode('&', $p);\n\n\t\t\t\techo $url;\n\t}", "public function OrderMonth_Year()\n {\n\t $arrMonth=array();\n\t $year=$this->OrderYear();\n\t foreach($year as $a)\n\t {\n\t\t $arr=array();\n\t\t $select= \"SELECT DISTINCT(month(orderDate)) As orderMonth FROM orders \n\t\t \t\t\twhere year(orderDate)=\".$a->getorderYear(). \" order by orderDate\";\n\t\t $result=$this->executeSelect($select);\n\t\t while($row=mysqli_fetch_array($result))\n\t\t {\n\t\t\t $month=new ordersDto();\n\t\t\t $month->setorderMonth($row['orderMonth']);\n\t\t\t $arr[]=$month;\n\t\t }\n\t\t $this->DisConnectDB();\n\t\t $arrMonth[]=$arr;\n\t }\n/*\t\tfor( $i=0; $i<count($arrMonth); $i++)\n\t\t for($j=0; $j<count($arrMonth[$i]); $j++)\n\t\t\t echo $arrMonth[$i][$j]->getorderMonth();\n\t Thử kiểm tra xem có lấy đc các tháng trong các năm hay k -->>Lấy được\n*/\t\t\n\treturn $arrMonth;\n }", "function getOrders($orders) {\n $html = '';\n\n for ($i = 0; $i < sizeof($orders); $i++) {\n $order = $orders[$i];\n\n $dateCreated = $order['dateCreated'];\n $dateCreated = new DateTime($dateCreated->toDateTime()->format('Y-m-d H:i:s'));\n\n $html .= '<tr>\n <td class=\"order-row\">' . $dateCreated->format('d/m/Y') . '</td>\n <td class=\"order-row\">' . $order['orderNumber'] . '</td>\n <td class=\"order-row\">' . '£' . $order['summary']['grandTotal'] . '</td>\n <td class=\"order-row\">' . $order['status'] . '</td>\n <td align=\"middle\" class=\"order-row\">\n <button class=\"btn btn-outline-dark btn-sm view-order\" id=\"' . $order['_id'] . '\" onclick=\"viewOrderHistory(this)\">\n View\n </button>\n </td>\n </tr>';\n }\n\n return $html;\n}", "function orders() {\n\t \treturn $this->hook(\"/{$this->subject_slug}/v1/orders.xml?api_key={$this->api_key}\",\"order\");\n\t}", "public function getOrdersDataLastMonth($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-30days\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getNumOfOrderByDay($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function graphyearused()\n \t{\n \t\t// announce return variable\n \t\t$return \t= \tarray();\n \t\t$count \t\t=\tarray();\n \t\t// select logger collection \n \t\t$use_data \t= \t$this->mongo_db->db->used;\n \t\t// preparing query data\n \t\t$splitday \t= \texplode('-', $this->use_date);\n \t\tfor ($i = 1; $i <= 12; $i++) \n \t\t{\n \t\t\tif (strlen($i) == 1) \n \t\t\t{\n \t\t\t\t// use mongoRegex (while like in sql)\n \t\t\t\t$regex_Date \t= \tnew MongoRegex('/^'.$splitday[0].'-0'.$i.'/');\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_date' \t=> \t$regex_Date, \n \t\t\t\t\t'use_appid' => \t$this->use_appid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t} \n \t\t\telse \n \t\t\t{\n \t\t\t\t// use mongoRegex (while like in sql)\n \t\t\t\t$regex_Date \t= \tnew MongoRegex('/^'.$splitday[0].'-'.$i.'/');\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_date' \t=> $regex_Date, \n \t\t\t\t\t'use_appid' => $this->use_appid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t}\n \t\t}\n \t\t$return\t\t=\tarray(\n \t\t\t'name'\t\t=>\t\t'User',\n \t\t\t'data'\t\t=>\t\t$count\n \t\t\t);\n\n \t\treturn $return;\t\n \t}", "public function getFOrders()\n {\n // 花店管理员身份验证\n if (session(\"admin_level\") == 3){\n $toFlower = M('weixin_order');\n $data = $toFlower->where('type = 0')->select();\n $this->assign('data',$data);\n }\n\n $toTrade = M('pub_trade_logs');\n $con['uid'] = session('uid');\n //$this->ajaxReturn(0 , $con['uid'] , 1);\n $TradeLogs = $toTrade->query(\"SELECT `xt_pub_trade_logs`.* ,`xt_pub`.`title` FROM `xt_pub_trade_logs` left join `xt_pub` on `xt_pub_trade_logs`.`pub_id` = `xt_pub`.`pub_id` WHERE 1\");\n // $this->ajaxReturn(0 , $TradeLogs , 1);\n\n $this->assign('tradelogs',$TradeLogs);\n $this->display();\n }", "public function pharmacySalesGraphData()\n {\n $prescriptions = Prescription::whereIn('status',[Prescriptions::PAID_PRESCRIPTION,Prescriptions::ISSUED_PRESCRIPTION])->get();\n $internalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::INTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n $externalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::EXTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n return ResponseHelper::findSuccess('Explorations Data', [\n 'internalPrescriptionsSales' => $internalPrescriptions,\n 'externalPrescriptionsSales' => $externalPrescriptions,\n ]);\n }", "public function exportOrders()\n\t{\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.OrderEvent' );\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.ProductEvent' );\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.ProspectExportEvent' );\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.OrderHistoryEvent' );\n\t\t\n\t\t$baseURL = Yii::app()->request->hostInfo;\n\t\t$pageSize = 100;\n\n\t\t$allOrders = Yii::app()->db->createCommand()\n\t\t ->select('o.id, o.user_id, o.name, o.email, o.sum, o.date_create, o.status_id')\n\t\t ->from('kalitniki_order AS o')\n\t\t ->group('o.id');\n\t\n\t $allOrders = $allOrders->queryAll();\n\n\t $orderCount = count( $allOrders );\n\t \n\t $pages = ( $orderCount % $pageSize ) > 0 ? floor( $orderCount / $pageSize ) + 1 : $orderCount / $pageSize;\n\t \n\t for ( $currentPage = 0; $currentPage <= $pages - 1; $currentPage++ )\n\t {\n\t \t$dataExport = new OrderHistoryEvent;\n\t \t\n\t \t$offset = $currentPage * $pageSize;\n\t \t$collection = array_slice( $allOrders, $offset, $pageSize );\n\t \t\n\t\t foreach ( $collection as $order )\n\t\t {\n\t\t \t$orderProducts = Yii::app()->db->createCommand()\n\t\t\t ->select('op.name AS product_name, op.price, op.count, op.sum,\n\t\t\t \t\t\tp.id, p.url, p.articul, p.notice, i.name AS img, s.name AS section')\n\t\t\t ->from('kalitniki_order_product AS op')\n\t\t\t ->where('op.order_id = ' . $order['id'])\n\t\t\t ->join('kalitniki_product AS p', 'op.name = p.name')\n\t\t\t ->join('kalitniki_product_img AS i', 'p.id = i.parent')\n\t\t\t ->join('kalitniki_product_assignment AS a', 'p.id = a.product_id')\n\t\t\t ->join('kalitniki_product_section AS s', 's.id = a.section_id')\n\t\t\t ->group('p.id');\n\t\t\t $orderProducts = $orderProducts->queryAll();\n\t\t\t \n\t\t\t $qtyTotal = 0;\n\t\t\t \n\t\t\t $customer = Yii::app()->db->createCommand()\n\t\t\t ->select('c.user_id AS id, c.name, c.email')\n\t\t\t ->from('kalitniki_order AS c')\n\t\t\t ->where('c.id = ' . $order['id']);\n\t\t\t $customer = $customer->queryAll();\n\t\t\t $customer = $customer[0];\n\t\t\t\t\n\t\t\t\t$customer['date_create'] = null;\n\t\t\t\t\n\t\t\t\tif ( $customer['id'] )\n\t\t\t\t{\n\t\t\t\t\t$dateCreate = Yii::app()->db->createCommand()\n\t\t\t\t ->select('u.date_create')\n\t\t\t\t ->from('kalitniki_user AS u')\n\t\t\t\t ->where('u.id = ' . $customer['id']);\n\t\t\t\t $dateCreate = $dateCreate->queryAll();\n\t\t\t\t $dateCreate = $dateCreate[0];\n\t\t\t\t $customer['date_create'] = $dateCreate['date_create'];\n\t\t\t\t}\n\t\t\t \n\t\t\t $dataCustomer = new ProspectExportEvent;\n\t\t\t $dataCustomer->customer_id = $customer['id'];\n\t\t $dataCustomer->customer_first_name = $customer['name'];\n\t\t $dataCustomer->customer_last_name = \"\";\n\t\t $dataCustomer->customer_email = $customer['email'];\n\t\t $dataCustomer->customer_date_created = $customer['date_create'];\n\t\t $dataCustomer->customer_last_login_date = \"\";\n \n\t\t\t $data = new OrderEvent;\n\t\t\t $data->customer = $dataCustomer;\n\t\t\t $data->order_id = $order['id'];\n\t\t\t $data->date_created = $order['date_create'];\n\t\t\t $data->status = $this->getOrderStatus( $order['status_id'] );\n\t\t\t $data->price_total = $order['sum'];\n\t\t\t $data->qty_total = $qtyTotal;\n\t\t\t $data->products = array();\n\t\t\t \n\t\t\t foreach ($orderProducts as $orderProduct)\n\t\t\t {\n\t\t\t \t$productCategories = array();\n \t\t\t$productCategories[] = $orderProduct['section'];\n\t\t\t \t\n\t\t\t \t$dataProduct = new ProductEvent;\n\t\t \t$dataProduct->product_id = $orderProduct['id'];\n\t\t \t$dataProduct->product_name = $orderProduct['product_name'];\n\t\t \t$dataProduct->product_desc = $orderProduct['notice'];\n\t\t \t$dataProduct->product_sku = $orderProduct['articul'];\n\t\t \t$dataProduct->product_image = $baseURL . '/' . $orderProduct['img'];\n\t\t \t$dataProduct->product_url = $baseURL . '/' . $orderProduct['url'];\n\t\t \t$dataProduct->product_qty = (int) $orderProduct['count'];\n\t\t \t$dataProduct->product_price = $orderProduct['price'];\n\t\t \t$dataProduct->product_total_val = $orderProduct['sum'];\n\t\t \t$dataProduct->product_categories = $productCategories;\n\t\t \t\n\t\t \t$data->products[] = $dataProduct;\n \t\t\t$data->qty_total += $dataProduct->product_qty;\n\t\t\t }\n\n\t\t\t $dataExport->orders[] = $data;\n\t\t }\n\t\t \n\t\t $this->client->sendEvent( $dataExport );\n\t }\n\t}", "public function getAnnualSales() {\n\t\t// Query\n\t\t$sql = '\n\t\t\tSELECT \n\t\t\t\tDATE_FORMAT(transactionDate, \"%Y\") AS year, \n\t\t\t\tSUM(amount) AS amount\n\t\t\tFROM \n\t\t\t\ttransactions\n\t\t\tGROUP BY \n\t\t\t\tDATE_FORMAT(transactionDate, \"%Y\")\n\t\t';\n\n\t\t// Return\n\t\treturn DB::select($sql);\n\t}", "protected function getLastYearScope($src_bu) {\n $currentTime = date('Y-m', time());\n //get Arr of last year but same month\n $lastYearArr = array();\n $lastYearFinal = array();\n for ($i = 0; $i < 12; $i++) {\n $lastYearArr[$i] = date('Y-m', strtotime('-1 year, +' . $i . ' month', strtotime($currentTime)));\n }\n foreach ($lastYearArr as $key => $ly) {\n $daysOfMonth = date('t', strtotime($ly));\n $lastYearFinal[$key] = $ly . '-' . $daysOfMonth;\n }\n\n $em = $this->getDoctrine()->getManager();\n $qb = $em->createQueryBuilder();\n $qb->select('date')\n ->from('AlbatrossDailyBundle:Date', 'date')\n ->leftJoin('date.bu', 'bu');\n if ($src_bu == null) {\n $qb->where('bu.id is null');\n } else {\n $qb->where('bu.id = :bid');\n $qb->setParameter('bid', $src_bu->getId());\n }\n $qb->andWhere('date.dailydate IN (:dayArr)')\n ->setParameter('dayArr', $lastYearFinal);\n $query = $qb->getQuery();\n $result = $query->getArrayResult();\n\n $dateIdArr = array();\n foreach ($result as $re) {\n $dateIdArr[] = $re['id'];\n }\n $scopeQb = $em->createQueryBuilder();\n $scopeQb->select('number', 'date2')\n ->from('AlbatrossDailyBundle:Number', 'number')\n ->leftJoin('number.date', 'date2')\n ->leftJoin('number.status', 'status')\n ->where('date2.id IN (:dateId)')\n ->setParameter('dateId', $dateIdArr)\n ->andWhere('status.id = 1');\n $scopeQuery = $scopeQb->getQuery();\n $scopeResult = $scopeQuery->getArrayResult();\n $temp = array_flip($lastYearFinal);\n foreach ($scopeResult as $s) {\n $temp[$s['date']['dailydate']->format('Y-m-d')] = $s['number'];\n }\n $final = array();\n foreach ($temp as $key => $f) {\n if (is_int($f)) {\n $temp[$key] = '0';\n }\n $final[] = $temp[$key];\n }\n\n return $final;\n }", "private function _countOrders($year, $month)\n {\n return Purchase::whereYear('created_at', $year)\n ->whereMonth('created_at', $month)\n ->get();\n }", "function get_years_to_search() {\n global $DB;\n $sql = \"SELECT date AS fecha FROM {report_user_statistics};\";\n $dates = $DB->get_records_sql($sql);\n $result = array();\n foreach ($dates as $date) {\n $fecha = new DateTime(\"@$date->fecha\");\n $result[$fecha->format('Y')] = $fecha->format('Y');\n }\n return $result;\n}", "public function getOrderings() {}", "public function getBuyerHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $buyer = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($dateQuery.',count(distinct buyer_id)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['buyer'] = $buyer;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function actionOrder()\n {\n $request = Yii::$app->getRequest();\n $requestParams = $request->getBodyParams();\n \n if (empty($requestParams)) {\n $requestParams = $request->getQueryParams();\n }\n \n $query = Order::find()\n ->where(['customer_id' => $this->customer_id])\n ->andWhere(['<>', 'status_id', Order::STATUS_DRAFT])\n // filter based on date range\n ->andFilterWhere([\n 'between',\n 'ordered_at',\n $request->getBodyParam('order_from'),\n $request->getBodyParam('order_to')\n ]);\n \n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => ['params' => $requestParams],\n 'sort' => ['params' => $requestParams],\n ]);\n \n return $dataProvider;\n }", "public function getFutureRevisitOrders()\n {\n return \\DB::select(\"SELECT a.id, a.propaddress1, a.propaddress2, a.propcity, a.propstate, a.propzip, s.descrip as status_name FROM appr_dashboard_delay_order d LEFT JOIN appr_order a ON (a.id=d.orderid) LEFT JOIN order_status s ON (a.status=s.id) WHERE d.created_date BETWEEN :from AND :to AND d.delay_date > :today\", [':from' => strtotime('today'), ':to' => strtotime('tomorrow'), ':today' => strtotime('tomorrow')]);\n }", "function get_all_by_key_by_year() {\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_set_form_g_and_o\n\t\t\t\tWHERE sfg_pos_id = ? AND sfg_pay_id = ?\";\n\t\t$query = $this->db->query($sql, array($this->sfg_pos_id, $this->sfg_pay_id));\n\t\treturn $query;\n\t}", "public function getOrderings();", "public function getOrders()\n {\n return $this->orders;\n }", "public function getBuyerHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $buyer = DB::connection('virtual_market')\n ->table('orders')\n ->select(DB::raw($dateQuery.',count(distinct customer_id)'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['buyer'] = $buyer;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function getOrdersAction()\n {\n $em = $this->getDoctrine()->getManager();\n $currencies = $em->getRepository('ApiBundle:CurrencyOrder')->findBy(array(), array('id' => 'DESC'));\n $view = $this->view($currencies);\n return $this->handleView($view);\n }", "public static function getOrderHistoryOfUser() {\n return $allOrders = Order::where(\"user_id\", Auth::id())\n ->select(\"*\")->orderBy(\"created_at\", \"desc\")->get();\n }", "public function index()\n {\n $data = $this->repository->getAllOrderedByDate();\n return $data;\n }", "private function topGridData() {\r\n\t\t\r\n $result = $this->getLatestPeriod();\r\n \r\n if (is_array($result) && !empty($result))\r\n {\r\n $periodResult = array_column($result, \"period\");\r\n $query = \"SELECT \".$this->accountIdField.\" AS SKUID \" .\r\n \",\".$this->accountNameField.\" AS ACCOUNT \" .\r\n \",\".$this->settingVars->tesco_po_details.\".period AS PERIOD \" .\r\n \",SUM((CASE WHEN period IN('\" . implode(\"','\", $periodResult) . \"') THEN total_placed_orders_Cases ELSE 0 END)) AS ORDERED \" .\r\n \",SUM((CASE WHEN period IN('\" . implode(\"','\", $periodResult) . \"') THEN delivered_on_time ELSE 0 END)) AS DELIVERED \" .\r\n \" FROM \".$this->settingVars->tesco_po_details.\", \".$this->settingVars->skutable.\" WHERE \".$this->settingVars->tesco_po_details.\".GID = \".$this->settingVars->skutable.\".GID AND \".$this->settingVars->tesco_po_details.\".skuID = \".$this->settingVars->skutable.\".PIN AND \".$this->settingVars->skutable.\".clientID = '\".$this->settingVars->clientID.\"' AND \".$this->settingVars->skutable.\".GID = \".$this->settingVars->GID.\" AND \".$this->commonQueryPart.\" GROUP BY SKUID, ACCOUNT, PERIOD ORDER BY PERIOD DESC\";\r\n //echo $query; exit;\r\n $redisOutput = $this->redisCache->checkAndReadByQueryHashFromCache($query);\r\n if ($redisOutput === false) {\r\n $result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\r\n $this->redisCache->setDataForHash($result);\r\n } else {\r\n $result = $redisOutput;\r\n }\r\n \r\n $tmpResult = array();\r\n if (is_array($result) && !empty($result))\r\n {\r\n foreach($result as $data)\r\n $tmpResult[$data['SKUID'].\"##\".$data['ACCOUNT']][$data['PERIOD']] = $data;\r\n \r\n foreach($tmpResult as $tmpKey => $tmpData)\r\n {\r\n $tmp = array();\r\n $extra = explode(\"##\", $tmpKey);\r\n $tmp[\"0_0SKUID\"] = $extra[0];\r\n $tmp[\"0_01ACCOUNT\"] = $extra[1];\r\n \r\n foreach($periodResult as $key => $period)\r\n {\r\n $tmp[$key.\"_1ORDERED_\".$period] = (double)$tmpData[$period][\"ORDERED\"];\r\n $tmp[$key.\"_2DOT_\".$period] = ($tmpData[$period][\"ORDERED\"] != 0) ? ($tmpData[$period][\"DELIVERED\"]/$tmpData[$period][\"ORDERED\"])*100 : 0;\r\n $tmp[$key.\"_2DOT_\".$period] = (double)number_format($tmp[$key.\"_2DOT_\".$period], 1, '.', '');\r\n }\r\n $finalData[] = $tmp;\r\n }\r\n }\r\n }\r\n\r\n $this->jsonOutput['topGridData'] = $finalData;\r\n }", "function get_all_distributor_orders(){\r\n\r\n $distributor = $this->aauth->get_user();\r\n $distributor_id = $distributor->distributor_id;\r\n\r\n $date_from = $this->session->userdata('dashboard_date_from');\r\n $date_to = $this->session->userdata('dashboard_date_to');\r\n\r\n $query_string = \"SELECT \r\n a.id as 'order_number',\r\n b.company_name as 'customer',\r\n do.distributor_id as 'distributor',\r\n c.name as 'payment_type', \r\n a.status, \r\n a.delivery_date, \r\n a.createdate,\r\n a.delivery_type,\r\n sum(oi.price * oi.quantity) as total,\r\n sum(oi.quantity) as product_count\r\n FROM `orders` as a, `order_items` as `oi`,`customers` as b, `payment_types` as c,`distributor_orders` as do \r\n WHERE a.customer_id = b.id \r\n AND a.id = do.order_id \r\n AND a.id = oi.order_id \r\n AND do.distributor_id = '$distributor_id'\r\n AND a.createdate > '$date_from' \r\n AND a.createdate < '$date_to' \r\n GROUP BY oi.order_id ORDER by a.createdate desc \";\r\n\r\n $query = $this->db->query($query_string);\r\n \r\n $return['query'] = $query_string;\r\n $return['orders'] = $query->result_array();\r\n return $return;\r\n }", "public function reOpen_Orders_get() {\n extract($_GET);\n $result = $this->feeds_model->reOpen_Orders($order_id);\n return $this->response($result);\n }", "public function index(Request $request)\n {\n $last_year_invoices = Invoice::whereDate('created_at', '>', Carbon::now()->subDays(365))->get();\n $last_month_invoices = Invoice::whereDate('created_at', '>', Carbon::now()->subDays(30))->get();\n $last_month_paid = 0;\n $last_month_unpaid = 0;\n $last_month_total = 0;\n $recurring_invoice = 0;\n $last_year_total = 0;\n $paid_invoice_per_day= []; // for graph\n\n foreach ($last_month_invoices as $last_month_invoice) {\n if ($last_month_invoice->is_paid == 1) {\n\n $last_month_paid = $last_month_paid + $last_month_invoice->total_amount;\n\n // paid invoice graph\n if (array_key_exists($last_month_invoice->created_at->format('M d'), $paid_invoice_per_day)) {\n $paid_invoice_per_day[$last_month_invoice->created_at->format('M d')] = $paid_invoice_per_day[$last_month_invoice->created_at->format('M d')] + $last_month_invoice->total_amount;\n }else{\n $paid_invoice_per_day[$last_month_invoice->created_at->format('M d')] = $last_month_invoice->total_amount;\n }\n\n }else{\n $last_month_unpaid = $last_month_unpaid + $last_month_invoice->total_amount;\n }\n\n // recurring total\n if ($last_month_invoice->is_autometic == 1) {\n $recurring_invoice = $recurring_invoice + $last_month_invoice->total_amount;\n }\n\n }\n $last_month_total = $last_month_paid + $last_month_unpaid;\n\n\n\n foreach ($last_year_invoices as $last_year_invoice) {\n $last_year_total = $last_year_total + $last_year_invoice->total_amount; \n }\n\n // customer list\n $keyword = $request->get('search');\n $perPage = 25;\n if (!empty($keyword)) {\n $customers = Customer::where('name', 'LIKE', \"%$keyword%\")\n ->orWhere('email', 'LIKE', \"%$keyword%\")\n ->orWhere('business_name', 'LIKE', \"%$keyword%\")\n ->orWhere('address', 'LIKE', \"%$keyword%\")\n ->orWhere('city', 'LIKE', \"%$keyword%\")\n ->orWhere('state', 'LIKE', \"%$keyword%\")\n ->orWhere('zip', 'LIKE', \"%$keyword%\")\n ->latest()->paginate($perPage);\n } else {\n $customers = Customer::latest()->paginate($perPage);\n }\n return view('home', compact('last_month_paid','last_month_unpaid','last_month_total','last_year_total', 'customers', 'paid_invoice_per_day', 'recurring_invoice'));\n }", "function getAllOrders() {\n\techo \"Getting All Order </br>\";\n\t$response = getRequest('/api/order');\n\tprintInfo($response);\n}", "function get_data(){\r\n include_once 'config.php';\r\n global $CONFIG;\r\n try{\r\n $db = new PDO('mysql:host='.$CONFIG['dbhost'].';dbname='.$CONFIG['dbname'].';charset=utf8', $CONFIG['dbuser'], $CONFIG['dbpass']);\r\n \r\n if(intval($_GET['last'])>1){\r\n $stmt = $db->query(\"SELECT date, weight FROM graph order by date DESC limit \".intval($_GET['last']));\r\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n $result = array_reverse($result);\r\n }else{\r\n $stmt = $db->query(\"SELECT date, weight FROM graph order by date ASC\");\r\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n }catch(PDOException $e){\r\n var_dump($e);\r\n }\r\n\r\n return $result;\r\n}", "public function getAmountsDataLast2Years($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-2year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getAmountsByMonth($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function purchaseSalesGraph($financial_month, $financialYearDD, $userId)\r\n\t{\r\n\t\t\r\n\t\t$arrayData=array();\r\n\t\t$cashData=array();\r\n\t\t//total sales in amount\r\n\t\t\t$saleQuery='SELECT sum(invoice_total_value) as total_sales FROM '.$this->tableNames['client_invoice'].'\r\n\t\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\t\tand added_by=\"'.$userId.'\" \r\n\t\t\tand is_deleted=\"0\" \r\n\t\t\tand is_canceled=\"0\"';\r\n\t\t\t\r\n\t\t\t//total purchase in amount\r\n\t\t\t$purchaseQuery = 'SELECT sum(invoice_total_value) as total_purchase FROM '.$this->tableNames['client_purchase_invoice'].'\r\n\t\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\t\tand added_by=\"'.$userId.'\"\r\n\t\t\tand is_deleted=\"0\" \r\n\t\t\tand is_canceled=\"0\"';\r\n\r\n\t\t\t$totalSales = $this->get_row($saleQuery,false);\r\n\t\t\t$totalPurchase = $this->get_row($purchaseQuery,false);\r\n\t\t\t\r\n\t\t\tif(empty($totalSales)) {\r\n\t\t\t\t$cashData['sales'] = \"0.00\";\r\n\t\t\t} else {\r\n\t\t\t\t$cashData['sales'] = $totalSales[0];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(empty($totalPurchase)) {\r\n\t\t\t\t$cashData['purchase'] = \"0.00\";\r\n\t\t\t} else {\r\n\t\t\t\t$cashData['purchase'] = $totalPurchase[0];\r\n\t\t\t\t$cashData['month'] = $financial_month;\r\n\t\t\t}\r\n\t\t\tarray_push($arrayData, $cashData);\r\n\t\t\treturn $arrayData;\r\n\t}", "public function getTimeSeries() {\n $series = array();\n foreach($this -> _trades as $trade) {\n \n $month = date('M',$trade['timestamp']);\n if(!isset($series[$month])) {\n $series[$month] = 0;\n }\n if(!empty($trade['delta'])) {\n $series[$month] += $trade['delta'] - (isset($trade['fee']) ? $trade['fee'] : 0);\n }\n }\n return $series;\n }", "function getSalesByCountryXML($intYear, $howMany, $addJSLinks, $forDataURL) {\n // Function to connect to the DB\n $link = connectToDB();\n\n $strSQL = \"SELECT c.Country, ROUND(SUM(d.Quantity*p.UnitPrice*(1-d.Discount)),0) As Total, SUM(d.Quantity) as Quantity FROM FC_Customers as c, FC_Products as p, FC_Orders as o, FC_OrderDetails as d WHERE YEAR(OrderDate)=\" . $intYear . \" and d.ProductID=p.ProductID and c.CustomerID=o.CustomerID and o.OrderID=d.OrderID GROUP BY c.Country ORDER BY Total DESC\";\n\tif ($howMany!=-1)\n\t\t$strSQL .= \" LIMIT \" . $howMany;\n\t\n $result = mysql_query($strSQL) or die(mysql_error());\n\n\t//Initialize <categories> element\n\t$strCat = \"<categories>\";\n\t\n\t//Initialize datasets\n\t$strAmtDS = \"<dataset seriesname='Amount'>\";\n\t$strQtyDS = \"<dataset seriesName='Quantity' parentYAxis='S'>\";\n\t\t\n\t//Iterate through each data row\n if ($result) {\n while($ors = mysql_fetch_array($result)) {\n $strCat .= \"<category label='\" . escapeXML($ors['Country'],$forDataURL) . \"'/>\";\n\t\t\n //If JavaScript links are to be added\n if ($addJSLinks) {\n //Generate the link\n //TRICKY: We're having to escape the \" character using chr(34) character.\n //In HTML, the data is provided as chart.setXMLData(\" - so \" is already used and un-terminated\n //For each XML attribute, we use '. So ' is used in <set link='\n //Now, we//ve to pass Country Name to JavaScript function, so we've to use chr(34)\n $strLink = urlencode(\"javaScript:updateChart(\" . $intYear . \",\" . chr(34) . $ors['Country'] . chr(34) . \");\");\n $strAmtDS .= \"<set value='\" . $ors['Total'] . \"' link='\" . $strLink . \"'/>\";\n }\n else\n $strAmtDS .= \"<set value='\" . $ors['Total'] . \"' />\";\n\n $strQtyDS .= \"<set value='\" . $ors['Quantity'] . \"'/>\";\n }\n }\n mysql_close($link);\n\n //Closing elements\n\t$strCat .= \"</categories>\";\n\t$strAmtDS .= \"</dataset>\";\n\t$strQtyDS .= \"</dataset>\";\n\t//Entire XML - concatenation\n\t$strXML = $strCat . $strAmtDS . $strQtyDS;\n\t\n\treturn $strXML;\n}", "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 }", "public function getTransactionDataLast2Years($customerId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-2year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $transactionResource = $this->_transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processReceivedTransactionData($data, $result);\n \n $data = $transactionResource->getSpentCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processSpentTransactionData($data, $result);\n \n $result = array_values($result);\n return $result;\n }", "public function get_chart($where){\n\t\t\t$this->db->select('SUM(trans_pembayaran) as jumlah, monthname(tgl_trans) as bulan');\n\t\t\t$this->db->where('status = \"done\"');\n\t\t\t$this->db->like('DATE_FORMAT(tgl_trans, \"%Y\")', $where);\n\t\t\t$this->db->group_by('DATE_FORMAT(tgl_trans, \"%m\")');\n\t\t\treturn $this->db->get('transaksi')->result_array();\n\t\t}", "function this_year()\n{\n global $db; // golbalize db variable:\n $thisYear = date('Y') . '-01-01';\n $nextYear = ((int) date('Y') + 1) . '-01-01';\n $datesIds = $db->getMany(DATES, [\n 'date' => $thisYear,\n 'dates.date' => $nextYear,\n ], ['id', 'date'], ['date' => '>=', 'dates.date' => '<=']);\n if ($db->count > 0) {\n return $datesIds;\n }\n}", "public function getSaleByMonth2($year = null)\n {\n $date = new \\DateTime(\"now\");\n $currentYear = $date->format('y');\n //If the value of $year is not define then use the current year (default)\n if(!$year){\n $year = $currentYear;\n }\n \n //Get all the STransaction from the DB first.\n $STransactions = $this->em->getRepository('TransactionBundle:STransaction')->findAll();\n $months = array('jan' => 0, 'feb' => 0, 'mar' => 0, 'apr' => 0, 'may' => 0, 'jun' => 0, 'jul'\n => 0, 'aug' => 0, 'sep' => 0, 'oct' => 0, 'nov' => 0, 'dec' => 0);\n foreach ($STransactions as $st){\n $m = $st->getCreatedAt()->format(\"m\");\n $y = $st->getCreatedAt()->format(\"y\");\n if($m == 01 && $y == $year){\n $months['jan'] = $months['jan'] + $st->getTotalAmount();\n }elseif($m == 11 && $y == $year){\n $months['nov'] = $months['nov'] + $st->getTotalAmount();\n }\n }\n \n return $months;\n \n }", "public function Orders()\n {\n return $this->getOrders();\n }" ]
[ "0.6137392", "0.606342", "0.60371614", "0.6024123", "0.5996329", "0.5934803", "0.5846875", "0.58465433", "0.5836489", "0.57916576", "0.5789612", "0.57834584", "0.5763714", "0.57595646", "0.5739751", "0.5706384", "0.56945807", "0.5690902", "0.5682889", "0.5681555", "0.55825484", "0.5575052", "0.5561212", "0.5543755", "0.5524735", "0.5504433", "0.5488392", "0.5486578", "0.54829943", "0.547366", "0.5454595", "0.54541177", "0.54444605", "0.5438267", "0.5426315", "0.54229903", "0.54147816", "0.5399265", "0.5398908", "0.53941566", "0.53764343", "0.5375896", "0.53700775", "0.5366062", "0.53618616", "0.53614", "0.53610855", "0.5360814", "0.53598326", "0.5349372", "0.53406113", "0.533106", "0.532358", "0.53083855", "0.529248", "0.52802044", "0.5278811", "0.52782387", "0.52681243", "0.52648646", "0.5239744", "0.52336395", "0.52289", "0.52281255", "0.5222474", "0.5220704", "0.52171046", "0.5209551", "0.52057487", "0.5196749", "0.5172987", "0.51716065", "0.5170257", "0.51648355", "0.51510334", "0.5145307", "0.5136936", "0.5117678", "0.5116504", "0.5115648", "0.51104754", "0.51054305", "0.50782293", "0.50743586", "0.5069163", "0.5068004", "0.50617135", "0.5058988", "0.50440717", "0.5028148", "0.5025954", "0.5022063", "0.5017035", "0.50136447", "0.5012176", "0.5008269", "0.5007481", "0.5005695", "0.50011283", "0.4996374" ]
0.6176183
0
Get orders data for graph last 2 years
public function getOrdersDataLast2Years($vendorId) { $to = $this->_date->date('Y-m-d'); $from = strtotime($to."-2year"); $from = $this->_date->date('Y-m-d', $from); $to .= ' 23:59:59'; $orderResource = $this->_vendorOrderFactory->create()->getResource(); $data = $orderResource->getNumOfOrderByMonth($from, $to, $vendorId); $result = $this->_processOrderData($data); $result = array_values($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOrders() {\n\t\t$orders = Mage::getModel ( 'sales/order' )->getCollection ()->addAttributeToSelect ( \"*\" )->addAttributeToFilter ( 'status', array ('complete') );\n\t\t$orders_data = $this->preapreOrdersTosend ( $orders );\n\t\treturn $orders_data;\n\t}", "public function getOutstandingOrders()\n {\n $order = $this->db->prepare(<<<SQL\nSELECT orders.order_id, orders.order_date, orders.arrival_date, orders.student_number\nFROM orders\nWHERE orders.arrival_date IS NULL\nORDER BY orders.order_date;\nSQL\n );\n $order->execute();\n return $order->fetchAll(\\PDO::FETCH_OBJ);\n }", "function charts($data1) {\n\t $startDate = Carbon::now()->subDay(365);\n\t $endDate = Carbon::now();\n\t\n\t\t//THIS RETURNS THE 4 BOXES\n\t\t$month = $data->filter(function($data1){ return $data1->created_at->format('m-y') == date('m-y'); });\n\t\t$lastmonth = $data->filter(function($data1){ return $data1->created_at->format('m-y') == Carbon::now()->firstOfMonth()->subMonth()->format('m-y'); });\n\t\t$year = $data->filter(function($data1){ return $data1->created_at->format('y') == date('y'); });\n\t\t$lastyear = $data->filter(function($data1){ return $data1->created_at->format('y') == Carbon::now()->subYear()->format('y'); });\n\t\n\t}", "public function getOpenOrders(): array;", "function get_recent_orders(){\n\t $orders = $this->Order->get_recent_orders();\n\t if($this->params['requested']){\n\t return $orders;\n\t }else{\n\t $this->set('orders', $orders);\n\t }\n \n\t}", "public function getOrdersDataLastYear($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-1year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getNumOfOrderByMonth($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function __construct(){\n\n $this->all_orders='App\\UserOrder'::with('get_order_details.get_product_details')->whereDate('created_at','>',Carbon::today()->subYear(1)->toDateString())->orderBy('created_at','desc')->get();\n }", "private function GetOrders()\n\t{\t$orders = array();\n\t\t$where = array();\n\t\t\n\t\tif ($this->startdate)\n\t\t{\t$where[] = 'orderdate>=\"' . $this->startdate . ' 00:00:00\"';\n\t\t}\n\t\tif ($this->enddate)\n\t\t{\t$where[] = 'orderdate<=\"' . $this->enddate . ' 23:59:59\"';\n\t\t}\n\t\tif (!$this->showunpaid)\n\t\t{\t$where[] = 'NOT paiddate=\"0000-00-00 00:00:00\"';\n\t\t}\n\t\t\n\t\t$sql = 'SELECT * FROM storeorders';\n\t\tif ($wstr = implode(' AND ', $where))\n\t\t{\t$sql .= ' WHERE ' . $wstr;\n\t\t}\n\t\t$sql .= ' ORDER BY orderdate DESC';\n\t\t\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\t$orders[$row['id']] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $orders;\n\t}", "public static function GetDashboard() {\n $date = [];\n $num_orders = [];\n $last_month = \\Carbon\\Carbon::today()->subDays(30);\n $orders = Order::where('created_at', '>=', $last_month)->get()\n ->groupBy(function($item) {\n return $item->created_at->format('d-m-y');\n })->toArray();\n foreach ($orders as $key => $value) {\n $date[] = $key;\n $num_orders[] = count($value);\n }\n\n //======= Get income from last month - Chart From DB =======\n $last_month_income = \\Carbon\\Carbon::today()->subDays(30);\n $all_orders = [];\n $orders_income = [];\n $income = [];\n $income_date = [];\n $users_orders = DB::table('users')\n ->join('orders', 'users.id', '=', 'orders.user_id')\n ->select('users.*', 'orders.*')\n ->where('orders.created_at', '>=', $last_month_income)->get();\n foreach ($users_orders as $new_user_order) {\n $all_orders[] = (array) $new_user_order;\n }\n foreach ($all_orders as &$orders_data) {\n $orders_data['data'] = unserialize($orders_data['data']);\n }\n foreach ($all_orders as $order) {\n $order['created_at'] = (new \\DateTime($order['created_at']))->format('Y-m-d');\n $income_date[] = $order['created_at'];\n $sum = 0;\n foreach ($order['data'] as $price) {\n $sum += ($price['price'] * $price['quantity']);\n }\n $income[] = $sum;\n }\n\n for ($i = count($income_date) - 1; $i > 0; $i--) {\n if ($income_date[$i] == $income_date[$i - 1]) {\n unset($income_date[$i]);\n $income[$i - 1] = $income[$i] + $income[$i - 1];\n unset($income[$i]);\n }\n }\n $income = array_values($income);\n $income_date = array_values($income_date);\n\n self::$data['income'] = json_encode($income);\n self::$data['income_date'] = json_encode($income_date);\n\n //======= Get last week new users =======\n $last_week = \\Carbon\\Carbon::today()->subDays(7);\n $weekly_users = User::where('created_at', '>=', $last_week)->get()->toArray();\n\n //======= Get all users except admin =======\n $all_users = User::where('role', '!=', '6')->get()->toArray();\n\n //======= Get last day new orders =======\n $last_day = \\Carbon\\Carbon::today();\n $daily_orders = Order::where('created_at', '>=', $last_day)->get()->toArray();\n\n self::$data['weekly_new_users'] = count($weekly_users);\n self::$data['all_users'] = count($all_users);\n self::$data['daily_orders'] = count($daily_orders);\n self::$data['date'] = json_encode($date);\n self::$data['num_orders'] = json_encode($num_orders);\n self::$data['title'] .= 'CMS';\n self::$data['page_name'] = 'Ski Expert | Main';\n return view('cms.dashboard', self::$data);\n }", "function getPrevOrders()\n\t{\n\t\t$gid = mysql_real_escape_string($_GET['gid']);\n\t\t\n\t\t$query = \"SELECT *\n\t\t\t\t\tFROM games\n\t\t\t\t\tWHERE gid=$gid;\";\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$year = mysql_result($result, 0, \"year\");\n\t\t$season = mysql_result($result, 0, \"season\");\n\t\t\n\t\tif($season == \"s\")\n\t\t{\n\t\t\t$year--;\n\t\t\t$season = \"f\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$season = \"s\";\n\t\t}\n\t\t\n\t\t$query = \"SELECT *\n\t\t\t\t\tFROM orders\n\t\t\t\t\tWHERE gid=$gid and year=$year and season='$season';\";\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$orders = array();\n\t\tfor($i = 0; $i < mysql_num_rows($result); $i++)\n\t\t{\n\t\t\tarray_push($orders, mysql_fetch_assoc($result));\n\t\t} \n\t\t\n\t\treturn $orders;\n\t}", "function getSalesByYear() {\n // Function to connect to the DB\n $link = connectToDB();\n\t\n //Initialize <categories> element\n $strCat = \"<categories>\";\n\n //Initialize datasets\n $strAmtDS = \"<dataset seriesname='Revenue'>\";\n $strQtyDS = \"<dataset seriesName='Units Sold' parentYAxis='S'>\";\n\n $strSQL = \"SELECT Year(o.OrderDate) As SalesYear, ROUND(SUM(d.Quantity*p.UnitPrice),0) As Total, SUM(d.Quantity) as Quantity FROM FC_OrderDetails as d,FC_Orders as o,FC_Products as p WHERE o.OrderID=d.OrderID and d.ProductID=p.ProductID GROUP BY Year(o.OrderDate) ORDER BY Year(o.OrderDate)\";\n $result = mysql_query($strSQL) or die(mysql_error());\n\t\n if ($result) {\n while($ors = mysql_fetch_array($result)) {\n $strCat .= \"<category label='\" . $ors['SalesYear'] . \"'/>\";\n\n //Generate the link\n $strLink = urlencode(\"javaScript:updateCharts(\" . $ors['SalesYear'] . \");\");\n $strAmtDS .= \"<set value='\" . $ors['Total'] . \"' link='\" . $strLink . \"'/>\";\n $strQtyDS .= \"<set value='\" . $ors['Quantity'] . \"'/>\";\n }\n }\n mysql_close($link);\n\n\t//Closing elements\n\t$strCat .= \"</categories>\";\n\t$strAmtDS .= \"</dataset>\";\n\t$strQtyDS .= \"</dataset>\";\n\t//Entire XML - concatenation\n\t$strXML = $strCat . $strAmtDS . $strQtyDS;\n\n\treturn $strXML;\n}", "public function getLastYearData() {\n\t\t$dates = getPeriods('LastYear');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear'], 12);\t\t\n\t}", "public function get_sales_data(Request $request){\n\n $sales_graph=$this->all_orders->groupBy(function($item){\n return ($item->created_at->format('Y:m'));\n })->map(function($item,$key){\n return ($item->sum('grand_total'));\n });\n $orders_graph=$this->all_orders->groupBy(function($item){\n return ($item->created_at->format('Y:m'));\n })->map(function($item,$key){\n return ($item->count());\n });\n \n $sales_str=\"[\";\n foreach($sales_graph as $key=>$value){\n\n if($sales_graph->last()==$value)\n $sales_str.='{\"Month\" : \"' . $key . '\", \"Sales\":\"'.$value .'\"}';\n else\n $sales_str.='{\"Month\": \"' . $key . '\", \"Sales\":\"'.$value .'\"},';\n }\n $sales_str.=\"]\";\n \n $orders_str=\"[\";\n \n foreach($orders_graph as $key=>$value){\n\n if($orders_graph->last()==$value)\n $orders_str.='{\"Month\" : \"' . $key . '\", \"Orders\":\"'.$value .'\"}';\n else\n $orders_str.='{\"Month\": \"' . $key . '\", \"Orders\":\"'.$value .'\"},';\n }\n $orders_str.=\"]\";\n\n\n echo json_encode([$sales_str,$orders_str]);\n }", "static function orderStatistics( $year = false, $month = false )\n {\n if ( $year == false )\n {\n $startDate = 0;\n $stopDate = mktime( 0, 0, 0, 12, 31, 2037 );\n }\n else if ( $year != false and $month == false )\n {\n $startDate = mktime( 0, 0, 0, 1, 1, $year );\n $stopDate = mktime( 0, 0, 0, 1, 1, $year + 1 );\n }\n else if ( $year != false and $month != false )\n {\n $startDate = mktime( 0, 0, 0, $month, 1, $year );\n $stopDate = mktime( 23, 59, 59, $month + 1, 0, $year );\n }\n\n $db = eZDB::instance();\n $productArray = $db->arrayQuery( \"SELECT ezproductcollection_item.*, ignore_vat, ezorder.created, currency_code FROM ezorder, ezproductcollection_item, ezproductcollection\n WHERE ezproductcollection.id=ezproductcollection_item.productcollection_id\n AND ezproductcollection_item.productcollection_id=ezorder.productcollection_id\n AND is_temporary='0'\n AND ezorder.created >= '$startDate' AND ezorder.created < '$stopDate'\n ORDER BY contentobject_id, currency_code\" );\n $currentContentObjectID = 0;\n $productItemArray = array();\n $itemCount = 0;\n $name = false;\n $productInfo = array();\n $totalSumInfo = array();\n $firstPass = true;\n // Hash of ContentObject ID, the value will be replaced by the correct object once all IDs are known.\n $contentObjectIDHash = array();\n foreach( $productArray as $productItem )\n {\n $itemCount++;\n $contentObjectID = $productItem['contentobject_id'];\n\n if ( $firstPass )\n {\n $contentObjectIDHash[$currentContentObjectID] = true;\n $currentContentObjectID = $contentObjectID;\n $firstPass = false;\n }\n\n if ( $currentContentObjectID != $contentObjectID && $itemCount != 1 )\n {\n $productItemArray[] = array(\n 'name' => $name,\n // Reference to the entry that will contain the ContentObject at the end\n 'product' => &$contentObjectIDHash[$currentContentObjectID],\n 'product_info' => $productInfo\n );\n $productInfo = array();\n $name = $productItem['name'];\n $currentContentObjectID = $contentObjectID;\n $contentObjectIDHash[$currentContentObjectID] = true;\n }\n\n $currencyCode = $productItem['currency_code'];\n if ( $currencyCode == '' )\n {\n $currencyCode = eZOrder::fetchLocaleCurrencyCode();\n }\n\n if ( !isset( $productInfo[$currencyCode] ) )\n {\n $productInfo[$currencyCode] = array( 'sum_count' => 0,\n 'sum_ex_vat' => 0,\n 'sum_inc_vat' => 0 );\n }\n if ( !isset( $totalSumInfo[$currencyCode] ) )\n {\n $totalSumInfo[$currencyCode] = array( 'sum_ex_vat' => 0,\n 'sum_inc_vat' => 0 );\n }\n\n if ( $productItem['ignore_vat']== true )\n {\n $vatValue = 0;\n }\n else\n {\n $vatValue = $productItem['vat_value'];\n }\n\n $price = $productItem['price'];\n\n if ( $productItem['is_vat_inc'] )\n {\n $priceExVAT = $price / ( 100 + $vatValue ) * 100;\n $priceIncVAT = $price;\n\n }\n else\n {\n $priceExVAT = $price;\n $priceIncVAT = $price * ( 100 + $vatValue ) / 100;\n }\n\n $count = $productItem['item_count'];\n $realPricePercent = ( 100 - $productItem['discount'] ) / 100;\n $totalPriceExVAT = round( $count * $priceExVAT * $realPricePercent, 2 );\n $totalPriceIncVAT = round( $count * $priceIncVAT * $realPricePercent, 2 );\n $totalSumInfo[$currencyCode]['sum_ex_vat'] += $totalPriceExVAT;\n $totalSumInfo[$currencyCode]['sum_inc_vat'] += $totalPriceIncVAT;\n\n $productInfo[$currencyCode]['sum_count'] += $count;\n $productInfo[$currencyCode]['sum_ex_vat'] += $totalPriceExVAT;\n $productInfo[$currencyCode]['sum_inc_vat'] += $totalPriceIncVAT;\n }\n\n // add last product info\n if ( !empty( $productArray ) )\n {\n $productItemArray[] = array(\n 'name' => $name,\n // Reference to the entry that will contain the ContentObject at the end\n 'product' => &$contentObjectIDHash[$currentContentObjectID],\n 'product_info' => $productInfo\n );\n\n // Fetching all ContentObject ids in one query, filling the hash with the corresponding ContentObject\n foreach ( eZContentObject::fetchList( true, array( \"id\" => array( array_keys( $contentObjectIDHash ) ) ) ) as $contentObject )\n {\n $contentObjectIDHash[$contentObject->ID] = $contentObject;\n }\n }\n\n return array(\n array(\n 'product_list' => $productItemArray,\n 'total_sum_info' => $totalSumInfo\n )\n );\n }", "public function woocommerce_reports_category_sales_order_items($orders) {\n\t\tglobal $wpdb;\n\t\t$this->set_reporting_flag(true);\n\n\t\t// If no data was retrieved by WooCommerce, just return the empty dataset\n\t\tif(empty($orders)) {\n\t\t\treturn $orders;\n\t\t}\n\n\t\t// This report requires one year to retrieve the data, but such information\n\t\t// is not passed by the apply_filter() call. It's therefore necessary to\n\t\t// extract it from the data that was retrieved by WooCommerce, using the\n\t\t// first date found in the dataset\n\t\t$order = $orders[0];\n\t\t$reference_date = DateTime::createFromFormat('Y-m-d H:i:s', get_value('post_date', $orders[0]));\n\t\t$year_to_retrieve = $reference_date->format('Y');\n\n\t\t// Calculate the first date of year passed as a parameter and the start date\n\t\t// of next one\n\t\t$start_date = $year_to_retrieve . '0101000000';\n\t\t$end_date = date('Ymd000000', strtotime($start_date . ' +1 year'));\n\n\t\t$SQL = \"\n\t\t\tSELECT\n\t\t\t\torder_item_meta_2.meta_value as product_id\n\t\t\t\t,posts.post_date\n\t\t\t\t-- ,SUM(order_item_meta_3.meta_value) AS line_total\n\t\t\t\t-- Return Line total converted to base currency\n\t\t\t\t,SUM(order_item_meta_3.meta_value * meta_order_base_curr.meta_value / meta_order.meta_value) AS line_total\n\t\t\tFROM\n\t\t\t\t{$wpdb->prefix}woocommerce_order_items AS order_items\n\t\t\tJOIN\n\t\t\t\t{$wpdb->prefix}woocommerce_order_itemmeta as order_item_meta_2 ON\n\t\t\t\t\t(order_item_meta_2.order_item_id = order_items.order_item_id) AND\n\t\t\t\t\t(order_item_meta_2.meta_key = '_product_id')\n\t\t\tJOIN\n\t\t\t\t{$wpdb->prefix}woocommerce_order_itemmeta as order_item_meta_3 ON\n\t\t\t\t\t(order_item_meta_3.order_item_id = order_items.order_item_id) AND\n\t\t\t\t\t(order_item_meta_3.meta_key = '_line_total')\n\t\t\tJOIN\n\t\t\t\t$wpdb->posts AS posts ON\n\t\t\t\t\t(posts.ID = order_items.order_id) AND\n\t\t\t\t\t(posts.post_type = 'shop_order') AND\n\t\t\t\t\t(posts.post_status = 'publish') AND\n\t\t\t\t\t(posts.post_date >= $start_date) AND\n\t\t\t\t\t(posts.post_date < $end_date)\n\t\t\tJOIN\n\t\t\t\t$wpdb->postmeta AS meta_order ON\n\t\t\t\t\t(meta_order.post_id = posts.ID) AND\n\t\t\t\t\t(meta_order.meta_key = '_order_total')\n\t\t\tJOIN\n\t\t\t\t$wpdb->postmeta AS meta_order_base_curr ON\n\t\t\t\t\t(meta_order_base_curr.post_id = posts.ID) AND\n\t\t\t\t\t(meta_order_base_curr.meta_key = '_order_total_base_currency')\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->term_relationships AS rel ON\n\t\t\t\t\t(rel.object_ID = posts.ID)\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->term_taxonomy AS taxonomy ON\n\t\t\t\t\t(taxonomy.term_taxonomy_id = rel.term_taxonomy_id) AND\n\t\t\t\t\t(taxonomy.taxonomy = 'shop_order_status')\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->terms AS term ON\n\t\t\t\t\t(term.term_id = taxonomy.term_id) AND\n\t\t\t\t\t(term.slug IN ('\" . implode(\"','\", apply_filters('woocommerce_reports_order_statuses', array('completed', 'processing', 'on-hold'))) . \"'))\n\t\t\tWHERE\n\t\t\t\t(order_items.order_item_type = 'line_item')\n\t\t\tGROUP BY\n\t\t\t\torder_items.order_item_id\n\t\t\tORDER BY\n\t\t\t\tposts.post_date ASC\n\t\t\";\n\n\t\t$orders_base_curr = $wpdb->get_results($SQL);\n\t\t$this->set_reporting_flag(false);\n\n\t\treturn $orders_base_curr;\n\t}", "public function OrderYear()\n {//--------------------------------------------------------------Lấy về năm (cái mà có bản ghi trả về)\n\t $arr=array();\n\t $select= \"SELECT DISTINCT(year(orderDate)) As orderYear FROM orders order by orderDate \";\n\t $result=$this->executeSelect($select);\n\t while($row=mysqli_fetch_array($result))\n\t {\n\t\t $year=new ordersDto();\n\t\t $year->setorderYear($row['orderYear']);\n\t\t $arr[]=$year;\n\t }\n\t $this->DisConnectDB();\n\t return $arr;\n }", "public function searchYear(Request $request){\n $result = Order::with('customer')->where('order_year',$request->search_year)->latest()->get();\n return response()->json($result);\n\n }", "protected function obtainDataOrders()\n\t{\n\t\t$this->dbQueryResult['ORDERS'] = CSaleOrder::GetList(array($this->sortBy => $this->sortOrder), $this->filter);\n\t\t$this->dbQueryResult['ORDERS']->NavStart($this->arParams[\"ORDERS_PER_PAGE\"], false);\n\n\t\tif(empty($this->dbQueryResult['ORDERS']))\n\t\t\treturn;\n\n\t\twhile ($arOrder = $this->dbQueryResult['ORDERS']->GetNext())\n\t\t{\n\t\t\t$arOBasket = array();\n\t\t\t$dbBasket = CSaleBasket::GetList(array('NAME' => 'asc'), array(\"ORDER_ID\"=>$arOrder[\"ID\"]), false, false, array('*'));\n\t\t\twhile ($arBasket = $dbBasket->Fetch())\n\t\t\t{\n\t\t\t\tif (CSaleBasketHelper::isSetItem($arBasket))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$arOBasket[] = $arBasket;\n\t\t\t}\n\n\t\t\t$this->dbResult['ORDERS'][] = array(\n\t\t\t\t\"ORDER\" => $arOrder,\n\t\t\t\t\"BASKET_ITEMS\" => $arOBasket,\n\t\t\t);\n\t\t}\n\t}", "function ppt_resources_get_next_planned_orders($data)\n{\n global $user;\n $months = array(\n \"01\" => 'December',\n \"02\" => 'January',\n \"03\" => 'February',\n \"04\" => 'March',\n \"05\" => 'April',\n \"06\" => 'May',\n \"07\" => 'June',\n \"08\" => 'July',\n \"09\" => 'August',\n \"10\" => 'September',\n \"11\" => 'October',\n \"12\" => 'November',\n );\n\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n if (empty($data['accounts'])) {\n return services_error('Accounts is not defined!', 500);\n }\n\n if (empty($data['products'])) {\n return services_error('Products is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = $data['accounts'];\n $products = $data['products'];\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'planned_order')\n ->fieldCondition('field_planned_account', 'target_id', $accounts, 'IN')\n ->fieldCondition('field_planned_product', 'target_id', $products, 'IN')\n ->fieldCondition('field_planned_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_period', 'value', $end_date, '<=')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n $final_arr = [];\n\n if (isset($records['node'])) {\n $nodes_ids = array_keys($records['node']);\n $nodes = node_load_multiple($nodes_ids);\n\n foreach ($nodes as $node) {\n // Get node planned product name.\n $planned_product_tid = $node->field_planned_product['und'][0]['target_id'];\n $planned_product = taxonomy_term_load($planned_product_tid);\n $planned_product_name = $planned_product->name;\n\n // Get node date for product (planned).\n if (isset($node->field_planned_period['und'])) {\n $node_date = $node->field_planned_period['und'][0]['value'];\n $planned_month = date(\"F\", strtotime($node_date));\n }\n\n // Get node values for planned quantity.\n $planned_quantity = 0;\n if (isset($node->field_planned_quantity['und'])) {\n $planned_quantity = $node->field_planned_quantity['und'][0]['value'];\n }\n\n // If product already exists, update its values for node months.\n if (isset($final_arr['planned'][$planned_product_name])) {\n if (isset($final_arr['planned'][$planned_product_name][$planned_month])) {\n $final_arr['planned'][$planned_product_name][$planned_month][0] += (int) $planned_quantity;\n } else {\n $final_arr['planned'][$planned_product_name][$planned_month][0] = [(int) $planned_quantity];\n }\n } else {\n // Initialze product array with 0 for all months, then update it with current node data.\n $final_arr['planned'][$planned_product_name] = [];\n for ($i = 1; $i <= 12; $i++) {\n $month = $months[sprintf('%02d', $i)];\n $final_arr['planned'][$planned_product_name][$month] = [0];\n }\n $final_arr['planned'][$planned_product_name][$planned_month] = [(int) $planned_quantity];\n }\n }\n }\n return $final_arr;\n}", "public function AllClosed_Orders_get() {\n extract($_GET);\n $result = $this->feeds_model->AllClosed_Orders();\n return $this->response($result);\n }", "function getOrderings() ;", "public function getDailyOrdersData($id=null)\n {\n $startDate = date(\"Y-m-d H:i:s\", strtotime('-7 day', time()));\n $endDate = date('Y-m-d H:i:s');\n\n $userData = User::find()->andFilterWhere(['u_id' => $id, 'u_type' => 2])->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n \\Yii::$app->data->getMwsDetails($user->u_mws_seller_id, $user->u_mws_auth_token);\n $orderList = \\Yii::$app->api->getOrdersList('Created', $startDate, $endDate);\n foreach ($orderList as $order) {\n $orderDetail = false;\n $order = (array)$order;\n $order = array_shift($order);\n if($order) {\n $model = AllOrdesList::findOne(['aol_amazon_order_id' => $order['AmazonOrderId'], 'aol_user_id' => $user->u_id]);\n if (!$model) {\n $model = new AllOrdesList();\n }\n $model->aol_amazon_order_id = (key_exists('AmazonOrderId', $order)) ? $order['AmazonOrderId'] : null;\n $model->aol_seller_order_id = (key_exists('SellerOrderId', $order)) ? $order['SellerOrderId'] : null;\n $model->aol_purchase_date = (key_exists('PurchaseDate', $order)) ? $order['PurchaseDate'] : null;\n $model->aol_last_updated_date = (key_exists('LastUpdateDate', $order)) ? $order['LastUpdateDate'] : null;\n $model->aol_order_status = (key_exists('OrderStatus', $order)) ? $order['OrderStatus'] : null;\n $model->aol_fulfilment_channel = (key_exists('FulfillmentChannel', $order)) ? $order['FulfillmentChannel'] : null;\n $model->aol_sales_channel = (key_exists('SalesChannel', $order)) ? $order['SalesChannel'] : null;\n $model->aol_ship_service = (key_exists('ShipServiceLevel', $order)) ? $order['ShipServiceLevel'] : null;\n $model->aol_order_total = (key_exists('OrderTotal', $order)) ? $order['OrderTotal']['Amount'] : 0;\n $model->aol_shipped_items = (key_exists('NumberOfItemsShipped', $order)) ? $order['NumberOfItemsShipped'] : null;\n $model->aol_unshipped_items = (key_exists('NumberOfItemsUnshipped', $order)) ? $order['NumberOfItemsUnshipped'] : null;\n if($model->aol_order_status == 'Shipped') {\n $model->aol_shipping_username = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['Name'] : null;\n $model->aol_shipping_address_1 = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['AddressLine1'] : null;\n $model->aol_shipping_address_2 = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['AddressLine2'] : null;\n $model->aol_shipping_address_3 = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['AddressLine3'] : null;\n $model->aol_city = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['City'] : null;\n $model->aol_country = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['County'] : null;\n $model->aol_district = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['District'] : null;\n $model->aol_state_or_region = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['StateOrRegion'] : null;\n $model->aol_postal_code = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['PostalCode'] : null;\n $model->aol_country_code =(key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['CountryCode'] : null;\n $model->aol_phone = (key_exists('ShippingAddress', $order)) ? $order['ShippingAddress']['Phone'] : null;\n $model->aol_buyer_name = key_exists('BuyerName', $order) ? $order['BuyerName'] : null;\n $model->aol_buyer_email = key_exists('BuyerEmail', $order) ? $order['BuyerEmail'] : null;\n $orderDetail = true;\n }\n $model->aol_user_id = $user->u_id;\n if($model->save(false)) {\n $olModel = OrderDataLog::findOne(['odl_order_id' => $model->aol_amazon_order_id, 'odl_user_id' => $user->u_id]);\n if (!$olModel) {\n $olModel = new OrderDataLog();\n $olModel->odl_order_id = $model->aol_amazon_order_id;\n $olModel->odl_user_id = $user->u_id;\n if($orderDetail) {\n $olModel->odl_shipped_order_data = 1;\n }\n if($olModel->save(false)) {\n echo $model->aol_amazon_order_id.\" Log is Saved. \";\n }\n }\n echo $model->aol_amazon_order_id.\" is Saved. \";\n }\n }\n }\n echo \"Done..\";\n }\n }", "public function graphData()\n {\n $dayOfWeek = ['Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo'];\n $colors = [\n 'rgba(201, 203, 207, 0.8)', //gray\n 'rgba(255, 99, 132, 0.8)', //Red\n 'rgba(255, 159, 64, 0.8)', //Orange\n 'rgba(75, 192, 192, 0.8)', //green\n 'rgba(54, 162, 235, 0.8)', //blue\n 'rgba(153, 102, 255, 0.8)', //purple\n 'rgba(255, 205, 86, 0.8)', //yellow\n ];\n $borderColors = [\n 'rgba(201, 203, 207, 1)', //gray\n 'rgba(255, 99, 132, 1)', //Red\n 'rgba(255, 159, 64, 1)', //Orange\n 'rgba(75, 192, 192, 1)', //green\n 'rgba(54, 162, 235, 1)', //blue\n 'rgba(153, 102, 255, 1)', //purple\n 'rgba(255, 205, 86, 1)', //yellow\n ];\n $months = ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'];\n $now = Carbon::now()->timezone($this->timezome);\n $data = [];\n\n switch ($this->graphPeriod) {\n case 'weekly':\n $data = $this->getDataFromWeeklySales($colors, $borderColors);\n break;\n case 'weeklyAccumulated':\n $data = $this->getDataFromWeeklySales($colors, $borderColors, true);\n break;\n case 'monthly':\n $labels = [];\n $date = $now->copy()->subMonths(5)->startOfMonth()->startOfDay();\n $end = $now->copy()->endOfDay();\n $count = 0;\n\n for ($i = 1; $i < 32; $i++) {\n $labels[] = $i;\n }\n\n while ($date->lessThanOrEqualTo($end)) {\n $label = $months[$date->month - 1];\n $data = [];\n $endOfMonth = $date->copy()->endOfMonth()->endOfDay();\n $sale = 0;\n\n while ($date->lessThanOrEqualTo($endOfMonth) && $date->lessThanOrEqualTo($end)) {\n $sale += $this->getSumFromGraphPeriod($date, $this->graphCategory);\n $data[] = $sale;\n $date->addDay();\n }\n\n $datasets[] = [\n 'label' => $label,\n 'backgroundColor' => $colors[$count],\n 'borderColor' => $borderColors[$count],\n 'borderWidth' => 1,\n 'data' => $data,\n 'fill' => false\n ];\n\n $count++;\n }\n\n $data = [\n 'labels' => $labels,\n 'datasets' => $datasets,\n 'type' => 'line'\n ];\n break;\n default:\n # code...\n break;\n }\n return $data;\n }", "function ppt_resources_get_delivered_planned_orders($data)\n{\n global $user;\n $months = array(\n \"01\" => 'December',\n \"02\" => 'January',\n \"03\" => 'February',\n \"04\" => 'March',\n \"05\" => 'April',\n \"06\" => 'May',\n \"07\" => 'June',\n \"08\" => 'July',\n \"09\" => 'August',\n \"10\" => 'September',\n \"11\" => 'October',\n \"12\" => 'November',\n );\n\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n if (empty($data['accounts'])) {\n return services_error('Accounts is not defined!', 500);\n }\n\n if (empty($data['products'])) {\n return services_error('Products is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = $data['accounts'];\n $products = $data['products'];\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'planned_order')\n ->fieldCondition('field_planned_account', 'target_id', $accounts, 'IN')\n ->fieldCondition('field_planned_product', 'target_id', $products, 'IN')\n ->fieldCondition('field_planned_actual_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_actual_period', 'value', $end_date, '<=')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n $final_arr = [];\n\n if (isset($records['node'])) {\n $nodes_ids = array_keys($records['node']);\n $nodes = node_load_multiple($nodes_ids);\n\n foreach ($nodes as $node) {\n // Get node planned product name.\n $planned_product_tid = $node->field_planned_product['und'][0]['target_id'];\n $planned_product = taxonomy_term_load($planned_product_tid);\n $planned_product_name = $planned_product->name;\n\n // Get node date for product (planned).\n if (isset($node->field_planned_actual_period['und'])) {\n $node_date = $node->field_planned_actual_period['und'][0]['value'];\n $delivered_month = date(\"F\", strtotime($node_date));\n }\n\n // Get node values for planned quantity.\n $delivered_quantity = 0;\n if (isset($node->field_planned_delivered_quantity['und'])) {\n $delivered_quantity = $node->field_planned_delivered_quantity['und'][0]['value'];\n }\n\n // If product already exists, update its values for node months.\n if (isset($final_arr['delivered'][$planned_product_name])) {\n if (isset($final_arr['delivered'][$planned_product_name][$delivered_month])) {\n $final_arr['delivered'][$planned_product_name][$delivered_month][0] += (int) $delivered_quantity;\n } else {\n $final_arr['delivered'][$planned_product_name][$delivered_month][0] = [(int) $delivered_quantity];\n }\n } else {\n // Initialze product array with 0 for all months, then update it with current node data.\n $final_arr['delivered'][$planned_product_name] = [];\n for ($i = 1; $i <= 12; $i++) {\n $month = $months[sprintf('%02d', $i)];\n $final_arr['delivered'][$planned_product_name][$month] = [0];\n }\n $final_arr['delivered'][$planned_product_name][$delivered_month] = [(int) $delivered_quantity];\n }\n }\n }\n return $final_arr;\n}", "public function vendor_orders()\n {\n $query = $this->db->where('vendor_hash', $this->current_user->user_hash)\n ->where('progress >', '0')\n ->order_by('time desc')\n ->get('orders');\n\n if ($query->num_rows() > 0) {\n $row = $query->result_array();\n return $this->build_array($row);\n } else {\n return array();\n }\n }", "public function getRecurringOrders();", "public function AllOpen_Orders_get() {\n extract($_GET);\n $result = $this->feeds_model->AllOpen_Orders();\n return $this->response($result);\n }", "public function get_main_chart() {\n\t\tglobal $wp_locale;\n\n\t\t// Get orders and dates in range - we want the SUM of order totals, COUNT of order items, COUNT of orders, and the date\n\t\t$orders = $this->get_order_report_data( array(\n\t\t\t'data' => array(\n\t\t\t\t'ID' => array(\n\t\t\t\t\t'type' => 'post_data',\n\t\t\t\t\t'function' => 'COUNT',\n\t\t\t\t\t'name' => 'total_orders',\n\t\t\t\t\t'distinct' => true,\n\t\t\t\t),\n\t\t\t\t'post_date' => array(\n\t\t\t\t\t'type' => 'post_data',\n\t\t\t\t\t'function' => '',\n\t\t\t\t\t'name' => 'post_date'\n\t\t\t\t),\n\t\t\t),\n\t\t\t'group_by' => $this->group_by_query,\n\t\t\t'order_by' => 'post_date ASC',\n\t\t\t'query_type' => 'get_results',\n\t\t\t'filter_range' => true\n\t\t) );\n\n\t\t// Get Abadoned Carts in range 1 years\n\t\t$abandoned_carts_items = CartModel::get_carts_one_year();\n\t\t$ee_abandoned_posts = array();\n\n\t\tif ( $abandoned_carts_items ) {\n\n\t\t\tforeach ( $abandoned_carts_items as $order_item ) {\n\t\t\t\t$date = date( 'Y-m-d h:i:s', $order_item->post_date );\n\n\t\t\t\t$obj = new stdClass();\n\t\t\t\t$obj->post_date = $date;\n\t\t\t\t$obj->abandoned_cart_itms = 1;\n\n\t\t\t\t$ee_abandoned_posts[] = $obj;\n\t\t\t}\n\t\t}\t\n\n\t\t// Prepare data for report\n\t\t$order_counts = $this->prepare_chart_data( $orders, 'post_date', 'total_orders', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t$abandoned_carts_encoded = $this->prepare_chart_data( $ee_abandoned_posts, 'post_date', 'abandoned_cart_itms', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t\n\t\t// Encode in json format\n\t\t$chart_data = json_encode( array(\n\t\t\t'order_counts' => array_values( $order_counts ),\n\t\t\t'abandoned_cart_itms' => array_values( $abandoned_carts_encoded )\n\t\t) );\n\t\t?>\n\n\t\t<?php //echo $chart_data; ?>\n\t\t<div class=\"chart-container\">\n\t\t\t<div class=\"chart-placeholder main\"></div>\n\t\t</div>\n\t\t<script type=\"text/javascript\">\n\n\t\t\tvar main_chart;\n\n\t\t\tjQuery(function(){\n\t\t\t\tvar order_data = jQuery.parseJSON( '<?php echo $chart_data; ?>' );\n\t\t\t\tvar drawGraph = function( highlight ) {\n\t\t\t\t\tvar series = [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"<?php echo esc_js( __( 'Number of conversions', 'cart_converter' ) ) ?>\",\n\t\t\t\t\t\t\tdata: order_data.order_counts,\n\t\t\t\t\t\t\tcolor: '<?php echo $this->chart_colours['order_counts']; ?>',\n\t\t\t\t\t\t\tbars: { fillColor: '<?php echo $this->chart_colours['order_counts']; ?>', fill: true, show: true, lineWidth: 0, barWidth: <?php echo $this->barwidth; ?> * 0.5, align: 'center' },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\thoverable: true\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"<?php echo esc_js( __( 'Abandoned Carts', 'cart_converter' ) ) ?>\",\n\t\t\t\t\t\t\tdata: order_data.abandoned_cart_itms,\n\t\t\t\t\t\t\tcolor: '<?php echo $this->chart_colours['abandoned_carts']; ?>',\n\t\t\t\t\t\t\tpoints: { show: true, radius: 5, lineWidth: 3, fillColor: '#fff', fill: true },\n\t\t\t\t\t\t\tlines: { show: true, lineWidth: 4, fill: false },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\thoverable: true\n\t\t\t\t\t\t}\n\t\t\t\t\t];\n\n\t\t\t\t\tif ( highlight !== 'undefined' && series[ highlight ] ) {\n\t\t\t\t\t\thighlight_series = series[ highlight ];\n\n\t\t\t\t\t\thighlight_series.color = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.bars )\n\t\t\t\t\t\t\thighlight_series.bars.fillColor = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.lines ) {\n\t\t\t\t\t\t\thighlight_series.lines.lineWidth = 5;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmain_chart = jQuery.plot(\n\t\t\t\t\t\tjQuery('.chart-placeholder.main'),\n\t\t\t\t\t\tseries,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\tshow: false\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t grid: {\n\t\t\t\t\t\t color: '#aaa',\n\t\t\t\t\t\t borderColor: 'transparent',\n\t\t\t\t\t\t borderWidth: 0,\n\t\t\t\t\t\t hoverable: true\n\t\t\t\t\t\t },\n\t\t\t\t\t\t xaxes: [ {\n\t\t\t\t\t\t \tcolor: '#aaa',\n\t\t\t\t\t\t \tposition: \"bottom\",\n\t\t\t\t\t\t \ttickColor: 'transparent',\n\t\t\t\t\t\t\t\tmode: \"time\",\n\t\t\t\t\t\t\t\ttimeformat: \"<?php if ( $this->chart_groupby == 'day' ) echo '%d %b'; else echo '%b'; ?>\",\n\t\t\t\t\t\t\t\tmonthNames: <?php echo json_encode( array_values( $wp_locale->month_abbrev ) ) ?>,\n\t\t\t\t\t\t\t\ttickLength: 1,\n\t\t\t\t\t\t\t\tminTickSize: [1, \"<?php echo $this->chart_groupby; ?>\"],\n\t\t\t\t\t\t\t\tfont: {\n\t\t\t\t\t\t \t\tcolor: \"#aaa\"\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t} ],\n\t\t\t\t\t\t yaxes: [\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t \t\tmin: 0,\n\t\t\t\t\t\t \t\tminTickSize: 1,\n\t\t\t\t\t\t \t\ttickDecimals: 0,\n\t\t\t\t\t\t \t\tcolor: '#d4d9dc',\n\t\t\t\t\t\t \t\tfont: { color: \"#aaa\" }\n\t\t\t\t\t\t \t},\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t \t\tposition: \"right\",\n\t\t\t\t\t\t \t\tmin: 0,\n\t\t\t\t\t\t \t\ttickDecimals: 2,\n\t\t\t\t\t\t \t\talignTicksWithAxis: 1,\n\t\t\t\t\t\t \t\tcolor: 'transparent',\n\t\t\t\t\t\t \t\tfont: { color: \"#aaa\" }\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\n\t\t\t\t\tjQuery('.chart-placeholder').resize();\n\t\t\t\t}\n\n\t\t\t\tdrawGraph();\n\n\t\t\t\tjQuery('.highlight_series').hover(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph( jQuery(this).data('series') );\n\t\t\t\t\t},\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}", "public function findAllOrders()\n {\n return $this->createQueryBuilder('o')\n ->orderBy('o.createdDate' , 'DESC');\n }", "public function getSalesByMonth()\n {\n\n $dataPoints = DB::select('SELECT date_format(created_at, \\'%Y\\') as year, date_format(created_at, \\'%m\\') as month, count(id) as pocount, sum(total) as monthtotal from purchase_orders group by date_format(created_at, \\'%Y-%m\\')');\n\n\n return response()->json($dataPoints);\n\n }", "public function actionGetOrders(): \\yii\\web\\Response\n {\n return $this->asJson(CommerceReports::$plugin->orders->getOrders());\n }", "public static function getNewOrders($lastVisit) {\n\n\t\treturn Order::fullActive()\n\t\t ->whereBetween('date', [$lastVisit, Carbon::now()])\n\t\t ->get();\n\t}", "public function getOrdersSince($startDate) {\n $apiUrl = sprintf('%s/orderExtend?full=1&excludeAbandonedCart=1&limit=200&createdAtMin=%s&createdAtMax=%s', env('SHOPRENTER_API'), $startDate->toDateTimeLocalString(), Carbon::now()->toDateTimeLocalString());\n $data = [\n 'data' => [\n 'requests' => [],\n ],\n ];\n\n // Megrendelések 1. oldala lekérése\n $ch = curl_init();\n curl_setopt_array($ch, [\n CURLOPT_URL => $apiUrl,\n CURLOPT_HTTPHEADER => ['Content-Type:application/json', 'Accept:application/json'],\n CURLOPT_USERPWD => sprintf('%s:%s', env('SHOPRENTER_USER'), env('SHOPRENTER_PASSWORD')),\n CURLOPT_TIMEOUT => 120,\n CURLOPT_RETURNTRANSFER => true,\n ]);\n $response = json_decode(curl_exec($ch), true);\n $orders = array_key_exists('items', $response) ? $response['items'] : null;\n curl_close($ch);\n\n // Többi megrendelés hozzácsatolása\n if (array_key_exists('pageCount', $response) && $response['pageCount'] > 1) {\n for ($i = 1; $i <= $response['pageCount']; $i++) {\n $nextUrl = str_replace('page=1', 'page='.$i, $response['next']['href']);\n\n $data['data']['requests'][] = [\n 'method' => 'GET',\n 'uri' => $nextUrl,\n ];\n }\n }\n\n $ch = curl_init();\n curl_setopt_array($ch, [\n CURLOPT_URL => sprintf('%s/batch', env('SHOPRENTER_API')),\n CURLOPT_HTTPHEADER => ['Accept:application/json'],\n CURLOPT_USERPWD => sprintf('%s:%s', env('SHOPRENTER_USER'), env('SHOPRENTER_PASSWORD')),\n CURLOPT_TIMEOUT => 120,\n CURLOPT_POST => 1,\n CURLOPT_RETURNTRANSFER => true,\n ]);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));\n $response = json_decode(curl_exec($ch), true);\n curl_close($ch);\n if ($response) {\n foreach ($response['requests']['request'] as $responseData) {\n if ($responseData['response']['header']['statusCode'] == 200) {\n // Összerakjuk\n $orders = array_merge($orders, $responseData['response']['body']['items']);\n }\n }\n }\n\n // Státuszok\n foreach ($orders as $order) {\n $data['data']['requests'][] = [\n 'method' => 'GET',\n 'uri' => str_replace('orderStatuses/', 'orderStatusDescriptions?orderStatusId=', $order['orderStatus']['href']).'&full=1',\n ];\n }\n $ch = curl_init();\n curl_setopt_array($ch, [\n CURLOPT_URL => sprintf('%s/batch', env('SHOPRENTER_API')),\n CURLOPT_HTTPHEADER => ['Accept:application/json'],\n CURLOPT_USERPWD => sprintf('%s:%s', env('SHOPRENTER_USER'), env('SHOPRENTER_PASSWORD')),\n CURLOPT_TIMEOUT => 120,\n CURLOPT_POST => 1,\n CURLOPT_RETURNTRANSFER => true,\n ]);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));\n $response = json_decode(curl_exec($ch), true);\n curl_close($ch);\n if ($response) {\n foreach ($response['requests']['request'] as $responseData) {\n if ($responseData['response']['header']['statusCode'] == 200) {\n // Megkeressük, h melyik megrendeléshez való\n $found = false;\n foreach ($orders as &$order) {\n if ($order['orderStatus']['href'] == $responseData['response']['body']['items'][0]['orderStatus']['href']) {\n $order['statusData'] = $responseData['response']['body']['items'][0];\n $found = true;\n }\n }\n\n if (! $found) {\n Log::info('Nem található státusz egyik megrendeléshez sem:');\n Log::info('- ID: '.$responseData['response']['body']['items'][0]['id']);\n }\n }\n }\n }\n\n return $orders;\n }", "public function getDailyOrders($id=null)\n {\n $startDate = date(\"Y-m-d H:i:s\", strtotime('-1 month', time()));\n $endDate = date('Y-m-d H:i:s');\n\n $userData = User::find()->andFilterWhere(['u_id' => $id])->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n \\Yii::$app->data->getMwsDetails($user->u_mws_seller_id, $user->u_mws_auth_token);\n\n $orderList = \\Yii::$app->api->getOrdersList('Created', $startDate, $endDate);\n foreach ($orderList as $order) {\n $order = (array)$order;\n $order = array_shift($order);\n if ($order) {\n\n $model = AllOrdesList::findOne(['aol_amazon_order_id' => $order['AmazonOrderId'], 'aol_user_id' => $user->u_id]);\n if (!$model) {\n $model = new AllOrdesList();\n }\n $model->aol_amazon_order_id = (key_exists('AmazonOrderId', $order)) ? $order['AmazonOrderId'] : null;\n $model->aol_seller_order_id = (key_exists('SellerOrderId', $order)) ? $order['SellerOrderId'] : null;\n $model->aol_purchase_date = (key_exists('PurchaseDate', $order)) ? $order['PurchaseDate'] : null;\n $model->aol_last_updated_date = (key_exists('LastUpdateDate', $order)) ? $order['LastUpdateDate'] : null;\n $model->aol_order_status = (key_exists('OrderStatus', $order)) ? $order['OrderStatus'] : null;\n $model->aol_fulfilment_channel = (key_exists('FulfillmentChannel', $order)) ? $order['FulfillmentChannel'] : null;\n $model->aol_sales_channel = (key_exists('SalesChannel', $order)) ? $order['SalesChannel'] : null;\n $model->aol_ship_service = (key_exists('ShipServiceLevel', $order)) ? $order['ShipServiceLevel'] : null;\n $model->aol_order_total = (key_exists('OrderTotal', $order)) ? $order['OrderTotal']['Amount'] : 0;\n $model->aol_shipped_items = (key_exists('NumberOfItemsShipped', $order)) ? $order['NumberOfItemsShipped'] : null;\n $model->aol_unshipped_items = (key_exists('NumberOfItemsUnshipped', $order)) ? $order['NumberOfItemsUnshipped'] : null;\n $model->aol_user_id = $user->u_id;\n if($model->save(false)) {\n echo $model->aol_amazon_order_id.\" is Saved. \";\n }\n\n $model = AllOrdesList::findOne($model->aol_amazon_order_id);\n if($model) {\n sleep(2);\n /**\n * Get Finance Event Data\n */\n $financeEventData = \\Yii::$app->api->getFinanceEventList($model->aol_amazon_order_id);\n $amazonOrderId = $sellerOrderId = $shipmentRefundId = null;\n\n if ($financeEventData) {\n // print_r($financeEventData); exit();\n /**\n * Store Shipment Event Data 111-8188019-0760241\n */\n if ($shipmentData = $financeEventData['shipmentEventData']) {\n foreach ($shipmentData as $sVal) {\n $modelSR = new ShipmentRefundEventData();\n $modelSR->sred_amazon_order_id = $amazonOrderId = $sVal['AmazonOrderId'];\n $modelSR->sred_seller_order_id = $sellerOrderId = $sVal['SellerOrderId'];\n $modelSR->sred_marketplace_name = $sVal['MarketplaceName'];\n $modelSR->sred_shipment_posted_date = $sVal['PostedDate'];\n $modelSR->sred_event_type = 'Order';\n\n if ($modelSR->save(false)) {\n $shipmentRefundId = $modelSR->sred_id;\n if (key_exists('ShipmentItemList', $sVal) && is_array($sVal['ShipmentItemList']) && $shipmentItemData = $sVal['ShipmentItemList']) {\n foreach ($shipmentItemData as $sItem) {\n $sellerSku = $sItem['SellerSKU'];\n $orderItemId = $sItem['OrderItemId'];\n $shippedQuantity = $sItem['QuantityShipped'];\n\n if (key_exists('ItemChargeList', $sItem) && is_array($sItem['ItemChargeList']) && $itemChargeData = $sItem['ItemChargeList']) {\n foreach ($itemChargeData as $iData) {\n $itemModel = new ItemChargeListData();\n $itemModel->icld_quantity_shipped = $shippedQuantity;\n $itemModel->icld_seller_sku = $sellerSku;\n $itemModel->icld_order_item_id = $orderItemId;\n $itemModel->icld_amazon_order_id = $modelSR->sred_amazon_order_id;\n $itemModel->icld_seller_order_id = $modelSR->sred_seller_order_id;\n $itemModel->icld_item_charge_type = $iData['ChargeType'];\n $itemModel->icld_charge_amount = $iData['Amount'];\n $itemModel->icld_currency = $iData['CurrencyCode'];\n $itemModel->icld_transaction_type = 'Order';\n $itemModel->icld_item_type = 'Shipment';\n $itemModel->icld_shipment_refund_event_data_id = $modelSR->sred_id;\n if ($itemModel->save(false)) {\n echo \"Item Charge Saved.\";\n }\n } //$itemChargeData\n }\n\n if (key_exists('ItemFeeList', $sItem) && is_array($sItem['ItemFeeList']) && $itemFeeChargeData = $sItem['ItemFeeList']) {\n foreach ($itemFeeChargeData as $ifData) {\n $feeModel = new ItemFeeListData();\n $feeModel->ifld_quantity_shipped = $shippedQuantity;\n $feeModel->ifld_seller_sku = $sellerSku;\n $feeModel->ifld_order_item_id = $orderItemId;\n $feeModel->ifld_amazon_order_id = $modelSR->sred_amazon_order_id;\n $feeModel->ifld_seller_order_id = $modelSR->sred_seller_order_id;\n $feeModel->ifld_fee_type = $ifData['FeeType'];\n $feeModel->ifld_fee_amount = $ifData['Amount'];\n $feeModel->ifld_currency = $ifData['CurrencyCode'];\n $feeModel->ifld_transaction_type = 'Order';\n $feeModel->ifld_item_type = 'Shipment';\n $feeModel->ifld_shipment_refund_event_id = $modelSR->sred_id;\n if ($feeModel->save(false)) {\n echo \"Item Fee Saved.\";\n }\n } // $itemFeeChargeData\n }\n } // $shipmentItemData\n }\n }\n } //$shipmentData\n } // if : $shipmentData\n\n /**\n * Store Refund Event Data\n */\n if ($refundData = $financeEventData['refundEventData']) {\n foreach ($refundData as $rValue) {\n $modelSR = new ShipmentRefundEventData();\n $modelSR->sred_amazon_order_id = $rValue['AmazonOrderId'];\n $modelSR->sred_seller_order_id = $rValue['SellerOrderId'];\n $modelSR->sred_marketplace_name = $rValue['MarketplaceName'];\n $modelSR->sred_refund_posted_date = $rValue['PostedDate'];\n $modelSR->sred_event_type = 'Refund';\n\n if ($model->save(false)) {\n /*$vnModel = new VaNotification();\n $vnModel->vn_amazon_order_id = $modelSR->sred_amazon_order_id;\n $vnModel->vn_refund_posted_date = $modelSR->sred_refund_posted_date;\n $vnModel->vn_shipment_refund_event_data_id = $modelSR->sred_id;\n $vnModel->save(false);*/\n\n if (key_exists('ShipmentItemAdjustmentList', $rValue) && is_array($rValue['ShipmentItemAdjustmentList']) && $shipmentItemData = $rValue['ShipmentItemAdjustmentList']) {\n foreach ($shipmentItemData as $sItem) {\n $sellerSku = $sItem['SellerSKU'];\n $orderItemId = (key_exists('OrderAdjustmentItemId', $sItem)) ? $sItem['OrderAdjustmentItemId'] : null;\n $shippedQuantity = (key_exists('QuantityShipped', $sItem)) ? $sItem['QuantityShipped'] : null;\n\n if (key_exists('ItemChargeAdjustmentList', $sItem) && is_array($sItem['ItemChargeAdjustmentList']) && $itemChargeData = $sItem['ItemChargeAdjustmentList']) {\n foreach ($itemChargeData as $iData) {\n $itemModel = new ItemChargeListData();\n $itemModel->icld_quantity_shipped = $shippedQuantity;\n $itemModel->icld_seller_sku = $sellerSku;\n $itemModel->icld_order_adjustment_item_id = $orderItemId;\n $itemModel->icld_amazon_order_id = $modelSR->sred_amazon_order_id;\n $itemModel->icld_seller_order_id = $modelSR->sred_seller_order_id;\n $itemModel->icld_item_charge_type = $iData['ChargeType'];\n $itemModel->icld_charge_amount = $iData['Amount'];\n $itemModel->icld_currency = $iData['CurrencyCode'];\n $itemModel->icld_transaction_type = 'Refund';\n $itemModel->icld_item_type = 'Refund';\n $itemModel->icld_shipment_refund_event_data_id = $modelSR->sred_id;\n if ($itemModel->save(false)) {\n echo \"Refund Item Charge Saved.\";\n }\n } //$itemChargeData\n }\n\n if (key_exists('ItemFeeAdjustmentList', $sItem) && is_array($sItem['ItemFeeAdjustmentList']) && $itemFeeChargeData = $sItem['ItemFeeAdjustmentList']) {\n foreach ($itemFeeChargeData as $ifData) {\n $feeModel = new ItemFeeListData();\n $feeModel->ifld_quantity_shipped = $shippedQuantity;\n $feeModel->ifld_seller_sku = $sellerSku;\n $feeModel->ifld_order_adjustment_item_id = $orderItemId;\n $feeModel->ifld_amazon_order_id = $modelSR->sred_amazon_order_id;\n $feeModel->ifld_seller_order_id = $modelSR->sred_seller_order_id;\n $feeModel->ifld_fee_type = $ifData['FeeType'];\n $feeModel->ifld_fee_amount = $ifData['Amount'];\n $feeModel->ifld_currency = $ifData['CurrencyCode'];\n $feeModel->ifld_transaction_type = 'Refund';\n $feeModel->ifld_item_type = 'Refund';\n $feeModel->ifld_shipment_refund_event_id = $modelSR->sred_id;\n if ($feeModel->save(false)) {\n echo \"Refund Item Fee Saved.\";\n }\n } // $itemFeeChargeData\n }\n } // $shipmentItemData\n }\n }\n }\n } // if : Refund Event\n\n /*\n * Store Service Fee Event Data\n */\n if ($serviceFeeEventData = $financeEventData['serviceFeeEventData']) {\n foreach ($serviceFeeEventData as $rValue) {\n $aOrderId = $rValue['AmazonOrderId'];\n $feeReason = $rValue['FeeReason'];\n $sellerSku = $rValue['SellerSKU'];\n $fnSku = $rValue['FnSKU'];\n $feeDesc = $rValue['FeeDescription'];\n $asin = $rValue['ASIN'];\n\n if (key_exists('FeeList', $rValue) && is_array($rValue['FeeList']) && $itemChargeData = $rValue['FeeList']) {\n foreach ($itemChargeData as $iData) {\n $sModel = new ServiceFeeData();\n $sModel->sfd_amazon_order_id = $aOrderId;\n $sModel->sfd_seller_order_id = $sellerOrderId;\n $sModel->sfd_fee_reason = $feeReason;\n $sModel->sfd_seller_sku = $sellerSku;\n $sModel->sfd_fnsku = $fnSku;\n $sModel->sfd_fee_description = $feeDesc;\n $sModel->sfd_asin = $asin;\n $sModel->sfd_fee_type = $iData['FeeType'];\n $sModel->sfd_fee_amount = $iData['Amount'];\n $sModel->sfd_currency = $iData['CurrencyCode'];\n $sModel->sfd_shipment_refund_event_data_id = $shipmentRefundId;\n if ($sModel->save(false)) {\n echo \"Service Fee Data Saved.\";\n }\n }\n }\n }\n } // if : service Fee Event\n\n /**\n * Adjustment Event Data\n */\n if ($adjustmentEventData = $financeEventData['adjustmentEventData']) {\n foreach ($adjustmentEventData as $raValue) {\n $adModel = new OrderAdjustmentEventData();\n $adModel->oaed_amazon_order_id = $amazonOrderId;\n $adModel->oaed_seller_order_id = $sellerOrderId;\n $adModel->oaed_adjustment_type = $raValue['AdjustmentType'];\n $adModel->oaed_amount = $raValue['Amount'];\n $adModel->oaed_currency = $raValue['CurrencyCode'];\n\n if ($adModel->save(false)) {\n if (key_exists('AdjustmentItemList', $raValue) && is_array($raValue['AdjustmentItemList']) && $AdjustmentItemList = $raValue['AdjustmentItemList']) {\n foreach ($AdjustmentItemList as $siItem) {\n $adIModel = new OrderAdjustmentItemListData();\n $adIModel->oaild_amazon_order_id = $amazonOrderId;\n $adIModel->oaild_seller_order_id = $sellerOrderId;\n $adIModel->oaild_quantity = $siItem['Quantity'];\n $adIModel->oaild_per_unit_amount = $siItem['PerUnitAmount']['Amount'];\n $adIModel->oaild_total_amount = $siItem['TotalAmount']['Amount'];\n $adIModel->oaild_currency = $siItem['TotalAmount']['CurrencyCode'];\n $adIModel->oaild_seller_sku = $siItem['SellerSKU'];\n $adIModel->oaild_fnsku = $siItem['FnSKU'];\n $adIModel->oaild_product_description = $siItem['ProductDescription'];\n $adIModel->oaild_asin = $siItem['ASIN'];\n $adIModel->order_adjustment_event_data_id = $adModel->oaed_id;\n $adIModel->oaild_shipment_refund_event_data_id = $shipmentRefundId;\n if ($adIModel->save(false)) {\n echo \"Adjustment Item Data Saved.\";\n }\n }\n }\n }\n }\n } // if : adjustment Event Data\n\n } // main if : $financeEventData\n\n $model = AllOrdesList::findOne(['aol_amazon_order_id' => $amazonOrderId]);\n if($model) {\n $model->aol_status = 1; // Finance Event Data Pulled.\n if ($model->save(false)) {\n echo \"Finance Event Data of Order No: \" . $model->aol_amazon_order_id . \" is Saved.\";\n }\n }\n sleep(3);\n\n /**\n * Get Shipped Order Details\n */\n $model = AllOrdesList::findOne(['aol_amazon_order_id' => $model->aol_amazon_order_id]);\n if ($model && $model->aol_order_status == 'Shipped') {\n $orderDetails = \\Yii::$app->api->getOrderDetails($model->aol_amazon_order_id);\n $orderItemAsin = \\Yii::$app->api->getOrderItems($model->aol_amazon_order_id);\n if ($orderDetails) {\n $model->aol_shipping_username = key_exists('Name', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['Name'] : null;\n $model->aol_shipping_address_1 = key_exists('AddressLine1', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['AddressLine1'] : null;\n $model->aol_shipping_address_2 = key_exists('AddressLine2', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['AddressLine2'] : null;\n $model->aol_shipping_address_3 = key_exists('AddressLine3', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['AddressLine3'] : null;\n $model->aol_city = key_exists('City', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['City'] : null;\n $model->aol_country = key_exists('County', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['County'] : null;\n $model->aol_district = key_exists('District', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['District'] : null;\n $model->aol_state_or_region = key_exists('StateOrRegion', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['StateOrRegion'] : null;\n $model->aol_postal_code = key_exists('PostalCode', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['PostalCode'] : null;\n $model->aol_country_code = key_exists('CountryCode', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['CountryCode'] : null;\n $model->aol_phone = key_exists('Phone', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['Phone'] : null;\n $model->aol_buyer_name = key_exists('BuyerName', $orderDetails) ? $orderDetails['BuyerName'] : null;\n $model->aol_buyer_email = key_exists('BuyerEmail', $orderDetails) ? $orderDetails['BuyerEmail'] : null;\n $model->aol_asin = $orderItemAsin;\n $model->aol_shipped_status = 1; //Order Details Pulled\n if ($model->save(false))\n echo $model->aol_amazon_order_id . \" Details Saved.\";\n }\n sleep(3);\n\n /**\n * Get All ASIN for Order\n */\n $orderItemAsinData = \\Yii::$app->api->getOrderItems($model->aol_amazon_order_id, true);\n if ($orderItemAsinData) {\n foreach ($orderItemAsinData as $asinData) {\n $modelOI = OrderItemsAsin::findOne(['oia_order_id' => $model->aol_amazon_order_id]);\n if (!$modelOI) {\n $modelOI = new OrderItemsAsin();\n }\n $modelOI->oia_order_id = $model->aol_amazon_order_id;\n $modelOI->oia_asin = $asinData['ASIN'];\n $catData = ($modelOI->oia_asin) ? \\Yii::$app->api->getProductCategory($modelOI->oia_asin) : null;\n if ($catData) {\n $modelP = FbaAllListingData::findOne(['asin1' => $modelOI->oia_asin]);\n $sPrice = ($modelP) ? $modelP->price : 0;\n $fees = GetApiData::mwsFeesEstimate($modelOI->oia_asin, $sPrice);\n $referralFee = ($fees) ? $fees['ReferralFee'] : 0;\n\n $modelOI->oia_referral_fee = $referralFee;\n $modelOI->oia_category = $catData;\n $modelOI->oia_purchase_date = $model->aol_purchase_date;\n\n $productDimensionData = \\Yii::$app->api->getProductDimensions($modelOI->oia_asin);\n if ($productDimensionData) {\n $modelOI->oia_item_height = $productDimensionData['ItemHeight'];\n $modelOI->oia_item_length = $productDimensionData['ItemLength'];\n $modelOI->oia_item_weight = $productDimensionData['ItemWeight'];\n $modelOI->oia_item_width = $productDimensionData['ItemWidth'];\n $modelOI->oia_package_height = $productDimensionData['PackageHeight'];\n $modelOI->oia_package_length = $productDimensionData['PackageLength'];\n $modelOI->oia_package_weight = $productDimensionData['PackageWeight'];\n $modelOI->oia_package_width = $productDimensionData['PackageWidth'];\n }\n }\n if ($modelOI->save(false)) {\n echo \"ASIN Saved.\";\n }\n sleep(3);\n }\n }\n }\n }\n }\n }\n\n /*if($id) {\n $user->order_cron_status = 1;\n $user->save(false);\n }*/\n }\n echo \"Done..\";\n }", "public function buyer_orders()\n {\n $query = $this->db->where('buyer_id', $this->current_user->user_id)\n ->order_by('time desc')\n //->order_by('progress asc, time desc')\n ->get('orders');\n #echo $this->db->last_query();\n return ($query->num_rows() > 0) ? $this->build_array($query->result_array()) : array();\n\n }", "public function getTodayRevisitOrders()\n {\n return \\DB::select(\"SELECT a.id, a.propaddress1, a.propaddress2, a.propcity, a.propstate, a.propzip, s.descrip as status_name FROM appr_dashboard_delay_order d LEFT JOIN appr_order a ON (a.id=d.orderid) LEFT JOIN order_status s ON (a.status=s.id) WHERE d.created_date BETWEEN :from AND :to AND d.delay_date BETWEEN :t AND :b\", [':from' => strtotime('today'), ':to' => strtotime('tomorrow'), ':t' => strtotime('today'), ':b' => strtotime('tomorrow')]);\n }", "public function getFulfilledOrders()\n {\n $order = $this->db->prepare(<<<SQL\nSELECT orders.order_id, orders.order_date, orders.arrival_date, orders.student_number\nFROM orders\nWHERE orders.arrival_date IS NOT NULL\nORDER BY orders.order_date;\nSQL\n );\n $order->execute();\n return $order->fetchAll(\\PDO::FETCH_OBJ);\n }", "function show_orders() {\n\n\t\t$connection = new MySQLDataSource();\n $connection->connect($GLOBALS['db']['default']['hostname'],\n $GLOBALS['db']['default']['username'],\n $GLOBALS['db']['default']['password'],\n $GLOBALS['db']['default']['database']);\n\t\t$query = \"SELECT * FROM orders ORDER BY date;\";\n\t\t$connection->execute_query($query);\n\t\t$row = $connection->next();\n\t\t$i = 0;\n\n\t\tif(!$row) {\n\n\t\t\t$connection->disconnect();\n\t\t\treturn false;\n\n\t\t} else {\n\n\t\t\twhile($row) {\n\n\t\t\t\t$orders[$i] = new Order();\n\t\t\t\t$orders[$i]->setIdOrder($row->id_order);\n\t\t\t\t$orders[$i]->setDate($row->date);\n\t\t\t\t$orders[$i]->setIdCustomer($row->id_customer);\n\t\t\t\t$orders[$i]->setAmount($row->amount);\n\t\t\t\t$row = $connection->next();\n\t\t\t\t$i++;\n\n\t\t\t}\n\n\t\t\t$connection->disconnect();\n\t\t\treturn $orders;\n\n\t\t}\n\t}", "public function getTransactionDataLast2Years($customerId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-2year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $transactionResource = $this->_transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processReceivedTransactionData($data, $result);\n \n $data = $transactionResource->getSpentCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processSpentTransactionData($data, $result);\n \n $result = array_values($result);\n return $result;\n }", "public function getAmountsDataLast2Years($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-2year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getAmountsByMonth($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function actionIndex()\n {\n if(empty($ordersMonth)){\n $begin = new \\DateTime( date('Y-m-d h:i:s').' -3 weeks' );\n $end = new \\DateTime( date('Y-m-d h:i:s').' +1 day' );\n } else {\n $begin = new \\DateTime( date($ordersMonth.'-01 h:i:s') );\n $end = new \\DateTime( date($ordersMonth.'-t h:i:s'));\n }\n\n $interval = \\DateInterval::createFromDateString('1 day');\n $period = new \\DatePeriod($begin, $interval, $end);\n $orderStats = [];\n foreach ( $period as $dt ){\n $beginOfDay = $dt->setTime(0,0,1)->format( \"Y-m-d H:i:s\\n\" );\n $endOfDay = $dt->setTime(23,59,59)->format( \"Y-m-d H:i:s\\n\" );\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['all'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['done'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>5])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['cancelled'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>1])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['new'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>3])->sum('order_amount');\n }\n\n return $this->render('index', ['orderStats'=>$orderStats, 'begin'=>$begin->format( \"Y-m-d H:i:s\\n\" ), 'end'=>$end->format( \"Y-m-d H:i:s\\n\" )]);\n }", "public function retrieveOrders() {\r\n $client = new Client(\r\n str_replace('/public', '', get_site_url()),\r\n // get_site_url(),\r\n $this->consumer_key,\r\n $this->consumer_secret,\r\n [\r\n 'wp_api' => true,\r\n 'version' => 'wc/v3',\r\n 'query_string_auth' => true,\r\n 'timeout' => PADBSYNC_CURL_TIMEOUT\r\n ]\r\n );\r\n \r\n global $wpdb;\r\n \r\n $query = \"SELECT ID FROM {$wpdb->prefix}posts WHERE profaktura_status = %d AND post_type = %s ORDER BY post_date DESC\";\r\n \r\n $sql = $wpdb->prepare($query, [0, 'shop_order']);\r\n \r\n $dbOrdersProStatZero = $wpdb->get_results($sql);\r\n \r\n $allOrders = $client->get('orders');\r\n \r\n $orders = [];\r\n \r\n if (count($allOrders) > 0 && count($dbOrdersProStatZero) > 0) {\r\n foreach ($allOrders as $o) {\r\n foreach ($dbOrdersProStatZero as $d) {\r\n if ($o->id == $d->ID) {\r\n $orders[] = $o;\r\n continue;\r\n }\r\n }\r\n } \r\n }\r\n \r\n if (count($orders) < 1) {\r\n return new WP_REST_Response(['message' => 'No orders found!']);\r\n }\r\n \r\n return new WP_REST_Response($orders);\r\n }", "public function getgraphAction(){\n $params = array(\n 'cht' => 'lc', \t\t\t\t\t// chart type\n 'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0', //background fills for the chart\n // 'chm' => 'B,f4d4b2,0,0,0|B,FF0000,1,1,0|B,00FF00,2,2,0', \t\t// line fills\n 'chco' => 'db4814,1919D1',\t\t\t\t\t//Series Colors\n 'chs' => '587x300',\t\t\t\t// chart size <width>x<height>\n\t\t\t'chxt' => 'x,y',\t\t\t\t\t// visible axes\n\t\t\t//'chof' => 'validate'\t\t\t\t// output format (png,gif,json,html{when chof='validate'})\n );\n \n\t$post=$this->getRequest()->getPost();\n\t\n\t\n\t$timezoneLocal = Mage::app()->getStore()->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);\n\n\t\tlist ($dateStart, $dateEnd) = Mage::getResourceModel('reports/order_collection')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getDateRange($post['range'], '', '', true);\n\n $dateStart->setTimezone($timezoneLocal);\n $dateEnd->setTimezone($timezoneLocal);\n\t\n\t\t$dates = array();\n $datas = array();\n\n while($dateStart->compare($dateEnd) < 0){\n switch ($post['range']) {\n case '24h':\n $d = $dateStart->toString('yyyy-MM-dd HH:00');\n $dateStart->addHour(1);\n break;\n case '7d':\n case '1m':\n $d = $dateStart->toString('yyyy-MM-dd');\n $dateStart->addDay(1);\n break;\n case '1y':\n case '2y':\n $d = $dateStart->toString('yyyy-MM');\n $dateStart->addMonth(1);\n break;\n }\n\n $dates[] = $d;\n }\n\n\t\t$graphData=array();\n\t\t\n\t\t$product_list=array('product1'=>$post['product'],\n\t\t\t\t\t\t\t'product2'=>$post['compare2']\n\t\t\t\t\t\t\t);\t\n\t\t$graphData=Mage::Helper('graphs')->getGraphData($dates,$product_list);\n\n /**\n * setting skip step\n */\n if (count($dates) > 8 && count($dates) < 15) {\n $c = 1;\n } else if (count($dates) >= 15){\n $c = 2;\n } else {\n $c = 0;\n }\n /**\n * skipping some x labels for good reading\n */\n $i=0;\n foreach ($dates as $k => $d) {\n if ($i == $c) {\n $dates[$k] = $d;\n $i = 0;\n } else {\n $dates[$k] = '';\n $i++;\n }\n }\n \n $this->_axisLabels['x'] = $dates;\n\t\t$this->_axisLabels['y'] = $graphData['quantity'][$post['product']];\n\t\t\n\t\tforeach ($graphData['quantity'] as $index => $serie) {\n $localmaxlength[$index] = sizeof($serie);\n $localmaxvalue[$index] = max($serie);\n $localminvalue[$index] = min($serie);\n }\n \n\t\t$maxvalue = max($localmaxvalue);\n\t\t$minvalue = min($localminvalue);\n\n $yrange = 0;\n $yLabels = array();\n $miny = 0;\n $maxy = 0;\n $yorigin = 0;\n\n $maxlength = max($localmaxlength);\n if ($minvalue >= 0 && $maxvalue >= 0) {\n $miny = 0;\n if ($maxvalue > 10) {\n $p = pow(10, $this->_getPow($maxvalue));\n $maxy = (ceil($maxvalue/$p))*$p;\n $yLabels = range($miny, $maxy, $p);\n } else {\n $maxy = ceil($maxvalue+1);\n $yLabels = range($miny, $maxy, 1);\n }\n $yrange = $maxy;\n $yorigin = 0;\n }\n\n \n\t\t\t\n\t\t\t$params['chd'] = \"e:\";\n $dataDelimiter = \"\";\n $dataSetdelimiter = \",\";\n $dataMissing = \"__\";\n \n\t\t\t// EXTENDED ENCODING\n\t\t\tforeach($product_list as $productid){\n\t\t\t\t$chartdata = array();\t\n for ($j = 0; $j < sizeof($graphData['quantity'][$productid]); $j++) {\n $currentvalue = $graphData['quantity'][$productid][$j];\n \n if (is_numeric($currentvalue)) {\n if ($yrange) {\n $ylocation = (4095 * ($yorigin + $currentvalue) / $yrange);\n\n } else {\n $ylocation = 0;\n }\n $firstchar = floor($ylocation / 64);\n $secondchar = $ylocation % 64;\n $mappedchar = substr($this->_extendedEncoding, $firstchar, 1)\n . substr($this->_extendedEncoding, $secondchar, 1);\n array_push($chartdata, $mappedchar . $dataDelimiter);\n } else {\n array_push($chartdata, $dataMissing . $dataDelimiter);\n }\n\n\t\t\t }\n\t\t\t $buffer = implode('', $chartdata);\t\t\t \n\t\t\t\t\t$buffer = rtrim($buffer, $dataSetdelimiter);\n\t\t\t\t\t$buffer = rtrim($buffer, $dataDelimiter);\n\t\t\t\t\t$buffer = str_replace(($dataDelimiter . $dataSetdelimiter), $dataSetdelimiter, $buffer);\n\t\t\t\t\t\n\t\t\t\t\t$params['chd'] .= $buffer.',';\n\t\t\t\t\t$buffer=null;\n\t\t\t\t\t$chartdata=null;\n\t\t\t\t}\n\t\t\t\t\t$labelBuffer = \"\";\n\t\t\t\t\t$valueBuffer = array();\n\t\t\t\t\t$rangeBuffer = \"\";\n \n if (sizeof($this->_axisLabels) > 0) {\n $params['chxt'] = implode(',', array_keys($this->_axisLabels));\n $indexid = 0;\n foreach ($this->_axisLabels as $idx=>$labels){\n\t\t\t\t\n if ($idx == 'x') {\n /**\n * Format date\n */\n foreach ($this->_axisLabels[$idx] as $_index=>$_label) {\n if ($_label != '') {\n switch ($post['range']) {\n case '24h':\n $this->_axisLabels[$idx][$_index] = $this->formatTime(\n new Zend_Date($_label, 'yyyy-MM-dd HH:00'), 'short', false\n );\n break;\n case '7d':\n case '1m':\n $this->_axisLabels[$idx][$_index] = $this->formatDate(\n new Zend_Date($_label, 'yyyy-MM-dd')\n );\n break;\n case '1y':\n case '2y':\n\t\t\t\t\t\t\t\t\t\n $formats = Mage::app()->getLocale()->getTranslationList('datetime');\n $format = isset($formats['yyMM']) ? $formats['yyMM'] : 'MM/yyyy';\n $format = str_replace(array(\"yyyy\", \"yy\", \"MM\"), array(\"Y\", \"y\", \"m\"), $format);\n $this->_axisLabels[$idx][$_index] = date($format, strtotime($_label));\n break;\n }\n } else {\n $this->_axisLabels[$idx][$_index] = '';\n }\n\n }\n\t\t\t\t\t\t\t\t\t\t\n $tmpstring = implode('|', $this->_axisLabels[$idx]);\n\n $valueBuffer[] = $indexid . \":|\" . $tmpstring;\n if (sizeof($this->_axisLabels[$idx]) > 1) {\n $deltaX = 100/(sizeof($this->_axisLabels[$idx])-1);\n } else {\n $deltaX = 100;\n }\n } else if ($idx == 'y') {\n $valueBuffer[] = $indexid . \":|\" . implode('|', $yLabels);\n if (sizeof($yLabels)-1) {\n $deltaY = 100/(sizeof($yLabels)-1);\n } else {\n $deltaY = 100;\n }\n // setting range values for y axis\n $rangeBuffer = $indexid . \",\" . $miny . \",\" . $maxy . \"|\";\n }\n $indexid++;\n }\n $params['chxl'] = implode('|', $valueBuffer);\n }\t\t\t\n\t\t\t\t\t\n\t\tif (isset($deltaX) && isset($deltaY)) {\n $params['chg'] = $deltaX . ',' . $deltaY . ',1,0';\n }\n \n\n\t\t\t$p = array();\n foreach ($params as $name => $value) {\n $p[] = $name . '=' .urlencode($value);\n }\n\n $url= Mage_Adminhtml_Block_Dashboard_Graph::API_URL . '?' . implode('&', $p);\n\n\t\t\t\techo $url;\n\t}", "function getOrders($orders) {\n $html = '';\n\n for ($i = 0; $i < sizeof($orders); $i++) {\n $order = $orders[$i];\n\n $dateCreated = $order['dateCreated'];\n $dateCreated = new DateTime($dateCreated->toDateTime()->format('Y-m-d H:i:s'));\n\n $html .= '<tr>\n <td class=\"order-row\">' . $dateCreated->format('d/m/Y') . '</td>\n <td class=\"order-row\">' . $order['orderNumber'] . '</td>\n <td class=\"order-row\">' . '£' . $order['summary']['grandTotal'] . '</td>\n <td class=\"order-row\">' . $order['status'] . '</td>\n <td align=\"middle\" class=\"order-row\">\n <button class=\"btn btn-outline-dark btn-sm view-order\" id=\"' . $order['_id'] . '\" onclick=\"viewOrderHistory(this)\">\n View\n </button>\n </td>\n </tr>';\n }\n\n return $html;\n}", "public function getOrderings() {}", "public function index()\r\n {\r\n $orders = Order::orderBy('created_at', 'desc')->get();\r\n\r\n // Stats\r\n $stats = [];\r\n\r\n // Stats - Orders - Processing\r\n $stats['orders_processing'] = Order::where('status', 'processing')->count();\r\n\r\n // Stats - Orders - Processing - Total\r\n $stats['orders_processing_total'] = Order::where('status', 'processing')->sum('total');\r\n\r\n // Stats - Orders - Month to Date\r\n $stats['orders_month_to_date'] = Order::where('created_at', '>=', Carbon::now('America/Los_Angeles')->startOfMonth())->count();\r\n //$stats['orders_month_to_date'] = Order::where('created_at', '>=', $now->modify('first day of this month'))->count(); //this works\r\n\r\n // Stats - Orders - Month to Date - Total\r\n $stats['orders_month_to_date_total'] = Order::where('created_at', '>=', Carbon::now('America/Los_Angeles')->startOfMonth())->sum('total');\r\n\r\n // Stats - Orders - Lifetime - Count\r\n $stats['orders_lifetime'] = Order::count();\r\n\r\n // Stats - Orders - Lifetime - Total\r\n $stats['orders_lifetime_total'] = Order::sum('total');\r\n\r\n return view('admin.orders.index', [\r\n 'orders' => $orders,\r\n 'stats' => $stats\r\n ]);\r\n }", "public function fetch_orders_date(Request $request) {\n $data['orders'] = Order::whereBetween('created_at', array($request->from, $request->to))->get();\n $data['areas'] = Area::where('deleted', 0)->orderBy('id', 'desc')->get();\n $data['from'] = '';\n $data['to'] = '';\n if (isset($request->from)) {\n $data['from'] = $request->from;\n $data['to'] = $request->to;\n }\n $data['sum_price'] = Order::whereBetween('created_at', array($request->from, $request->to))->sum('subtotal_price');\n $data['sum_delivery'] = Order::whereBetween('created_at', array($request->from, $request->to))->sum('delivery_cost');\n $data['sum_total'] = Order::whereBetween('created_at', array($request->from, $request->to))->sum('total_price');\n return view('admin.orders' , ['data' => $data]);\n }", "public function exportOrders()\n\t{\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.OrderEvent' );\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.ProductEvent' );\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.ProspectExportEvent' );\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.OrderHistoryEvent' );\n\t\t\n\t\t$baseURL = Yii::app()->request->hostInfo;\n\t\t$pageSize = 100;\n\n\t\t$allOrders = Yii::app()->db->createCommand()\n\t\t ->select('o.id, o.user_id, o.name, o.email, o.sum, o.date_create, o.status_id')\n\t\t ->from('kalitniki_order AS o')\n\t\t ->group('o.id');\n\t\n\t $allOrders = $allOrders->queryAll();\n\n\t $orderCount = count( $allOrders );\n\t \n\t $pages = ( $orderCount % $pageSize ) > 0 ? floor( $orderCount / $pageSize ) + 1 : $orderCount / $pageSize;\n\t \n\t for ( $currentPage = 0; $currentPage <= $pages - 1; $currentPage++ )\n\t {\n\t \t$dataExport = new OrderHistoryEvent;\n\t \t\n\t \t$offset = $currentPage * $pageSize;\n\t \t$collection = array_slice( $allOrders, $offset, $pageSize );\n\t \t\n\t\t foreach ( $collection as $order )\n\t\t {\n\t\t \t$orderProducts = Yii::app()->db->createCommand()\n\t\t\t ->select('op.name AS product_name, op.price, op.count, op.sum,\n\t\t\t \t\t\tp.id, p.url, p.articul, p.notice, i.name AS img, s.name AS section')\n\t\t\t ->from('kalitniki_order_product AS op')\n\t\t\t ->where('op.order_id = ' . $order['id'])\n\t\t\t ->join('kalitniki_product AS p', 'op.name = p.name')\n\t\t\t ->join('kalitniki_product_img AS i', 'p.id = i.parent')\n\t\t\t ->join('kalitniki_product_assignment AS a', 'p.id = a.product_id')\n\t\t\t ->join('kalitniki_product_section AS s', 's.id = a.section_id')\n\t\t\t ->group('p.id');\n\t\t\t $orderProducts = $orderProducts->queryAll();\n\t\t\t \n\t\t\t $qtyTotal = 0;\n\t\t\t \n\t\t\t $customer = Yii::app()->db->createCommand()\n\t\t\t ->select('c.user_id AS id, c.name, c.email')\n\t\t\t ->from('kalitniki_order AS c')\n\t\t\t ->where('c.id = ' . $order['id']);\n\t\t\t $customer = $customer->queryAll();\n\t\t\t $customer = $customer[0];\n\t\t\t\t\n\t\t\t\t$customer['date_create'] = null;\n\t\t\t\t\n\t\t\t\tif ( $customer['id'] )\n\t\t\t\t{\n\t\t\t\t\t$dateCreate = Yii::app()->db->createCommand()\n\t\t\t\t ->select('u.date_create')\n\t\t\t\t ->from('kalitniki_user AS u')\n\t\t\t\t ->where('u.id = ' . $customer['id']);\n\t\t\t\t $dateCreate = $dateCreate->queryAll();\n\t\t\t\t $dateCreate = $dateCreate[0];\n\t\t\t\t $customer['date_create'] = $dateCreate['date_create'];\n\t\t\t\t}\n\t\t\t \n\t\t\t $dataCustomer = new ProspectExportEvent;\n\t\t\t $dataCustomer->customer_id = $customer['id'];\n\t\t $dataCustomer->customer_first_name = $customer['name'];\n\t\t $dataCustomer->customer_last_name = \"\";\n\t\t $dataCustomer->customer_email = $customer['email'];\n\t\t $dataCustomer->customer_date_created = $customer['date_create'];\n\t\t $dataCustomer->customer_last_login_date = \"\";\n \n\t\t\t $data = new OrderEvent;\n\t\t\t $data->customer = $dataCustomer;\n\t\t\t $data->order_id = $order['id'];\n\t\t\t $data->date_created = $order['date_create'];\n\t\t\t $data->status = $this->getOrderStatus( $order['status_id'] );\n\t\t\t $data->price_total = $order['sum'];\n\t\t\t $data->qty_total = $qtyTotal;\n\t\t\t $data->products = array();\n\t\t\t \n\t\t\t foreach ($orderProducts as $orderProduct)\n\t\t\t {\n\t\t\t \t$productCategories = array();\n \t\t\t$productCategories[] = $orderProduct['section'];\n\t\t\t \t\n\t\t\t \t$dataProduct = new ProductEvent;\n\t\t \t$dataProduct->product_id = $orderProduct['id'];\n\t\t \t$dataProduct->product_name = $orderProduct['product_name'];\n\t\t \t$dataProduct->product_desc = $orderProduct['notice'];\n\t\t \t$dataProduct->product_sku = $orderProduct['articul'];\n\t\t \t$dataProduct->product_image = $baseURL . '/' . $orderProduct['img'];\n\t\t \t$dataProduct->product_url = $baseURL . '/' . $orderProduct['url'];\n\t\t \t$dataProduct->product_qty = (int) $orderProduct['count'];\n\t\t \t$dataProduct->product_price = $orderProduct['price'];\n\t\t \t$dataProduct->product_total_val = $orderProduct['sum'];\n\t\t \t$dataProduct->product_categories = $productCategories;\n\t\t \t\n\t\t \t$data->products[] = $dataProduct;\n \t\t\t$data->qty_total += $dataProduct->product_qty;\n\t\t\t }\n\n\t\t\t $dataExport->orders[] = $data;\n\t\t }\n\t\t \n\t\t $this->client->sendEvent( $dataExport );\n\t }\n\t}", "function get_years_to_search() {\n global $DB;\n $sql = \"SELECT date AS fecha FROM {report_user_statistics};\";\n $dates = $DB->get_records_sql($sql);\n $result = array();\n foreach ($dates as $date) {\n $fecha = new DateTime(\"@$date->fecha\");\n $result[$fecha->format('Y')] = $fecha->format('Y');\n }\n return $result;\n}", "public function getOrderings();", "public function actionOrder()\n {\n $request = Yii::$app->getRequest();\n $requestParams = $request->getBodyParams();\n \n if (empty($requestParams)) {\n $requestParams = $request->getQueryParams();\n }\n \n $query = Order::find()\n ->where(['customer_id' => $this->customer_id])\n ->andWhere(['<>', 'status_id', Order::STATUS_DRAFT])\n // filter based on date range\n ->andFilterWhere([\n 'between',\n 'ordered_at',\n $request->getBodyParam('order_from'),\n $request->getBodyParam('order_to')\n ]);\n \n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => ['params' => $requestParams],\n 'sort' => ['params' => $requestParams],\n ]);\n \n return $dataProvider;\n }", "public function getOrders()\n {\n $response = $this->orderDesk->get( \"orders\" );\n $orders = $response[ \"orders\" ];\n $values = [];\n\n if (!empty($orders)) {\n foreach ( $orders as $order ) {\n\n $value = [\n $order[\"shipping\"][\"first_name\"],\n $order[\"shipping\"][\"last_name\"],\n $order[\"email\"],\n $order[\"shipping_method\"],\n $order[\"payment_type\"],\n $order[\"order_total\"]\n ];\n \n array_push( $values, $value );\n }\n \n $this->updateGoogleSheets( $values );\n } else {\n return $response['message'];\n }\n }", "public function buysOfThisYear() {\n $query = \"SELECT COUNT(*) AS 'BUYS', MONTH(`BUYDATE`) AS 'MONTH' FROM `BUY` WHERE YEAR(BUYDATE) = \" .\n \"YEAR(NOW()) GROUP BY MONTH(`BUYDATE`)\";\n\n $result = parent::query($query);\n\n $toReturn = array();\n\n while ($row = $result->fetch_assoc()) {\n $toReturn[] = array(\n 'month' => $row['MONTH'],\n 'buys' => $row['BUYS']\n );\n }\n\n return $toReturn;\n }", "function orders() {\n\t \treturn $this->hook(\"/{$this->subject_slug}/v1/orders.xml?api_key={$this->api_key}\",\"order\");\n\t}", "function getAllOrders()\n {\n $dataService = new OrderDataService();\n\n return $dataService->getAllOrders();\n }", "public function get_latest_orders()\n\t{\n\t\t$where = 'orders.order_status_id != 4 AND orders.order_status_id = order_status.order_status_id AND customer.customer_id = orders.customer_id AND orders.vendor_id = '.$this->session->userdata('vendor_id');\n\t\t$table = 'orders, order_status, customer';\n\t\t\n\t\t//retrieve all orders\n\t\t$this->db->from($table);\n\t\t$this->db->select('orders.*, orders.order_status_id AS status,customer.customer_first_name AS first_name, customer.customer_surname AS other_names, order_status.order_status_name');\n\t\t$this->db->where($where);\n\t\t$this->db->order_by('orders.order_created', 'DESC');\n\t\t$query = $this->db->get('', 20);\n\t\t\n\t\treturn $query;\n\t}", "public function getOrders()\n {\n return $this->orders;\n }", "protected function list_orders() {\r\n // Get response\r\n $dt = new DataTableResponse( $this->user );\r\n\r\n $website_order = new WebsiteOrder();\r\n\r\n // Set Order by\r\n $dt->order_by( '`website_order_id`', '`total_cost`', '`status`', '`date_created`' );\r\n $dt->add_where( ' AND `website_id` = ' . (int) $this->user->account->id );\r\n $dt->search( array( '`website_order_id`' => false ) );\r\n\r\n // Get items\r\n $website_orders = $website_order->list_all( $dt->get_variables() );\r\n $dt->set_row_count( $website_order->count_all( $dt->get_count_variables() ) );\r\n\r\n // Set initial data\r\n $data = false;\r\n\r\n /**\r\n * @var WebsiteOrder $order\r\n */\r\n if ( is_array( $website_orders ) )\r\n foreach ( $website_orders as $order ) {\r\n switch ( $order->status ) {\r\n case WebsiteOrder::STATUS_DECLINED:\r\n $status = 'Declined';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_PURCHASED:\r\n $status = 'Purchased';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_PENDING:\r\n $status = 'Pending';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_DELIVERED:\r\n $status = 'Delivered';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_RECEIVED:\r\n $status = 'Received';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_SHIPPED:\r\n $status = 'Shipped';\r\n break;\r\n\r\n default:\r\n $status = 'Error';\r\n break;\r\n }\r\n\r\n $date = new DateTime( $order->date_created );\r\n\r\n $link_text = '';\r\n if ( $order->is_ashley_express() ) {\r\n $link_text = \" - Express Delivery\";\r\n }\r\n\r\n $data[] = array(\r\n '<a href=\"' . url::add_query_arg( 'woid', $order->id, '/shopping-cart/orders/view/' ) . '\" title=\"' . _('View') . '\">' . $order->id . '</a>' . $link_text\r\n , $order->name\r\n , '$' . number_format( $order->total_cost, 2 )\r\n , $status\r\n , $date->format('F jS, Y')\r\n );\r\n }\r\n\r\n // Send response\r\n $dt->set_data( $data );\r\n\r\n return $dt;\r\n }", "public function getFutureRevisitOrders()\n {\n return \\DB::select(\"SELECT a.id, a.propaddress1, a.propaddress2, a.propcity, a.propstate, a.propzip, s.descrip as status_name FROM appr_dashboard_delay_order d LEFT JOIN appr_order a ON (a.id=d.orderid) LEFT JOIN order_status s ON (a.status=s.id) WHERE d.created_date BETWEEN :from AND :to AND d.delay_date > :today\", [':from' => strtotime('today'), ':to' => strtotime('tomorrow'), ':today' => strtotime('tomorrow')]);\n }", "public function allOrders()\n\t{\n\t\trequire 'Database.php';\n\n\t\t$req = $db->prepare(\"SELECT lol_server,lol_summoner,lol_account,lol_password,order_id, order_queue, order_boost, order_type, order_wins, start_league, start_division, desired_league, desired_division, order_date, DATE_FORMAT(order_date, '%d/%m/%Y') AS date, order_price, order_status, order_pause FROM orders WHERE user_id = ? ORDER BY order_status\");\n\t\t$req->execute(array($_SESSION['id']));\n\n\t\treturn $req->fetchAll();\n\t}", "public function getTransactionDataLastYear($customerId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-1year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $transactionResource = $this->_transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processReceivedTransactionData($data, $result);\n \n $data = $transactionResource->getSpentCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processSpentTransactionData($data, $result);\n \n $result = array_values($result);\n return $result;\n }", "public function indexgraphyearAd()\n {\n\n // ->elementLabel(\"amout\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->groupBy('name');\n\n // $bills = Bill::where(DB::raw(\"(DATE_FORMAT(update_at,'%Y'))\"),date('Y'))->get();\n // $chart = Charts::database($bills, 'bar', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->groupByMonth(date('Y'), true);\n\n // $data = Bill::where('updated_at', '2018-12-10')->get();\n // $chart = Charts::create('line', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->labels($data->pluck('updated_at'))\n // ->values($data->pluck('sum'));\n\n $chart = Charts::database(Bill::all(), 'bar', 'highcharts')\n ->elementLabel(\"Total\")\n ->dimensions(1000, 500)\n ->responsive(false)\n ->lastByYear(6);\n\n \n\n // $data = BillDetail::all();\n // $chart = Charts::create('line', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->labels($data->pluck('name'))\n // ->values($data->pluck('amout'));\n\n\n // ->template(\"material\")\n // ->dataset('Element 1', [5,20,100])\n // ->dataset('Element 1', [15,30,80])\n // ->dataset('Element 1', [25,10,40])\n // ->labels(['One', 'Two', 'Three']);\n\n return view('adminPharmacy.a_graphyear', ['chart' => $chart]);\n }", "public function getFOrders()\n {\n // 花店管理员身份验证\n if (session(\"admin_level\") == 3){\n $toFlower = M('weixin_order');\n $data = $toFlower->where('type = 0')->select();\n $this->assign('data',$data);\n }\n\n $toTrade = M('pub_trade_logs');\n $con['uid'] = session('uid');\n //$this->ajaxReturn(0 , $con['uid'] , 1);\n $TradeLogs = $toTrade->query(\"SELECT `xt_pub_trade_logs`.* ,`xt_pub`.`title` FROM `xt_pub_trade_logs` left join `xt_pub` on `xt_pub_trade_logs`.`pub_id` = `xt_pub`.`pub_id` WHERE 1\");\n // $this->ajaxReturn(0 , $TradeLogs , 1);\n\n $this->assign('tradelogs',$TradeLogs);\n $this->display();\n }", "public static function getOrderHistoryOfUser() {\n return $allOrders = Order::where(\"user_id\", Auth::id())\n ->select(\"*\")->orderBy(\"created_at\", \"desc\")->get();\n }", "public function get_trend_data_rows()\n\t{\n\t\t$dates = array();\n\t\t$i_rows = array();\n\t\t$sr_rows = array();\n\t\t$trend_data = array();\n\n\t $current_month = date_create()->format('Y-m-d H:i:s');\n\n\t // echo $current_month_first_day=date_create($current_month)\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\t $current_month_first_day=date_create($current_month)\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n\n $dates[] = $current_month_first_day;\n\n //echo\"</br>\";\n \n // echo $current_month_current_day=date_create($current_month)\n // ->format(\"Y-m-d 23:59:59\");\n\n $current_month_current_day=date_create($current_month)\n ->format(\"Y-m-d 23:59:59\");\t\n\n $dates[] = $current_month_current_day;\n\n //echo\"</br></br>\";\n\n // echo $second_month_first_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $second_month_first_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $second_month_first_day;\n\n //echo\"</br>\";\n\n // echo $second_month_last_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n $second_month_last_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $second_month_last_day;\n\n// echo\"</br></br>\";\n\n // echo $third_month_first_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $third_month_first_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $third_month_first_day;\n\n //echo\"</br>\";\n \t\t\t\n // echo $third_month_last_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n\t $third_month_last_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $third_month_last_day;\n\n // echo\"</br>\";\t\n // echo \"<pre>\";\n // print_r($dates);\n\t // echo \"</pre>\";\t\n\t // echo\"</br>\";\t\t\t \n\n for ($i=0; $i <=5 ; $i=$i+2)\n { \t\n \t//echo\"</br>\";\n\n \t$start = new DateTime($dates[$i]);\n \t\n \t//echo\"</br>\";\n\n\t\t$start = date_format($start,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\n\t\t$end = new DateTime($dates[$i+1]);\n\n\t\t//echo\"</br>\";\n\n\t\t$end = date_format($end,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\t\t$i_rows[] = date_create($start)->format(\"F Y\");\n\t\t$i_rows[] = date_create($end)->format(\"F Y\");\n\t\t$i_rows[] = $this->trend_insident_data($start,$end);\n \t$sr_rows[] = date_create($start)->format(\"F Y\");\n\t\t$sr_rows[] = date_create($end)->format(\"F Y\");\n \t$sr_rows[] = $this->trend_sr_data($start,$end);\t\n }\n\n // echo \"<pre>\";\n // \tprint_r($i_rows);\n \t\t// echo \"<h4>SR Array</h4>\";\n \t\t// print_r($sr_rows);\n \t\t// echo \"</pre>\";\n\n \t\t$trend_data[] = $i_rows;\n \t\t$trend_data[] = $sr_rows;\n\n\n \t\treturn $trend_data;\n\n\n // // First day of a specific month\n // $d = new DateTime('2010-01-19');\n // $d->modify('first day of this month');\n // echo $d->format('jS, F Y').\"</br>\";\n\n // // alternatively...\n // echo date_create('2010-01-19')\n // ->modify('first day of this month')\n // ->format('jS, F Y');\n\t\t//exit();\n\t}", "function get_vehicles_by_year() {\n global $db;\n $query = 'SELECT * FROM vehicles\n ORDER BY year DESC';\n $statement = $db->prepare($query);\n $statement->execute();\n $vehicles = $statement->fetchAll();\n $statement->closeCursor();\n return $vehicles;\n }", "public function getTimeSeries() {\n $series = array();\n foreach($this -> _trades as $trade) {\n \n $month = date('M',$trade['timestamp']);\n if(!isset($series[$month])) {\n $series[$month] = 0;\n }\n if(!empty($trade['delta'])) {\n $series[$month] += $trade['delta'] - (isset($trade['fee']) ? $trade['fee'] : 0);\n }\n }\n return $series;\n }", "public function getHistory($fsym, $limit = 29)\n {\n $filtered_data = [];\n\n $response = $this->client->get('data/v2/histoday', [\n 'query' => [\n 'fsym' => $fsym, // Cryptocurrency whose data we want\n 'tsym' => $this->conversion_currency, // Real currency to convert the price to\n 'limit' => $limit // Number of past days to retrieve\n ]\n ]);\n\n $data = json_decode($response->getBody())->Data->Data; // Get data from JSON\n\n // Filter API data to keep only relevent data\n foreach ($data as $index => $day) {\n $date = new Carbon($day->time);\n $filtered_data[$index]['date'] = $date->format('d/m'); // Format the date\n $filtered_data[$index]['rate'] = $day->open; // Price at the date\n }\n\n return $filtered_data;\n }", "public function getReportsbyYear()\n {\n $charts = app(ReportChart::class);\n $response = $this->byYear();\n \n $charts->labels($response['ano']);\n \n $charts->dataset('Relatório Anual de Vendas','bar',$response['total'])\n ->backgroundColor($response['colors'])\n ->color('red');\n\n $charts->options([\n 'scales' => [\n 'yAxes' => [\n [\n 'ticks' => [\n 'callback' => $charts->rawObject('myCallback')\n ]\n ]\n ]\n ]\n ]); \n \n return $charts;\n }", "public function allOrder()\n {\n $orders = Order::where('id','!=',0)\n ->orderBy('id','desc')\n ->get()\n ->groupBy(function ($data){\n return $data->created_at->format('M-Y');\n });\n\n return view('user.admin.order.all-order',[\n 'orders' => $orders\n ]);\n }", "public function getBuyerHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $buyer = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($dateQuery.',count(distinct buyer_id)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['buyer'] = $buyer;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function AllOrders_get() {\n extract($_GET);\n $result = $this->feeds_model->AllOrders($per_page, $offset);\n return $this->response($result);\n }", "function get_planned_orders_for_acconuts_per_year($year, $accounts)\n{\n if (!$year) {\n $year = date('Y');\n }\n\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n\n if (empty($accounts)) {\n return [];\n }\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'planned_order')\n ->fieldCondition('field_planned_account', 'target_id', $accounts, 'IN')\n ->fieldCondition('field_planned_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_period', 'value', $end_date, '<=')\n ->fieldCondition('field_planned_actual_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_actual_period', 'value', $end_date, '<=')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n\n if (isset($records['node'])) {\n return $records['node'];\n }\n}", "public function searchMonth(Request $request){\n $result = Order::with('customer')->where('order_month',$request->order_month)->where('order_year',$request->order_year)->latest()->get();\n return response()->json($result);\n\n }", "public static function getChartData(Request $request)\n {\n $user = auth()->user();\n $chart = new Chart($request);\n $query_params = $chart->setQueryParams();\n\n $query = (new Order())->newQuery();\n\n if (Bouncer::is($user)->an('editor')) {\n $query->where('client_id', $user->clientId());\n }\n\n $orders = $query->select('total', 'created_at')\n ->whereBetween('created_at', [$query_params['from'], $query_params['to']])\n ->orderBy('created_at')\n ->get()\n ->groupBy(function ($val) use ($query_params) {\n return Carbon::parse($val->created_at)->format($query_params['group']);\n });\n\n return $chart->returnQueryData($query_params['iterator'], $orders);\n }", "private function topGridData() {\r\n\t\t\r\n $result = $this->getLatestPeriod();\r\n \r\n if (is_array($result) && !empty($result))\r\n {\r\n $periodResult = array_column($result, \"period\");\r\n $query = \"SELECT \".$this->accountIdField.\" AS SKUID \" .\r\n \",\".$this->accountNameField.\" AS ACCOUNT \" .\r\n \",\".$this->settingVars->tesco_po_details.\".period AS PERIOD \" .\r\n \",SUM((CASE WHEN period IN('\" . implode(\"','\", $periodResult) . \"') THEN total_placed_orders_Cases ELSE 0 END)) AS ORDERED \" .\r\n \",SUM((CASE WHEN period IN('\" . implode(\"','\", $periodResult) . \"') THEN delivered_on_time ELSE 0 END)) AS DELIVERED \" .\r\n \" FROM \".$this->settingVars->tesco_po_details.\", \".$this->settingVars->skutable.\" WHERE \".$this->settingVars->tesco_po_details.\".GID = \".$this->settingVars->skutable.\".GID AND \".$this->settingVars->tesco_po_details.\".skuID = \".$this->settingVars->skutable.\".PIN AND \".$this->settingVars->skutable.\".clientID = '\".$this->settingVars->clientID.\"' AND \".$this->settingVars->skutable.\".GID = \".$this->settingVars->GID.\" AND \".$this->commonQueryPart.\" GROUP BY SKUID, ACCOUNT, PERIOD ORDER BY PERIOD DESC\";\r\n //echo $query; exit;\r\n $redisOutput = $this->redisCache->checkAndReadByQueryHashFromCache($query);\r\n if ($redisOutput === false) {\r\n $result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\r\n $this->redisCache->setDataForHash($result);\r\n } else {\r\n $result = $redisOutput;\r\n }\r\n \r\n $tmpResult = array();\r\n if (is_array($result) && !empty($result))\r\n {\r\n foreach($result as $data)\r\n $tmpResult[$data['SKUID'].\"##\".$data['ACCOUNT']][$data['PERIOD']] = $data;\r\n \r\n foreach($tmpResult as $tmpKey => $tmpData)\r\n {\r\n $tmp = array();\r\n $extra = explode(\"##\", $tmpKey);\r\n $tmp[\"0_0SKUID\"] = $extra[0];\r\n $tmp[\"0_01ACCOUNT\"] = $extra[1];\r\n \r\n foreach($periodResult as $key => $period)\r\n {\r\n $tmp[$key.\"_1ORDERED_\".$period] = (double)$tmpData[$period][\"ORDERED\"];\r\n $tmp[$key.\"_2DOT_\".$period] = ($tmpData[$period][\"ORDERED\"] != 0) ? ($tmpData[$period][\"DELIVERED\"]/$tmpData[$period][\"ORDERED\"])*100 : 0;\r\n $tmp[$key.\"_2DOT_\".$period] = (double)number_format($tmp[$key.\"_2DOT_\".$period], 1, '.', '');\r\n }\r\n $finalData[] = $tmp;\r\n }\r\n }\r\n }\r\n\r\n $this->jsonOutput['topGridData'] = $finalData;\r\n }", "public function getOrdersDataLastMonth($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-30days\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getNumOfOrderByDay($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function orders_get_list() {\n\t\t $sql = <<<EOD\n\t\t SELECT\n\t\t \t{$this->wpdb->prefix}topspin_orders.id,\n\t\t \t{$this->wpdb->prefix}topspin_orders.artist_id,\n\t\t \t{$this->wpdb->prefix}topspin_orders.created_at,\n\t\t \t{$this->wpdb->prefix}topspin_orders.subtotal,\n\t\t\t{$this->wpdb->prefix}topspin_currency.currency,\n\t\t\t{$this->wpdb->prefix}topspin_currency.symbol,\n\t\t \t{$this->wpdb->prefix}topspin_orders.tax,\n\t\t \t{$this->wpdb->prefix}topspin_orders.phone,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_method_calculator,\n\t\t \t{$this->wpdb->prefix}topspin_orders.reshipment,\n\t\t \t{$this->wpdb->prefix}topspin_orders.fan,\n\t\t \t{$this->wpdb->prefix}topspin_orders.details_url,\n\t\t \t{$this->wpdb->prefix}topspin_orders.exchange_rate,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_method_code,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_firstname,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_lastname,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_lastname,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_address1,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_address2,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_city,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_state,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_postal_code,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_country,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_phone\n\t\t FROM {$this->wpdb->prefix}topspin_orders\n\t\t LEFT JOIN\n\t\t \t{$this->wpdb->prefix}topspin_currency ON {$this->wpdb->prefix}topspin_orders.currency = {$this->wpdb->prefix}topspin_currency.currency\n\t\t WHERE\n\t\t \t{$this->wpdb->prefix}topspin_orders.artist_id = '%d'\n\t\t GROUP BY\n\t\t \t{$this->wpdb->prefix}topspin_orders.id\n\t\t ORDER BY\n\t\t \t{$this->wpdb->prefix}topspin_orders.created_at DESC\nEOD;\n\t\t$ordersList = $this->wpdb->get_results($this->wpdb->prepare($sql,array($this->artist_id)));\n\t\tif(count($ordersList)) {\n\t\t\tforeach($ordersList as $key=>$order) {\n\t\t\t\t$ordersList[$key]->items_list = $this->orders_get_items_list($order->id);\n\t\t\t}\n\t\t}\n\t\treturn $ordersList;\n\t}", "public function graphyearused()\n \t{\n \t\t// announce return variable\n \t\t$return \t= \tarray();\n \t\t$count \t\t=\tarray();\n \t\t// select logger collection \n \t\t$use_data \t= \t$this->mongo_db->db->used;\n \t\t// preparing query data\n \t\t$splitday \t= \texplode('-', $this->use_date);\n \t\tfor ($i = 1; $i <= 12; $i++) \n \t\t{\n \t\t\tif (strlen($i) == 1) \n \t\t\t{\n \t\t\t\t// use mongoRegex (while like in sql)\n \t\t\t\t$regex_Date \t= \tnew MongoRegex('/^'.$splitday[0].'-0'.$i.'/');\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_date' \t=> \t$regex_Date, \n \t\t\t\t\t'use_appid' => \t$this->use_appid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t} \n \t\t\telse \n \t\t\t{\n \t\t\t\t// use mongoRegex (while like in sql)\n \t\t\t\t$regex_Date \t= \tnew MongoRegex('/^'.$splitday[0].'-'.$i.'/');\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_date' \t=> $regex_Date, \n \t\t\t\t\t'use_appid' => $this->use_appid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t}\n \t\t}\n \t\t$return\t\t=\tarray(\n \t\t\t'name'\t\t=>\t\t'User',\n \t\t\t'data'\t\t=>\t\t$count\n \t\t\t);\n\n \t\treturn $return;\t\n \t}", "private static function getAllOldSystem(): array\n {\n $ordersList = [];\n\n $args = [\n 'post_type' => 'shop_order',\n 'post_status' => self::$ordersStatuses,\n 'posts_per_page' => self::$limit,\n 'paged' => self::$currentPage,\n 'orderby' => 'date',\n 'order' => 'DESC',\n 'meta_query' => [\n 'relation' => 'OR',\n [\n 'key' => '_moloni_sent',\n 'compare' => 'NOT EXISTS'\n ],\n [\n 'key' => '_moloni_sent',\n 'value' => '0',\n 'compare' => '='\n ]\n ],\n ];\n\n $args = apply_filters('moloni_before_pending_orders_fetch', $args);\n\n $query = new WP_Query($args);\n self::$totalPages = $query->max_num_pages;\n\n foreach ($query->posts as $order) {\n $ordersList[] = new WC_Order($order->ID);\n }\n\n return $ordersList;\n }", "public function getAmountsDataLastYear($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-1year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getAmountsByMonth($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function Orders()\n {\n return $this->getOrders();\n }", "public function getOrders($start = 0, $limit = 100, \\DateTime $since = null)\n {\n $payload = array('start' => $start, 'limit' => $limit);\n \n if($since) {\n $since->setTimezone(new \\DateTimeZone('Etc/GMT'));\n $payload['since'] = $since->format('Y-m-d H:i:s');\n }\n \n $apiCall = 'ecommOrders';\n $data = $this->makeRequest($apiCall, $payload);\n $data = json_decode($data);\n\n return $data; \n }", "private function getOrderData($order)\n {\n // get order subprofile instance \n $orderAbstract = Mage::getModel('marketingsoftware/abstraction_order')->importFromOriginal($order);\n $orderSubprofile = Mage::getModel('marketingsoftware/Copernica_Order_Subprofile')->setOrder($orderAbstract);\n\n // get order data array\n $orderData = $orderSubprofile->toArray();\n\n // placeholder for items array\n $items = array();\n\n /**\n * Order has 3 (or more) methods to get set of items. ::getAllItems(),\n * ::getAllVisibleItems() and ::getItemsCollection(). ::getAllItems()\n * and getAllVisibleItems() returns an array and items have some missing\n * data (or are just populated in odd way). ::getAllVisibleItems() seems \n * to return all orders configurable items, so top-level items.\n * ::getItemsCollection() seems to fetch proper items collection that \n * we can use.\n * It's nice of magento to provide such friendly interface.\n */\n $itemsCollection = $order->getItemsCollection();\n\n // iterate over all items \n foreach ($itemsCollection as $item) $items[] = $this->getItemData($item);\n\n // add items to order data\n $orderData['items'] = $items;\n\n // return order data array\n return $orderData;\n }", "public function getBuyerHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $buyer = DB::connection('virtual_market')\n ->table('orders')\n ->select(DB::raw($dateQuery.',count(distinct customer_id)'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['buyer'] = $buyer;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function getSaleByMonth2($year = null)\n {\n $date = new \\DateTime(\"now\");\n $currentYear = $date->format('y');\n //If the value of $year is not define then use the current year (default)\n if(!$year){\n $year = $currentYear;\n }\n \n //Get all the STransaction from the DB first.\n $STransactions = $this->em->getRepository('TransactionBundle:STransaction')->findAll();\n $months = array('jan' => 0, 'feb' => 0, 'mar' => 0, 'apr' => 0, 'may' => 0, 'jun' => 0, 'jul'\n => 0, 'aug' => 0, 'sep' => 0, 'oct' => 0, 'nov' => 0, 'dec' => 0);\n foreach ($STransactions as $st){\n $m = $st->getCreatedAt()->format(\"m\");\n $y = $st->getCreatedAt()->format(\"y\");\n if($m == 01 && $y == $year){\n $months['jan'] = $months['jan'] + $st->getTotalAmount();\n }elseif($m == 11 && $y == $year){\n $months['nov'] = $months['nov'] + $st->getTotalAmount();\n }\n }\n \n return $months;\n \n }", "public function getDifferentOrders()\n\t{\n\t\t$select = $this->_getReadAdapter()\n\t\t\t->select()\n\t\t\t->from($this->getMainTable()) \n\t\t\t->columns('ebay_order_id') \t\n ->where('order_created = ? AND ebay_order_status = ? AND ebay_order_id <> ?',0,Mbid_Magebid_Model_Transaction::EBAY_ORDER_STATUS_COMPLETED,'')\n ->group('ebay_order_id'); \n \n return $this->_getReadAdapter()->fetchAll($select);\t\n\t}", "public function getOrders() \n {\n return $this->_fields['Orders']['FieldValue'];\n }", "public function index()\n {\n $start = date('Y-m-d 00:00:00');\n $end = date('Y-m-d 23:59:59');\n\n $newOrder = (int) Order::whereNotNull('confirmed_at')\n ->whereBetween('created_at', [$start, $end])\n ->where('status', '<>', 'canceled')\n ->count();\n\n $income = Order::whereNotNull('confirmed_at')\n ->whereIn('status', ['paid', 'shipped', 'complete'])\n ->whereBetween('created_at', [$start, $end])\n ->sum(DB::raw('`total` * `exchange_rate`'));\n\n $newUser = (int) User::whereBetween('created_at', [$start, $end])->count();\n $totalUser = (int) User::count();\n\n $dailySales = [];\n $num = 10;\n $from = strtotime(date('Y-m-d')) - 86400 * 9;\n for ($i = 0; $i < 10; $i++) {\n $t = $from + $i * 86400;\n\n $v = Order::whereNotNull('confirmed_at')\n ->whereIn('status', ['paid', 'shipped', 'complete'])\n ->whereBetween('created_at', [\n date('Y-m-d 00:00:00', $t), date('Y-m-d 23:59:59', $t),\n ])\n ->sum(DB::raw('`total` * `exchange_rate`'));\n\n $dailySales[date('Y-m-d', $t)] = round($v, 2);\n }\n\n $months = [];\n $monthlySales = [];\n $start = mktime(0, 0, 0, date('n'), 1, date('Y') - 1);\n for ($i = 0; $i <= 12; $i++) {\n $t = Helper::periodicTime($start, $i);\n $months[] = date('Y-m', $t);\n\n $v = Order::whereNotNull('confirmed_at')\n ->whereIn('status', ['paid', 'shipped', 'complete'])\n ->whereBetween('created_at', [\n date('Y-m-d 00:00:00', $t), date('Y-m-t 23:59:59', $t),\n ])\n ->sum(DB::raw('`total` * `exchange_rate`'));\n $monthlySales[] = round($v, 2);\n }\n\n return view('admin.index', [\n 'pageTitle' => 'Dashboard',\n 'newOrder' => $newOrder,\n 'income' => Helper::money($income),\n 'newUser' => $newUser,\n 'totalUser' => $totalUser,\n 'dailySales' => $dailySales,\n 'months' => $months,\n 'monthlySales' => $monthlySales,\n ]);\n }", "function get_all_distributor_orders(){\r\n\r\n $distributor = $this->aauth->get_user();\r\n $distributor_id = $distributor->distributor_id;\r\n\r\n $date_from = $this->session->userdata('dashboard_date_from');\r\n $date_to = $this->session->userdata('dashboard_date_to');\r\n\r\n $query_string = \"SELECT \r\n a.id as 'order_number',\r\n b.company_name as 'customer',\r\n do.distributor_id as 'distributor',\r\n c.name as 'payment_type', \r\n a.status, \r\n a.delivery_date, \r\n a.createdate,\r\n a.delivery_type,\r\n sum(oi.price * oi.quantity) as total,\r\n sum(oi.quantity) as product_count\r\n FROM `orders` as a, `order_items` as `oi`,`customers` as b, `payment_types` as c,`distributor_orders` as do \r\n WHERE a.customer_id = b.id \r\n AND a.id = do.order_id \r\n AND a.id = oi.order_id \r\n AND do.distributor_id = '$distributor_id'\r\n AND a.createdate > '$date_from' \r\n AND a.createdate < '$date_to' \r\n GROUP BY oi.order_id ORDER by a.createdate desc \";\r\n\r\n $query = $this->db->query($query_string);\r\n \r\n $return['query'] = $query_string;\r\n $return['orders'] = $query->result_array();\r\n return $return;\r\n }", "private function _countOrders($year, $month)\n {\n return Purchase::whereYear('created_at', $year)\n ->whereMonth('created_at', $month)\n ->get();\n }", "public function pharmacySalesGraphData()\n {\n $prescriptions = Prescription::whereIn('status',[Prescriptions::PAID_PRESCRIPTION,Prescriptions::ISSUED_PRESCRIPTION])->get();\n $internalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::INTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n $externalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::EXTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n return ResponseHelper::findSuccess('Explorations Data', [\n 'internalPrescriptionsSales' => $internalPrescriptions,\n 'externalPrescriptionsSales' => $externalPrescriptions,\n ]);\n }", "public function reOpen_Orders_get() {\n extract($_GET);\n $result = $this->feeds_model->reOpen_Orders($order_id);\n return $this->response($result);\n }", "function getOrdersData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n $total=0;\n if($varAction=='today' || $varAction=='yesterday'){\n if($varAction=='today'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n \n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $arrClms = array('TIME(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded < \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$i]['time'][]=$arrData;\n $arrRes['data'][$i]['count']=$count;\n $total +=$count;\n }\n $arrRes['total']=$total;\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_week'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$count;\n $total +=$count;\n }\n $arrRes['total']=$total;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_month'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $lastMonth.'=='.$lastMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$count;\n $total +=$count; \n }\n $arrRes['total']=$total;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "public function list_client_desc(){\n\n$this->db->order_by(\"year\", \"desc\");\n\t\n$result\t= $this->db->get('client');\n\n\t\treturn $result->result();\t\n}", "protected function getLastYearScope($src_bu) {\n $currentTime = date('Y-m', time());\n //get Arr of last year but same month\n $lastYearArr = array();\n $lastYearFinal = array();\n for ($i = 0; $i < 12; $i++) {\n $lastYearArr[$i] = date('Y-m', strtotime('-1 year, +' . $i . ' month', strtotime($currentTime)));\n }\n foreach ($lastYearArr as $key => $ly) {\n $daysOfMonth = date('t', strtotime($ly));\n $lastYearFinal[$key] = $ly . '-' . $daysOfMonth;\n }\n\n $em = $this->getDoctrine()->getManager();\n $qb = $em->createQueryBuilder();\n $qb->select('date')\n ->from('AlbatrossDailyBundle:Date', 'date')\n ->leftJoin('date.bu', 'bu');\n if ($src_bu == null) {\n $qb->where('bu.id is null');\n } else {\n $qb->where('bu.id = :bid');\n $qb->setParameter('bid', $src_bu->getId());\n }\n $qb->andWhere('date.dailydate IN (:dayArr)')\n ->setParameter('dayArr', $lastYearFinal);\n $query = $qb->getQuery();\n $result = $query->getArrayResult();\n\n $dateIdArr = array();\n foreach ($result as $re) {\n $dateIdArr[] = $re['id'];\n }\n $scopeQb = $em->createQueryBuilder();\n $scopeQb->select('number', 'date2')\n ->from('AlbatrossDailyBundle:Number', 'number')\n ->leftJoin('number.date', 'date2')\n ->leftJoin('number.status', 'status')\n ->where('date2.id IN (:dateId)')\n ->setParameter('dateId', $dateIdArr)\n ->andWhere('status.id = 1');\n $scopeQuery = $scopeQb->getQuery();\n $scopeResult = $scopeQuery->getArrayResult();\n $temp = array_flip($lastYearFinal);\n foreach ($scopeResult as $s) {\n $temp[$s['date']['dailydate']->format('Y-m-d')] = $s['number'];\n }\n $final = array();\n foreach ($temp as $key => $f) {\n if (is_int($f)) {\n $temp[$key] = '0';\n }\n $final[] = $temp[$key];\n }\n\n return $final;\n }", "public function getOrder(): array;", "function getOrder();", "private function getOrdersArray(){\n $connection = new Connection();\n $link = $connection->connect();\n $my_id = $this->user->getId();\n $count = $link->query(\"SELECT count(*) FROM transaction WHERE registered_for = '$my_id'\")->fetchColumn();\n if($count > 0){\n $result = $link->query(\"SELECT id FROM transaction WHERE registered_for = '$my_id' ORDER BY date_registered DESC LIMIT $this->ordersCount\");\n $orders = [];\n while($record = $result->fetch()){\n $orders[] = $record;\n }\n $connection = null;\n return $orders;\n }\n else{\n return FALSE;\n }\n }", "function getOrders() {\r\n $b2b_orders = getOrdersFromB2B();\r\n //GET ORDERS FROM B2C\r\n $b2c_orders = getOrdersFromB2C();\r\n //COMBINE ORDERS\r\n $today_orders = array_merge($b2b_orders, $b2c_orders);\r\n \r\n $restaurant_array = array();\r\n \r\n foreach($today_orders as $order ) {\r\n $restaurant = array(\r\n \"id\" => '',\r\n \"orders\"=> array(),\r\n );\r\n if ( count($restaurant_array) == 0 ) {\r\n $restaurant[\"id\"] = $order[\"restaurant_id\"];\r\n array_push($restaurant[\"orders\"], $order);\r\n array_push($restaurant_array, $restaurant);\r\n } else {\r\n foreach($restaurant_array as &$array_item) {\r\n if ( $array_item[\"id\"] == $order[\"restaurant_id\"] ) {\r\n array_push($array_item[\"orders\"], $order);\r\n continue 2;\r\n }\r\n }\r\n $restaurant[\"id\"] = $order[\"restaurant_id\"];\r\n array_push($restaurant[\"orders\"], $order);\r\n array_push($restaurant_array, $restaurant);\r\n }\r\n }\r\n \r\n return $restaurant_array;\r\n}" ]
[ "0.61164427", "0.5987768", "0.5911272", "0.58855456", "0.5795916", "0.57806545", "0.5758788", "0.5743868", "0.57264215", "0.5662732", "0.56624943", "0.5649392", "0.56460464", "0.56296027", "0.56075716", "0.554253", "0.55382454", "0.5533397", "0.5504726", "0.5494692", "0.5493129", "0.5490246", "0.5485609", "0.5449642", "0.54160994", "0.5415095", "0.5411985", "0.5411481", "0.54065436", "0.5400094", "0.5397761", "0.5393934", "0.5393872", "0.53756493", "0.53745896", "0.53728443", "0.5338096", "0.53362703", "0.5327351", "0.529365", "0.5277897", "0.5237134", "0.521966", "0.5195578", "0.5185319", "0.51832205", "0.5178328", "0.5177008", "0.51742876", "0.5171838", "0.5169043", "0.516691", "0.5153577", "0.51529634", "0.51464367", "0.51440376", "0.51384914", "0.513742", "0.5133047", "0.5129735", "0.51257885", "0.51227766", "0.5116631", "0.5108755", "0.51056266", "0.5093735", "0.5091599", "0.50825477", "0.50820494", "0.5076501", "0.50737566", "0.50602096", "0.50520426", "0.5039899", "0.5037631", "0.5027759", "0.50272125", "0.5024766", "0.5021573", "0.50159615", "0.50119287", "0.5008674", "0.5004377", "0.5002144", "0.49977943", "0.49958658", "0.49895808", "0.4988419", "0.4984404", "0.49813873", "0.49804133", "0.49795702", "0.49791497", "0.4974094", "0.4970704", "0.49676353", "0.4955407", "0.49547026", "0.4949264", "0.49442804" ]
0.62975216
0
Get paid amount last 24 hours
public function getAmountsDataLast24Hours($vendorId) { $to = $this->_date->date('Y-m-d H:i:s'); $from = strtotime($to."-24hours"); $from = $this->_date->date('Y-m-d H:i:s', $from); $orderResource = $this->_vendorOrderFactory->create()->getResource(); $data = $orderResource->getAmountsByHour($from, $to, $vendorId); $result = $this->_processOrderData($data); $result = array_values($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPaymentAuthExpiration();", "public static function get24HoursAgo(){\n return date('Y-m-d H:i:s',strtotime(\"-1 days\"));\n }", "public function getExpiration();", "public function getRelativeExpiration(): \\DateInterval;", "public function getTotalPaid();", "public function getExpiration()\n {\n }", "public function getPaidAt(): Carbon\n {\n return $this->paidAt;\n }", "private function getLastPayPeriodEnd(){ $myq = getCurrentPayPeriod();\r\n $result = getQueryResult($this->config, $myq, $debug = false);\r\n $ppArray = $result->fetch_assoc();\r\n $startDate = $ppArray['PPBEG'];\r\n $this->lastPayStart = date('Y-m-d', strtotime('-14 days', strtotime($startDate)));\r\n $endDate = $ppArray['PPEND'];\r\n $this->lastPayEnd = date('Y-m-d', strtotime('-14 days', strtotime($endDate)));\r\n\r\n return $endDate;\r\n }", "public function getPaidDurationHours(): ?float\n {\n return $this->paidDurationHours;\n }", "public function getPaymentDate();", "public function getRemainingHoursOfNewOrd(){\n return 0;\n }", "public function getExpiration()\n {\n return $this->getCreated()->add(new DateInterval('P2W'));\n }", "public function getExpired();", "public function getAmtPaid()\n {\n return $this->amt_paid;\n }", "public function getExpirationDate();", "public function getAmtPaidSat()\n {\n return $this->amt_paid_sat;\n }", "public static function getPayDate() {\n return new DateTime(date(\"Ymd H:i:s\", strtotime('+ 7 days')));\n }", "public function getMonthlyFee();", "function expiredTime($modified_date){\n $diff = abs(time()-strtotime($modified_date));\n if ($diff < 0)$diff = 0;\n $dl = floor($diff/60/60/24);\n $hl = floor(($diff - $dl*60*60*24)/60/60);\n $ml = floor(($diff - $dl*60*60*24 - $hl*60*60)/60);\n $sl = floor(($diff - $dl*60*60*24 - $hl*60*60 - $ml*60));\n // OUTPUT\n\t\t\t $hl = ($dl *24)+$hl;\n $return = array('hours'=>$hl, 'minutes'=>$ml, 'seconds'=>$sl);\n return $return;\n\t}", "function getTimeOrderPay(){\n\treturn campo('config_system','id','1','time_in_minutes_pending_order_payable');\n}", "function getTimeOrderPay(){\n\treturn campo('config_system','id','1','time_in_minutes_pending_order_payable');\n}", "public function getExpired() {\n\t\t\n\t}", "public function getHoursToDeposit()\n {\n return $this->hoursToDeposit;\n }", "public function getExpiration()\n {\n // expire now\n return new \\DateTime();\n }", "public function getBaseTotalPaid();", "public function getAmountPaid()\n {\n return $this->amountPaid instanceof TypedMoneyBuilder ? $this->amountPaid->build() : $this->amountPaid;\n }", "private function getPayum()\n {\n return $this->get('payum');\n }", "public function getExpirationDate(): int;", "public function getOnHoldExpiration()\n {\n return $this->getParameter('onHoldExpiration');\n }", "function getMemberExpiryDate($userId) {\r\n $sql = $this->db->prepare(\"SELECT expiry FROM USER WHERE UserID=:user_id\");\r\n $sql->execute(array('user_id' => $userId));\r\n return $sql->fetch(PDO::FETCH_ASSOC);\r\n }", "function last24hours()\r\n{\r\n\tglobal $CURUSER, $last24cache, $last24record ;\r\n\r\n\t$last24cache\t= ROOT_DIR.'/cache/last24/'.date('dmY').'.txt';\r\n\t$last24record\t= ROOT_DIR.'/cache/last24record.txt';\r\n\t$_last24\t\t= (file_exists($last24cache) ? unserialize(file_get_contents($last24cache)) : array());\r\n\t$_last24record\t= (file_exists($last24record) ? unserialize(file_get_contents($last24record)) : array('num'=>0,'date'=>0));\r\n\r\n\tif(!isset($_last24[$CURUSER['id']]) || empty($_last24[$CURUSER['id']]))\r\n\t{\r\n\t\t$_last24[$CURUSER['id']] = array($CURUSER['username'],$CURUSER['class']);\r\n\t\t$_newcount = count($_last24);\r\n\r\n\t\tif(isset($_last24record['num']) && $_last24record['num']<$_newcount)\r\n\t\t{\r\n\t\t\t$_last24record['num'] = $_newcount;\r\n\t\t\t$_last24record['date'] = time();\r\n\r\n\t\t\tfile_put_contents($last24record,serialize($_last24record));\r\n\t\t}\r\n\t\t\tfile_put_contents($last24cache,serialize($_last24));\r\n\t}\r\n}", "private function getExpiration()\n {\n return (self::EXPIRATION_IN_MINUTES * 60);\n }", "public function getLastpaymentamount()\n {\n return $this->lastpaymentamount;\n }", "public function getDownTimeToday(){\n return Notification::calculateDailyDowntime($this);\n }", "public function getForRestApi()\n {\n $dateForApi = new Tiramizoo_Shipping_Model_Date($this->get());\n $sign = strpos($dateForApi->get('P'), '+') == 0 ? '-' : '+';\n\n $dateForApi->modify($sign . (intval($dateForApi->get('Z')) / 3600) . ' hours');\n\n return $dateForApi->get('Y-m-d\\TH:i:s\\Z');\n }", "public function upcomingCredit()\n {\n $where = \"(SELECT DATEDIFF(po.`due_date`, '$this->curDate') AS days) < 14 AND po.`status_paid` = 0\";\n $po = $this->db\n ->from('purchase_order po')\n ->join('principal p', 'p.id_principal = po.id_principal')\n ->where($where)\n ->order_by('po.id_purchase_order asc')\n ->get()\n ->result();\n return $po;\n }", "public function upcomingDebit()\n {\n $where = \"(SELECT DATEDIFF(so.`due_date`, '$this->curDate') AS days) < 14 AND so.`status_paid` = 0 AND so.active = 1\";\n $so = $this->db\n ->from('sales_order so')\n ->join('customer c', 'c.id_customer = so.id_customer')\n ->where($where)\n ->order_by('so.id_sales_order asc')\n ->get()\n ->result();\n\n return $so;\n }", "public function getAmountPaid()\n {\n $amountPaid = 0;\n if ($this->payments) {\n foreach ($this->payments as $payment) {\n if ($payment->getStatus() == 'OK') {\n $amountPaid = $amountPaid + $payment->getAmount();\n }\n }\n }\n return $amountPaid;\n }", "public function getPaidMoney()\n {\n $money = new Money($this->paidAmount, $this->paidCurrency);\n return $money;\n }", "protected function getExpiration()\n {\n return $this->expiration;\n }", "public static function getAmountEndDay()\n {\n return static::getAmountSeconds(strtotime(\"tomorrow\") - 1);\n }", "function get_amount($date) {\n global $debug;\n $val = null;\n $money = 0;\n //if ($debug) { echo \"comparing value range for this object: \"; print_r($item); }\n foreach ($this->list as $item) {\n if ($item->includes($date)) {\n $val = $item;\n }\n }\n if (!$val) {\n return $money;\n }\n $period = $val->period;\n switch ($period) {\n case 'weekly':\n // this is only debited once every week.\n // make sure it is a multiple of 1 week offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 7 == 0) {\n $money = $val->amount;\n }\n break;\n case 'biweekly':\n // this is only debited once every 2 weeks.\n // make sure it is a multiple of 2 weeks offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 14 == 0) {\n $money = $val->amount;\n }\n break;\n case 'monthly': \n // this is debited once per month\n // make sure the day of month matches the day from $val->extra\n $day_amount = date('d', strtotime($val->extra));\n $day_this = date('d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'semiannual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_amount_semi = date('m-d', strtotime(\"+6 months\", strtotime($val->extra)));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount || $day_this == $day_amount_semi) {\n $money = $val->amount;\n }\n break;\n case 'annual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'once':\n // make sure date matches exactly with $val->extra\n if ($date == $val->extra) {\n $money = $val->amount;\n }\n break;\n case 'daily':\n // always return the same value\n $money = $val->amount;\n break;\n default:\n throw new Exception(\"unkown period '$period'\");\n }\n if ($debug) {\n printf(\"get_amount($date) $val->period, $val->amount, $val->extra -> $money\\n\");\n }\n return $money;\n }", "public function getRemainingTime()\n {\n return $this->isExpired() ? 0\n : ($this->getExpirationDate()->getTimestamp() - time());\n }", "public function getLastPaymentDate(): \\DateTime\n {\n return $this->lastPaymentDate;\n }", "public function soonToExpire()\n {\n $fifteen_before = Carbon::now()->subMinutes(15)->toDateTimeString();\n $fifteen_later = Carbon::now()->addMinutes(15)->toDateTimeString();\n\n return $this->getModel()->whereBetween('expires_at', [$fifteen_before, $fifteen_later])->get();\n }", "function getDateExpiration() {\n return $this->dateExpiration;\n }", "public function expirationAfter(): ?int;", "public function getDueDateTime();", "public function getExpiration()\n {\n return $this->expiration;\n }", "public function getExpiration()\n {\n return $this->expiration;\n }", "function subtractDaysFromFutureToCurrent($mySQLFormatFutureDate)\n{\n $eDate = new DateTime($mySQLFormatFutureDate);\n $expiryDate= $eDate->format('Y-m-d');\n\n $now = time(); // or your date as well\n $your_date = strtotime($expiryDate);\n $datediff = $now - $your_date;\n return abs(floor($datediff/(60*60*24)));\n \n \n}", "public function getCacheExpiry()\n {\n return $this->cachePeriod;\n }", "public function getTotalDue();", "public function getOrdersDataLast24Hours($vendorId)\n {\n $to = $this->_date->date('Y-m-d H:i:s');\n $from = strtotime($to.\"-24hours\");\n $from = $this->_date->date('Y-m-d H:i:s', $from);\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getNumOfOrderByHour($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function paid()\n {\n $this->paidAmount = $this->price;\n }", "public function iN_CurrentDayTotalPremiumEarning() {\n\t\t$query = mysqli_query($this->db, \"SELECT SUM(admin_earning) AS DayTotalEarnPremium FROM i_user_payments WHERE payment_type = 'post' AND payment_status = 'ok' AND DAY(FROM_UNIXTIME(payment_time)) = DAY(CURDATE()) \") or die(mysqli_error($this->db));\n\t\t$row = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\treturn isset($row['DayTotalEarnPremium']) ? $row['DayTotalEarnPremium'] : '0.00';\n\t}", "public function pay();", "protected function getNowDeliveryTime()\n {\n $nowTime = new DateTime(null, new DateTimeZone(\"UTC\"));\n $deliveryTime = strtotime('+1 hour +30 minutes', strtotime($nowTime->format('Y-m-d H:i:s')));\n\n $preparationTime = Mage::getStoreConfig('carriers/' . Vaimo_UrbIt_Model_System_Config_Source_Environment::CARRIER_CODE . '/order_now_validation_time');\n\n if ($preparationTime) {\n $deliveryTime += (int)$preparationTime * 60;\n }\n\n $nextPossible = new DateTime();\n $nextPossible->setTimestamp($deliveryTime);\n\n return $nextPossible->format(\"Y-m-d H:i:s\");\n }", "public function getCapturedAmount();", "function amountOfAvailablePrizesToday($conn)\n{\n $amount = 0;\n if (isSunday() && !isLastSunday()) {\n $amount = 7;\n } else {\n $amount = 8;\n }\n return ($amount - todaysSentPrizes($conn));\n}", "public function getPayee()\r\n {\r\n return $this->payee;\r\n }", "public function getPaymentAmount()\n {\n return $this->bonus + parent::getSalary();\n }", "function simplesamlphp_get_expires ($view, $entry = array()) {\n $now = time();\n if (array_key_exists('expire', $entry)) {\n if ($entry['expire'] < $now) {\n $value = number_format(($now - $entry['expire'])/3600, 1);\n return '(expired ' . $value . ' hours ago)';\n }\n $value = number_format(($entry['expire'] - $now)/3600, 1);\n return '(expires in ' . $value . ' hours)';\n }\n}", "public function getFormattedExpirationDate();", "function getDateResponseDue() {\n\t\treturn $this->getData('dateResponseDue');\n\t}", "public function getAmtPaidMsat()\n {\n return $this->amt_paid_msat;\n }", "public static function expiration()\n {\n return strtotime( \"+\" . self::EXPIRATION );\n }", "public static function passwordless_get_expiration( $user_id ) {\n\t\tglobal $wpdb;\n\t\t$sql = \"SELECT expires FROM {$wpdb->base_prefix}pp_passwordless WHERE user_id = $user_id\";\n\n\t\treturn $wpdb->get_var( $sql );\n\t}", "function loanExpire(){\n\tglobal $driver;\n\t$sql\t=\t\"SELECT loanduration FROM settings\"; //Retrieve the maximum days the loanee will be given before being flagged as a defaulter\n\tif($loanexpire\t=\t$driver->perform_request($sql)):\n\t\t$row\t=\t$driver->load_data($loanexpire);\n\t\t$maxdays\t=\t($row['loanduration']>0)?($row['loanduration']):30; //Retrieved loan duration\n\telse:\n\t\tdie('<p class=\"error\">ERROR Retrieving Loan duration.<br/>'.mysql_error().'</p>');\n\tendif;\n\treturn $maxdays; //The maximum days before loan is pushed to arrear\n}", "public function getDateExpiration()\n {\n return $this->DateExpiration;\n }", "public function getExpiration() {\n return $this->expiration;\n }", "public function getPayee()\n {\n return $this->payee;\n }", "public function getExpireTime()\n {\n return $this->get(self::_EXPIRE_TIME);\n }", "public function getExpireTime()\n {\n return $this->get(self::_EXPIRE_TIME);\n }", "public function getExpireTime()\n {\n return $this->get(self::_EXPIRE_TIME);\n }", "public function getExpireTime()\n {\n return $this->get(self::_EXPIRE_TIME);\n }", "public function pay_hourly_invoice($invoice_id='', $project_id='', $user_id=''){\n\t\t$msg = array();\n\t\t$error = 0;\n\t\t$total_cost_new = 0;\n\t\t$invoice_row = get_row(array('select' =>'*', 'from' => 'invoice_main' , 'where' => array('invoice_id' => $invoice_id)));\n\t\t\n\t\t$invoice_number = $invoice_row['invoice_number'];\n\t\t$tracker_rows = get_results(array('select' =>'*', 'from' => 'project_tracker' , 'where' => array('invoice_id' => $invoice_id, 'payment_status <>' => 'P')));\n\t\t\n\t\t$freelancer_id = $invoice_row['sender_id'];\n\t\t$freelancer_wallet_id = get_user_wallet($freelancer_id);\n\t\t\n\t\t$tracker_ids = array();\n\t\t\n\t\tif(count($tracker_rows) > 0){\n\t\t\tforeach($tracker_rows as $tracker_row){\n\t\t\t\t$tracker_ids[] = $tracker_row['id'];\n\t\t\t\t\n\t\t\t\t$bid_row=get_row(array('select'=>'total_amt,pausedcontract','from'=>'bids', 'where'=>array('project_id'=>$project_id,'bidder_id'=>$tracker_row['worker_id'])));\n\t\t\t\t\n\t\t\t\t$client_amt = $bid_row['total_amt'];\n\t\t\t\t$minute_cost_min = ($client_amt/60);\n\t\t\t\t$total_min_cost = $minute_cost_min *floatval($tracker_row['minute']);\n\t\t\t\t$cost_n=(($client_amt*floatval($tracker_row['hour']))+$total_min_cost);\n\t\t\t\t$cost_n=round($cost_n , 2);\n\t\t\t\t$total_cost_new += $cost_n;\n\t\t\t}\n\t\t\t\n\t\t\t$total_deposit = get_project_deposit($project_id);\n\t\t\t$total_release = get_project_release_fund($project_id);\n\t\t\t$total_pending = get_project_pending_fund($project_id);\n\t\t\t$remaining_bal = $total_deposit - $total_release - $total_pending;\n\t\t\t\n\t\t\t$remaining_deposit = $total_deposit - $total_release;\n\t\t\t\n\t\t\t$commission = (($total_cost_new * SITE_COMMISSION) / (100 + SITE_COMMISSION)) ; \n\t\t\t\n\t\t\tif($remaining_deposit < $total_cost_new){\n\t\t\t\t// employer has no enough balance in his deposit\n\t\t\t\t$diff = ($total_cost_new - $remaining_deposit);\n\t\t\t\t$diff_str = CURRENCY.''.number_format($diff , 2);\n\t\t\t\t\n\t\t\t\t$employer_wallet_id = get_user_wallet($user_id);\n\t\t\t\t$wallet_bal = CURRENCY.''.get_wallet_balance($employer_wallet_id);\n\t\t\t\t\n\t\t\t\t$link = base_url('projectroom/add_process_invoice?project_id='.$project_id.'&invoice_id='.$invoice_id);\n\t\t\t\n\t\t\t\t\n\t\t\t\t$html = '<div><b>'.$diff_str.'</b> is needed in your deposit to process this invoice. Current wallet balance <b>'.$wallet_bal.'</b> <a href=\"'.$link .'\">click here</a> to add fund and process invoice </div>';\n\t\t\t\t$msg['msg'] = '<div class=\"info-error\">Not enough balance in your project deposit</div>'.$html;\n\t\t\t\t$msg['status']=0;\n\t\t\t\t$error++;\n\t\t\t}\n\t\t\t\n\t\t\tif($error == 0){\n\t\t\t\t\n\t\t\t\t$this->load->helper('invoice');\n\t\t\t\t\n\t\t\t\t$user_info = get_row(array('select' => 'user_id,fname,lname,email','from' => 'user', 'where' => array('user_id' => $invoice_row['sender_id'])));\n\t\t\t\t$freelancer_fname = $user_info['fname'];\n\t\t\t\t$sender_info = array(\n\t\t\t\t\t'name' => SITE_TITLE,\n\t\t\t\t\t'address' => ADMIN_ADDRESS,\n\t\t\t\t);\n\t\t\t\t$receiver_info = array(\n\t\t\t\t\t'name' => $user_info['fname'].' '.$user_info['lname'],\n\t\t\t\t\t'address' => getUserAddress($user_info['user_id']),\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$invoice_data = array(\n\t\t\t\t\t'sender_id' => 0,\n\t\t\t\t\t'receiver_id' => $user_info['user_id'],\n\t\t\t\t\t'invoice_type' => 3,\n\t\t\t\t\t'sender_information' => json_encode($sender_info),\n\t\t\t\t\t'receiver_information' => json_encode($receiver_info),\n\t\t\t\t\t'receiver_email' => $user_info['email'],\n\t\t\t\t\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$inv_id = create_invoice($invoice_data); // creating invoice\n\t\t\t\t\n\t\t\t\t$invoice_row_data = array(\n\t\t\t\t\t'invoice_id' => $inv_id,\n\t\t\t\t\t'description' => 'Commission - ' . SITE_COMMISSION . '% for invoice number #'.$invoice_number,\n\t\t\t\t\t'per_amount' => $commission,\n\t\t\t\t\t'unit' => '-',\n\t\t\t\t\t'quantity' => 1,\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\tadd_invoice_row($invoice_row_data); // adding invoice row\n\t\t\t\t\n\t\t\t\tadd_project_invoice($project_id, $inv_id);\n\t\t\t\t\n\t\t\t\t$this->load->model('myfinance/transaction_model');\n\t\t\t\t\n\t\t\t\t$ref = $invoice_id;\n\t\t\t\t\n\t\t\t\t// transaction insert\n\t\t\t\t$new_txn_id = $this->transaction_model->add_transaction(FREELANCER_PAYMENT_ESCROW, $user_id);\n\t\t\t\t\n\t\t\t\t$this->transaction_model->add_transaction_row(array('txn_id' => $new_txn_id, 'wallet_id' => ESCROW_WALLET, 'debit' => $total_cost_new, 'ref' => $ref , 'info' => 'Project payment to '.$freelancer_fname.' #'.$project_id));\n\t\t\t\t\n\t\t\t\t$this->transaction_model->add_transaction_row(array('txn_id' => $new_txn_id, 'wallet_id' => $freelancer_wallet_id, 'credit' => $total_cost_new, 'ref' => $ref , 'info' => 'Project payment received #'.$project_id));\n\t\t\t\t\n\t\t\t\t$new_txn_id_2 = $this->transaction_model->add_transaction(COMMISSION, $freelancer_id, 'Y', $inv_id);\n\t\t\t\t\n\t\t\t\t$this->transaction_model->add_transaction_row(array('txn_id' => $new_txn_id_2, 'wallet_id' => $freelancer_wallet_id, 'debit' => $commission, 'ref' => $inv_id , 'info' => 'Commission paid #'.$project_id));\n\t\t\t\t\n\t\t\t\t$this->transaction_model->add_transaction_row(array('txn_id' => $new_txn_id_2, 'wallet_id' => PROFIT_WALLET, 'credit' => $commission , 'ref' => $inv_id, 'info' => 'Commission received #'.$project_id));\n\t\t\t\t\n\t\t\t\twallet_less_fund(ESCROW_WALLET, $total_cost_new);\n\t\t\t\n\t\t\t\twallet_add_fund($freelancer_wallet_id, ($total_cost_new-$commission));\n\t\t\t\twallet_add_fund(PROFIT_WALLET, $commission);\n\t\t\t\t\n\t\t\t\tcheck_wallet($freelancer_wallet_id, $new_txn_id);\n\t\t\t\t\n\t\t\t\tcheck_wallet(ESCROW_WALLET, $new_txn_id);\n\t\t\t\tcheck_wallet(PROFIT_WALLET, $new_txn_id);\n\t\t\t\t\n\t\t\t\t$this->db->where_in('id', $tracker_ids)->update('project_tracker', array('status' => '1', 'payment_status' => 'P', 'commission_invoice_id' => $inv_id));\n\t\t\t\t\n\t\t\t\t$project_txn = array(\n\t\t\t\t\t'project_id' => $project_id,\n\t\t\t\t\t'txn_id' => $new_txn_id,\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$this->db->insert('project_transaction', $project_txn);\n\t\t\t\t\n\t\t\t\t$this->db->where('invoice_id', $invoice_id)->update('invoice_main', array('is_paid' => date('Y-m-d H:i:s')));\n\t\t\t\t$this->db->where('invoice_id', $inv_id)->update('invoice_main', array('is_paid' => date('Y-m-d H:i:s')));\n\t\t\t\t\n\t\t\t\t$msg['status']=1;\n\t\t\t}\n\t\t\t\n\n\t\t}\n\t\t\n\t\treturn $msg;\n\t}", "public function getPayDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->payDate;\r\n\t}", "function getLastPaymentDataForUser($liuAccountID, $dbh)\n\t{\n\t\t$responseObject\t\t\t\t\t\t\t\t= array();\n\t\t$responseObject['paymentDataFound']\t\t\t= false;\n\t\t\n\t\ttry\n\t\t{\t\n\t\t\t$getInfoFromLastPayment\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= $dbh -> prepare(\"SELECT\n\tPaymentHistory.paymentHistoryEventID,\n\tPaymentHistory.FK_AccountID,\n\tPaymentHistory.paymentMethod,\n\tAES_DECRYPT(PaymentHistory.encryptedFirstName, UNHEX(SHA2('b9Gf98252c8!0aea1f(31c4c753d351',512))) AS decryptedFirstName,\n\tAES_DECRYPT(PaymentHistory.encryptedLastName, UNHEX(SHA2('b9Gf98252c8!0aea1f(31c4c753d351',512))) AS decryptedLastName,\t\n\tAES_DECRYPT(PaymentHistory.encryptedAddressOne, UNHEX(SHA2('b9Gf98252c8!0aea1f(31c4c753d351',512))) AS decryptedAddressOne,\t\n\tPaymentHistory.FK_CityID,\n\tPaymentHistory.FK_StateID,\n\tAES_DECRYPT(PaymentHistory.encryptedZipCode, UNHEX(SHA2('b9Gf98252c8!0aea1f(31c4c753d351',512))) AS decryptedZipCode,\t\n\tPaymentHistory.FK_CountryID,\n\tCountries.isoAlpha3Code AS countryAbbreviation,\n\tCities.cityName,\n\tStates.stateName,\n\tAES_DECRYPT(PaymentHistory.encryptedExpirationMonth, UNHEX(SHA2('b9Gf98252c8!0aea1f(31c4c753d351',512))) AS decryptedExpirationMonth,\t\n\tAES_DECRYPT(PaymentHistory.encryptedExpirationYear, UNHEX(SHA2('b9Gf98252c8!0aea1f(31c4c753d351',512))) AS decryptedExpirationYear,\t\n\tAES_DECRYPT(PaymentHistory.encryptedLastFourDigits, UNHEX(SHA2('b9Gf98252c8!0aea1f(31c4c753d351',512))) AS decryptedLastFourDigits,\n\tPaymentHistory.wasPaid,\n\tPaymentHistory.FK_PlanTypeID,\n\tPaymentPlanTypes.paymentPlanName,\n\tPaymentHistory.FK_CardTypeID,\n\tCardType.cardTypeLabel\nFROM\n\tPaymentHistory\n\tINNER JOIN Countries ON PaymentHistory.FK_CountryID = Countries.countryID \n\tINNER JOIN Cities ON PaymentHistory.FK_CityID = Cities.cityID \n\tINNER JOIN States ON PaymentHistory.FK_StateID = States.stateID\n\tINNER JOIN PaymentPlanTypes ON PaymentHistory.FK_PlanTypeID = PaymentPlanTypes.paymentPlanTypeID AND PaymentPlanTypes.languageCode = 'EN'\n\tINNER JOIN CardType ON PaymentHistory.FK_CardTypeID = CardType.cardTypeID AND CardType.languageCode = 'EN'\nWHERE\n\tPaymentHistory.FK_AccountID = :accountID\nORDER BY\n\tPaymentHistory.paymentDateTime DESC\nLIMIT 1\");\n\t\t\n\t\t\t$getInfoFromLastPayment -> bindValue(':accountID', $liuAccountID);\n\t\t\t\t\t\t\t\n\t\t\tif ($getInfoFromLastPayment -> execute() && $getInfoFromLastPayment -> rowCount() > 0)\n\t\t\t{\n\t\t\t\t$responseObject['paymentDataFound']\t\t\t\t\t\t\t\t\t\t\t\t= true;\n\t\t\t\t$responseObject['resultMessage']\t\t\t\t\t\t\t\t\t\t\t\t= \"Found last payment method information for user $liuAccountID\";\n\t\t\t\t\n\t\t\t\t$row \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= $getInfoFromLastPayment -> fetchObject();\n\t\t\t\t\n\t\t\t\t$loadedAccountID\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= $row -> FK_AccountID;\n\t\t\t\t$responseObject['accountID']\t\t\t\t\t\t\t\t\t\t\t\t\t= $liuAccountID;\n\t\t\t\t\n\t\t\t\tif ($loadedAccountID == $liuAccountID)\n\t\t\t\t{\n\t\t\t\t\t$responseObject['paymentHistoryEventID']\t\t\t\t\t\t\t\t\t= $row -> paymentHistoryEventID;\n\t\t\t\t\t$responseObject['paymentMethod']\t\t\t\t\t\t\t\t\t\t\t= $row -> paymentMethod;\n\t\t\t\t\t$responseObject['firstNameOnCard']\t\t\t\t\t\t\t\t\t\t\t= $row -> decryptedFirstName;\n\t\t\t\t\t$responseObject['lastNameOnCard']\t\t\t\t\t\t\t\t\t\t\t= $row -> decryptedLastName;\n\t\t\t\t\t$responseObject['addressStreet']\t\t\t\t\t\t\t\t\t\t\t= $row -> decryptedAddressOne;\n\t\t\t\t\t$responseObject['addressCityName']\t\t\t\t\t\t\t\t\t\t\t= $row -> cityName;\n\t\t\t\t\t$responseObject['addressStateName']\t\t\t\t\t\t\t\t\t\t\t= $row -> stateName;\n\t\t\t\t\t$responseObject['zipCode']\t\t\t\t\t\t\t\t\t\t\t\t\t= $row -> decryptedZipCode;\n\t\t\t\t\t$responseObject['countryCode']\t\t\t\t\t\t\t\t\t\t\t\t= $row -> FK_CountryID;\n\t\t\t\t\t$responseObject['countryAbbreviation']\t\t\t\t\t\t\t\t\t\t= $row -> countryAbbreviation;\n\t\t\t\t\t$responseObject['ccExpirationMonth']\t\t\t\t\t\t\t\t\t\t= $row -> decryptedExpirationMonth;\n\t\t\t\t\t$responseObject['ccExpirationYear']\t\t\t\t\t\t\t\t\t\t\t= $row -> decryptedExpirationYear;\n\t\t\t\t\t$responseObject['ccLastFourDigits']\t\t\t\t\t\t\t\t\t\t\t= $row -> decryptedLastFourDigits;\n\t\t\t\t\t$responseObject['wasPaid']\t\t\t\t\t\t\t\t\t\t\t\t\t= $row -> wasPaid;\t\n\t\t\t\t\t$responseObject['FK_PlanTypeID']\t\t\t\t\t\t\t\t\t\t\t= $row -> FK_PlanTypeID;\t\n\t\t\t\t\t$responseObject['paymentPlanName']\t\t\t\t\t\t\t\t\t\t\t= $row -> paymentPlanName;\n\t\t\t\t\t$responseObject['FK_CardTypeID']\t\t\t\t\t\t\t\t\t\t\t= $row -> FK_CardTypeID;\t\n\t\t\t\t\t$responseObject['cardTypeName']\t\t\t\t\t\t\t\t\t\t\t\t= $row -> cardTypeLabel;\n\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$responseObject['resultMessage']\t\t\t\t\t\t\t\t\t\t\t\t= \"No payment method information found for user $liuAccountID\";\n\t\t\t}\t\n\t\t}\n\t catch (PDOException $e) \n\t {\n\t \t$responseObject['resultMessage']\t\t\t\t\t\t\t\t\t\t\t\t\t= \"Error: Could not retrieve payment method information for account $liuAccountID due to a database error: \".$e->getMessage();\t\n\t\t\t\n\t\t\terrorLog($e->getMessage());\n\t\t}\n\t\t\n\t\treturn $responseObject;\t\n\t}", "public static function getLastItemAmount($clientId, $hours = 24, $typeId = '') {\n $db = DI::getDefault()->getShared('db');\n\n // 1 출금보낸 모든\n // 2 수신받은 모든\n // 3 이건...?\n if($typeId == 1){\n $query = \"SELECT SUM(`sendQuantity`) FROM `\" . self::getTableNameStatic() . \"` WHERE `typeId` = ? AND `senderId` = ? AND `regTime` >= ?\";\n $data = $db->query($query, array(Transaction::Type_Withdrawal, $clientId, date('Y-m-d H:i:s', (time() - ($hours * 60 * 60) ) )) )->fetch();\n }elseif($typeId == 2 ){\n $query = \"SELECT SUM(`receiveQuantity`) FROM `\" . self::getTableNameStatic() . \"` WHERE `typeId` = ? AND `senderId` = ? AND `regTime` >= ?\";\n $data = $db->query($query, array(Transaction::Type_Receive, $clientId, date('Y-m-d H:i:s', (time() - ($hours * 60 * 60) ) )) )->fetch();\n } else {\n return 0;\n /*$query = \"SELECT COUNT(`id`) FROM `\" . self::getTableNameStatic() . \"` WHERE `senderId` = ? AND `regTime` >= ?\";\n $data = $db->query($query, array($clientId, date('Y-m-d H:i:s', (time() - ($hours * 60 * 60) ) )) )->fetch();*/\n }\n return $data[0];\n\n }", "function calculatePay($hours, $wage){\n global $errorCount;\n global $overtime;\n if($hours > 168){\n echo \"You can't work more than 168 hours in a week.<br>\";\n $errorCount++;\n $hours = 168;\n } else if($hours > 100){\n //if they are working more than 100 hours a week, they need sleep.\n echo \"You need sleep.<br>\";\n }\n $overtime = $hours - 40;\n $pay = $hours * $wage;\n if($overtime >= 0){\n $pay += $overtime * $wage/2;\n }\n $pay = round($pay,2);\n $pay = number_format($pay,2);\n return $pay;\n }", "function payDay(){\n\t\t$totalStaffCost = 0;\n\t\t// get all memeber's weekly salary and add them together\n\t\tforeach($this->urlms->getLab_index(0)->getStaffMembers() as $member){\n\t\t\t$totalStaffCost += $member->getWeeklySalary();\n\t\t}\n\t\tdate_default_timezone_set('America/New_York');\n\t\t$date = date('m/d/Y', time());\n\t\t$this->addTransaction(\"Staff Funding\", \"PAYDAY\", $totalStaffCost, \"expense\", $date);\n\t\treturn $totalStaffCost;\n\t}", "public static function earnedTillNow($user) // what would i do that, worker can be not paid for several weeks?\n\t{\n\t\t$from = self::earnedTillNowFrom($user);\n\t\t$till = date('Y-m-d H:i:s'); // now\n\n\t\treturn self::amount($user, $from, $till);\n\t}", "public function expiryDate();", "public function updatePay(): int {\n if ($this->amtDue === $this->amtPayed) {\n $this->state = State::PAYED;\n $this->appt->state = State::DONE;\n $this->appt->updateTime = new \\DateTime();\n $this->appt->update();\n }\n if ($this->amtDue < $this->amtPayed) {\n $this->amtPayed = $this->amtDue;\n $this->state = State::PAYED;\n $this->appt->state = State::DONE;\n $this->appt->updateTime = new \\DateTime();\n $this->appt->update();\n }\n $this->updateTime = new \\DateTime();\n return self::update();\n }", "public function getPaidValue()\n {\n return defined('static::PAID_VALUE') ? static::PAID_VALUE : 'paid';\n }", "public function getLastbuy()\n {\n return $this->get(self::_LASTBUY);\n }", "public function getExpiredAttribute()\n {\n return $this->subscription_payment\n && ! is_null($this->paid_at)\n && $this->paid_at->lessThan(now()->subDays(60))\n && (is_null($this->payments_required) || $this->payments_made < $this->payments_required);\n }", "function store_order_paid(Order $order)\n {\n if ($order->order_owing < 0) {\n return '<span class=\"store_order_paid_over\">'.lang('store.overpaid').'</span>';\n } elseif ($order->order_owing == 0) {\n return '<span class=\"store_order_paid_yes\">'.lang('yes').'</span>';\n } elseif ($order->order_paid > 0) {\n return store_currency($order->order_paid);\n } else {\n return lang('no');\n }\n }", "public function getExpirationTime()\n {\n return $this->expiration_time;\n }", "public function getExpirationTime()\n {\n return $this->expiration_time;\n }", "public function getUsersGrowthStatisticsByYesterday($accountId)\n {\n $url = $this->weconnectDomain . \"/accounts/$accountId/statistics/users/growth/keyIndicator\";\n\n $result = $this->_curl(self::METHOD_GET, $url, 'admin');\n\n //format date\n if (!empty($result)) {\n $result['refDate'] = $this->_formatTime($result['refDate'], 'Y-m-d');\n }\n return $result;\n }", "function warquest_daily_bonus() {\r\n\r\n\t/* input */\r\n\tglobal $config;\r\n\t\r\n\t/* output */\r\n\tglobal $player;\r\n\tglobal $page;\r\n\t\t\r\n\tif ($player->holiday_date > date(\"Y-m-d H:i:s\", time())) {\r\n\t\r\n\t\t/* No bonus if holiday is activated! */\r\n\t\treturn;\r\n\t}\r\n\t\t\t\t\r\n\tif (date(\"Y-m-d\",strtotime( $player->bonus_date)) != date(\"Y-m-d\")) {\r\n\t\r\n\t\t/* Update last_login date for player with long session (>24h) */\r\n\t\t$member = warquest_db_member($player->pid);\r\n\t\t$member->last_login = date(\"Y-m-d H:i:s\");\t\t\t\t\r\n\t\twarquest_db_member_update($member);\r\n\t\t\t\t\r\n\t\t/* Add bonus */\r\n\t\t$money = $config[\"init_money\"] * $player->lid * rand(20,40);\r\n\r\n\t\t$player->bonus_date = date(\"Y-m-d H:i:s\");\r\n\t\t$player->money += $money;\r\n\t\t\r\n\t\t$log = 'Daily bonus '.number_format2($money);\t\t\r\n\t\twarquest_user_log($player, $log);\r\n\t\r\n\t\t/* Create message */\r\n \t\tif ($money>0) {\r\n\t\t\t$message = t('HOME_DAILY_BONUS', money_format1($money) );\t\t\r\n\t\t\t$page .= warquest_box_icon(\"info\", $message);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t/* One year WarQuest bonus */\r\n\t\tif ( date(\"Y-m-d\", strtotime(\"08-02-2012\")) == date(\"Y-m-d\") ) {\r\n\t\t\t\r\n\t\t\t$skill = warquest_db_skill($player->pid);\r\n\t\t\t$skill->skill_points+= 10;\r\n\t\t\twarquest_db_skill_update($skill);\r\n\t\t\t\r\n\t\t\t$bonus = 10000000000;\r\n\t\t\t$player->bank1+=$bonus;\t\t\r\n\t\t\twarquest_db_bank_insert($player->pid, 0, 1, $bonus, $player->bank1, 6);\t\t\t\t\r\n\t\t}\t\r\n\t}\t\t\r\n}", "public function getExpirationTime() {\n return $this->shareData[\"expire\"];\n }", "function getExpirationOffset($prj_id)\n {\n $backend =& self::_getBackend($prj_id);\n return $backend->_getExpirationOffset();\n }", "public function getPaymentPrice() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->paymentPrice;\r\n\t}", "public function retryUntil()\n {\n return now()->addHours(2);\n }", "public function getBookingPeriodPricing(Period $period)\n {\n $bookingPeriod = $this->getBookingPeriod($period);\n\n return $bookingPeriod->purchasedAt;\n }", "function get_expiry() {\n\t\treturn $this->get_expiry_from_vtec();\n\t}", "public function getLastpaymentdate()\n {\n return $this->lastpaymentdate;\n }" ]
[ "0.61048967", "0.60730714", "0.591904", "0.58494616", "0.5784993", "0.5761473", "0.5740352", "0.57386655", "0.5713298", "0.569081", "0.5685817", "0.5662327", "0.5628338", "0.5580329", "0.556388", "0.5526758", "0.551033", "0.5495572", "0.54939234", "0.54702985", "0.54702985", "0.5469474", "0.54572135", "0.5440343", "0.54070854", "0.53928024", "0.53846467", "0.53711116", "0.5357357", "0.53381264", "0.53322726", "0.5307598", "0.52887213", "0.52638316", "0.5261815", "0.52564925", "0.5253167", "0.52487445", "0.5243997", "0.52418715", "0.5216023", "0.5208199", "0.5200065", "0.5172853", "0.51676816", "0.5167628", "0.5166982", "0.5159051", "0.5152647", "0.5152647", "0.51478237", "0.5142448", "0.51380885", "0.51271296", "0.51233137", "0.5115775", "0.511219", "0.50880164", "0.50867194", "0.50801575", "0.5078667", "0.50751084", "0.5072048", "0.50676155", "0.5066214", "0.5048722", "0.50463104", "0.5037536", "0.50346494", "0.50310665", "0.50170094", "0.5014263", "0.5012475", "0.5012475", "0.5012475", "0.5012475", "0.49989492", "0.49894837", "0.49871713", "0.4984928", "0.49824435", "0.498143", "0.49791616", "0.49788463", "0.49781537", "0.49750972", "0.4970701", "0.49705887", "0.49594402", "0.49487537", "0.49487537", "0.49451616", "0.49404907", "0.4936257", "0.49289706", "0.49252006", "0.4924273", "0.49230096", "0.4922457", "0.49175015" ]
0.54435486
23
Get paid amount last 7 days
public function getAmountsDataLast7Days($vendorId) { $to = $this->_date->date('Y-m-d'); $from = strtotime($to."-7days"); $from = $this->_date->date('Y-m-d', $from); $to .= ' 23:59:59'; $orderResource = $this->_vendorOrderFactory->create()->getResource(); $data = $orderResource->getAmountsByDay($from, $to, $vendorId); $result = $this->_processOrderData($data); $result = array_values($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getPayDate() {\n return new DateTime(date(\"Ymd H:i:s\", strtotime('+ 7 days')));\n }", "public function getMonthlyFee();", "function getProfitLastWeek(){\n global $db;\n \n $get = getWeek();//Pulls most recent week from purchasing table\n $week = $get['week'];\n \n $stmt=$db->prepare(\"SELECT SUM(revenue) - SUM(expense) AS 'profit' FROM invoices WHERE week = :week\");\n \n $binds=array(\n \":week\"=>$week\n );\n $results= false;\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n }\n return $results;\n }", "public function upcomingDebit()\n {\n $where = \"(SELECT DATEDIFF(so.`due_date`, '$this->curDate') AS days) < 14 AND so.`status_paid` = 0 AND so.active = 1\";\n $so = $this->db\n ->from('sales_order so')\n ->join('customer c', 'c.id_customer = so.id_customer')\n ->where($where)\n ->order_by('so.id_sales_order asc')\n ->get()\n ->result();\n\n return $so;\n }", "private function getLastPayPeriodEnd(){ $myq = getCurrentPayPeriod();\r\n $result = getQueryResult($this->config, $myq, $debug = false);\r\n $ppArray = $result->fetch_assoc();\r\n $startDate = $ppArray['PPBEG'];\r\n $this->lastPayStart = date('Y-m-d', strtotime('-14 days', strtotime($startDate)));\r\n $endDate = $ppArray['PPEND'];\r\n $this->lastPayEnd = date('Y-m-d', strtotime('-14 days', strtotime($endDate)));\r\n\r\n return $endDate;\r\n }", "public function upcomingCredit()\n {\n $where = \"(SELECT DATEDIFF(po.`due_date`, '$this->curDate') AS days) < 14 AND po.`status_paid` = 0\";\n $po = $this->db\n ->from('purchase_order po')\n ->join('principal p', 'p.id_principal = po.id_principal')\n ->where($where)\n ->order_by('po.id_purchase_order asc')\n ->get()\n ->result();\n return $po;\n }", "public function getTotalPaid();", "function payDay(){\n\t\t$totalStaffCost = 0;\n\t\t// get all memeber's weekly salary and add them together\n\t\tforeach($this->urlms->getLab_index(0)->getStaffMembers() as $member){\n\t\t\t$totalStaffCost += $member->getWeeklySalary();\n\t\t}\n\t\tdate_default_timezone_set('America/New_York');\n\t\t$date = date('m/d/Y', time());\n\t\t$this->addTransaction(\"Staff Funding\", \"PAYDAY\", $totalStaffCost, \"expense\", $date);\n\t\treturn $totalStaffCost;\n\t}", "function get_amount($date) {\n global $debug;\n $val = null;\n $money = 0;\n //if ($debug) { echo \"comparing value range for this object: \"; print_r($item); }\n foreach ($this->list as $item) {\n if ($item->includes($date)) {\n $val = $item;\n }\n }\n if (!$val) {\n return $money;\n }\n $period = $val->period;\n switch ($period) {\n case 'weekly':\n // this is only debited once every week.\n // make sure it is a multiple of 1 week offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 7 == 0) {\n $money = $val->amount;\n }\n break;\n case 'biweekly':\n // this is only debited once every 2 weeks.\n // make sure it is a multiple of 2 weeks offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 14 == 0) {\n $money = $val->amount;\n }\n break;\n case 'monthly': \n // this is debited once per month\n // make sure the day of month matches the day from $val->extra\n $day_amount = date('d', strtotime($val->extra));\n $day_this = date('d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'semiannual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_amount_semi = date('m-d', strtotime(\"+6 months\", strtotime($val->extra)));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount || $day_this == $day_amount_semi) {\n $money = $val->amount;\n }\n break;\n case 'annual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'once':\n // make sure date matches exactly with $val->extra\n if ($date == $val->extra) {\n $money = $val->amount;\n }\n break;\n case 'daily':\n // always return the same value\n $money = $val->amount;\n break;\n default:\n throw new Exception(\"unkown period '$period'\");\n }\n if ($debug) {\n printf(\"get_amount($date) $val->period, $val->amount, $val->extra -> $money\\n\");\n }\n return $money;\n }", "function amountOfAvailablePrizesToday($conn)\n{\n $amount = 0;\n if (isSunday() && !isLastSunday()) {\n $amount = 7;\n } else {\n $amount = 8;\n }\n return ($amount - todaysSentPrizes($conn));\n}", "function getReportLastWeek(){\n global $db;\n \n $get = getWeekSale();//Pulls most recent week from purchasing table\n $week = $get['week'];\n \n $stmt=$db->prepare(\"SELECT week, SUM(expense) AS 'expense', SUM(revenue) AS 'revenue' FROM invoices WHERE week = :week\");\n \n $binds=array(\n \":week\"=>$week\n );\n $results= false;\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n }\n return $results;\n }", "public function getLastSevenDaysRevenue() {\n $userClient = Auth::user()->clientID;\n\n if($userClient == 1) {\n \t\n $result = DB::select(\"SELECT calendar.datefield AS DATE,IFNULL(SUM(r.amount),0) AS total FROM request_logs r RIGHT JOIN calendar ON (DATE(r.date_created) = calendar.datefield) inner join transactions t on t.requestlogID = r.requestlogID inner join client_channels_reference ccr on t.channel_ref_id=ccr.channel_ref_id GROUP BY DATE DESC LIMIT 7\");\n } else {\n\n $result = DB::select(\"SELECT calendar.datefield AS DATE,IFNULL(SUM(r.amount),0) AS total FROM request_logs r RIGHT JOIN calendar ON (DATE(r.date_created) = calendar.datefield) inner join transactions t on t.requestlogID = r.requestlogID inner join client_channels_reference ccr on t.channel_ref_id=ccr.channel_ref_id WHERE ccr.clientID='$userClient' or ccr.destinationClientID='$userClient' GROUP BY DATE DESC LIMIT 7\");\n }\n\n \treturn $result;\n\n }", "public function weekly_deposits()\n\t{\n\t\t// $date->format('Y-m-d'); \n\n\t\t// $date = strtotime(\"-6 day\");\n\t\t // date(\"Y-m-d\", $date);\n\t\t \n\t\t$today = date(\"Y-m-d\");\n\t\t$newDate = date(\"Y-m-d\",strtotime($today.\"-6 day\"));\n\t\t\n\t\t//`date_transaction` BETWEEN '$newDate' AND '$today'\n\t\t//OR\n\t\t//`date_transaction` > DATE_SUB(NOW(), INTERVAL 1 WEEK)\t\n\t\t\n\t\t$query = $this->db->prepare(\"SELECT * FROM `statement` WHERE `credit` <> 0 AND `date_transaction` > DATE_SUB(NOW(), INTERVAL 1 WEEK) ORDER BY `date_transaction` DESC\");\n\n\t\ttry{\n\t\t\t\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchAll();\n\t\t\t\n\t\t\t\n\t\t}catch(PDOException $e){\n\t\t\tdie($e->getMessage());\n\t\t}\n\n\t}", "public function getBaseTotalPaid();", "public function get_storage_cost(){\n $number_of_days = $this->get_days_spent();\n $total_debit = 0;\n\n //cost for first week\n if ($number_of_days <= 7) {\n $total_debit += $number_of_days * 10.0;\n } else {\n $number_of_days = $number_of_days - 7;\n $total_debit += 7 * 10.0;\n\n //cost for second week\n if ($number_of_days <= 7) {\n $total_debit += $number_of_days * 20.0;\n }else {\n $number_of_days = $number_of_days - 7;\n $total_debit += 7 * 20.0;\n\n //for third week onwards\n $total_debit += $number_of_days * 30.0;\n }\n }\n return $total_debit;\n }", "public function getAmountPaid()\n {\n return $this->amountPaid instanceof TypedMoneyBuilder ? $this->amountPaid->build() : $this->amountPaid;\n }", "public function getPaymentDate();", "public function getTotalDue();", "public function getAmtPaidSat()\n {\n return $this->amt_paid_sat;\n }", "public function getMonthlyFee(): float { return 2.0; }", "function getDateResponseDue() {\n\t\treturn $this->getData('dateResponseDue');\n\t}", "public function getDaysToFullPayment()\n {\n return $this->daysToFullPayment;\n }", "public function getAdditionalDays()\n {\n $config = $this->scopeConfig->getValue(\n 'payment/az2009_cielo_bank_slip/additional_days',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n\n $config = intval($config);\n $config = \"P{$config}D\";\n\n return $config;\n }", "private function getCalculatedDate(){\n date_default_timezone_set('GMT+1');//@todo get the information from system\n\n $oneDay = 86400;//seconds\n $numDays = 7; //default are 7 days\n $today = strtotime('now');\n\n if(!empty($this->settings['flexform']['countDays'])){\n $numDays = $this->settings['flexform']['countDays'];\n }\n\n //calcaulate date\n $date = date(\"d.m.Y\",$today-($numDays * $oneDay));\n\n return $date;\n }", "public function get_recurring_period(){\n\t\treturn $this->payment['recurring_period'];\n\t}", "public function getRaisedAmount() {\n $sql = sprintf(\"SELECT SUM(amount) AS total_amount FROM donation WHERE project_id = %d;\", $this->id);\n $results = self::$connection->execute($sql);\n $total_amount = $results[0][\"total_amount\"];\n return $total_amount ? $total_amount : 0;\n }", "public function getAmtPaid()\n {\n return $this->amt_paid;\n }", "public function get_last7Days($type, $array_data, $auth) {\n $date = date('Y-m-d', strtotime('-7 days'));\n $today = date('Y-m-d');\n\n if ($type == 1) {\n\n $exception = '';\n $exception2 = '';\n if ($auth['id'] == '2') {\n $exception = ' AND affiliate=\"0\"';\n //$exception2 = ' WHERE affiliate=\"0\" AND insertDate=\"' . $today . '\"';\n }\n\n //last 7 days\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE insertDate >= \"' . $date . '\"' . $exception . ' GROUP BY insertDate');\n\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n /*\n //today\n //clicks\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, SUM( clicks ) AS clicks FROM MainReport INNER JOIN Sources ON source=Sources.id ' . $exception2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n //conversions\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id ' . $exception2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n /*\n //last 7 days\n $statement = $this->getDi()->getDb()->prepare('SELECT insert_date as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM Agr__MainReport INNER JOIN tinas__Sources ON source=tinas__Sources.id WHERE insert_date >= \"' . $date . '\"' . $exception . ' GROUP BY insert_date');\n\n $exe = $this->getDi()->getDb()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n //today\n //clicks\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS clicks FROM ClicksDaily INNER JOIN Sources ON fkSource=Sources.id ' . $exception2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n //conversions\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS conversions, SUM( ccpa ) AS revenue FROM ConversionsDaily INNER JOIN Sources ON fkSource=Sources.id ' . $exception2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n\n foreach ($array_ret as $key => $value) {\n $cr = $value['conversions'] / $value['clicks'];\n\n $array_ret[$key]['cr'] = $cr;\n\n $array_ret[$key]['revenue'] = number_format($array_ret[$key]['revenue'], 2, '.', '');\n $array_ret[$key]['cr'] = number_format($array_ret[$key]['cr'] * 100, 3, '.', '');\n }\n\n //$cr = $array_ret_conversions[0]['conversions'] / $array_ret_clicks[0]['clicks'];\n //array_push($array_ret, array('date' => $array_ret_clicks[0]['date'] , 'clicks' => $array_ret_clicks[0]['clicks'], 'conversions' => $array_ret_conversions[0]['conversions'], 'revenue' => number_format($array_ret_conversions[0]['revenue'], 2, '.', ''), 'cr' => $cr * 100));\n\n return $array_ret;\n } else if ($type == 2) {\n\n $sql = '';\n\n if ($array_data[0]['sources'] != '') {\n $sources = str_replace(',', '\",\"', $auth['sources']);\n $sources = ' AND source IN (\"' . $sources . '\")';\n $sql .= $sources;\n }\n\n if ($array_data[0]['countries'] != '') {\n $countries = str_replace(',', '\",\"', $auth['countries']);\n $countries = ' AND campaign_country IN (\"' . $countries . '\")';\n $sql .= $countries;\n }\n\n if ($array_data[0]['aggregators'] != '') {\n $aggregators = str_replace(',', '\",\"', $auth['aggregators']);\n $aggregators = ' AND agregator IN (\"' . $aggregators . '\")';\n $sql .= $aggregators;\n }\n\n /*\n //last 7 days\n\n $statement = $this->getDi()->getDb()->prepare('SELECT insert_date as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM Agr__MainReport INNER JOIN tinas__Sources ON source=tinas__Sources.id WHERE insert_date >= \"' . $date . '\" ' . $sql . ' AND affiliate=\"0\" GROUP BY insert_date');\n $exe = $this->getDi()->getDb()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n */\n\n //last 7 days\n $sqlstr = 'SELECT insertDate as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE insertDate >= \"' . $date . '\" ' . $sql . ' AND affiliate=\"0\" GROUP BY insertDate';\n //mail('[email protected]', 'str', $sqlstr);\n $statement = $this->getDi()->getDb4()->prepare($sqlstr);\n\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n /*\n //today\n //clicks\n $sql = '';\n if($array_data[0]['sources'] != '') {\n $sources = str_replace(',', '\",\"', $auth['sources']);\n $sources = (($sql != \"\")) ? (' AND source IN (\"' . $sources . '\")') : (' WHERE source IN (\"' . $sources . '\")');\n $sql .= $sources;\n }\n\n if($array_data[0]['countries'] != '') {\n $countries = str_replace(',', '\",\"', $auth['countries']);\n $countries = (($sql != \"\")) ? (' AND campaign_country IN (\"' . $countries . '\")') : (' WHERE campaign_country IN (\"' . $countries . '\")');\n $sql .= $countries;\n }\n\n if($array_data[0]['aggregators'] != '') {\n $aggregators = str_replace(',', '\",\"', $auth['aggregators']);\n $aggregators = (($sql != \"\")) ? (' AND agregator IN (\"' . $aggregators . '\")') : (' WHERE agregator IN (\"' . $aggregators . '\")');\n $sql .= $aggregators;\n }\n\n $date = (($sql != \"\")) ? (' AND insertDate=\"' . $today . '\"') : (' WHERE insertDate =\"' . $today . '\"');\n $sql .= $date;\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS clicks FROM MainReport ' . $sql);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS clicks FROM ClicksDaily ' . $sql);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n //conversions\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS conversions, SUM( ccpa ) AS revenue FROM ConversionsDaily ' . $sql);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n //conversions\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS conversions, SUM( revenue ) AS revenue FROM MainReport ' . $sql);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n foreach ($array_ret as $key => $value) {\n $cr = $value['conversions'] / $value['clicks'];\n\n $array_ret[$key]['cr'] = $cr;\n\n $array_ret[$key]['revenue'] = number_format($array_ret[$key]['revenue'], 2, '.', '');\n $array_ret[$key]['cr'] = number_format($array_ret[$key]['cr'] * 100, 3, '.', '');\n }\n\n //$cr = ($array_ret_clicks[0]['clicks'] == 0) ? 0 : ($array_ret_conversions[0]['conversions'] / ($array_ret_clicks[0]['clicks']));\n //array_push($array_ret, array('date' => $array_ret_clicks[0]['date'] , 'clicks' => $array_ret_clicks[0]['clicks'], 'conversions' => $array_ret_conversions[0]['conversions'], 'revenue' => number_format($array_ret_conversions[0]['revenue'], 2, '.', ''), 'cr' => $cr * 100));\n\n return $array_ret;\n } else if ($type == 3) {\n //last 7 days\n /*\n $statement = $this->getDi()->getDb()->prepare('SELECT insert_date as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM Agr__MainReport INNER JOIN tinas__Sources ON source=tinas__Sources.id WHERE insert_date >= \"' . $date . '\" AND affiliate=\"1\" GROUP BY insert_date');\n $exe = $this->getDi()->getDb()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE insertDate >= \"' . $date . '\" AND affiliate=\"1\" GROUP BY insertDate');\n\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n /*\n //today\n //clicks\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS clicks FROM ClicksDaily INNER JOIN Sources ON fkSource=Sources.id WHERE affiliate=\"1\"');\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS clicks FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE affiliate=\"1\" AND insertDate=\"' . $today . '\"');\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n //conversions\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS conversions, SUM( ccpa ) AS revenue FROM ConversionsDaily INNER JOIN Sources ON fkSource=Sources.id WHERE affiliate=\"1\"');\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE affiliate=\"1\" AND insertDate=\"' . $today . '\"');\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n foreach ($array_ret as $key => $value) {\n $cr = $value['conversions'] / (($value['clicks'] == 0) ? 1 : $value['clicks']);\n\n $array_ret[$key]['cr'] = $cr;\n\n $array_ret[$key]['revenue'] = number_format($array_ret[$key]['revenue'], 2, '.', '');\n $array_ret[$key]['cr'] = number_format($array_ret[$key]['cr'] * 100, 3, '.', '');\n }\n\n //$cr = ($array_ret_clicks[0]['clicks'] == 0) ? 0 : ($array_ret_conversions[0]['conversions'] / ($array_ret_clicks[0]['clicks']));\n //array_push($array_ret, array('date' => $array_ret_clicks[0]['date'] , 'clicks' => $array_ret_clicks[0]['clicks'], 'conversions' => $array_ret_conversions[0]['conversions'], 'revenue' => number_format($array_ret_conversions[0]['revenue'], 2, '.', ''), 'cr' => $cr * 100));\n\n return $array_ret;\n } else if ($type == 4) {\n\n\n $sqlDb = '';\n $sqlDb2 = '';\n if ($array_data[0]['sources'] != '') {\n $sources = str_replace(',', '\",\"', $auth['sources']);\n $sqlDb .= ' AND source IN (\"' . $sources . '\") ';\n //$sqlDb2 .= ' AND source IN (\"' . $sources . '\") AND insertDate=\"' . $today . '\"';\n }\n\n //last 7 days\n /*\n $statement = $this->getDi()->getDb()->prepare('SELECT insert_date as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM Agr__MainReport INNER JOIN tinas__Sources ON source=tinas__Sources.id WHERE insert_date >= \"' . $date . '\" AND affiliate=\"2\" ' . $sqlDb . ' GROUP BY insert_date');\n $exe = $this->getDi()->getDb()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE insertDate >= \"' . $date . '\" AND affiliate=\"2\" ' . $sqlDb . ' GROUP BY insertDate');\n\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n /*\n //today\n //clicks\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS clicks FROM ClicksDaily INNER JOIN Sources ON fkSource=Sources.id WHERE affiliate=\"2\" ' . $sqlDb2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS clicks FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE affiliate=\"2\" ' . $sqlDb2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n //conversions\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS conversions, SUM( ccpa ) AS revenue FROM ConversionsDaily INNER JOIN Sources ON fkSource=Sources.id WHERE affiliate=\"2\" ' . $sqlDb2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE affiliate=\"2\" ' . $sqlDb2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n foreach ($array_ret as $key => $value) {\n $cr = $value['conversions'] / (($value['clicks'] == 0) ? 1 : $value['clicks']);\n\n $array_ret[$key]['cr'] = $cr;\n\n $array_ret[$key]['revenue'] = number_format($array_ret[$key]['revenue'], 2, '.', '');\n $array_ret[$key]['cr'] = number_format($array_ret[$key]['cr'] * 100, 3, '.', '');\n }\n\n //$cr = $array_ret_conversions[0]['conversions'] / $array_ret_clicks[0]['clicks'];\n //array_push($array_ret, array('date' => $array_ret_clicks[0]['date'] , 'clicks' => $array_ret_clicks[0]['clicks'], 'conversions' => $array_ret_conversions[0]['conversions'], 'revenue' => number_format($array_ret_conversions[0]['revenue'], 2, '.', ''), 'cr' => $cr * 100));\n\n return $array_ret;\n } else if ($type == 5) {\n\n $sqlDb = '';\n $sqlDb2 = '';\n if ($array_data[0]['aggregators'] != '') {\n $aggregators = str_replace(',', '\",\"', $auth['aggregators']);\n $sqlDb .= ' AND agregator IN (\"' . $aggregators . '\") ';\n //$sqlDb2 .= ' WHERE agregator IN (\"' . $aggregators . '\") AND insertDate=\"' . $today . '\"';\n }\n\n //last 7 days\n /*\n $statement = $this->getDi()->getDb()->prepare('SELECT insert_date as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM Agr__MainReport WHERE insert_date >= \"' . $date . '\" ' . $sqlDb . ' GROUP BY insert_date');\n $exe = $this->getDi()->getDb()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n $sqlstr = 'SELECT insertDate as date, SUM( clicks ) AS clicks, SUM( conversions ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id WHERE insertDate >= \"' . $date . '\" ' . $sqlDb . ' GROUP BY insertDate';\n $statement = $this->getDi()->getDb4()->prepare($sqlstr);\n //mail('[email protected]', 'sql', $sqlstr);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n /*\n //today\n //clicks\n\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS clicks FROM ClicksDaily INNER JOIN Sources ON fkSource=Sources.id ' . $sqlDb2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS clicks FROM MainReport INNER JOIN Sources ON source=Sources.id ' . $sqlDb2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_clicks = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n\n //conversions\n /*\n $statement = $this->getDi()->getDb2()->prepare('SELECT insertdate AS date, COUNT( * ) AS conversions, SUM( ccpa ) AS revenue FROM ConversionsDaily INNER JOIN Sources ON fkSource=Sources.id ' . $sqlDb2);\n $exe = $this->getDi()->getDb2()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n\n $statement = $this->getDi()->getDb4()->prepare('SELECT insertDate AS date, COUNT( * ) AS conversions, SUM( revenue ) AS revenue FROM MainReport INNER JOIN Sources ON source=Sources.id ' . $sqlDb2);\n $exe = $this->getDi()->getDb4()->executePrepared($statement, array(), array());\n $array_ret_conversions = $exe->fetchAll(PDO::FETCH_ASSOC);\n */\n\n foreach ($array_ret as $key => $value) {\n $cr = $value['conversions'] / (($value['clicks'] == 0) ? 1 : $value['clicks']);\n\n $array_ret[$key]['cr'] = $cr;\n\n $array_ret[$key]['revenue'] = number_format($array_ret[$key]['revenue'], 2, '.', '');\n $array_ret[$key]['cr'] = number_format($array_ret[$key]['cr'] * 100, 3, '.', '');\n }\n\n //$cr = $array_ret_conversions[0]['conversions'] / $array_ret_clicks[0]['clicks'];\n //array_push($array_ret, array('date' => $array_ret_clicks[0]['date'] , 'clicks' => $array_ret_clicks[0]['clicks'], 'conversions' => $array_ret_conversions[0]['conversions'], 'revenue' => number_format($array_ret_conversions[0]['revenue'], 2, '.', ''), 'cr' => $cr * 100));\n\n return $array_ret;\n }\n }", "public function getPaidAt(): Carbon\n {\n return $this->paidAt;\n }", "function ultimo_dia_periodo() { \n\n $sql=\"select fecha_fin from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql); \n return $resul[0]['fecha_fin'];\n }", "function getPayments(){\n $earlyPayment = 0;\n $regularPayment = 0;\n $latePayment = 0;\n \n // Separate fee payments into early, regular, late deadlines\n $this->totalFinAid = 0;\n $payments = payment::getSchoolPayments($this->schoolId);\n for($i = 0; $i < sizeof($payments); $i++){\n $payment = new payment($payments[$i]);\n if($payment->finaid == '1') $this->totalFinAid += $payment->amount;\n if($payment->startedTimeStamp<=generalInfoReader('earlyRegDeadline')){\n $earlyPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('earlyRegDeadline') && $payment->startedTimeStamp<=generalInfoReader('regularRegDeadline')){\n $regularPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('regularRegDeadline')){\n $latePayment += intval($payment->amount);\n }\n }\n // Check when school fee was paid\n if($earlyPayment>=generalInfoReader('earlySchoolFee') || $this->numStudents <= 5){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n\t } else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($earlyPayment+$regularPayment>=generalInfoReader('regularSchoolFee')){\n $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t$this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n\n\t}elseif($earlyPayment+$regularPayment+$latePayment>=generalInfoReader('lateSchoolFee')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }else{ // School fee was not paid\n $curTime = time();\n if($curTime<=generalInfoReader('earlyRegDeadline')){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n \t} else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('earlyRegDeadline') && $curTime<=generalInfoReader('regularRegDeadline')){\n\t $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t $this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('regularRegDeadline')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }\n }\n\t\n // Small delegations don't pay school fees\n if($this->numStudents <=5 && $this->numAdvisers){\n $this->schoolFee = 0;\n }\n\t\n\t//Chosun doesn't pay\n\tif(strpos(strtolower($this->schoolName),\"chosun\") !== False || strpos(strtolower($this->schoolName),\"worldview\") !== False){\n\t $this->schoolFee = 0;\n\t $this->delegateFee = 0;\n\t}\n\n // Calculating numbers\n $this->totalPaid = $earlyPayment + $regularPayment + $latePayment - $this->totalFinAid;\n $this->delegateFeeTotal = $this->numStudents*$this->delegateFee;\n $mealTicket = new mealTicket($this->schoolId);\n $this->mealTicketTotal = $mealTicket->totalCost;\n \n $this->schoolFeePaid = 0;\n $this->schoolFeeOwed = 0;\n $this->delegateFeePaid = 0;\n $this->delegateFeeOwed = 0;\n $this->mealTicketPaid = 0;\n $this->mealTicketOwed = 0;\n if($this->totalPaid < $this->schoolFee){\n // Haven't paid school fee\n $this->schoolFeePaid = $this->totalPaid;\n $this->schoolFeeOwed = $this->schoolFee - $this->totalPaid;\n $this->delegateFeeOwed = $this->delegateFeeTotal;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }elseif($this->totalPaid + $this->totalFinAid < $this->schoolFee + $this->delegateFeeTotal){\n // Have paid school fee but not delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->totalPaid + $this->totalFinAid - $this->schoolFee;\n $this->delegateFeeOwed = $this->delegateFeeTotal - $this->delegateFeePaid;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }else{\n // Have paid school and delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->delegateFeeTotal;\n $this->mealTicketPaid = min($this->mealTicketTotal, $this->totalPaid + $this->totalFinAid - $this->schoolFee - $this->delegateFeeTotal);\n $this->mealTicketOwed = $this->mealTicketTotal - $this->mealTicketPaid;\n }\n $this->totalFee = $this->schoolFee + $this->delegateFeeTotal + $this->mealTicketTotal;\n $this->totalOwed = $this->totalFee - $this->totalFinAid - $this->totalPaid;\n \n\t//Create formatted versions:\n\t$this->totalFeeFormatted = '$'.money_format('%.2n',$this->totalFee);\n\t$this->totalPaidFormatted = '$'.money_format('%.2n',$this->totalPaid);\n\t$this->totalOwedFormatted = '$'.money_format('%.2n',$this->totalOwed);\n\n\n\t$this->schoolFeeFormatted = '$'.money_format('%.2n',$this->schoolFee);\n\t$this->schoolFeePaidFormatted = '$'.money_format('%.2n',$this->schoolFeePaid);\n\t$this->schoolFeeOwedFormatted = '$'.money_format('%.2n',$this->schoolFeeOwed);\n\t\n\t$this->delegateFeeFormatted = '$'.money_format('%.2n',$this->delegateFee);\n\t$this->delegateFeeTotalFormatted = '$'.money_format('%.2n',$this->delegateFeeTotal);\n\t$this->delegateFeePaidFormatted = '$'.money_format('%.2n',$this->delegateFeePaid);\n\t$this->delegateFeeOwedFormatted = '$'.money_format('%.2n',$this->delegateFeeOwed);\n\n\t$this->totalFinAidFormatted = '$'.money_format('%.2n',$this->totalFinAid);\n\n\n // Calculate Payment Due Date\n if($this->delegateFee == generalInfoReader('earlyDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('earlyRegDeadline');\n if($this->delegateFee == generalInfoReader('regularDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('regularRegDeadline');\n if($this->delegateFee == generalInfoReader('lateDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('lateRegDeadline');\n $this->totalPaymentDue = generalInfoReader('paymentDueDate');\n\t\n }", "public function weekly_withdrawals()\n\t{\n\t\t// $date->format('Y-m-d'); \n\n\t\t// $date = strtotime(\"-6 day\");\n\t\t // date(\"Y-m-d\", $date);\n\t\t \n\t\t$today = date(\"Y-m-d\");\n\t\t$newDate = date(\"Y-m-d\",strtotime($today.\"-6 day\"));\n\t\t\n\t\t//`date_transaction` BETWEEN '$newDate' AND '$today'\n\t\t//OR\n\t\t//`date_transaction` > DATE_SUB(NOW(), INTERVAL 1 WEEK)\t\n\t\t\n\t\t$query = $this->db->prepare(\"SELECT * FROM `statement` WHERE `debit` <> 0 AND `date_transaction` > DATE_SUB(NOW(), INTERVAL 1 WEEK) ORDER BY `date_transaction` DESC\");\n\n\t\ttry{\n\t\t\t\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchAll();\n\t\t\t\n\t\t\t\n\t\t}catch(PDOException $e){\n\t\t\tdie($e->getMessage());\n\t\t}\n\n\t}", "public function getAmountPaid()\n {\n $amountPaid = 0;\n if ($this->payments) {\n foreach ($this->payments as $payment) {\n if ($payment->getStatus() == 'OK') {\n $amountPaid = $amountPaid + $payment->getAmount();\n }\n }\n }\n return $amountPaid;\n }", "public function getSubtotalRefunded();", "function get_umur($no_medrec){\n\t\t\treturn $this->db->query(\"select datediff(now(),tgl_lahir) as umurday from data_pasien where no_medrec='$no_medrec'\");\n\t\t}", "public function getFee(){\r\n\t\treturn $this->fee;\r\n\t}", "function recalculateRebillDate()\n {\n if (is_null($this->tm_started) || in_array($this->status, array(self::RECURRING_FAILED, self::RECURRING_FINISHED, self::RECURRING_CANCELLED))) {\n $this->updateQuick('rebill_date', null);\n return;\n }\n $date = null;\n $c = $this->getPaymentsCount();\n if ($this->first_total <= 0)\n $c++; // first period is \"fake\" because it was free trial\n //if ($c < $this->getExpectedPaymentsCount()) // not yet done with rebills\n if ($this->rebill_times > ($c - 1)) { // not yet done with rebills\n // we count starting from first payment date, we rely on tm_started field here\n if ($this->first_total <= 0)\n list($date, ) = explode(' ', $this->tm_started);\n else\n $date = $this->getAdapter()\n ->selectCell(\"SELECT MIN(dattm) FROM ?_invoice_payment WHERE invoice_id=?d\", $this->invoice_id);\n $date = date('Y-m-d', strtotime($date));\n\n $period1 = new Am_Period($this->first_period);\n $date = $period1->addTo($date);\n $period2 = new Am_Period($this->second_period);\n for ($i = 1; $i < $c; $i++) { // we skip first payment here, already added above\n $date = $period2->addTo($date);\n }\n // If date is in the past, something is wrong here. Now we try to calculate rebill date from user's last payment.\n if ($date < $this->getDi()->dateTime->format('Y-m-d')) {\n\n $last_payment_date = $this->getAdapter()\n ->selectCell(\"SELECT MAX(dattm) FROM ?_invoice_payment WHERE invoice_id=?d\", $this->invoice_id);\n if ($last_payment_date) {\n\n $period = new Am_Period($this->second_period);\n $date = date('Y-m-d', strtotime($last_payment_date));\n $date = $period->addTo($date);\n }\n // date is in the past again; Use tomorrow's date instead;\n $restore_limit_date = $this->getDi()->dateTime;\n $restore_limit_date->modify('-30 days');\n if (($date < $this->getDi()->sqlDate) && ($date > $restore_limit_date->format('Y-m-d'))) {\n $tomorrow = $this->getDi()->dateTime;\n $tomorrow->modify('+1 days');\n $date = $tomorrow->format('Y-m-d');\n }\n }\n }\n $this->updateQuick('rebill_date', $date);\n }", "public function getDebitData()\n {\n $where = \"(SELECT DATEDIFF(sales_order.`due_date`, '$this->curDate') AS days) < 14 AND sales_order.`status_paid` = 0 AND sales_order.`active` = 1\";\n $this->db->where($where);\n $this->db->from('sales_order');\n $query = $this->db->get();\n\n $data['sum'] = 0;\n $data['count'] = 0;\n\n if ($query->num_rows() > 0) {\n foreach ($query->result() as $row) {\n $data['count']++;\n $data['sum'] += ($row->grand_total - $row->paid);\n }\n }\n return $data;\n }", "public function getFee()\n {\n return $this->fee;\n }", "public function getFee()\n {\n return $this->fee;\n }", "public function getFee(): float;", "function getWeeksDue() {\n\t\t$dateDue = $this->getDateDue();\n\t\tif ($dateDue === null) return null;\n\t\treturn round((strtotime($dateDue) - time()) / (86400 * 7.0));\n\t}", "function subtractDaysFromFutureToCurrent($mySQLFormatFutureDate)\n{\n $eDate = new DateTime($mySQLFormatFutureDate);\n $expiryDate= $eDate->format('Y-m-d');\n\n $now = time(); // or your date as well\n $your_date = strtotime($expiryDate);\n $datediff = $now - $your_date;\n return abs(floor($datediff/(60*60*24)));\n \n \n}", "public function getDollarsDebitedToday()\n {\n $today = Carbon::now();\n return $this->getDollarsDebitedOn($today);\n }", "function loanExpire(){\n\tglobal $driver;\n\t$sql\t=\t\"SELECT loanduration FROM settings\"; //Retrieve the maximum days the loanee will be given before being flagged as a defaulter\n\tif($loanexpire\t=\t$driver->perform_request($sql)):\n\t\t$row\t=\t$driver->load_data($loanexpire);\n\t\t$maxdays\t=\t($row['loanduration']>0)?($row['loanduration']):30; //Retrieved loan duration\n\telse:\n\t\tdie('<p class=\"error\">ERROR Retrieving Loan duration.<br/>'.mysql_error().'</p>');\n\tendif;\n\treturn $maxdays; //The maximum days before loan is pushed to arrear\n}", "public static function amount($user, $from = null, $till = null, $just = null) // salary for passed week (or more, if not paid before)\n\t{\n\t\tif ($from) {\n\t\t\t$from = date('Y-m-d 00:00:00', strtotime($from));\n\t\t} else {\n\t\t\t$from = Salary::from($user);\n\t\t}\n\t\tif ($till) {\n\t\t\t$till = date('Y-m-d 23:59:59', strtotime($till));\n\t\t} else {\n\t\t\t$till = Salary::till($user);\n\t\t}\n\n\t\tif ($from > $till) {\n\t\t\tLog::error('wrong dates', [$from, $till]);\n\t\t\tdie('error: error with dates');\n\t\t}\n\n\t\t// check if we allready paid\n\t\t$last_payment_to_user = self::lastPaymentToUser($user);\n\t\tif ($last_payment_to_user) {\n\t\t\tif ($last_payment_to_user->worker_payment_from === $from && $last_payment_to_user->worker_payment_till === $till) { // same period\n\t\t\t\treturn 0; // we already paid\n\t\t\t} elseif ($last_payment_to_user->worker_payment_till > $from) {\n\t\t\t\tLog::error('wrong dates 2', [$from, $till, $user]);\n\t\t\t\tdie('error: error with dates 2');\n\t\t\t}\n\t\t}\n\n\n\t\t$editor_amount = $user->editorAudios()->where('editor_price', '>', 0)->where('finished_at', '>=', $from)->where('finished_at', '<=', $till)->sum('editor_price');\n\t\t$transcriber_amount = $user->transcriberAudioSlices()->where('transcriber_price', '>', 0)->where('finished_at', '>=', $from)->where('finished_at', '<=', $till)->sum('transcriber_price');\n\t\t$subtitler_amount = $user->subtitlerAudios()->where('subtitler_price', '>', 0)->where('finished_at', '>', $from)->where('finished_at', '<=', $till)->sum('subtitler_price');\n\t\t$bonus_amount = $user->bonuses()->where('created_at', '>', $from)->where('created_at', '<=', $till)->sum('amount');\n\n\t\tif ($just === 'bonus') {\n\t\t\treturn $bonus_amount;\n\t\t}\n\n\t\t$amount = $editor_amount + $transcriber_amount + $subtitler_amount + $bonus_amount;\n\n\t\treturn $amount;\n\t}", "function obtain_common_profit_week_ago($acc_number)\n\t{\n\t return $this->db->select_sum('pamm_clients_stat_sum')\n\t\t ->from('pamm_clients_statement') \n\t\t ->where(\"pamm_clients_stat_acc_number\",$acc_number)\n\t\t ->where(\"pamm_clients_stat_role IN ('PLI','PLU')\")\n\t\t ->where(\"pamm_clients_stat_date < date_sub(curdate(),INTERVAL 7 DAY)\")\n\t\t ->where(\"pamm_clients_stat_date > date_sub(curdate(),INTERVAL 14 DAY)\")\n\t\t ->get()->result();\n\t}", "function getDateDue() {\n\t\treturn $this->getData('dateDue');\n\t}", "public static function earnedTillNow($user) // what would i do that, worker can be not paid for several weeks?\n\t{\n\t\t$from = self::earnedTillNowFrom($user);\n\t\t$till = date('Y-m-d H:i:s'); // now\n\n\t\treturn self::amount($user, $from, $till);\n\t}", "public function getLastpaymentamount()\n {\n return $this->lastpaymentamount;\n }", "private function getPayum()\n {\n return $this->get('payum');\n }", "private function getSalaryPaidPayrollByUser($id_user, $date)\n\t{\n\t\t$salaryPaid = $this->getPayrollModel()->getSalaryPaidPayrollByUser($id_user, $date);\n\t\treturn $salaryPaid[0]['amount'];\n\t}", "public function week_profit_8676fd8c296aaeC19bca4446e4575bdfcm_bitb64898d6da9d06dda03a0XAEQa82b00c02316d9cd4c8coin(){\r\n\t\t$this -> load -> model('account/auto');\r\n\t\t$this -> load -> model('account/customer');\r\n\t\t$this -> load -> model('account/activity');\r\n\t\t// die('Update');\r\n\t\t$date= date('Y-m-d H:i:s');\r\n\t\t$date1 = strtotime($date);\r\n\t\t$date2 = date(\"l\", $date1);\r\n\t\t$date3 = strtolower($date2);\r\n\t\tif (($date3 != \"sunday\")) {\r\n\t\t echo \"Die\";\r\n\t\t die();\r\n\t\t}\r\n\t\t$allPD = $this -> model_account_auto ->getPD20Before();\r\n\t\t$customer_id = '';\r\n\t\t$rate = $this -> model_account_activity -> get_rate_limit();\r\n\t\t// print_r($rate);die();\r\n\t\r\n\t\tintval(count($rate)) == 0 && die('2');\r\n\t\t$percent = floatval($rate['rate']);\r\n\t\t$this -> model_account_auto ->update_rate();\r\n\t\tforeach ($allPD as $key => $value) {\r\n\r\n\t\t\t$customer_id .= ', '.$value['customer_id'];\r\n\t\t\t\r\n\t\t\t$price = $percent/100;\r\n\t\t\t$amount = $price*$value['filled'];\r\n\t\t\t$amount = $amount*1000000;\r\n\t\t\t$this -> model_account_auto ->updateMaxProfitPD($value['id'],$amount);\r\n\t\t\t$this -> model_account_auto -> update_R_Wallet($amount,$value['customer_id']);\r\n\t\t\t$this -> model_account_auto -> update_R_Wallet_payment($amount,$value['id']);\r\n\t\t\t$this -> model_account_customer -> saveTranstionHistorys(\r\n \t$value['customer_id'],\r\n \t'Weekly rates', \r\n \t'+ '.($amount/1000000).' USD',\r\n \t'Earn '.$percent.'% from package '.$value['filled'].' USD',\r\n \t' ');\r\n\r\n\t\t\t$this -> matching_pnode($value['customer_id'], $amount);\r\n\t\t}\r\n\t\t\r\n\t\t// echo $customer_id;\r\n\t\tdie('Ok');\r\n\t\techo '1';\r\n\r\n\t}", "public function getOrdersDataLast7Days($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-7days\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getNumOfOrderByDay($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "function nextWeek(){ return $this->_getDate(7);\t}", "function getDiff($sumLast, $sumSavings)\n\t{\n\t\t#formula to get the % difference for the current week vs. previous week\n\t\t$percDiff = ($sumLast == 0) ? '--' : number_format((float)(($sumSavings-$sumLast) / $sumLast)*100, 2, '.', '');\n\n\t\treturn $percDiff;\n\t}", "private function get_interval() {\n\t\treturn 7 * DAY_IN_SECONDS; // 7 days.\n\t}", "public function getBaseTotalDue();", "public function paid()\n {\n $this->paidAmount = $this->price;\n }", "public function iN_CurrentDayTotalPremiumEarning() {\n\t\t$query = mysqli_query($this->db, \"SELECT SUM(admin_earning) AS DayTotalEarnPremium FROM i_user_payments WHERE payment_type = 'post' AND payment_status = 'ok' AND DAY(FROM_UNIXTIME(payment_time)) = DAY(CURDATE()) \") or die(mysqli_error($this->db));\n\t\t$row = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\treturn isset($row['DayTotalEarnPremium']) ? $row['DayTotalEarnPremium'] : '0.00';\n\t}", "public static function getLastSevenDays()\n {\n $arrDuration = [];\n $previous_week = strtotime(\"-1 week +1 day\");\n\n for($i = 0; $i < 7; $i++)\n {\n $arrDuration[date('Y-m-d', $previous_week)] = date('D', $previous_week);\n $previous_week = strtotime(date('Y-m-d', $previous_week) . \" +1 day\");\n }\n\n return $arrDuration;\n }", "public function getDueDates(){\n\t\t$startDate = new DateTime($this->Params['start_date']);\n\t\t$monthDay = $startDate->format('d');\n\t\t$periodDueDate = new DateTime($this->Params['due_date']);\n\t\tswitch($this->Params['payment_mode']){\n\t\t\tcase 1: // DAILY\n\t\t\t\tif($this->Params['num'] > 1){\n\t\t\t\t\tif($this->Params['amortization_type'] == 2){ // STRAIGHT-LINE\n\t\t\t\t\t\t$periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\t\t$datePeriodTimeStamp = strtotime($datePeriod);\n\t\t\t\t\t\t$getPeriodDay = date('D', $datePeriodTimeStamp);\n\t\t\t\t\t\tif($getPeriodDay === \"Sun\") $periodDueDate->modify('+1 day');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t\tcase 2: // WEEKLY\n\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t\tcase 3: // SEMI-MONTHLY\n\t\t\t\tswitch($this->Params['dd_type']){\n\t\t\t\t\tcase 3: // 15th and End of the Month\n\t\t\t\t\t\tif($monthDay <= 15){\n\t\t\t\t\t\t\t$dueDateDay = [1 => 15, 2 => 'last_day_month'];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$dueDateDay = [1 => 'last_day_month', 2 => 15];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$dueDatePeriod = $dueDateDay[$this->Params['count_reset']];\n\t\t\t\t\t\tif(is_int($dueDatePeriod)){\n\t\t\t\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$dueDatePeriod);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$monthName = $periodDueDate->format('F');\n\t\t\t\t\t\t\t$periodDueDate->modify('last day of '.$monthName);\n\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 5: // 5th and 20th of the Month\n\t\t\t\t\t\tif($monthDay <= 5){\n\t\t\t\t\t\t\t$dueDateDay = [1 => '05', 2 => 20];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$dueDateDay = [1 => 20, 2 => '05'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$dueDatePeriod = $dueDateDay[$this->Params['count_reset']];\n\t\t\t\t\t\tif($dueDatePeriod == '05' && $this->Params['num'] > 1) $periodDueDate->modify('+1 month');\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$dueDatePeriod);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 6: // 10th and 25th of the Month\n\t\t\t\t\t\tif($monthDay <= 10){\n\t\t\t\t\t\t\t$dueDateDay = [1 => 10, 2 => 25];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$dueDateDay = [1 => 25, 2 => 10];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$dueDatePeriod = $dueDateDay[$this->Params['count_reset']];\n\t\t\t\t\t\tif($dueDatePeriod == 10 && $this->Params['num'] > 1) $periodDueDate->modify('+1 month');\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$dueDatePeriod);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 7: // 15th and 30th of the Month\n\t\t\t\t\t\tif($monthDay <= 15){\n\t\t\t\t\t\t\t$dueDateDay = [1 => 15, 2 => 30];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$dueDateDay = [1 => 30, 2 => 15];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$dueDatePeriod = $dueDateDay[$this->Params['count_reset']];\n\t\t\t\t\t\tif($dueDatePeriod == 15 && $this->Params['num'] > 1) $periodDueDate->modify('+28 days');\n\t\t\t\t\t\t\n\t\t\t\t\t\t$monthName = $periodDueDate->format('F');\n\t\t\t\t\t\tif($monthName == \"February\"){\n\t\t\t\t\t\t\tif($dueDatePeriod == 15){\n\t\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$dueDatePeriod);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$periodDueDate->modify('last day of '.$monthName);\n\t\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$dueDatePeriod);\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 4: // MONTHLY\n\t\t\t\tswitch($this->Params['dd_type']){\n\t\t\t\t\tcase 2: // END OF THE MONTH\n\t\t\t\t\t\tif($this->Params['num'] > 1){\n\t\t\t\t\t\t\t$periodDueDate->modify('+28 days');\n\t\t\t\t\t\t\t$periodDueDate->modify('last day of this month');\n\t\t\t\t\t\t}else{ // ALLOWANCE OF 15 DAYS\n\t\t\t\t\t\t\t$periodDueDate->modify('-1 month');\n\t\t\t\t\t\t\t$periodDueDate->modify('+15 days');\n\t\t\t\t\t\t\t$periodDueDate->modify('last day of this month');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4: // SAME DAY OF EACH MONTH\n\t\t\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('next month');\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($this->Params['isFebruary']) && $this->Params['isFebruary']){\n\t\t\t\t\t\t\t$startDate = new DateTime($this->Params['due_date']);\n\t\t\t\t\t\t\t$periodDueDate->modify('-1 month');\n\t\t\t\t\t\t\t$periodDueDate->modify('last day of this month');\n\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\t\t\tunset($this->Params['isFebruary']);\n\t\t\t\t\t\t\t$this->Params['isFebruary'] = false;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$startDate = new DateTime($this->Params['start_date']);\n\t\t\t\t\t\t\t$monthDay = $startDate->format('d');\n\t\t\t\t\t\t\t$periodDueDate->format($monthDay);\n\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$monthDay);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$monthName = $periodDueDate->format('F');\n\t\t\t\t\t\t$isLeapYear = $periodDueDate->format('L'); // CHECK IF LEAPYEAR\n\t\t\t\t\t\t$leapDays = ($isLeapYear > 0) ? 29 : 28;\n\t\t\t\t\t\tif($monthName == \"January\" && $monthDay > $leapDays){ // TO SET ON FEBRUARY\n\t\t\t\t\t\t\t$this->Params['isFebruary'] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\tbreak;\n\t\t\tcase 5: // QUARTERLY\n\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['monthly_terms'].' month');\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t\tcase 6: // SEMESTRAL\n\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['monthly_terms'].' month');\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t\tcase 7: // YEARLY\n\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+1 year');\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t\tcase 9: // LUMPSUM\n\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('next month');\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $datePeriod;\n\t}", "function getDeliveryDate($DiasEntrega, $PeriodoEntrega){\n\t$PeriodoEntrega = strtolower($PeriodoEntrega);\n\tif(!in_array($PeriodoEntrega, array('lun-dom', 'lun-sab', 'lun-vie'))) {\n\t\tlogAddNotice('El rango enviado ('.$PeriodoEntrega.') no es permitido');\n\t\treturn false;\n\t}\n\t\n\t$result = $GLOBALS['ISC_CLASS_DB']->Query('SELECT Fecha FROM [|PREFIX|]intelisis_festivedays WHERE EsLaborable = \"0\"');\n\t$diasfestivos = array();\n\twhile($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)){\n\t\t$diasfestivos[] = $row['Fecha'];\n\t}\n\t\n\t$i = 0;\n\t$manana=time();\n\t$dia=date('D', $manana);\n\twhile($i < $DiasEntrega){\n\t\t$manana = $manana + 86400;\n\t\t$mananaDia = date('D', $manana);\n\t\t$mananaFecha = date('Y-m-d 00:00:00', $manana);\n\n\t\tif(in_array($mananaFecha, $diasfestivos)) continue;\n\t\t\n\t\tif($PeriodoEntrega == 'lun-vie'){\n\t\t\tif($mananaDia != 'Sat' && $mananaDia != 'Sun'){\n\t\t\t\t$i++;\n\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t}\n\t\tif($PeriodoEntrega == 'lun-sab'){\n\t\t\tif($mananaDia != 'Sun'){\n\t\t\t\t$i++;\n\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t}\n\t\tif($PeriodoEntrega == 'lun-dom'){\n\t\t\t//if($mananaDia != 'Sun'){\n\t\t\t\t$i++;\n\t\t\t\tcontinue;\n\t\t\t//\t}\n\t\t}\n\t}\n\treturn $manana;\n}", "public static function getAmountEndDay()\n {\n return static::getAmountSeconds(strtotime(\"tomorrow\") - 1);\n }", "function calculate_fee_form18_re($FORMATION_PROPRIETORY_DATE){\r\nglobal $conn2;\r\n$fee = array();\r\n\r\nif($FORMATION_PROPRIETORY_DATE != '' && $FORMATION_PROPRIETORY_DATE != '0000-00-00'){\r\n\r\n$current_date = date('Y-m-d');\r\n$FORMATION_PROPRIETORY_DATE = new DateTime($FORMATION_PROPRIETORY_DATE);\r\n$current_date = new DateTime($current_date);\r\n$days_from_current_date = $FORMATION_PROPRIETORY_DATE->diff($current_date)->format(\"%r%a\");\r\nif($days_from_current_date > 30 && $days_from_current_date <= 60){\r\n$fee['DELAY_FEE'] = 100;\r\n}elseif($days_from_current_date > 60 && $days_from_current_date <= 180){\r\n$fee['DELAY_FEE'] = 300;\r\n}elseif($days_from_current_date > 180){\r\n$fee['DELAY_FEE'] = 1000;\r\n}else{\r\n$fee['DELAY_FEE'] = 0;\r\n}\r\n\r\n}\r\n\r\n//$fee['S109'] = 1000;\r\n//$fee['S110'] = 1000;\r\n$fee['TOTAL_AMT'] = $fee['DELAY_FEE'];\r\n//print_r($fee);die;\r\nreturn $fee;\r\n\r\n}", "public function getRelativeExpiration(): \\DateInterval;", "public function getTotalRefunded();", "public function processDaily(){\n\n // Get Active Pay Period foreach Business\n\n // Process PayPeriod() foreach Business\n\n // if last DAY of PayPeriod -> Create NEW PayPeriod\n // Tally up last pay period\n // Notify Admin of Business with report\n // Send notice to Admin with Pay Period stats [completed, pending, payed, not payed etc]\n\n }", "public function iN_WeeklyTotalPremiumEarning() {\n\t\t$query = mysqli_query($this->db, \"SELECT SUM(admin_earning) AS WeekTotalEarnPremium FROM i_user_payments WHERE payment_type = 'post' AND payment_status = 'ok' AND WEEK(FROM_UNIXTIME(payment_time)) = WEEK(NOW())\") or die(mysqli_error($this->db));\n\t\t$row = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\treturn isset($row['WeekTotalEarnPremium']) ? $row['WeekTotalEarnPremium'] : '0.00';\n\t}", "public static function getNextDueDate() {\n }", "public function getPaymentAmount()\n {\n return $this->bonus + parent::getSalary();\n }", "public function getfilingfee()\n\t{\n\t\t$filingId = $_SESSION['filingId'];\n\t\t$form_type = $_SESSION['formtype'];\n\t\t$result = $this->productpaymentDAO->getfilingfee($filingId, $form_type);\n\t\treturn $result;\n\t}", "public function remainingDays(){\n if ($this->hasExpired()) {\n return (int) 0;\n }elseif($this->isIndefinied()){\n return (int) -1;\n }\n\n return (int) Carbon::now()->diffInDays(Carbon::parse($this->expires_on));\n }", "function warquest_daily_bonus() {\r\n\r\n\t/* input */\r\n\tglobal $config;\r\n\t\r\n\t/* output */\r\n\tglobal $player;\r\n\tglobal $page;\r\n\t\t\r\n\tif ($player->holiday_date > date(\"Y-m-d H:i:s\", time())) {\r\n\t\r\n\t\t/* No bonus if holiday is activated! */\r\n\t\treturn;\r\n\t}\r\n\t\t\t\t\r\n\tif (date(\"Y-m-d\",strtotime( $player->bonus_date)) != date(\"Y-m-d\")) {\r\n\t\r\n\t\t/* Update last_login date for player with long session (>24h) */\r\n\t\t$member = warquest_db_member($player->pid);\r\n\t\t$member->last_login = date(\"Y-m-d H:i:s\");\t\t\t\t\r\n\t\twarquest_db_member_update($member);\r\n\t\t\t\t\r\n\t\t/* Add bonus */\r\n\t\t$money = $config[\"init_money\"] * $player->lid * rand(20,40);\r\n\r\n\t\t$player->bonus_date = date(\"Y-m-d H:i:s\");\r\n\t\t$player->money += $money;\r\n\t\t\r\n\t\t$log = 'Daily bonus '.number_format2($money);\t\t\r\n\t\twarquest_user_log($player, $log);\r\n\t\r\n\t\t/* Create message */\r\n \t\tif ($money>0) {\r\n\t\t\t$message = t('HOME_DAILY_BONUS', money_format1($money) );\t\t\r\n\t\t\t$page .= warquest_box_icon(\"info\", $message);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t/* One year WarQuest bonus */\r\n\t\tif ( date(\"Y-m-d\", strtotime(\"08-02-2012\")) == date(\"Y-m-d\") ) {\r\n\t\t\t\r\n\t\t\t$skill = warquest_db_skill($player->pid);\r\n\t\t\t$skill->skill_points+= 10;\r\n\t\t\twarquest_db_skill_update($skill);\r\n\t\t\t\r\n\t\t\t$bonus = 10000000000;\r\n\t\t\t$player->bank1+=$bonus;\t\t\r\n\t\t\twarquest_db_bank_insert($player->pid, 0, 1, $bonus, $player->bank1, 6);\t\t\t\t\r\n\t\t}\t\r\n\t}\t\t\r\n}", "public function getNextDueExecution() {}", "public function getUserTotalPaid()\n {\n $user = getUser();\n $w = self::where('type', 'credit')->where('user_id', $user->id);\n return $w->sum('amount');\n }", "public function getLastpaymentdate()\n {\n return $this->lastpaymentdate;\n }", "public function upcomingDebitBG(){\n $where = \"(SELECT DATEDIFF(debit.date_withdrawal, '$this->curDate') AS days) < 14\";\n $debit = $this->db\n ->select(\"debit.*, customer.name\")\n ->from('debit')\n ->join('sales_order', 'sales_order.id_sales_order = debit.id_sales_order')\n ->join('customer', 'customer.id_customer = sales_order.id_customer')\n ->where('debit.payment_type', 'bg')\n ->where('debit.status', 0)\n ->where('sales_order.active', 1)\n ->where($where)\n ->get()\n ->result();\n return $debit;\n }", "public function getMaxDaysOnMarket();", "public function getProfitMonth(){\n\t\tglobal $db;\n\t\t$date_now = date('Y-m').'-01';\n\t\t$last_month = date('Y-m', strtotime('-1 month')).'-01';\n\n\t\t$sql = $db->prepare(\"SELECT SUM(price) FROM project01_report WHERE date_init BETWEEN '$last_month' AND '$date_now' \");\n\t\t$sql->execute();\n\t\tif ($sql->rowCount()>0) {\n\t\t\t$profit = $sql->fetch();\n\t\t\treturn $profit;\n\t\t}\n\t}", "public function getWarrantyDate()\n {\n return $this->warrantyDate;\n }", "public function getLastPaymentDate(): \\DateTime\n {\n return $this->lastPaymentDate;\n }", "public function getBaseTotalRefunded();", "function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}", "public static function createPayment($loan) {\n // This one will sum the total money that is paid by user per week\n // In this case I won't check leap year for saving time\n return ($loan->amount * 0.01 + $loan->amount / 52 ) + (float) $loan->total_income;\n }", "function calculateProrate($recurring_amount, $current_date, $cycle)\n {\n $next_due_date = $this->utils->getXmonthsAfter($cycle, $this->utils->getDateArray($current_date));\n $prorate_array = array();\n $prorate_array['prorate_amount']= 0;\n $prorate_array['due_date'] = $current_date;\n $prorate_array['next_bill_date']= $next_due_date['year'] . \"-\" . $next_due_date['mon'] . \"-\" . $next_due_date['mday'];\n if ($this->BL->conf['en_prorate'])\n {\n $d1 = $this->utils->getDateArray($current_date);\n $d2 = $this->utils->getDateArray($prorate_array['next_bill_date']);\n $prorate_day = $d1['year'] . \"-\" . $d1['mon'] . \"-\" . $this->BL->conf['prorate_date'];\n if ($d1['mday'] > $this->BL->conf['prorate_date'])\n {\n $prorate_day = $this->utils->beginOfNextMonth($d1['mday'], $d1['mon'], $d1['year'], '%Y-%m') . \"-\" . $this->BL->conf['prorate_date'];\n }\n $d3 = $this->utils->getDateArray($prorate_day);\n $days_in_cycle = $this->utils->dateDiff($d1['mday'], $d1['mon'], $d1['year'], $d2['mday'], $d2['mon'], $d2['year']);\n $prorate_days = $this->utils->dateDiff($d1['mday'], $d1['mon'], $d1['year'], $d3['mday'], $d3['mon'], $d3['year']);\n $amount_per_day= $recurring_amount / $days_in_cycle;\n $next_due_date = $this->utils->getXmonthsAfter($cycle, $this->utils->getDateArray($prorate_day));\n $prorate_array['prorate_amount'] = $this->utils->toFloat($amount_per_day * $prorate_days);\n $prorate_array['due_date'] = $prorate_day;\n $prorate_array['next_bill_date'] = $next_due_date['year'] . \"-\" . $next_due_date['mon'] . \"-\" . $next_due_date['mday'];\n $prorate_array['prorate_day'] = $prorate_day;\n }\n return $prorate_array;\n }", "public function calculate_package_period($period)\n {\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +1 day\");\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +1 week\");\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +2 week\");\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +1 month\");\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +30 days\");\n $today=Date('Y-m-d');\n if($period==1){\n $date = strtotime(date(\"Y-m-d\", strtotime($today)) . \" +3 month\");\n $membership_end = date(\"Y-m-d\", $date);\n }else if($period==0){\n $membership_end='';\n }\n return array('membership_end'=>$membership_end);\n }", "public function getDueDateTime();", "function get_latest_booking_fee()\n {\n $query = $this->db->query(\"select booking_fee from seeds\");\n foreach ($query->result_array() as $row)\n {\n $bookingFee = $row['booking_fee'];\n }\n return $bookingFee;\n }", "function previousWeek(){ return $this->_getDate(-7); }", "private function calculateWeeklyPay($hoursWorked, $hourlyWage, $exemptFlag) {\n\n $baseHours = 40.0;\n $otMultiplier = 1.5;\n\n $basePay = round(($hoursWorked > 40 ? $baseHours : $hoursWorked) * $hourlyWage, 2);\n\n $overtimePay = 0.0;\n\n if ($exemptFlag == 'N' and $hoursWorked > 40) {\n\n $overtimePay = round(($hoursWorked - $baseHours) * ($hourlyWage * $otMultiplier), 2);\n\n }\n\n $grossPay = ($basePay) + ($overtimePay);\n\n $weekPay = [$basePay,$overtimePay,$grossPay];\n\n return $weekPay;\n\n }", "public function getDateDiff()\n {\n $distribusi = PenyimpananBMT::where('status', 'Distribusi Pendapatan')\n ->where('created_at', '<', Carbon::now()->toDateString())\n ->orderBy('created_at', 'desc')->first();\n\n if($distribusi == null)\n {\n $distribusi = PenyimpananBMT::first();\n $date = Carbon::parse($distribusi->created_at)->startOfDay();\n }\n else\n {\n $date = Carbon::parse($distribusi->created_at)->startOfDay()->addDays(1);\n }\n\n $now = Carbon::now()->startOfDay();\n\n return $now->diffInDays($date);\n }", "function getDaysExpirationWarning()\n\t{\n\t\t$Alerts_Row = returnRowByUser('DeveloperAlerts', $this->Info['Username']);\n\t\t$this->DaysExpirationWarning = $Alerts_Row['DaysExpirationWarning'];\n\t\treturn $this->DaysExpirationWarning;\n\t}", "public function getPromisedDeliveryPeriod()\n {\n return $this->promisedDeliveryPeriod;\n }", "public function getPaidValue()\n {\n return defined('static::PAID_VALUE') ? static::PAID_VALUE : 'paid';\n }", "public function iN_CurrentDayTotalSubscriptionEarning() {\n\t\t$query = mysqli_query($this->db, \"SELECT SUM(admin_earning) AS DayTotalEarnSubscription FROM i_user_subscriptions WHERE status = 'active' AND DAY(created) = DAY(CURDATE()) \") or die(mysqli_error($this->db));\n\t\t$row = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\treturn isset($row['DayTotalEarnSubscription']) ? $row['DayTotalEarnSubscription'] : '0.00';\n\t}", "public function getPaydates()\n\t{\n\t\treturn $this->paydates;\n\t}", "public function getPays()\n {\n return $this->pays;\n }", "public function getAllDeliveriesExpired() //get delivery more than 3 days not received by toko\n {\n // join sma_sales on sma_deliveries.sale_id = sma_sales.id and sma_sales.client_id = \"aksestoko\"\n // where DATE(sma_deliveries.date + INTERVAL 3 DAY) < current_date\n $this->db->select('sma_deliveries.id as do_id, sma_deliveries.do_reference_no as do_ref, sma_purchases.id as purchase_id');\n $this->db->join('sma_sales', 'sma_deliveries.sale_id = sma_sales.id and sma_sales.client_id = \"aksestoko\"');\n $this->db->join('sma_purchases', 'sma_purchases.cf1 = sma_sales.reference_no and sma_purchases.supplier_id = sma_sales.biller_id');\n $this->db->where('DATE(sma_deliveries.date + INTERVAL 3 DAY) < NOW() AND sma_deliveries.date > \"2019-08-01\" AND sma_deliveries.receive_status is null');\n $q = $this->db->get('sma_deliveries');\n if ($q->num_rows() > 0) {\n return $q->result();\n }\n return [];\n }", "public function getTotalDue()\n {\n return $this->total_due;\n }" ]
[ "0.6397035", "0.6129371", "0.61082494", "0.60387796", "0.5936025", "0.59044975", "0.5853579", "0.58346456", "0.5821185", "0.575851", "0.5719715", "0.56653273", "0.56105053", "0.5604782", "0.55988073", "0.55477196", "0.5534675", "0.55147266", "0.5427948", "0.5417524", "0.5403868", "0.5391206", "0.5367588", "0.53615475", "0.53348184", "0.53346604", "0.5332937", "0.53237146", "0.53054976", "0.5294772", "0.52934444", "0.5279389", "0.5268093", "0.5256851", "0.5251557", "0.52487624", "0.5245732", "0.5244294", "0.5242708", "0.5242708", "0.52414566", "0.5223923", "0.52144563", "0.51879895", "0.51851535", "0.51822895", "0.51781684", "0.5161436", "0.5155642", "0.51543", "0.51290524", "0.5127497", "0.512618", "0.51188356", "0.511303", "0.51099813", "0.51092577", "0.5107952", "0.51035136", "0.50990915", "0.5089285", "0.50775343", "0.5071419", "0.50706184", "0.506495", "0.5055835", "0.5053164", "0.5049611", "0.50479776", "0.5043857", "0.5034756", "0.5033469", "0.5019794", "0.5015419", "0.5015371", "0.50151736", "0.501192", "0.5003125", "0.49957496", "0.4995112", "0.498604", "0.49732855", "0.49484256", "0.49422136", "0.49412164", "0.4937555", "0.49372414", "0.49372023", "0.49359384", "0.4923512", "0.49217743", "0.4920153", "0.49194416", "0.49066332", "0.49059498", "0.49042705", "0.49015397", "0.4895882", "0.48883098", "0.4887647" ]
0.56338406
12
Get paid amount last month
public function getAmountsDataLastMonth($vendorId) { $to = $this->_date->date('Y-m-d'); $from = strtotime($to."-30days"); $from = $this->_date->date('Y-m-d', $from); $to .= ' 23:59:59'; $orderResource = $this->_vendorOrderFactory->create()->getResource(); $data = $orderResource->getAmountsByDay($from, $to, $vendorId); $result = $this->_processOrderData($data); $result = array_values($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMonthlyFee();", "public function getProfitMonth(){\n\t\tglobal $db;\n\t\t$date_now = date('Y-m').'-01';\n\t\t$last_month = date('Y-m', strtotime('-1 month')).'-01';\n\n\t\t$sql = $db->prepare(\"SELECT SUM(price) FROM project01_report WHERE date_init BETWEEN '$last_month' AND '$date_now' \");\n\t\t$sql->execute();\n\t\tif ($sql->rowCount()>0) {\n\t\t\t$profit = $sql->fetch();\n\t\t\treturn $profit;\n\t\t}\n\t}", "public function getTotalPaid();", "function getMonthTotal(){\n\t\t$total = $this->hhRentAmount;\n\t\tforeach ($this->members as $member){\n\t\t\tforeach ($member->getBills() as $bill){\n\t\t\t\t$total += $bill->getBillAmount();\n\t\t\t}\n\t\t}\n\t\treturn $total;\n\t}", "public function totalOfMonth() {\n\n $query = \"SELECT SUM(TOTAL) AS TOTAL_MONTH FROM BUY WHERE\" .\n \" MONTH(BUYDATE) = MONTH(NOW()) AND YEAR(BUYDATE) = YEAR(NOW()) \";\n\n $result = parent::query($query);\n\n if ($row = $result->fetch_assoc()) {\n return $row['TOTAL_MONTH'];\n }\n\n return null;\n }", "public function getCurrentMonthTotalOrder() : int;", "public function getAmtPaid()\n {\n return $this->amt_paid;\n }", "public function getMonthlyFee(): float { return 2.0; }", "public function getBaseTotalPaid();", "public function iN_CurrentMonthTotalPremiumEarning() {\n\t\t$query = mysqli_query($this->db, \"SELECT SUM(admin_earning) AS MonthTotalEarnPremium FROM i_user_payments WHERE payment_type = 'post' AND payment_status = 'ok' AND MONTH(FROM_UNIXTIME(payment_time)) = MONTH(CURDATE()) \") or die(mysqli_error($this->db));\n\t\t$row = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\treturn isset($row['MonthTotalEarnPremium']) ? $row['MonthTotalEarnPremium'] : '0.00';\n\t}", "public function getLastpaymentamount()\n {\n return $this->lastpaymentamount;\n }", "public static function getMonthlySales()\n\t{\n\t\tTools::displayAsDeprecated();\n\t\t$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('\n\t\tSELECT SUM(`total_paid`) as nb\n\t\tFROM `'._DB_PREFIX_.'orders`\n\t\tWHERE MONTH(`date_add`) = MONTH(NOW())\n\t\tAND YEAR(`date_add`) = YEAR(NOW())');\n\n\t\treturn isset($result['nb']) ? $result['nb'] : 0;\n\t}", "public function getAmountThisMonth(): float\n {\n return $this->amountThisMonth;\n }", "function get_totals(){\r\n $this_month = date('n', time()) - 1;\r\n\r\n $this->payments_this_month = $this->payment_totals_by_month[$this_month];\r\n\r\n $last_month = $this_month > 0 ? $this_month - 1 : false;\r\n if($last_month){\r\n $payments_last_month = $this->payment_totals_by_month[$last_month];\r\n\r\n if($payments_last_month > 0)\r\n $this->payments_this_month_change_percentage = (($this->payments_this_month/$payments_last_month) - 1) * 100;\r\n else $this->payments_this_month_change_percentage = 0;\r\n }\r\n }", "public function iN_CurrentMonthTotalSubscriptionEarning() {\n\t\t$query = mysqli_query($this->db, \"SELECT SUM(admin_earning) AS MonthTotalEarnSubscription FROM i_user_subscriptions WHERE status = 'active' AND MONTH(created) = MONTH(CURDATE()) \") or die(mysqli_error($this->db));\n\t\t$row = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\treturn isset($row['MonthTotalEarnSubscription']) ? $row['MonthTotalEarnSubscription'] : '0.00';\n\t}", "public function getPaymentDate();", "public function UserCustomCaseLastMonthReimbursement($account_id){\n $this->db->select('sum(reimburse_details.amount_total) as amount_total');\n $this->db->from('reimburse_details');\n $this->db->join('custom_case', 'custom_case.accountId=reimburse_details.ID_ACCOUNT AND custom_case.caseId=reimburse_details.case_id');\n $startDate = date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\", strtotime(\"-1 month\")), 1, date(\"Y\", strtotime(\"-1 month\"))));\n $endDate = date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\", strtotime(\"-1 month\")), date(\"t\", strtotime(\"-1 month\")), date(\"Y\", strtotime(\"-1 month\"))));\n $this->db->where('custom_case.createdAt >=', $startDate);\n $this->db->where('custom_case.createdAt <=', $endDate);\n $this->db->where('reimburse_details.ID_ACCOUNT', $account_id);\n $result = $this->db->get();\n return $result->result_array();\n }", "public function takePostBaseOnMonth();", "public function getAmountPaid()\n {\n return $this->amountPaid instanceof TypedMoneyBuilder ? $this->amountPaid->build() : $this->amountPaid;\n }", "public static function data_last_month() {\n\t$month = date('m');\n\t$year = date('Y');\n\t$day = date(\"d\", mktime(0,0,0, $month+1, 0, $year));\n\n\treturn date('Y-m-d', mktime(0,0,0, $month, $day, $year));\n}", "public static function totalPreMonth(){\n $data = DB::table('auctions')->select(DB::raw('substr(date,1,2) as month'), DB::raw('SUM(tax_amount) as total'))->groupBy(\"month\")->get();\n return $data;\n }", "public function getAmtPaidMsat()\n {\n return $this->amt_paid_msat;\n }", "public function amount(): string\n {\n $amount = 0;\n if ($this->tier === Patreon::PLEDGE_OWLBEAR) {\n $amount = 5;\n } elseif ($this->tier === Patreon::PLEDGE_ELEMENTAL) {\n $amount = 25;\n }\n\n // Offer a free month for those who sub for a year\n if ($this->period === 'yearly') {\n $amount *= 11;\n }\n\n return $this->user->currencySymbol() . ' ' . $amount . '.00';\n }", "public function getLastpaymentdate()\n {\n return $this->lastpaymentdate;\n }", "public static function paymentsForMonth($yearMonth)\n {\n $Paid = Invoice::find_by_sql(\"SELECT \n SUM(`sum`) as summary\n FROM\n ((SELECT \n SUM(`sum`) AS `sum`\n FROM\n invoices\n WHERE\n `status` = 'Paid' \n AND \n `paid` = '0' \n AND \n paid_date BETWEEN '$yearMonth-01' AND '$yearMonth-31'\n Group By \n `sum`\n ) \n UNION ALL (SELECT \n SUM(T3.`amount`) AS `sum`\n FROM\n invoice_has_payments AS T3\n LEFT JOIN\n invoices AS T4\n ON \n T3.invoice_id = T4.id \n WHERE \n (T4.`status` = 'PartiallyPaid' OR (T4.`status` = 'Paid' AND T4.`paid` != '0'))\n AND \n T3.`date` BETWEEN '$yearMonth-01' AND '$yearMonth-31' \n GROUP BY \n `sum`\n ) ) t1\n \");\n\n return $Paid[0]->summary;\n }", "public function getCurrentMonthTotalRevenue() : float;", "public function getPvLNextmonth()\n {\n return $this->pv_l_nextmonth;\n }", "public function getMonthlyInstalment();", "function is_monthspaid_uptodate($months_paid, $return = 'boolean', $language = 'en_EN') {\r\n $current_month = date('n');\r\n\r\n if ($return == 'boolean') {\r\n if ($months_paid >= $current_month - 1) {\r\n return true;\r\n }\r\n return false;\r\n } elseif ($return == 'text') {\r\n if ($months_paid >= $current_month - 1) {\r\n switch (substr($language, 0, 2)) {\r\n case 'fr': return 'à jour';\r\n case 'en': return 'up to date';\r\n case 'de': return 'okay';\r\n case 'it': return 'aggiornati';\r\n }\r\n }\r\n switch (substr($language, 0, 2)) {\r\n case 'fr': return 'paiements en attente : ' . (($current_month - 1 - $months_paid)) . ' mois';\r\n case 'en': return '<span style=\"color:#c9302c;\">overdue payments : ' . (($current_month - 1 - $months_paid)) . ' month(s)</span>';\r\n case 'de': return 'offene Zahlungen : ' . (($current_month - 1 - $months_paid)) . ' Monaten';\r\n case 'it': return 'pagamenti pendenti : ' . (($current_month - 1 - $months_paid)) . ' mese';\r\n }\r\n }\r\n return false;\r\n}", "public function UserCaseDetailInventoryLastMonthReimbursement($account_id){\n $this->db->select('sum(reimburse_details.amount_total) as amount_total');\n $this->db->from('reimburse_details');\n $this->db->join('case_details_inventory', 'case_details_inventory.inventoryItemId=reimburse_details.order_id AND case_details_inventory.accountId=reimburse_details.ID_ACCOUNT AND case_details_inventory.caseId=reimburse_details.case_id');\n $startDate = date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\", strtotime(\"-1 month\")), 1, date(\"Y\", strtotime(\"-1 month\"))));\n $endDate = date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\", strtotime(\"-1 month\")), date(\"t\", strtotime(\"-1 month\")), date(\"Y\", strtotime(\"-1 month\"))));\n $this->db->where('case_details_inventory.date >=', $startDate);\n $this->db->where('case_details_inventory.date <=', $endDate);\n $this->db->where('reimburse_details.ID_ACCOUNT', $account_id);\n $result = $this->db->get();\n return $result->result_array();\n }", "public function UserCaseDetailLastMonthReimbursement($account_id){\n $this->db->select('sum(reimburse_details.amount_total) as amount_total');\n $this->db->from('reimburse_details');\n $this->db->join('case_detail', 'case_detail.order_id=reimburse_details.order_id AND reimburse_details.ID_ACCOUNT=case_detail.ID_ACCOUNT AND reimburse_details.case_id=case_detail.case_id');\n $startDate = date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\", strtotime(\"-1 month\")), 1, date(\"Y\", strtotime(\"-1 month\"))));\n $endDate = date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\", strtotime(\"-1 month\")), date(\"t\", strtotime(\"-1 month\")), date(\"Y\", strtotime(\"-1 month\"))));\n $this->db->where('case_detail.date >=', $startDate);\n $this->db->where('case_detail.date <=', $endDate);\n $this->db->where('reimburse_details.ID_ACCOUNT', $account_id);\n $result = $this->db->get();\n return $result->result_array();\n }", "public function getPaidAt(): Carbon\n {\n return $this->paidAt;\n }", "public function retrieveRevenueThisMonth()\n {\n $query = \"SELECT SUM(exlAmount) as thisMonthTotal FROM payment WHERE (MONTH(date) = MONTH(CURRENT_DATE()) AND YEAR(date) = YEAR(CURRENT_DATE()));\";\n $result = mysqli_query($GLOBALS['db'], $query);\n $row = mysqli_fetch_assoc($result);\n return $row;\n }", "public function getAmountPaid()\n {\n $amountPaid = 0;\n if ($this->payments) {\n foreach ($this->payments as $payment) {\n if ($payment->getStatus() == 'OK') {\n $amountPaid = $amountPaid + $payment->getAmount();\n }\n }\n }\n return $amountPaid;\n }", "private function getMonthlyActualPaymentsForTheCurrentYear($current_year)\n {\n $actual_expense = Transaction::mine()->where('type', 'expense')\n ->whereYear('transaction_date', $current_year)\n ->select(\n DB::raw('YEAR(transaction_date) year'),\n DB::raw('MONTH(transaction_date) month'),\n DB::raw('sum(amount) as ammount')\n )\n ->orderBy('transaction_date')\n ->groupBy(DB::raw('MONTH(transaction_date)'))\n ->get()->groupBy(function($row){\n return $row->month;\n });\n return $actual_expense;\n }", "public function getMonthPartnersIncome($year, $month) {\n //$vydaje = $this->db->table('translator_project')->where('accounted', 1)->where('translator_id=? OR translator_id=?', 1, 2)->where('project_id', $this->db->table('project')->select('id')->where('invoice_date LIKE ?', $year.'-'.$month.'%'))->sum('payment');\n //return $prijmy - $vydaje;\n return 0;\n }", "public function getLastPaymentDate(): \\DateTime\n {\n return $this->lastPaymentDate;\n }", "public static function outstandingPayments($yearMonth = false)\n {\n $where = '';\n if ($yearMonth) {\n $where = \" AND due_date BETWEEN '$yearMonth-01' AND '$yearMonth-31'\";\n }\n $open = Invoice::find_by_sql(\"SELECT \n sum(invoices.`sum`) as `summary` \n FROM \n invoices \n WHERE \n (invoices.`status` = 'Sent' \n OR \n invoices.`status` = 'Open') \n AND \n invoices.`estimate` != 1\n $where \n \");\n\n $partially = Invoice::find_by_sql(\"SELECT \n sum(invoices.`outstanding`) as summary \n FROM \n invoices \n WHERE \n invoices.`status` = 'PartiallyPaid'\n $where;\n \");\n $open[0]->summary = $open[0]->summary + $partially[0]->summary;\n return $open[0]->summary;\n }", "public function getMaximumAmountPerMonth()\n {\n return $this->maximumAmountPerMonth;\n }", "public function getNextMonth(){\n\t\tif($this->getMonth() == 12){return 1;}\n\t\telse{return $this->getMonth()+1;}\n\t}", "function _data_last_month_day()\n {\n $month = date('m');\n $year = date('Y');\n $day = date(\"d\", mktime(0, 0, 0, $month + 1, 0, $year));\n\n return date('Y-m-d', mktime(0, 0, 0, $month, $day, $year));\n }", "public function getExpiryMonth()\n {\n return $this->expiry_month;\n }", "private function getCurrent()\n {\n $this->db = $this->load->database(\"cms\", true);\n\n $query = $this->db->query(\"SELECT amount from monthly_income WHERE month=?\", array(date(\"Y-m\")));\n\n if($query->num_rows())\n {\n $row = $query->result_array();\n\n return $row[0]['amount'];\n }\n else\n {\n return 0;\n }\n }", "private function getLastPayPeriodEnd(){ $myq = getCurrentPayPeriod();\r\n $result = getQueryResult($this->config, $myq, $debug = false);\r\n $ppArray = $result->fetch_assoc();\r\n $startDate = $ppArray['PPBEG'];\r\n $this->lastPayStart = date('Y-m-d', strtotime('-14 days', strtotime($startDate)));\r\n $endDate = $ppArray['PPEND'];\r\n $this->lastPayEnd = date('Y-m-d', strtotime('-14 days', strtotime($endDate)));\r\n\r\n return $endDate;\r\n }", "function obtain_common_profit_month_ago($acc_number)\n\t{\n\t return $this->db->select_sum('pamm_clients_stat_sum')\n\t\t ->from('pamm_clients_statement') \n\t\t ->where(\"pamm_clients_stat_acc_number\",$acc_number)\n\t\t ->where(\"pamm_clients_stat_role IN ('PLI','PLU')\")\n\t\t ->where(\"pamm_clients_stat_date > date_sub(curdate(),INTERVAL 30 DAY)\")\n\t\t ->get()->result();\n\t}", "public function getPvCNextmonth()\n {\n return $this->pv_c_nextmonth;\n }", "public function get_last_payment_date( $context = 'view' ) {\n\t\treturn $this->get_prop( 'last_payment_date', $context ) ;\n\t}", "private function getPayum()\n {\n return $this->get('payum');\n }", "function _data_last_month_day() { \r\n $month = date('m');\r\n $year = date('Y');\r\n $day = date(\"d\", mktime(0,0,0, $month+1, 0, $year));\r\n \r\n return date('d/m/Y', mktime(0,0,0, $month, $day, $year));\r\n }", "public function get_month_permastruct()\n {\n }", "public function getPaidMoney()\n {\n $money = new Money($this->paidAmount, $this->paidCurrency);\n return $money;\n }", "function _data_last_month_day() {\n\t$month = date('m');\n\t$year = date('Y');\n\t$day = date(\"d\", mktime(0,0,0, $month+1, 0, $year));\n\n\treturn date('Y-m-d', mktime(0,0,0, $month, $day, $year));\n}", "public function getNextMonth()\n {\n return $this->calendarMonth->getNextMonth();\n }", "public function getPrevMonth(){\n\t\tif($this->getMonth() == 1){return 12;}\n\t\telse{return $this->getMonth()-1;}\n\t}", "public function getExpiryMonth()\n {\n return $this->expiryMonth;\n }", "public function getPvLLastmonth1()\n {\n return $this->pv_l_lastmonth1;\n }", "public static function getLastMonth()\n\t{\n\t\treturn date( 'n/Y', strtotime( '-1day '. date( 'F Y' ) ) );\n\t}", "function obtain_invested_means_month_ago($acc_number)\n\t{\n\t return $this->db->select_sum('pamm_clients_stat_sum')\n\t\t ->from('pamm_clients_statement') \n\t\t ->where(\"pamm_clients_stat_acc_number\",$acc_number)\n\t\t ->where(\"pamm_clients_stat_role IN ('I','U')\")\n\t\t ->where(\"pamm_clients_stat_sum > 0\")\n\t\t ->where(\"pamm_clients_stat_date < date_sub(curdate(),INTERVAL 30 DAY)\")\n\t\t ->get()->result();\n\t}", "public function getTotalPayment()\n\t{\n\t\treturn $this->total_payment;\n\t}", "public function getUserTotalPaid()\n {\n $user = getUser();\n $w = self::where('type', 'credit')->where('user_id', $user->id);\n return $w->sum('amount');\n }", "public function getTotalDue();", "public function paid()\n {\n $this->paidAmount = $this->price;\n }", "public function calcPaidThru($months = null, $op = null)\n {\n \tif ($months === null)\n \t\t$months = $this->calcMonths();\n \tif ($op === null)\n \t\t$op = OpDate::OP_ADD;\n \t$paid_thru = (new OpDate)->setFromMySql($this->getStartDt());\n \t$paid_thru->modify($op . $months . ' month');\n \t$paid_thru->setToMonthEnd();\n \treturn $paid_thru->getMySqlDate();\n }", "public function getAmountDue(Request $request){\n\n\n $data = UnremittedCash::where(['agent_id'=>$request->agent_id,'month'=>$request->month])->first();\n\n if($data)\n $amount = $data->amount;\n else\n $amount =0.00;\n\n return response()->json(['status' => 'success',\n 'data' => $amount\n ]);\n\n }", "public function getMonthlyInstalment(): float\n {\n return $this->monthlyInstalment;\n }", "function recalculateRebillDate()\n {\n if (is_null($this->tm_started) || in_array($this->status, array(self::RECURRING_FAILED, self::RECURRING_FINISHED, self::RECURRING_CANCELLED))) {\n $this->updateQuick('rebill_date', null);\n return;\n }\n $date = null;\n $c = $this->getPaymentsCount();\n if ($this->first_total <= 0)\n $c++; // first period is \"fake\" because it was free trial\n //if ($c < $this->getExpectedPaymentsCount()) // not yet done with rebills\n if ($this->rebill_times > ($c - 1)) { // not yet done with rebills\n // we count starting from first payment date, we rely on tm_started field here\n if ($this->first_total <= 0)\n list($date, ) = explode(' ', $this->tm_started);\n else\n $date = $this->getAdapter()\n ->selectCell(\"SELECT MIN(dattm) FROM ?_invoice_payment WHERE invoice_id=?d\", $this->invoice_id);\n $date = date('Y-m-d', strtotime($date));\n\n $period1 = new Am_Period($this->first_period);\n $date = $period1->addTo($date);\n $period2 = new Am_Period($this->second_period);\n for ($i = 1; $i < $c; $i++) { // we skip first payment here, already added above\n $date = $period2->addTo($date);\n }\n // If date is in the past, something is wrong here. Now we try to calculate rebill date from user's last payment.\n if ($date < $this->getDi()->dateTime->format('Y-m-d')) {\n\n $last_payment_date = $this->getAdapter()\n ->selectCell(\"SELECT MAX(dattm) FROM ?_invoice_payment WHERE invoice_id=?d\", $this->invoice_id);\n if ($last_payment_date) {\n\n $period = new Am_Period($this->second_period);\n $date = date('Y-m-d', strtotime($last_payment_date));\n $date = $period->addTo($date);\n }\n // date is in the past again; Use tomorrow's date instead;\n $restore_limit_date = $this->getDi()->dateTime;\n $restore_limit_date->modify('-30 days');\n if (($date < $this->getDi()->sqlDate) && ($date > $restore_limit_date->format('Y-m-d'))) {\n $tomorrow = $this->getDi()->dateTime;\n $tomorrow->modify('+1 days');\n $date = $tomorrow->format('Y-m-d');\n }\n }\n }\n $this->updateQuick('rebill_date', $date);\n }", "public function postpaidPayment()\n {\n $bio = $this->customerData();\n // return $bio;\n $topups = Payment::where('email', '[email protected]')->get();\n // return $topups;\n $previous_topup = array_flatten(last($topups));\n $prev_tops = 0;\n if ($previous_topup) {\n $prev_top = Transaction::where('payment_id', $previous_topup[0]['id'])->first();\n $prev_tops = $prev_top ? $prev_top->initial_amount : 0;\n }\n // return $previous_topups;\n return view('customer.postpaid-payment', compact('prev_tops'))->withBio($bio);\n }", "function getTotalPayment($id_purchase) {\n $data = $this->db\n ->select('sum(payment_total) as total_paid')\n ->where('id_purchase',$id_purchase)\n ->order_by('payment_date','desc')\n ->get('purchase_payment')\n ->row_array();\n if ($data) {\n return $data['total_paid'];\n } else {\n return 0;\n }\n }", "public function getPaidValue()\n {\n return defined('static::PAID_VALUE') ? static::PAID_VALUE : 'paid';\n }", "public function getPvLLastmonth2()\n {\n return $this->pv_l_lastmonth2;\n }", "function month_last_day($year, $month){\r\n\treturn date(\"d\", mktime(0, 0, 0, $month + 1, 1, $year) - 1);\r\n}", "public function getPaymentAmount()\n {\n return $this->bonus + parent::getSalary();\n }", "function get_amount($date) {\n global $debug;\n $val = null;\n $money = 0;\n //if ($debug) { echo \"comparing value range for this object: \"; print_r($item); }\n foreach ($this->list as $item) {\n if ($item->includes($date)) {\n $val = $item;\n }\n }\n if (!$val) {\n return $money;\n }\n $period = $val->period;\n switch ($period) {\n case 'weekly':\n // this is only debited once every week.\n // make sure it is a multiple of 1 week offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 7 == 0) {\n $money = $val->amount;\n }\n break;\n case 'biweekly':\n // this is only debited once every 2 weeks.\n // make sure it is a multiple of 2 weeks offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 14 == 0) {\n $money = $val->amount;\n }\n break;\n case 'monthly': \n // this is debited once per month\n // make sure the day of month matches the day from $val->extra\n $day_amount = date('d', strtotime($val->extra));\n $day_this = date('d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'semiannual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_amount_semi = date('m-d', strtotime(\"+6 months\", strtotime($val->extra)));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount || $day_this == $day_amount_semi) {\n $money = $val->amount;\n }\n break;\n case 'annual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'once':\n // make sure date matches exactly with $val->extra\n if ($date == $val->extra) {\n $money = $val->amount;\n }\n break;\n case 'daily':\n // always return the same value\n $money = $val->amount;\n break;\n default:\n throw new Exception(\"unkown period '$period'\");\n }\n if ($debug) {\n printf(\"get_amount($date) $val->period, $val->amount, $val->extra -> $money\\n\");\n }\n return $money;\n }", "function obtain_invested_means_first_period_month($acc_number)\n\t{\n\t return $this->db->select()\n\t\t ->from('pamm_clients_statement') \n\t\t ->where(\"pamm_clients_stat_acc_number\",$acc_number)\n\t\t ->where(\"pamm_clients_stat_date < date_sub(curdate(),INTERVAL 30 DAY)\")\n\t\t ->get()->result();\n\t}", "public function bulanan()\n {\n $month = array();\n\n $this->db->select('SUM(hargatotal) as bulan');\n $this->db->from('bahanterpakai');\n $this->db->where('MONTH(tglpakai) = MONTH(NOW()) AND YEAR(tglpakai) = YEAR(NOW())');\n\n $query = $this->db->get();\n if ($query->num_rows() > 0) {\n $month = $query->result();\n }\n\n return $month;\n }", "function get_end_of_trade_period($acc_number)\n\t{\n\t return $this->db->select('last_order_number')\n\t\t ->from('pamm_tp') \n\t\t ->where(\"number\",$acc_number)\n\t ->order_by('first_order_number', 'DESC')\n\t\t ->get()->result();\n\t}", "public static function getLastDayOfCurrentMonth()\n\t{\n\t\t$dateInSeconds = mktime(0, 0, 0, date('m')+1, 0, date('Y'));\n\t\t$date = date('Y-m-d', $dateInSeconds);\n\t\treturn $date;\n\t}", "public function getCurrentMonthData() {\n\t\t//return $this->getDataByInterval($currentMonth, $currentYear, $currentMonth, $currentYear);\n\t\t$dates = getPeriods('CurrentMonth');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear']);\t\t\n\t}", "function getNextMonth() {\n\t\t$nextDate = date ( \"Y-m-d\", strtotime ( \"+1 months\" ) );\n\t\t$dateArray = split ( \"-\", $nextDate );\n\t\t$nextMonth = FormatClass::getMonthName ( $dateArray [1], \"full\" );\n\t\treturn $nextMonth;\n\t}", "public function totalMes(){\n //$conexao = $c->conexao();\n\n $sql = \" SELECT ifnull(sum(c.valor+c.troco),0) as total from tbpedido_pagamento c WHERE MONTH(c.data_pagamento) = MONTH(now()) and c.status = 'F';\";\n $rstotal = $this->conexao->query($sql);\n $result = $rstotal->fetch_assoc();\n $totalgeral = $result['total'];\n\n return $totalgeral;\n }", "private function getMonth() {\n\t\treturn $this->month;\n\t}", "public function currentMonthPersonBazar()\n {\n $this->db->select('name,sum(bazartk) as y');\n $this->db->where('YEAR(date) = YEAR(CURRENT_DATE()) AND MONTH(date) = MONTH(CURRENT_DATE())');\n $this->db->from('bazar');\n $this->db->group_by('name');\n $query = $this->db->get();\n //echo $this->db->last_query(); exit;\n //$query = $this->db->get('user');\n return $query->result();\n \n }", "public function calculate_end_month_bonus()\n {\n $year = (new DateTime)->format(\"Y\");\n $month = (new DateTime)->format(\"n\");\n\n if($month == 1){\n $month = 12;\n $year = $year - 1;\n } else {\n $month = $month - 1;\n }\n\n //count for DO Rank Members\n $do_members = ActiveDo::all();\n $sdo_members = ActiveSdo::all();\n //$userPurchases = UserPurchase::all(); // originall\n $userPurchases = UserPurchase::groupBy('user_id', 'product_id')\n ->selectRaw('user_id, product_id, sum(price) as price, sum(pv) as pv, count(*) as quantity')\n ->whereMonth('created_at', $month)\n ->whereYear('created_at', $year)\n ->get();\n //$userStores = Store::all(); // originall\n $userStores = Store::groupBy('user_id', 'product_id')\n ->selectRaw('user_id, product_id, sum(price) as price, sum(pv) as pv, count(*) as quantity')\n ->whereMonth('created_at', $month)\n ->whereYear('created_at', $year)\n ->get();\n \n $next_do_members= $do_members;\n $i = 0;\n $n = count($do_members);\n\n $total_sales1 = UserPurchase::sum('price');\n $total_sales2 = Store::sum('price');\n $total_sales = $total_sales1 + $total_sales2;\n\n $total_pv1 = UserPurchase::sum('pv');\n $total_pv2 = Store::sum('pv');\n $total_pv = $total_pv1 + $total_pv2;\n\n //$sale = Sale::where('year', $year)->where('month', $month)->first();\n $sale = Sale::firstOrCreate([]);\n $sale->re_total_sale = $total_sales;\n $sale->re_total_pv = $total_pv;\n $sale->save();\n\n // echo '<br>';\n // echo '<pre>';\n // print_r($userStores);\n // echo '<pre>';\n // echo '<br>';\n\n foreach ($userPurchases as $userPurchase) \n {\n $this->retail_price($userPurchase->user_id, $userPurchase->price, $userPurchase->product_id);\n //$this->upline_personal_rebate($userPurchase->user_id, $userPurchase->pv);\n $this->personal_rebate($userPurchase->user_id, $userPurchase->pv, $userPurchase->product_id);\n }\n\n foreach($userStores as $store)\n {\n $this->retail_price($store->user_id, $store->price, $store->product_id);\n //$this->pay_valid_upline_for_personal_rebate($store->user_id, $store->pv);\n //$this->upline_personal_rebate($store->user_id, $store->pv);\n $this->personal_rebate($store->user_id, $store->pv, $store->product_id);\n }\n\n foreach($do_members as $member)\n {\n $this->calculate_active_do_personal_gpv($member->user_id);\n // $this->group_bonus($member->user_id);\n }\n\n foreach($do_members as $member)\n {\n // $this->calculate_active_do_personal_gpv($member->user_id);\n $this->group_bonus($member->user_id);\n }\n\n $this->calculate_total_group_pv();\n\n foreach ($sdo_members as $smember) {\n $this->calculate_active_sdo_personal_gpv($smember->user_id);\n // $this->sdo_bonus($smember->user_id); //need to separate\n // $this->sdo_to_sdo_bonus($smember->user_id); //need to separate\n }\n\n foreach ($sdo_members as $smember) {\n $this->sdo_bonus($smember->user_id); \n $this->sdo_to_sdo_bonus($smember->user_id); \n }\n\n // foreach($next_do_members as $next_member)\n // {\n // //$this->calculate_active_do_personal_gpv($member->user_id);\n // $this->group_bonus($next_member->user_id);\n // }\n\n $ewallets = Wallet::all();\n\n foreach ($ewallets as $wallet) {\n //$this->direct_sponsor_bonus($wallet->user_id, $wallet->pv, $wallet->first_purchased);\n $this->direct_sponsor_bonus($wallet->user_id, $wallet->pv);\n }\n\n $do_cto_bonus = $this->do_cto_bonus();\n $sdo_cto_bonus = $this->sdo_cto_bonus();\n\n //$this->countTotalBonus();\n $this->recordUserBonuses();\n //$this->countTotalBonus();\n }", "public function calculate_package_period($period)\n {\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +1 day\");\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +1 week\");\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +2 week\");\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +1 month\");\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +30 days\");\n $today=Date('Y-m-d');\n if($period==1){\n $date = strtotime(date(\"Y-m-d\", strtotime($today)) . \" +3 month\");\n $membership_end = date(\"Y-m-d\", $date);\n }else if($period==0){\n $membership_end='';\n }\n return array('membership_end'=>$membership_end);\n }", "public function iN_CurrentDayTotalPremiumEarning() {\n\t\t$query = mysqli_query($this->db, \"SELECT SUM(admin_earning) AS DayTotalEarnPremium FROM i_user_payments WHERE payment_type = 'post' AND payment_status = 'ok' AND DAY(FROM_UNIXTIME(payment_time)) = DAY(CURDATE()) \") or die(mysqli_error($this->db));\n\t\t$row = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\treturn isset($row['DayTotalEarnPremium']) ? $row['DayTotalEarnPremium'] : '0.00';\n\t}", "public function getCurrentMonth() {\n return date('m');\n }", "public function getExpiryMonth()\n {\n return $this->getParameter('expiryMonth');\n }", "protected function get_totalVentas()\n {\n $ventas = DB::SELECT(\"SELECT SUM(subtotal) AS t_mes \n FROM pedidos \n WHERE extract(month FROM current_date) = extract(month FROM created_at);\");\n foreach($ventas as $venta)\n {\n $totalMes = $venta->t_mes;\n }\n return $totalMes;\n }", "protected function month(){\n return $this->now->format('m');\n }", "public static function monthlyEarningOfUser($chat_id)\n {\n return TelegramPost::where('channel_owner_id',$chat_id)\n ->whereYear('created_at',now()->year())\n ->whereMonth('created_at',now()->month)\n ->where('is_first',true)->sum('earning');\n }", "public function paid()\n {\n $expenses = Expense::where(\"status\", 'verified')->orderBy('created_at', 'DESC')->get();\n $expenses->map(function ($expense) {\n return $expense->payment_account;\n });\n return response()->json($expenses);\n }", "public function getAnnualPrice(): float\n {\n $ratio = $this->getMonths() / 12;\n return $this->getPrice() / $ratio;\n }", "function ultimo_dia_periodo() { \n\n $sql=\"select fecha_fin from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql); \n return $resul[0]['fecha_fin'];\n }", "function getNextMonthTimestamp()\n{\n return Carbon::now()->addMonth()->toDateTimeString();\n}", "public function getAmtPaidSat()\n {\n return $this->amt_paid_sat;\n }", "function total_monthly_cost($sum, $months, $monthfee, $rate, $startfee, $cur)\n{\n\t$sum_j_to_N = 0;\n\t// reference: Avbetalningsplaner.pdf\n\t$K0 = $sum;\n\t$A = $monthfee;\n\t$S = $startfee;\n\t$R = (pow(1.0+$rate/10000, 1.0/12.0));\n\t$N = $months;\n\tif ($rate == 0)\n\t$T = (1 / $N)*($K0 + ($N * $A) + $S);\n\telse\n\t{\n\t\t// the total cost of fees plus the cost of paying off the monthly fee first and after that amortize\n\t\tfor ($j = 2; $j < $N+1; $j++)\n\t\t{\n\t\t\t$sum_j_to_N = $sum_j_to_N + pow($R, $N - $j) * $A;\n\t\t}\n\t\t$T = (($R - 1) / (pow($R, $N) - 1)) * (pow($R, $N) * $K0 + $sum_j_to_N + pow($R, $N - 1) * ($A + $S));\n\t}\n\n\treturn round($T, 0);\n}", "function nextMonth($interval=1){ return $this->_getDate(0,$interval); }", "public static function get_total_price_remain($repair_staff_id, $month, $year)\n\t{\n\t\t$month = $month < 10 ? '0'.$month : $month;\n\t\t$past_date = date(\"Y-m-d\", strtotime(\"first day of last month\"));\n\t\t$last_month = date('m', strtotime($past_date));\n\n\t\t//if is last month\n\t\tif($month == $last_month)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\t$query = DB::select(DB::expr(\"SUM(price) as total\"))\n\t\t\t\t->from(self::$_table_name)\n\t\t\t\t->where('repair_staff_id', $repair_staff_id)\n\t\t\t\t->where(DB::expr(\"DATE_FORMAT(arrival_time,'%Y-%m-%d') > '\".date('Y-m-d').\"' AND DATE_FORMAT(arrival_time,'%Y-%m-%d') <= '\".date('Y-m-t').\"'\"));\n\n\t\t$result = $query->execute()->as_array();\n\t\tif($result[0]['total'])\n\t\t{\n\t\t\treturn $result[0]['total'];\n\t\t}\n\n\t\treturn 0;\n\t}", "public function getDifferenceInMonths();", "public function getTotalAmount()\n {\n $response = ['status' => false];\n\n if ($user = Auth::user()) {\n $payment = $user->payments()->get()->last() ?: 0;\n setlocale(LC_MONETARY, 'en_US');\n $response = ['status' => true, 'total_amount' => money_format('%i', $payment ? $payment->total_amount : 0)];\n }\n return response()->json($response);\n }" ]
[ "0.68698126", "0.68231267", "0.6483436", "0.6371976", "0.6362899", "0.6345615", "0.6224541", "0.61965346", "0.6177446", "0.61648774", "0.61598235", "0.6116789", "0.60735", "0.6034552", "0.6029726", "0.6013092", "0.5995471", "0.59944236", "0.5983563", "0.59803563", "0.59561753", "0.5928262", "0.5925282", "0.5916086", "0.5881043", "0.5862726", "0.58430016", "0.5820886", "0.5810488", "0.5802543", "0.5765557", "0.57604", "0.5756122", "0.57522076", "0.5751385", "0.5741621", "0.57365054", "0.5725953", "0.57152593", "0.5704778", "0.57044697", "0.5681543", "0.5681173", "0.5655845", "0.56541675", "0.56468487", "0.5644879", "0.5638829", "0.5636852", "0.5634423", "0.563141", "0.5626536", "0.5604022", "0.56002116", "0.5567831", "0.55524254", "0.5540905", "0.55376077", "0.55288804", "0.55209494", "0.5518468", "0.55151844", "0.55025005", "0.5501544", "0.5501365", "0.5497846", "0.54889816", "0.54776096", "0.5464334", "0.54580384", "0.54561925", "0.54536414", "0.5429384", "0.54290336", "0.5388702", "0.53876835", "0.53832513", "0.5377264", "0.5368615", "0.5368036", "0.53603643", "0.53580636", "0.53553724", "0.5343431", "0.5341958", "0.534162", "0.5339095", "0.5337402", "0.5334716", "0.53343153", "0.5313348", "0.53028107", "0.5302003", "0.52970874", "0.5294392", "0.5294327", "0.529099", "0.52895343", "0.5280143", "0.5277971" ]
0.53571135
82
Get paid amount last year
public function getAmountsDataLastYear($vendorId) { $to = $this->_date->date('Y-m-d'); $from = strtotime($to."-1year"); $from = $this->_date->date('Y-m-d', $from); $to .= ' 23:59:59'; $orderResource = $this->_vendorOrderFactory->create()->getResource(); $data = $orderResource->getAmountsByMonth($from, $to, $vendorId); $result = $this->_processOrderData($data); $result = array_values($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getYear() {}", "public function receipt_year() {\n $this->db->select('YEAR(receipt_master.date_transfer) AS year_pay');\n $this->db->where('receipt_master.type_receipt_id', 5);\n $this->db->where('receipt_master.status_receipt_id', 1);\n $this->db->where('receipt_master.status_transfer_id', 3);\n $this->db->where('receipt_master.shop_id_pri', $this->session->userdata('shop_id_pri'));\n $this->db->where('receipt_master.date_transfer !=', '');\n $this->db->group_by('YEAR(receipt_master.date_transfer)');\n return $this->db->get('receipt_master');\n }", "public function getLastYearData() {\n\t\t$dates = getPeriods('LastYear');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear'], 12);\t\t\n\t}", "public function getTotalPaid();", "function formatAsYears($paymentPeriods, $paymentTerm)\n{\n $days = $paymentPeriods * $paymentTerm;\n $years = round($days / 365, 1);\n return $years;\n}", "function it_returns_one_percent_for_one_payment_one_year_after_the_advance()\n {\n $this->addPayment(101, 365);\n\n $this->calculate()->shouldReturn(1.0);\n }", "public function latestYear()\n\t{\n\t\t$year = $this->doll->orderBy('release_year', 'DESC')->pluck('release_year');\n\t\treturn $year;\n\t}", "public function getFullYear()\r\n\t{\r\n\t\treturn $this->format('Y');\r\n\t}", "protected function year(){\n return $this->now->format('Y');\n }", "public function get_year_permastruct()\n {\n }", "function totalSaleCurrentYear()\r\n {\r\n \r\n // $strSQLQuery = \"SELECT SUM(TotalPrice) as OrderTotal FROM e_orders WHERE (DATE(OrderDate) BETWEEN '\".date('Y').'-01-01'.\"' AND '\".date('Y').'-12-31'.\"') AND PaymentStatus=1 AND OrderStatus='Completed'\";\r\n $strSQLQuery = \"SELECT SUM((CASE when Currency='USD' then TotalPrice \r\n \t\telse TotalPrice/CurrencyValue\r\n\tEND )) as OrderTotal FROM e_orders WHERE (DATE(OrderDate) BETWEEN '\".date('Y').'-01-01'.\"' AND '\".date('Y').'-12-31'.\"') AND (PaymentStatus='1' OR OrderType in('Amazon','Ebay')) AND OrderStatus in ('Completed', 'Shipped','Unshipped') \";\r\n \r\n $arrayRow = $this->query($strSQLQuery, 1);\r\n return $arrayRow[0]['OrderTotal'];\r\n }", "public function getExpiryYear()\n {\n return $this->expiry_year;\n }", "public function getExpiryYear()\n {\n return $this->expiryYear;\n }", "public function totalOfYear() {\n\n $query = \"SELECT SUM(TOTAL) AS TOTAL_YEAR FROM BUY WHERE YEAR(BUYDATE) = YEAR(NOW()) \";\n\n $result = parent::query($query);\n\n if ($row = $result->fetch_assoc()) {\n return $row['TOTAL_YEAR'];\n }\n\n return null;\n }", "public function getDifferenceInYears();", "public function getAmtPaid()\n {\n return $this->amt_paid;\n }", "public function getBaseTotalPaid();", "public function getYear() : string;", "public function getYear() {\n return $this->_year;\n }", "public function getYear()\n {\n return $this->year;\n }", "public function getYear()\n {\n return $this->year;\n }", "function previousYear($interval=1){ return $this->_getDate(0,0,-$interval); }", "function nextYear($interval=1){ return $this->_getDate(0,0,$interval); }", "public function getHighestYear() {\n\t\t$query = $this->createQuery();\n\t\t$query->getQuerySettings()->setRespectStoragePage(FALSE);\n\t\t$query->statement(\"SELECT MAX(year) as year FROM `tx_wxlottery_domain_model_partnerlog`\");\n\t\treturn $query->execute()->getFirst()->getYear();\n }", "public function getInvoiceYear(): int\n {\n return (int)($this->createdAt ? $this->createdAt->format('y') : date('y'));\n }", "function getYear()\r\n {\r\n return $this->ano;\r\n }", "function obtain_year_profitable($acc_number)\n\t{\n\t return $this->db->select('AVG(pamm_tp_profitable) AS ptp,year(pamm_tp_timestamp) AS year')\n\t\t ->from('pamm_tp_results') \n\t\t ->where(\"pamm_tp_account\",$acc_number)\n\t\t ->group_by('year(pamm_tp_timestamp)')\n\t\t ->get()->result();\n\t}", "public static function outstandingPayments($yearMonth = false)\n {\n $where = '';\n if ($yearMonth) {\n $where = \" AND due_date BETWEEN '$yearMonth-01' AND '$yearMonth-31'\";\n }\n $open = Invoice::find_by_sql(\"SELECT \n sum(invoices.`sum`) as `summary` \n FROM \n invoices \n WHERE \n (invoices.`status` = 'Sent' \n OR \n invoices.`status` = 'Open') \n AND \n invoices.`estimate` != 1\n $where \n \");\n\n $partially = Invoice::find_by_sql(\"SELECT \n sum(invoices.`outstanding`) as summary \n FROM \n invoices \n WHERE \n invoices.`status` = 'PartiallyPaid'\n $where;\n \");\n $open[0]->summary = $open[0]->summary + $partially[0]->summary;\n return $open[0]->summary;\n }", "public static function totalIncomeForYear($year)\n {\n $income = Invoice::find_by_sql(\"SELECT \n SUM(`sum`) as summary\n FROM\n ((SELECT \n SUM(`sum`) AS `sum`\n FROM\n invoices\n WHERE\n `status` = 'Paid' \n AND \n `paid` = '0'\n AND \n paid_date BETWEEN '$year-01-01' AND '$year-12-31'\n ) \n UNION ALL (SELECT \n SUM(T3.`amount`) AS `sum`\n FROM\n invoice_has_payments AS T3\n LEFT JOIN\n invoices AS T4\n ON \n T3.invoice_id = T4.id \n WHERE \n (T4.`status` = 'PartiallyPaid' OR (T4.`status` = 'Paid' AND T4.`paid` != '0'))\n AND \n T3.`date` \n BETWEEN '$year-01-01' AND '$year-12-31' \n\n ) ) t1\n \");\n\n return $income[0]->summary;\n }", "public function getYear(){\n\t\treturn $this->_year;\n\t}", "public function GetYear() {\n return $this->format('Y');\n }", "public function getPaymentDate();", "function find_dob_yr($year)\n {\n $this->db->_protect_identifiers = FALSE;\n\n return $this->db->select('name, nat, cat, dob_md')\n ->from('authors')\n ->join('nats', 'nats.id = authors.nat_id')\n ->join('cats', 'cats.id = authors.cat_id')\n ->where('dob_yr', $year)\n ->order_by(\"str_to_date(dob_md, '%M %E')\")\n ->get()->result();\n }", "public function getYear()\n {\n return $this->_getDateValue('Y');\n }", "public function getCurrentYear() {\n return date('Y');\n }", "public function getYear()\n\t{\n\t\treturn $this->year;\n\t}", "public function getYear() : int\n {\n return $this->year;\n }", "public function getAnnualSales() {\n\t\t// Query\n\t\t$sql = '\n\t\t\tSELECT \n\t\t\t\tDATE_FORMAT(transactionDate, \"%Y\") AS year, \n\t\t\t\tSUM(amount) AS amount\n\t\t\tFROM \n\t\t\t\ttransactions\n\t\t\tGROUP BY \n\t\t\t\tDATE_FORMAT(transactionDate, \"%Y\")\n\t\t';\n\n\t\t// Return\n\t\treturn DB::select($sql);\n\t}", "public static function getLastDayOfCurrentYear()\n\t{\n\t\t$dateInSeconds = mktime(0, 0, 0, 12, 31, date('Y'));\n\t\t$date = date('Y-m-d', $dateInSeconds);\n\t\treturn $date;\n\t}", "public function getPaidAt(): Carbon\n {\n return $this->paidAt;\n }", "public function getExpiryYear()\n {\n return $this->getParameter('expiryYear');\n }", "public function getYear()\n\t{\n\t\treturn $this->year \n\t\t\t?? $this->year = date('Y');\n\t}", "public function addYears($years){\n\t\t$this->_year+=$years;\n\t\t$this->_consolideDate();\n\t\treturn $this->_date;\n\t}", "public function getYear()\r\n\t{\r\n\t\treturn $this->format('y');\r\n\t}", "function get_current_year() {\n global $db;\n $query = 'SELECT max(year) FROM CalcBatting';\n $statement = $db->prepare($query);\n $statement->execute();\n $return = $statement->fetch();\n $statement->closeCursor();\n $current_year = $return[0];\n return $current_year;\n}", "public function getAmountPaid()\n {\n $amountPaid = 0;\n if ($this->payments) {\n foreach ($this->payments as $payment) {\n if ($payment->getStatus() == 'OK') {\n $amountPaid = $amountPaid + $payment->getAmount();\n }\n }\n }\n return $amountPaid;\n }", "function getCurrentYear ()\n\t{\n\t\treturn date ('Y');\n\t}", "public function getAmountPaid()\n {\n return $this->amountPaid instanceof TypedMoneyBuilder ? $this->amountPaid->build() : $this->amountPaid;\n }", "public function getYearPrice($id ,$type)\n {\n $r = $this->preFind($id);\n $date = Carbon::now()->subYear($type)->toDateString();\n return $r->price()->where([['month' , '>=' , $date]])->orderBy(\"month\",\"asc\")->groupBy(\"month\")->get();\n }", "public function diffYears($years){\n\t\t$this->_year-=$years;\n\t\t$this->_consolideDate();\n\t\treturn $this->_date;\n\t}", "public function modelYear();", "public function getPaidValue()\n {\n return defined('static::PAID_VALUE') ? static::PAID_VALUE : 'paid';\n }", "public function getPaidMoney()\n {\n $money = new Money($this->paidAmount, $this->paidCurrency);\n return $money;\n }", "public function trae_solo_anio_actual()\n {\n return $this->fecha->year;\n }", "private function resolve_year() {\n $academicYearStart = strftime(\"%Y\",strtotime(\"-8 months\",time()));\n $academicYearEnd = strftime(\"%Y\",strtotime(\"+4 months\",time()));\n return \"Academic Year $academicYearStart/$academicYearEnd\";\n }", "public static function yearOrMostRecent($year) {\n\t if($year > 0 AND CompYear::where('year', $year)->count() > 0) {\n\t return $year;\n\t } else {\n\t return CompYear::orderBy('year', 'desc')->first()->year;\n\t }\n\t}", "public function addYears($year, $format = self::datePattern) {\r\n $date = new DateTime($this->parmDate());\r\n if($year < 0)\r\n {\r\n $date->sub(new DateInterval(\"P\".abs($year).\"Y\"));\r\n }\r\n else\r\n {\r\n $date->add(new DateInterval(\"P\".$year.\"Y\"));\r\n }\r\n return $date->format($format); \r\n }", "public function getYear(): string\n {\n return $this->toLocalizedString('y');\n }", "public static function getCurrentYear() {\n return date('Y');\n }", "public function getAcademic()\n {\n $now = Carbon::now();\n\n $year = $now->year + 4;\n\n return ($now->month >= 8) ? ($year - 1911) : ($year - 1912);\n }", "function getYearsSelect()\n\t{\n\t\treturn $this->db->query(\"SELECT distinct(year(created_sell)) as yearssell from tb_sell where status <> 1 order by created_sell desc\")->result();\n\t}", "public function getExpYear(Order $order)\n {\n try {\n $yearAdapter = $this->paymentVerificationFactory->createPaymentExpYear($order->getPayment()->getMethod());\n\n $this->logger->debug('Getting expiry year using ' . get_class($yearAdapter), ['entity' => $order]);\n\n $expYear = $yearAdapter->getData($order);\n\n if (isset($expYear) === false) {\n return null;\n }\n\n $expYear = preg_replace('/\\D/', '', $expYear);\n\n $expYear = (int) $expYear;\n if ($expYear <= 0) {\n return null;\n }\n\n //If returned expiry year has less then 4 digits\n if ($expYear < 1000) {\n $expYear += 2000;\n }\n\n return $expYear;\n } catch (Exception $e) {\n $this->logger->error('Error fetching expiration year: ' . $e->getMessage(), ['entity' => $order]);\n return null;\n }\n }", "function getMinYears()\n {\n return 0;\n }", "public function getAnnualPrice(): float\n {\n $ratio = $this->getMonths() / 12;\n return $this->getPrice() / $ratio;\n }", "public function getMinYearBuilt();", "function get_yr_nxt($cur_date){\n $date_split=split(\"-\",$cur_date);\n return date(\"d-m-Y\",mktime (0,0,0,$date_split[1],$date_split[0],($date_split[2]+1)));\n }", "function get_current_finacial_year(){\n $str_query=\"select financial_year_id, year_name, date_start, date_end from financial_year \n where CURDATE() between date_start and date_end\";\n\tif (!$this->sql_query($str_query)){\n return false;\n\t}\n\t\n return $this->fetch();\n }", "public function getTotalSPerYear(){\n // FROM [mon].[ProjectDetail]\n // GROUP BY YEAR([CreatedAt])\n $result = [];\n $this->db->select(\"YEAR([CreatedAt]) as year, count(ApiKey) as count\");\n $this->db->from($this->TBL_SDEVICEPROFILE);\n $this->db->group_by('YEAR([CreatedAt])');\n $q = $this->db->get();\n return $q->result_array();\n }", "public function paid()\n {\n $this->paidAmount = $this->price;\n }", "function get_year()\n {\n $datearray=getdate($this->timestamp);\n return $datearray[\"year\"];\n }", "function this_year()\n{\n global $db; // golbalize db variable:\n $thisYear = date('Y') . '-01-01';\n $nextYear = ((int) date('Y') + 1) . '-01-01';\n $datesIds = $db->getMany(DATES, [\n 'date' => $thisYear,\n 'dates.date' => $nextYear,\n ], ['id', 'date'], ['date' => '>=', 'dates.date' => '<=']);\n if ($db->count > 0) {\n return $datesIds;\n }\n}", "public function getUserTotalPaid()\n {\n $user = getUser();\n $w = self::where('type', 'credit')->where('user_id', $user->id);\n return $w->sum('amount');\n }", "function get_annual_period_balance($cur='IDR',$acc=null,$eyear=null)\n {\n// transactions.debit, transactions.credit, transactions.vamount, gls.approved');\n \n $this->db->select_sum('transactions.vamount');\n $this->db->select_sum('transactions.debit');\n $this->db->select_sum('transactions.credit');\n \n $this->db->from('gls, transactions, accounts');\n $this->db->where('gls.id = transactions.gl_id');\n $this->db->where('transactions.account_id = accounts.id');\n $this->db->where('YEAR(dates)', $eyear);\n $this->db->where('gls.currency', $cur);\n $this->cek_null($acc,\"transactions.account_id\");\n $this->db->where('gls.approved', 1);\n $this->db->where('accounts.deleted', NULL);\n return $this->db->get(); \n }", "public static function paymentsForMonth($yearMonth)\n {\n $Paid = Invoice::find_by_sql(\"SELECT \n SUM(`sum`) as summary\n FROM\n ((SELECT \n SUM(`sum`) AS `sum`\n FROM\n invoices\n WHERE\n `status` = 'Paid' \n AND \n `paid` = '0' \n AND \n paid_date BETWEEN '$yearMonth-01' AND '$yearMonth-31'\n Group By \n `sum`\n ) \n UNION ALL (SELECT \n SUM(T3.`amount`) AS `sum`\n FROM\n invoice_has_payments AS T3\n LEFT JOIN\n invoices AS T4\n ON \n T3.invoice_id = T4.id \n WHERE \n (T4.`status` = 'PartiallyPaid' OR (T4.`status` = 'Paid' AND T4.`paid` != '0'))\n AND \n T3.`date` BETWEEN '$yearMonth-01' AND '$yearMonth-31' \n GROUP BY \n `sum`\n ) ) t1\n \");\n\n return $Paid[0]->summary;\n }", "function getMaxYears()\n {\n return 9999;\n }", "public function GetThisYear()\n\t\t{\n\t\t\t$year = date('Y');\n\t\t\treturn $year;\n\t\t}", "public function list_invoice_select($current_year,$next_year){\n\n$this->db->where(\"year BETWEEN '$next_year' and '$current_year'\", NULL, FALSE); \n$this->db->order_by(\"year\", \"desc\");\n\t\n$result\t= $this->db->get('invoice');\n\n\t\treturn $result->result();\t\n}", "private function getMonthlyActualIncomeForTheCurrentYear($current_year)\n {\n $actual_income = Transaction::mine()->where('type', 'income')\n ->whereYear('transaction_date', $current_year)\n ->select(\n DB::raw('YEAR(transaction_date) year'),\n DB::raw('MONTH(transaction_date) month'),\n DB::raw('sum(amount) as ammount')\n )\n ->orderBy('transaction_date')\n ->groupBy(DB::raw('MONTH(transaction_date)'))\n ->get()->groupBy(function($row){\n return $row->month;\n });\n return $actual_income;\n }", "private function getMonthlyActualPaymentsForTheCurrentYear($current_year)\n {\n $actual_expense = Transaction::mine()->where('type', 'expense')\n ->whereYear('transaction_date', $current_year)\n ->select(\n DB::raw('YEAR(transaction_date) year'),\n DB::raw('MONTH(transaction_date) month'),\n DB::raw('sum(amount) as ammount')\n )\n ->orderBy('transaction_date')\n ->groupBy(DB::raw('MONTH(transaction_date)'))\n ->get()->groupBy(function($row){\n return $row->month;\n });\n return $actual_expense;\n }", "public function get_lastet_year($villaid) {\n\n\t\t $query=\"SELECT MAX(`year`) AS ano FROM `\".DB_PREFIX1.\"statements` WHERE `id_villa`='\".$this->link->myesc($villaid).\"'\";\n\n\t\t $result=$this->link->query($query);\n\t\t foreach($result AS $result)\n\t\t return $result;\n\t\t}", "public function getCreditCardExpirationYear()\n {\n return $this->creditCardExpirationYear;\n }", "public function getPaymentAmount()\n {\n return $this->bonus + parent::getSalary();\n }", "public function getStatForDonations() {\r\n // TODO: Move to config\r\n $requiredPerYear = 1000;\r\n $requiredPerMonth = 85;\r\n\r\n // Calculate donations received for current year\r\n $result = $this->dao->query(\"\r\n SELECT\r\n SUM(amount) AS YearDonation,\r\n year(NOW()) AS yearnow,\r\n month(NOW()) AS month,\r\n quarter(NOW()) AS quarter\r\n FROM\r\n donations\r\n WHERE\r\n created > CONCAT(CONCAT(year(NOW()), '-01'), '-01')\r\n \");\r\n $rowYear = $result->fetch(PDB::FETCH_OBJ);\r\n\r\n switch ($rowYear->quarter) {\r\n case 1:\r\n $start = $rowYear->yearnow . \"-01-01\";\r\n $end = $rowYear->yearnow . \"-04-01\";\r\n break;\r\n case 2:\r\n $start = $rowYear->yearnow . \"-04-01\";\r\n $end = $rowYear->yearnow . \"-07-01\";\r\n break;\r\n case 3:\r\n $start = $rowYear->yearnow . \"-07-01\";\r\n $end = $rowYear->yearnow . \"-10-01\";\r\n break;\r\n case 4:\r\n $start = $rowYear->yearnow . \"-10-01\";\r\n $end = $rowYear->yearnow . \"-12-31\";\r\n break;\r\n }\r\n\r\n $query = \"\r\n SELECT\r\n SUM(ROUND(amount)) AS Total,\r\n year(now()) AS year\r\n FROM\r\n donations\r\n WHERE\r\n created >= '$start'\r\n AND\r\n created < '$end'\r\n \";\r\n $result = $this->dao->query($query);\r\n\r\n $row = $result->fetch(PDB::FETCH_OBJ);\r\n $row->QuarterDonation = sprintf(\"%d\", $row->Total);\r\n $row->MonthNeededAmount = $requiredPerMonth;\r\n $row->YearNeededAmount = $requiredPerYear;\r\n $row->QuarterNeededAmount = $requiredPerMonth * 3;\r\n $row->YearDonation = $rowYear->YearDonation;\r\n\r\n return $row;\r\n }", "public function asPaid()\n {\n return $this->markAs($this->getPaidValue());\n }", "public function getAmountsDataLast2Years($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-2year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getAmountsByMonth($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function getStudentClassYear($class,$year){\n\n// find the age of student \n$age =$this->findAge($class);\n$year = $year.\"-01-01\"; \n// find the born year using age \n$birthdayYear = Carbon::parse($year)->subYears($age)->year;\n\n// \n\n $result = Student::whereYear('dob' ,$birthdayYear)->get();\n return $result;\n\n\n\n\n\n }", "public static function current() {\n\t\treturn CompYear::orderBy('year', 'desc')->first();\n\t}", "function get_yr_prev($cur_date){\n $date_split=split(\"-\",$cur_date);\n return date(\"d-m-Y\",mktime (0,0,0,$date_split[1],$date_split[0],($date_split[2]-1)));\n }", "function gec_copyrightYears($startYr = '') {\n // if startYr is greater than current year, return current year\n if ($startYr >= date(\"Y\")) {\n return ('<p>&copy ' . date(\"Y\") . '</p>');\n }\n // get current year and format as 2 digits if start year provided\n if ($startYr) {\n $currentYr = date(\"y\");\n }\n // otherwise, format as four digits and return\n else {\n return ('<p>&copy ' . date(\"Y\") . '</p>');\n }\n // return start year as 4 digits - current year as 2 digits\n /* @var $currentYr type */\n return ('<p>&copy ' . $startYr . '-' . $currentYr . '</p>' );\n}", "public function upcomingCredit()\n {\n $where = \"(SELECT DATEDIFF(po.`due_date`, '$this->curDate') AS days) < 14 AND po.`status_paid` = 0\";\n $po = $this->db\n ->from('purchase_order po')\n ->join('principal p', 'p.id_principal = po.id_principal')\n ->where($where)\n ->order_by('po.id_purchase_order asc')\n ->get()\n ->result();\n return $po;\n }", "public function getActiveYears() {\n return $this->activeYears;\n }", "public function years($callback = null)\n {\n Carbon::setTestNow(Carbon::now()->addYears($this->value));\n\n return $this->handleCallback($callback);\n }", "public function getValidFromYear()\n {\n return $this->valid_from_year;\n }", "public function getSaleByMonth2($year = null)\n {\n $date = new \\DateTime(\"now\");\n $currentYear = $date->format('y');\n //If the value of $year is not define then use the current year (default)\n if(!$year){\n $year = $currentYear;\n }\n \n //Get all the STransaction from the DB first.\n $STransactions = $this->em->getRepository('TransactionBundle:STransaction')->findAll();\n $months = array('jan' => 0, 'feb' => 0, 'mar' => 0, 'apr' => 0, 'may' => 0, 'jun' => 0, 'jul'\n => 0, 'aug' => 0, 'sep' => 0, 'oct' => 0, 'nov' => 0, 'dec' => 0);\n foreach ($STransactions as $st){\n $m = $st->getCreatedAt()->format(\"m\");\n $y = $st->getCreatedAt()->format(\"y\");\n if($m == 01 && $y == $year){\n $months['jan'] = $months['jan'] + $st->getTotalAmount();\n }elseif($m == 11 && $y == $year){\n $months['nov'] = $months['nov'] + $st->getTotalAmount();\n }\n }\n \n return $months;\n \n }", "public function getYear()\n\t{\n\t\t$sqlYear = \"SELECT * FROM edu_academic_year WHERE NOW() >= from_month AND NOW() <= to_month AND status = 'Active'\";\n\t\t$year_result = $this->db->query($sqlYear);\n\t\t$ress_year = $year_result->result();\n\n\t\tif($year_result->num_rows()==1)\n\t\t{\n\t\t\tforeach ($year_result->result() as $rows)\n\t\t\t{\n\t\t\t $year_id = $rows->year_id;\n\t\t\t}\n\t\t\treturn $year_id;\n\t\t}\n\t}", "public function getCcYears()\r\n {\r\n $years = $this->getData('cc_years');\r\n if (is_null($years)) {\r\n $years = Mage::getSingleton('payment/config')->getYears();\r\n $years = array(0 => $this->__('Year')) + $years;\r\n $this->setData('cc_years', $years);\r\n }\r\n return $years;\r\n }", "public function getExpYear(): ?int\n {\n return $this->expYear;\n }", "public function getPublicationYear() {\n $fields = array('publicationYear');\n $result = TingOpenformatMethods::parseFields($this->_getPublicationDetails(), $fields);\n return (is_array($result)) ? reset($result) : $result;\n }", "function happyNewYear () {\n $day = (int) date('z');\n $year = date('Y');\n $yearCheck = ((int)$year ? $year % 4 == 0 ? $year % 400 == 0 && $year % 100 == 0 ? 366 : 365 : 365 : \"ERROR\");\n $daytill = $yearCheck-$day;\n echo \"До Нового Года осталось: $daytill дней\";\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 }" ]
[ "0.6462789", "0.6368475", "0.6221266", "0.62104636", "0.6199526", "0.6188869", "0.61713487", "0.6107393", "0.61063874", "0.6081917", "0.60647273", "0.605971", "0.60405564", "0.6021551", "0.5979511", "0.59642303", "0.59386605", "0.5936051", "0.5896815", "0.58818483", "0.58818483", "0.58811235", "0.5875254", "0.58428186", "0.5837594", "0.5832669", "0.5801647", "0.5800531", "0.57978743", "0.5793021", "0.57928866", "0.57849634", "0.5776825", "0.5768712", "0.57473934", "0.57282174", "0.5710485", "0.57061046", "0.5696052", "0.56928855", "0.5692253", "0.5678544", "0.56694525", "0.56688964", "0.56507003", "0.5648925", "0.56473726", "0.5640852", "0.56321186", "0.56309175", "0.56238866", "0.5611259", "0.56081235", "0.56053", "0.55952394", "0.55847913", "0.5575702", "0.55751556", "0.556765", "0.5548439", "0.5540538", "0.5525829", "0.55192715", "0.55122894", "0.5506965", "0.55061626", "0.55032915", "0.54982466", "0.5498204", "0.54920954", "0.5490289", "0.54865247", "0.5478466", "0.5477136", "0.5468561", "0.5456453", "0.54553735", "0.54496276", "0.54350066", "0.5427958", "0.54191184", "0.54168934", "0.5410231", "0.5401167", "0.5399097", "0.5392915", "0.5392872", "0.53838485", "0.5381217", "0.53801036", "0.5378596", "0.53766125", "0.5371989", "0.53681964", "0.53654176", "0.5363914", "0.5363909", "0.53590107", "0.53554446", "0.5351949" ]
0.57716787
33
Get paid amount last 2 years
public function getAmountsDataLast2Years($vendorId) { $to = $this->_date->date('Y-m-d'); $from = strtotime($to."-2year"); $from = $this->_date->date('Y-m-d', $from); $to .= ' 23:59:59'; $orderResource = $this->_vendorOrderFactory->create()->getResource(); $data = $orderResource->getAmountsByMonth($from, $to, $vendorId); $result = $this->_processOrderData($data); $result = array_values($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDifferenceInYears();", "function formatAsYears($paymentPeriods, $paymentTerm)\n{\n $days = $paymentPeriods * $paymentTerm;\n $years = round($days / 365, 1);\n return $years;\n}", "public function getLastYearData() {\n\t\t$dates = getPeriods('LastYear');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear'], 12);\t\t\n\t}", "public function getTotalPaid();", "public function getYear() {}", "function it_returns_one_percent_for_one_payment_one_year_after_the_advance()\n {\n $this->addPayment(101, 365);\n\n $this->calculate()->shouldReturn(1.0);\n }", "public function getExpiryYear()\n {\n return $this->expiry_year;\n }", "public function getExpiryYear()\n {\n return $this->expiryYear;\n }", "function previousYear($interval=1){ return $this->_getDate(0,0,-$interval); }", "public function latestYear()\n\t{\n\t\t$year = $this->doll->orderBy('release_year', 'DESC')->pluck('release_year');\n\t\treturn $year;\n\t}", "public function getBaseTotalPaid();", "public function getPaymentDate();", "public function getOrdersDataLast2Years($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-2year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getNumOfOrderByMonth($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function getPaidAt(): Carbon\n {\n return $this->paidAt;\n }", "public function getAmtPaid()\n {\n return $this->amt_paid;\n }", "function getMaxYears()\n {\n return 9999;\n }", "private function getLastPayPeriodEnd(){ $myq = getCurrentPayPeriod();\r\n $result = getQueryResult($this->config, $myq, $debug = false);\r\n $ppArray = $result->fetch_assoc();\r\n $startDate = $ppArray['PPBEG'];\r\n $this->lastPayStart = date('Y-m-d', strtotime('-14 days', strtotime($startDate)));\r\n $endDate = $ppArray['PPEND'];\r\n $this->lastPayEnd = date('Y-m-d', strtotime('-14 days', strtotime($endDate)));\r\n\r\n return $endDate;\r\n }", "public function getMonthlyFee(): float { return 2.0; }", "public function getTwoYearDates()\n {\n $current_year = date('Y-m-d',strtotime(date('Y-01-01')));\n $next_year = date('Y-m-d', strtotime('last day of december next year'));\n\n return Holiday::where('date', '>=', $current_year)\n ->where('date', '<=', $next_year)\n ->orderBy('date', 'asc')\n ->paginate(25);\n }", "public function diffYears($years){\n\t\t$this->_year-=$years;\n\t\t$this->_consolideDate();\n\t\treturn $this->_date;\n\t}", "public function getMonthlyFee();", "public function getAmountAts2OfYear($year) {\r\n\t\t$query = $this->createQueryBuilder('u')\r\n\t\t\t->select('COUNT(u)')\r\n\t\t\t->where('u.ats2 >= :firstJan')\r\n\t\t\t->andWhere('u.ats2 <= :lastDec')\r\n\t\t\t->setParameter('firstJan', new \\DateTime($year.'-01-01'))\r\n\t\t\t->setParameter('lastDec', new \\DateTime($year.'-12-31'))\r\n\t\t\t->getQuery();\r\n\t\t\r\n\t\treturn $query->getSingleScalarResult();\r\n\t}", "public function getExpiryYear()\n {\n return $this->getParameter('expiryYear');\n }", "public function getAnnualPrice(): float\n {\n $ratio = $this->getMonths() / 12;\n return $this->getPrice() / $ratio;\n }", "public function get_year_permastruct()\n {\n }", "public function receipt_year() {\n $this->db->select('YEAR(receipt_master.date_transfer) AS year_pay');\n $this->db->where('receipt_master.type_receipt_id', 5);\n $this->db->where('receipt_master.status_receipt_id', 1);\n $this->db->where('receipt_master.status_transfer_id', 3);\n $this->db->where('receipt_master.shop_id_pri', $this->session->userdata('shop_id_pri'));\n $this->db->where('receipt_master.date_transfer !=', '');\n $this->db->group_by('YEAR(receipt_master.date_transfer)');\n return $this->db->get('receipt_master');\n }", "public function upcomingCredit()\n {\n $where = \"(SELECT DATEDIFF(po.`due_date`, '$this->curDate') AS days) < 14 AND po.`status_paid` = 0\";\n $po = $this->db\n ->from('purchase_order po')\n ->join('principal p', 'p.id_principal = po.id_principal')\n ->where($where)\n ->order_by('po.id_purchase_order asc')\n ->get()\n ->result();\n return $po;\n }", "function erp_financial_end_date() {\n $financial_year_dates = erp_get_financial_year_dates();\n\n return $financial_year_dates['end'];\n}", "public function getAge()\n {\n if ($dob = $this->getDob()) {\n $now = new \\Datetime('now');\n $today['month'] = $now->format('m');\n $today['day'] = $now->format('d');\n $today['year'] = $now->format('Y');\n\n $years = $today['year'] - $dob->format('Y');\n\n if ($today['month'] <= $dob->format('m')) {\n if ($dob->format('m') == $today['month']) {\n if ($dob->format('d') > $today['day'])\n $years--;\n } else\n $years--;\n }\n\n return $years;\n }\n\n return null;\n }", "function nextYear($interval=1){ return $this->_getDate(0,0,$interval); }", "public function addYears($years){\n\t\t$this->_year+=$years;\n\t\t$this->_consolideDate();\n\t\treturn $this->_date;\n\t}", "public function getAmountPaid()\n {\n return $this->amountPaid instanceof TypedMoneyBuilder ? $this->amountPaid->build() : $this->amountPaid;\n }", "private function ageChaton() { \n $datenow = new DateTime(\"now\");\n $result = date('Y-m-d', strtotime('-365 day')); //-12 mois\n\n return $result;\n }", "public function getAmountsDataLastYear($vendorId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-1year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n \n $orderResource = $this->_vendorOrderFactory->create()->getResource();\n $data = $orderResource->getAmountsByMonth($from, $to, $vendorId);\n $result = $this->_processOrderData($data);\n \n $result = array_values($result);\n return $result;\n }", "public function getAcademic()\n {\n $now = Carbon::now();\n\n $year = $now->year + 4;\n\n return ($now->month >= 8) ? ($year - 1911) : ($year - 1912);\n }", "public function getStudentClassYear($class,$year){\n\n// find the age of student \n$age =$this->findAge($class);\n$year = $year.\"-01-01\"; \n// find the born year using age \n$birthdayYear = Carbon::parse($year)->subYears($age)->year;\n\n// \n\n $result = Student::whereYear('dob' ,$birthdayYear)->get();\n return $result;\n\n\n\n\n\n }", "public function getFullYear()\r\n\t{\r\n\t\treturn $this->format('Y');\r\n\t}", "public function getHighestYear() {\n\t\t$query = $this->createQuery();\n\t\t$query->getQuerySettings()->setRespectStoragePage(FALSE);\n\t\t$query->statement(\"SELECT MAX(year) as year FROM `tx_wxlottery_domain_model_partnerlog`\");\n\t\treturn $query->execute()->getFirst()->getYear();\n }", "public function years($callback = null)\n {\n Carbon::setTestNow(Carbon::now()->addYears($this->value));\n\n return $this->handleCallback($callback);\n }", "public function getPaidMoney()\n {\n $money = new Money($this->paidAmount, $this->paidCurrency);\n return $money;\n }", "function calculAge($date){\n\n$timestamp = strtotime($date); // en seconde\nreturn ceil((time() - $timestamp) / (60 * 60 * 24 * 365)); //calcul de l'age en arrondit\n}", "public function getYearPrice($id ,$type)\n {\n $r = $this->preFind($id);\n $date = Carbon::now()->subYear($type)->toDateString();\n return $r->price()->where([['month' , '>=' , $date]])->orderBy(\"month\",\"asc\")->groupBy(\"month\")->get();\n }", "public function getYear() : string;", "public function paid()\n {\n $this->paidAmount = $this->price;\n }", "public function paid()\n {\n $expenses = Expense::where(\"status\", 'verified')->orderBy('created_at', 'DESC')->get();\n $expenses->map(function ($expense) {\n return $expense->payment_account;\n });\n return response()->json($expenses);\n }", "public function getAge()\n {\n // future dates have no age\n return max(0, $this->difference(self::now())->getYears());\n }", "function get_yr_nxt($cur_date){\n $date_split=split(\"-\",$cur_date);\n return date(\"d-m-Y\",mktime (0,0,0,$date_split[1],$date_split[0],($date_split[2]+1)));\n }", "function getMinYears()\n {\n return 0;\n }", "function getYearsSelect()\n\t{\n\t\treturn $this->db->query(\"SELECT distinct(year(created_sell)) as yearssell from tb_sell where status <> 1 order by created_sell desc\")->result();\n\t}", "function dateDiffYears($time1, $time2){\n \n $yrs = 0;\n $time1 = date_create($time1);\n $time2 = date_create($time2);\n $diffArray = date_diff($time1, $time2); \n $yrs = $diffArray->format('%R%y'); \n return $yrs * 1;\n}", "function get_yr_prev($cur_date){\n $date_split=split(\"-\",$cur_date);\n return date(\"d-m-Y\",mktime (0,0,0,$date_split[1],$date_split[0],($date_split[2]-1)));\n }", "protected function year(){\n return $this->now->format('Y');\n }", "public function getExpYear(Order $order)\n {\n try {\n $yearAdapter = $this->paymentVerificationFactory->createPaymentExpYear($order->getPayment()->getMethod());\n\n $this->logger->debug('Getting expiry year using ' . get_class($yearAdapter), ['entity' => $order]);\n\n $expYear = $yearAdapter->getData($order);\n\n if (isset($expYear) === false) {\n return null;\n }\n\n $expYear = preg_replace('/\\D/', '', $expYear);\n\n $expYear = (int) $expYear;\n if ($expYear <= 0) {\n return null;\n }\n\n //If returned expiry year has less then 4 digits\n if ($expYear < 1000) {\n $expYear += 2000;\n }\n\n return $expYear;\n } catch (Exception $e) {\n $this->logger->error('Error fetching expiration year: ' . $e->getMessage(), ['entity' => $order]);\n return null;\n }\n }", "function getYear()\r\n {\r\n return $this->ano;\r\n }", "public function asPaid()\n {\n return $this->markAs($this->getPaidValue());\n }", "function years()\n{\n $years = array();\n for($i=date('Y');$i>(date('Y') - 100); $i--)\n $years[$i] = $i;\n return $years;\n}", "public function getAmountPaid()\n {\n $amountPaid = 0;\n if ($this->payments) {\n foreach ($this->payments as $payment) {\n if ($payment->getStatus() == 'OK') {\n $amountPaid = $amountPaid + $payment->getAmount();\n }\n }\n }\n return $amountPaid;\n }", "public function getYear() {\n return $this->_year;\n }", "public function getAge() {\n date_default_timezone_set('America/New_York');\n list($year,$month,$day) = explode(\"-\",$this->birthDate);\n $year_diff = date(\"Y\") - $year;\n $month_diff = date(\"m\") - $month;\n $day_diff = date(\"d\") - $day;\n if ($month_diff < 0 || ($month_diff == 0 && $day_diff < 0)) {\n $year_diff--;\n }\n return $year_diff;\n }", "public function getSaleByMonth2($year = null)\n {\n $date = new \\DateTime(\"now\");\n $currentYear = $date->format('y');\n //If the value of $year is not define then use the current year (default)\n if(!$year){\n $year = $currentYear;\n }\n \n //Get all the STransaction from the DB first.\n $STransactions = $this->em->getRepository('TransactionBundle:STransaction')->findAll();\n $months = array('jan' => 0, 'feb' => 0, 'mar' => 0, 'apr' => 0, 'may' => 0, 'jun' => 0, 'jul'\n => 0, 'aug' => 0, 'sep' => 0, 'oct' => 0, 'nov' => 0, 'dec' => 0);\n foreach ($STransactions as $st){\n $m = $st->getCreatedAt()->format(\"m\");\n $y = $st->getCreatedAt()->format(\"y\");\n if($m == 01 && $y == $year){\n $months['jan'] = $months['jan'] + $st->getTotalAmount();\n }elseif($m == 11 && $y == $year){\n $months['nov'] = $months['nov'] + $st->getTotalAmount();\n }\n }\n \n return $months;\n \n }", "function get_amount($date) {\n global $debug;\n $val = null;\n $money = 0;\n //if ($debug) { echo \"comparing value range for this object: \"; print_r($item); }\n foreach ($this->list as $item) {\n if ($item->includes($date)) {\n $val = $item;\n }\n }\n if (!$val) {\n return $money;\n }\n $period = $val->period;\n switch ($period) {\n case 'weekly':\n // this is only debited once every week.\n // make sure it is a multiple of 1 week offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 7 == 0) {\n $money = $val->amount;\n }\n break;\n case 'biweekly':\n // this is only debited once every 2 weeks.\n // make sure it is a multiple of 2 weeks offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 14 == 0) {\n $money = $val->amount;\n }\n break;\n case 'monthly': \n // this is debited once per month\n // make sure the day of month matches the day from $val->extra\n $day_amount = date('d', strtotime($val->extra));\n $day_this = date('d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'semiannual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_amount_semi = date('m-d', strtotime(\"+6 months\", strtotime($val->extra)));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount || $day_this == $day_amount_semi) {\n $money = $val->amount;\n }\n break;\n case 'annual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'once':\n // make sure date matches exactly with $val->extra\n if ($date == $val->extra) {\n $money = $val->amount;\n }\n break;\n case 'daily':\n // always return the same value\n $money = $val->amount;\n break;\n default:\n throw new Exception(\"unkown period '$period'\");\n }\n if ($debug) {\n printf(\"get_amount($date) $val->period, $val->amount, $val->extra -> $money\\n\");\n }\n return $money;\n }", "public static function outstandingPayments($yearMonth = false)\n {\n $where = '';\n if ($yearMonth) {\n $where = \" AND due_date BETWEEN '$yearMonth-01' AND '$yearMonth-31'\";\n }\n $open = Invoice::find_by_sql(\"SELECT \n sum(invoices.`sum`) as `summary` \n FROM \n invoices \n WHERE \n (invoices.`status` = 'Sent' \n OR \n invoices.`status` = 'Open') \n AND \n invoices.`estimate` != 1\n $where \n \");\n\n $partially = Invoice::find_by_sql(\"SELECT \n sum(invoices.`outstanding`) as summary \n FROM \n invoices \n WHERE \n invoices.`status` = 'PartiallyPaid'\n $where;\n \");\n $open[0]->summary = $open[0]->summary + $partially[0]->summary;\n return $open[0]->summary;\n }", "public function upcomingDebit()\n {\n $where = \"(SELECT DATEDIFF(so.`due_date`, '$this->curDate') AS days) < 14 AND so.`status_paid` = 0 AND so.active = 1\";\n $so = $this->db\n ->from('sales_order so')\n ->join('customer c', 'c.id_customer = so.id_customer')\n ->where($where)\n ->order_by('so.id_sales_order asc')\n ->get()\n ->result();\n\n return $so;\n }", "function obtain_year_profitable($acc_number)\n\t{\n\t return $this->db->select('AVG(pamm_tp_profitable) AS ptp,year(pamm_tp_timestamp) AS year')\n\t\t ->from('pamm_tp_results') \n\t\t ->where(\"pamm_tp_account\",$acc_number)\n\t\t ->group_by('year(pamm_tp_timestamp)')\n\t\t ->get()->result();\n\t}", "function getAge($DOB) \n{\n $birth = explode(\"-\", $DOB);\n $age = date(\"Y\") - $birth[0];\n if(($birth[1] > date(\"m\")) || ($birth[1] == date(\"m\") && date(\"d\") < $birth[2]))\n {\n $age -= 1;\n }\n return $age;\n}", "function find_dob_yr($year)\n {\n $this->db->_protect_identifiers = FALSE;\n\n return $this->db->select('name, nat, cat, dob_md')\n ->from('authors')\n ->join('nats', 'nats.id = authors.nat_id')\n ->join('cats', 'cats.id = authors.cat_id')\n ->where('dob_yr', $year)\n ->order_by(\"str_to_date(dob_md, '%M %E')\")\n ->get()->result();\n }", "public function getInvoiceYear(): int\n {\n return (int)($this->createdAt ? $this->createdAt->format('y') : date('y'));\n }", "public function getPaymentAmount()\n {\n return $this->bonus + parent::getSalary();\n }", "public function getLastPaymentDate(): \\DateTime\n {\n return $this->lastPaymentDate;\n }", "public function getMaxAge()\n {\n return $this->expiry;\n }", "public function getPaymentAuthExpiration();", "public function trae_solo_anio_actual()\n {\n return $this->fecha->year;\n }", "public function getYear()\n {\n return $this->year;\n }", "public function getYear()\n {\n return $this->year;\n }", "public function getPrice($amount){\r\n\t\t$tmp_perso = new Personalization($this->persoID);\r\n\t\t$tmp_price = $tmp_perso->getPrice($amount);\r\n\t\treturn $tmp_price;\r\n\t}", "public function getLoanAmount(): float;", "public function getLastpaymentamount()\n {\n return $this->lastpaymentamount;\n }", "function DetermineAgeGET_DOB_Prod ($YYYYMMDD_In) {\n $yIn=substr($YYYYMMDD_In, 0, 4);\n $mIn=substr($YYYYMMDD_In, 4, 2);\n $dIn=substr($YYYYMMDD_In, 6, 2);\n\n $ddiff = date(\"d\") - $dIn;\n $mdiff = date(\"m\") - $mIn;\n $ydiff = date(\"Y\") - $yIn;\n\n // Check If Birthday Month Has Been Reached\n if ($mdiff < 0)\n {\n // Birthday Month Not Reached\n // Subtract 1 Year From Age\n $ydiff--;\n } elseif ($mdiff==0)\n {\n // Birthday Month Currently\n // Check If BirthdayDay Passed\n if ($ddiff < 0)\n {\n //Birthday Not Reached\n // Subtract 1 Year From Age\n $ydiff--;\n }\n }\n return $ydiff;\n }", "public function subYears(int $years)\n {\n $time = clone $this;\n\n return $time->sub(DateInterval::createFromDateString(\"{$years} years\"));\n }", "public function getProfitMonth(){\n\t\tglobal $db;\n\t\t$date_now = date('Y-m').'-01';\n\t\t$last_month = date('Y-m', strtotime('-1 month')).'-01';\n\n\t\t$sql = $db->prepare(\"SELECT SUM(price) FROM project01_report WHERE date_init BETWEEN '$last_month' AND '$date_now' \");\n\t\t$sql->execute();\n\t\tif ($sql->rowCount()>0) {\n\t\t\t$profit = $sql->fetch();\n\t\t\treturn $profit;\n\t\t}\n\t}", "public function getYearsOfService() {\n if (!empty($this->hireDate)) {\n if (!empty($this->departureDate)) {\n return $this->departureDate->diff($this->hireDate)->y;\n }\n return $this->hireDate->diff(new \\DateTime('now'))->y;\n }\n return 0;\n }", "public function age() {\n $years = ((integer) date('Y')) - $this->year;\n\n if (((integer) date('n')) < $this->month) {\n $years -= 1;\n }\n else if (((integer) date('n')) == $this->month) {\n if (((integer) date('j')) < $this->day) {\n $years -= 1;\n }\n }\n\n return $years;\n }", "public function getTransactionDataLast2Years($customerId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-2year\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $transactionResource = $this->_transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processReceivedTransactionData($data, $result);\n \n $data = $transactionResource->getSpentCreditTransactionsByMonth($from, $to, $customerId);\n $result = $this->_processSpentTransactionData($data, $result);\n \n $result = array_values($result);\n return $result;\n }", "public function get_lastet_year($villaid) {\n\n\t\t $query=\"SELECT MAX(`year`) AS ano FROM `\".DB_PREFIX1.\"statements` WHERE `id_villa`='\".$this->link->myesc($villaid).\"'\";\n\n\t\t $result=$this->link->query($query);\n\t\t foreach($result AS $result)\n\t\t return $result;\n\t\t}", "public function getPaidValue()\n {\n return defined('static::PAID_VALUE') ? static::PAID_VALUE : 'paid';\n }", "public function GetYear() {\n return $this->format('Y');\n }", "public function getYear(){\n\t\treturn $this->_year;\n\t}", "function get_annual_period_balance($cur='IDR',$acc=null,$eyear=null)\n {\n// transactions.debit, transactions.credit, transactions.vamount, gls.approved');\n \n $this->db->select_sum('transactions.vamount');\n $this->db->select_sum('transactions.debit');\n $this->db->select_sum('transactions.credit');\n \n $this->db->from('gls, transactions, accounts');\n $this->db->where('gls.id = transactions.gl_id');\n $this->db->where('transactions.account_id = accounts.id');\n $this->db->where('YEAR(dates)', $eyear);\n $this->db->where('gls.currency', $cur);\n $this->cek_null($acc,\"transactions.account_id\");\n $this->db->where('gls.approved', 1);\n $this->db->where('accounts.deleted', NULL);\n return $this->db->get(); \n }", "public function getUserTotalPaid()\n {\n $user = getUser();\n $w = self::where('type', 'credit')->where('user_id', $user->id);\n return $w->sum('amount');\n }", "public function getAge()\n {\n //function qui calcule l'age de leleve \n $now = new \\DateTime('now');\n $age = $this->getDateNaissance();\n $difference = $now->diff($age);\n\n return $difference->format('%y Ans');\n }", "function addDateYears($mySQLFormatDate, $noOfYearsToAdd)\n{\n\t\t$ed = strtotime('+' .$noOfYearsToAdd . ' years', strtotime($mySQLFormatDate)); \n\t\t$retDate = date('Y-m-d', $ed); \n\t\treturn $retDate;\n\t\n}", "public function getBalanceDueAttribute()\n {\n return $this->grossValue - $this->paid;\n }", "function happyNewYear () {\n $day = (int) date('z');\n $year = date('Y');\n $yearCheck = ((int)$year ? $year % 4 == 0 ? $year % 400 == 0 && $year % 100 == 0 ? 366 : 365 : 365 : \"ERROR\");\n $daytill = $yearCheck-$day;\n echo \"До Нового Года осталось: $daytill дней\";\n}", "function getYearOfBirth() {\n global $USER;\n\t$yearOfBirth = date(\"Y\", $USER['dob']);\n\treturn $yearOfBirth;\n}", "public function get_last_payment_date( $context = 'view' ) {\n\t\treturn $this->get_prop( 'last_payment_date', $context ) ;\n\t}", "function getAmountByMonthWithPrevYear($endyear, $startyear, $cachedelay=0, $format=0)\r\n\t{\r\n\t\tglobal $conf,$user,$langs;\r\n\r\n if ($startyear > $endyear) return -1;\r\n\r\n $datay=array();\r\n\r\n // Search into cache\r\n if (! empty($cachedelay))\r\n {\r\n \tinclude_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';\r\n \tinclude_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';\r\n }\r\n\r\n $newpathofdestfile=$conf->user->dir_temp.'/'.get_class($this).'_'.__FUNCTION__.'_'.(empty($this->cachefilesuffix)?'':$this->cachefilesuffix.'_').$langs->defaultlang.'_entity.'.$conf->entity.'_user'.$user->id.'.cache';\r\n $newmask='0644';\r\n\r\n $nowgmt = dol_now();\r\n\r\n $foundintocache=0;\r\n if ($cachedelay > 0)\r\n {\r\n \t$filedate=dol_filemtime($newpathofdestfile);\r\n \tif ($filedate >= ($nowgmt - $cachedelay))\r\n \t{\r\n \t\t$foundintocache=1;\r\n\r\n \t\t$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$filedate;\r\n \t}\r\n \telse\r\n \t{\r\n \t\tdol_syslog(get_class($this).'::'.__FUNCTION__.\" cache file \".$newpathofdestfile.\" is not found or older than now - cachedelay (\".$nowgmt.\" - \".$cachedelay.\") so we can't use it.\");\r\n \t}\r\n }\r\n\r\n // Load file into $data\r\n if ($foundintocache) // Cache file found and is not too old\r\n {\r\n \tdol_syslog(get_class($this).'::'.__FUNCTION__.\" read data from cache file \".$newpathofdestfile.\" \".$filedate.\".\");\r\n \t$data = json_decode(file_get_contents($newpathofdestfile), true);\r\n }\r\n else\r\n\t\t{\r\n\t\t\t$year=$startyear;\r\n\t\t\twhile($year <= $endyear)\r\n\t\t\t{\r\n\t\t\t\t$datay[$year] = $this->getAmountByMonth($year, $format);\r\n\t\t\t\t$year++;\r\n\t\t\t}\r\n\r\n\t\t\t$data = array();\r\n\t\t\t// $data = array('xval'=>array(0=>xlabel,1=>yval1,2=>yval2...),...)\r\n\t\t\tfor ($i = 0 ; $i < 12 ; $i++)\r\n\t\t\t{\r\n\t\t\t\t$data[$i][]=$datay[$endyear][$i][0];\t// set label\r\n\t\t\t\t$year=$startyear;\r\n\t\t\t\twhile($year <= $endyear)\r\n\t\t\t\t{\r\n\t\t\t\t\t$data[$i][]=$datay[$year][$i][1];\t// set yval for x=i\r\n\t\t\t\t\t$year++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Save cache file\r\n\t\tif (empty($foundintocache) && ($cachedelay > 0 || $cachedelay == -1))\r\n\t\t{\r\n\t\t\tdol_syslog(get_class($this).'::'.__FUNCTION__.\" save cache file \".$newpathofdestfile.\" onto disk.\");\r\n\t\t\tif (! dol_is_dir($conf->user->dir_temp)) dol_mkdir($conf->user->dir_temp);\r\n\t\t\t$fp = fopen($newpathofdestfile, 'w');\r\n\t\t\tif ($fp)\r\n\t\t\t{\r\n\t\t\t\tfwrite($fp, json_encode($data));\r\n\t\t\t\tfclose($fp);\r\n\t\t\t\tif (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK;\r\n\t\t\t\t@chmod($newpathofdestfile, octdec($newmask));\r\n\t\t\t}\r\n\t\t\telse dol_syslog(\"Failed to write cache file\", LOG_ERR);\r\n\t\t\t$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt;\r\n\t\t}\r\n\r\n\t\treturn $data;\r\n\t}", "public function getYear()\n {\n return $this->_getDateValue('Y');\n }", "function getAge($dob) { \n $dob = explode(\"/\", $dob); \n $curMonth = date(\"m\");\n $curDay = date(\"j\");\n $curYear = date(\"Y\");\n // echo \"curYear: $curYear\";\n $age = $curYear - $dob[2]; \n if($curMonth<$dob[0] || ($curMonth==$dob[0] && $curDay<$dob[1])) \n $age--; \n return $age; \n}", "public function getActiveYears() {\n return $this->activeYears;\n }", "public function getEquipYearsOfUseAttribute()\n {\n $equip_years_of_use = 0;\n\n if (isset($this->equip_date_of_release) && $this->equip_date_of_release != NULL) {\n $dateNow = new DateTime();\n $dateOfStart = date_create($this->equip_date_of_release);\n $diff = date_diff($dateNow, $dateOfStart);\n $equip_years_of_use = $diff->y;\n }\n\n return $equip_years_of_use;\n }" ]
[ "0.61900914", "0.60370886", "0.5881575", "0.5788142", "0.57079434", "0.56943154", "0.56689715", "0.56558144", "0.55912715", "0.5557239", "0.55455476", "0.5524324", "0.5481294", "0.54745454", "0.547291", "0.546731", "0.54236317", "0.5414736", "0.53936255", "0.5392288", "0.53777635", "0.53759927", "0.535737", "0.5335267", "0.5334265", "0.5323935", "0.5273479", "0.5272371", "0.5262042", "0.52557945", "0.5253032", "0.5249482", "0.5249203", "0.524078", "0.5236814", "0.5234431", "0.5230714", "0.5212114", "0.5205687", "0.5195307", "0.51709193", "0.51610434", "0.5157626", "0.51549244", "0.5149435", "0.5143689", "0.5139196", "0.5137876", "0.513672", "0.5121945", "0.5114418", "0.5110575", "0.51068604", "0.51058865", "0.51039904", "0.510284", "0.5101797", "0.51008976", "0.5100706", "0.50982714", "0.50968075", "0.5087395", "0.5075368", "0.50731444", "0.5072156", "0.5070342", "0.50677305", "0.50677073", "0.50646114", "0.50613576", "0.5051973", "0.5048201", "0.5045226", "0.5045226", "0.50406015", "0.5038917", "0.50334406", "0.5021926", "0.5021926", "0.50107604", "0.499419", "0.49918717", "0.4990513", "0.49826312", "0.49752435", "0.49707437", "0.4962972", "0.4961791", "0.4955229", "0.4950661", "0.494926", "0.49327943", "0.4928975", "0.49278817", "0.4920986", "0.49189505", "0.49154204", "0.4915161", "0.49052587", "0.4902895" ]
0.5817088
3
funcion ultimo cliente para guardar el Empleado_idEmpleado
function ultimoCliente() { $query = $this->db->query('SELECT MAX(idCliente) as idCliente from cliente'); foreach($query->result_array() as $d) { return( $d['idCliente']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GuardarEmpleado()\n {\n //Creo la conexion a la DB.\n $objetoAccesoDato = AccesoDatos::dameUnObjetoAcceso();\n\n //Creo la consulta INSERT.\n $consulta = $objetoAccesoDato->RetornarConsulta(\"INSERT into empleado (nombre,turno,tipo)values('$this->nombre','$this->tipo','$this->turno')\");\n\n //Ejecuto la consulta.\n $consulta->execute();\n\n //Guardo su ID.\n $this->id = $objetoAccesoDato->RetornarUltimoIdInsertado();\n\n //Retorno\n return $this->id;\n }", "public function store(){\n\t\t$post = Input::all();\n\n\t\t$empresa = new Empresa();\n\t\t$empresa->RUC = $post['ruc'];\n\t\t$empresa->NombreEmpresa = $post['nombre'];\n\t\t$empresa->DireccionEmpresa = $post['direccion'];\n\t\t$empresa->TelefonoEmpresa = $post['telefono'];\n\t\t$empresa->EmailEmpresa = $post['email'];\n\t\t$empresa->idDistrito = $post['distrito'];\n\t\t$empresa->save();\n\n\t\t$cliente = new Cliente();\n\t\t$cliente->idEmpresa = $empresa->idEmpresa;\n\t\t$cliente->save();\n\t\treturn $cliente->idCliente;\n\t}", "function insertarEmpresa(){\n\t\t$this->procedimiento='dir.f_empresa_ime';\n\t\t$this->transaccion='DIR_EMP_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('tipo_sociedad','tipo_sociedad','varchar');\n\t\t$this->setParametro('actividad','actividad','text');\n\t\t$this->setParametro('actividad_esp','actividad_esp','varchar');\n\t\t$this->setParametro('nit','nit','varchar');\n\t\t$this->setParametro('actividad_gral','actividad_gral','varchar');\n\t\t$this->setParametro('domicilio','domicilio','text');\n\t\t$this->setParametro('matricula','matricula','int8');\n\t\t$this->setParametro('renovado','renovado','int4');\n\t\t$this->setParametro('actividad_prim','actividad_prim','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('departamento','departamento','varchar');\n\t\t$this->setParametro('telefono','telefono','varchar');\n\t\t$this->setParametro('municipio','municipio','varchar');\n\t\t$this->setParametro('estado_matricula','estado_matricula','varchar');\n\t\t$this->setParametro('mail','mail','varchar');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function ingresarEmpleadoSinID(){\n $conexion = new Conexion;\n $con = new mysqli($conexion->servername, $conexion->username, $conexion->password, $conexion->dbname);\n $sql = \"INSERT INTO empleado (rut, nombre, password, categoria, estado ) VALUES ('\".$this->rut.\"', '\".$this->nombre.\"','\".$this->password.\"', '\".$this->categoria.\"', 1)\";\n if ($con->connect_error) {\n die(\"Conexión fallida: \" . $con->connect_error);\n } \n if ($con->query($sql) === TRUE) {\n echo \"Empleado ingresada correctamente.\";\n } else {\n echo \"Error: \" . $sql . \"<br>\" . $con->error;\n }\n $con->close();\n }", "function modificarEmpleado(){\n\t$ced=$this->objEmpleado->getCedula();\n\t$nom=$this->objEmpleado->getNombre();\n\t$fechaIng=$this->objEmpleado->getFechaIngreso();\n\t$fechaRet=$this->objEmpleado->getFechaRetiro();\n\t$salBas=$this->objEmpleado->getSalarioBasico();\n\t$ded=$this->objEmpleado->getDeducciones();\n\t$foto=$this->objEmpleado->getFoto();\n\t$hojaV=$this->objEmpleado->getHojaVida();\n\t$email=$this->objEmpleado->getEmail();\n\t$tel=$this->objEmpleado->getTelefono();\n\t$cel=$this->objEmpleado->getCelular();\n\t$estado=$this->objEmpleado->getEstado();\n\t$usuario=$this->objEmpleado->getUsuario();\n\t$contrasena=$this->objEmpleado->getContrasena();\n\t$nomTmp=$this->objEmpleado->getNombreTmp();\n\t$fotoTmp=$this->objEmpleado->getFotoTmp();\n\t$hojaVTmp=$this->objEmpleado->getHojaVidaTmp();\n\t$emailTmp=$this->objEmpleado->getEmailTmp();\n\t$telTmp=$this->objEmpleado->getTelefonoTmp();\n\t$celTmp=$this->objEmpleado->getCelularTmp();\n\n\t$objConexion = new ControlConexion();\n\t$objConexion->abrirBd($GLOBALS['serv'],$GLOBALS['usua'],$GLOBALS['pass'],$GLOBALS['bdat']);\n\t$comandoSql=\"UPDATE EMPLEADO SET NOMBRE_TMP='\".$nomTmp.\"', FECHAINGRESO='\".$fechaIng.\"', \n\tSALARIOBASICO='\".$salBas.\"', DEDUCCIONES='\".$ded.\"', FOTO_TMP='\".$fotoTmp.\"', HOJAVIDA_TMP='\".$hojaVTmp.\"', EMAIL_TMP='\".$emailTmp.\"',\n\tTELEFONO_TMP='\".$telTmp.\"', CELULAR_TMP='\".$celTmp.\"',CONTRASENA='\".$contrasena.\"' WHERE CEDULA='\".$ced.\"'\";\n\t$objConexion->ejecutarComandoSql($comandoSql);\n\t$objConexion->cerrarBd();\n}", "public function Crear_Empre_Prov(,$Id_emp ,$EstadoUsu_Id_est_usu ,$Solicitud_empleado_idSolicitud ,$Name_emp ,$Email_emp ,$Pass_emp ,$Img_emp ,$Id_supvisor ,$Obser_emp ,$Edad_emp ){\n $this->Id_emp=$Id_emp;\n $this->EstadoUsu_Id_est_usu=$EstadoUsu_Id_est_usu;\n $this->Solicitud_empleado_idSolicitud=$Solicitud_empleado_idSolicitud;\n $this->Name_emp=$Name_emp;\n $this->Email_emp=$Email_emp;\n $this->Pass_emp=$Pass_emp;\n $this->Img_emp=$Img_emp;\n $this->Id_supvisor=$Id_supvisor;\n $this->Obser_emp=$Obser_emp;\n $this->Edad_emp=$Edad_emp;\n }", "public function Crear_Empre_Prov(,$Id_emp ,$EstadoUsu_Id_est_usu ,$Solicitud_empleado_idSolicitud ,$Name_emp ,$Email_emp ,$Pass_emp ,$Img_emp ,$Id_supvisor ,$Obser_emp ,$Edad_emp ){\n $this->Id_emp=$Id_emp;\n $this->EstadoUsu_Id_est_usu=$EstadoUsu_Id_est_usu;\n $this->Solicitud_empleado_idSolicitud=$Solicitud_empleado_idSolicitud;\n $this->Name_emp=$Name_emp;\n $this->Email_emp=$Email_emp;\n $this->Pass_emp=$Pass_emp;\n $this->Img_emp=$Img_emp;\n $this->Id_supvisor=$Id_supvisor;\n $this->Obser_emp=$Obser_emp;\n $this->Edad_emp=$Edad_emp;\n }", "function ventaEmpleadoDAO($empleado, $idUltimo){\n $conexion = Conexion::crearConexion();\n $exito = false;\n try {\n $conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $stm = $conexion->prepare(\"INSERT INTO empleado_salida(id_empleado, id_venta) VALUES (?,?)\");\n $stm->bindParam(1, $empleado, PDO::PARAM_STR);\n $stm->bindParam(2, $idUltimo, PDO::PARAM_STR);\n $exito = $stm->execute();\n } catch (Exception $ex) {\n throw new Exception(\"Error al registrar la salida en tabla empleado_salida\");\n }\n return $exito;\n }", "public function saveEntidad(){\n\t\t$conexion = new Database();\n if ($this->codigo){\n $query = sprintf('UPDATE agenda_entidades SET entidad = \"%s\" WHERE entidad_id = %d',\n $this->entidad,\n $this->codigo);\n $rows = $conexion->exec( $query );\n }\n else{\n $query = sprintf('INSERT INTO agenda_entidades(entidad) VALUES (\"%s\")',\n $this->usuario);\n\t\t\t$rows = $conexion->exec( $query );\n $this->codigo = $conexion->lastInsertId();\n }\n }", "function ventaClienteDAO($idUltimo, $cliente, $estado){\n $conexion = Conexion::crearConexion();\n $exito = false;\n try {\n $conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $stm = $conexion->prepare(\"INSERT INTO cliente_salida(id_venta, id_persona, estado) VALUES (?,?,?)\");\n $stm->bindParam(1, $idUltimo, PDO::PARAM_STR);\n $stm->bindParam(2, $cliente, PDO::PARAM_STR);\n $stm->bindParam(3, $estado, PDO::PARAM_STR);\n $exito = $stm->execute();\n } catch (Exception $ex) {\n throw new Exception(\"Error al registrar la salida en tabla cliente_salida\");\n }\n return $exito;\n }", "public function guardar($empresa) {\n if ($this->db->insert(\"empresa\", $empresa)) {\n //id de la empresa\n $empresa_id = $this->db->insert_id();\n $this->configuracion_model->logInterno(\"Se creo la empresa \" . $empresa_id);\n //le creamos un usuario con valor de 10 para que entre al sistema\n //sacamos los datos de la empresa ya insertados para su manejo\n //hacemos el array de la persona de la empresa para su insercion\n $persona = array(\n \"nombre\" => $empresa['nombre'],\n \"apellido\" => \"Principal\",\n \"documento\" => $empresa['nit'],\n \"direccion\" => $empresa['direccion'],\n \"email\" => $empresa['email'],\n \"telefono\" => $empresa['telefono']\n );\n //hacemos el array de la sede con los datos de la empresa\n $sede = array(\n \"nombre\" => $empresa['nombre'],\n \"direccion\" => $empresa['direccion'],\n \"telefono\" => $empresa['telefono'],\n \"email\" => $empresa['email'],\n \"empresa_id\" => $empresa_id\n );\n\n //insertamos a la persona-empresa\n if ($this->db->insert(\"persona\", $persona)) {\n $persona_id = $this->db->insert_id();\n $this->configuracion_model->logInterno(\"Se creo la persona \" . $persona_id);\n } else {\n return FALSE;\n }\n //insertamos a la sede\n if ($this->db->insert(\"sede\", $sede)) {\n $sede_id = $this->db->insert_id();\n $this->configuracion_model->logInterno(\"Se creo una sede \" . $sede_id);\n } else {\n return FALSE;\n }\n\n\n\n\n //sacamos la id de la persona-empresa para agregar el usuario\n //creamos el usuario para la insercion\n $usuario = array(\n \"user\" => $empresa['email'],\n \"pass\" => sha1($empresa['nit']),\n \"persona_id\" => $persona_id,\n \"grado\" => \"3\",\n \"valor\" => \"10\",\n \"empresa_id\" => $empresa_id,\n \"sede_id\" => $sede_id\n );\n\n\n //lo insertamos\n\n if ($this->db->insert(\"usuario\", $usuario)) {\n $this->configuracion_model->logInterno(\"Se crea e usuario \" . $this->db->insert_id());\n //Creamos los archivos de configuracion\n $configuracion = array(\n \"empresa_id\" => $empresa_id\n );\n } else {\n return FALSE;\n }\n //insertamos los datos de la configuracion\n if ($this->db->insert(\"configuracion\", $configuracion)) {\n $this->configuracion_model->logInterno(\"Se crea configuracion \" . $this->db->insert_id());\n\n /* creamos las categorias Default de la empresa en categoria y egresos_categoria */\n $categoria_default = array(\n \"nombre\" => \"Default\",\n \"descripcion\" => \"Default\",\n \"empresa_id\" => $empresa_id\n );\n if ($this->db->insert(\"categoria\", $categoria_default)) {\n $this->configuracion_model->logInterno(\"Se creo la categoria default \" . $usuario['user']);\n if ($this->db->insert(\"categoria_egreso\", $categoria_default)) {\n $this->configuracion_model->logInterno(\"Se creo la categoria_egreso default \" . $usuario['user']);\n }\n }\n\n\n return TRUE;\n } else {\n return FALSE;\n }\n } else {\n return FALSE;\n }\n }", "public function primerCliente($id_usuario,$nombreE,$rfcE,$cpE,$correo1E,$observacionesE,$fijo,$logo){\r\n\t\t$sql = \"INSERT INTO tbl_clientesclientes (id_usuario,logo,nombreE,rfcE,cpE,correo1E,observacionesE,estatus,fijo)VALUES('$id_usuario','$logo','$nombreE','$rfcE','$cpE','$correo1E','$observacionesE','1','$fijo')\";\r\n return ejecutarConsulta($sql); \t\r\n\t}", "function insertarCliente(){\n\t\t$this->procedimiento='rec.ft_cliente_ime';\n\t\t$this->transaccion='REC_CLI_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('genero','genero','varchar');\n\t\t$this->setParametro('ci','ci','varchar');\n\t\t$this->setParametro('email','email','varchar');\n\t\t$this->setParametro('email2','email2','varchar');\n\t\t$this->setParametro('direccion','direccion','varchar');\n\t\t$this->setParametro('celular','celular','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('lugar_expedicion','lugar_expedicion','varchar');\n\t\t$this->setParametro('apellido_paterno','apellido_paterno','varchar');\n\t\t$this->setParametro('telefono','telefono','varchar');\n\t\t$this->setParametro('ciudad_residencia','ciudad_residencia','varchar');\n\t\t$this->setParametro('id_pais_residencia','id_pais_residencia','int4');\n\t\t$this->setParametro('nacionalidad','nacionalidad','varchar');\n\t\t$this->setParametro('barrio_zona','barrio_zona','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('apellido_materno','apellido_materno','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function insert($cliente){\r\n\t\t$sql = 'INSERT INTO clientes (nome, sobrenome, email, senha, ativo) VALUES (?, ?, ?, ?, ?)';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\t\n\t\t$sqlQuery->set($cliente->nome);\n\t\t$sqlQuery->set($cliente->sobrenome);\n\t\t$sqlQuery->set($cliente->email);\n\t\t$sqlQuery->set($cliente->senha);\n\t\t$sqlQuery->setNumber($cliente->ativo);\n\r\n\t\t$id = $this->executeInsert($sqlQuery);\t\r\n\t\t$cliente->id = $id;\r\n\t\treturn $id;\r\n\t}", "function registrarCliente (){\n\t\t$x = $this->pdo->prepare('INSERT INTO cliente (cedula,correo,clave,nombre,celular,ciudad,direccion) VALUES (?,?,?,?,?,?,?)');\n\t\t$x->execute(array($this->cedula,$this->correo,$this->clave,$this->nombre,$this->celular,$this->ciudad,$this->direccion));\n\t\treturn $x;\n\t}", "public function salvar($objcliente){\n $this->sql = \"Insert into cliente(nome,email,senha) values (:nomeCliente,:emailCliente,:senhaCliente)\";\n //Criar um objeto para Preparo do Comando SQL\n $this->stmt = $this->conn->prepare($this->sql);\n //Unir ao comando SQL os dados informados na Tela do Usuário\n $nomeCliente=$objcliente->getNomeCliente();\n $emailCliente=$objcliente->getEmailCliente();\n $senhaCliente=$objcliente->getSenhaCliente();\n \n $this->stmt->bindParam(':nomeCliente',$nomeCliente);\n $this->stmt->bindParam(':emailCliente',$emailCliente);\n $this->stmt->bindParam(':senhaCliente',$senhaCliente);\n \n \n //Executar o comando SQL\n $retorno = $this->stmt->execute();\n return ($retorno);\n }", "function cocinar_registro_cliente() {\n\t\tglobal $bd;\n\t\tglobal $x_idcliente;\n\t\tglobal $x_idpedido;\n\n\t\t\n\t\t// $x_arr_cliente = $_POST['p_cliente'];\n\t\t// $datos_cliente = $x_arr_cliente['cliente'];\n\t\t$datos_cliente = $_POST['p_cliente'];\n\n\t\t$nomclie=$datos_cliente['nombres'];\n\t\t$idclie=$datos_cliente['idcliente'];\n\t\t$num_doc=$datos_cliente['num_doc'];\n\t\t$direccion=$datos_cliente['direccion'];\n\t\t$f_nac=$datos_cliente['f_nac'];\n\t\t// $idpedidos=$x_arr_cliente['i'] == '' ? $x_idpedido : $x_arr_cliente['i'];\n\n\t\tif($idclie==''){\n\t\t\tif($nomclie==''){//publico general\n\t\t\t\t$idclie=0;\n\t\t\t}else{\n\t\t\t\t$sql=\"insert into cliente (idorg,nombres,direccion,ruc,f_nac)values(\".$_SESSION['ido'].\",'\".$nomclie.\"','\".$direccion.\"','\".$num_doc.\"','\".$f_nac.\"')\";\n\t\t\t\t$idclie=$bd->xConsulta_UltimoId($sql);\n\t\t\t}\n\t\t} else {\n\t\t\t// update cliente\n\t\t\t$sql=\"update cliente set nombres='\".$nomclie.\"',ruc='\".$num_doc.\"',direccion='\".$direccion.\"' where idcliente = \".$idclie;\n\t\t\t$bd->xConsulta_NoReturn($sql);\n\t\t}\n\n\t\t// $bd->xConsulta_NoReturn($sql);\n\t\t// $sql=\"update pedido set idcliente=\".$idclie.\" where idpedido in (\".$idpedidos.\")\";\n\t\t\n\t\t$x_idcliente = $idclie;\n\t\t$x_idpedido = $idpedidos;\n\n\t\techo $idclie;\n\n\t\t// $rptclie = json_encode(array('idcliente' => $idclie));\n\t\t// print $rptclie.'|';\n\n\t\t// 031218 // cambio: ahora se graba primero el cliente se devuelve el idcliete, \n\n\t\t// $GLOBALS['x_idcliente'] = $idclie;\n\t\t// return $x_idcliente;\n\t\t// echo $idclie;\n\t}", "public function registrarCliente($dados){\n //$conexao = $c->conexao();\n $tipoCadastro = $_POST['tipocad'];\n $tipoCliente = $_POST['tipo'];\n $iss = $_POST['iss'];\n $nome = trim($_POST['nome']);\n // $nomeJuridico = trim($_POST['nomeJuridico']);\n $nomeFantasia = trim($_POST['nomeFantasia']);\n $apelido = trim($_POST['apelido']);\n $cnpj = $_POST['cnpj'];\n $cpf = $_POST['cpf'];\n $rg = trim($_POST['rg']);\n $dt_nascimento = trim($_POST['dtnascimento']);\n $telefone = $_POST['telefone'];\n // $telefoneJ = $_POST['telefoneJ'];\n $telefone2J = $_POST['telefone2J'];\n $cep = $_POST['cep'];\n $endereco = $_POST['endereco'];\n $bairro = $_POST['bairro'];\n $uf = $_POST['uf'];\n $cidade = $_POST['cidade'];\n $complemento = $_POST['complemento'];\n $numero = trim($_POST['numero']);\n $usuid = $_SESSION['usuid'];\n\n $sql = \"SELECT count(*) as total from tbclientes WHERE rg = '$rg' or cnpj = '$cnpj' or cpf = '$cpf' \";\n $sql = $this->conexao->query($sql);\n $row = $sql->fetch_assoc();\n\n if($row['total'] == 1){\n return 0;\n }else{\n\n $sql = \"INSERT INTO tbclientes (nome, nomefantasia, apelido, tipocad, tipopessoa, iss, cpf, cnpj, rg, telefone, telefone2, dt_nascimento, data_cadastro, usuid, habilitado, cep, endereco, bairro, uf, cidade, complemento, numero) VALUES ('$nome', '$nomeFantasia', '$apelido', '$tipoCadastro', '$tipoCliente', '$iss', '$cpf', '$cnpj', '$rg', '$telefone', '$telefone2J', '$dt_nascimento', NOW(), '$usuid', 'S', '$cep', '$endereco', '$bairro', '$uf', '$cidade', '$complemento', '$numero') \";\n\n $mensagem = \"O Usuário \".$_SESSION['email'].\" cadastrou o Cliente $nome \";\n $this->salvaLog($mensagem);\n\n return $this->conexao->query($sql);\n\n }\n\n }", "public static function save($empleado){\n\t\t$db=Db::getConnect();\n\t\t\t\t\n\t\t$insert=$db->prepare('INSERT INTO empleado VALUES (NULL, :nombre,:apellidos,:id_provincia,\n\t\t\t:direccion,:estado,:id_tienda)');\n\n\t\t$insert->bindValue('nombre',$empleado->getNombre());\n\t\t$insert->bindValue('apellidos',$empleado->getApellidos());\n\t\t$insert->bindValue('id_provincia',$empleado->getProvincia());\n\t\t$insert->bindValue('direccion',$empleado->getDireccion());\t\t\n\t\t$insert->bindValue('estado',$empleado->getEstado());\n\t\t$insert->bindValue('id_tienda',$empleado->getTienda());\n\t\t$insert->execute();\n\n\t}", "public function inserir_anuncio(){\n if(!isset($_SESSION))session_start();\n\n $cliente = unserialize($_SESSION['cliente']);\n\n $id_veiculo = $_POST['cb_veiculos'];\n $data_inicial = $_POST['data_inicial'];\n $data_final = $_POST['data_final'];\n $hora_inicial = $_POST['hora_inicial'];\n $hora_final = $_POST['hora_final'];\n $descricao = $_POST['descricao'];\n $valor_hora = $_POST['valor_hora'];\n $id_cliente = $cliente->getId();\n\n $anuncio = new Anuncio();\n $anuncio->setDescricao($descricao)\n ->setIdClienteLocador($id_cliente)\n ->setIdVeiculo($id_veiculo)\n ->setHorarioInicio($hora_inicial)\n ->setHorarioTermino($hora_final)\n ->setDataInicial($data_inicial)\n ->setDataFinal($data_final)\n ->setValor($valor_hora);\n\n\n $this->anunciosDAO->insert($anuncio);\n\n }", "function entrada_por_traspaso(){\n\t\t$e= new Entrada();\n\t\t$e->usuario_id=$GLOBALS['usuarioid'];\n\t\t$e->empresas_id=$GLOBALS['empresaid'];\n\t\t$related = $e->from_array($_POST);\n\t\t//if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n\t\t$e->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$e->costo_total=($e->cantidad * $e->costo_unitario);\n\t\t$e->cproveedores_id=1;\n\t\t$e->fecha=date(\"Y-m-d H:i:s\");\n\t\tif($e->id==0)\n\t\t\tunset($e->id);\n\t\tif($e->save($related)) {\n\t\t\techo $e->id;\n\t\t} else\n\t\t\techo 0;\n\t}", "public function insertar(){\n $pdo=Conexion::conectar();\n $sentencia = $pdo->prepare(\"INSERT INTO empleado (id, nombre, apellido,direccion,telefono,email,estado,firma,jefe,id_cargo,id_departamento) VALUES (:id, :nombre, :apellido,:direccion,:telefono,:email,:estado,:firma,:jefe,:id_cargo,:id_departamento)\");\n $sentencia->bindParam(':id', $id);\n $sentencia->bindParam(':nombre', $nombre);\n $sentencia->bindParam(':apellido', $apellido);\n $sentencia->bindParam(':direccion', $direccion);\n $sentencia->bindParam(':telefono', $telefono);\n $sentencia->bindParam(':email', $email);\n $sentencia->bindParam(':estado', $estado);\n $sentencia->bindParam(':firma', $firma);\n $sentencia->bindParam(':jefe', $jefe);\n $sentencia->bindParam(':id_cargo', $id_cargo);\n $sentencia->bindParam(':id_departamento', $id_departamento);\n \n // estos los valores de los input\n $id=\"0700950454\";\n $nombre=\"aaa\";\n $apellido=\"ssss\";\n $direccion=\"sss\";\n $telefono=23323232;\n $email=\"[email protected]\";\n $estado=1;\n $firma=\"NULL\";\n $jefe=\"0706430980\";\n $id_cargo=3;\n $id_departamento=16;\n $sentencia->execute();\n \n \n //CUANDO NO TIENE JEFE--=EL EMPLEADO ES JEFE (NO ENVIAR EL PARAMETRO JEFE,LA BDD AUTOMTICAMENTE PONE NULL)\n $pdo=Conexion::conectar();\n $sentencia = $pdo->prepare(\"INSERT INTO empleado (id, nombre, apellido,direccion,telefono,email,estado,firma,id_cargo,id_departamento) VALUES (:id, :nombre, :apellido,:direccion,:telefono,:email,:estado,:firma,:id_cargo,:id_departamento)\");\n $sentencia->bindParam(':id', $id);\n $sentencia->bindParam(':nombre', $nombre);\n $sentencia->bindParam(':apellido', $apellido);\n $sentencia->bindParam(':direccion', $direccion);\n $sentencia->bindParam(':telefono', $telefono);\n $sentencia->bindParam(':email', $email);\n $sentencia->bindParam(':estado', $estado);\n $sentencia->bindParam(':firma', $firma);\n $sentencia->bindParam(':id_cargo', $id_cargo);\n $sentencia->bindParam(':id_departamento', $id_departamento);\n \n // estos los valores de los inputs\n $id=\"0700950454\";\n $nombre=\"aaa\";\n $apellido=\"ssss\";\n $direccion=\"sss\";\n $telefono=23323232;\n $email=\"[email protected]\";\n $estado=1;\n $firma=\"NULL\";\n $id_cargo=3;\n $id_departamento=16;\n $sentencia->execute();\n \n \n\n \n }", "public function save(){\n\t\t$bd=baseDatos::getInstance();\n\t\t$bd=new baseDatos(BD_USUARIO, BD_CONTRASENA, BD_NOMBRE_BD, BD_SERVIDOR);\n\t\t$bd->connect();\n\t\tif($this->id<>null){\n\t\t$columnas= array('idHotel','nombre','descripcion','cantidadEstrellas','ciudad','direccion','telefono','email','ubicacionFotografia');\n\t\t$valores = array($this->id,$this->nombre, $this->descripcion, $this->cantidadEstrellas, $this->ciudad, $this->direccion, $this->telefono, $this->email, $this->ubicacionFotografia);\n\t\t$filtros=array('idHotel'=>$this->id!= null);\n\t\tif (is_numeric($this->id) && $this->id > 0) {\n\t\t\t$bd->update(self::$tabla, $columnas, $valores, $filtros);\n\t\t} else {\n\t\t\t$bd->insert(self::$tabla, $columnas, $valores);\n\t\t}\n\t\t}else{\n\t\t\t$columnas= array('nombre','descripcion','cantidadEstrellas','ciudad','direccion','telefono','email','ubicacionFotografia');\n\t\t\t$valores = array($this->nombre, $this->descripcion, $this->cantidadEstrellas, $this->ciudad, $this->direccion, $this->telefono, $this->email, $this->ubicacionFotografia);\n\t\t\t$filtros=array('idHotel'=>$this->id!= null);\n\t\t\tif (is_numeric($this->id) && $this->id > 0) {\n\t\t\t\t$bd->update(self::$tabla, $columnas, $valores, $filtros);\n\t\t\t} else {\n\t\t\t\t$bd->insert(self::$tabla, $columnas, $valores);\n\t\t\t}\n\t\t}$bd->disconnect();\n\n\t}", "function reg_Empleado($ife, $name, $apellido, $dir, $tel, $ciudad) {\n\t\t\t$bit = false;\n\t\t\t$existe = $this->query_Registro('empleados', 'ife', $ife);\n\t\t\tif ($existe) {\n\t\t\t\techo \"<script>alert('La clave para el Empleado ya se encuentra registrada, intente de nuevo.');</script>\";\n\t\t\t}else{\n\t\t\t\t$sql_Reg = 'INSERT INTO empleados (IFE, nombre, apellido, direccion, telefono, ciudad)' .\n\t\t\t\t\t\t\t'VALUES (\"'.$ife.'\", \"'.$name.'\", \"'.$apellido.'\", \"'.$dir.'\", \"'.$tel.'\", \"'.$ciudad.'\")';\n\t\t\t\t$sql_Res = $this->conn->query($sql_Reg);\n\t\t\t\tif ($sql_Res) {\n\t\t\t\t\t$bit = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $bit;\n\t\t\t$this->conn->close();\n\t\t}", "public function agregar_empresa_controlador(){\n\t\t$codigo=mainModel::limpiar_cadena($_POST[\"cc-reg\"]);\n\t\t$nombre=mainModel::limpiar_cadena($_POST[\"nombre-reg\"]);\n\t\t$telefono=mainModel::limpiar_cadena($_POST[\"telefono-reg\"]);\n\t\t$email=mainModel::limpiar_cadena($_POST[\"email-reg\"]);\n\t\t$direccion=mainModel::limpiar_cadena($_POST[\"direccion-reg\"]);\n\t\t$director=mainModel::limpiar_cadena($_POST[\"director-reg\"]);\n\t\t$telefono2=mainModel::limpiar_cadena($_POST[\"telefono2-reg\"]);\n\t\t$year=mainModel::limpiar_cadena($_POST[\"year-reg\"]);\n\t\t\n\t\t\n\t\t$consulta1=mainModel::ejecutar_consulta_simple(\"SELECT EmpresaCodigo FROM empresa WHERE EmpresaCodigo='$codigo'\");\n\t\t\t\t\n\t\t\tif ($consulta1->rowCount()<=0){\n\n\t\t\t\t$consulta2=mainModel::ejecutar_consulta_simple(\"SELECT EmpresaNombre FROM empresa WHERE EmpresaNombre='$nombre'\");\t\n\n\t\t\t\tif($consulta2->rowCount()<=0){\n\t\t\t\t\t$datosEmpresa=[\n\t\t\t\t\t\t\"Codigo\"=>$codigo,\n\t\t\t\t\t\t\"Nombre\"=>$nombre,\n\t\t\t\t\t\t\"Telefono\"=>$telefono,\n\t\t\t\t\t\t\"Email\"=>$email,\n\t\t\t\t\t\t\"Direccion\"=>$direccion,\n\t\t\t\t\t\t\"Director\"=>$director,\n\t\t\t\t\t\t\"Telefono2\"=>$telefono2,\n\t\t\t\t\t\t\"Year\"=>$year\n\t\t\t\t\t\t];\n\t\t\t\t\t$guardarEmpresa=empresaModelo::agregar_empresa_modelo($datosEmpresa);\n\t\t\t\t\tif($guardarEmpresa->rowCount()>=1){\n\t\t\t\t\t\t$alerta=[\n\t\t\t\t\t\t\t\"Alertas\"=>\"recargar\",\n\t\t\t\t\t\t\t\"Titulo\"=>\"Registro exitoso\",\n\t\t\t\t\t\t\t\"Texto\"=>\"Se ha registrado la empresa en el sistema\",\n\t\t\t\t\t\t\t\"Tipo\"=>\"success\"\n\t\t\t\t\t\t\t];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$alerta=[\n\t\t\t\t\t\t\t\"Alertas\"=>\"simple\",\n\t\t\t\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\n\t\t\t\t\t\t\t\"Texto\"=>\"No se ha podido registrar la Empresa en el sistema\",\n\t\t\t\t\t\t\t\"Tipo\"=>\"error\"\n\t\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$alerta=[\n\t\t\t\t\t\"Alertas\"=>\"simple\",\n\t\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\n\t\t\t\t\t\"Texto\"=>\"El nombre de la empresa que acaba de ingresar ya se encuentra resgitrada en el sistema\",\n\t\t\t\t\t\"Tipo\"=>\"error\"\n\t\t\t\t\t];\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t$alerta=[\n\t\t\t\t\t\"Alertas\"=>\"simple\",\n\t\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\n\t\t\t\t\t\"Texto\"=>\"El NIT que acaba de ingresar ya se encuentra resgitrada en el sistema\",\n\t\t\t\t\t\"Tipo\"=>\"error\"\n\t\t\t\t\t];\n\t\t\t}\n\t\t\treturn mainModel::sweet_alert($alerta);\n\t}", "public function getId_empresa()\n {\n return $this->id_empresa;\n }", "public function insertarEmpresa($nombre_empresa, $representante, $nit, $direccion, $municipio, $correo, $pagina_web, $celular, $telefono, $sector, $actividad, $clave)\n {\n $query = \"INSERT INTO empresa(nombre_empresa,representante_legal,nit_empresa,direccion_empresa,municipio_empresa,correo_empresa,web_empresa,celular_empresa,telefono_empresa,sector_empresa,actividad_empresa,clave_empresa) VALUES(:nombre,:representante,:nit,:direccion,:municipio,:correo,:pagina_web,:celular,:telefono,:sector,:actividad,:clave)\";\n $stmt = $this->conexion->prepare($query);\n $stmt->bindParam(\":nombre\", $nombre_empresa);\n $stmt->bindParam(\":representante\", $representante);\n $stmt->bindParam(\":nit\", $nit);\n $stmt->bindParam(\":direccion\", $direccion);\n $stmt->bindParam(\":municipio\", $municipio);\n $stmt->bindParam(\":correo\", $correo);\n $stmt->bindParam(\":pagina_web\", $pagina_web);\n $stmt->bindParam(\":celular\", $celular);\n $stmt->bindParam(\":telefono\", $telefono);\n $stmt->bindParam(\":sector\", $sector);\n $stmt->bindParam(\":actividad\", $actividad);\n $stmt->bindParam(\":clave\", $clave);\n if (!$stmt->execute()) {\n $stmt->closeCursor();\n return 0;\n } else {\n $stmt->closeCursor();\n return 1;\n }\n }", "public function Guardar(){\n\t\t\t$enlace = AccesoBD::Conexion();\n\t\t\t$sql = \"INSERT INTO denuncia (ID_VICTIMA, ES_LA_VICTIMA, DESCRIPCION_EVENTO, ASESORADO, \n\t\t\tASISTENCIA_PROFESIONAL, DENUNCIA_POLICIAL, PERPETRADOR_CONOCIDO, PROCEDIMIENTO_PERPETRADOR) VALUES ('$this->victima','$this->esLaVictima','$this->descripcionEvento','$this->yaAsesorado','$this->asistenciaProfesional',\n\t\t\t'$this->denunciaPolicial','$this->perpetradorConocido','$this->procedimientoPerpetrador')\";\n\t\t\tif ($enlace->query($sql) === TRUE) {\n \t\t\techo \"Nueva denuncia creada. Id de denuncia: \" . $enlace->insert_id;\n \t\t\treturn $enlace->insert_id;\n\t\t\t} else {\n \t\t\techo \"Error al guardar la denuncia \";\n\t\t\t}\n\t\t}", "function guardarComentario($idpincho,$login,$coment){\n\t\t$comentario = new Comentarios();\n\t\treturn $comentario->insertarComentario($idpincho,$login,$coment);\n\t}", "public function DevuelveSaldoProducto($tabla,$idTabla,$Filtro,$idProducto)\r\n {\r\n\t//$sql=\"INSERT INTO `servitorno`.`clientes` ( `RazonSocial`, `NIT`, `Direccion`, `Telefono`, `Ciudad`, `Contacto` , `TelContacto`, `Email`) VALUES ('$_POST[TxtNombre]', '$_POST[TxtNIT]', '$_POST[TxtDireccion]', '$_POST[TxtTelefono]', '$_POST[TxtCiudad]', '$_POST[TxtContacto]', '$_POST[TxtCelConta]', '$_POST[TxtEmail]')\";\r\n\t\t \r\n\t$sql=\"SELECT MAX($idTabla) as MaxId FROM $tabla WHERE $Filtro='$idProducto' and Movimiento='SALDOS'\";\r\n\r\n\t$MaxId=mysql_query($sql, $this->con) or die('no se pudo registrar el movimiento en la tabla $tabla: ' . mysql_error());\r\n\t$MaxId=mysql_fetch_array($MaxId);\r\n\t$idSaldo=$MaxId[\"MaxId\"];\r\n\t\r\n\t$sql=\"SELECT Cantidad as Cantidad FROM $tabla WHERE $idTabla='$idSaldo'\";\r\n\r\n\t$MaxId=mysql_query($sql, $this->con) or die('no se pudo registrar el movimiento en la tabla $tabla: ' . mysql_error());\r\n\t$MaxId=mysql_fetch_array($MaxId);\r\n\t$SaldoActual=$MaxId[\"Cantidad\"];\r\n\treturn($SaldoActual);\r\n}", "public function Guardarhorario()\n\t{\n\t\t$query=\"INSERT INTO horario (dia,mes,anio,hora,estatus) VALUES ('$this->dia','$this->mes','$this->anio','$this->hora','$this->estatus')\";\n\t\t\n\t\t\n\t\t$resp=$this->db->consulta($query);\n\t\t$this->idhorario = $this->db->id_ultimo();\n\t\t\n\t\t\n\t}", "public function save(){\r\n\t\tif(empty($this->idPrestamoEjemplar)){\t\t\t\r\n\t\t\t$this->idPrestamoEjemplar = $this->con->autoInsert(array(\r\n\t\t\t\"Prestamo_idPrestamo\" => $this->prestamoIdPrestamo,\r\n\t\t\t\"Ejemplar_idEjemplar\" => $this->ejemplarIdEjemplar,\r\n\t\t\t),\"prestamo_has_ejemplar\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\treturn $this->con->autoUpdate(array(\r\n\t\t\t\"Prestamo_idPrestamo\" => $this->prestamoIdPrestamo,\r\n\t\t\t\"Ejemplar_idEjemplar\" => $this->ejemplarIdEjemplar,\r\n\t\t\t),\"prestamo_has_ejemplar\",\"idPrestamo_Ejemplar=\".$this->getId());\r\n\t}", "public function guardar()\n\t{\n\t\t// Crear una instancia de la conexion\n\t\t$conexion = new Conexion;\n\n\t\t// Comprobar si es un registro nuevo o uno ya existente\n\t\tif ($this->update) {\n\n\t\t\t// Preparar la sentencia para actualizar el tipo de rol en la bd\n\t\t\t$sentencia = $conexion->conn->prepare(\"UPDATE \". static::$tablaConsulta . \" SET medio= ? WHERE id= ?\");\n\n\t\t\t// Pasar los campos del objecto a la sentencia\n\t\t\t$sentencia->bind_param(\n\t\t\t\t\t'si',\n\t\t\t\t\t$this->medio,\n\t\t\t\t\t$this->id\n\t\t\t);\n\n\t\t} else {\n\n\t\t\t// Preparar la sentencia para isertar el tipo de rol en la bd\n\t\t\t$sentencia = $conexion->conn->prepare(\"INSERT INTO \". static::$tablaConsulta . \" VALUES (null, ?)\");\n\n\t\t\t// Pasar los campos del objecto a la sentencia\n\t\t\t$sentencia->bind_param(\n\t\t\t\t\t's',\n\t\t\t\t\t$this->medio\n\t\t\t);\n\t\t}\n\n\n // Ejecutar la sentencia\n\t\tif ( $sentencia->execute() ) {\n\n\t\t\t// Devolver un uno si fue un exito\n\t\t\treturn 1;\n\t\t} else {\n\n\t\t\t// Devolver un 0 si ocurrio un error\n\t\t\treturn 0;\n\t\t}\n\t}", "function guardar_receta($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tcom_recetas\n\t\t\t\t\t\t(id, nombre, precio, ganancia, ids_insumos, ids_insumos_preparados, preparacion)\n\t\t\t\tVALUES\n\t\t\t\t\t(\".$datos['id_receta'].\", '\".$datos['nombre'].\"',\".$datos['precio_venta'].\",\n\t\t\t\t\t\t\".$datos['margen_ganancia'].\",\n\t\t\t\t\t\t'\".$datos['ids'].\"','\".$datos['ids_preparados'].\"','\".$datos['preparacion'].\"'\n\t\t\t\t\t)\";\n\t\t// return $sql;\n\t\t$result =$this->insert_id($sql);\n\n\t// Guarda la actividad\n\t\t$fecha=date('Y-m-d H:i:s');\n\n\t\t$texto = ($datos['tipo']==1) ? 'receta' : 'insumo preparado' ;\n\t// Valida que exista el empleado si no agrega un cero como id\n\t\t$usuario = (!empty($_SESSION['accelog_idempleado'])) ?$_SESSION['accelog_idempleado'] : 0 ;\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tcom_actividades\n\t\t\t\t\t\t(id, empleado, accion, fecha)\n\t\t\t\tVALUES\n\t\t\t\t\t('',\".$usuario.\",'Agrega \".$texto.\"', '\".$fecha.\"')\";\n\t\t$actividad=$this->query($sql);\n\n\t\treturn $result;\n\t}", "function agregar_nueva_poliza($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion){\n\t\n\t//VEO SI SE HA HECHO CLICK EN EL BOTON GUARDAR\n\tif(isset($_POST['btnGuardar'])) {\n\t\t\n\t\t\t$id_ef_cia = base64_decode($_GET['id_ef_cia']);\t\n\t\t \n\t\t\t//SEGURIDAD\n\t\t\t$num_poliza = $conexion->real_escape_string($_POST['txtPoliza']);\n\t\t\t$fecha_ini = $conexion->real_escape_string($_POST['txtFechaini']);\n\t\t\t$fecha_fin = $conexion->real_escape_string($_POST['txtFechafin']);\n\t\t\t$producto = $conexion->real_escape_string($_POST['txtProducto']);\n\t\t\t//GENERAMOS EL ID CODIFICADO UNICO\n\t\t\t$id_new_poliza = generar_id_codificado('@S#1$2013');\t\t\t\t\t\n\t\t\t//METEMOS LOS DATOS A LA BASE DE DATOS\n\t\t\t$insert =\"INSERT INTO s_poliza(id_poliza, no_poliza, fecha_ini, fecha_fin, producto, id_ef_cia) \"\n\t\t\t\t .\"VALUES('\".$id_new_poliza.\"', '\".$num_poliza.\"', '\".$fecha_ini.\"', '\".$fecha_fin.\"', '\".$producto.\"', '\".$id_ef_cia.\"')\";\n\t\t\t\n\t\t\t\n\t\t\t//VERIFICAMOS SI HUBO ERROR EN EL INGRESO DEL REGISTRO\n\t\t\tif($conexion->query($insert)===TRUE){\n\t\t\t\t\t\t\t\t\n\t\t\t\t$mensaje=\"Se registro correctamente los datos del formulario\";\n\t\t\t header('Location: index.php?l=des_poliza&var='.$_GET['var'].'&listarpolizas=v&id_ef_cia='.$_GET['id_ef_cia'].'&entidad='.$_GET['entidad'].'&compania='.$_GET['compania'].'&id_ef='.base64_encode($_GET['id_ef']).'&producto_nombre='.$_GET['producto_nombre'].'&producto_code='.$_GET['producto_code'].'&op=1&msg='.base64_encode($mensaje));\n\t\t\t exit;\n\t\t\t} else {\n\t\t\t\t$mensaje=\"Hubo un error al ingresar los datos, consulte con su administrador \".$conexion->errno.\": \".$conexion->error;\n\t\t\t header('Location: index.php?l=des_poliza&var='.$_GET['var'].'&listarpolizas=v&id_ef_cia='.$_GET['id_ef_cia'].'&entidad='.$_GET['entidad'].'&compania='.$_GET['compania'].'&id_ef='.base64_encode($_GET['id_ef']).'&producto_nombre='.$_GET['producto_nombre'].'&producto_code='.$_GET['producto_code'].'&op=2&msg='.base64_encode($mensaje));\n\t\t\t\texit;\n\t\t\t}\n\t\t\n\t}else {\n\t\t//MUESTRO EL FORM PARA CREAR UNA CATEGORIA\n\t\tmostrar_crear_poliza($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion);\n\t}\n}", "function salida_por_traspaso(){\n\t\t$e= new Salida();\n\t\t$e->usuario_id=$GLOBALS['usuarioid'];\n\t\t$e->empresas_id=$GLOBALS['empresaid'];\n\t\t$related = $e->from_array($_POST);\n\t\t//if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n\t\t$e->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$e->costo_total=($e->cantidad * $e->costo_unitario);\n\t\t$e->cclientes_id=1;\n\t\t$e->fecha=date(\"Y-m-d H:i:s\");\n\t\tif($e->id==0)\n\t\t\tunset($e->id);\n\t\tif($e->save($related)) {\n\t\t\techo $e->id;\n\t\t} else\n\t\t\techo 0;\n\t}", "public function inserirCliente() {\r\n\r\n if (isset($_POST['nombre'])) {\r\n\r\n $objClienteModel = new ClienteModel();\r\n\r\n $objClienteModel->setNombre($_POST['nombre']);\r\n $objClienteModel->setUsername($_POST['username']);\r\n $objClienteModel->setEmail($_POST['email']);\r\n $objClienteModel->setContrasena($_POST['contrasena']);\r\n $objClienteModel->setApellido($_POST['apellido']);\r\n $objClienteModel->setDocumento($_POST['documento']);\r\n $objClienteModel->setEdad($_POST['edad']);\r\n $objClienteModel->setTelefono($_POST['telefono']);\r\n $objClienteModel->setDireccion($_POST['direccion']);\r\n $objClienteModel->setCiudad($_POST['ciudad']);\r\n $objClienteModel->setBarrio($_POST['barrio']);\r\n $objClienteModel->setTipoUsuario(3);\r\n \r\n if ($objClienteModel->insertarCliente()) {\r\n $msg = \"ok\";\r\n } else {\r\n $msg = \"problem\";\r\n }\r\n }\r\n include 'View/Client/RegistroCliente.php';\r\n }", "function eliminarEmpresa(){\n\t\t$this->procedimiento='dir.f_empresa_ime';\n\t\t$this->transaccion='DIR_EMP_ELI';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_empresa','id_empresa','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "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 }", "function eliminarCliente(){\n\t\t$this->procedimiento='rec.ft_cliente_ime';\n\t\t$this->transaccion='REC_CLI_ELI';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cliente','id_cliente','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function guardar_horario()\n {\n $fecha = filter_input(INPUT_POST, 'fecha');\n $hora = filter_input(INPUT_POST, 'hora');\n $zona = filter_input(INPUT_POST, 'zona');\n\n $profe=$this->model->get_profe($_SESSION['iduser']);\n $this->model->set_horario($profe[0]['id_profesores'],$fecha,$hora,$zona);\n $this->model->delete_horario();\n\n }", "function consultarUserEmpleado(){\n\t\t\n\t\t$usu=$this->objEmpleado->getUsuario();\n\t\t//SELECT ESTADO FROM `cliente` WHERE `usuario`=\"lili\"\n\t\t$objConexion = new ControlConexion();\n\t\t$objConexion->abrirBd($GLOBALS['serv'],$GLOBALS['usua'],$GLOBALS['pass'],$GLOBALS['bdat']);\n\t\t//$comandoSql=\"SELECT cedula, nombre_tmp, tipoCliente, fechaRegistro, imagen_tmp, email_tmp, telefono_tmp, cupoCredito, contrasena FROM CLIENTE WHERE USUARIO='\".$usu.\"' \";\n\t\t$comandoSql=\"SELECT * FROM EMPLEADO WHERE USUARIO='\".$usu.\"' \";\n\t\t\n\t\t$recordSet=$objConexion->ejecutarSelect($comandoSql);\n\n\t\t \n\t\t\n\t\twhile($registro = $recordSet->fetch_array(MYSQLI_ASSOC)){\n\t\t\n\t\t\t$this->objEmpleado->setNombre($registro[\"nombre\"]);\n\t\t\t$this->objEmpleado->setCedula($registro[\"cedula\"]);\n\t\t\t$this->objEmpleado->setFechaIngreso($registro[\"fechaIngreso\"]);\n\t\t\t$this->objEmpleado->setFechaRetiro($registro[\"fechaRetiro\"]);\n\t\t\t$this->objEmpleado->setSalarioBasico($registro[\"salarioBasico\"]);\n\t\t\t$this->objEmpleado->setDeducciones($registro[\"deducciones\"]);\n\t\t\t$this->objEmpleado->setFoto($registro[\"foto\"]);\n\t\t\t$this->objEmpleado->setHojaVida($registro[\"hojaVida\"]);\n\t\t\t$this->objEmpleado->setEmail($registro[\"email\"]);\n\t\t\t$this->objEmpleado->setTelefono($registro[\"telefono\"]);\n\t\t\t$this->objEmpleado->setCelular($registro[\"celular\"]);\n\t\t\t$this->objEmpleado->setEstado($registro[\"estado\"]);\n\t\t\t$this->objEmpleado->setContrasena($registro[\"contrasena\"]);\n\t\t\t$this->objEmpleado->setNombreTmp($registro[\"nombre_tmp\"]);\n\t\t\t$this->objEmpleado->setFotoTmp($registro[\"foto_tmp\"]);\n\t\t\t$this->objEmpleado->setHojaVidaTmp($registro[\"hojaVida_tmp\"]);\n\t\t\t$this->objEmpleado->setEmailTmp($registro[\"email_tmp\"]);\n\t\t\t$this->objEmpleado->setTelefonoTmp($registro[\"telefono_tmp\"]);\n\t\t\t$this->objEmpleado->setCelularTmp($registro[\"celular_tmp\"]);\n\n\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t\t$objConexion->cerrarBd(); \n\t\t\treturn $this->objEmpleado; \t\t\n\t}", "public function insert($tblEmpleado){\r\n\t\t$sql = 'INSERT INTO tbl_empleado (dui, nit, isss, afp, nombre, apellido, sexo, cuenta, fecha_nacimiento, salario, id_puesto_trabajo) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';\r\n\t\t$qpos = 0;\r\n\t\t\n\t\t$qpos = strpos($sql, '?', $qpos + 1);\n\t\tif ((!isset($tblEmpleado->dui)) || is_null($tblEmpleado->dui))\n\t\t\t$sql = substr_replace($sql, 'NULL', $qpos, 1);\n\t\t$qpos = strpos($sql, '?', $qpos + 1);\n\t\tif ((!isset($tblEmpleado->nit)) || is_null($tblEmpleado->nit))\n\t\t\t$sql = substr_replace($sql, 'NULL', $qpos, 1);\n\t\t$qpos = strpos($sql, '?', $qpos + 1);\n\t\tif ((!isset($tblEmpleado->isss)) || is_null($tblEmpleado->isss))\n\t\t\t$sql = substr_replace($sql, 'NULL', $qpos, 1);\n\t\t$qpos = strpos($sql, '?', $qpos + 1);\n\t\tif ((!isset($tblEmpleado->afp)) || is_null($tblEmpleado->afp))\n\t\t\t$sql = substr_replace($sql, 'NULL', $qpos, 1);\n\t\t$qpos = strpos($sql, '?', $qpos + 1);\n\t\tif ((!isset($tblEmpleado->nombre)) || is_null($tblEmpleado->nombre))\n\t\t\t$sql = substr_replace($sql, 'NULL', $qpos, 1);\n\t\t$qpos = strpos($sql, '?', $qpos + 1);\n\t\tif ((!isset($tblEmpleado->apellido)) || is_null($tblEmpleado->apellido))\n\t\t\t$sql = substr_replace($sql, 'NULL', $qpos, 1);\n\t\t$qpos = strpos($sql, '?', $qpos + 1);\n\t\tif ((!isset($tblEmpleado->sexo)) || is_null($tblEmpleado->sexo))\n\t\t\t$sql = substr_replace($sql, 'NULL', $qpos, 1);\n\t\t$qpos = strpos($sql, '?', $qpos + 1);\n\t\tif ((!isset($tblEmpleado->cuenta)) || is_null($tblEmpleado->cuenta))\n\t\t\t$sql = substr_replace($sql, 'NULL', $qpos, 1);\n\t\t$qpos = strpos($sql, '?', $qpos + 1);\n\t\tif ((!isset($tblEmpleado->fechaNacimiento)) || is_null($tblEmpleado->fechaNacimiento))\n\t\t\t$sql = substr_replace($sql, 'NULL', $qpos, 1);\n\t\t$qpos = strpos($sql, '?', $qpos + 1);\n\t\tif ((!isset($tblEmpleado->salario)) || is_null($tblEmpleado->salario))\n\t\t\t$sql = substr_replace($sql, 'NULL', $qpos, 1);\n\t\t$qpos = strpos($sql, '?', $qpos + 1);\n\t\tif ((!isset($tblEmpleado->idPuestoTrabajo)) || is_null($tblEmpleado->idPuestoTrabajo))\n\t\t\t$sql = substr_replace($sql, 'NULL', $qpos, 1);\n\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\t\n\t\tif ((isset($tblEmpleado->dui)) && (!is_null($tblEmpleado->dui)))\n\t\t\t$sqlQuery->set($tblEmpleado->dui);\n\t\tif ((isset($tblEmpleado->nit)) && (!is_null($tblEmpleado->nit)))\n\t\t\t$sqlQuery->set($tblEmpleado->nit);\n\t\tif ((isset($tblEmpleado->isss)) && (!is_null($tblEmpleado->isss)))\n\t\t\t$sqlQuery->set($tblEmpleado->isss);\n\t\tif ((isset($tblEmpleado->afp)) && (!is_null($tblEmpleado->afp)))\n\t\t\t$sqlQuery->set($tblEmpleado->afp);\n\t\tif ((isset($tblEmpleado->nombre)) && (!is_null($tblEmpleado->nombre)))\n\t\t\t$sqlQuery->set($tblEmpleado->nombre);\n\t\tif ((isset($tblEmpleado->apellido)) && (!is_null($tblEmpleado->apellido)))\n\t\t\t$sqlQuery->set($tblEmpleado->apellido);\n\t\tif ((isset($tblEmpleado->sexo)) && (!is_null($tblEmpleado->sexo)))\n\t\t\t$sqlQuery->set($tblEmpleado->sexo);\n\t\tif ((isset($tblEmpleado->cuenta)) && (!is_null($tblEmpleado->cuenta)))\n\t\t\t$sqlQuery->set($tblEmpleado->cuenta);\n\t\tif ((isset($tblEmpleado->fechaNacimiento)) && (!is_null($tblEmpleado->fechaNacimiento)))\n\t\t\t$sqlQuery->set($tblEmpleado->fechaNacimiento);\n\t\tif ((isset($tblEmpleado->salario)) && (!is_null($tblEmpleado->salario)))\n\t\t\t$sqlQuery->set($tblEmpleado->salario);\n\t\tif ((isset($tblEmpleado->idPuestoTrabajo)) && (!is_null($tblEmpleado->idPuestoTrabajo)))\n\t\t\t$sqlQuery->setNumber($tblEmpleado->idPuestoTrabajo);\n\r\n\t\t$id = $this->executeInsert($sqlQuery);\t\r\n\t\t$tblEmpleado->idEmpleado = $id;\r\n\t\treturn $id;\r\n\t}", "public function guardarRecesoFechaUsuario($idUsuario, $fecha, $horaInicio, $horaFin){\n\t\t\n\t\t\t$fecha \t\t= parent::escaparQueryBDCliente($fecha); \n\t\t\t$idUsuario \t= parent::escaparQueryBDCliente($idUsuario); \n\t\t\t$horaInicio \t= parent::escaparQueryBDCliente($horaInicio); \n\t\t\t$horaFin \t\t= parent::escaparQueryBDCliente($horaFin); \t\t\t\n \n\t\t\t$resultado = \"\";\n\t\t\t\n $query = \"INSERT INTO tb_agendaRecesosFechaUsuario (fecha, idUsuario) \".\n \" VALUES ('$fecha', '$idUsuario') \";\n \n $conexion = parent::conexionCliente();\n \t\t\n if($res = $conexion->query($query)){\n \n\t\t\t\t\t$query2\t= \"SELECT MAX(idAgendaRecesosFechaUsuario) as ultimoIdRecesoFechaUsuario FROM tb_agendaRecesosFechaUsuario\";\n\t\t\t\n\t\t\t\t\tif($res2 = $conexion->query($query2)){\n\t\t\t \n\t\t\t /* obtener un array asociativo */\n\t\t\t while ($filas = $res2->fetch_assoc()) {\n\t\t\t \t\n\t\t\t $resultado = $filas['ultimoIdRecesoFechaUsuario'];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$query3 = \"INSERT INTO tb_agendaHorarioRecesoFecha (horaInicio, horaFin, estado, idAgendaRecesosFechaUsuario)\n\t\t\t\t\t\t\t\t\t\t\tVALUES ('$horaInicio','$horaFin','A','$resultado')\";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$conexion->query($query3);\n\t\t\t\t\t\t\t\t\n\t\t\t }\n\t\t\t \n\t\t\t /* liberar el conjunto de resultados */\n\t\t\t $res2->free();\n\t\t\t \n\t\t\t }//fin if\n }//fin if externo\n \n\t\t\n\t\t\n\t}", "public function store(Request $request)\n {\n\n /* if(Auth::check()==false){\n return redirect('/login');\n }*/\n\n $insertClient = request('insertClient');\n $insertVehicle = request('insertVehicle');\n\n if($insertClient!=1){\n $cliente = new Cliente();\n\n $clientedni = $cliente->dni = request('dniCliente');\n $cliente->nombrecli = request('nombre');\n $cliente->apellido = request('apellido');\n $cliente->direccion = request('direccion');\n $cliente->telefono = request('telefono');\n\n $cliente->save();\n\n }else{\n $clientedni = request('dniCliente');\n }\n\n $clienteid =\\App\\Cliente::select('id')->where('dni',$clientedni)->first();\n $cliente = \\App\\Cliente::find($clienteid->id);\n\n $incidencia = new Incidencia();\n\n $incidencia->tipoincidencia = request('tipoincidencia');\n $incidencia->lugar = request('lugar');\n $incidencia->estado = request('estado');\n if($insertClient==1) {\n $incidencia->cliente_id = request('idCliente');\n }else{\n $incidencia->cliente_id = $cliente->id;\n }\n $incidencia->usuario_id = request('idUsuario');\n $incidencia->tecnico_id = request('idTecnico');\n\n $tecnico = Tecnico::find(request(\"idTecnico\"));\n\n $tecnico->estado=1;\n $tecnico->save();\n\n\n $incidencia->save();\n\n\n\n if($insertVehicle!=1) {\n $vehiculo = new Vehiculo();\n\n $vehiculo->matricula = request('matricula');\n $vehiculo->marca = request('marca');\n $vehiculo->modelo = request('modelo');\n $vehiculo->tipo = request('tipovehiculo');\n $vehiculo->aseguradora = request('aseguradora');\n if($insertClient==1) {\n $vehiculo->cliente_id = request('idCliente');\n }else{\n $vehiculo->cliente_id = $cliente->id;\n }\n\n $vehiculo->save();\n }\n\n\n return redirect()->route('sendMail');\n\n\n\n\n\n\n }", "function modificarEmpresa(){\n\t\t$this->procedimiento='dir.f_empresa_ime';\n\t\t$this->transaccion='DIR_EMP_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_empresa','id_empresa','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('tipo_sociedad','tipo_sociedad','varchar');\n\t\t$this->setParametro('objeto','objeto','text');\n\t\t$this->setParametro('dir_comercial','dir_comercial','varchar');\n\t\t$this->setParametro('nit','nit','varchar');\n\t\t$this->setParametro('clase','clase','varchar');\n\t\t$this->setParametro('domicilio','domicilio','text');\n\t\t$this->setParametro('matricula','matricula','int8');\n\t\t$this->setParametro('renovado','renovado','int4');\n\t\t$this->setParametro('domicilio_legal','domicilio_legal','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('seccion','seccion','varchar');\n\t\t$this->setParametro('telefono','telefono','varchar');\n\t\t$this->setParametro('divission','divission','varchar');\n\t\t$this->setParametro('estado_matricula','estado_matricula','varchar');\n\t\t$this->setParametro('mail','mail','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function insertar(){\n $this -> Conexion -> abrir();\n $this -> Conexion -> ejecutar( $this -> ClienteDAO -> insertar());\n $res = $this -> Conexion -> filasAfectadas();\n $this -> Conexion -> cerrar();\n return $res;\n }", "function guardarComida($arg) {\n\t\tSessionHandler()->check_session();\n\t\tdate_default_timezone_set('America/Argentina/La_Rioja');\n\t\t$ids = explode('@', $arg);\n\t\t$mesa = $ids[0];\n\t\t$comida = $ids[1];\n\t\t$cantidad = $ids[2];\n\t\t$pedidoId = $ids[3];\n\t\t\n\t\tif ($pedidoId != null || $pedidoId != 0 || $pedidoId != \"\") {\n\t\t\t$bp = new ComidaPedido();\n\t\t\t$bp->pedido = $pedidoId;\n\t\t\t$bp->comida = $comida;\n\t\t\t$bp->cantidad = $cantidad;\n\t\t\t$bp->save();\n\t\t\t\n\t\t\t$md = new Mesa();\n\t\t\t$md->mesa_id = $mesa;\n\t\t\t$md->get();\n\t\t\t$md->disponible = 2;\n\t\t\t$md->save();\n\t\t\tprint($pedidoId);exit;\n\t\t}\n\n\t\t$this->model->fecha = date('Y-m-d');\t\t\n\t\t$this->model->mesa = $mesa;\t\t\n\t\t$this->model->estado = 1;\t\t\n $this->model->save();\n\t\t\n\t\t$pedido_id = $this->model->pedido_id;\n\n\t\t$md = new Mesa();\n\t\t$md->mesa_id = $mesa;\n\t\t$md->get();\n\t\t$md->disponible = 2;\n\t\t$md->save();\n\t\t\n\t\t$bp = new ComidaPedido();\n\t\t$bp->pedido = $pedido_id;\n\t\t$bp->comida = $comida;\n\t\t$bp->cantidad = $cantidad;\n\t\t$bp->save();\n\t\tprint($pedido_id);exit;\n\n\t}", "public function store()\n {\n $this->validate();\n\n $cliente = Cliente::create([\n 'sexo_id' => $this->sexo_id,\n 'cedula' => $this->cedula,\n 'nombre_primero' => $this->nombre_primero,\n 'nombre_segundo' => $this->nombre_segundo,\n 'apellido_paterno' => $this->apellido_paterno,\n 'apellido_materno' => $this->apellido_materno,\n 'direccion' => $this->direccion,\n 'correo' => $this->correo,\n 'telefono' => $this->telefono,\n 'fecha_nacimiento' => $this->fecha_nacimiento,\n 'deuda' => $this->deuda,\n ]);\n\n $this->resetInput();\n $this->accion = 1;\n }", "public function creaCliente()\n {\n $id=null; // id del cliente, esto es lo que se debe guardar en la DB\n $this->cliente = $this->pasarela->customer()->create([\n 'firstName' => 'Mike',\n 'lastName' => 'Jones', \n 'company' => 'Jones Co.',\n 'email' => '[email protected]',\n 'phone' => '281.330.8004',\n 'fax' => '419.555.1235',\n 'website' => 'http://example.com'\n ]);\n $this->cliente=$this->cliente->customer->id; // asi es como se obtiene el id del cliente\n // se guarda en la DB\n $c=new Cliente();\n $c->token=$this->cliente;\n $c->save();\n }", "static Public function MdlGuardaCancelado($idcliente, $num_cancelacion, $numsalida, $fechasalida, $valor1, $valor2, $prevta, $idalmacen, $espromo,$idUsuario){\n\n $stmt = Conexion::conectar()->prepare(\"INSERT INTO cancela_venta(id_cliente, num_cancelacion, num_salida, fecha_salida, id_producto, cantidad, precio_venta, id_almacen, es_promo, ultusuario) VALUES (:id_cliente, :num_cancelacion, :num_salida, :fecha_salida, :id_producto, :cantidad, :precio_venta, :id_almacen, :es_promo, :ultusuario)\");\n\n $stmt->bindParam(\":id_cliente\", $idcliente, PDO::PARAM_INT);\n $stmt->bindParam(\":num_cancelacion\", $num_cancelacion, PDO::PARAM_INT);\n $stmt->bindParam(\":num_salida\", $numsalida, PDO::PARAM_STR);\n $stmt->bindParam(\":fecha_salida\", $fechasalida, PDO::PARAM_STR);\n $stmt->bindParam(\":id_producto\", $valor1, PDO::PARAM_INT);\n $stmt->bindParam(\":cantidad\", $valor2, PDO::PARAM_INT);\n $stmt->bindParam(\":precio_venta\", $prevta, PDO::PARAM_STR);\n $stmt->bindParam(\":id_almacen\", $idalmacen, PDO::PARAM_INT);\n $stmt->bindParam(\":es_promo\", $espromo, PDO::PARAM_INT);\n $stmt->bindParam(\":ultusuario\", $idUsuario, PDO::PARAM_INT);\n\t\tif($stmt->execute()){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\n\t//$stmt->close();\n\t$stmt = null;\n \n}", "public function setcadastracliente($nome,$cpf,$email,$telefone,$idestado,$idcidade,$rua,$bairro,$numero,$cep,$login,$senha)\n { \n $bdLeilao = new bd_leilao();\n $sql = \"insert into cliente values(\".\"NULL\".\"','\".$nome.\"','\".$cpf.\"','\".$email.\"','\".$telefone.\"','\".$idestado.\"','\".$idcidade.\"','\".$rua.\"','\".$bairro.\"','\".$numero.\"','\".$cep.\"','\".$login.\"','\".$senha.\")\";\n $bdLeilao->execute($sql);\n }", "public function guardar(){\r\n\r\n\t $conexion = new Conexion();\r\n\t if($this->nombre ==true ){\r\n\t \t $consulta = $conexion->prepare('INSERT INTO ' . self::TABLA .' ( nombre,apellidos,edad,curso,transporteEscolar) \r\n\t \tVALUES(:nombre,:apellidos,:edad,:curso,:transporteEscolar)');\r\n\t \r\n\t $consulta->bindParam(':nombre', $this->nombre);\r\n\t $consulta->bindParam(':apellidos', $this->apellidos);\r\n\t $consulta->bindParam(':edad', $this->edad);\r\n\t $consulta->bindParam(':curso', $this->curso);\r\n\t $consulta->bindParam(':transporteEscolar', $this->transporteEscolar);\r\n\t $consulta->execute();\r\n\t\t\t$this->idAlumno = $conexion->lastInsertId();\r\n\t\t//\tif($respuesta1){\r\n\t\t//\t\treturn $respuesta1;\r\n\t\t//\t}\t\r\n\t\t\techo \"<h2 style='color:white;'>El Alumno se ha registrado con el id: \" . $this->idAlumno.\"</h2>\";\r\n\t\t\t printf (\"<br/><a href='registroAlumnos.php'><button class='lila'>Volver</button></a>\");\t\r\n\t\t}else{\r\n\t\t\techo \"<h2 style='color:white;'>No se pudo realizar el registro.</h2>\";\r\n\t\t\t printf (\"<br/><a href='registroAlumnos.php'><button class='lila'>Volver</button></a>\");\r\n\t\t}\r\n\t\t$conexion = null; \r\n\t\t}", "public function inserir($nome, $email, $endereco, $bairro, $cep, $cpf, $fone) {\n\n //$nome = $_POST[\"txt_nome\"]; // assim já pega os dados mas\n // por questão de segurança recomenda-se usar strip_tags para quebrar as tags e ficar mais seguro\n // usa-se o issset para verificar se o dado existe, senão retorna null\n $nome = isset($_POST[\"txt_nome\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_nome\")) : NULL; // usado para a edição e inserção do cliente\n $email = isset($_POST[\"txt_email\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_email\")) : NULL; // usado para a edição e inserção do cliente\n $endereco = isset($_POST[\"txt_endereco\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_endereco\")) : NULL; // usado para a edição e inserção do cliente\n $bairro = isset($_POST[\"txt_bairro\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_bairro\")) : NULL; // usado para a edição e inserção do cliente\n $cep = isset($_POST[\"txt_cep\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_cep\")) : NULL; // usado para a edição e inserção do cliente\n $cpf = isset($_POST[\"txt_cpf\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_cpf\")) : NULL; // usado para a edição e inserção do cliente\n $fone = isset($_POST[\"txt_fone\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_fone\")) : NULL; // usado para a edição e inserção do cliente\n\n $sql = \"INSERT INTO cliente SET nome = :nome, email = :email, endereco = :endereco, bairro = :bairro, cep = :cep, cpf = :cpf, fone = :fone\";\n $qry = $this->db->prepare($sql); // prepare para os dados externos\n $qry->bindValue(\":nome\", $nome); // comando para inserir\n $qry->bindValue(\":email\", $email); // comando para inserir\n $qry->bindValue(\":endereco\", $endereco); // comando para inserir\n $qry->bindValue(\":bairro\", $bairro); // comando para inserir\n $qry->bindValue(\":cep\", $cep); // comando para inserir\n $qry->bindValue(\":cpf\", $cpf); // comando para inserir\n $qry->bindValue(\":fone\", $fone); // comando para inserir\n $qry->execute(); // comando para executar\n\n return $this->db->lastInsertId(); // retorna o id do ultimo registro inserido\n }", "public function GuardarEstado()\n\t{\n\t\t$query=\"INSERT INTO estado (idpais,estado,descripcion) VALUES ($this->id_pais,'$this->estado','$this->descripcion')\";\n\t\t$resp=$this->db->consulta($query);\n\t\t$this->id_estado = $this->db->id_ultimo();\n\t\t\n\t\t\n\t\t\n\t}", "function Save(){\n $rowsAffected = 0;\n if(isset($this->legajo)){\n $rowsAffected = $this->UpdateSQL([\"legajo = \".$this->legajo]);\n }else{\n $rowsAffected = $this->InsertSQL();\n if($rowsAffected > 0){\n $this->legajo = $this->Max(\"legajo\");\n }\n }\n if($rowsAffected == 0){\n throw new \\Exception(\"Error al guardar Usuario\");\n }else{\n $this->Refresh();\n }\n }", "function guardarRecesoDia($idUsuario, $dia, $horaInicio, $horaFin){\n\t\t\n\t\t\t$dia \t\t\t= parent::escaparQueryBDCliente($dia); \n\t\t\t$idUsuario \t= parent::escaparQueryBDCliente($idUsuario); \n\t\t\t$horaInicio \t= parent::escaparQueryBDCliente($horaInicio); \n\t\t\t$horaFin \t\t= parent::escaparQueryBDCliente($horaFin); \t\t\t\n \n $query = \"INSERT INTO tb_agendaRecesosUsuario (numeroDia, idUsuario) \".\n \" VALUES ('$dia', '$idUsuario')\";\n \n\t\t \n $conexion = parent::conexionCliente();\n \t\t\n if($res = $conexion->query($query)){\n \n $query2\t= \"SELECT MAX(idAgendaRecesosUsuario) as ultimoIdRecesoUsuario FROM tb_agendaRecesosUsuario\";\n\t\t\t\n\t\t\t\t\tif($res2 = $conexion->query($query2)){\n\t\t\t \n\t\t\t /* obtener un array asociativo */\n\t\t\t while ($filas = $res2->fetch_assoc()) {\n\t\t\t \t\n\t\t\t $resultado = $filas['ultimoIdRecesoUsuario'];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$query3 = \"INSERT INTO tb_agendaHorarioReceso (horaInicio, horaFin, estado, idAgendaRecesosUsuario)\n\t\t\t\t\t\t\t\t\t\t\tVALUES ('$horaInicio','$horaFin','A','$resultado')\";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$conexion->query($query3);\n\t\t\t\t\t\t\t\t\n\t\t\t }\n\t\t\t \n\t\t\t /* liberar el conjunto de resultados */\n\t\t\t $res2->free();\n\t\t\t \n\t\t\t }\n\t\t\t\t \n\t\t\t\t \n }\n \n return $resultado;\t\t\n\t\t\n\t\t\n\t}", "public function setVendedor($nome,$comissao){\n try{\n $x = 1;\n $Conexao = Conexao::getConnection();\n $query = $Conexao->prepare(\"INSERT INTO vendedor (nome,comissao) VALUES ('$nome',$comissao)\"); \n $query->execute(); \n // $query = $Conexao->query(\"DELETE FROM vendedor WHERE id_vendedor = (SELECT top 1 id_vendedor from vendedor order by id_vendedor desc)\"); \n // $query->execute();\n return 1;\n\n }catch(Exception $e){\n echo $e->getMessage();\n return 2;\n exit;\n } \n }", "public function agregar_Empleado($datosEmpleado){\n\n $stmt=$this->db->prepare(\"CALL INSERT_EMPLEADO(:cc,:nombres,:apellido1,:apellido2,:codCargo,:tel,:correo)\");\n $stmt->bindParam(':nombres', $nombres);\n $stmt->bindParam(':apellido1', $apellido1);\n $stmt->bindParam(':apellido2', $apellido2);\n $stmt->bindParam(':codCargo', $codCargo);\n $stmt->bindParam(':tel', $tel);\n $stmt->bindParam(':correo', $correo);\n $stmt->bindParam(':cc', $cc);\n\n $cc=$datosEmpleado['cc'];\n $nombres=$datosEmpleado['nombres'];\n $apellido1=$datosEmpleado['apellido1'];\n $apellido2=$datosEmpleado['apellido2'];\n $codCargo=$datosEmpleado['codCargo'];\n $tel=$datosEmpleado['tel'];\n $correo=$datosEmpleado['correo'];\n $stmt->execute();\n $this->db=null; //cerrar conexión\n\n }", "function cadastraCliente($conexao,$nome,$endereco,$cep,$tel_celular,$tel_residencial,$email,$senha)\n {\n $sql = \"INSERT INTO cliente (nome,endereco,cep,tel_celular,tel_residencial,email,senha) VALUES\n ('{$nome}','{$endereco}','{$cep}','{$tel_celular}','{$tel_residencial}','{$email}','{$senha}')\";\n return mysqli_query($conexao,$sql);\n }", "public function guardar_lectura(){\n\t\t\n\t\t$userdata = $this->session->userdata('user_data');\n $empId = $userdata[0]['id_empresa'];\n\n\t\t$id_equipo = $_POST['id_equipo'];\n\t\t$id_parametro = $_POST['id_parametro'];\n\t\t$fecha = $_POST['fecha'];\n\t\t$valor = $_POST['valor'];\n\n\t\t$insert = array(\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t'paramId' => $id_parametro,\n\t\t\t\t\t\t\t\t\t'id_equipo' =>$id_equipo ,\n\t\t\t\t\t\t\t\t\t'valor' => $valor,\n\t\t\t\t\t\t\t\t\t'fechahora'=> $fecha,\n\t\t\t\t\t\t\t\t\t'id_empresa' => $empId\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t);\n\t\t$result = $this->Lecturas->guardar_lectura($insert);\n\t\techo json_encode($result); \n\t}", "function modificarCliente(){\n\t\t$this->procedimiento='rec.ft_cliente_ime';\n\t\t$this->transaccion='REC_CLI_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cliente','id_cliente','int4');\n\t\t$this->setParametro('genero','genero','varchar');\n\t\t$this->setParametro('ci','ci','varchar');\n\t\t$this->setParametro('email','email','varchar');\n\t\t$this->setParametro('email2','email2','varchar');\n\t\t$this->setParametro('direccion','direccion','varchar');\n\t\t$this->setParametro('celular','celular','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('lugar_expedicion','lugar_expedicion','varchar');\n\t\t$this->setParametro('apellido_paterno','apellido_paterno','varchar');\n\t\t$this->setParametro('telefono','telefono','varchar');\n\t\t$this->setParametro('ciudad_residencia','ciudad_residencia','varchar');\n\t\t$this->setParametro('id_pais_residencia','id_pais_residencia','int4');\n\t\t$this->setParametro('nacionalidad','nacionalidad','varchar');\n\t\t$this->setParametro('barrio_zona','barrio_zona','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('apellido_materno','apellido_materno','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function registerCliente($clientes, $pagos) {\n $where = \" WHERE Email = :Email\";\n $response = $this->db->select1(\"*\", 'clientes', $where, array('Email' => $clientes->Email));\n\n if (is_array($response)) {\n //A qui insertamos los datos a la tabla cliente\n $response = $response['results'];\n if (0 == count($response)) {\n //\n //Esta seria la query\n $value = \"(Nombre, Apellido_paterno, Apellido_materno, Email, Edad, Fecha_inicio, Folio) \n VALUE (:Nombre, :Apellido_paterno, :Apellido_materno, :Email, :Edad, :Fecha_inicio, :Folio)\";\n $data = $this->db->insert1(\"clientes\", $clientes, $value);\n // $data = true;\n if (is_bool($data)) {\n //A qui ya se inserto los datos en los datos en la tabla proveedores\n // echo $data;\n $response = $this->db->select1(\"*\", 'clientes', $where, array('Email' => $clientes->Email));\n // var_dump($response);\n if (is_array($response)) {\n echo \"condi2\";\n //Checamos si es el mismo proveedor\n $response = $response['results'];\n // var_dump($pagos);\n $pagos->Id_cliente = $response[0][\"Id_cliente\"];\n var_dump($pagos);\n $value = \" (`Id_pago`, `Nombre`, `Mes`, `Pago`, `Fecha_pago`, `Estatus`, `Folio`, `Id_cliente`) VALUES (:Id_pago, :Nombre,:Mes,:Pago,:Fecha_pago, :Estatus, :Folio, :Id_cliente)\";\n print_r($pagos);\n $data = $this->db->insert1(\"pagos\", $pagos, $value);\n\n if (is_bool($data)) {\n // return 0;\n return 0;\n } else {\n // return $data;\n echo $data;\n }\n } else {\n return $response;\n }\n } else {\n return $data;\n }\n } else {\n return 1;\n }\n } else {\n return $response;\n }\n }", "function create_empresa($data) {\n\t\t$data['fecha_alta'] = date('Y-m-d H:i:s');\n\t\t//Audit field\n\t\t$data['user'] = $this->auth_frr->is_logged_in();\n\n\t\tif ($this -> db -> insert('empresas', $data)) {\n\t\t\t$empresa_id = $this -> db -> insert_id();\n\t\t\treturn array('empresa_id' => $empresa_id);\n\t\t}\n\t}", "function guardar_contacto_nuevo_cliente() {\n $respuesta=\"\";\n $datos = array(\n 'id_cliente' => $this->input->post('id_cli'),\n 'nom_comp' => $this->input->post('nom_com'),\n 'telefonos' => $this->input->post('tel'),\n 'cargo' => $this->input->post('cargo'),\n 'direccion' => $this->input->post('dir'),\n 'estado' => \"Activo\");\n if($this->input->post('id_cont') != 0){\n \n $this->db->where('id_contacto', $this->input->post('id_cont'));\n $upd = $this->db->update('contacto_cliente', $datos);\n if ($upd != 0)\n $respuesta= \"<input type='hidden' id='ayudata' value='$upd'><input type='hidden' id='proceso' value='UPDATE'>\";\n\n }\n else {\n $this->db->insert('contacto_cliente', $datos);\n $id_con_nuevo=$this->db->insert_id();\n $respuesta = \"<input type='hidden' id='ayudata' value='$id_con_nuevo'><input type='hidden' id='proceso' value='INSERT'>\";\n }\n \n return ($respuesta);\n }", "public function GuardarCambios($model, $modelAvaluo, $modelRegistro)\n {\n $buscar = new ParametroSolicitud($_SESSION['id']);\n\n $nivelAprobacion = $buscar->getParametroSolicitud([\"nivel_aprobacion\"]);\n\n $config = $buscar->getParametroSolicitud([\n 'id_config_solicitud',\n 'tipo_solicitud',\n 'impuesto',\n 'nivel_aprobacion'\n ]);\n $datosContribuyente = self::DatosContribuyente();\n $_SESSION['datosContribuyente']= $datosContribuyente;\n try {\n $tableName1 = 'solicitudes_contribuyente'; \n\n \n\n $arrayDatos1 = [ 'id_contribuyente' => $_SESSION['idContribuyente'],\n 'id_config_solicitud' => $_SESSION['id'],\n 'impuesto' => 2,\n 'id_impuesto' => $_SESSION['datosInmueble']['id_impuesto'],\n 'tipo_solicitud' => $config['tipo_solicitud'],\n 'usuario' => $datosContribuyente['email'],\n 'fecha_hora_creacion' => date('Y-m-d h:i:s'),\n 'nivel_aprobacion' => $nivelAprobacion[\"nivel_aprobacion\"],\n 'nro_control' => 0,\n 'firma_digital' => null,\n 'estatus' => 0,\n 'inactivo' => 0,\n ]; \n \n\n $conn = New ConexionController();\n $conexion = $conn->initConectar('db'); // instancia de la conexion (Connection)\n $conexion->open(); \n $transaccion = $conexion->beginTransaction();\n\n if ( $conn->guardarRegistro($conexion, $tableName1, $arrayDatos1) ){ \n $result = $conexion->getLastInsertID();\n \n $estado_catastro = $model->estado_catastro; \n $municipio_catastro = $model->municipio_catastro; \n $parroquia_catastro = $model->parroquia_catastro; \n $ambito_catastro = $model->ambito_catastro; \n $sector_catastro = $model->sector_catastro; \n $manzana_catastro = $model->manzana_catastro; \n $catastro1 = array(['estado' => $estado_catastro, 'municipio'=> $municipio_catastro, 'parroquia'=>$parroquia_catastro, 'ambito'=>$ambito_catastro, 'sector'=>$sector_catastro, 'manzana' =>$manzana_catastro]);\n $catastro = \"\".$catastro1[0]['estado'].\"-\".$catastro1[0]['municipio'].\"-\".$catastro1[0]['parroquia'].\"-\".$catastro1[0]['ambito'].\"-\".$catastro1[0]['sector'].\"-\".$catastro1[0]['manzana'].\"\";\n\n if($model->propiedad_horizontal == 1){\n $arrayDatos2 = [ 'id_contribuyente' => $_SESSION['idContribuyente'],\n 'id_impuesto' => $_SESSION['datosInmueble']['id_impuesto'],\n 'nro_solicitud' => $result,\n 'estado_catastro' => $model->estado_catastro,\n 'municipio_catastro' => $model->municipio_catastro,\n 'parroquia_catastro' => $model->parroquia_catastro,\n 'ambito_catastro' => $model->ambito_catastro,\n 'sector_catastro' => $model->sector_catastro,\n 'manzana_catastro' => $model->manzana_catastro,\n //catastro\n 'propiedad_horizontal' => $model->propiedad_horizontal,\n 'parcela_catastro' => $model->parcela_catastro,\n 'subparcela_catastro' => $model->subparcela_catastro,\n 'nivel_catastro' => $model->nivel_catastro,\n 'unidad_catastro' => $model->unidad_catastro,\n 'manzana_limite' => $model->manzana_catastro,\n 'catastro' => $catastro,\n 'fecha_creacion' => date('Y-m-d h:i:s'),\n ]; \n\n } else {\n $arrayDatos2 = [ 'id_contribuyente' => $_SESSION['idContribuyente'],\n 'id_impuesto' => $_SESSION['datosInmueble']['id_impuesto'],\n 'nro_solicitud' => $result,\n 'estado_catastro' => $model->estado_catastro,\n 'municipio_catastro' => $model->municipio_catastro,\n 'parroquia_catastro' => $model->parroquia_catastro,\n 'ambito_catastro' => $model->ambito_catastro,\n 'sector_catastro' => $model->sector_catastro,\n 'manzana_catastro' => $model->manzana_catastro,\n //catastro\n 'propiedad_horizontal' => $model->propiedad_horizontal,\n 'parcela_catastro' => $model->parcela_catastro,\n 'subparcela_catastro' => 0,\n 'nivel_catastro' => 0,\n 'unidad_catastro' => 0,\n 'manzana_limite' => $model->manzana_catastro,\n 'catastro' => $catastro,\n 'fecha_creacion' => date('Y-m-d h:i:s'),\n ]; \n\n }\n $tableName2 = 'sl_inmuebles'; \n\n $model->nro_solicitud = $arrayDatos2['nro_solicitud'];\n $resultProceso = self::actionEjecutaProcesoSolicitud($conn, $conexion, $model, $config); \n\n if ( $conn->guardarRegistro($conexion, $tableName2, $arrayDatos2) ){\n\n if ($nivelAprobacion['nivel_aprobacion'] != 1){\n\n $transaccion->commit(); \n $conexion->close(); \n $tipoError = 0; \n return $result; \n\n } else {\n if($model->propiedad_horizontal == 1){\n $arrayDatos3 = [ 'id_contribuyente' => $_SESSION['idContribuyente'],\n 'estado_catastro' => $model->estado_catastro,\n 'municipio_catastro' => $model->municipio_catastro,\n 'parroquia_catastro' => $model->parroquia_catastro,\n 'ambito_catastro' => $model->ambito_catastro,\n 'sector_catastro' => $model->sector_catastro,\n 'manzana_catastro' => $model->manzana_catastro,\n 'propiedad_horizontal' => $model->propiedad_horizontal,\n 'parcela_catastro' => $model->parcela_catastro,\n 'subparcela_catastro' => $model->subparcela_catastro,\n 'nivel_catastro' => $model->nivel_catastro,\n 'unidad_catastro' => $model->unidad_catastro,\n 'manzana_limite' => $model->manzana_catastro,\n //catastro\n 'catastro' => $catastro,\n \n ]; \n } else {\n $arrayDatos3 = [ 'id_contribuyente' => $_SESSION['idContribuyente'],\n 'estado_catastro' => $model->estado_catastro,\n 'municipio_catastro' => $model->municipio_catastro,\n 'parroquia_catastro' => $model->parroquia_catastro,\n 'ambito_catastro' => $model->ambito_catastro,\n 'sector_catastro' => $model->sector_catastro,\n 'manzana_catastro' => $model->manzana_catastro,\n 'propiedad_horizontal' => $model->propiedad_horizontal,\n 'parcela_catastro' => $model->parcela_catastro,\n 'subparcela_catastro' => 0,\n 'nivel_catastro' => 0,\n 'unidad_catastro' => 0,\n 'manzana_limite' => $model->manzana_catastro,\n //catastro\n 'catastro' => $catastro,\n ];\n }\n \n $tableName3 = 'inmuebles';\n $arrayCondition = ['id_impuesto'=>$_SESSION['datosInmueble']['id_impuesto']];\n\n if ( $conn->modificarRegistro($conexion, $tableName3, $arrayDatos3, $arrayCondition) ){\n\n $transaccion->commit(); \n $conexion->close(); \n $tipoError = 0; \n return $result; \n\n } else {\n \n $transaccion->rollBack(); \n $conexion->close(); \n $tipoError = 0; \n return false; \n\n }\n }\n\n\n } else {\n \n $transaccion->rollBack(); \n $conexion->close(); \n $tipoError = 0; \n return false; \n\n }\n\n }else{ \n \n return false;\n } \n \n } catch ( Exception $e ) {\n //echo $e->errorInfo[2];\n } \n \n }", "function save() {\r\n $exp_id = $_REQUEST [\"exp_id\"];\r\n $tra_id = $_REQUEST [\"tra_id\"];\r\n $cue_id = $_REQUEST [\"cue_id\"];\r\n \r\n //$ver_id = $_SESSION ['VER_ID'];\r\n //$ser_id = 0;\r\n $usu_id = 0;\r\n $trc_id = 0;\r\n $exc_id = 0;\r\n $con_id = 0;\r\n $this->expediente = new tab_expediente ();\r\n $sql = \"SELECT * \r\n FROM tab_expediente \r\n WHERE exp_estado = 1 \r\n AND exp_id='$exp_id' \";\r\n $rows = $this->expediente->dbselectBySQL($sql);\r\n\r\n if (count($rows) == 1) {\r\n $ser_id = $rows [0]->getSer_id();\r\n }\r\n\r\n//\t\t$this->expunidad = new tab_expunidad ();\r\n//\t\t$rows_euv = $this->expunidad->dbselectBySQL ( \"select * from tab_expunidad where euv_estado = 1\r\n//\t\t\t\t\t\tand exp_id='\" . $exp_id . \"' \" );\r\n//\t\tif (count ( $rows_euv ) >= 1) {\r\n//\t\t\t$euv_id = $rows_euv [0]->getEuv_id ();\r\n//\t\t\t$uni_id = $rows_euv [0]->getUni_id ();\r\n//\t\t}\r\n\r\n $expusuario = new Tab_expusuario ();\r\n $sql = \"SELECT *\r\n FROM tab_expusuario\r\n WHERE eus_estado = 1\r\n\t\tand exp_id='\" . $exp_id . \"' \";\r\n $rows_eus = $expusuario->dbselectBySQL($sql);\r\n if (count($rows_eus) >= 1) {\r\n $usu_id = $rows_eus [0]->getUsu_id();\r\n }\r\n\r\n $this->tramitecuerpos = new tab_tramitecuerpos ();\r\n $sql = \"select *\r\n from tab_tramitecuerpos\r\n where tra_id=\" . $tra_id . \"\r\n and cue_id=\" . $cue_id . \" \";\r\n $rows = $this->tramitecuerpos->dbselectBySQL($sql);\r\n if (count($rows) >= 1) {\r\n $trc_id = $rows [0]->getTrc_id();\r\n }\r\n //print \"ser_id: \".$ser_id.\"<br>\".\"euv_id: \".$euv_id.\"<br>\".\"uni_id: \".$uni_id.\"<br>usu_id: \".$usu_id.\"<br>trc_id: \".$trc_id;die();\r\n\r\n\r\n // Save Tab_archivo\r\n $fil_id = $this->saveArchivo();\r\n\r\n \r\n \r\n // Save Tab_archivo_digital\r\n ///////////////Aumentado por freddy///////////////////////////////////////////////////////////////////////////////////////////\r\n //$seccion = VAR3;\r\n $arc = new archivo ();\r\n $tarchivo = new tab_archivo ();\r\n //\r\n $archivo_digital = new tab_archivo_digital();\r\n //\r\n $tarchivo->setRequest2Object($_REQUEST);\r\n //$exp_id = $_REQUEST ['exp_id'];\r\n //$fil_id = $_REQUEST ['fil_id'];\r\n $sql = \"SELECT *\r\n FROM tab_archivo\r\n WHERE fil_id = '$fil_id' \";\r\n $rows = $tarchivo->dbselectBySQL($sql);\r\n //$tarch = $rows [0];\r\n\r\n $archivo_type = $_FILES [\"archivo\"] [\"type\"];\r\n $archivo = $_FILES [\"archivo\"] [\"tmp_name\"];\r\n $archivo_size = $_FILES [\"archivo\"] [\"size\"];\r\n $archivo_name = $_FILES [\"archivo\"] [\"name\"];\r\n $nombre = basename($_FILES[\"archivo\"][\"name\"]);\r\n $nombreFichero = $_FILES [\"archivo\"] [\"name\"];\r\n\r\n $archivo_name_array = explode(\".\", $archivo_name);\r\n $archivo_ext = array_pop($archivo_name_array);\r\n $archivo_sin_ext = implode($archivo_name_array);\r\n //$archivo_name = $arc->generarNombre($archivo_sin_ext);\r\n //$archivo_name = \"\";\r\n $archivo_cifrado = md5($archivo_name);\r\n $sis_tammax = 0;\r\n\r\n \r\n // Data Parameters\r\n $nombreDirectorio = \"\";\r\n $tsistema = new tab_sistema ();\r\n $sql = \"SELECT *\r\n FROM tab_sistema\";\r\n $rows2 = $tsistema->dbselectBySQL($sql);\r\n if (count($rows2) >= 1) {\r\n $sis_tipcarga = $rows2 [0]->sis_tipcarga;\r\n $sis_tammax = $rows2 [0]->sis_tammax;\r\n $nombreDirectorio = $rows2 [0]->sis_ruta;\r\n }\r\n\r\n\r\n // Verify size\r\n if ($archivo_size > $sis_tammax) {\r\n echo \"El tamaño del archivo supera el permitido\";\r\n } else {\r\n\r\n /* * *************************************************** */\r\n /* TYPE SAVE BD */\r\n /* * *************************************************** */\r\n $sis_tipcarga = 1;\r\n\r\n if ($sis_tipcarga == 1) {\r\n // SERVER\r\n $error = false;\r\n $copiarFichero = false;\r\n if (is_uploaded_file($_FILES['archivo']['tmp_name'])) {\r\n //$nombreDirectorio = \"img/\";\r\n $nombreFichero = $_FILES['archivo']['name'];\r\n $copiarFichero = true;\r\n $nombreCompleto = $nombreDirectorio . $nombreFichero;\r\n if (is_file($nombreCompleto)) {\r\n $idUnico = time();\r\n $nombreFichero = $idUnico . \"-\" . $nombreFichero;\r\n }\r\n } else if ($_FILES['archivo']['error'] == UPLOAD_ERR_FORM_SIZE) {\r\n $maxsize = $_REQUEST['MAX_FILE_SIZE'];\r\n $errores[\"archivo\"] = \"El tamanio del fichero supera el limite permitido ($maxsize bytes)!\";\r\n $error = true;\r\n } else if ($_FILES['archivo']['name'] == \"\")\r\n $nombreFichero = '';\r\n else {\r\n $errores[\"archivo\"] = \"No se ha podido subir el fichero!\";\r\n $msm_guardado_archivo = 0;\r\n $error = true;\r\n }\r\n if ($error == false) {\r\n $link = $archivo_digital->connect();\r\n pg_query($link, \"begin\");\r\n $sql = \"INSERT INTO tab_archivo_digital(fil_id, \r\n fil_nomoriginal, \r\n fil_nomcifrado, \r\n fil_tipo, \r\n fil_tamano, \r\n fil_extension, \r\n nombre, \r\n mime, \r\n size, \r\n archivo, \r\n fil_estado) \r\n VALUES ($fil_id, \r\n '$nombreFichero', \r\n '$archivo_cifrado', \r\n '$archivo_type',\r\n '$archivo_size' , \r\n '$archivo_ext' ,\r\n '$nombre', \r\n '$archivo_type', \r\n $archivo_size, \r\n '$nombreFichero', \r\n 1)\";\r\n pg_query($link, $sql) or die(pg_last_error($link));\r\n pg_query($link, \"commit\");\r\n if ($copiarFichero)\r\n move_uploaded_file($_FILES['archivo']['tmp_name'], $nombreDirectorio . $nombreFichero);\r\n $msm_guardado_archivo = 1; \r\n \r\n }\r\n }\r\n else {\r\n // BD\r\n $link = $archivo_digital->connect();\r\n $fp = fopen($archivo, \"rb\");\r\n $contenido = fread($fp, filesize($archivo));\r\n fclose($fp);\r\n pg_query($link, \"begin\");\r\n $oid = pg_lo_create($link);\r\n $sql = \"INSERT INTO tab_archivo_digital(fil_id, \r\n fil_nomoriginal, \r\n fil_nomcifrado, \r\n fil_tipo, \r\n fil_tamano, \r\n fil_extension, \r\n nombre, \r\n archivo_oid, \r\n mime, \r\n size, \r\n archivo) \r\n VALUES ($fil_id, \r\n '$archivo_name', \r\n '$archivo_cifrado', \r\n '$archivo_type',\r\n '$archivo_size', \r\n '$archivo_ext', \r\n '$nombre', \r\n $oid, \r\n '$archivo_type', \r\n $archivo_size, \r\n '$nombreFichero')\";\r\n pg_query($link, $sql) or die(pg_last_error($link));\r\n $blob = pg_lo_open($link, $oid, \"w\");\r\n pg_lo_write($blob, $contenido);\r\n pg_lo_close($blob);\r\n pg_query($link, \"commit\");\r\n $msm_guardado_archivo = 1; \r\n\r\n }\r\n\r\n //Guardar palabra clave\r\n if (!empty($_REQUEST['fil_descripcion'])) {\r\n $this->palclave = new tab_palclave();\r\n $pac_nombre = trim($_REQUEST['fil_descripcion']);\r\n $array = explode(SEPARATOR_SEARCH, $pac_nombre);\r\n for($j=0;$j<count($array);$j++){\r\n $sql = \"select pac_id from tab_palclave where pac_estado = 1 AND fil_id='$fil_id' AND pac_nombre='\" . $array[$j] . \"'\";\r\n $row = $this->palclave->dbSelectBySQL($sql);\r\n if (count($row) == 0) {\r\n $this->palclave->setFil_id($fil_id);\r\n $this->palclave->setPac_nombre(strtoupper(trim($array[$j])));\r\n $this->palclave->setPac_formulario('Documento');\r\n $this->palclave->setPac_estado(1);\r\n $this->palclave->insert();\r\n }\r\n } \r\n }\r\n\r\n\r\n ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\r\n if ($ser_id != 0 && $usu_id != 0 && $trc_id != 0) {\r\n\r\n if (isset($_REQUEST [\"con_id\"]) && $_REQUEST [\"con_id\"] != \"\") {\r\n $con_id = $_REQUEST [\"con_id\"];\r\n $suc_id = $_REQUEST [\"suc_id\"];\r\n $expcontenedor = new tab_expcontenedor ();\r\n $row_exc = $expcontenedor->dbselectBy3Field(\"suc_id\", $suc_id, \"exc_estado\", \"1\", \"exp_id\", $exp_id);\r\n\r\n if (count($row_exc) == 0) {\r\n $exc_id = $this->saveContenedor($exp_id, $suc_id);\r\n } else {\r\n $exc_id = $row_exc [0]->exc_id;\r\n }\r\n }\r\n \r\n \r\n $this->saveExpArchivo($fil_id, $exp_id, $tra_id, $cue_id);\r\n if ($_REQUEST ['accion'] == 'cargar') {\r\n header(\"location:\" . PATH_DOMAIN . \"/estrucDocumental/viewTree/\" . $exp_id . \"/\" . $msm_guardado_archivo . \"/$cue_id/\");\r\n } else {\r\n if ($_REQUEST ['accion'] == 'cargarnuevo') {\r\n $this->addArchivo2(\"estrucDocumental\");\r\n }else{\r\n Header(\"Location: \" . PATH_DOMAIN . \"/archivo/digitalizar/$exp_id/$fil_id/\" . VAR3 . \"/\");\r\n }\r\n }\r\n } else {\r\n header(\"location:\" . PATH_DOMAIN . \"/estrucDocumental/viewTree/\" . $exp_id . \"/\" . $msm_guardado_archivo . \"/$cue_id/\");\r\n }\r\n }\r\n \r\n \r\n \r\n }", "public function guardarRegistro2(){\r\n $this->database->execute(\"INSERT INTO empleados (nombreApellido, dni, email, pass) VALUES ('rodri', '12345678', '[email protected]', '123456'\");\r\n }", "function Inserir() {\n if($this->GetClienteCPF($this->getCli_cpf())>0):\n echo '<div class=\"alert alert-danger\" id=\"erro_mostra\">Este CPF já esta cadastrado ';\n Sistema::VoltarPagina();\n echo '</div>';\n exit();\n endif;\n \n //se for maior que zero significa que exite algum email igual----------------------\n if($this->GetClienteEmail($this->getCli_email())>0):\n echo '<div class=\"alert alert-danger\" id=\"erro_mostra\">Este Email já esta cadastrado ';\n Sistema::VoltarPagina();\n echo '</div>';\n exit();\n endif;\n //Caso passou na verificação os dados serão gravados no banco-------------------------\n $query = \"INSERT INTO \".$this->prefix.\"clientes (cli_nome,\n cli_sobrenome,\n cli_data_nasc,\n cli_rg,\n cli_cpf,\n cli_ddd,\n cli_fone,\n cli_celular,\n cli_endereco,\n cli_numero,\n cli_bairro,\n cli_cidade,\n cli_uf,\n cli_cep,\n cli_email,\n cli_data_cad,\n cli_hora_cad,\n cli_pass) VALUES (:cli_nome,\n :cli_sobrenome,\n :cli_data_nasc,\n :cli_rg,\n :cli_cpf,\n :cli_ddd,\n :cli_fone,\n :cli_celular,\n :cli_endereco,\n :cli_numero,\n :cli_bairro,\n :cli_cidade,\n :cli_uf,\n :cli_cep,\n :cli_email,\n :cli_data_cad,\n :cli_hora_cad,\n :cli_senha)\";\n \n $params = array(\n ':cli_nome'=> $this->getCli_nome(),\n ':cli_sobrenome'=> $this->getCli_sobrenome(),\n ':cli_data_nasc'=> $this->getCli_data_nasc(),\n ':cli_rg'=> $this->getCli_rg(),\n ':cli_cpf'=> $this->getCli_cpf(),\n ':cli_ddd'=> $this->getCli_ddd(),\n ':cli_fone'=> $this->getCli_fone(),\n ':cli_celular'=> $this->getCli_celular(),\n ':cli_endereco'=> $this->getCli_endereco(),\n ':cli_numero'=> $this->getCli_numero(),\n ':cli_bairro'=> $this->getCli_bairro(),\n ':cli_cidade'=> $this->getCli_cidade(),\n ':cli_uf'=> $this->getCli_uf(),\n ':cli_cep'=> $this->getCli_cep(),\n ':cli_email'=> $this->getCli_email(),\n ':cli_data_cad'=> $this->getCli_data_cad(),\n ':cli_hora_cad'=> $this->getCli_hora_cad(),\n ':cli_senha'=> $this->getCli_senha(),\n \n \n );\n //echo $query;\n $this->ExecuteSQL($query, $params);\n \n \n }", "public function inserir(){\r\n\t\tif(!$this->_validarCampos())\r\n\t\t\t// levantando a excessao CamposObrigatorios //\r\n\t\t\tthrow new CamposObrigatorios();\r\n\t\t\r\n\t\tif($this->_testarServicoExiste($this->getNome()))\r\n\t\t\t// levanto a excessao//\r\n\t\t\tthrow new Exception(\"Serviço já cadastrado en nossa base de dados\");\r\n\t\t\r\n\t\t// recuperando a instancia da classe de acesso a dados //\r\n\t\t$instancia = ServicoDAO::getInstancia();\r\n\t\t// retornando o Usuario //\r\n\t\treturn $servico = $instancia->inserir($this);\r\n\t}", "function insereCliente($nome, $senha, $email){\r\n \r\n\r\n \r\n //Abre conexao com banco de dados\r\n $conexao = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT);\r\n $sucesso = false;\r\n\r\n //remove codigo html ou javascript\r\n //$nome = $this->conexao->real_scape_string(strip_tags($nome, ENT_QUOTES));\r\n //$senha = $this->conexao->real_scape_string(strip_tags($senha, ENT_QUOTES));\r\n //$email = $this->conexao->real_scape_string(strip_tags($email, ENT_QUOTES));\r\n \r\n if (!$conexao->set_charset(\"utf8\")) {\r\n echo $conexao->error;\r\n }\r\n \r\n //Se a conexão com o banco for bem sucedida\r\n if (!$conexao->connect_errno) {\r\n\r\n $sql = \"INSERT INTO cliente \r\n (nomecliente, senhacliente, emailcliente)\r\n VALUES('\" \r\n .$nome \r\n .\"', '\" \r\n .$senha \r\n .\"', '\" \r\n .$email\r\n .\"');\";\r\n \r\n $exec = $conexao->query($sql);\r\n\r\n if($exec)\r\n $sucesso = true;\r\n \r\n mysqli_close($conexao);\r\n }\r\n else{\r\n echo \"<h4 class='error'> Erro: \"\r\n . $conexao->connect_errno\r\n .\"</h4>\";\r\n }\r\n return $sucesso;\r\n }", "public function insertViaje($puntuacion){\n\t\t$query = \"INSERT INTO aventon_calificar\n\t\t(calificacion, id_usuario, id_viaje, id_calificador, comentario)\".\n\t\t \"VALUES (\".$puntuacion->getCalificacion().\",\".$puntuacion->getIdUsuario().\",\".$puntuacion->getIdViaje().\",\".$puntuacion->getIdCalificador().\", '\".$puntuacion->getComentario().\"')\";\n\t\t$result = Db::query($query); //usar para delete insert update\n\t\t$result = Db::select(\"SELECT LAST_INSERT_ID() as id\");\n\t\treturn $result[0][\"id\"];\n\t\t\n\t}", "function registrarPedido(){\n\t\t$x = $this->pdo->prepare('INSERT INTO pedido (cedulaCliente,fechaPedido) VALUES (?,?)');\n\t\t$x->execute(array($this->cedulaCliente,$this->fechaPedido));\n\t\treturn $x;\n\t}", "function guardar_producto_proceso($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Valida el tipo de producto: 5-> Receta, 4-> Insumo preparado\n\t\t//$tipo = ($datos['tipo']==1) ? 5 : 4 ;\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tprd_productos_procesos\n\t\t\t\t\t\t(id_producto, id_proceso)\n\t\t\t\tVALUES\n\t\t\t\t\t(\".$datos['id_producto'].\",\".$datos['id_proceso'].\")\";\n\t \t//return $sql;\n\t\t$result =$this->insert_id($sql);\n\n\t\treturn $result;\n\t}", "static public function mdlGuardarIngreso($tabla, $datos){\t\n\n\t\t$dbh = Conexion::conectar();\n\n\t\t$stmt = $dbh->prepare(\"INSERT INTO $tabla(idproveedor, idusuario, tipo_comprobante, serie_comprobante, num_comprobante, fecha_hora, impuesto, total_compra, divisa) VALUES (:idproveedor, :idusuario, :tipo_comprobante, :serie_comprobante, :num_comprobante, :fecha_hora, :impuesto, :total_compra, :divisa)\");\n\n\t\t$stmt->bindParam(\":idproveedor\", $datos[\"proveedor\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":idusuario\", $datos[\"idusuario\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":fecha_hora\", $datos[\"fecha\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":tipo_comprobante\", $datos[\"tipo_comprobante\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":divisa\", $datos[\"divisa_ingreso\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":serie_comprobante\", $datos[\"serie_comprobante\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":num_comprobante\", $datos[\"numero_comprobante\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":impuesto\", $datos[\"impuesto_ingreso\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":total_compra\", $datos[\"total_compra\"], PDO::PARAM_INT);\n\n\t\t\n\n\t\t$stmt->execute();\n\t\t$id = $dbh->lastInsertId();\n\t\treturn $id;\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\t}", "public function agregarComentario($coment){\n \n $cliente=array(\n 'va_nombre_cliente'=>$coment['va_nombre'],\n 'va_email'=>$coment['va_email'], \n );\n $insert = $this->tableGateway->getSql()->insert()->into('ta_cliente')\n ->values($cliente);\n $statement = $this->tableGateway->getSql()->prepareStatementForSqlObject($insert);\n \n $statement->execute(); \n// $selectString2 = $this->tableGateway->getSql()->getSqlStringForSqlObject($insert);\n// $adapter=$this->tableGateway->getAdapter();\n// $result = $adapter->query($selectString2, $adapter::QUERY_MODE_EXECUTE);\n $idcliente=$this->tableGateway->getAdapter()->getDriver()->getLastGeneratedValue();//$this->tableGateway->getLastInsertValue();\n// var_dump($idcliente);Exit;\n\n// date_default_timezone_set('UTC');\n $comentario = array(\n 'tx_descripcion' => $coment['tx_descripcion'],\n 'Ta_plato_in_id' => $coment['Ta_plato_in_id'],\n 'Ta_cliente_in_id' => $idcliente,//$coment->Ta_cliente_in_id,\n 'Ta_puntaje_in_id' => $coment['Ta_puntaje_in_id'],\n 'Ta_plato_in_id'=>35,\n 'da_fecha'=>date('c')//date('Y-m-dTH:i:s.uZ')//'2013-12-12'\n );\n \n $id = (int) $coment['in_id'];\n if ($id == 0) { \n $insertcoment= $this->tableGateway->getSql()->insert()->into('ta_comentario')\n ->values($comentario);\n $statement2 = $this->tableGateway->getSql()->prepareStatementForSqlObject($insertcoment);\n $statement2->execute(); \n\n }\n \n }", "function RegistrarCliente($DATA){ \n try{ \n $bd = new BD;\n $conn = $bd->conectar(); \n\n if (!$conn) {\n echo 'No pudo conectarse a mysql';\n exit;\n } \n \n $sql = \"\n INSERT INTO `clientes`(\n `NOMBRE`, `APELLIDO`\n ) VALUES ( \n '\".$DATA['nombre'].\"', \n '\".$DATA['apellido'].\"' \n )\";\n \n $resultado = mysqli_query($conn, $sql); \n \n if (!$resultado) {\n echo \"Error de BD, no se pudo consultar la base de datos\\n\";\n echo \"Error MySQL: \" . mysqli_error($conn);\n echo \"<br> $sql\";\n exit;\n }\n \n return mysqli_insert_id($conn); \n } \n catch(Exception $e){ \n echo(\"Error!\");\n return \"Error en la consulta\"; \n } \n }", "public function restaurare($id_emp)\n {\n if(Session::get('sesionidu')!=\"\")\n\t\t{\n //echo \"El maestro a eliminar es $idm\";\n empleados::withTrashed()->where('id_emp',$id_emp)->restore();\n // find($idm)->delete();\n return redirect()->route('confirmacion');\n }\n else\n {\n Session::flash('error', 'El usuario esta desactivado, favor de consultar a su administrador');\n return redirect()->route('login');\n }\n }", "public function guardar($actividadId,$usuarioId,$nivelEducativoId){\n $actividadUsuario = $this->newEntity();\n $actividadUsuario->usuario_id = $usuarioId;\n $actividadUsuario->actividad_id = $actividadId;\n $actividadUsuario->niv_edu_id = $nivelEducativoId;\n $guardado = $this->connection()->transactional(\n function() use($actividadUsuario){\n if(!$this->save($actividadUsuario)){\n return false;\n }\n return true;\n }\n );\n return $guardado;\n\n }", "function consultarEmpleado(){\n\t$ced=$this->objEmpleado->getCedula();\n\t$objConexion = new ControlConexion();\n\t$objConexion->abrirBd($GLOBALS['serv'],$GLOBALS['usua'],$GLOBALS['pass'],$GLOBALS['bdat']);\n\t//$comandoSql=\"SELECT cedula, nombre_tmp, tipoCliente, fechaRegistro, imagen_tmp, email_tmp, telefono_tmp, cupoCredito, contrasena FROM CLIENTE WHERE USUARIO='\".$usu.\"' \";\n\t$comandoSql=\"SELECT * FROM EMPLEADO WHERE CEDULA='\".$ced.\"' \";\n\n\t$recordSet=$objConexion->ejecutarSelect($comandoSql);\n\n\t\t \n\t\n\twhile($registro = $recordSet->fetch_array(MYSQLI_ASSOC)){\n\t\n\t\t$this->objEmpleado->setNombre($registro[\"nombre\"]);\n\t\t$this->objEmpleado->setFechaIngreso($registro[\"fechaIngreso\"]);\n\t\t$this->objEmpleado->setFechaRetiro($registro[\"fechaRetiro\"]);\n\t\t$this->objEmpleado->setSalarioBasico($registro[\"salarioBasico\"]);\n\t\t$this->objEmpleado->setDeducciones($registro[\"deducciones\"]);\n\t\t$this->objEmpleado->setFoto($registro[\"foto\"]);\n\t\t$this->objEmpleado->setHojaVida($registro[\"hojaVida\"]);\n\t\t$this->objEmpleado->setEmail($registro[\"email\"]);\n\t\t$this->objEmpleado->setTelefono($registro[\"telefono\"]);\n\t\t$this->objEmpleado->setCelular($registro[\"celular\"]);\n\t\t$this->objEmpleado->setEstado($registro[\"estado\"]);\n\t\t$this->objEmpleado->setContrasena($registro[\"contrasena\"]);\n\t\t$this->objEmpleado->setNombreTmp($registro[\"nombre_tmp\"]);\n\t\t$this->objEmpleado->setFotoTmp($registro[\"foto_tmp\"]);\n\t\t$this->objEmpleado->setHojaVidaTmp($registro[\"hojaVida_tmp\"]);\n\t\t$this->objEmpleado->setEmailTmp($registro[\"email_tmp\"]);\n\t\t$this->objEmpleado->setTelefonoTmp($registro[\"telefono_tmp\"]);\n\t\t$this->objEmpleado->setCelularTmp($registro[\"celular_tmp\"]);\n\t\t}\t\n\t\t$objConexion->cerrarBd(); \n\t\treturn $this->objEmpleado; \t\t\n}", "public function set_reservas(objeto_reserva $reserva){\n\n\t$consulta_insertar= new conectar();\n $consulta_insertar = $consulta_insertar->conexion();\n\t$query=\t\"insert into reservas (cliente_id, habitacion_id, fecha_ingreso, fecha_salida, valor, estado, observacion) values(:cl_id, :ha_id, :fe_in, :fe_sa, :va, :es, :ob)\";\n\n\t$resultado=$consulta_insertar->prepare($query);\n $resultado->execute(array(\":cl_id\"=>$reserva->get_cliente_id(),\":ha_id\"=>$reserva->get_habitacion_id(), \":fe_in\"=>$reserva->get_fecha_ingreso(), \":fe_sa\"=>$reserva->get_fecha_salida(),\":va\"=>$reserva->get_valor(),\":es\"=>$reserva->get_estado(),\":ob\"=>$reserva->get_observacion()));\n\n\t$id = $consulta_insertar->lastInsertId();\n\n\treturn $id;\n\t}", "private function _savePreventivo($id_preventivo = null) {\n $con = DBUtils::getConnection();\n $data = date('Y-m-d');\n $id_cliente = $this->id_cliente;\n if ($this->customer)\n $email_cliente = $this->customer->email;\n else\n $email_cliente = '';\n\n $citta_partenza = $this->partenza->citta;\n $provincia_partenza = $this->partenza->provincia;\n $cap_partenza = $this->partenza->cap;\n $indirizzo_partenza = $this->partenza->indirizzo;\n $partenza_codice_citta = $this->partenza->codice_citta;\n $partenza_codice_provincia = $this->partenza->codice_provincia;\n\n\n $citta_destinazione = $this->destinazione->citta;\n $provincia_destinazione = $this->destinazione->provincia;\n $cap_destinazione = $this->destinazione->cap;\n $indirizzo_destinazone = $this->destinazione->indirizzo;\n\n $destinazione_codice_citta = $this->destinazione->codice_citta;\n $destinazione_codice_provincia = $this->destinazione->codice_provincia;\n\n $data_sopraluogo = $this->data_sopraluogo;\n $data_trasloco = $this->data_trasloco;\n $id_agenzia = $this->id_agenzia;\n $flag_sopraluogo = $this->flag_sopraluogo;\n $note = mysql_real_escape_string($this->note);\n $imponibile = $this->imponibile;\n $iva = $this->iva;\n $note_interne = mysql_real_escape_string($this->note_interne);\n\n $piano = $this->piani_da_salire;\n $montaggio = $this->montaggio ? 1: 0;\n $montaggio_locali_preggio = $this->montaggio_locali_preggio ? 1: 0;\n $peso = $this->peso;\n $pagamento_contrassegno = $this->pagamento_contrassegno ? 1: 0;\n\n $algoritmo = $this->tipo_algoritmo;\n\n $sql =\"INSERT INTO preventivi (data, id_cliente, partenza_cap, partenza_citta, partenza_provincia, partenza_indirizzo, destinazione_cap, destinazione_citta, destinazione_provincia,\ndestinazione_indirizzo, importo, stato, email_cliente, id_trasportatore, id_traslocatore_partenza, id_traslocatore_destinazione,\ndata_sopraluogo, data_trasloco, id_agenzia, flag_sopraluogo, note, id_depositario, importo_commessa_trasportatore, importo_commessa_depositario, importo_commessa_traslocatore_partenza,\nimporto_commessa_traslocatore_destinazione, imponibile, iva, partenza_codice_citta, partenza_codice_provincia,\ndestinazione_codice_provincia, destinazione_codice_citta, note_interne,\npartenza_localizzazione, partenza_localizzazione_tipo, partenza_localizzazione_tipo_piano,\ndestinazione_localizzazione, destinazione_localizzazione_tipo, destinazione_localizzazione_tipo_piano, mc, tipologia_cliente,\npiano, montaggio, montaggio_locali_preggio, pagamento_contrassegno, algoritmo,\nnote_partenza, note_destinazione)\n VALUES ('$data', '$id_cliente', '$cap_partenza',\n '$citta_partenza', '$provincia_partenza', '$indirizzo_partenza',\n '$cap_destinazione',\n '$citta_destinazione', '$provincia_destinazione', '$indirizzo_destinazone',\n '$this->importo', '$this->stato', '$email_cliente',\n '$this->id_trasportatore', '$this->id_traslocatore_partenza', '$this->id_traslocatore_destinazione',\n '$data_sopraluogo', '$data_trasloco', '$id_agenzia',\n '$flag_sopraluogo', '$note', '$this->id_depositario',\n '$this->importo_commessa_trasportatore', '$this->importo_commessa_depositario', '$this->importo_commessa_traslocatore_partenza', '$this->importo_commessa_traslocatore_destinazione',\n '$imponibile','$iva',\n '$partenza_codice_citta', '$partenza_codice_provincia',\n '$destinazione_codice_provincia', '$destinazione_codice_citta', '$note_interne',\n '$this->partenza_localizzazione', '$this->partenza_localizzazione_tipo', '$this->partenza_localizzazione_tipo_piano',\n '$this->destinazione_localizzazione', '$this->destinazione_localizzazione_tipo', '$this->destinazione_localizzazione_tipo_piano',\n '$this->mc',1,\n '$piano', '$montaggio', '$montaggio_locali_preggio', '$pagamento_contrassegno',\n '$algoritmo', '$this->note_partenza', '$this->note_destinazione'\n )\";\n\n //se il preventivo già c'è significa che lo sto salvando e quindi riuso lo stesso id\n if ($id_preventivo)\n {\n $data= $this->data_preventivo;\n $sql =\"UPDATE preventivi SET\n data='$data',\n id_cliente = '$id_cliente',\n partenza_cap = '$cap_partenza',\n partenza_citta = '$citta_partenza',\n partenza_provincia = '$provincia_partenza',\n partenza_indirizzo = '$indirizzo_partenza',\n destinazione_cap = '$cap_destinazione',\n destinazione_citta = '$citta_destinazione',\n destinazione_provincia = '$provincia_destinazione',\n destinazione_indirizzo = '$indirizzo_destinazone',\n importo = '$this->importo',\n stato = '$this->stato',\n email_cliente = '$email_cliente',\n id_trasportatore = '$this->id_trasportatore',\n id_traslocatore_partenza = '$this->id_traslocatore_partenza',\n id_traslocatore_destinazione = '$this->id_traslocatore_destinazione',\n id_depositario = '$this->id_depositario',\n flag_sopraluogo = '$this->flag_sopraluogo',\n note = '$this->note',\n data_sopraluogo = '$data_sopraluogo',\n data_trasloco = '$data_trasloco',\n importo_commessa_trasportatore = '$this->importo_commessa_trasportatore',\n importo_commessa_depositario = '$this->importo_commessa_depositario',\n importo_commessa_traslocatore_partenza = '$this->importo_commessa_traslocatore_partenza',\n importo_commessa_traslocatore_destinazione = '$this->importo_commessa_traslocatore_destinazione',\n id_agenzia = '$id_agenzia',\n imponibile = '$imponibile',\n iva = '$iva',\n partenza_codice_citta = '$partenza_codice_citta',\n partenza_codice_provincia = '$partenza_codice_provincia',\n destinazione_codice_citta = '$destinazione_codice_citta',\n destinazione_codice_provincia = '$destinazione_codice_provincia',\n note_interne = '$note_interne',\n partenza_localizzazione = '$this->partenza_localizzazione',\n partenza_localizzazione_tipo = '$this->partenza_localizzazione_tipo',\n partenza_localizzazione_tipo_piano = '$this->partenza_localizzazione_tipo_piano',\n destinazione_localizzazione = '$this->destinazione_localizzazione',\n destinazione_localizzazione_tipo = '$this->destinazione_localizzazione_tipo',\n destinazione_localizzazione_tipo_piano = '$this->destinazione_localizzazione_tipo_piano',\n mc = '$this->mc',\n tipologia_cliente='1',\n piano = $piano,\n montaggio = $montaggio,\n montaggio_locali_preggio = $montaggio_locali_preggio,\n pagamento_contrassegno = $pagamento_contrassegno,\n algoritmo = $algoritmo,\n note_partenza = '$this->note_partenza',\n note_destinazione = '$this->note_destinazione'\n\n\n WHERE id_preventivo='$id_preventivo'\n \";\n\n }\n\n //echo \"\\nSQL: \".$sql;\n $res = mysql_query($sql);\n\n if (!$res) {\n die (\"ERRORE: \".$sql);\n }\n if (!$id_preventivo)\n $id_preventivo = mysql_insert_id();\n\n $this->id_preventivo = $id_preventivo;\n return $id_preventivo;\n }", "function delete_Empleado($ife) {\n\t\t\tif ($this->dato_Delete('empleados', 'IFE', $ife)) {\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public static function register($empresa, $cnpj, $endereco, $complemento, $cidade, $uf, $telefone, $celular, $email, $senha, $subdomain) {\n //Verifica se subdomínio já existe\n if (self::checkSubdomain($subdomain)) {\n return self::retorno(false, 'Este subdomínio já esta cadastrado');\n\t}\n\t\t\n // Cadastra os dados do cliente no banco de dados\n $conn = MPDatabase::db();\n $query = $conn->prepare('insert into clientes \n (empresa, cnpj, endereco, complemento, cidade, uf, telefone, celular, email, senha, subdominio) \n values (:empresa, :cnpj, :endereco, :complemento, :cidade, :uf, :telefone, :celular, :email, :senha, :subdominio)');\n $query->bindValue(':empresa', $empresa, PDO::PARAM_STR);\n $query->bindValue(':cnpj', $cnpj, PDO::PARAM_STR);\n $query->bindValue(':endereco', $endereco, PDO::PARAM_STR);\n $query->bindValue(':complemento', $complemento, PDO::PARAM_STR);\n $query->bindValue(':cidade', $cidade, PDO::PARAM_STR);\n $query->bindValue(':uf', $uf, PDO::PARAM_STR);\n $query->bindValue(':telefone', $telefone, PDO::PARAM_STR);\n $query->bindValue(':celular', $celular, PDO::PARAM_STR);\n $query->bindValue(':email', $email, PDO::PARAM_STR);\n $query->bindValue(':senha', $senha, PDO::PARAM_STR);\n $query->bindValue(':subdominio', $subdomain, PDO::PARAM_STR);\n $success = $query->execute();\n self::$id_client = $conn->lastInsertId();\n\n if ($success) {\n return self::retorno(true, self::$id_client);\n }\n\n return self::retorno(false, 'Ocorreu um erro ao registrar seu cadastro');\n }", "function insertarSolicitudCompletaMenor()\r\n {\r\n $cone = new conexion();\r\n $link = $cone->conectarpdo();\r\n $copiado = false;\r\n try {\r\n $link->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n $link->beginTransaction();\r\n\r\n /////////////////////////\r\n // inserta cabecera de la solicitud de compra\r\n ///////////////////////\r\n\r\n //Definicion de variables para ejecucion del procedimiento\r\n $this->procedimiento = 'adq.f_solicitud_modalidades_ime';\r\n $this->transaccion = 'ADQ_SOLMODAL_INS';\r\n $this->tipo_procedimiento = 'IME';\r\n\r\n //Define los parametros para la funcion\r\n $this->setParametro('estado_reg', 'estado_reg', 'varchar');\r\n $this->setParametro('id_solicitud_ext', 'id_solicitud_ext', 'int4');\r\n $this->setParametro('presu_revertido', 'presu_revertido', 'varchar');\r\n $this->setParametro('fecha_apro', 'fecha_apro', 'date');\r\n $this->setParametro('estado', 'estado', 'varchar');\r\n $this->setParametro('id_moneda', 'id_moneda', 'int4');\r\n $this->setParametro('id_gestion', 'id_gestion', 'int4');\r\n $this->setParametro('tipo', 'tipo', 'varchar');\r\n $this->setParametro('num_tramite', 'num_tramite', 'varchar');\r\n $this->setParametro('justificacion', 'justificacion', 'text');\r\n $this->setParametro('id_depto', 'id_depto', 'int4');\r\n $this->setParametro('lugar_entrega', 'lugar_entrega', 'varchar');\r\n $this->setParametro('extendida', 'extendida', 'varchar');\r\n $this->setParametro('numero', 'numero', 'varchar');\r\n $this->setParametro('posibles_proveedores', 'posibles_proveedores', 'text');\r\n $this->setParametro('id_proceso_wf', 'id_proceso_wf', 'int4');\r\n $this->setParametro('comite_calificacion', 'comite_calificacion', 'text');\r\n $this->setParametro('id_categoria_compra', 'id_categoria_compra', 'int4');\r\n $this->setParametro('id_funcionario', 'id_funcionario', 'int4');\r\n $this->setParametro('id_estado_wf', 'id_estado_wf', 'int4');\r\n $this->setParametro('fecha_soli', 'fecha_soli', 'date');\r\n $this->setParametro('id_proceso_macro', 'id_proceso_macro', 'int4');\r\n $this->setParametro('id_proveedor', 'id_proveedor', 'int4');\r\n $this->setParametro('tipo_concepto', 'tipo_concepto', 'varchar');\r\n $this->setParametro('fecha_inicio', 'fecha_inicio', 'date');\r\n $this->setParametro('dias_plazo_entrega', 'dias_plazo_entrega', 'integer');\r\n $this->setParametro('precontrato', 'precontrato', 'varchar');\r\n $this->setParametro('correo_proveedor', 'correo_proveedor', 'varchar');\r\n\r\n $this->setParametro('nro_po', 'nro_po', 'varchar');\r\n $this->setParametro('fecha_po', 'fecha_po', 'date');\r\n\r\n $this->setParametro('prioridad', 'prioridad', 'integer');\r\n\r\n $this->setParametro('tipo_modalidad', 'tipo_modalidad', 'varchar');\r\n\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n $stmt = $link->prepare($this->consulta);\r\n $stmt->execute();\r\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n //recupera parametros devuelto depues de insertar ... (id_solicitud)\r\n $resp_procedimiento = $this->divRespuesta($result['f_intermediario_ime']);\r\n if ($resp_procedimiento['tipo_respuesta'] == 'ERROR') {\r\n throw new Exception(\"Error al ejecutar en la bd\", 3);\r\n }\r\n\r\n $respuesta = $resp_procedimiento['datos'];\r\n\r\n $id_solicitud = $respuesta['id_solicitud'];\r\n\r\n //////////////////////////////////////////////\r\n //inserta detalle de la solicitud de compra\r\n /////////////////////////////////////////////\r\n\r\n\r\n //decodifica JSON de detalles\r\n $json_detalle = $this->aParam->_json_decode($this->aParam->getParametro('json_new_records'));\r\n\r\n //var_dump($json_detalle)\t;\r\n foreach ($json_detalle as $f) {\r\n\r\n $this->resetParametros();\r\n //Definicion de variables para ejecucion del procedimiento\r\n $this->procedimiento = 'adq.f_solicitud_det_ime';\r\n $this->transaccion = 'ADQ_SOLD_INS';\r\n $this->tipo_procedimiento = 'IME';\r\n //modifica los valores de las variables que mandaremos\r\n $this->arreglo['id_centro_costo'] = $f['id_centro_costo'];\r\n $this->arreglo['descripcion'] = $f['descripcion'];\r\n $this->arreglo['precio_unitario'] = $f['precio_unitario'];\r\n $this->arreglo['id_solicitud'] = $id_solicitud;\r\n $this->arreglo['id_orden_trabajo'] = $f['id_orden_trabajo'];\r\n $this->arreglo['id_concepto_ingas'] = $f['id_concepto_ingas'];\r\n $this->arreglo['precio_total'] = $f['precio_total'];\r\n $this->arreglo['cantidad_sol'] = $f['cantidad_sol'];\r\n $this->arreglo['precio_ga'] = $f['precio_ga'];\r\n $this->arreglo['precio_sg'] = $f['precio_sg'];\r\n\r\n $this->arreglo['id_activo_fijo'] = $f['id_activo_fijo'];\r\n $this->arreglo['codigo_act'] = $f['codigo_act'];\r\n $this->arreglo['fecha_ini_act'] = $f['fecha_ini_act'];\r\n $this->arreglo['fecha_fin_act'] = $f['fecha_fin_act'];\r\n\r\n\r\n //Define los parametros para la funcion\r\n $this->setParametro('id_centro_costo', 'id_centro_costo', 'int4');\r\n $this->setParametro('descripcion', 'descripcion', 'text');\r\n $this->setParametro('precio_unitario', 'precio_unitario', 'numeric');\r\n $this->setParametro('id_solicitud', 'id_solicitud', 'int4');\r\n $this->setParametro('id_orden_trabajo', 'id_orden_trabajo', 'int4');\r\n $this->setParametro('id_concepto_ingas', 'id_concepto_ingas', 'int4');\r\n $this->setParametro('precio_total', 'precio_total', 'numeric');\r\n $this->setParametro('cantidad_sol', 'cantidad_sol', 'int4');\r\n $this->setParametro('precio_ga', 'precio_ga', 'numeric');\r\n $this->setParametro('precio_sg', 'precio_sg', 'numeric');\r\n\r\n $this->setParametro('id_activo_fijo', 'id_activo_fijo', 'varchar');\r\n $this->setParametro('codigo_act', 'codigo_act', 'varchar');\r\n $this->setParametro('fecha_ini_act', 'fecha_ini_act', 'date');\r\n $this->setParametro('fecha_fin_act', 'fecha_fin_act', 'date');\r\n\r\n\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n $stmt = $link->prepare($this->consulta);\r\n $stmt->execute();\r\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n //recupera parametros devuelto depues de insertar ... (id_solicitud)\r\n $resp_procedimiento = $this->divRespuesta($result['f_intermediario_ime']);\r\n if ($resp_procedimiento['tipo_respuesta'] == 'ERROR') {\r\n throw new Exception(\"Error al insertar detalle en la bd\", 3);\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n //si todo va bien confirmamos y regresamos el resultado\r\n $link->commit();\r\n $this->respuesta = new Mensaje();\r\n $this->respuesta->setMensaje($resp_procedimiento['tipo_respuesta'], $this->nombre_archivo, $resp_procedimiento['mensaje'], $resp_procedimiento['mensaje_tec'], 'base', $this->procedimiento, $this->transaccion, $this->tipo_procedimiento, $this->consulta);\r\n $this->respuesta->setDatos($respuesta);\r\n } catch (Exception $e) {\r\n $link->rollBack();\r\n $this->respuesta = new Mensaje();\r\n if ($e->getCode() == 3) {//es un error de un procedimiento almacenado de pxp\r\n $this->respuesta->setMensaje($resp_procedimiento['tipo_respuesta'], $this->nombre_archivo, $resp_procedimiento['mensaje'], $resp_procedimiento['mensaje_tec'], 'base', $this->procedimiento, $this->transaccion, $this->tipo_procedimiento, $this->consulta);\r\n } else if ($e->getCode() == 2) {//es un error en bd de una consulta\r\n $this->respuesta->setMensaje('ERROR', $this->nombre_archivo, $e->getMessage(), $e->getMessage(), 'modelo', '', '', '', '');\r\n } else {//es un error lanzado con throw exception\r\n throw new Exception($e->getMessage(), 2);\r\n }\r\n\r\n }\r\n\r\n return $this->respuesta;\r\n }", "public function MantenimientoReserva($idreserva,$idhotel ,$idcliente ,$bfecha ,$bguia ,$btrasporte ,$balimento ,$btipocliente ,$bfecha_inicio ,$bfecha_fin ,$btipobagon ,$bmachupicchu ,$bhorasalida ,$bhorallegada,$op,$mensaje,$consulta){\n\t if($consulta==\"I\"){\n\t\t$sql = \" INSERT INTO TRESERVA VALUES (NULL ,'\".$idhotel.\"','\".$idcliente.\"','\".$bfecha.\"','\".$bguia.\"','\".$btrasporte .\"','\".$balimento.\"','\".$btipocliente.\"','\".$bfecha_inicio.\"','\".$bfecha_fin .\"','\".$btipobagon.\"','\".$bmachupicchu .\"','\".$bhorasalida .\"','\".$bhorallegada.\"','\".$op.\"','\".$mensaje.\"' )\";\n\t }else\t \n\t if($consulta==\"A\"){\n\t\t $sql = \" UPDATE TRESERVA SET bhorasalida='\".$bhorasalida.\"',bhorallegada='\".$bhorallegada.\"',bopcional='\".$op.\"',bobservacion='\".$mensaje.\"' WHERE idreserva='\".$idreserva.\"'\";\n\t\t echo \" <script language='JavaScript'> \n alert('Sus Datos Fueron Actualizados Correctamente'); \n </script>\";\n\t\t }\n\t \n\t \n\t\t mysql_query($sql);\n\t\t}", "public function AgregarVenta($fecha,$idVentaActiva,$impuestos,$descuentos,$tipoVenta,$idCliente,$idUsuario)\r\n {\r\n\t\r\n\t\r\n\t$sql=\"INSERT INTO `$this->database`.`preventa` ( `Fecha`, `Cantidad`, `VestasActivas_idVestasActivas`, `ProductosVenta_idProductosVenta`,`Clientes_idClientes`, `Usuarios_idUsuarios`)\r\n\t\tVALUES ('$fecha', '$Cantidad', '$idVentaActiva', '$idProducto', '$idCliente', '$idUsuario');\";\r\n\t\r\n\tmysql_query($sql, $this->con) or die('no se pudo guardar el item en preventa: ' . mysql_error());\t\r\n\t\r\n\t\r\n\t}", "public function guardarUsuario()\n {\n \n //ACCESO A DATOS\n $usu = new Usuario('usuarios');\n if (isset($this->request['usuario']))\n {\n $usu->load(\"id=\".$_SESSION['id']);\n }\n\n $usu->usuario=$this->request['usuario'];\n $usu->password=$this->request['nuevapassword'];\n $usu->fechamodificacion=date('Y-m-d');\n \n \n if($usu->save()){\n $this->cerrarSesion ();\n header('Location: /appnutri/index.php');\n }else echo'<script> \n alert(\"Error. No se pudo cerrar la conexion\") \n window.location=\"/appnutri/index.php\";\n </script>';\n \n }", "function getIdCliente()\r\n\t {\r\n\t\t return $this->id_cliente;\r\n\t }", "function setEmpresa($empresa, $puesto, $depto = \"\", $idempleado = \"\", $nss = 0, $ExtTelefonica = 0 ){\n\t\t$this->mClaveEmpresa\t= $empresa;\n\t\t$this->mPuesto\t\t\t= $puesto;\n\t\t$this->mDepto\t\t\t= $depto;\n\t\t$this->mIDEmpleado\t\t= $idempleado;\n\t\t$this->mNSS\t\t\t\t= $nss;\n\t\t$this->mExtTelefonica\t= $ExtTelefonica;\n\t\t//iniciar domicilio?\n\t\t$xEmp\t\t\t\t\t= new cEmpresas($this->mCodigoPostal);\n\t\tif($xEmp->init() == true){\n\t\t\t$this->mNombreEmpresa\t= $xEmp->getNombreCorto();\n\t\t\t$this->mDomicilio\t\t= $xEmp->getDomicilio();\n\t\t\t$OPers\t\t\t\t\t= $xEmp->getOPersona();\n\t\t\tif($OPers != null){\n\t\t\t\t$xViv\t\t\t\t= $OPers->getODomicilio();\n\t\t\t\tif($xViv != null){\n\t\t\t\t\t$this->mClaveDeEstado\t\t= $xViv->getClaveDeEstado();\n\t\t\t\t\t$this->mClaveDeMunicipio\t= $xViv->getClaveDeMunicipio();\n\t\t\t\t\t$this->mClaveDeLocalidad\t= $xViv->getClaveDeLocalidad();\n\t\t\t\t\t\n\t\t\t\t\t$this->mNombreDeLocalidad\t= $xViv->getLocalidad();\n\t\t\t\t\t$this->mNombreDeMunicipio\t= $xViv->getMunicipio();\n\t\t\t\t\t$this->mNombreDeEstado\t\t= $xViv->getEstado();\n\t\t\t\t\t$this->mCodigoPostal\t\t= $xViv->getCodigoPostal();\n\t\t\t\t\t$this->mIDDomicilio\t\t\t= $xViv->getClaveUnica();\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static function generarRepresentanteLegal(Empresa $empresa,$nombres,$apellidop,$apellidom,$tipodocumento,$documento,$direccion,$numerocontacto2,$idpais,$genero,$email,$id_persona,$cargo,$expedido)\n {\n $logs = new Logs();\n $sqlLogs = new SQLLogs();\n \n $persona = new Persona();\n $sqlPersona = new SQLPersona();\n $hoy = date(\"Y-m-d h:m:s\");\n $usuario = new Usuario();\n $sqlUsuario = new SQLUsuario();\n \n if($id_persona=='0')\n {\n //es nuevo\n $persona->setNombres(mb_strtoupper($nombres));\n $persona->setPaterno(mb_strtoupper($apellidop));\n $persona->setMaterno(mb_strtoupper($apellidom));\n $persona->setId_tipo_documento($tipodocumento);\n $persona->setNumero_documento($documento);//este es el documento\n $persona->setDireccion($direccion);\n // if($numerocontacto!=''){$persona->setNumero_contacto($numerocontacto);}\n // if($numerocontacto2!=''){$persona->setNumero_contacto2($numerocontacto2);}\n $persona->setExpedido($expedido);\n $persona->setEmail($email);\n $persona->setId_pais_origen($idpais);\n $persona->setFecha_creacion($hoy);\n $persona->setEstado(1);//para el estado activo\n $persona->setId_usuario_creacion($_SESSION['id_usuario']);\n if($genero==1) $persona->setGenero(true);\n else $persona->setGenero(false);\n try{\n $sqlPersona->setGuardarPersona($persona);\n } catch (Exception $ex) {\n $logs->setDescripcion('ERROR: generarRepresentanteLegal: creacion de la PERSONA');\n $logs->setId_servicio(0);\n $logs->setMensaje($ex->getMessage());\n $logs->setObjeto(print_r($persona,true));\n $logs->setDate(Date('Y-m-d H:i:s'));\n $sqlLogs->Save($logs);\n return null;\n }\n \n \n //esto es para crear el nombre del usuario\n $campousuario=trim($persona->getNombres());\n $campousuario=$campousuario[0].$persona->getNumero_documento();\n //-guardamos el usuario\n \n $usuario->setUsuario($campousuario);\n $usuario->setClave(substr(str_shuffle(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"), 0, 8));\n //$usuario->setClave('123456');\n $usuario->setFecha_creacion($hoy);\n $usuario->setId_persona($persona->getId_persona());\n $usuario->setActivo(1);\n $usuario->setId_tipo_usuario(2);\n try{\n $sqlUsuario->setGuardarUsuario($usuario);\n } catch (Exception $ex) {\n $logs->setDescripcion('ERROR: generarRepresentanteLegal: creacion del USUARIO');\n $logs->setId_servicio(0);\n $logs->setMensaje($ex->getMessage());\n $logs->setObjeto(print_r($usuario,true));\n $logs->setDate(Date('Y-m-d H:i:s'));\n $sqlLogs->Save($logs);\n $sqlPersona->delete($persona);\n return null;\n }\n }\n else\n {\n //es antiguo\n $persona->setId_persona($id_persona);\n $persona = $sqlPersona->getDatosPersonaPorId($persona);\n $usuario->setId_persona($id_persona);\n $usuario=$sqlUsuario->getDatosUsuarioPorIdPersona($usuario);\n }\n \n $perfil = new Perfil();\n $sqlPerfil = new SQLPerfil();\n $perfil->setId_perfil(3);//es pa el RL\n $perfil=$sqlPerfil->getBuscarDescripcionPorId($perfil);\n $perfil->getOpciones();\n\n $empresa_persona = new EmpresaPersona();\n $sqlEmpresaPersona = new SQLEmpresaPersona();\n $empresa_persona->setId_Persona($persona->getId_persona());\n $empresa_persona->setId_Empresa($empresa->getId_empresa());\n $empresa_persona->setId_Perfil(3);\n $empresa_persona->setFecha_Vinculacion($hoy);\n $empresa_persona->setOpciones_persona($perfil->getOpciones());\n $empresa_persona->setActivo(1);\n $empresa_persona->setCargo($cargo);\n try{\n $sqlEmpresaPersona->setGuardarEmpresaPersona($empresa_persona);\n return $persona->getId_persona().','.$usuario->getClave().','.$campousuario.','.$persona->getEmail();\n } catch (Exception $ex) {\n $logs->setDescripcion('ERROR: generarRepresentanteLegal: registo EMPRESA - PERSONA');\n $logs->setId_servicio(0);\n $logs->setMensaje($ex->getMessage());\n $logs->setObjeto(print_r($empresa_persona,true));\n $logs->setDate(Date('Y-m-d H:i:s'));\n $sqlLogs->Save($logs);\n $sqlPersona->delete($persona);\n $sqlUsuario->delete($usuario);\n }\n return null;\n /*if($sqlEmpresaPersona->setGuardarEmpresaPersona($empresa_persona)){\n return $persona->getId_persona().','.$usuario->getClave().','.$campousuario.','.$persona->getEmail();\n }else return null;*/\n }", "public function registrar_objeto_controlador(){\n\t\t\t$Nombre=mainModelo::limpiar_cadena($_POST['objeto-txt']);\n\t\t\t$Marca=mainModelo::limpiar_cadena($_POST['marcaobjeto-txt']);\n\t\t\t$Modelo=mainModelo::limpiar_cadena($_POST['modeloobjeto-txt']);\n\t\t\t$Cantidad=mainModelo::limpiar_cadena($_POST['cantidadobjeto-txt']);\n\t\t\t$Tipo=mainModelo::limpiar_cadena($_POST['tipoobjeto-txt']);\n\t\t\t$Propietario=mainModelo::limpiar_cadena($_POST['docpropietario-txt']); \n\t\t\t$codigo= objetoModelo::codigo_auto();\n\t\t\t$codigo= ($codigo->rowCount()+1);\n\t\t\t\n\t\t\t$dataobjeto=[\n\t\t \"Codigo\"=>$codigo,\n\t\t\t\t\"Nombre\"=>$Nombre,\n\t\t\t\t\"Marca\"=>$Marca,\n\t\t\t\t\"Modelo\"=>$Modelo,\n\t\t\t\t\"Cantidad\"=>$Cantidad,\n\t\t\t\t\"Tipo\"=>$Tipo,\n\t\t\t\t\"Estado\"=>'A',\n\t\t\t\t\"Propietario\"=>$Propietario\n\t\t\t];\n\t\t\t\n\t\t\t$guardarObjeto=ObjetoModelo::registrar_objeto_modelo($dataobjeto);\n\n\t\t\tif ($guardarObjeto->rowCount()==1) {\n\t\t\t\t$alerta=[\n\t\t\t\t\t\"Alerta\"=>\"limpiar\",\n\t\t\t\t\t\"Titulo\"=>\"Objeto registrado\",\n\t\t\t\t\t\"Texto\"=>\"Registro exitoso!\",\n\t\t\t\t\t\"Tipo\"=>\"success\"\n\t\t\t ];\n\t\t }else{\n\t\t\t\t\n\t\t\t\t$alerta=[\n\t\t\t\t\t\"Alerta\"=>\"simple\",\n\t\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\n\t\t\t\t\t\"Texto\"=>\"No se ha podido registrar el objeto!\",\n\t\t\t\t\t\"Tipo\"=>\"error\"\n\t\t\t\t];\n\t\t }\n\t\t\treturn mainModelo::sweet_alert($alerta);\n\t\t}", "public function store(empleadosRequest $request)\n {\n if(isset($request->id)){\n $empleado = Empleados::find($request->id);\n $empleado->codigo = $request->codigo;\n $empleado->nombre = $request->nombre;\n $empleado->salario_dolar = $request->salario_dolar;\n $empleado->salario_pesos = $request->salario_pesos;\n $empleado->direccion = $request->direccion;\n $empleado->direccion = $request->direccion;\n $empleado->ciudad = $request->ciudad;\n $empleado->ciudad = $request->ciudad;\n $empleado->telefono = $request->telefono;\n $empleado->telefono = $request->telefono;\n $empleado->correo = $request->correo;\n $empleado->save();\n }else{\n $empleado = new Empleados();\n $empleado->codigo = $request->codigo;\n $empleado->nombre = $request->nombre;\n $empleado->salario_dolar = $request->salario_dolar;\n $empleado->salario_pesos = $request->salario_pesos;\n $empleado->direccion = $request->direccion;\n $empleado->direccion = $request->direccion;\n $empleado->ciudad = $request->ciudad;\n $empleado->ciudad = $request->ciudad;\n $empleado->telefono = $request->telefono;\n $empleado->telefono = $request->telefono;\n $empleado->correo = $request->correo;\n $empleado->save();\n }\n }", "function guardar($arg) {\n\t\tSessionHandler()->check_session();\n\t\tdate_default_timezone_set('America/Argentina/La_Rioja');\n\n\t\t$ids = explode('@', $arg);\n\t\t$mesa = $ids[0];\n\t\t$bebida = $ids[1];\n\t\t$cantidad = $ids[2];\n\t\t$pedidoId = $ids[3];\n\n\t\t//COMPROBAR STOCK DE BEBIDA.\n\t\t\n\t\tif ($pedidoId != null || $pedidoId != 0 || $pedidoId != \"\") {\n\t\t\t$bp = new BebidaPedido();\n\t\t\t$bp->pedido = $pedidoId;\n\t\t\t$bp->bebida = $bebida;\n\t\t\t$bp->cantidad = $cantidad;\n\t\t\t$bp->save();\n\n\t\t\t$md = new Mesa();\n\t\t\t$md->mesa_id = $mesa;\n\t\t\t$md->get();\n\t\t\t$md->disponible = 2;\n\t\t\t$md->save();\n\t\t\tprint($pedidoId);exit;\n\t\t}\n\n\t\t$this->model->fecha = date('Y-m-d');\t\t\n\t\t$this->model->mesa = $mesa;\t\t\n\t\t$this->model->estado = 1;\t\t\n\t\t$this->model->save();\n\t\t\n\t\t$md = new Mesa();\n\t\t$md->mesa_id = $mesa;\n\t\t$md->get();\n\t\t$md->disponible = 2;\n\t\t$md->save();\n\t\t\n\t\t$pedido_id = $this->model->pedido_id;\n\t\t\n\t\t$bp = new BebidaPedido();\n\t\t$bp->pedido = $pedido_id;\n\t\t$bp->bebida = $bebida;\n\t\t$bp->cantidad = $cantidad;\n\t\t$bp->save();\n\t\tprint($pedido_id);exit;\n\n\t}", "public function set_clientes(objeto_cliente $cliente){\n\t$consulta_insertar = new Conectar();\n\t$consulta_insertar = $consulta_insertar->conexion();\n\t$query=\"insert into clientes (cliente_id, nombre, celular, pais, correo) values (:cl_id, :nom, :cel, :pais, :corr)\";\n\n\t$resultado=$consulta_insertar->prepare($query);\n\n\t$resultado->execute(array(\":cl_id\"=>$cliente->get_cliente_id(),\":nom\"=>$cliente->get_nombre(),\":cel\"=>$cliente->get_celular(),\":pais\"=>$cliente->get_pais(),\":corr\"=>$cliente->get_correo()));\n\n\n\t}", "public function agregar_Cliente($datosCliente){\n\n $stmt=$this->db->prepare(\"CALL INSERT_CLIENTE(:nombre,:ciudad,:responsable)\");\n $stmt->bindParam(':nombre', $nombre);\n $stmt->bindParam(':ciudad', $ciudad);\n $stmt->bindParam(':responsable', $responsable);\n\n $nombre=$datosCliente['nombre'];\n $ciudad=$datosCliente['ciudad'];\n $responsable=$datosCliente['responsable'];\n $tel1=$datosCliente['tel1'];\n $tel2=$datosCliente['tel2'];\n $correo1=$datosCliente['correo1'];\n $correo2=$datosCliente['correo2'];\n\n $stmt->execute();\n\n //Obtener el ultimo codigo de cliente\n $cods=new Tablas_model();\n $codigos=$cods->getCodigosClientes(); //array de arrays\n $codigosCliente=array();\n foreach ($codigos as $arrayCod) {\n array_push($codigosCliente,($arrayCod[0]+0));\n }\n $ultimoCod=max($codigosCliente);// ultimo codigo de cliente ingresado\n\n\n //obtener el ultimo codigo de cliente ingresado\n\n //ingresar uno o 2 teléfonos:\n $this->db->query(\"DELETE FROM tel_clientes WHERE tel_clientes.cod_cliente =\".$ultimoCod); //eliminar registros\n if ($datosCliente['tel2']==\"\") {\n $this->db->query('INSERT INTO tel_clientes (tel_clientes.cod_cliente, tel_clientes.tel)\n VALUES ('.$ultimoCod.','.$tel1.')');\n }else{\n $this->db->query('INSERT INTO tel_clientes (tel_clientes.cod_cliente, tel_clientes.tel)\n VALUES ('.$ultimoCod.', '.$tel1.'); INSERT INTO tel_clientes (tel_clientes.cod_cliente, tel_clientes.tel)\n VALUES ('.$ultimoCod.', '.$tel2.')');\n }\n\n //ingresar uno o dos correos:\n $this->db->query(\"DELETE FROM correos_clientes WHERE correos_clientes.cod_cliente =\".$ultimoCod); //eliminar registros\n if ($datosCliente['correo2']==\"\") {\n $this->db->query('INSERT INTO correos_clientes (correos_clientes.cod_cliente, correos_clientes.correo)\n VALUES ('.$ultimoCod.',\"'.$correo1.'\")');\n }else{\n $this->db->query('INSERT INTO correos_clientes (correos_clientes.cod_cliente, correos_clientes.correo)\n VALUES ('.$ultimoCod.', \"'.$correo1.'\"); INSERT INTO correos_clientes (correos_clientes.cod_cliente, correos_clientes.correo)\n VALUES ('.$ultimoCod.', \"'.$correo2.'\")');\n }\n\n $this->db=null; //cerrar conexión\n\n\n }", "public function setEduardoCreate($datos)\n {\n $this->fijarValores($datos);\n $this->guardar();\n $val = $this->lastId();\n return $val;\n }", "public function eliminar_empresa_controlador(){\n\n\t\t$codigo=mainModel::decryption($_POST['codigo-del']);\n\t\t$Privilegio=mainModel::decryption($_POST['privilegio-admin']);\n\n\t\t$codigo=mainModel::limpiar_cadena($codigo);\n\t\t$Privilegio=mainModel::limpiar_cadena($Privilegio);\n\n\t\tif($Privilegio==1){\n\n\t\t\t$consulta1=mainModel::ejecutar_consulta_simple(\"SELECT EmpresaCodigo FROM libro WHERE EmpresaCodigo='$codigo'\");\n\n\t\t\t\n\t\t\tif($consulta1->rowCount()<=0){\n\t\t\t\t$ElimEmp=empresaModelo::eliminar_empresa_modelo($codigo);\n\t\t\t\t\n\t\t\t\tif($ElimEmp->rowCount()==1){\n\t\t\t\t\t$alerta=[\n\t\t\t\t\t\t\t\"Alertas\"=>\"recargar\",\n\t\t\t\t\t\t\t\"Titulo\"=>\"Empresa Eliminada\",\n\t\t\t\t\t\t\t\"Texto\"=>\"Se elimino la empresa de manera satisfactoria\",\n\t\t\t\t\t\t\t\"Tipo\"=>\"success\"\n\t\t\t\t\t\t];\t\n\t\t\t\t}else{\n\t\t\t\t\t$alerta=[\n\t\t\t\t\t\"Alertas\"=>\"simple\",\n\t\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\n\t\t\t\t\t\"Texto\"=>\"Lo sentimos no se puede eliminar la empresa, \",\n\t\t\t\t\t\"Tipo\"=>\"error\"\n\t\t\t\t\t];\n\t\t\t\t}\t\n\t\t\t}else{\n\t\t\t\t$alerta=[\n\t\t\t\t\"Alertas\"=>\"simple\",\n\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\n\t\t\t\t\"Texto\"=>\"No se puede eliminar la empresa, teniendo en cuenta que hay libros asociados a esta empresa\",\n\t\t\t\t\"Tipo\"=>\"error\"\n\t\t\t];\n\t\t\t}\n\t\t}else{\n\t\t\t\t$alerta=[\n\t\t\t\t\"Alertas\"=>\"simple\",\n\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\n\t\t\t\t\"Texto\"=>\"No se puede eliminar la empresa.\",\n\t\t\t\t\"Tipo\"=>\"error\"\n\t\t\t];\n\t\t}\n\t\treturn mainModel::sweet_alert($alerta);\n\t\t\n\t}", "public function AgregaPreventa($fecha,$Cantidad,$idVentaActiva,$idProducto,$idCliente,$idUsuario)\r\n {\r\n\t\r\n\t\r\n\t$reg=mysql_query(\"select * from productosventa where idProductosVenta = '$idProducto'\", $this->con) or die('no se pudo consultar los valores de productosventa en AgregaPreventa: ' . mysql_error());\r\n\t$reg=mysql_fetch_array($reg);\r\n\t$ValorUnitario=$reg[\"PrecioVenta\"];\r\n\t$Subtotal=$ValorUnitario*$Cantidad;\r\n\t$impuesto=$reg[\"IVA\"];\r\n\t$impuesto=$Subtotal*$impuesto;\r\n\t//$Subtotal=$Subtotal-$impuesto;\r\n\t$Total=$Subtotal+$impuesto;\r\n\t\r\n\t$sql=\"INSERT INTO `$this->database`.`preventa` ( `Fecha`, `Cantidad`, `VestasActivas_idVestasActivas`, `ProductosVenta_idProductosVenta`,`Clientes_idClientes`, `Usuarios_idUsuarios`, `ValorUnitario`,`ValorAcordado`, `Subtotal`, `Impuestos`, `TotalVenta`)\r\n\t\tVALUES ('$fecha', '$Cantidad', '$idVentaActiva', '$idProducto', '$idCliente', '$idUsuario', '$ValorUnitario','$ValorUnitario', '$Subtotal', '$impuesto', '$Total');\";\r\n\t\r\n\tmysql_query($sql, $this->con) or die('no se pudo guardar el item en preventa: ' . mysql_error());\t\r\n\t\r\n\t\r\n\t}", "public function Registrar_Ref_Personal(HojaVida $data){\n $modelo = new HojaVida();\n $fechahora = $modelo->get_fecha_actual();\n $datosfecha = explode(\" \",$fechahora);\n $fechalog = $datosfecha[0];\n $horalog = $datosfecha[1];\n \n $tiporegistro = \"Referencia Personal\";\n $accion = \"Registra una Nueva \".$tiporegistro.\" En el Sistema (Hoja vida) TALENTO HUMANO\";\n $detalle = $_SESSION['nombre'].\" \".$accion.\" \".$fechalog.\" \".\"a las: \".$horalog;\n $tipolog = 15;\n $idusuario = $_SESSION['idUsuario'];\n \n try {\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\t\t\n //EMPIEZA LA TRANSACCION\n $this->pdo->beginTransaction();\n\n $sql = \"INSERT INTO `th_referencias_personales`(`ref_id_hv`, `ref_id_usuario`, `ref_id_usuarioR`, `ref_nombre`, `ref_cargo`, `ref_empresa`, `ref_telefono`) \n VALUES (?,?,?,?,?,?,?)\";\n $this->pdo->prepare($sql)\n ->execute(\n array(\n $data->id,\n $data->usuario,\n $idusuario,\n $data->ref_per_nombre,\n $data->ref_per_cargo,\n $data->ref_per_empresa,\n $data->ref_per_telefono\n )\n ); \n $this->pdo->exec(\"INSERT INTO log (fecha, accion,detalle,idusuario,idtipolog) VALUES ('$fechalog', '$accion','$detalle','$idusuario','$tipolog')\");\n \n //SE TERMINA LA TRANSACCION \n $this->pdo->commit();\n } catch (Exception $e) {\n $this->pdo->rollBack();\n die($e->getMessage());\n }\n }", "public static function guardar(){\n // Almacena la cita y devuelve el id\n $cita = new Cita($_POST);\n $resultado = $cita->guardar();\n\n $id = $resultado['id'];// Id de la cita creada\n\n // Almacena la cita y el servicio\n $idServicios = explode(\",\", $_POST['servicios']);\n // Iteramos egun el numero de servicios elegidos y le ponemos la misma citaId\n foreach($idServicios as $idServicio){\n $args = [\n 'citaId' => $id,\n 'servicioId' => $idServicio\n ];\n $citaServicio = new CitaServicio($args); // Creamos el objeto para tabla 'citasservicios'(Pivote)\n $citaServicio->guardar(); // Guardamos en tabla 'citasservicios'\n }\n echo json_encode(['resultado' => $resultado]);\n }" ]
[ "0.7614188", "0.67663884", "0.6710776", "0.66748893", "0.65489644", "0.65332836", "0.65332836", "0.652973", "0.64936984", "0.6422517", "0.6381397", "0.63496107", "0.63442326", "0.6291047", "0.6264177", "0.6259227", "0.62446684", "0.6209219", "0.6169536", "0.61444026", "0.6115375", "0.61045355", "0.6098468", "0.60959375", "0.608893", "0.6072664", "0.6066378", "0.6063142", "0.6061723", "0.60563856", "0.6051056", "0.6046274", "0.6038237", "0.601743", "0.5996475", "0.5986625", "0.59861195", "0.5984902", "0.59728754", "0.59655327", "0.594406", "0.59398574", "0.5936129", "0.5935181", "0.5932235", "0.5923374", "0.5911241", "0.5909245", "0.58989865", "0.58955353", "0.5893054", "0.58816123", "0.5873516", "0.5867534", "0.5864782", "0.5863509", "0.58587986", "0.58584976", "0.58536035", "0.58499676", "0.58494174", "0.58466023", "0.583231", "0.58322096", "0.58309245", "0.58230025", "0.5818364", "0.58157474", "0.5815691", "0.5814672", "0.5806262", "0.57926804", "0.5789417", "0.5788218", "0.57773036", "0.5760675", "0.575936", "0.5743284", "0.57389414", "0.5738479", "0.5738137", "0.5734096", "0.5731604", "0.57314515", "0.57255083", "0.5724276", "0.5718757", "0.57111657", "0.5702966", "0.5702075", "0.5691079", "0.568419", "0.5681636", "0.56754804", "0.56753904", "0.5674801", "0.56742364", "0.5670303", "0.56701064", "0.5666534", "0.5664652" ]
0.0
-1
comprovar si existe nobre de usuario para registro cliente
function check_User($user_id) { if ($this->Logeo_model->check_User($user_id)) { $this->form_validation->set_message('check_User', "$user_id no Disponible"); return FALSE; } else { return TRUE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function existe_usuario()\n\t{\n\t\t$data = $this->request->getRawInput();\n\t\t$ruc = $data['nick']; \n\t\t$usu = new Admin_model();\n\t\t$usuarioObject = $usu->where(\"nick\", $ruc) \n\t\t->first();\n\t\treturn !is_null($usuarioObject);\n\t\t \n\t}", "function Boolean_Existencia_Usuario($username,$email)\n{\n\t$query = consultar(sprintf(\"SELECT email_usuario,usuario FROM tb_usuarios WHERE email_usuario='%s' or usuario='%s'\",escape($username),escape($email)));\n\tif(Int_consultaVacia($query)>0)\n\t{\n\t\treturn array(false,'El usuario o el email ya existen, intenta nuevamente.');\n\t}else\n\t{\n\t\treturn array(true,'');\t\n\t}\n\n}", "function usuario_existe($usuario){\n\t$sql = \"SELECT id FROM usuarios WHERE usuario = '$usuario'\";\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}", "public function existe_usuario($user){ \n \n $query = \"SELECT email, password, idneo4j FROM usuario WHERE email = '\".$user.\"';\";\n $mysql = new Conexion();\n $resultado = $mysql->get_resultados_query($query);\n \n //print_r($resultado);\n \n if(!empty($resultado))\n return $resultado;\n \n return false;\n \n }", "private function existeUsuario()\n {\n $con = Conexion::getInstance();\n $sql = \"SELECT user \n FROM usuarios\n WHERE user = '{$this->usuario}' AND estado = 1 AND idUsuario != {$this->Id}\";\n\n $result = mysqli_query($con, $sql);\n\n if($result->num_rows >= 1 && $result != false)\n {\n return false;\n }\n\n return true;\n }", "private function existeusuario2($usuario)\n {\n $stmt = $this->con->prepare(\"SELECT id_conductor FROM `descuento` WHERE id_conductor = ?\");\n $stmt->bind_param(\"s\", $usuario);\n $stmt->execute(); \n $stmt->store_result();\n return $stmt->num_rows > 0;\n }", "function mcomprobarUsuarioSesion() {\n\t\t$conexion = conexionbasedatos();\n\t\tif (isset($_SESSION[\"nickname\"]) ) {\n\t\t\t$nickname = $_SESSION[\"nickname\"];\n\n\t\t\t$consulta = \"select * \n\t\t\t\t\t\t from final_USUARIO\n\t\t\t\t\t\t where nickname = '$nickname';\";\n\n\t\t\tif ($resultado = $conexion->query($consulta)) {\n\t\t\t\tif ($datos = $resultado->fetch_assoc()) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else {\n\t\t\t\t\treturn -2;\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t} else {\n\t\t\treturn -2;\n\t\t}\n\t\t\n\t}", "public function usuarioExiste($usuario)\n {\n $bd = new Bd();\n\n $usser = \"SELECT * FROM usuarios WHERE mail='\" . $this->mail . \"'\" . \" AND clave='\" . $this->clave . \"'\";\n $resultado = $bd->consulta($usser);\n\n\n if ($bd->numeroElementos() == 1) {\n session_start();\n $_SESSION['mail'] = $this->mail;\n $_SESSION['clave'] = $this->clave;\n\n header('location: inici.php');\n } else {\n\n header(\"location: registro.php\");\n }\n }", "private function existeusuario($usuario)\n {\n $stmt = $this->con->prepare(\"SELECT id_conductor FROM `carga` WHERE id_conductor = ?\");\n $stmt->bind_param(\"s\", $usuario);\n $stmt->execute(); \n $stmt->store_result();\n\n return $stmt->num_rows > 0;\n }", "function inativaUsuario($id){\n\t\t\ttry{\n\t\t\t\t$conn = Banco::ConectaBanco();\n\t\t\t\t$statm = $conn->prepare(\n\t\t\t\t\"UPDATE Usuario\n\t\t\t\t\tSET usuario_ativo = FALSE\n\t\t\t\t\tWHERE usuario_id = :id AND usuario_ativo = TRUE\n\t\t\t\t\");\n\t\t\t\t$statm->bindValue(\":id\", $id);\n\t\t\t\t$conn = NULL;\n\t\t\t\treturn $statm->execute();\n\t\t\t}catch(Exception $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t}", "public static function HayAdministradores(){\n $usuario = new Usuario();\n $result = (new Usuario())->FindBy([\"tipo = '\".USUARIO::TIPO_ADMINISTRADOR.\"'\"]);\n return (count($result) > 0);\n }", "public function v_nuevo(){\n\t\tif($this -> e_user === '' && $this -> e_pass === '' && $this -> e_email === ''){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function aggiungiCliente($username, $password, $nome){\n$query = mysql_query(\"SELECT * FROM utente WHERE username = '\".$username.\"' \");\n\n\n//se non esiste lo aggiungo\nif(mysql_num_rows($query)==0){\n$ins = mysql_query(\"INSERT INTO utente (username,password,nome) values('\".$username.\"', '\".$password.\"', '\".$nome.\"' )\") ;\n\nif($ins){\nreturn true;\n}\n\nelse {\nreturn false;//username non esiste ma l'inserimento non è andato a buon fine\n}\n}\nelse{\nreturn false; //username esiste\n}\n\n\n}", "public function getNoUsuario()\n\t{\n\t\treturn $this->no_usuario;\n\t}", "function crearUsuario($usuario,$clave){\n\tif(!existeUsuario($usuario)){\n\t\tsetKValue(BUCKET_USUARIOS,$usuario,$clave);\n\t\treturn existeUsuario($usuario);\n\t}\n\treturn false;\n}", "function verificalogin(){\n if(!isset($this->session->datosusu)){\n return true;\n }\n }", "public function validado($usuario){\r\n\t\t$consulta=$this->db->query(\"SELECT * FROM Usuarios WHERE usuario LIKE '$usuario'\");\r\n\t\tforeach ($consulta->result() as $row)\r\n\t\t\t{\r\n\t\t\t\t$id=$row->ID;\r\n\t\t\t}\r\n\t\t$consulta=$this->db->query(\"SELECT ID FROM Cliente WHERE alta LIKE '1' AND ID LIKE '$id'\");\r\n\t\t if($consulta->num_rows()!=0){\r\n\t\t\t return true;\r\n\t\t }else{\r\n\t\t\t return false;\r\n\t\t }\r\n\t}", "function exiteUsuario($usuario) {\n $usuarioSaneado = trim(filter_var($usuario, FILTER_SANITIZE_STRING));\n\n $link = crearConexion();\n $query = \"SELECT `username` FROM `usuario` WHERE `username`='$usuarioSaneado'\";\n $result = mysqli_query($link, $query);\n cerrarConexion($link);\n return mysqli_num_rows($result) > 0;\n}", "function existeUsuario($usuario){\n\tif (hasKey(BUCKET_USUARIOS,$usuario))\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "public function agregarUsuario(){\n \n }", "public function SesionIniciada()\n{\n \n $ConexionCassandra=new ManejadorCassandra();//Conexion con la base de datos \n $ObtenerIp=$ConexionCassandra->ConsultaPorParametro('sesion',array('ip'=>$this->ObtenerIp())); //Busco en la tabla sesion si se encuentra la ip\n $VerificarIp=$ObtenerIp->getAll();\n \n if($VerificarIp!=NULL){\n \n return true; //Retorna true si se encontra el usuario\n }\n else{\n \n return false; //Retorna false si no se encuentra el usuario\n }\n \n }", "public function userExists($codigo, $clave, $tipo_usuario)\n\t{\n\t\t$db = Db::getConnect();\n\t\t$md5Clave = md5($clave);\n\t\t$query = $db->prepare('SELECT * FROM usuarios \n\t\t\t\t\t\t\t\t\t\t\t WHERE codigo = :codigo AND clave = :clave\n\t\t\t\t\t\t\t\t\t\t\t\t AND tipo = :tipo');\n\t\t$query->execute([\n\t\t\t'codigo' => $codigo,\n\t\t\t'clave' => $md5Clave,\n\t\t\t'tipo' => $tipo_usuario\n\t\t]);\n\n\t\t// ME TRAE EL NUMERO DE FILAS ENCONTRADAS\n\t\tif ($query->rowCount()) {\n\n\t\t\tforeach ($query as $currentUser) {\n\t\t\t\t$this->id = $currentUser['id'];\n\t\t\t\t$this->tipo = $currentUser['tipo'];\n\t\t\t\t$this->nombre = $currentUser['nombre'];\n\t\t\t\t$this->apellido = $currentUser['apellido'];\n\t\t\t\t$this->cedula = $currentUser['cedula'];\n\t\t\t\t$this->foto = $currentUser['foto'];\n\t\t\t\t$this->direccion = $currentUser['direccion'];\n\t\t\t\t$this->telefono = $currentUser['telefono'];\n\t\t\t\t$this->estudios = $currentUser['estudios'];\n\t\t\t\t$this->anopromo = $currentUser['anopromo'];\n\t\t\t\t$this->codigo = $currentUser['codigo'];\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function recuperarUsuario()\n {\n $_codigo=$this->codigo ; \n $this->dataBaseAccess(); \n $mySelect = 'select Codigo_empresa,Nome,Senha where Codigo = ' . $this->Codigo ;\n $ret = mysqli_query($this->myCon , $mySelect) ;\n $numRows= mysqli_num_rows($ret); \n if($numRows>0)\n {\n $reg = mysqli_fetch_array($ret) ;\n $this->Codigo_empresa=$reg['Codigo_empresa'] ;\n $this->Nome=$reg['Nome'] ;\n $this->Senha=$reg['Senha'] ;\n mysqli_close( $this->myCon );\n $this->records_found=$numRows ;\n return true ; // ja cadastrado \n }else{\n mysqli_close( $this->myCon );\n return false ; \n }\n }", "function registro($_usuario, $_pass, $_nombre, $_apellidos, $_email) {\n\t\t$sql = \"SELECT * from usuario where usuario='\".$_usuario.\"'\";\n\n\t\t$usuario_result = $this->db->query($sql)->result();\n\n\t\tif (count($usuario_result)!='0') {\n\n\t\t\t// SI EXISTE DEVOLVEMOS \"FALSE\"\n\t\t\techo \"false\";\n\t\t} else {\n\n\t\t\t// SI NO EXISTE HACEMOS LA INSERCION Y LO GUARDAMOS EN LA VARIABLE SESSION\n\t\t\t$insert = \"INSERT INTO usuario value (NULL, '\".$_nombre.\"', '\".$_apellidos.\"', '\".$_usuario.\"', md5('\".$_pass.\"'), '\".$_email.\"', 'usuario');\";\n\n\t\t\t$this->db->query($insert);\n\n\t\t\t$sql = \"SELECT * from usuario where usuario='\".$_usuario.\"'\";\n\n\t\t\t$usuario_result = $this->db->query($sql)->result();\n\n\t\t\tforeach ($usuario_result[0] as $key => $value) {\n\t\t\t\t$usuario[0][$key] = $value;\n\t\t\t}\n\t\t\tif (count($usuario_result)=='1') {\n\t\t\t\t$this->session->id_usuario = $usuario[0]['id'];\n\t\t\t\t$this->session->nombre = $usuario[0]['usuario'];\n\t\t\t\t$this->session->email = $usuario[0]['email'];\n\t\t\t\t$this->session->privilegio = $usuario[0]['privilegio'];\n\t\t\t\t$this->session->sesion = TRUE;\n\t\t\t}\n\n\t\t\techo \"true\";\n\t\t}\n\n\t}", "function comprobar_usuario_valido($usuario)\n {\n $con = conectar();\n \n $res = pg_query($con, \"select * from usuarios where usuario = '$usuario'\");\n \n $num_rows = pg_num_rows($res);\n \n if ($num_rows != 0)\n {\n return \"<p style='color:red;'>Usuario no válido</p>\";\n }\n else\n {\n return \"\";\n }\n \n pg_close($con);\n }", "public function usuarioAutorizado($usuario)\r\n\t {\r\n\t \t$lista = self::getListaUsuarioAutorizado();\r\n\t \tif ( count($lista) > 0 ) {\r\n\r\n\t \t\tforeach ( $lista as $key => $value ) {\r\n\t \t\t\tif ( $value == $usuario ) {\r\n\t \t\t\t\treturn true;\r\n\t \t\t\t}\r\n\t \t\t}\r\n\t \t}\r\n\r\n\t \treturn false;\r\n\t }", "function createUser($nombre,$password){\n\t\t$creadoUsuario = false;\n //creamos la conexión\n $conexion = $this->conectarBD();\n //Escribimos la sentencia sql necesaria respetando los tipos de datos\n $sql = \"insert into usuarios (nombre_usuario,password_usuario)\n values ('\".$nombre.\"','\".$password.\"')\";\n //hacemos la consulta y la comprobamos\n $consulta = mysqli_query($conexion,$sql);\n if(!$consulta){\n echo \"No se ha podido insertar un nuevo usuario en la base de datos<br><br>\".mysqli_error($conexion);\n }\n\t\telse{\n\t\t\t$creadoUsuario = true;\n\t\t}\n //Desconectamos la base de datos\n $this->desconectarBD($conexion);\n //devolvemos el resultado de la consulta (true o false)\n return $creadoUsuario;\n }", "public function vldUsuario(User $usuario) {\n try {\n $sql = \"SELECT\n id,\n name,\n email\n FROM users\n WHERE \";\n \n if ($usuario->getID() > 0) {\n $sql .= \" id <> '\".$usuario->getId().\"' AND \";\n }\n \n if ($usuario->getEmail() != \"\") {\n $sql .= \"( UPPER(email) = '\".strtoupper($usuario->getEmail()).\"' ) \";\n }\n $stmt = $this->cnx->prepare($sql);\n $result = $stmt->execute();\n \n $linhas = $stmt->rowCount();\n\n if($linhas <= 0) {\n return 0;\n }\n \n if ($result) {\n return 1;\n }\n \n \n } catch (Exception $e) {\n throw new Exception(\"Ocorreu um erro no ao validar dados de usuarios do sistema\");\n }\n }", "public function ctrIngresoUsuario(){\n\n\t\tif(isset($_POST[\"user01\"])){\n\n\t\t//\t if(preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST[\"ingresoEmail\"]) && preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingresoPassword\"])){\n\n\t\t\t \t//$encriptar = crypt($_POST[\"ingresoPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\t\t\t\t$encriptar = crypt($_POST[\"passwords01\"], '$2a$07$asxx54ahjppf17sd87a5a4dDDGsystemdevmybebe$');\n\n\t\t\t \t$tabla = \"genusuario\";\n\t\t\t \t$item = \"usunombre\";\n\t\t\t \t$valor = $_POST[\"user01\"];\n\n\t\t\t \t$respuesta = UserModel::mdlMostrarUsuarios($tabla, $item, $valor);\n\n\t\t\t\t//echo \"<pre>\".print_r($respuesta).\"</pre>\";\n\n\t\t\t \tif($respuesta[\"usunombre\"] == $_POST[\"user01\"] && $respuesta[\"usuclave\"] == $encriptar){\n\n\t\t\t \t\tif($respuesta[\"usuverific\"] == 0){\n\n\t\t\t \t\t\techo'<script>\n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t\t \ttitle: \"¡ERROR!\",\n\t\t\t\t\t\t\t\t \ttext: \"¡El correo electrónico aún no ha sido verificado, por favor revise la bandeja de entrada o la carpeta SPAM de su correo electrónico para verificar la cuenta, o contáctese con nuestro soporte a [email protected]!\",\n\t\t\t\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t</script>';\n\n\t\t\t\t\t\treturn;\n\n\t\t\t \t\t}else{\n\n\t\t\t \t\t\t$_SESSION[\"validarSesion\"] = \"ok\";\n\t\t\t \t\t\t$_SESSION[\"id\"] = $respuesta[\"oid\"];\n\n\t\t\t \t\t\t$ruta = RouteController::ctrRoute();\n\n\t\t\t \t\t\techo '<script>\n\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"'.$ruta.'backoffice\";\t\t\t\t\n\n\t\t\t\t\t\t</script>';\n\n\t\t\t \t\t}\n\n\t\t\t \t}else{\n\n\t\t\t \t\techo'<script>\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t \ttitle: \"¡ERROR!\",\n\t\t\t\t\t\t\t \ttext: \"¡El email o contraseña no coinciden!\",\n\t\t\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t});\n\n\t\t\t\t\t</script>';\n\n\t\t\t \t}\n\n\n\t\t/*\t }else{\n\n\t\t\t \techo '<script>\n\n\t\t\t\t\tswal({\n\n\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\ttitle: \"¡CORREGIR!\",\n\t\t\t\t\t\ttext: \"¡No se permiten caracteres especiales en ninguno de los campos!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\thistory.back();\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\t\n\n\t\t\t\t</script>';\n\n\t\t\t }*/\n\n\t\t}\n\n\t}", "private function consultar_usuario_por_nombre() {\n $sentencia = \"select id,nombrecompleto ,correo,token \"\n . \"from usuario u where u.nombrecompleto ilike '%{$this->referencia_a_buscar}%'; \";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }", "public static function usuarioCrear(String $identificador, String $contrasenna, bool $tipo): bool\r\n {\r\n return self::ejecutarActualizacion(\r\n \"INSERT INTO usuario (identificador, contrasenna, tipo) VALUES(?,?,?)\",\r\n [$identificador, $contrasenna, $tipo]\r\n );\r\n\r\n // los parametros que obtenemos son los qeu almacenamos en la base de datos\r\n }", "public function createUser($correo)\n {\n $query = $this->connect()->prepare('SELECT * FROM users WHERE Correo = :correo');\n $query->execute(['correo' => $correo]);\n //Guardo el obj PDO en cadenaValida\n $this->cadenaValida = $query->fetch();\n\n //si el resultado retorna true no inserta, de lo contrario inserta\n if ($this->cadenaValida) {\n //El usuario ya existe, hay que retornar mensaje de lo que paso\n\n return $resultado = true;\n }else\n {\n //El correo buscado no existe, hay que insertar en tabla users\n //Obtenemos el ultimo valor de ID de usuario para agregar al nuevo\n $idTemp = $this->connect()->query('SELECT MAX(IDUsuario) FROM users');\n \n $a = $idTemp->fetch(PDO::FETCH_BOTH);\n\n $this->idu = $a[0];\n\n $this->idu = (int) $this->idu + 1;\n $this->nombre = $_POST['name'];\n $this->apellidoP = $_POST['ap'];\n $this->apellidoM = $_POST['am'];\n $this->correo = $_POST['correo'];\n $this->pass = md5($_POST['pass']);\n $this->rol = 1;\n\n $query = $this->connect()->prepare(\n 'INSERT INTO users VALUES(\n :idTemp,\n :nombre,\n :apellidoP,\n :apellidoM,\n :correo,\n :pass,\n :rol)'\n );\n\n $query->execute([\n 'idTemp' => $this->idu,\n 'nombre' => $this->nombre,\n 'apellidoP' => $this->apellidoP,\n 'apellidoM' => $this->apellidoM,\n 'correo' => $this->correo,\n 'pass' => $this->pass,\n 'rol' => $this->rol]);\n\n return $resultado = false;\n }\n }", "public function tipousuario($usuario){\r\n\t\t$consulta=$this->db->query(\"SELECT usuario FROM Usuarios WHERE usuario LIKE '$usuario' AND admin LIKE 0\");\r\n\t\t if($consulta->num_rows()!=0){\r\n\t\t\t return true;\r\n\t\t }else{\r\n\t\t\t return false;\r\n\t\t }\r\n\t}", "public function userCadConfirm($codConfirmacao=''){\n \n\n \n if($codConfirmacao==''){//se em branco retorna NULL (erro)\n \n \n return null;\n \n }else{//caso codigo informado procede com a conferencia e a ativacao\n \n \n \n $sql = new Sql();\n $ativacao = $sql->select('SELECT * FROM usuarios \n WHERE cod_ativacao_usuario = :cod_ativacao_usuario',\n array(':cod_ativacao_usuario'=>$codConfirmacao)); \n \n if(count($ativacao)==0){\n \n \n return null;//caso nada encontrado retorna NULL (deve pode ser um codigo invalido)\n \n }elseif(count($ativacao)>0){//caso codigo de confirmacao for OK entao ativa o cadastro\n \n \n //obtem o id do usuario\n $id_usuario = $ativacao[0]['id_usuario'];\n \n \n //verifica se existe a necessidade de ativacao\n if($ativacao[0]['status_usuario']==1){//cadastro JA ATIVO basta notificar\n \n return true;//retorna true confirmando que o cadastro esta atualizado \n \n }elseif($ativacao[0]['status_usuario']==0){//CASO INATIVO ENTÃO PROCEDE COM A ATIVACAO\n \n //atualiza o cadastro do usuario ativando ele\n $res = $sql->query('UPDATE usuarios SET status_usuario = 1\n WHERE id_usuario = :id_usuario',\n array(':id_usuario'=>$id_usuario));\n \n if($res>0){//se o numero de linhas afetadas for maior que ZERO\n \n return true;//retorna true confirmando que o cadastro esta atualizado\n \n }else{\n return false;//caso nada encontrado retorna FALSE (pode ter ocorrido erro na atualizacao)\n\n }\n }\n } \n }\n }", "public function buscaCvePas(){\n /* Consulta usando ELOQUENT -> Trae al usuario si lo encuentra en la tabla usuarios */\n $usuario = Usuario::where([\n ['cuentaUsuario', $this->cuentaUsuario],\n ['contrasenia', $this->contrasenia]\n ])->first();\n return $usuario;\n }", "public function createUsuario()\n {\n $hash = password_hash($this->contra, PASSWORD_DEFAULT);\n $sql = 'INSERT INTO administradores(nombre, apellido, correo, usuario, contra)\n VALUES(?, ?, ?, ?, ?)';\n $params = array($this->nombre, $this->apellido, $this->correo, $this->usuario, $hash);\n return Database::executeRow($sql, $params);\n }", "function registrar_usuario($datos = array()){\n if(empty($datos)||!($datos['perfil']!=''&&$datos['email']!=''&&$datos['contrasena']!='')){return false;}\n $sql = sprintf(\"INSERT INTO `login` (`cloud`,`perfil`,`nombres`,`apellidos`,`email`,`telefono`,`contrasena`) SELECT * FROM (SELECT %s,%s,%s,%s,%s,%s,%s) AS `tmp` WHERE NOT EXISTS (SELECT `email` FROM `login` WHERE `email` = %s AND `cloud` = %s)\",varSQL(__sistema),varSQL($datos['perfil']),varSQL((!isset($datos['nombres']))?'':$datos['nombres']),varSQL((!isset($datos['apellidos']))?'':$datos['apellidos']),varSQL($datos['email']),varSQL((!array_key_exists('telefono',$datos))?'':$datos['telefono']),varSQL(md5($datos['contrasena'])),varSQL($datos['email']),varSQL(__sistema));\n return consulta($sql);\n}", "function isUsuario() {\n if (\\Illuminate\\Support\\Facades\\Auth::user()->rol_id == 3) {\n return true;\n } else {\n return false;\n }\n }", "public static function existe ($usuario,$contrasena){\n $existe=false;\n self::setConexion();\n $resultado=self::$conexion->query(\"SELECT * FROM cuenta WHERE contrasena='$contrasena' AND usuario='$usuario'\");\n $totalFilas=$resultado->rowCount();\n \n if(!$resultado->rowCount()==0){\n //throw Exception(\"YA EXISTE UNA CUENTA CON ESE USUARIO Y CONTRASEÑA\");\n $existe=true;\n }\n return $existe;\n }", "public static function crearUsuario($usuario)\n {\n \n $query = \"INSERT INTO users (nombre,email,usuario,password,privilegio) VALUES (:nombre,:email,:usuario,:password,:privilegio)\";\n \n\n self::getConexion();\n\n $resultado = self::$cnx->prepare($query);\n\n $nombre = $usuario->getNombre();\n $email = $usuario->getEmail();\n $usu = $usuario->getUsuario();\n $password = $usuario->getPassword();\n $privilegio = $usuario->getPrivilegio();\n\n \n $resultado->bindParam(\":privilegio\", $privilegio);\n $resultado->bindParam(\":nombre\", $nombre);\n $resultado->bindParam(\":email\", $email);\n $resultado->bindParam(\":usuario\", $usu);\n $resultado->bindParam(\":password\", $password);\n\n if ($resultado->execute()) {\n return true;\n }\n \n return false;\n \n \n \n }", "function PesquisaUsuarioPorId($id){\n\t\t\t\n\t\t\ttry{\n\t\t\t\t$conn = Banco::ConectaBanco();\n\t\t\t\t$statm = $conn->prepare(\"SELECT * FROM Usuario WHERE usuario_id = :id AND usuario_ativo = TRUE\");\n\t\t\t\t$statm->bindValue(\":id\", $id);\n\t\t\t\t$statm->execute();\n\t\t\t\t$conn = NULL;\n\t\t\t\treturn $row = $statm->fetch(PDO::FETCH_ASSOC);\n\t\t\t}catch(Exception $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t}", "public function recepcionUsuario($nombre , $password){\n\t\t\t$result_child = $this->_db->query(\"SELECT * FROM usuario WHERE login_usu = '\".$nombre.\"'\");\n\t\t\t$retorna_child = $result_child->fetch_all(MYSQL_ASSOC);\n\n\t\t\t//mensaje por defecto indicando que no se registro\n\t\t\t//genera mensaje para el sistema\n\t\t\t$outp = array('activo'=> \"0\");\n\n\t\t\t//verifica que exista el usuario\n\t\t\tif (!$result_child) {\n \t\t\treturn \"Falló SELECT usuario: (\" . $this->_db->errno . \") \" . $this->_db->error;\n\t\t\t}else{\n\n\t\t\t\tif (count($retorna_child) > 0) {\n\t\t\t\t\t//print_r(count($retorna_child));\n\t\t\t\t\t//busca su grupo de usuario para asignar un rol \n\t\t\t\t\t$result_master = $this->_db->query(\"SELECT * FROM grupousu WHERE idGrupoUsu = '\".$retorna_child[0]['GrupoUsu_idGrupoUsu'].\"'\");\n\t\t\t\t\t$retorna_master = $result_master->fetch_all(MYSQL_ASSOC);\n\n\t\t\t\t\t//verifique que tenga un grupo de usuario\n\t\t\t\t\tif (!$result_child) {\n\t \t\t\t\treturn \"Falló SELECT grupousu: (\" . $this->_db->errno . \") \" . $this->_db->error;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//verifica la contrasena\n\t\t\t\t\t\tif (md5($retorna_child[0]['pass_usu']) == $password) {\n\t\t\t\t\t\t\t//genera mensaje para el sistema\n\t\t\t\t\t\t\t$outp[] = array('idUsuario'=> \"\".$retorna_child[0]['idUsuario'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'nombres_usu'=> \"\".$retorna_child[0]['nombres_usu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'apellidos_usu'=> \"\".$retorna_child[0]['apellidos_usu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'GrupoUsu_idGrupoUsu'=> \"\".$retorna_master[0]['idGrupoUsu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'idGrupoUsu'=> \"\".$retorna_master[0]['idGrupoUsu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'activo'=> \"1\",\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn $outp;\n\t\t\t\t\t\t\t$result_child->close();\n\t\t\t\t\t\t\t$result_master->close();\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//genera mensaje para el sistema\n\t\t\t\t\t\t\t$outp[] = array('activo'=> \"0\"\n\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}\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t//genera mensaje para el sistema\n\t\t\t\t\t$outp[] = array('activo'=> \"0\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn $outp;\n\t\t\t\n\t\t}", "public function crearusuarios($nombre,$primer_apellido,$segundo_apellido,$fechanacimento,$email,$telefono,$password,$comprobacion,$alias,$foto)\n { //busca en la tabla usuarios los campos donde el alias sea igual a admin si no encuentra nada devuelve null\n $usuarios = R::findOne('usuarios', 'alias=?', [\n $alias\n ]);\n \n \n // ok es igual a true siempre y cuando usuarios sea distinto de null\n $ok = ($usuarios == null );\n if ($ok) {\n // crea la tabla usuarios\n $usuarios = R::dispense('usuarios');\n //crea los campos de la tabla usuarios\n $usuarios->nombre=$nombre;\n $usuarios->primer_apellido=$primer_apellido;\n $usuarios->segundo_apellido=$segundo_apellido;\n $usuarios->fecha_nacimiento=$fechanacimento;\n $usuarios->fecha_de_registro=date('Y-m-d');\n $usuarios->email=$email;\n $usuarios->telefono=$telefono;\n $usuarios->contrasena=password_hash($password, PASSWORD_DEFAULT);\n $usuarios->confirmar_contrasena=password_hash($comprobacion, PASSWORD_DEFAULT);\n $usuarios->alias=$alias;\n //verifico si las fotos exiten en el directorio assets/fotosperfil\n $sustitutuirespaciosblancos = str_replace(\" \",\"_\",$alias);\n $directorio = \"assets/fotosperfil/usuario-\".$sustitutuirespaciosblancos.\".png\";\n \n $existefichero = is_file( $directorio );\n //si la foto exite se guarda en la base de datos se guarda el campo extension como png si la foto no exite se guarda como null\n if($foto!=null){\n \n if ( $existefichero==true ){\n $extension=\"png\";\n }else{\n \n \n \n \n \n \n \n }}\n $usuarios->foto = $extension;\n //almacena los datos en la tabla usuarios\n R::store($usuarios);\n \n \n //rdirege al controlador principal\n redirect(base_url());\n \n \n }\n \n }", "public function existeUser($acc){\n\t\tUtilidades::_log(\"existeUser($acc)\");\n\t\t$db=DB::conectar();\n\t\t$select=$db->prepare('SELECT * FROM user WHERE account=:account');\n\t\t$select->bindValue('account',$acc);\n\t\t$select->execute();\n\t\t$registro=$select->fetch();\n\t\tif(null != registro['id']){\n\t\t\t$usado=False;\n\t\t}else{\n\t\t\t$usado=True;\n\t\t}\t\n\t\treturn $usado;\n\t}", "function compruebaLoginUsuario($bd){\n //Hago un filtrado previo por si hay valores indeseables en el array\n $arrayFiltrado=array();\n foreach ($_POST as $k => $v)\n $arrayFiltrado[$k] = filtrado($v);\n\n //Utilizo los objetos DAO para añadir el usuario a la BD\n $daoUsuario = new Usuarios($bd);\n $usuario = new Usuario();\n $usuario->setPassword($arrayFiltrado[\"password\"]);\n $usuario->setUsuario($arrayFiltrado[\"usuario\"]);\n $resultado = $daoUsuario->compruebaCredenciales($usuario);\n //Compruebo si tengo usuario\n if($resultado!=false) {\n $usuario->setPassword(null);\n $usuario->setId($resultado[\"id\"]);\n $usuario->setImagen($resultado[\"imagen\"]);\n return $usuario;\n }\n else\n return false;\n}", "public function existNameUser($user){\t\t\n\t\t$query = \"SELECT idUser FROM final_usuario WHERE nick='\".$user.\"'\";\n\t\treturn mysqli_num_rows($this->con->action($query))> 0? True: False;\n\t}", "function trovaCliente($id_cliente){\n$query = mysql_query(\"SELECT * FROM utente WHERE id_cliente = '\".$id_cliente.\"' \");\nif(mysql_num_rows($query)>0){\nreturn true;\n}\nelse {\nreturn false;\n}\n}", "function validar_usuario($user) {\n\t\t\t$this->db->from($this->tabla);\n\t\t\t$this->db->where('usuario', $user);\n\t\t\t$consulta = $this->db->get();\n\t\t\tif ($consulta->num_rows() == 0) {\n\t\t\t\t//usuario no existe\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t//usuario existe\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "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 cadastrar_usuario($nome_usuario, $sobrenome_usuario, $senha_usuario, $email_usuario){\n try{\n $data = array('nome_usuario' => $nome_usuario, 'sobrenome_usuario' => $sobrenome_usuario, \n 'senha_usuario' => $senha_usuario, 'email_usuario' => $email_usuario);\n $str = $this->db->insert('usuario', $data);\n return true;\n }catch(Exception $e){\n return false;\n }\n }", "public function registrarUsuario()\n {\n $datos = array();\n\n //guardamos los datos del formulario en un array \n foreach ($_POST as $clave => $valor) {\n $datos[$clave] = $valor;\n }\n\n //añadimos una clave por defecto y generamos el ciu\n $datos['clave'] = hash('sha512', \"12345678\");\n $datos['ciu'] = self::generarCiu($datos['nombre'], $datos['apellidos'], $datos['fecha_nacimiento']);\n\n //insertamos los datos y mostramos un error en funcion de si ha habido error o no\n echo $this->Usuarios_model->registrarUsuario($datos) ? 1 : 0;\n }", "function StatusVerify($usuario, $senha){\n $usuario = ClearString($usuario);\n $senha = CryptPassword($senha);\n $query = \"SELECT userchave FROM membros WHERE usuario=:username AND senha=:senha AND status='1'\";\n try{\n $result = MySQLStart()->prepare($query);\n $result->bindParam(':username', $usuario, PDO::PARAM_STR);\n $result->bindParam(':senha', $senha, PDO::PARAM_STR);\n $result->execute();\n $count = $result->rowCount();\n if($count > 0){\n $sucesso = true;\n }else{\n $sucesso = false;\n }\n }catch (PDOException $erro_bd){\n echo $erro_bd;\n }\n return $sucesso;\n }", "function revisar_usuario() {\n return isset($_SESSION['nombre']); //valida que exista un nombre en session\n}", "function EstoyLogueado()\n\t{\n\t\tif (!isset($_SESSION['clientecod']) || $_SESSION['clientecod']==0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function ValidarNick($nick){\n \n $ConexionCassandra=new ManejadorCassandra(); //Conexion con la base de datos cassandra\n $BuscaUsuario=$ConexionCassandra->ConsultaPorParametro('usuario',array('nick'=>$nick)); // Busca en la table usuario el nick \n $VerificaEnBD=$BuscaUsuario->getAll();\n if($VerificaEnBD[$nick]==NULL){\n return true;\n }\n return false;\n \n }", "function existUsername($username)\n{\n $c = conectar();\n $select = \"select * from USUARIOS where USERNAME='$username'\";\n // Ejecutamos la consulta recogiendo el resultado\n $resultado = mysqli_query($c, $select);\n // Comprobamos cuantas filas tiene\n if (mysqli_num_rows($resultado) === 1) {\n $resultado = true;\n } else {\n $resultado = false;\n }\n desconectar($c);\n return $resultado;\n}", "public function issetConsejo($login, $clave) {\n if ($login == \"\" || $clave == \"\")\n return false;\n $activo = Objectbase::STATUS_AC;\n $sql = \"select * , c.id as consejo_id from \" . $this->getTableName() . \" as c , \" . $this->getTableName('usuario') . \" as u where c.login = '$login' and c.clave = '$clave' and c.usuario_id = u.id and u.estado = '$activo' and c.estado = '$activo' \";\n //echo $sql; \n $resultado = mysql_query($sql);\n if (!$resultado)\n return false;\n $user = mysql_fetch_object($resultado);\n return $user;\n }", "public static function registro($usuario_obj){\n\n\t\t// var_dump($usuario);\n\t\t$query = \"INSERT INTO usuarios(nombre,usuario,email,password,privilegio) VALUES (:nombre,:usuario,:email,:password,:privilegio)\";\n\n\n\t\t/**\n\t\t * Call getConexion()\n\t\t */\n\t\tself::getConexion();\n\n\t\t$resultado = self::$cn->prepare($query);\n\n\t\t$resultado->bindValue(\":nombre\", $usuario_obj->getNombre());\n\t\t$resultado->bindValue(\":usuario\", $usuario_obj->getUsuario());\n\t\t$resultado->bindValue(\":email\", $usuario_obj->getEmail());\n\t\t$resultado->bindValue(\":password\", $usuario_obj->getPassword());\n\t\t$resultado->bindValue(\":privilegio\",$usuario_obj->getPrivilegio());\n\n\t\tif ($resultado->execute()) {\n\t\t\t#echo \"<br>TRUE<br>\";\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\necho \"false\";\n\t}", "function verClienteActual(){ \r\n\t$query = sprintf(\"SELECT * FROM usuarios WHERE userId=%d\",$_SESSION['userId']);\r\n\treturn getFromDB($query);}", "public function createUsers($data) {\n try {\n $sql = \"SELECT usua_cedula FROM usuario WHERE usua_cedula = ?\";\n $query = $this->pdo->prepare($sql);\n $const = $query->execute(array($data[0]));\n $const= $query->fetch();\n if ($const[0] == $data[0]) {\n return \"existe\";\n }else {\n $pass_encrypted = password_hash(123456, PASSWORD_DEFAULT);\n $sql1 = \"INSERT INTO usuario (usua_id, usua_nombre1, usua_nombre2, usua_apellido1, usua_apellido2, usua_cedula, carg_id, usua_contrasena, clien_id, usua_estado, sed_id, area_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)\";\n $query1 = $this->pdo->prepare($sql1);\n $save = $query1->execute(array('', $data[1], $data[2], $data[3], $data[4], $data[0], $data[5], $pass_encrypted, $data[6], $data[7], $data[8], $data[9]));\n if ($save == true) {\n return true;\n }else {\n return false;\n }\n }\n } catch (Exception $e) {\n $save = $e->getMessage();;\n }\n }", "function _validate_usuario_controlador($idPermiso) {\n $CI =& get_instance();\n if(!isset($_COOKIE[$CI->config->item('sess_cookie_name')])) {\n $CI->session->sess_destroy();\n redirect('','refresh');\n }\n $idPersona = $CI->session->userdata('nid_persona');\n if($idPersona == null) {\n $CI->session->sess_destroy();\n redirect('','refresh');\n }\n if($CI->m_utils->validarPersonaPermiso($idPersona, $idPermiso) == false) {\n $CI->session->sess_destroy();\n redirect('','refresh');\n }\n }", "function verificarenvio($expediente,$usuario){\n \n $parametros=array($expediente);\n $query=$this->db->query(\"select t.cTramiteTipoPersona,e.nExpedienteCodigo from tb_sistram_expediente as e inner join tb_sistram_tramite as t on e.nTramiteId=t.nTramiteId where e.nExpedienteId=?\",$parametros);\n if($query){\n $row=$query->row();\n $tipopersona=$row->cTramiteTipoPersona;\n if($usuario==$tipopersona){\n return true;\n }\n else {\n $this->setExpGenerado($row->nExpedienteCodigo);\n return false;\n }\n \n }\n \n \n }", "private function crearUsuario(){\n \t\t#valida que la solicitud sea mediante un post \n\t if ($_SERVER['REQUEST_METHOD'] != \"POST\") {\n\t \t//envia un error \n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405); \n\t }\n\t //valida que los datos a incorporar no sean vacios \n\t if (isset($this->datosPeticion['nombre'], $this->datosPeticion['email'], $this->datosPeticion['pwd'])){\n\t $nombre = $this->datosPeticion['nombre']; \n\t $pwd = $this->datosPeticion['pwd']; \n\t $email = $this->datosPeticion['email'];\n\n\t //valida la existemcia del usuario mediante el email \n\t if (!$this->existeUsuario($email)){ \n\t $query = $this->_conn->prepare(\n\t \t\"INSERT into usuario (nombre,email,password,fRegistro) \n\t \t VALUES (:nombre, :email, :pwd, NOW())\");\n\t //se le asignan los valores a las variables de la consulta \n\t $query->bindValue(\":nombre\", $nombre); \n\t $query->bindValue(\":email\", $email); \n\t $query->bindValue(\":pwd\", sha1($pwd)); \n\t $query->execute(); \n\t if ($query->rowCount() == 1){ // se inserto bien \n\t $id = $this->_conn->lastInsertId(); \n\t $respuesta['estado'] = 'correcto'; \n\t $respuesta['msg'] = 'usuario creado correctamente'; \n\t $respuesta['usuario']['id'] = $id; \n\t $respuesta['usuario']['nombre'] = $nombre; \n\t $respuesta['usuario']['email'] = $email; \n\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t } else //se envia un error de insercion en la bd\n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(7)), 400); \n\t } else //se envia un error del usuario no existe\n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(8)), 400); \n\t } else { \n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(7)), 400); \n\t } \n\t}", "function agregar($nombre_usuario, $nick_usuario, $clave, $apellido_usuario, $direccion_usuario, $telefono_usuario, $email_usuario, $genero_usuario, $id_rol){\n\t\tinclude 'data_bd.inc';\n\t\tinclude 'databaseClass.php';\n\t\t//creo mi cadena de conexion\n\t\t$conexion = new DB($host, $user, $pass, $bd);\n\t\t//Creo mi conexión\n\t\t$status = $conexion->conectar();\n\t\t//En caso de que devuelva una falla\n\t\tif($status === FALSE){\n\t\t\tdie('No se pudo conectar');\n\t\t}\n\t\t//Creo mi query\n\t\t$consulta = \"INSERT INTO\n\t\t\t\t\t\t\t\tusuario(nombre_usuario, nick_usuario, clave, apellido_usuario, direccion_usuario, telefono_usuario, email_usuario, genero_usuario, id_rol)\n\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t'$nombre_usuario',\n\t\t\t\t\t\t\t\t'$nick_usuario',\n\t\t\t\t\t\t\t\t'$clave',\n\t\t\t\t\t\t\t\t'$apellido_usuario',\n\t\t\t\t\t\t\t\t'$direccion_usuario',\n\t\t\t\t\t\t\t\t'$telefono_usuario',\n\t\t\t\t\t\t\t\t'$email_usuario',\n\t\t\t\t\t\t\t\t'$genero_usuario',\n\t\t\t\t\t\t\t\t$id_rol\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\";\n\t\t//Ejecuto la consulta\n\t\t$resultado = $conexion -> ejecutarConsulta($consulta);\n\t\t//Si fue una falla\n\t\tif($conexion === FALSE){\n\t\t\t$conexion -> cerrar();\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t//Cierro la conexion\n\t\t$id = $resultado;\n\t\t$conexion -> cerrar();\n\t\trequire('usuarioClass.php');\n\t\t$usuario = new Usuario($id, $nombre_usuario, $nick_usuario, $clave, $apellido_usuario, $direccion_usuario, $telefono_usuario, $email_usuario, $genero_usuario, $id_rol);\n\t\t//Regreso los productos\n\t\treturn $usuario;\n\t}", "public function atualizarUsuarios($idusuario, $nome, $email, $senha, $senha_confirma, $telefone, $dtnascimento, $habilitado, $idpermissao){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT count(*) as total from tbusuarios WHERE email = '$email' \";\n $sql = $this->conexao->query($sql);\n $row = $sql->fetch_assoc();\n \n if($senha != $senha_confirma){\n return 2;\n }elseif ($senha == '' || $senha == null && $senha_confirma == '' || $senha_confirma == null ) {\n $sql = \"UPDATE tbusuarios SET nome = '$nome', email='$email', dt_nascimento='$dtnascimento', telefone='$telefone', data_modificado = NOW(), habilitado='$habilitado', idpermissao='$idpermissao' WHERE idusuario = '$idusuario' \";\n echo $this->conexao->query($sql);\n }else{\n $sql = \"UPDATE tbusuarios SET nome = '$nome', email='$email', senha='$senha', senha_confirma='$senha_confirma' dt_nascimento='$dtnascimento', telefone='$telefone', data_modificado = NOW(), habilitado='$habilitado', idpermissao='$idpermissao' WHERE idusuario = '$idusuario' \";\n\n echo $this->conexao->query($sql);\n }\n }", "function registrar_usuario($identificacion,$nombre,$apellidos,$correo,$password)\n\t{\n\t\t$respuesta= array();\n\t\t$usuario = new Usuario();\n\t\t$existe_usuario = $usuario->consultar_usuario($correo);\n\t\tif (empty($existe_usuario)) {\n\t\t\t$usuario_nuevo = $usuario->registrar_usuario($identificacion,$nombre,$apellidos,$correo,$password);\n\t\t\t$respuesta[\"usuario_nuevo\"]=$usuario_nuevo;\n\t\t\tif ($usuario_nuevo) {\n\t\t\t\t$respuesta[\"valor\"]=1; \n\t\t\t} else{\n\t\t\t\t$respuesta[\"valor\"]=0; \n\t\t\t}\n\t\t} else{\n\t\t\t$respuesta[\"valor\"]=2; \n\t\t}\n\t\techo json_encode($respuesta);\n\n\t}", "private function checkUsernameExist(){\n $base = new ConnexionDb();\n\n $req = $base->query(\n \"SELECT u.username FROM user as u WHERE u.username = :username\",\n array(\n array('username',$_POST['username'],\\PDO::PARAM_STR)\n )\n );\n\n if(isset($req[0]->username)){\n return true;\n }else{\n return false;\n }\n }", "public function getdatosUsuarios(){\n\t\t$bd = new bd();\n\t\t$result = $bd->doSingleSelect($this->u_table,\"id = {$this->id}\");\n\t\tif($result){\n\t\t\t$this->datosUsuario($result[\"direccion\"], $result[\"telefono\"], $result[\"descripcion\"], $result[\"estados_id\"], $result[\"facebook\"], $result[\"twitter\"],$result[\"website\"],$result[\"certificado\"],$result[\"id_sede\"]);\n\t\t\t$this->id = $result[\"id\"];\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}", "function autenticado(){\n\tif(isset($_SESSION['DNI'])){//Si existe, existe\n\t\treturn true;\n\t}else{//Si no existe, no existe\n\t\treturn false;\n\t}\n}", "function p_crear_usuario(\n\t\t\t\t$cod_usuario\t\t\t\t\t,\n\t\t\t\t$txt_login\t\t\t\t\t\t,\n\t\t\t\t$txt_password\n\t\t){\n\t\t\tglobal $db;\n\t\t\t$query =\"\n\t\t\tinsert into\tseg_usuario(\n\t\t\ttxt_login\t\t,\n\t\t\tcod_usuario\t\t,\n\t\t\tind_bloqueado\t,\n\t\t\ttxt_password\n\t\t\t)values(\n\t\t\t'$txt_login'\t,\n\t\t\t'$cod_usuario'\t,\n\t\t\t0\t\t\t\t,\n\t\t\t'$txt_password'\n\t\t\t)\";\n\t\t\t$db->consultar($query);\t\n\t\t\t$cod_pk\t= $GLOBALS['fn_ultimo_registro'];\n\t\t\treturn $cod_pk;\n\t\t}", "private function consultar_usuario_por_id() {\n\n if (is_numeric($this->referencia_a_buscar)) {\n $id_a_buscar = intval($this->referencia_a_buscar);\n $sentencia = \"select id,nombrecompleto ,correo,token from usuario u where u.id= {$id_a_buscar};\";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n } else {\n $this->respuesta = null;\n }\n }", "function setUsuario($usuario, $contraseña, $nombre, $apellidos, $telefono, $movil){\n\t\t\n\t\t$resultado = conectar()->query( \"SELECT * FROM usuarios WHERE usuario LIKE '$usuario'\");\n\t\tif($resultado->num_rows == 0){\n\t\t\tconectar()->query(\"INSERT INTO usuarios (usuario, contrasenia, nombre, apellidos, telefono, movil) VALUES ('\" . $usuario . \"','\" . $contraseña . \"','\" . $nombre . \"','\" . $apellidos .\"','\" . $telefono . \"','\" . $movil .\"')\");\n\t\t\techo \"<script>alert('Te has registrado correctamente!');document.location.reload();\";\t\n\t\t}else{\n\t\t\techo \"<script>alert('Ya existe ese nombre de usuario!');</script>\";\n\t\t}\n\t}", "public function ctrIngresoUsuario(){\n\t\tif(isset($_POST[\"ingUsuario\"])){\n\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/',$_POST[\"ingUsuario\"]) && \n\t\t\t\tpreg_match('/^[a-zA-Z0-9]+$/',$_POST[\"ingPassword\"])){\n\n\t\t\t\t$tabla=\"usuarios\";\n\t\t\t$item=\"usuario\";\n\t\t\t$valor=$_POST[\"ingUsuario\"];\n\t\t\t$respuesta=ModeloUsuarios::MdlMostrarUsuarios($tabla,$item,$valor);\t\n\t\t\t //var_dump($respuesta[\"usuario\"]);\n\t\t\tif($respuesta[\"usuario\"]==$_POST[\"ingUsuario\"] && $respuesta[\"password\"]==$_POST[\"ingPassword\"]){\n\t\t\t\t$_SESSION[\"iniciarSesion\"]=\"ok\";\n\t\t\t\techo '<script>\n\t\t\t\twindow.location=\"inicio\";\n\t\t\t\t</script>';\n\t\t\t}else{\n\t\t\t\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelva a intentarlo</div>';\n\t\t\t}\n\t\t}\n\t}\n }", "public function insertUsuario(){\n $query = \"INSERT INTO usuario (nombre, apellido, sexo, fecha_nac, correo, contrasenia) VALUES ('\".parent::string($this->getNombre()).\"', '\".parent::string($this->getApellido()).\"', '\".parent::string($this->getSexo()).\"', '\".parent::string($this->getFecha_Nac()).\"', '\".parent::string($this->getCorreo()).\"', '\".md5(md5(\"PAO%%%%0001TPIPSADSADasdsad\").parent::string($this->getContrasenia())).\"');\";\n $result = mysqli_query(parent::conexion(), $query);\n if($result){\n $fila = mysqli_fetch_array($result);\n parent::desconectar();\n return $fila;\n } else{\n echo parent::conexion()->error;\n parent::desconectar();\n return false;\n }\n }", "public function verificarLogin($nombre, $password)\n {\n //busca en la tabla usuarios los campos donde el nombre sea igual a admin si no encuentra nada devuelve null\n $usuario = R::findOne('usuarios', 'alias=?', [\n $nombre\n ]);\n $a=\"\";\n $b=\"\";\n echo $usuario->alias;\n echo $usuario->contrasena;\n //comprueba si la variable usuario es distinta al campo alias almacenado en la base de datos si es asi a octiene el valor=\"no\"\n if ($usuario->alias!=$nombre) {\n \n $a=\"no\";\n }\n //comprueba si la variable password es distinta al campo contraseña almacenado en la base de datos si es asi b octiene el valor=\"no\"\n if (! password_verify($password, $usuario->contrasena)) {\n \n $b=\"no\";\n }\n // si a y b de los if anteriores son no redirecciona al controlador a la carpeta usuarios dentro de esta carpeta al controlador usuarios.php linea 192\n \n if($a!=\"no\"&& $b!=\"no\"){\n //rdirege al controlador Usuarios/Bienvenidos_u\n \n redirect(base_url().\"usuario/Usuarios/Bienvenidos_u\");\n \n \n \n }\n else{\n session_destroy();\n // redirecciona al controlador usuario usuarios.php linea 190 dentro de la carpeta usuario\n redirect(base_url().\"usuario/Usuarios/errorsesion\");\n }\n \n }", "function obtener_id_usuario($usuario, \r\n $password){\r\n \r\n if ( $usuario == \"\" or $password == \"\" ){ \r\n return false;\r\n }\r\n else{\r\n global $dbHost;\r\n global $dbUsuario;\r\n global $dbPassword;\r\n global $dbNombre;\r\n \r\n $db = new mysqli($dbHost, $dbUsuario, $dbPassword, $dbNombre);\r\n if ($db->connect_errno>0){\r\n die(\"Error de conexion a bases de datos.\");\r\n }\r\n\r\n $sql = \"SELECT id_usuario FROM usuario WHERE usuario = '$usuario' AND contrasena = '$password'\";\r\n //echo $sql;\r\n //exit();\r\n\r\n if($result = $db->query($sql)){\r\n if ($result->num_rows > 0){ //si existe usuario\r\n $renglon = $result->fetch_assoc();\r\n return $renglon[\"id_usuario\"];\r\n }\r\n else{\r\n return 0;\r\n }\r\n }\r\n else\r\n {\r\n die($db->error);\r\n }\r\n\r\n }\r\n}", "function ajax_cadastra_usuario($nome, $email, $senha, $edicao){\n\t$user_email = get_user_by( 'email', $email);\n\t\n\tif ( $user_email !== false && wp_check_password( $senha, $user_email->data->user_pass, $user_email->ID ) ){\n\t\t return $user_email->ID;\n\t\twp_die();\n\n\t}\n\telse if (email_exists($email) !== false ){\n\t\treturn 'E-mail ja cadastrado e senha não confere.';\n\t\t\twp_die();\n\n\t}\n\telse if ( username_exists( $nome )){\n\t\treturn 'Nome de usuário já existe';\n\t\t\twp_die();\n\n\t}\n\telse if ( !empty($nome) && !empty($email) && !empty($senha)) {\n\t\t$userdata = array(\n \t\t 'user_login' => $nome,\n \t\t 'user_email' => $email,\n \t\t 'user_pass' => $senha, // When creating an user, `user_pass` is expected.\n \t\t 'role'\t\t => 'entidade'\n\t);\n\t$user_id = wp_insert_user( $userdata );\t\n\n\treturn $user_id;\n\t} \n\telse{\n\t\treturn 'Algo não foi preenchido';\n\t}\n\twp_die();\n}", "public function crearUsuario() {\n\n\n if ($this->seguridad->esAdmin()) {\n $id = $this->usuario->getLastId();\n $usuario = $_REQUEST[\"usuario\"];\n $contrasenya = $_REQUEST[\"contrasenya\"];\n $email = $_REQUEST[\"email\"];\n $nombre = $_REQUEST[\"nombre\"];\n $apellido1 = $_REQUEST[\"apellido1\"];\n $apellido2 = $_REQUEST[\"apellido2\"];\n $dni = $_REQUEST[\"dni\"];\n $imagen = $_FILES[\"imagen\"];\n $borrado = 'no';\n if (isset($_REQUEST[\"roles\"])) {\n $roles = $_REQUEST[\"roles\"];\n } else {\n $roles = array(\"2\");\n }\n\n if ($this->usuario->add($id,$usuario,$contrasenya,$email,$nombre,$apellido1,$apellido2,$dni,$imagen,$borrado,$roles) > 1) {\n $this->perfil($id);\n } else {\n echo \"<script>\n i=5;\n setInterval(function() {\n if (i==0) {\n location.href='index.php';\n }\n document.body.innerHTML = 'Ha ocurrido un error. Redireccionando en ' + i;\n i--;\n },1000);\n </script>\";\n } \n } else {\n $this->gestionReservas();\n }\n \n }", "function iniciarSesion($usr, $clv, $tabla) {\n //para saber si es usuario o administrador\n $tabla = ($tabla==\"s_admin\") ? \"admin\" : \"usuario\";\n $this->db->where('usuario=',$usr);\n $this->db->where('contrasena=',$clv);\n $query = $this->db->get($tabla);\n\n $rs = $query->result();\n if(count($rs) > 0){\n return $rs;\n }\n $todos = $this->db->query('SELECT count(*) AS nr FROM usuario');\n $nn = $todos->result();\n return false;\n }", "function validar_usuario($usuario) {\n $conn = $this->conectar();\n $query = \"SELECT * FROM MEDICO WHERE login = '\".$usuario.\"'\";\n $result = oci_parse($conn, $query);\n oci_execute($result);\n return $result;\n }", "function validateOnAdd( $entity ){\n\t\t$username = $entity->getUsername();\n\t\t$criteria = new UserCriteria();\n\t\t$criteria->setUsername($username);\n\t\t$criteria->setOidNotEqual( $entity->getOid() );\n\t\t\n\t\t\n\t\t//Logger::log(\"oid del usuario \" . $entity->getOid(), __CLASS__);\n\t\t\n\t\t$count = $this->getCount($criteria);\n\t\t\n\t\tif( $count > 0){\n\t\t\tthrow new ServiceException( \"user.add.username.repetead\" );\n\t\t}\n\t\t\n\t\t\n\t}", "function checkUser($usuario, $password){\n $conexion = $this->conectarBD();\n\t\t$userRegistered = false;\n\n $sql = \"SELECT id_usuario FROM usuarios WHERE nombre_usuario = '\".$usuario.\"' and password_usuario = '\".$password.\"' ;\";\n\n $result = mysqli_query($conexion, $sql);\n\n if($row=mysqli_fetch_array($result, MYSQL_ASSOC)){ \n $this->id_user = $row['id_usuario'];\n\t\t $userRegistered = true;\n } \n //Desconectamos la base de datos\n $this->desconectarBD($conexion);\n return $userRegistered;\n }", "public static function comprobarYaExistente($valor) {\n return UsuarioPDO::comprobarYaExistente($valor);\n }", "function comprobarDatosUsuario() {\n try {\n if($_POST['vat_socio'] == \"\"){\n $aux = null;\n }else{\n $aux=$_POST['vat_socio'];\n }\n $bd = new Bd(3);\n if ($bd->getError() === true) {\n \n } else {\n $stmt = $bd->query(\"SELECT * FROM socios WHERE usuario='\" . $_POST['usuario_socio'] . \"' OR email='\" . $_POST['email_socio'] . \"' OR vat='\" . $aux.\"'\");\n \n if ($stmt !== false) {\n if($stmt->rowCount()<1){\n echo \"true\";\n }else{\n echo \"false\";\n }\n } else {\n echo \"Error\";\n }\n }\n } catch (Exception $ex) {\n echo $ex->getMessage();\n }\n}", "public function buscarUsuario($id) {\n\t\t// hace consulta y setea valores\n\t\t$this->id = $id;\n\t\tif(!$this->getdatosUsuarios()){\t\t\t\n\t\t\tif(!$this->getdatosNatural()){\t\t\t\t\n\t\t\t\t$this->getdatosJuridico();\n\t\t\t}\n\t\t\t$this->getdatosAcceso();\n\t\t\t$this->getdatosStatus();\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getUserExiste(){\n return $this->userExist;\n }", "public function getUsuarioExclusao()\n {\n return $this->usuarioExclusao;\n }", "public function authorize()\n {\n $usuario = Auth::User();\n //se ele e master\n if($usuario->tipo_usuario_id!=8){\n return false; \n }\n return true;\n }", "public function fazerLogin($email, $senha) {\n $this->dados = $this->conexao->selecionar(['usuario_email'], 'usuarios', 'usuario_email= ?', [$email])->fetch(\\PDO::FETCH_ASSOC);\n\n // Instaciando o objeto util para verificar a senha\n $this->util = new Util();\n\n // Se o email existir no banco de dados, o atributo dados vai valer true\n if (count($this->dados) > 0) {\n // Fazemos outra conexão com o banco de dados para pegar a senha do usuario\n \t$this->dados = $this->conexao->selecionar(['usuario_senha'], 'usuarios', \"usuario_email= ?\", [$email])->fetch(\\PDO::FETCH_ASSOC);\n\n // Se a senha do bd for igual a senha digitada no input entramos no if\n if($this->util->compararHash($senha, $this->dados['usuario_senha'])) {\n // Aqui o usuario está logado\n // Setamos ele online no banco de dados\n $this->setStatusOnline($email);\n\n // criamos outra conexão com o banco para pegar as outras informações do usuario\n $this->dados = $this->conexao->selecionar(['usuario_id', 'usuario_nome', 'usuario_sobrenome', 'usuario_cpf', 'usuario_nome_usuario', 'usuario_email',' usuario_email_pendente', 'usuario_email_ativado', 'usuario_cargo', 'usuario_registro_data', 'usuario_registro_ip', 'usuario_ultimo_acesso', 'usuario_ultimo_ip', 'usuario_online', 'usuario_foto', 'usuario_estado', 'usuario_cidade', 'usuario_cep'], 'usuarios', \"usuario_email= ?\", [$email])->fetch(\\PDO::FETCH_ASSOC);\n\n // Intanciamos o objeto usuario com todas as informações\n $this->usuario = new Usuario($this->dados['usuario_nome'], $this->dados['usuario_sobrenome'], $this->dados['usuario_cpf'], $this->dados['usuario_nome_usuario'], $this->dados['usuario_email'], $this->dados['usuario_email_pendente'], $this->dados['usuario_email_ativado'], $this->dados['usuario_cargo'], $this->dados['usuario_registro_data'], $this->dados['usuario_registro_ip'], $this->dados['usuario_ultimo_acesso'], $this->dados['usuario_ultimo_ip'], $this->dados['usuario_online'], $this->dados['usuario_foto'], $this->dados['usuario_estado'], $this->dados['usuario_cidade'], $this->dados['usuario_cep']);\n\n // setamos o id do objeto usuario como o id do bd criptografado em md5 por segurança\n $this->usuario->setId(md5($this->dados['usuario_id']));\n // Retornamos true\n\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "public function cadastro(){\t\n\t\t\t$con = $this->Conectar();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\t$cadUsuario = $con->prepare(\"INSERT INTO usuario(usu_nome, usu_login, usu_senha, usu_contato, usu_permissao)VALUES(:usu_nome, :usu_login, :usu_senha, :usu_contato, :usu_permissao);\");\n\t\t\t\t\t$cadUsuario->bindValue(':usu_nome', $this->getNome());\n\t\t\t\t\t$cadUsuario->bindValue(':usu_login', $this->getLogin());\n\t\t\t\t\t$cadUsuario->bindValue(':usu_senha', $this->getSenha());\n\t\t\t\t\t$cadUsuario->bindValue(':usu_contato', $this->getFone());\n\t\t\t\t\t$cadUsuario->bindValue(':usu_permissao', $this->getPermissao());\n\t\t\t\t\t$cadUsuario->execute();\n\n\t\t\t\tif ($cadUsuario->rowCount()==1) {\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} catch (Exception $e) {\n\t\t\t\techo \"Erro na inserção Objeto Material\";\n\t\t\t}\n\t\t}", "public function check_user_exists($user)\n\t{\n\n\t\t$result = $this->db->query(\"SELECT cli_nome FROM ms_clientes WHERE cli_nome='$user'\");\n\t\tif($result->rowCount() > 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t}", "function getUserExistsOrNot() \n{\n\t$username = $_POST['username'];\t\n\t$query = \"SELECT id FROM users WHERE username='\".$username.\"'\";\n\t$result = mysql_query($query) or die(\"Failed to fetch data: \".mysql_error());\n\t\n\tif(!mysql_num_rows($result)) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\t\n}", "function addUser($nome, $morada, $email, $telefone, $username, $password){\n\t\t$result = checkUsername($username); \n\t\t\n\t\tif(count($result) < 2){ //Não existe ninguém com este username\n\t\t\tglobal $conn;\n\t\t\t$stmt = $conn->prepare(\"INSERT INTO utilizador \n\t\t\t\t\t\t\t\t\tVALUES (DEFAULT, ? , ? , ? , ? , ? , ? ,false);\");\n\t\t\tif (!$stmt->execute(array($nome, $morada, $telefone, $username, $password, $email))) {\n\t\t\t return 1; // Erro a executar a query\n\t\t\t exit;\n\t\t\t}\n\t\t\treturn 0; //Correu tudo bem\t\n\t\t\treturn $query;\n\t\t}\n\t\telse\n\t\t\treturn 2; //Username já utilizado*/\n\t}", "private static function utenteLoggato(){\n return true;\n }", "function saveUsuario(Usuario $objeto) {\n $campos = $this->_getCampos($objeto);\n \n $id = $campos['id'];\n unset($campos['id']);\n unset($campos['tipo']);\n unset($campos['activa']);\n unset($campos['falta']);\n if($objeto->getPassword() === null || $objeto->getPassword() === ''){\n unset($campos['password']);\n }\n return $this->db->updateParameters(self::TABLA, $campos, array('id' => $id));\n }", "function verificarUsuario($user, $ingreso) {\n if (!empty($user)) {\n foreach ($user as $usuario) {\n if ($usuario['email'] == $ingreso) {return false;}\n else {return true;}\n }}\n else {return true;}\n}", "public function login($usuario, $senha) {\n global $conexao;\n\n // Verifica se o email e senha são iguais aos que serão recebidos\n $sql = \"Select * FROM suafesta.cadastros WHERE usuario = :usuario AND senha = :senha\";\n\n // $sql é nada mais nada menos que a tabela usuario\n\n $sql = $conexao->prepare($sql);\n\n // Passa o valor recebido do parametro na variavel\n $sql->bindValue(\"usuario\", $usuario);\n $sql->bindValue(\"senha\", $senha);\n\n $sql->execute();\n\n // Se quantidade de registros > 0\n if($sql->rowCount() > 0) {\n // Fetch - cria um array e retorna apenas uma linha dele\n $dado = $sql->fetch();\n\n echo $sql->rowCount();\n\n // Mostre a linha que está na posição do codigo que bate o email e a senha\n //echo $dado['codigo'];\n\n // Salvar o codigo do usuario no navegador\n $_SESSION[\"codUser\"] = $dado['codigo'];\n \n return true;\n } else {\n return false;\n }\n\n }", "function Boolean_Set_Usuario($nombre,$apellido,$email,$pregunta,$respuesta,$usuario)\n{\n\t$query = modificar(sprintf(\"UPDATE `tb_usuarios` SET nombre_usuario='%s',apellido_usuario='%s',email_usuario='%s',pregunta_usuario='%d',respuesta='%s' WHERE id_usuario='%d'\",escape($nombre),escape($apellido),escape($email),escape($pregunta),escape($respuesta),escape($usuario)));\n\treturn $query;\t\n}", "public function getIdUsuarioOrigen() {\n\t\treturn $this->usuarioOrigen;\n\t}", "function checkUserIdBL() {\n\t $isExisting = false;\n\t // If the user exists\n\t if ( checkUserIdDAL($_POST['userId']) )\n\t {\n\t\t $isExisting = true;\n\t }\n\t return $isExisting;\n }", "public function comprobar_nombre_usuario($nombre_usuario){\n\t $permitidos = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.\";\n\t for ($i=0; $i<strlen($nombre_usuario); $i++){\n\t\t if (strpos($permitidos, substr($nombre_usuario,$i,1))===false){\n\t\t\techo \"<script> alert('El usuario digitado no es válido') ;</script>\";\n\t\t\texit();\n\t\t }\n\t }\n\t \n\t return true;\n\t}" ]
[ "0.73709846", "0.68137", "0.6810606", "0.6797553", "0.6796816", "0.6757448", "0.67523235", "0.67438734", "0.6654201", "0.6482175", "0.64433396", "0.6441933", "0.64321893", "0.64256275", "0.64206606", "0.64146906", "0.6413275", "0.6392416", "0.6362193", "0.6360377", "0.6345079", "0.63245183", "0.6323506", "0.6307954", "0.63004214", "0.629763", "0.6294023", "0.6289629", "0.6278766", "0.6267688", "0.626097", "0.6251117", "0.62471706", "0.6245977", "0.6236611", "0.6232904", "0.6226896", "0.6225853", "0.6223607", "0.6221245", "0.6219686", "0.61869746", "0.6185159", "0.61789054", "0.6172328", "0.61667114", "0.6153421", "0.6148494", "0.61452776", "0.6145195", "0.6141111", "0.6138419", "0.61341566", "0.61341316", "0.61281246", "0.6120191", "0.6120163", "0.6117267", "0.6116906", "0.6115812", "0.6104048", "0.61026233", "0.60972846", "0.6096999", "0.6094887", "0.6093897", "0.60904443", "0.6089472", "0.6083253", "0.60708386", "0.60653824", "0.6062653", "0.60625196", "0.60592073", "0.60574216", "0.6043512", "0.60416216", "0.6040796", "0.60234565", "0.6020483", "0.60194856", "0.60191464", "0.6018826", "0.6016399", "0.60062", "0.59985816", "0.5997936", "0.5988608", "0.59882116", "0.59867233", "0.59852254", "0.5984253", "0.5984109", "0.5979", "0.5975921", "0.5974404", "0.59725976", "0.5968264", "0.5966191", "0.5963885", "0.5960055" ]
0.0
-1
comprovar si existe nobre de usuario para registro cliente
function check_email($Email) { if ($this->Logeo_model->check_email($Email)) { $this->form_validation->set_message('check_email', "$Email ya esta registrado "); return FALSE; } else { return TRUE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function existe_usuario()\n\t{\n\t\t$data = $this->request->getRawInput();\n\t\t$ruc = $data['nick']; \n\t\t$usu = new Admin_model();\n\t\t$usuarioObject = $usu->where(\"nick\", $ruc) \n\t\t->first();\n\t\treturn !is_null($usuarioObject);\n\t\t \n\t}", "function Boolean_Existencia_Usuario($username,$email)\n{\n\t$query = consultar(sprintf(\"SELECT email_usuario,usuario FROM tb_usuarios WHERE email_usuario='%s' or usuario='%s'\",escape($username),escape($email)));\n\tif(Int_consultaVacia($query)>0)\n\t{\n\t\treturn array(false,'El usuario o el email ya existen, intenta nuevamente.');\n\t}else\n\t{\n\t\treturn array(true,'');\t\n\t}\n\n}", "function usuario_existe($usuario){\n\t$sql = \"SELECT id FROM usuarios WHERE usuario = '$usuario'\";\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}", "public function existe_usuario($user){ \n \n $query = \"SELECT email, password, idneo4j FROM usuario WHERE email = '\".$user.\"';\";\n $mysql = new Conexion();\n $resultado = $mysql->get_resultados_query($query);\n \n //print_r($resultado);\n \n if(!empty($resultado))\n return $resultado;\n \n return false;\n \n }", "private function existeUsuario()\n {\n $con = Conexion::getInstance();\n $sql = \"SELECT user \n FROM usuarios\n WHERE user = '{$this->usuario}' AND estado = 1 AND idUsuario != {$this->Id}\";\n\n $result = mysqli_query($con, $sql);\n\n if($result->num_rows >= 1 && $result != false)\n {\n return false;\n }\n\n return true;\n }", "private function existeusuario2($usuario)\n {\n $stmt = $this->con->prepare(\"SELECT id_conductor FROM `descuento` WHERE id_conductor = ?\");\n $stmt->bind_param(\"s\", $usuario);\n $stmt->execute(); \n $stmt->store_result();\n return $stmt->num_rows > 0;\n }", "function mcomprobarUsuarioSesion() {\n\t\t$conexion = conexionbasedatos();\n\t\tif (isset($_SESSION[\"nickname\"]) ) {\n\t\t\t$nickname = $_SESSION[\"nickname\"];\n\n\t\t\t$consulta = \"select * \n\t\t\t\t\t\t from final_USUARIO\n\t\t\t\t\t\t where nickname = '$nickname';\";\n\n\t\t\tif ($resultado = $conexion->query($consulta)) {\n\t\t\t\tif ($datos = $resultado->fetch_assoc()) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else {\n\t\t\t\t\treturn -2;\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t} else {\n\t\t\treturn -2;\n\t\t}\n\t\t\n\t}", "public function usuarioExiste($usuario)\n {\n $bd = new Bd();\n\n $usser = \"SELECT * FROM usuarios WHERE mail='\" . $this->mail . \"'\" . \" AND clave='\" . $this->clave . \"'\";\n $resultado = $bd->consulta($usser);\n\n\n if ($bd->numeroElementos() == 1) {\n session_start();\n $_SESSION['mail'] = $this->mail;\n $_SESSION['clave'] = $this->clave;\n\n header('location: inici.php');\n } else {\n\n header(\"location: registro.php\");\n }\n }", "private function existeusuario($usuario)\n {\n $stmt = $this->con->prepare(\"SELECT id_conductor FROM `carga` WHERE id_conductor = ?\");\n $stmt->bind_param(\"s\", $usuario);\n $stmt->execute(); \n $stmt->store_result();\n\n return $stmt->num_rows > 0;\n }", "function inativaUsuario($id){\n\t\t\ttry{\n\t\t\t\t$conn = Banco::ConectaBanco();\n\t\t\t\t$statm = $conn->prepare(\n\t\t\t\t\"UPDATE Usuario\n\t\t\t\t\tSET usuario_ativo = FALSE\n\t\t\t\t\tWHERE usuario_id = :id AND usuario_ativo = TRUE\n\t\t\t\t\");\n\t\t\t\t$statm->bindValue(\":id\", $id);\n\t\t\t\t$conn = NULL;\n\t\t\t\treturn $statm->execute();\n\t\t\t}catch(Exception $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t}", "public static function HayAdministradores(){\n $usuario = new Usuario();\n $result = (new Usuario())->FindBy([\"tipo = '\".USUARIO::TIPO_ADMINISTRADOR.\"'\"]);\n return (count($result) > 0);\n }", "public function v_nuevo(){\n\t\tif($this -> e_user === '' && $this -> e_pass === '' && $this -> e_email === ''){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function aggiungiCliente($username, $password, $nome){\n$query = mysql_query(\"SELECT * FROM utente WHERE username = '\".$username.\"' \");\n\n\n//se non esiste lo aggiungo\nif(mysql_num_rows($query)==0){\n$ins = mysql_query(\"INSERT INTO utente (username,password,nome) values('\".$username.\"', '\".$password.\"', '\".$nome.\"' )\") ;\n\nif($ins){\nreturn true;\n}\n\nelse {\nreturn false;//username non esiste ma l'inserimento non è andato a buon fine\n}\n}\nelse{\nreturn false; //username esiste\n}\n\n\n}", "public function getNoUsuario()\n\t{\n\t\treturn $this->no_usuario;\n\t}", "function crearUsuario($usuario,$clave){\n\tif(!existeUsuario($usuario)){\n\t\tsetKValue(BUCKET_USUARIOS,$usuario,$clave);\n\t\treturn existeUsuario($usuario);\n\t}\n\treturn false;\n}", "function verificalogin(){\n if(!isset($this->session->datosusu)){\n return true;\n }\n }", "public function validado($usuario){\r\n\t\t$consulta=$this->db->query(\"SELECT * FROM Usuarios WHERE usuario LIKE '$usuario'\");\r\n\t\tforeach ($consulta->result() as $row)\r\n\t\t\t{\r\n\t\t\t\t$id=$row->ID;\r\n\t\t\t}\r\n\t\t$consulta=$this->db->query(\"SELECT ID FROM Cliente WHERE alta LIKE '1' AND ID LIKE '$id'\");\r\n\t\t if($consulta->num_rows()!=0){\r\n\t\t\t return true;\r\n\t\t }else{\r\n\t\t\t return false;\r\n\t\t }\r\n\t}", "function exiteUsuario($usuario) {\n $usuarioSaneado = trim(filter_var($usuario, FILTER_SANITIZE_STRING));\n\n $link = crearConexion();\n $query = \"SELECT `username` FROM `usuario` WHERE `username`='$usuarioSaneado'\";\n $result = mysqli_query($link, $query);\n cerrarConexion($link);\n return mysqli_num_rows($result) > 0;\n}", "function existeUsuario($usuario){\n\tif (hasKey(BUCKET_USUARIOS,$usuario))\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "public function agregarUsuario(){\n \n }", "public function SesionIniciada()\n{\n \n $ConexionCassandra=new ManejadorCassandra();//Conexion con la base de datos \n $ObtenerIp=$ConexionCassandra->ConsultaPorParametro('sesion',array('ip'=>$this->ObtenerIp())); //Busco en la tabla sesion si se encuentra la ip\n $VerificarIp=$ObtenerIp->getAll();\n \n if($VerificarIp!=NULL){\n \n return true; //Retorna true si se encontra el usuario\n }\n else{\n \n return false; //Retorna false si no se encuentra el usuario\n }\n \n }", "public function userExists($codigo, $clave, $tipo_usuario)\n\t{\n\t\t$db = Db::getConnect();\n\t\t$md5Clave = md5($clave);\n\t\t$query = $db->prepare('SELECT * FROM usuarios \n\t\t\t\t\t\t\t\t\t\t\t WHERE codigo = :codigo AND clave = :clave\n\t\t\t\t\t\t\t\t\t\t\t\t AND tipo = :tipo');\n\t\t$query->execute([\n\t\t\t'codigo' => $codigo,\n\t\t\t'clave' => $md5Clave,\n\t\t\t'tipo' => $tipo_usuario\n\t\t]);\n\n\t\t// ME TRAE EL NUMERO DE FILAS ENCONTRADAS\n\t\tif ($query->rowCount()) {\n\n\t\t\tforeach ($query as $currentUser) {\n\t\t\t\t$this->id = $currentUser['id'];\n\t\t\t\t$this->tipo = $currentUser['tipo'];\n\t\t\t\t$this->nombre = $currentUser['nombre'];\n\t\t\t\t$this->apellido = $currentUser['apellido'];\n\t\t\t\t$this->cedula = $currentUser['cedula'];\n\t\t\t\t$this->foto = $currentUser['foto'];\n\t\t\t\t$this->direccion = $currentUser['direccion'];\n\t\t\t\t$this->telefono = $currentUser['telefono'];\n\t\t\t\t$this->estudios = $currentUser['estudios'];\n\t\t\t\t$this->anopromo = $currentUser['anopromo'];\n\t\t\t\t$this->codigo = $currentUser['codigo'];\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function recuperarUsuario()\n {\n $_codigo=$this->codigo ; \n $this->dataBaseAccess(); \n $mySelect = 'select Codigo_empresa,Nome,Senha where Codigo = ' . $this->Codigo ;\n $ret = mysqli_query($this->myCon , $mySelect) ;\n $numRows= mysqli_num_rows($ret); \n if($numRows>0)\n {\n $reg = mysqli_fetch_array($ret) ;\n $this->Codigo_empresa=$reg['Codigo_empresa'] ;\n $this->Nome=$reg['Nome'] ;\n $this->Senha=$reg['Senha'] ;\n mysqli_close( $this->myCon );\n $this->records_found=$numRows ;\n return true ; // ja cadastrado \n }else{\n mysqli_close( $this->myCon );\n return false ; \n }\n }", "function registro($_usuario, $_pass, $_nombre, $_apellidos, $_email) {\n\t\t$sql = \"SELECT * from usuario where usuario='\".$_usuario.\"'\";\n\n\t\t$usuario_result = $this->db->query($sql)->result();\n\n\t\tif (count($usuario_result)!='0') {\n\n\t\t\t// SI EXISTE DEVOLVEMOS \"FALSE\"\n\t\t\techo \"false\";\n\t\t} else {\n\n\t\t\t// SI NO EXISTE HACEMOS LA INSERCION Y LO GUARDAMOS EN LA VARIABLE SESSION\n\t\t\t$insert = \"INSERT INTO usuario value (NULL, '\".$_nombre.\"', '\".$_apellidos.\"', '\".$_usuario.\"', md5('\".$_pass.\"'), '\".$_email.\"', 'usuario');\";\n\n\t\t\t$this->db->query($insert);\n\n\t\t\t$sql = \"SELECT * from usuario where usuario='\".$_usuario.\"'\";\n\n\t\t\t$usuario_result = $this->db->query($sql)->result();\n\n\t\t\tforeach ($usuario_result[0] as $key => $value) {\n\t\t\t\t$usuario[0][$key] = $value;\n\t\t\t}\n\t\t\tif (count($usuario_result)=='1') {\n\t\t\t\t$this->session->id_usuario = $usuario[0]['id'];\n\t\t\t\t$this->session->nombre = $usuario[0]['usuario'];\n\t\t\t\t$this->session->email = $usuario[0]['email'];\n\t\t\t\t$this->session->privilegio = $usuario[0]['privilegio'];\n\t\t\t\t$this->session->sesion = TRUE;\n\t\t\t}\n\n\t\t\techo \"true\";\n\t\t}\n\n\t}", "function comprobar_usuario_valido($usuario)\n {\n $con = conectar();\n \n $res = pg_query($con, \"select * from usuarios where usuario = '$usuario'\");\n \n $num_rows = pg_num_rows($res);\n \n if ($num_rows != 0)\n {\n return \"<p style='color:red;'>Usuario no válido</p>\";\n }\n else\n {\n return \"\";\n }\n \n pg_close($con);\n }", "public function usuarioAutorizado($usuario)\r\n\t {\r\n\t \t$lista = self::getListaUsuarioAutorizado();\r\n\t \tif ( count($lista) > 0 ) {\r\n\r\n\t \t\tforeach ( $lista as $key => $value ) {\r\n\t \t\t\tif ( $value == $usuario ) {\r\n\t \t\t\t\treturn true;\r\n\t \t\t\t}\r\n\t \t\t}\r\n\t \t}\r\n\r\n\t \treturn false;\r\n\t }", "function createUser($nombre,$password){\n\t\t$creadoUsuario = false;\n //creamos la conexión\n $conexion = $this->conectarBD();\n //Escribimos la sentencia sql necesaria respetando los tipos de datos\n $sql = \"insert into usuarios (nombre_usuario,password_usuario)\n values ('\".$nombre.\"','\".$password.\"')\";\n //hacemos la consulta y la comprobamos\n $consulta = mysqli_query($conexion,$sql);\n if(!$consulta){\n echo \"No se ha podido insertar un nuevo usuario en la base de datos<br><br>\".mysqli_error($conexion);\n }\n\t\telse{\n\t\t\t$creadoUsuario = true;\n\t\t}\n //Desconectamos la base de datos\n $this->desconectarBD($conexion);\n //devolvemos el resultado de la consulta (true o false)\n return $creadoUsuario;\n }", "public function vldUsuario(User $usuario) {\n try {\n $sql = \"SELECT\n id,\n name,\n email\n FROM users\n WHERE \";\n \n if ($usuario->getID() > 0) {\n $sql .= \" id <> '\".$usuario->getId().\"' AND \";\n }\n \n if ($usuario->getEmail() != \"\") {\n $sql .= \"( UPPER(email) = '\".strtoupper($usuario->getEmail()).\"' ) \";\n }\n $stmt = $this->cnx->prepare($sql);\n $result = $stmt->execute();\n \n $linhas = $stmt->rowCount();\n\n if($linhas <= 0) {\n return 0;\n }\n \n if ($result) {\n return 1;\n }\n \n \n } catch (Exception $e) {\n throw new Exception(\"Ocorreu um erro no ao validar dados de usuarios do sistema\");\n }\n }", "public function ctrIngresoUsuario(){\n\n\t\tif(isset($_POST[\"user01\"])){\n\n\t\t//\t if(preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST[\"ingresoEmail\"]) && preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingresoPassword\"])){\n\n\t\t\t \t//$encriptar = crypt($_POST[\"ingresoPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\t\t\t\t$encriptar = crypt($_POST[\"passwords01\"], '$2a$07$asxx54ahjppf17sd87a5a4dDDGsystemdevmybebe$');\n\n\t\t\t \t$tabla = \"genusuario\";\n\t\t\t \t$item = \"usunombre\";\n\t\t\t \t$valor = $_POST[\"user01\"];\n\n\t\t\t \t$respuesta = UserModel::mdlMostrarUsuarios($tabla, $item, $valor);\n\n\t\t\t\t//echo \"<pre>\".print_r($respuesta).\"</pre>\";\n\n\t\t\t \tif($respuesta[\"usunombre\"] == $_POST[\"user01\"] && $respuesta[\"usuclave\"] == $encriptar){\n\n\t\t\t \t\tif($respuesta[\"usuverific\"] == 0){\n\n\t\t\t \t\t\techo'<script>\n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t\t \ttitle: \"¡ERROR!\",\n\t\t\t\t\t\t\t\t \ttext: \"¡El correo electrónico aún no ha sido verificado, por favor revise la bandeja de entrada o la carpeta SPAM de su correo electrónico para verificar la cuenta, o contáctese con nuestro soporte a [email protected]!\",\n\t\t\t\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t</script>';\n\n\t\t\t\t\t\treturn;\n\n\t\t\t \t\t}else{\n\n\t\t\t \t\t\t$_SESSION[\"validarSesion\"] = \"ok\";\n\t\t\t \t\t\t$_SESSION[\"id\"] = $respuesta[\"oid\"];\n\n\t\t\t \t\t\t$ruta = RouteController::ctrRoute();\n\n\t\t\t \t\t\techo '<script>\n\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"'.$ruta.'backoffice\";\t\t\t\t\n\n\t\t\t\t\t\t</script>';\n\n\t\t\t \t\t}\n\n\t\t\t \t}else{\n\n\t\t\t \t\techo'<script>\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t \ttitle: \"¡ERROR!\",\n\t\t\t\t\t\t\t \ttext: \"¡El email o contraseña no coinciden!\",\n\t\t\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t});\n\n\t\t\t\t\t</script>';\n\n\t\t\t \t}\n\n\n\t\t/*\t }else{\n\n\t\t\t \techo '<script>\n\n\t\t\t\t\tswal({\n\n\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\ttitle: \"¡CORREGIR!\",\n\t\t\t\t\t\ttext: \"¡No se permiten caracteres especiales en ninguno de los campos!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\thistory.back();\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\t\n\n\t\t\t\t</script>';\n\n\t\t\t }*/\n\n\t\t}\n\n\t}", "private function consultar_usuario_por_nombre() {\n $sentencia = \"select id,nombrecompleto ,correo,token \"\n . \"from usuario u where u.nombrecompleto ilike '%{$this->referencia_a_buscar}%'; \";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }", "public static function usuarioCrear(String $identificador, String $contrasenna, bool $tipo): bool\r\n {\r\n return self::ejecutarActualizacion(\r\n \"INSERT INTO usuario (identificador, contrasenna, tipo) VALUES(?,?,?)\",\r\n [$identificador, $contrasenna, $tipo]\r\n );\r\n\r\n // los parametros que obtenemos son los qeu almacenamos en la base de datos\r\n }", "public function createUser($correo)\n {\n $query = $this->connect()->prepare('SELECT * FROM users WHERE Correo = :correo');\n $query->execute(['correo' => $correo]);\n //Guardo el obj PDO en cadenaValida\n $this->cadenaValida = $query->fetch();\n\n //si el resultado retorna true no inserta, de lo contrario inserta\n if ($this->cadenaValida) {\n //El usuario ya existe, hay que retornar mensaje de lo que paso\n\n return $resultado = true;\n }else\n {\n //El correo buscado no existe, hay que insertar en tabla users\n //Obtenemos el ultimo valor de ID de usuario para agregar al nuevo\n $idTemp = $this->connect()->query('SELECT MAX(IDUsuario) FROM users');\n \n $a = $idTemp->fetch(PDO::FETCH_BOTH);\n\n $this->idu = $a[0];\n\n $this->idu = (int) $this->idu + 1;\n $this->nombre = $_POST['name'];\n $this->apellidoP = $_POST['ap'];\n $this->apellidoM = $_POST['am'];\n $this->correo = $_POST['correo'];\n $this->pass = md5($_POST['pass']);\n $this->rol = 1;\n\n $query = $this->connect()->prepare(\n 'INSERT INTO users VALUES(\n :idTemp,\n :nombre,\n :apellidoP,\n :apellidoM,\n :correo,\n :pass,\n :rol)'\n );\n\n $query->execute([\n 'idTemp' => $this->idu,\n 'nombre' => $this->nombre,\n 'apellidoP' => $this->apellidoP,\n 'apellidoM' => $this->apellidoM,\n 'correo' => $this->correo,\n 'pass' => $this->pass,\n 'rol' => $this->rol]);\n\n return $resultado = false;\n }\n }", "public function tipousuario($usuario){\r\n\t\t$consulta=$this->db->query(\"SELECT usuario FROM Usuarios WHERE usuario LIKE '$usuario' AND admin LIKE 0\");\r\n\t\t if($consulta->num_rows()!=0){\r\n\t\t\t return true;\r\n\t\t }else{\r\n\t\t\t return false;\r\n\t\t }\r\n\t}", "public function userCadConfirm($codConfirmacao=''){\n \n\n \n if($codConfirmacao==''){//se em branco retorna NULL (erro)\n \n \n return null;\n \n }else{//caso codigo informado procede com a conferencia e a ativacao\n \n \n \n $sql = new Sql();\n $ativacao = $sql->select('SELECT * FROM usuarios \n WHERE cod_ativacao_usuario = :cod_ativacao_usuario',\n array(':cod_ativacao_usuario'=>$codConfirmacao)); \n \n if(count($ativacao)==0){\n \n \n return null;//caso nada encontrado retorna NULL (deve pode ser um codigo invalido)\n \n }elseif(count($ativacao)>0){//caso codigo de confirmacao for OK entao ativa o cadastro\n \n \n //obtem o id do usuario\n $id_usuario = $ativacao[0]['id_usuario'];\n \n \n //verifica se existe a necessidade de ativacao\n if($ativacao[0]['status_usuario']==1){//cadastro JA ATIVO basta notificar\n \n return true;//retorna true confirmando que o cadastro esta atualizado \n \n }elseif($ativacao[0]['status_usuario']==0){//CASO INATIVO ENTÃO PROCEDE COM A ATIVACAO\n \n //atualiza o cadastro do usuario ativando ele\n $res = $sql->query('UPDATE usuarios SET status_usuario = 1\n WHERE id_usuario = :id_usuario',\n array(':id_usuario'=>$id_usuario));\n \n if($res>0){//se o numero de linhas afetadas for maior que ZERO\n \n return true;//retorna true confirmando que o cadastro esta atualizado\n \n }else{\n return false;//caso nada encontrado retorna FALSE (pode ter ocorrido erro na atualizacao)\n\n }\n }\n } \n }\n }", "public function buscaCvePas(){\n /* Consulta usando ELOQUENT -> Trae al usuario si lo encuentra en la tabla usuarios */\n $usuario = Usuario::where([\n ['cuentaUsuario', $this->cuentaUsuario],\n ['contrasenia', $this->contrasenia]\n ])->first();\n return $usuario;\n }", "public function createUsuario()\n {\n $hash = password_hash($this->contra, PASSWORD_DEFAULT);\n $sql = 'INSERT INTO administradores(nombre, apellido, correo, usuario, contra)\n VALUES(?, ?, ?, ?, ?)';\n $params = array($this->nombre, $this->apellido, $this->correo, $this->usuario, $hash);\n return Database::executeRow($sql, $params);\n }", "function registrar_usuario($datos = array()){\n if(empty($datos)||!($datos['perfil']!=''&&$datos['email']!=''&&$datos['contrasena']!='')){return false;}\n $sql = sprintf(\"INSERT INTO `login` (`cloud`,`perfil`,`nombres`,`apellidos`,`email`,`telefono`,`contrasena`) SELECT * FROM (SELECT %s,%s,%s,%s,%s,%s,%s) AS `tmp` WHERE NOT EXISTS (SELECT `email` FROM `login` WHERE `email` = %s AND `cloud` = %s)\",varSQL(__sistema),varSQL($datos['perfil']),varSQL((!isset($datos['nombres']))?'':$datos['nombres']),varSQL((!isset($datos['apellidos']))?'':$datos['apellidos']),varSQL($datos['email']),varSQL((!array_key_exists('telefono',$datos))?'':$datos['telefono']),varSQL(md5($datos['contrasena'])),varSQL($datos['email']),varSQL(__sistema));\n return consulta($sql);\n}", "function isUsuario() {\n if (\\Illuminate\\Support\\Facades\\Auth::user()->rol_id == 3) {\n return true;\n } else {\n return false;\n }\n }", "public static function existe ($usuario,$contrasena){\n $existe=false;\n self::setConexion();\n $resultado=self::$conexion->query(\"SELECT * FROM cuenta WHERE contrasena='$contrasena' AND usuario='$usuario'\");\n $totalFilas=$resultado->rowCount();\n \n if(!$resultado->rowCount()==0){\n //throw Exception(\"YA EXISTE UNA CUENTA CON ESE USUARIO Y CONTRASEÑA\");\n $existe=true;\n }\n return $existe;\n }", "public static function crearUsuario($usuario)\n {\n \n $query = \"INSERT INTO users (nombre,email,usuario,password,privilegio) VALUES (:nombre,:email,:usuario,:password,:privilegio)\";\n \n\n self::getConexion();\n\n $resultado = self::$cnx->prepare($query);\n\n $nombre = $usuario->getNombre();\n $email = $usuario->getEmail();\n $usu = $usuario->getUsuario();\n $password = $usuario->getPassword();\n $privilegio = $usuario->getPrivilegio();\n\n \n $resultado->bindParam(\":privilegio\", $privilegio);\n $resultado->bindParam(\":nombre\", $nombre);\n $resultado->bindParam(\":email\", $email);\n $resultado->bindParam(\":usuario\", $usu);\n $resultado->bindParam(\":password\", $password);\n\n if ($resultado->execute()) {\n return true;\n }\n \n return false;\n \n \n \n }", "function PesquisaUsuarioPorId($id){\n\t\t\t\n\t\t\ttry{\n\t\t\t\t$conn = Banco::ConectaBanco();\n\t\t\t\t$statm = $conn->prepare(\"SELECT * FROM Usuario WHERE usuario_id = :id AND usuario_ativo = TRUE\");\n\t\t\t\t$statm->bindValue(\":id\", $id);\n\t\t\t\t$statm->execute();\n\t\t\t\t$conn = NULL;\n\t\t\t\treturn $row = $statm->fetch(PDO::FETCH_ASSOC);\n\t\t\t}catch(Exception $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t}", "public function recepcionUsuario($nombre , $password){\n\t\t\t$result_child = $this->_db->query(\"SELECT * FROM usuario WHERE login_usu = '\".$nombre.\"'\");\n\t\t\t$retorna_child = $result_child->fetch_all(MYSQL_ASSOC);\n\n\t\t\t//mensaje por defecto indicando que no se registro\n\t\t\t//genera mensaje para el sistema\n\t\t\t$outp = array('activo'=> \"0\");\n\n\t\t\t//verifica que exista el usuario\n\t\t\tif (!$result_child) {\n \t\t\treturn \"Falló SELECT usuario: (\" . $this->_db->errno . \") \" . $this->_db->error;\n\t\t\t}else{\n\n\t\t\t\tif (count($retorna_child) > 0) {\n\t\t\t\t\t//print_r(count($retorna_child));\n\t\t\t\t\t//busca su grupo de usuario para asignar un rol \n\t\t\t\t\t$result_master = $this->_db->query(\"SELECT * FROM grupousu WHERE idGrupoUsu = '\".$retorna_child[0]['GrupoUsu_idGrupoUsu'].\"'\");\n\t\t\t\t\t$retorna_master = $result_master->fetch_all(MYSQL_ASSOC);\n\n\t\t\t\t\t//verifique que tenga un grupo de usuario\n\t\t\t\t\tif (!$result_child) {\n\t \t\t\t\treturn \"Falló SELECT grupousu: (\" . $this->_db->errno . \") \" . $this->_db->error;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//verifica la contrasena\n\t\t\t\t\t\tif (md5($retorna_child[0]['pass_usu']) == $password) {\n\t\t\t\t\t\t\t//genera mensaje para el sistema\n\t\t\t\t\t\t\t$outp[] = array('idUsuario'=> \"\".$retorna_child[0]['idUsuario'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'nombres_usu'=> \"\".$retorna_child[0]['nombres_usu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'apellidos_usu'=> \"\".$retorna_child[0]['apellidos_usu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'GrupoUsu_idGrupoUsu'=> \"\".$retorna_master[0]['idGrupoUsu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'idGrupoUsu'=> \"\".$retorna_master[0]['idGrupoUsu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'activo'=> \"1\",\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn $outp;\n\t\t\t\t\t\t\t$result_child->close();\n\t\t\t\t\t\t\t$result_master->close();\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//genera mensaje para el sistema\n\t\t\t\t\t\t\t$outp[] = array('activo'=> \"0\"\n\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}\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t//genera mensaje para el sistema\n\t\t\t\t\t$outp[] = array('activo'=> \"0\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn $outp;\n\t\t\t\n\t\t}", "public function crearusuarios($nombre,$primer_apellido,$segundo_apellido,$fechanacimento,$email,$telefono,$password,$comprobacion,$alias,$foto)\n { //busca en la tabla usuarios los campos donde el alias sea igual a admin si no encuentra nada devuelve null\n $usuarios = R::findOne('usuarios', 'alias=?', [\n $alias\n ]);\n \n \n // ok es igual a true siempre y cuando usuarios sea distinto de null\n $ok = ($usuarios == null );\n if ($ok) {\n // crea la tabla usuarios\n $usuarios = R::dispense('usuarios');\n //crea los campos de la tabla usuarios\n $usuarios->nombre=$nombre;\n $usuarios->primer_apellido=$primer_apellido;\n $usuarios->segundo_apellido=$segundo_apellido;\n $usuarios->fecha_nacimiento=$fechanacimento;\n $usuarios->fecha_de_registro=date('Y-m-d');\n $usuarios->email=$email;\n $usuarios->telefono=$telefono;\n $usuarios->contrasena=password_hash($password, PASSWORD_DEFAULT);\n $usuarios->confirmar_contrasena=password_hash($comprobacion, PASSWORD_DEFAULT);\n $usuarios->alias=$alias;\n //verifico si las fotos exiten en el directorio assets/fotosperfil\n $sustitutuirespaciosblancos = str_replace(\" \",\"_\",$alias);\n $directorio = \"assets/fotosperfil/usuario-\".$sustitutuirespaciosblancos.\".png\";\n \n $existefichero = is_file( $directorio );\n //si la foto exite se guarda en la base de datos se guarda el campo extension como png si la foto no exite se guarda como null\n if($foto!=null){\n \n if ( $existefichero==true ){\n $extension=\"png\";\n }else{\n \n \n \n \n \n \n \n }}\n $usuarios->foto = $extension;\n //almacena los datos en la tabla usuarios\n R::store($usuarios);\n \n \n //rdirege al controlador principal\n redirect(base_url());\n \n \n }\n \n }", "public function existeUser($acc){\n\t\tUtilidades::_log(\"existeUser($acc)\");\n\t\t$db=DB::conectar();\n\t\t$select=$db->prepare('SELECT * FROM user WHERE account=:account');\n\t\t$select->bindValue('account',$acc);\n\t\t$select->execute();\n\t\t$registro=$select->fetch();\n\t\tif(null != registro['id']){\n\t\t\t$usado=False;\n\t\t}else{\n\t\t\t$usado=True;\n\t\t}\t\n\t\treturn $usado;\n\t}", "function compruebaLoginUsuario($bd){\n //Hago un filtrado previo por si hay valores indeseables en el array\n $arrayFiltrado=array();\n foreach ($_POST as $k => $v)\n $arrayFiltrado[$k] = filtrado($v);\n\n //Utilizo los objetos DAO para añadir el usuario a la BD\n $daoUsuario = new Usuarios($bd);\n $usuario = new Usuario();\n $usuario->setPassword($arrayFiltrado[\"password\"]);\n $usuario->setUsuario($arrayFiltrado[\"usuario\"]);\n $resultado = $daoUsuario->compruebaCredenciales($usuario);\n //Compruebo si tengo usuario\n if($resultado!=false) {\n $usuario->setPassword(null);\n $usuario->setId($resultado[\"id\"]);\n $usuario->setImagen($resultado[\"imagen\"]);\n return $usuario;\n }\n else\n return false;\n}", "public function existNameUser($user){\t\t\n\t\t$query = \"SELECT idUser FROM final_usuario WHERE nick='\".$user.\"'\";\n\t\treturn mysqli_num_rows($this->con->action($query))> 0? True: False;\n\t}", "function trovaCliente($id_cliente){\n$query = mysql_query(\"SELECT * FROM utente WHERE id_cliente = '\".$id_cliente.\"' \");\nif(mysql_num_rows($query)>0){\nreturn true;\n}\nelse {\nreturn false;\n}\n}", "function validar_usuario($user) {\n\t\t\t$this->db->from($this->tabla);\n\t\t\t$this->db->where('usuario', $user);\n\t\t\t$consulta = $this->db->get();\n\t\t\tif ($consulta->num_rows() == 0) {\n\t\t\t\t//usuario no existe\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t//usuario existe\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "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 cadastrar_usuario($nome_usuario, $sobrenome_usuario, $senha_usuario, $email_usuario){\n try{\n $data = array('nome_usuario' => $nome_usuario, 'sobrenome_usuario' => $sobrenome_usuario, \n 'senha_usuario' => $senha_usuario, 'email_usuario' => $email_usuario);\n $str = $this->db->insert('usuario', $data);\n return true;\n }catch(Exception $e){\n return false;\n }\n }", "public function registrarUsuario()\n {\n $datos = array();\n\n //guardamos los datos del formulario en un array \n foreach ($_POST as $clave => $valor) {\n $datos[$clave] = $valor;\n }\n\n //añadimos una clave por defecto y generamos el ciu\n $datos['clave'] = hash('sha512', \"12345678\");\n $datos['ciu'] = self::generarCiu($datos['nombre'], $datos['apellidos'], $datos['fecha_nacimiento']);\n\n //insertamos los datos y mostramos un error en funcion de si ha habido error o no\n echo $this->Usuarios_model->registrarUsuario($datos) ? 1 : 0;\n }", "function StatusVerify($usuario, $senha){\n $usuario = ClearString($usuario);\n $senha = CryptPassword($senha);\n $query = \"SELECT userchave FROM membros WHERE usuario=:username AND senha=:senha AND status='1'\";\n try{\n $result = MySQLStart()->prepare($query);\n $result->bindParam(':username', $usuario, PDO::PARAM_STR);\n $result->bindParam(':senha', $senha, PDO::PARAM_STR);\n $result->execute();\n $count = $result->rowCount();\n if($count > 0){\n $sucesso = true;\n }else{\n $sucesso = false;\n }\n }catch (PDOException $erro_bd){\n echo $erro_bd;\n }\n return $sucesso;\n }", "function revisar_usuario() {\n return isset($_SESSION['nombre']); //valida que exista un nombre en session\n}", "function EstoyLogueado()\n\t{\n\t\tif (!isset($_SESSION['clientecod']) || $_SESSION['clientecod']==0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function ValidarNick($nick){\n \n $ConexionCassandra=new ManejadorCassandra(); //Conexion con la base de datos cassandra\n $BuscaUsuario=$ConexionCassandra->ConsultaPorParametro('usuario',array('nick'=>$nick)); // Busca en la table usuario el nick \n $VerificaEnBD=$BuscaUsuario->getAll();\n if($VerificaEnBD[$nick]==NULL){\n return true;\n }\n return false;\n \n }", "function existUsername($username)\n{\n $c = conectar();\n $select = \"select * from USUARIOS where USERNAME='$username'\";\n // Ejecutamos la consulta recogiendo el resultado\n $resultado = mysqli_query($c, $select);\n // Comprobamos cuantas filas tiene\n if (mysqli_num_rows($resultado) === 1) {\n $resultado = true;\n } else {\n $resultado = false;\n }\n desconectar($c);\n return $resultado;\n}", "public function issetConsejo($login, $clave) {\n if ($login == \"\" || $clave == \"\")\n return false;\n $activo = Objectbase::STATUS_AC;\n $sql = \"select * , c.id as consejo_id from \" . $this->getTableName() . \" as c , \" . $this->getTableName('usuario') . \" as u where c.login = '$login' and c.clave = '$clave' and c.usuario_id = u.id and u.estado = '$activo' and c.estado = '$activo' \";\n //echo $sql; \n $resultado = mysql_query($sql);\n if (!$resultado)\n return false;\n $user = mysql_fetch_object($resultado);\n return $user;\n }", "public static function registro($usuario_obj){\n\n\t\t// var_dump($usuario);\n\t\t$query = \"INSERT INTO usuarios(nombre,usuario,email,password,privilegio) VALUES (:nombre,:usuario,:email,:password,:privilegio)\";\n\n\n\t\t/**\n\t\t * Call getConexion()\n\t\t */\n\t\tself::getConexion();\n\n\t\t$resultado = self::$cn->prepare($query);\n\n\t\t$resultado->bindValue(\":nombre\", $usuario_obj->getNombre());\n\t\t$resultado->bindValue(\":usuario\", $usuario_obj->getUsuario());\n\t\t$resultado->bindValue(\":email\", $usuario_obj->getEmail());\n\t\t$resultado->bindValue(\":password\", $usuario_obj->getPassword());\n\t\t$resultado->bindValue(\":privilegio\",$usuario_obj->getPrivilegio());\n\n\t\tif ($resultado->execute()) {\n\t\t\t#echo \"<br>TRUE<br>\";\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\necho \"false\";\n\t}", "function verClienteActual(){ \r\n\t$query = sprintf(\"SELECT * FROM usuarios WHERE userId=%d\",$_SESSION['userId']);\r\n\treturn getFromDB($query);}", "public function createUsers($data) {\n try {\n $sql = \"SELECT usua_cedula FROM usuario WHERE usua_cedula = ?\";\n $query = $this->pdo->prepare($sql);\n $const = $query->execute(array($data[0]));\n $const= $query->fetch();\n if ($const[0] == $data[0]) {\n return \"existe\";\n }else {\n $pass_encrypted = password_hash(123456, PASSWORD_DEFAULT);\n $sql1 = \"INSERT INTO usuario (usua_id, usua_nombre1, usua_nombre2, usua_apellido1, usua_apellido2, usua_cedula, carg_id, usua_contrasena, clien_id, usua_estado, sed_id, area_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)\";\n $query1 = $this->pdo->prepare($sql1);\n $save = $query1->execute(array('', $data[1], $data[2], $data[3], $data[4], $data[0], $data[5], $pass_encrypted, $data[6], $data[7], $data[8], $data[9]));\n if ($save == true) {\n return true;\n }else {\n return false;\n }\n }\n } catch (Exception $e) {\n $save = $e->getMessage();;\n }\n }", "function _validate_usuario_controlador($idPermiso) {\n $CI =& get_instance();\n if(!isset($_COOKIE[$CI->config->item('sess_cookie_name')])) {\n $CI->session->sess_destroy();\n redirect('','refresh');\n }\n $idPersona = $CI->session->userdata('nid_persona');\n if($idPersona == null) {\n $CI->session->sess_destroy();\n redirect('','refresh');\n }\n if($CI->m_utils->validarPersonaPermiso($idPersona, $idPermiso) == false) {\n $CI->session->sess_destroy();\n redirect('','refresh');\n }\n }", "function verificarenvio($expediente,$usuario){\n \n $parametros=array($expediente);\n $query=$this->db->query(\"select t.cTramiteTipoPersona,e.nExpedienteCodigo from tb_sistram_expediente as e inner join tb_sistram_tramite as t on e.nTramiteId=t.nTramiteId where e.nExpedienteId=?\",$parametros);\n if($query){\n $row=$query->row();\n $tipopersona=$row->cTramiteTipoPersona;\n if($usuario==$tipopersona){\n return true;\n }\n else {\n $this->setExpGenerado($row->nExpedienteCodigo);\n return false;\n }\n \n }\n \n \n }", "private function crearUsuario(){\n \t\t#valida que la solicitud sea mediante un post \n\t if ($_SERVER['REQUEST_METHOD'] != \"POST\") {\n\t \t//envia un error \n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405); \n\t }\n\t //valida que los datos a incorporar no sean vacios \n\t if (isset($this->datosPeticion['nombre'], $this->datosPeticion['email'], $this->datosPeticion['pwd'])){\n\t $nombre = $this->datosPeticion['nombre']; \n\t $pwd = $this->datosPeticion['pwd']; \n\t $email = $this->datosPeticion['email'];\n\n\t //valida la existemcia del usuario mediante el email \n\t if (!$this->existeUsuario($email)){ \n\t $query = $this->_conn->prepare(\n\t \t\"INSERT into usuario (nombre,email,password,fRegistro) \n\t \t VALUES (:nombre, :email, :pwd, NOW())\");\n\t //se le asignan los valores a las variables de la consulta \n\t $query->bindValue(\":nombre\", $nombre); \n\t $query->bindValue(\":email\", $email); \n\t $query->bindValue(\":pwd\", sha1($pwd)); \n\t $query->execute(); \n\t if ($query->rowCount() == 1){ // se inserto bien \n\t $id = $this->_conn->lastInsertId(); \n\t $respuesta['estado'] = 'correcto'; \n\t $respuesta['msg'] = 'usuario creado correctamente'; \n\t $respuesta['usuario']['id'] = $id; \n\t $respuesta['usuario']['nombre'] = $nombre; \n\t $respuesta['usuario']['email'] = $email; \n\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t } else //se envia un error de insercion en la bd\n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(7)), 400); \n\t } else //se envia un error del usuario no existe\n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(8)), 400); \n\t } else { \n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(7)), 400); \n\t } \n\t}", "function agregar($nombre_usuario, $nick_usuario, $clave, $apellido_usuario, $direccion_usuario, $telefono_usuario, $email_usuario, $genero_usuario, $id_rol){\n\t\tinclude 'data_bd.inc';\n\t\tinclude 'databaseClass.php';\n\t\t//creo mi cadena de conexion\n\t\t$conexion = new DB($host, $user, $pass, $bd);\n\t\t//Creo mi conexión\n\t\t$status = $conexion->conectar();\n\t\t//En caso de que devuelva una falla\n\t\tif($status === FALSE){\n\t\t\tdie('No se pudo conectar');\n\t\t}\n\t\t//Creo mi query\n\t\t$consulta = \"INSERT INTO\n\t\t\t\t\t\t\t\tusuario(nombre_usuario, nick_usuario, clave, apellido_usuario, direccion_usuario, telefono_usuario, email_usuario, genero_usuario, id_rol)\n\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t'$nombre_usuario',\n\t\t\t\t\t\t\t\t'$nick_usuario',\n\t\t\t\t\t\t\t\t'$clave',\n\t\t\t\t\t\t\t\t'$apellido_usuario',\n\t\t\t\t\t\t\t\t'$direccion_usuario',\n\t\t\t\t\t\t\t\t'$telefono_usuario',\n\t\t\t\t\t\t\t\t'$email_usuario',\n\t\t\t\t\t\t\t\t'$genero_usuario',\n\t\t\t\t\t\t\t\t$id_rol\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\";\n\t\t//Ejecuto la consulta\n\t\t$resultado = $conexion -> ejecutarConsulta($consulta);\n\t\t//Si fue una falla\n\t\tif($conexion === FALSE){\n\t\t\t$conexion -> cerrar();\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t//Cierro la conexion\n\t\t$id = $resultado;\n\t\t$conexion -> cerrar();\n\t\trequire('usuarioClass.php');\n\t\t$usuario = new Usuario($id, $nombre_usuario, $nick_usuario, $clave, $apellido_usuario, $direccion_usuario, $telefono_usuario, $email_usuario, $genero_usuario, $id_rol);\n\t\t//Regreso los productos\n\t\treturn $usuario;\n\t}", "public function atualizarUsuarios($idusuario, $nome, $email, $senha, $senha_confirma, $telefone, $dtnascimento, $habilitado, $idpermissao){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT count(*) as total from tbusuarios WHERE email = '$email' \";\n $sql = $this->conexao->query($sql);\n $row = $sql->fetch_assoc();\n \n if($senha != $senha_confirma){\n return 2;\n }elseif ($senha == '' || $senha == null && $senha_confirma == '' || $senha_confirma == null ) {\n $sql = \"UPDATE tbusuarios SET nome = '$nome', email='$email', dt_nascimento='$dtnascimento', telefone='$telefone', data_modificado = NOW(), habilitado='$habilitado', idpermissao='$idpermissao' WHERE idusuario = '$idusuario' \";\n echo $this->conexao->query($sql);\n }else{\n $sql = \"UPDATE tbusuarios SET nome = '$nome', email='$email', senha='$senha', senha_confirma='$senha_confirma' dt_nascimento='$dtnascimento', telefone='$telefone', data_modificado = NOW(), habilitado='$habilitado', idpermissao='$idpermissao' WHERE idusuario = '$idusuario' \";\n\n echo $this->conexao->query($sql);\n }\n }", "function registrar_usuario($identificacion,$nombre,$apellidos,$correo,$password)\n\t{\n\t\t$respuesta= array();\n\t\t$usuario = new Usuario();\n\t\t$existe_usuario = $usuario->consultar_usuario($correo);\n\t\tif (empty($existe_usuario)) {\n\t\t\t$usuario_nuevo = $usuario->registrar_usuario($identificacion,$nombre,$apellidos,$correo,$password);\n\t\t\t$respuesta[\"usuario_nuevo\"]=$usuario_nuevo;\n\t\t\tif ($usuario_nuevo) {\n\t\t\t\t$respuesta[\"valor\"]=1; \n\t\t\t} else{\n\t\t\t\t$respuesta[\"valor\"]=0; \n\t\t\t}\n\t\t} else{\n\t\t\t$respuesta[\"valor\"]=2; \n\t\t}\n\t\techo json_encode($respuesta);\n\n\t}", "private function checkUsernameExist(){\n $base = new ConnexionDb();\n\n $req = $base->query(\n \"SELECT u.username FROM user as u WHERE u.username = :username\",\n array(\n array('username',$_POST['username'],\\PDO::PARAM_STR)\n )\n );\n\n if(isset($req[0]->username)){\n return true;\n }else{\n return false;\n }\n }", "public function getdatosUsuarios(){\n\t\t$bd = new bd();\n\t\t$result = $bd->doSingleSelect($this->u_table,\"id = {$this->id}\");\n\t\tif($result){\n\t\t\t$this->datosUsuario($result[\"direccion\"], $result[\"telefono\"], $result[\"descripcion\"], $result[\"estados_id\"], $result[\"facebook\"], $result[\"twitter\"],$result[\"website\"],$result[\"certificado\"],$result[\"id_sede\"]);\n\t\t\t$this->id = $result[\"id\"];\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}", "function autenticado(){\n\tif(isset($_SESSION['DNI'])){//Si existe, existe\n\t\treturn true;\n\t}else{//Si no existe, no existe\n\t\treturn false;\n\t}\n}", "function p_crear_usuario(\n\t\t\t\t$cod_usuario\t\t\t\t\t,\n\t\t\t\t$txt_login\t\t\t\t\t\t,\n\t\t\t\t$txt_password\n\t\t){\n\t\t\tglobal $db;\n\t\t\t$query =\"\n\t\t\tinsert into\tseg_usuario(\n\t\t\ttxt_login\t\t,\n\t\t\tcod_usuario\t\t,\n\t\t\tind_bloqueado\t,\n\t\t\ttxt_password\n\t\t\t)values(\n\t\t\t'$txt_login'\t,\n\t\t\t'$cod_usuario'\t,\n\t\t\t0\t\t\t\t,\n\t\t\t'$txt_password'\n\t\t\t)\";\n\t\t\t$db->consultar($query);\t\n\t\t\t$cod_pk\t= $GLOBALS['fn_ultimo_registro'];\n\t\t\treturn $cod_pk;\n\t\t}", "private function consultar_usuario_por_id() {\n\n if (is_numeric($this->referencia_a_buscar)) {\n $id_a_buscar = intval($this->referencia_a_buscar);\n $sentencia = \"select id,nombrecompleto ,correo,token from usuario u where u.id= {$id_a_buscar};\";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n } else {\n $this->respuesta = null;\n }\n }", "function setUsuario($usuario, $contraseña, $nombre, $apellidos, $telefono, $movil){\n\t\t\n\t\t$resultado = conectar()->query( \"SELECT * FROM usuarios WHERE usuario LIKE '$usuario'\");\n\t\tif($resultado->num_rows == 0){\n\t\t\tconectar()->query(\"INSERT INTO usuarios (usuario, contrasenia, nombre, apellidos, telefono, movil) VALUES ('\" . $usuario . \"','\" . $contraseña . \"','\" . $nombre . \"','\" . $apellidos .\"','\" . $telefono . \"','\" . $movil .\"')\");\n\t\t\techo \"<script>alert('Te has registrado correctamente!');document.location.reload();\";\t\n\t\t}else{\n\t\t\techo \"<script>alert('Ya existe ese nombre de usuario!');</script>\";\n\t\t}\n\t}", "public function ctrIngresoUsuario(){\n\t\tif(isset($_POST[\"ingUsuario\"])){\n\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/',$_POST[\"ingUsuario\"]) && \n\t\t\t\tpreg_match('/^[a-zA-Z0-9]+$/',$_POST[\"ingPassword\"])){\n\n\t\t\t\t$tabla=\"usuarios\";\n\t\t\t$item=\"usuario\";\n\t\t\t$valor=$_POST[\"ingUsuario\"];\n\t\t\t$respuesta=ModeloUsuarios::MdlMostrarUsuarios($tabla,$item,$valor);\t\n\t\t\t //var_dump($respuesta[\"usuario\"]);\n\t\t\tif($respuesta[\"usuario\"]==$_POST[\"ingUsuario\"] && $respuesta[\"password\"]==$_POST[\"ingPassword\"]){\n\t\t\t\t$_SESSION[\"iniciarSesion\"]=\"ok\";\n\t\t\t\techo '<script>\n\t\t\t\twindow.location=\"inicio\";\n\t\t\t\t</script>';\n\t\t\t}else{\n\t\t\t\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelva a intentarlo</div>';\n\t\t\t}\n\t\t}\n\t}\n }", "public function insertUsuario(){\n $query = \"INSERT INTO usuario (nombre, apellido, sexo, fecha_nac, correo, contrasenia) VALUES ('\".parent::string($this->getNombre()).\"', '\".parent::string($this->getApellido()).\"', '\".parent::string($this->getSexo()).\"', '\".parent::string($this->getFecha_Nac()).\"', '\".parent::string($this->getCorreo()).\"', '\".md5(md5(\"PAO%%%%0001TPIPSADSADasdsad\").parent::string($this->getContrasenia())).\"');\";\n $result = mysqli_query(parent::conexion(), $query);\n if($result){\n $fila = mysqli_fetch_array($result);\n parent::desconectar();\n return $fila;\n } else{\n echo parent::conexion()->error;\n parent::desconectar();\n return false;\n }\n }", "public function verificarLogin($nombre, $password)\n {\n //busca en la tabla usuarios los campos donde el nombre sea igual a admin si no encuentra nada devuelve null\n $usuario = R::findOne('usuarios', 'alias=?', [\n $nombre\n ]);\n $a=\"\";\n $b=\"\";\n echo $usuario->alias;\n echo $usuario->contrasena;\n //comprueba si la variable usuario es distinta al campo alias almacenado en la base de datos si es asi a octiene el valor=\"no\"\n if ($usuario->alias!=$nombre) {\n \n $a=\"no\";\n }\n //comprueba si la variable password es distinta al campo contraseña almacenado en la base de datos si es asi b octiene el valor=\"no\"\n if (! password_verify($password, $usuario->contrasena)) {\n \n $b=\"no\";\n }\n // si a y b de los if anteriores son no redirecciona al controlador a la carpeta usuarios dentro de esta carpeta al controlador usuarios.php linea 192\n \n if($a!=\"no\"&& $b!=\"no\"){\n //rdirege al controlador Usuarios/Bienvenidos_u\n \n redirect(base_url().\"usuario/Usuarios/Bienvenidos_u\");\n \n \n \n }\n else{\n session_destroy();\n // redirecciona al controlador usuario usuarios.php linea 190 dentro de la carpeta usuario\n redirect(base_url().\"usuario/Usuarios/errorsesion\");\n }\n \n }", "function obtener_id_usuario($usuario, \r\n $password){\r\n \r\n if ( $usuario == \"\" or $password == \"\" ){ \r\n return false;\r\n }\r\n else{\r\n global $dbHost;\r\n global $dbUsuario;\r\n global $dbPassword;\r\n global $dbNombre;\r\n \r\n $db = new mysqli($dbHost, $dbUsuario, $dbPassword, $dbNombre);\r\n if ($db->connect_errno>0){\r\n die(\"Error de conexion a bases de datos.\");\r\n }\r\n\r\n $sql = \"SELECT id_usuario FROM usuario WHERE usuario = '$usuario' AND contrasena = '$password'\";\r\n //echo $sql;\r\n //exit();\r\n\r\n if($result = $db->query($sql)){\r\n if ($result->num_rows > 0){ //si existe usuario\r\n $renglon = $result->fetch_assoc();\r\n return $renglon[\"id_usuario\"];\r\n }\r\n else{\r\n return 0;\r\n }\r\n }\r\n else\r\n {\r\n die($db->error);\r\n }\r\n\r\n }\r\n}", "function ajax_cadastra_usuario($nome, $email, $senha, $edicao){\n\t$user_email = get_user_by( 'email', $email);\n\t\n\tif ( $user_email !== false && wp_check_password( $senha, $user_email->data->user_pass, $user_email->ID ) ){\n\t\t return $user_email->ID;\n\t\twp_die();\n\n\t}\n\telse if (email_exists($email) !== false ){\n\t\treturn 'E-mail ja cadastrado e senha não confere.';\n\t\t\twp_die();\n\n\t}\n\telse if ( username_exists( $nome )){\n\t\treturn 'Nome de usuário já existe';\n\t\t\twp_die();\n\n\t}\n\telse if ( !empty($nome) && !empty($email) && !empty($senha)) {\n\t\t$userdata = array(\n \t\t 'user_login' => $nome,\n \t\t 'user_email' => $email,\n \t\t 'user_pass' => $senha, // When creating an user, `user_pass` is expected.\n \t\t 'role'\t\t => 'entidade'\n\t);\n\t$user_id = wp_insert_user( $userdata );\t\n\n\treturn $user_id;\n\t} \n\telse{\n\t\treturn 'Algo não foi preenchido';\n\t}\n\twp_die();\n}", "public function crearUsuario() {\n\n\n if ($this->seguridad->esAdmin()) {\n $id = $this->usuario->getLastId();\n $usuario = $_REQUEST[\"usuario\"];\n $contrasenya = $_REQUEST[\"contrasenya\"];\n $email = $_REQUEST[\"email\"];\n $nombre = $_REQUEST[\"nombre\"];\n $apellido1 = $_REQUEST[\"apellido1\"];\n $apellido2 = $_REQUEST[\"apellido2\"];\n $dni = $_REQUEST[\"dni\"];\n $imagen = $_FILES[\"imagen\"];\n $borrado = 'no';\n if (isset($_REQUEST[\"roles\"])) {\n $roles = $_REQUEST[\"roles\"];\n } else {\n $roles = array(\"2\");\n }\n\n if ($this->usuario->add($id,$usuario,$contrasenya,$email,$nombre,$apellido1,$apellido2,$dni,$imagen,$borrado,$roles) > 1) {\n $this->perfil($id);\n } else {\n echo \"<script>\n i=5;\n setInterval(function() {\n if (i==0) {\n location.href='index.php';\n }\n document.body.innerHTML = 'Ha ocurrido un error. Redireccionando en ' + i;\n i--;\n },1000);\n </script>\";\n } \n } else {\n $this->gestionReservas();\n }\n \n }", "function iniciarSesion($usr, $clv, $tabla) {\n //para saber si es usuario o administrador\n $tabla = ($tabla==\"s_admin\") ? \"admin\" : \"usuario\";\n $this->db->where('usuario=',$usr);\n $this->db->where('contrasena=',$clv);\n $query = $this->db->get($tabla);\n\n $rs = $query->result();\n if(count($rs) > 0){\n return $rs;\n }\n $todos = $this->db->query('SELECT count(*) AS nr FROM usuario');\n $nn = $todos->result();\n return false;\n }", "function validar_usuario($usuario) {\n $conn = $this->conectar();\n $query = \"SELECT * FROM MEDICO WHERE login = '\".$usuario.\"'\";\n $result = oci_parse($conn, $query);\n oci_execute($result);\n return $result;\n }", "function validateOnAdd( $entity ){\n\t\t$username = $entity->getUsername();\n\t\t$criteria = new UserCriteria();\n\t\t$criteria->setUsername($username);\n\t\t$criteria->setOidNotEqual( $entity->getOid() );\n\t\t\n\t\t\n\t\t//Logger::log(\"oid del usuario \" . $entity->getOid(), __CLASS__);\n\t\t\n\t\t$count = $this->getCount($criteria);\n\t\t\n\t\tif( $count > 0){\n\t\t\tthrow new ServiceException( \"user.add.username.repetead\" );\n\t\t}\n\t\t\n\t\t\n\t}", "function checkUser($usuario, $password){\n $conexion = $this->conectarBD();\n\t\t$userRegistered = false;\n\n $sql = \"SELECT id_usuario FROM usuarios WHERE nombre_usuario = '\".$usuario.\"' and password_usuario = '\".$password.\"' ;\";\n\n $result = mysqli_query($conexion, $sql);\n\n if($row=mysqli_fetch_array($result, MYSQL_ASSOC)){ \n $this->id_user = $row['id_usuario'];\n\t\t $userRegistered = true;\n } \n //Desconectamos la base de datos\n $this->desconectarBD($conexion);\n return $userRegistered;\n }", "public static function comprobarYaExistente($valor) {\n return UsuarioPDO::comprobarYaExistente($valor);\n }", "function comprobarDatosUsuario() {\n try {\n if($_POST['vat_socio'] == \"\"){\n $aux = null;\n }else{\n $aux=$_POST['vat_socio'];\n }\n $bd = new Bd(3);\n if ($bd->getError() === true) {\n \n } else {\n $stmt = $bd->query(\"SELECT * FROM socios WHERE usuario='\" . $_POST['usuario_socio'] . \"' OR email='\" . $_POST['email_socio'] . \"' OR vat='\" . $aux.\"'\");\n \n if ($stmt !== false) {\n if($stmt->rowCount()<1){\n echo \"true\";\n }else{\n echo \"false\";\n }\n } else {\n echo \"Error\";\n }\n }\n } catch (Exception $ex) {\n echo $ex->getMessage();\n }\n}", "public function buscarUsuario($id) {\n\t\t// hace consulta y setea valores\n\t\t$this->id = $id;\n\t\tif(!$this->getdatosUsuarios()){\t\t\t\n\t\t\tif(!$this->getdatosNatural()){\t\t\t\t\n\t\t\t\t$this->getdatosJuridico();\n\t\t\t}\n\t\t\t$this->getdatosAcceso();\n\t\t\t$this->getdatosStatus();\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getUserExiste(){\n return $this->userExist;\n }", "public function getUsuarioExclusao()\n {\n return $this->usuarioExclusao;\n }", "public function authorize()\n {\n $usuario = Auth::User();\n //se ele e master\n if($usuario->tipo_usuario_id!=8){\n return false; \n }\n return true;\n }", "public function fazerLogin($email, $senha) {\n $this->dados = $this->conexao->selecionar(['usuario_email'], 'usuarios', 'usuario_email= ?', [$email])->fetch(\\PDO::FETCH_ASSOC);\n\n // Instaciando o objeto util para verificar a senha\n $this->util = new Util();\n\n // Se o email existir no banco de dados, o atributo dados vai valer true\n if (count($this->dados) > 0) {\n // Fazemos outra conexão com o banco de dados para pegar a senha do usuario\n \t$this->dados = $this->conexao->selecionar(['usuario_senha'], 'usuarios', \"usuario_email= ?\", [$email])->fetch(\\PDO::FETCH_ASSOC);\n\n // Se a senha do bd for igual a senha digitada no input entramos no if\n if($this->util->compararHash($senha, $this->dados['usuario_senha'])) {\n // Aqui o usuario está logado\n // Setamos ele online no banco de dados\n $this->setStatusOnline($email);\n\n // criamos outra conexão com o banco para pegar as outras informações do usuario\n $this->dados = $this->conexao->selecionar(['usuario_id', 'usuario_nome', 'usuario_sobrenome', 'usuario_cpf', 'usuario_nome_usuario', 'usuario_email',' usuario_email_pendente', 'usuario_email_ativado', 'usuario_cargo', 'usuario_registro_data', 'usuario_registro_ip', 'usuario_ultimo_acesso', 'usuario_ultimo_ip', 'usuario_online', 'usuario_foto', 'usuario_estado', 'usuario_cidade', 'usuario_cep'], 'usuarios', \"usuario_email= ?\", [$email])->fetch(\\PDO::FETCH_ASSOC);\n\n // Intanciamos o objeto usuario com todas as informações\n $this->usuario = new Usuario($this->dados['usuario_nome'], $this->dados['usuario_sobrenome'], $this->dados['usuario_cpf'], $this->dados['usuario_nome_usuario'], $this->dados['usuario_email'], $this->dados['usuario_email_pendente'], $this->dados['usuario_email_ativado'], $this->dados['usuario_cargo'], $this->dados['usuario_registro_data'], $this->dados['usuario_registro_ip'], $this->dados['usuario_ultimo_acesso'], $this->dados['usuario_ultimo_ip'], $this->dados['usuario_online'], $this->dados['usuario_foto'], $this->dados['usuario_estado'], $this->dados['usuario_cidade'], $this->dados['usuario_cep']);\n\n // setamos o id do objeto usuario como o id do bd criptografado em md5 por segurança\n $this->usuario->setId(md5($this->dados['usuario_id']));\n // Retornamos true\n\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "public function cadastro(){\t\n\t\t\t$con = $this->Conectar();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\t$cadUsuario = $con->prepare(\"INSERT INTO usuario(usu_nome, usu_login, usu_senha, usu_contato, usu_permissao)VALUES(:usu_nome, :usu_login, :usu_senha, :usu_contato, :usu_permissao);\");\n\t\t\t\t\t$cadUsuario->bindValue(':usu_nome', $this->getNome());\n\t\t\t\t\t$cadUsuario->bindValue(':usu_login', $this->getLogin());\n\t\t\t\t\t$cadUsuario->bindValue(':usu_senha', $this->getSenha());\n\t\t\t\t\t$cadUsuario->bindValue(':usu_contato', $this->getFone());\n\t\t\t\t\t$cadUsuario->bindValue(':usu_permissao', $this->getPermissao());\n\t\t\t\t\t$cadUsuario->execute();\n\n\t\t\t\tif ($cadUsuario->rowCount()==1) {\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} catch (Exception $e) {\n\t\t\t\techo \"Erro na inserção Objeto Material\";\n\t\t\t}\n\t\t}", "public function check_user_exists($user)\n\t{\n\n\t\t$result = $this->db->query(\"SELECT cli_nome FROM ms_clientes WHERE cli_nome='$user'\");\n\t\tif($result->rowCount() > 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t}", "function getUserExistsOrNot() \n{\n\t$username = $_POST['username'];\t\n\t$query = \"SELECT id FROM users WHERE username='\".$username.\"'\";\n\t$result = mysql_query($query) or die(\"Failed to fetch data: \".mysql_error());\n\t\n\tif(!mysql_num_rows($result)) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\t\n}", "function addUser($nome, $morada, $email, $telefone, $username, $password){\n\t\t$result = checkUsername($username); \n\t\t\n\t\tif(count($result) < 2){ //Não existe ninguém com este username\n\t\t\tglobal $conn;\n\t\t\t$stmt = $conn->prepare(\"INSERT INTO utilizador \n\t\t\t\t\t\t\t\t\tVALUES (DEFAULT, ? , ? , ? , ? , ? , ? ,false);\");\n\t\t\tif (!$stmt->execute(array($nome, $morada, $telefone, $username, $password, $email))) {\n\t\t\t return 1; // Erro a executar a query\n\t\t\t exit;\n\t\t\t}\n\t\t\treturn 0; //Correu tudo bem\t\n\t\t\treturn $query;\n\t\t}\n\t\telse\n\t\t\treturn 2; //Username já utilizado*/\n\t}", "private static function utenteLoggato(){\n return true;\n }", "function saveUsuario(Usuario $objeto) {\n $campos = $this->_getCampos($objeto);\n \n $id = $campos['id'];\n unset($campos['id']);\n unset($campos['tipo']);\n unset($campos['activa']);\n unset($campos['falta']);\n if($objeto->getPassword() === null || $objeto->getPassword() === ''){\n unset($campos['password']);\n }\n return $this->db->updateParameters(self::TABLA, $campos, array('id' => $id));\n }", "function verificarUsuario($user, $ingreso) {\n if (!empty($user)) {\n foreach ($user as $usuario) {\n if ($usuario['email'] == $ingreso) {return false;}\n else {return true;}\n }}\n else {return true;}\n}", "public function login($usuario, $senha) {\n global $conexao;\n\n // Verifica se o email e senha são iguais aos que serão recebidos\n $sql = \"Select * FROM suafesta.cadastros WHERE usuario = :usuario AND senha = :senha\";\n\n // $sql é nada mais nada menos que a tabela usuario\n\n $sql = $conexao->prepare($sql);\n\n // Passa o valor recebido do parametro na variavel\n $sql->bindValue(\"usuario\", $usuario);\n $sql->bindValue(\"senha\", $senha);\n\n $sql->execute();\n\n // Se quantidade de registros > 0\n if($sql->rowCount() > 0) {\n // Fetch - cria um array e retorna apenas uma linha dele\n $dado = $sql->fetch();\n\n echo $sql->rowCount();\n\n // Mostre a linha que está na posição do codigo que bate o email e a senha\n //echo $dado['codigo'];\n\n // Salvar o codigo do usuario no navegador\n $_SESSION[\"codUser\"] = $dado['codigo'];\n \n return true;\n } else {\n return false;\n }\n\n }", "function Boolean_Set_Usuario($nombre,$apellido,$email,$pregunta,$respuesta,$usuario)\n{\n\t$query = modificar(sprintf(\"UPDATE `tb_usuarios` SET nombre_usuario='%s',apellido_usuario='%s',email_usuario='%s',pregunta_usuario='%d',respuesta='%s' WHERE id_usuario='%d'\",escape($nombre),escape($apellido),escape($email),escape($pregunta),escape($respuesta),escape($usuario)));\n\treturn $query;\t\n}", "public function getIdUsuarioOrigen() {\n\t\treturn $this->usuarioOrigen;\n\t}", "function checkUserIdBL() {\n\t $isExisting = false;\n\t // If the user exists\n\t if ( checkUserIdDAL($_POST['userId']) )\n\t {\n\t\t $isExisting = true;\n\t }\n\t return $isExisting;\n }", "public function comprobar_nombre_usuario($nombre_usuario){\n\t $permitidos = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.\";\n\t for ($i=0; $i<strlen($nombre_usuario); $i++){\n\t\t if (strpos($permitidos, substr($nombre_usuario,$i,1))===false){\n\t\t\techo \"<script> alert('El usuario digitado no es válido') ;</script>\";\n\t\t\texit();\n\t\t }\n\t }\n\t \n\t return true;\n\t}" ]
[ "0.73709846", "0.68137", "0.6810606", "0.6797553", "0.6796816", "0.6757448", "0.67523235", "0.67438734", "0.6654201", "0.6482175", "0.64433396", "0.6441933", "0.64321893", "0.64256275", "0.64206606", "0.64146906", "0.6413275", "0.6392416", "0.6362193", "0.6360377", "0.6345079", "0.63245183", "0.6323506", "0.6307954", "0.63004214", "0.629763", "0.6294023", "0.6289629", "0.6278766", "0.6267688", "0.626097", "0.6251117", "0.62471706", "0.6245977", "0.6236611", "0.6232904", "0.6226896", "0.6225853", "0.6223607", "0.6221245", "0.6219686", "0.61869746", "0.6185159", "0.61789054", "0.6172328", "0.61667114", "0.6153421", "0.6148494", "0.61452776", "0.6145195", "0.6141111", "0.6138419", "0.61341566", "0.61341316", "0.61281246", "0.6120191", "0.6120163", "0.6117267", "0.6116906", "0.6115812", "0.6104048", "0.61026233", "0.60972846", "0.6096999", "0.6094887", "0.6093897", "0.60904443", "0.6089472", "0.6083253", "0.60708386", "0.60653824", "0.6062653", "0.60625196", "0.60592073", "0.60574216", "0.6043512", "0.60416216", "0.6040796", "0.60234565", "0.6020483", "0.60194856", "0.60191464", "0.6018826", "0.6016399", "0.60062", "0.59985816", "0.5997936", "0.5988608", "0.59882116", "0.59867233", "0.59852254", "0.5984253", "0.5984109", "0.5979", "0.5975921", "0.5974404", "0.59725976", "0.5968264", "0.5966191", "0.5963885", "0.5960055" ]
0.0
-1
the test pages key in on FALSE, so don't rename to assertFalse
public function assertNotTrue($bool, $label = "") { if (!$bool) { $this->currResults[$this->count] = $this->tag."assertNotTrue $label TRUE"; } else { $this->currResults[$this->count] = $this->tag."assertNotTrue $label FALSE"; } $this->count++; $this->tag = ""; return !$bool; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testRestrictPage()\n {\n $this->assertTrue(true);\n }", "public function isTeste() {\n return false;\n }", "public function testGuestNotAccessSettingsPage()\n\t{\n\t\t$this->open('setting');\n\t\t$this->assertTextNotPresent('Settings');\n\t}", "public function testTroubleshootingModeDisabledNoCookie() {\n\t\t$this->assertFalse( $this->class_instance->is_troubleshooting() );\n\t}", "public function testDontIndexNewPrivatePage()\n {\n\n // Add a private page.\n $page = $this->_simplePage(false);\n\n // Should not add a Solr document.\n $this->_assertNotRecordInSolr($page);\n\n }", "private function assertPageNotReloaded(): void {\n $this->assertSession()->pageTextContains($this->pageReloadMarker);\n }", "public function testShowUnauthicatedAccess(): void { }", "public function testManagerNotAccessSettingsPage()\n\t{\n\t\t$this->login($this->users['sample2']['varName'], $this->passwordManager);\n\t\t$this->open('/setting/');\n\t\t$this->assertTextPresent('You don\\'t have access to this section.');\n\t}", "public function isTesting() {}", "public function notATestCase() {}", "function isOnPage(){\n return $this->on_page != 'f';\n\t}", "public static function test() {\n\t\treturn true;\n\t}", "public function isButtonValidBrokenSetupMultiplePrimaryActionsGivenExpectFalse() {}", "public function origTestFinal()\n {\n $this->assertTrue('true');\n }", "public function testKojiPreskacem()\n {\n $this->markTestSkipped(\"ovaj test je namjerno prekocen\");\n }", "public function isTestMode(): bool;", "public function page_test() {\n\n\t\tprint_r($this->permissions->check(\"can_view_admin\"));\n\t}", "public function testTroubleshootingModeDisabledWrongCokie() {\n\t\t$_COOKIE['health-check-disable-plugins'] = 'abc124';\n\n\t\t// This test should fail, as the hash values do not match.\n\t\t$this->assertFalse( $this->class_instance->is_troubleshooting() );\n\t}", "public function testTitle()\n {\n $this->markTestSkipped();\n }", "public function testGuestNotAccessUsersPage()\n\t{\n\t\t$this->open('user');\n\t\t$this->assertTextNotPresent('Users');\n\t}", "protected function shouldRun()\n {\n return false === (bool) $this->configurationManager->getConfigurationValueByPath('FE/pageUnavailable_force');\n }", "public function testGuestNotAccessProfilePage()\n\t{\n\t\t$this->open('/user/edit/' . $this->users['sample1']['intUserID']);\n\t\t$this->assertTextNotPresent('Edit');\n\n\t\t$this->open('/user/edit/' . $this->users['sample2']['intUserID']);\n\t\t$this->assertTextNotPresent('Edit');\n\t}", "function assertFalse($bool){\r\n if(!$bool){\r\n $status = \"passed\";\r\n }\r\n else{\r\n $status = \"failed\";\r\n }\r\n \r\n $this->updateStatus($status);\r\n $this->updateAction(__FUNCTION__);\r\n }", "function test_restrict_deletion_of_Home_page(){}", "public function shouldBeSkipped();", "function test()\n {\n return true;\n }", "public function testDisabledCache()\n {\n $app = $this->app->clone([\n 'options' => [\n 'cache.pages' => false\n ]\n ]);\n\n $this->assertFalse($app->page('a')->isCacheable());\n\n // deactivate in array\n $app = $this->app->clone([\n 'options' => [\n 'cache.pages' => [\n 'active' => false\n ]\n ]\n ]);\n\n $this->assertFalse($app->page('a')->isCacheable());\n }", "public function testGuestNotAccessHomePage()\n\t{\n\t\t$this->open('/');\n\t\t$this->assertTextNotPresent('Home');\n\t}", "public function isTestMode() {\n\t\treturn (bool) $this->app->store->get()->params->get('anet.test_mode');\n\t}", "public function testExample()\n {\n $this->assertTrue(false);\n }", "protected function assertFlagWidget(): void {\n $this->assertSession()->pageTextNotContains('Flag other translations as outdated');\n $this->assertSession()->pageTextContains('Translations cannot be flagged as outdated when content is moderated.');\n }", "public function shouldBeDisplayed()\n {\n return false;\n }", "public function testGetBoolFalse(): void\n {\n // 0\n $_SERVER['MY_KEY'] = 0;\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // false\n $_SERVER['MY_KEY'] = false;\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // '0'\n $_SERVER['MY_KEY'] = '0';\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // 'false'\n $_SERVER['MY_KEY'] = 'false';\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // 'no'\n $_SERVER['MY_KEY'] = 'no';\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // 'off'\n $_SERVER['MY_KEY'] = 'off';\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // 'unknown'\n $_SERVER['MY_KEY'] = 'unknown';\n $this->assertFalse(Env::getBool('MY_KEY'));\n }", "public function testSkipIfFalse(): void\n {\n $this->skipIf(false);\n $this->assertTrue(true, 'Avoid phpunit warnings');\n }", "public function setTestMode()\n {\n $this->isTestMode = true;\n }", "public function runningInFallbackMode(): void\n {\n self::assertEquals(false, $this->subject->runningInFallbackMode());\n }", "public function testMaintenanceModeFalse()\n {\n $lock = $this->util->getMaintenanceLock();\n $lock->unlock();\n\n $result = $this->object->reverseMaintenanceMonitor();\n $this->assertTrue($result);\n }", "private function test()\n {\n return (bool) Mage::getStoreConfig('actions/settings/test');\n }", "public function assertFalse($check) {\r\n\t\t\r\n\t\tTestSuite::assertFalse($check);\r\n\t\t\r\n\t}", "public function testOff()\n\t{\n\t\tCatapult\\Log::on(FALSE);\n\t\t$this->assertTrue(!Catapult\\Log::isOn());\n\t}", "public function testSkipIfTrue(): void\n {\n $this->skipIf(true);\n }", "public function test_page_cache()\n {\n }", "protected function is_edit_page() {\n\t\treturn false;\n\t}", "public function testToFail()\n {\n $this->assertTrue(false, 'He sido creada para fallar');\n }", "function tearDown()\r\n {\r\n // Logout this system.\r\n $this->logout();\r\n\r\n return TRUE;\r\n }", "public function testSpecial(): void {\n\t}", "public function testShowUnderConstruction()\n {\n $response = $this->amGoingToHome();\n\n $response->assertSee('Under construction');\n }", "public function testIsUnPublishScheduled()\n {\n $page = SiteTree::create();\n $page->Title = 'My page';\n $page->PublishOnDate = '2010-01-01 00:00:00';\n $page->AllowEmbargoedEditing = false;\n $page->write();\n\n $this->assertFalse($page->getIsUnPublishScheduled());\n\n $page->UnPublishOnDate = '2016-02-01 00:00:00';\n DBDatetime::set_mock_now('2016-01-16 00:00:00');\n $this->assertTrue($page->getIsUnPublishScheduled());\n\n DBDatetime::set_mock_now('2016-02-16 00:00:00');\n $this->assertFalse($page->getIsUnPublishScheduled());\n }", "public function getTestUrlSuffix() {\n return false;\n }", "public function testUsersTotpToggle()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function isMenuItemValidOmittedTitleExpectFalse() {}", "public function test_setup_assert() {\n $this->assertTrue($this->testassertexecuted);\n $this->testassertexecuted = false;\n }", "public function testNothing(){\n $this->assertTrue(TRUE);\n }", "function tearDown()\r\n {\r\n // Logout from the system.\r\n $this->logout(); \r\n \r\n return TRUE;\r\n }", "function test_basic_nonexistentpage(){\n global $ID,$conf;\n $ID = 'wiki:start';\n\n $info = $this->_get_expected_pageinfo();\n $info['id'] = 'wiki:start';\n $info['namespace'] = 'wiki';\n $info['filepath'] = $conf['datadir'].'/wiki/start.txt';\n\n $this->assertEquals($info, pageinfo());\n }", "function tearDown()\r\n { \r\n // Logout from the system.\r\n $this->logout(); \r\n \r\n return TRUE;\r\n }", "public function testRegisterPageDisplay()\n {\n $this->browse(function ($browser) {\n $browser->visit('/register')\n ->assertDontSee('Contacts Manager');\n });\n }", "public function testNonPublicPages()\n {\n $this->get('/home')->assertStatus(302);\n $this->get('/routes')->assertStatus(302);\n $this->get('/themes')->assertStatus(302);\n $this->get('/users')->assertStatus(302);\n $this->get('/users/create')->assertStatus(302);\n $this->get('/phpinfo')->assertStatus(302);\n $this->get('/profile/create')->assertStatus(302);\n }", "function test0()\n {\n $this->assertTrue(true);\n }", "protected function is_view_page() {\n\t\treturn false;\n\t}", "public function isGeneratePage() {}", "public function pageExistDisabled()\n {\n // checks to see if the page is missing, if it is the page is routed to the 404error page\n if (!file_exists($this->page_folderFullPath . $this->page_name . \".php\"))\n {\n header(\"Location: /errors/404error\");\n }\n // checks to see if the page is disabled, if it is the page is routed to the pageDisabled page\n else if ($this->page_disabled === true)\n {\n header(\"Location: errors/pageDisabled\");\n }\n return true;\n }", "public function testTrue()\n {\n $testtrue = true;\n $this->assertTrue($testtrue);\n\n\treturn false;\n }", "public function TestFilterUserByStatusFalse()\n {\n $expected = $this->usersFilter->filterByStatus(\"authorized\",\"decline\");\n $this->assertFalse($expected);\n }", "function testValueForTrue(){\n $this->assertTrue(true);\n }", "function test_sampleme() {\n\t\t// Replace this with some actual testing code.\n\t\t$this->assertTrue( true );\n\t}", "public function shouldBeDisplayed()\n {\n return Auth::user()->can('browse', Actadmin::model('Page'));\n }", "function test(){\r\n //placeholder for future test functions\r\n }", "public function testBasicFeatures()\n {\n return $this->doTheRealTest(false);\n }", "public function isTest();", "public function testSetAndRetrieveBoolean(): void\n {\n $key = \"A test key\";\n $this->testNotStrict->set($key, true);\n $actual = $this->testNotStrict->get($key);\n $this->assertTrue($actual);\n $this->testNotStrict->set($key, false);\n $actual = $this->testNotStrict->get($key);\n $this->assertFalse($actual);\n }", "public function testStatusFlags()\n {\n $page = SiteTree::create();\n $page->Title = 'stuff';\n DBDatetime::set_mock_now('2016-01-16 00:00:00');\n\n $flags = $page->getStatusFlags(false);\n $this->assertNotContains('embargo_expiry', array_keys($flags ?? []));\n $this->assertNotContains('embargo', array_keys($flags ?? []));\n $this->assertNotContains('expiry', array_keys($flags ?? []));\n\n $page->PublishOnDate = '2016-02-01 00:00:00';\n $page->UnPublishOnDate = null;\n $flags = $page->getStatusFlags(false);\n $this->assertNotContains('embargo_expiry', array_keys($flags ?? []));\n $this->assertContains('embargo', array_keys($flags ?? []));\n $this->assertNotContains('expiry', array_keys($flags ?? []));\n\n $page->PublishOnDate = null;\n $page->UnPublishOnDate = '2016-02-01 00:00:00';\n $flags = $page->getStatusFlags(false);\n $this->assertNotContains('embargo_expiry', array_keys($flags ?? []));\n $this->assertNotContains('embargo', array_keys($flags ?? []));\n $this->assertContains('expiry', array_keys($flags ?? []));\n\n $page->PublishOnDate = '2016-02-01 00:00:00';\n $page->UnPublishOnDate = '2016-02-08 00:00:00';\n $flags = $page->getStatusFlags(false);\n $this->assertContains('embargo_expiry', array_keys($flags ?? []));\n $this->assertNotContains('embargo', array_keys($flags ?? []));\n $this->assertNotContains('expiry', array_keys($flags ?? []));\n }", "public function isButtonValidBrokenSetupInvalidButtonAsSecondParametersGivenExpectFalse() {}", "public function testIsMarkedUndoneIfDone()\n {\n $this->addTestFixtures();\n $id = $this->task->getId();\n $title = $this->task->getTitle();\n $this->task->setIsDone(true);\n $this->logInAsUser();\n $this->client->request('GET', '/tasks/'.$id.'/toggle');\n\n $isDone = $this->task->getIsDone();\n\n $statusCode = $this->client->getResponse()->getStatusCode();\n $this->assertEquals(302, $statusCode);\n\n $crawler = $this->client->followRedirect();\n $response = $this->client->getResponse();\n $statusCode = $response->getStatusCode();\n\n $this->assertEquals(200, $statusCode);\n $this->assertEquals(false, $isDone);\n $this->assertContains('Superbe! La tâche '.$title.' a bien été marquée comme à faire.', $crawler->filter('div.alert.alert-success')->text());\n }", "public function testHasFailedReturnsFalse(): void\n {\n $this->assertFalse($this->class->has_failed());\n }", "public function testHasFailedReturnsFalse(): void\n {\n $this->assertFalse($this->class->has_failed());\n }", "function test_import_key()\n\t{\n\t\t// Remove the following line when you implement this test.\n\t\treturn $this -> markTestSkipped();\n\t}", "function testGetAllFaqsPages() {\n $faqspage = $this->fixture->objFromFixture('FaqsPage', 'faq1');\n $this->assertContains('Faq Number 1', $faqspage->Title);\n \n $faqspage = $this->fixture->objFromFixture('FaqsPage', 'faq2');\n $this->assertContains('Faq Number 2', $faqspage->Title); \n }", "public function isTestmode()\n {\n return $this->getConfigDataFlag('test', $this->getStoreId());\n }", "public function automated() : bool;", "public function makeMenuAllGoodExpectTrue() {}", "public function testWebinarPanelists()\n {\n }", "public function hasIsTest()\n {\n return $this->IsTest !== null;\n }", "public function isMenuItemValidOmittedHrefAndRouteExpectFalse() {}", "public static function phpunit_disable() {\n parent::disable();\n }", "public function tearDown(): bool\n {\n // MongoDB does not require any action. Always return true\n return true;\n }", "function _isTest($method) {\r\n return strtolower(substr($method, 0, 4)) == 'test';\r\n }", "public function test_filters_automatic_updater_disabled()\n {\n }", "public function test_show_homepage_referers_widget_disabled()\n {\n setting()->set('disable_referers', 1);\n\n $admin = User::find(1);\n $this->actingAs($admin)\n ->get('/')\n ->assertDontSee('Best referers');\n }", "function _autodiscover(){\n if (file_exists('test')){return true;}\n else{return false;}\n }", "public function isMenuValidBlankCallExpectFalse() {}", "public function isVisitante(){ return false; }", "public function tearDown() {\n\t\tremove_filter( 'doing_it_wrong_trigger_error', '__return_false' );\n\n\t\tparent::tearDown();\n\t}", "public function isTest() : bool\n\t{\n\t\treturn $this->productionTest;\n\t}", "function testLoad()\n {\n $this->assertTrue(true);\n }", "public function testIsMarkedDoneIfUndone()\n {\n $this->addTestFixtures();\n $id = $this->task->getId();\n $title = $this->task->getTitle();\n $this->logInAsUser();\n $this->client->request('GET', '/tasks/'.$id.'/toggle');\n\n $isDone = $this->task->getIsDone();\n\n $statusCode = $this->client->getResponse()->getStatusCode();\n $this->assertEquals(302, $statusCode);\n\n $crawler = $this->client->followRedirect();\n $response = $this->client->getResponse();\n $statusCode = $response->getStatusCode();\n\n $this->assertEquals(200, $statusCode);\n $this->assertEquals(true, $isDone);\n $this->assertContains('Superbe! La tâche '.$title.' a bien été marquée comme faite.', $crawler->filter('div.alert.alert-success')->text());\n }", "public function testCanLogOut() {\n // TBA\n }", "public function isPageHomonymie(): bool\n {\n return false !== stristr($this->getText() ?? '', '{{homonymie');\n }", "protected function isInMainNamespace(): bool\n { if ($this->wikiPageAction->getNs() !== 0) {\n $this->log->notice(\"SKIP : page n'est pas dans Main (ns 0)\\n\");\n $this->db->skipArticle($this->title);\n\n return false;\n }\n return true;\n }", "function testSample() {\n\t\t$this->assertTrue( true );\n\t}", "public function testverifyIfPasswordIsFalse()\n {\n $state=Database::findAdmin($this->db->getPdo(),\"bill\",\"cool\");\n $this->assertFalse($state);\n }" ]
[ "0.6641856", "0.66418374", "0.6360166", "0.63117653", "0.626287", "0.6097981", "0.60663253", "0.6059799", "0.6058551", "0.60422266", "0.600909", "0.5994836", "0.59617776", "0.59524614", "0.5933293", "0.59285605", "0.5918608", "0.5885063", "0.5878168", "0.5877327", "0.58423734", "0.5837265", "0.58316535", "0.5812413", "0.5781009", "0.578078", "0.57688993", "0.57667094", "0.57532096", "0.57485896", "0.5745645", "0.5743102", "0.5740636", "0.57382584", "0.5730743", "0.5728003", "0.5726777", "0.572055", "0.5719067", "0.5717071", "0.57091236", "0.5709032", "0.5702988", "0.5700826", "0.5691362", "0.5681821", "0.5665075", "0.5655536", "0.5644024", "0.5642978", "0.56426144", "0.56425804", "0.56414133", "0.5640564", "0.563513", "0.5623726", "0.5621867", "0.561892", "0.5614442", "0.5614096", "0.5606815", "0.56023467", "0.5598891", "0.55916494", "0.5591185", "0.55811876", "0.55788577", "0.55681515", "0.556741", "0.556002", "0.55450445", "0.55236816", "0.5522582", "0.55220175", "0.5512889", "0.5512889", "0.54994404", "0.54989237", "0.5492146", "0.54891884", "0.5488962", "0.54878384", "0.54750615", "0.5474094", "0.5472636", "0.5458916", "0.5454907", "0.5454005", "0.5452429", "0.5451833", "0.5445406", "0.5442723", "0.543451", "0.54343563", "0.54310215", "0.54287225", "0.542339", "0.5419662", "0.5418393", "0.5417748", "0.54133826" ]
0.0
-1
/ EXPORT DATA CUSTOMER TO EXCEL export_data
public function actionExport(){ //$custDataMTI=Yii::$app->db_esm->createCommand("CALL ERP_MASTER_CUSTOMER_export('CUSTOMER_MTI')")->queryAll(); /* 22=NKA*/ $cusDataProviderNKA= new ArrayDataProvider([ 'key' => 'ID', 'allModels'=>Yii::$app->db_esm->createCommand(" SELECT CUST_KD,CUST_NM,(SELECT CUST_KTG_NM FROM c0001k WHERE CUST_KTG=CUST_TYPE limit 1) AS TYPE_NM, ALAMAT,TLP1,PIC FROM c0001 WHERE CUST_KTG='1' AND CUST_TYPE='22' #AND CUST_KD<>CUST_GRP ORDER BY CUST_GRP ASC ")->queryAll(), ]); $aryCusDataProviderNKA=$cusDataProviderNKA->allModels; /*15=MTI*/ $cusDataProviderMTI= new ArrayDataProvider([ 'key' => 'ID', 'allModels'=>Yii::$app->db_esm->createCommand(" SELECT CUST_KD,CUST_NM,(SELECT CUST_KTG_NM FROM c0001k WHERE CUST_KTG=CUST_TYPE limit 1) AS TYPE_NM, ALAMAT,TLP1,PIC FROM c0001 WHERE CUST_KTG='1' AND CUST_TYPE='15' #AND CUST_KD<>CUST_GRP ORDER BY CUST_GRP ASC ")->queryAll(), ]); $aryCusDataProviderMTI=$cusDataProviderMTI->allModels; /*OTHERS*/ $cusDataProvideOTHER= new ArrayDataProvider([ 'key' => 'ID', 'allModels'=>Yii::$app->db_esm->createCommand(" SELECT CUST_KD,CUST_NM,(SELECT CUST_KTG_NM FROM c0001k WHERE CUST_KTG=CUST_TYPE limit 1) AS TYPE_NM, ALAMAT,TLP1,PIC FROM c0001 WHERE CUST_KTG='1' AND CUST_TYPE<>'15' AND CUST_TYPE<>22 ORDER BY CUST_GRP ASC ")->queryAll(), ]); $aryCusDataProviderOTHER=$cusDataProvideOTHER->allModels; /*SOURCE NKA*/ $excel_dataNKA = Export2ExcelBehavior::excelDataFormat($aryCusDataProviderNKA); //$excel_title = $excel_dataNKA['excel_title']; $excel_ceilsNKA = $excel_dataNKA['excel_ceils']; /*SOURCE MTI*/ $excel_dataMTI = Export2ExcelBehavior::excelDataFormat($aryCusDataProviderMTI); $excel_ceilsMTI = $excel_dataMTI['excel_ceils']; /*SOURCE OTHERS*/ $excel_dataOTHER= Export2ExcelBehavior::excelDataFormat($aryCusDataProviderOTHER); $excel_ceilsOTHER = $excel_dataOTHER['excel_ceils']; $excel_content = [ [ 'sheet_name' => 'NKA CUSTOMER', 'sheet_title' => ['CUST_ID','CUST_NM','TYPE','ALAMAT','TLP','PIC'], //$excel_ceils,//'sad',//[$excel_title], 'ceils' => $excel_ceilsNKA, //'freezePane' => 'E2', 'headerColor' => Export2ExcelBehavior::getCssClass("header"), 'headerColumnCssClass' => [ 'CUST_KD' => Export2ExcelBehavior::getCssClass('header'), 'CUST_NM' => Export2ExcelBehavior::getCssClass('header'), 'TYPE_NM' => Export2ExcelBehavior::getCssClass('header'), 'ALAMAT' => Export2ExcelBehavior::getCssClass('header'), 'TLP1' => Export2ExcelBehavior::getCssClass('header'), 'PIC' => Export2ExcelBehavior::getCssClass('header') ], //define each column's cssClass for header line only. You can set as blank. 'oddCssClass' => Export2ExcelBehavior::getCssClass("odd"), 'evenCssClass' => Export2ExcelBehavior::getCssClass("even"), ], [ 'sheet_name' => 'MTI CUSTOMER', 'sheet_title' => ['CUST_ID','CUST_NM','TYPE','ALAMAT','TLP','PIC'], //$excel_ceils,//'sad',//[$excel_title], 'ceils' => $excel_ceilsMTI, //'freezePane' => 'E2', 'headerColor' => Export2ExcelBehavior::getCssClass("header"), 'headerColumnCssClass' => [ 'CUST_KD' => Export2ExcelBehavior::getCssClass('header'), 'CUST_NM' => Export2ExcelBehavior::getCssClass('header'), 'TYPE_NM' => Export2ExcelBehavior::getCssClass('header'), 'ALAMAT' => Export2ExcelBehavior::getCssClass('header'), 'TLP1' => Export2ExcelBehavior::getCssClass('header'), 'PIC' => Export2ExcelBehavior::getCssClass('header') ], //define each column's cssClass for header line only. You can set as blank. 'oddCssClass' => Export2ExcelBehavior::getCssClass("odd"), 'evenCssClass' => Export2ExcelBehavior::getCssClass("even"), ], [ 'sheet_name' => 'OTHERS', 'sheet_title' => ['CUST_ID','CUST_NM','TYPE','ALAMAT','TLP','PIC'], //$excel_ceils,//'sad',//[$excel_title], 'ceils' => $excel_ceilsOTHER, //'freezePane' => 'E2', 'headerColor' => Export2ExcelBehavior::getCssClass("header"), 'headerColumnCssClass' => [ 'CUST_KD' => Export2ExcelBehavior::getCssClass('header'), 'CUST_NM' => Export2ExcelBehavior::getCssClass('header'), 'TYPE_NM' => Export2ExcelBehavior::getCssClass('header'), 'ALAMAT' => Export2ExcelBehavior::getCssClass('header'), 'TLP1' => Export2ExcelBehavior::getCssClass('header'), 'PIC' => Export2ExcelBehavior::getCssClass('header') ], //define each column's cssClass for header line only. You can set as blank. 'oddCssClass' => Export2ExcelBehavior::getCssClass("odd"), 'evenCssClass' => Export2ExcelBehavior::getCssClass("even"), ], ]; $excel_file = "PostmanCustomer"; $this->export2excel($excel_content, $excel_file); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function export()\n {\n return Excel::download(new CustomerFormExport, 'customers.xlsx');\n }", "public function customerExcelExport()\n\t{\n\t\t$status = $this->uri->segment(4);\n\t\t$sortArr = array('field' => 'id', 'type' => 'desc');\n\t\t$condition = array();\n\t\t$rep_code = ltrim($this->session->userdata('fc_session_admin_rep_code'), '0');\n\t\tif ($rep_code != '') {\n\t\t\t$condition = ' and h.rep_code=\"' . $rep_code . '\"';\n\t\t} else {\n\t\t\t$condition = '';\n\t\t}\n\t\t$UserDetails = $this->order_model->view_order_detailsexcel($status, $condition, $rep_code);\n\t\t$data['getCustomerDetails'] = $UserDetails->result_array();\n\t\t//print_r($data['getCustomerDetails']); \n\t\t\n\t\t//exit;\n\t\t$data['status'] = ($status == \"Pending\") ? 'Failed' : $status;\n\t\t$data['admin_currency_symbol'] = $this->data['admin_currency_symbol'];\n\t\t$data['admin_currency_code'] = $this->data['admin_currency_code'];\n\t\t$this->load->view('admin/order/customerExportExcel', $data);\n\t}", "public function export_sales_report(){\n $sales_report = DB::table('orders')\n ->select('*')\n ->get();\n\n $sales_array[] = array('Invoice ID','Customer Name','Total', 'Discount','Sales Date');\n\n foreach ($sales_report as $item) {\n $customer_details = unserialize($item->customer_details);\n\n $sales_array[] = array(\n 'Invoice ID' => $item->id,\n 'Customer Name' => $customer_details['customer_name'],\n 'Total' => $item->total,\n 'Discount' => $item->discount,\n 'Sales Date' => date('d M Y', strtotime($item->created_at))\n );\n\n }\n //create excel\n Excel::create('Sales Report', function($excel) use($sales_array) {\n $excel->sheet('Sales Report', function($sheet) use($sales_array) {\n $sheet->fromArray($sales_array);\n });\n })->download('xls');\n\n }", "public function download()\n {\n\n $cus_list = array();\n $cus_list[] = ['Customer Name'];\n $cus_list[] = ['Eastex'];\n $cus_list[] = ['Magnate'];\n\n // and append it to the payments array.\n return \\Excel::create('customer_example', function ($excel) use ($cus_list) {\n\n $excel->sheet('sheet name', function ($sheet) use ($cus_list) {\n\n $sheet->fromArray($cus_list, null, 'A1', false, false);\n $sheet->cells('A1', function ($cells) {\n\n $cells->setAlignment('center');\n $cells->setFontWeight(\"bold\");\n $cells->setFontColor('#000000');\n $cells->setFontSize('12');\n });\n });\n })->download('xlsx');\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 function companiessExport(){\n \n return Excel::download( new CompaniesExport , 'companies.xls');\n\n }", "public function export() \n \t\t{\n \t\t$data = $this->model_user->export();\n \t\t#load PHPExcel library\n \t\t$this->excel->setActiveSheetIndex(0);\n \t\t#name the worksheet\n \t\t$this->excel->getActiveSheet()->setTitle('Data User SN Health Care');\n \n \t\t#STYLING\n \t\t$styleArray = array('borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN,'color' => array('argb' => '0000'))));\n \n \t\t#set report header\n \t\t$this->excel->getActiveSheet()->getStyle('A:I')->getFont()->setName('Times New Roman');\n \t\t$this->excel->getActiveSheet()->mergeCells('A1:J1');\n \t\t$this->excel->getActiveSheet()->setCellValue('A1', 'DAFTAR USER APLIKASI SN HEALTH CARE');\n \t\t$this->excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t$this->excel->getActiveSheet()->getStyle('A1')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t$this->excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);\n \t\t$this->excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(12);\n \n \n \t\t//set column name\n \t\t$this->excel->getActiveSheet()->setCellValue('A2', 'No');\n \t\t$this->excel->getActiveSheet()->setCellValue('B2', 'Nama');\n \t\t$this->excel->getActiveSheet()->setCellValue('C2', 'Jenis Kelamin');\n \t\t$this->excel->getActiveSheet()->setCellValue('D2', 'Tanggal Lahir');\n \t\t$this->excel->getActiveSheet()->setCellValue('E2', 'Email');\n \t\t$this->excel->getActiveSheet()->setCellValue('F2', 'Password');\n \t\t$this->excel->getActiveSheet()->setCellValue('G2', 'Nomor Handphone');\n \t\t$this->excel->getActiveSheet()->setCellValue('H2', 'Wilayah');\n \t\t$this->excel->getActiveSheet()->setCellValue('I2', 'Alamat');\n \t\t$this->excel->getActiveSheet()->setCellValue('J2', 'Tanggal & Waktu Registrasi');\n \n\t\t\t $this->excel->getActiveSheet()->getStyle('A2:J2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('A')->setWidth(4);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('B')->setWidth(30);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('C')->setWidth(15);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('D')->setWidth(15);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('E')->setWidth(30);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('F')->setWidth(30);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('G')->setWidth(20);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('H')->setWidth(30);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('I')->setWidth(40);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('J')->setWidth(25);\n \n \t\t$no = 3;\n \t\t$nomor = 1;\n \t\tforeach ($data as $v) \n \t\t{\n \t\t\t\n \t\t\t$this->excel->getActiveSheet()->getStyle('A' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('A' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('A' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->setCellValue('A' . $no, $nomor);\n\n \t\t\t$this->excel->getActiveSheet()->getStyle('B' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('B' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('B' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->setCellValue('B' . $no, $v->user_name);\n\n \t\t\t$this->excel->getActiveSheet()->getStyle('C' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('C' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('C' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->setCellValue('C' . $no, $v->user_sex);\n\n \t\t\t$this->excel->getActiveSheet()->getStyle('D' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('D' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('D' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('D' . $no, $v->user_datebirth);\n\t\t\t\t \n \t\t\t$this->excel->getActiveSheet()->getStyle('E' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('E' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('E' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('E' . $no, $v->user_email);\n\t\t\t\t \n \t\t\t$this->excel->getActiveSheet()->getStyle('F' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('F' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('F' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('F' . $no, $v->user_password);\n\n \t\t\t$this->excel->getActiveSheet()->getStyle('G' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('G' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('G' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('G' . $no, $v->user_phone);\n\t\t\t\t \n \t\t\t$this->excel->getActiveSheet()->getStyle('H' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('H' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('H' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('H' . $no, $v->district_name);\n\t\t\t\t \n \t\t\t$this->excel->getActiveSheet()->getStyle('I' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('I' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('I' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('I' . $no, $v->user_address);\n\t\t\t\t \n\t\t\t\t$this->excel->getActiveSheet()->getStyle('J' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('J' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('J' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->setCellValue('J' . $no, $v->user_registerdate);\n\t\t\t\t\n\t\t\t\t$no++;\n \t\t\t$nomor++;\n \t\t}\n \n \t\t$this->excel->getActiveSheet()->getStyle('A2:J' . ($no - 1))->applyFromArray($styleArray);\n \t\tob_end_clean();\n \t\t$filename = 'Daftar User Aplikasi SN Health Care.xls'; //save our workbook as this file name\n \t\theader('Content-Type: application/vnd.ms-excel'); //mime type\n \t\theader('Content-Disposition: attachment;filename=\"' . $filename . '\"'); //tell browser what's the file name\n \t\theader('Cache-Control: max-age=0'); //no cache\n \t\t$objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5');\n \t\t$objWriter->save('php://output');\n \n \t\tredirect('admin/user');\n \t\t}", "public function excel()\r\n {\r\n $data = $this->AdminJobModel->getJobsForCSV($this->xssCleanInput('ids'));\r\n $data = sortForCSV(objToArr($data));\r\n $excel = new SimpleExcel('csv'); \r\n $excel->writer->setData($data);\r\n $excel->writer->saveFile('jobs'); \r\n exit;\r\n }", "public function export()\n {\n\n\n ini_set('memory_limit', '-1');\n ini_set('max_execution_time', 0);\n\n $user_id = Session::get(\"ID\");\n\n $data_api = $this->call_api_by_parameter(\"webGetCustomer\", [\"UserID\" => $user_id]);\n\n $cus_list = array();\n $cus_list[] = ['ID', 'Customer Name', 'Group', 'Status'];\n if ($data_api == false) {\n return redirect('/admin')->withErrors(\"You are losing your connection.\");\n } else {\n $data_json = json_decode($data_api);\n $i = 1;\n if ($data_json->id) {\n foreach ($data_json->data as $row) {\n $status = \"Active\";\n if ($row->Status == 0) {\n $status = \"Inactive\";\n }\n\n $cus_list[] = array($row->CustomerID, $row->CustomerName, $row->Name, $status);\n $i++;\n }\n }\n // Convert each member of the returned collection into an array,\n // and append it to the payments array.\n return \\Excel::create('Customer List', function ($excel) use ($cus_list, $i) {\n\n $excel->sheet('sheet name', function ($sheet) use ($cus_list, $i) {\n\n\n $sheet->cells('A1:D1', function ($cells) {\n\n $cells->setAlignment('center');\n $cells->setFontWeight(\"bold\");\n $cells->setFontColor('#000000');\n $cells->setFontSize('12');\n });\n\n $sheet->fromArray($cus_list, null, 'A1', false, false);\n });\n })->download('xlsx');\n }\n }", "public function customerExcelExportlist()\n\t{\n\t\t$sortArr = array('field' => 'id', 'type' => 'desc');\n\t\t$rep_code = ltrim($this->session->userdata('fc_session_admin_rep_code'), '0');\n\t\tif ($rep_code != '') {\n\t\t\t$condition = ' and u.rep_code=\"' . $rep_code . '\"';\n\t\t} else {\n\t\t\t$condition = '';\n\t\t}\n\t\t$UserDetails = $this->order_model->view_host_detailsexcel($condition);\n\t\t$data['getCustomerDetails'] = $UserDetails->result_array();\n\t\t$data['admin_currency_symbol'] = $this->data['admin_currency_symbol'];\n\t\t$data['admin_currency_code'] = $this->data['admin_currency_code'];\n\t\t$this->load->view('admin/order/hostExportExcel', $data);\n\t}", "public function export()\n {\n return Excel::download(new ClientsExport, 'companies-' . date('Y-m-d H:i:s') . '.' . request('format', 'xlsx'));\n }", "public function sales_report_export_xls() {\n\n //Read page parameter to display report\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $sales_exec = $this->input->get('sales_exec');\n $start_date = $this->input->get('start');\n $end_date = $this->input->get('end');\n \n\n $tabledata = $this->reportsModel->get_sales_report_data_xls($tenant_id, $start_date, $end_date, $sales_exec);\n $this->load->helper('export_helper');\n \n export_sales_report_xls($tabledata);\n }", "public function exportExcel()\n {\n /** Fuente de Datos Eloquent */\n $data = User::all();\n\n /** Creamos nuestro archivo Excel */\n Excel::create('usuarios', function ($excel) use ($data) {\n\n /** Creamos una hoja */\n $excel->sheet('Hoja Uno', function ($sheet) use ($data) {\n /**\n * Insertamos los datos en la hoja con el método with/fromArray\n * Parametros: (\n * Datos,\n * Valores del encabezado de la columna,\n * Celda de Inicio,\n * Comparación estricta de los valores del encabezado\n * Impresión de los encabezados\n * )*/\n $sheet->with($data, null, 'A1', false, false);\n });\n\n /** Descargamos nuestro archivo pasandole la extensión deseada (xls, xlsx) */\n })->download('xlsx');///** Descarga del documento en csv ->download('csv');\n }", "public function export() \n {\n return Excel::download(new EmployesListe, 'employe.xlsx');\n }", "public function export_excel()\n {\n return (new SiswaExport)->download('StudentList.xlsx');\n }", "public function export_csv()\n {\n return Excel::download(new UsersExport, 'user.xlsx');\n }", "public function exportXLS()\n {\n $contact = Contact::all();\n Excel::create('List Contact', function($excel) use ($contact) {\n\n $excel->sheet('List Contact', function($sheet) use ($contact) {\n\n $sheet->fromArray($contact);\n\n });\n\n })->export('xlsx');\n }", "public function export()\n {\n return Excel::download(new UsersExport, 'users.xlsx');\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}", "public function export_returns_report(){\n $sales_report = DB::table('returns')\n ->select('*')\n ->get();\n\n $sales_array[] = array('Invoice ID','Customer Name','Total', 'Discount','Sales Date');\n\n foreach ($sales_report as $item) {\n $customer_details = unserialize($item->customer_details);\n\n $sales_array[] = array(\n 'Invoice ID' => $item->inventory_id,\n 'Customer Name' => $customer_details['customer_name'],\n 'Total' => $item->total,\n 'Return Charge' => $item->return_charge,\n 'Sales Date' => date('d M Y', strtotime($item->created_at))\n );\n\n }\n //create excel\n Excel::create('Returns Report', function($excel) use($sales_array) {\n $excel->sheet('Returns Report', function($sheet) use($sales_array) {\n $sheet->fromArray($sales_array);\n });\n })->download('xls');\n\n }", "abstract function exportData();", "public function export_excel()\n\t{\n\t$data = array(\n array ('Name', 'Surname'),\n array('Schwarz', 'Oliver'),\n array('Test', 'Peter')\n );\n\t\t\n\t\t//$data = $this->db->get('test')->result_array();\n\t\t$this->load->library('Excel-Generation/excel_xml');\n\t\t$this->excel_xml->addArray($data);\n\t\t$this->excel_xml->generateXML('my-test');\n\t}", "public function export()\n\t{\n\t\t$countries = Country::withTrashed()->get();\n\t\t$csvArray = [];\n\t\t$count = 0;\n\n\t\tforeach($countries as $country) {\n\t\t\t$countryArray = [\n\t\t\t\t'#' => ++$count,\n\t\t\t\t'Country Name' => $country->country_name,\n\t\t\t\t'Created At' => $country['created_at']->toDateTimeString(),\n\t\t\t\t'Updated At' => $country['updated_at']->toDateTimeString()\n\t\t\t];\n\n\t\t\tif($country->isDeleted()) {\n\t\t\t\t$countryArray['Deleted At'] = $country['deleted_at']->toDateTimeString();\n\t\t\t}\n\n\t\t\tarray_push($csvArray, $countryArray);\n\t\t}\n\n\t\tExcel::create('List of Church associated countries', function($excel) use($csvArray) {\n\n\t\t\t// Set the title\n\t\t $excel->setTitle('Church associated countries');\n\n\t\t // Chain the setters\n\t\t $excel->setCreator('Charisse May Dalida')\n\t\t ->setCompany('Crist Lopez');\n\n\t\t\t$excel->sheet('Records', function($sheet) use($csvArray) {\n\n\t\t\t\t$sheet->with($csvArray);\n\t\t\t\t$sheet->setAutoFilter(); // Auto filter for entire sheet\n\t\t\t\t$sheet->freezeFirstRow();\n\t\t\t\t$sheet->row(1, function($row) {// Set black background\n\n\t\t\t\t // call cell manipulation methods\n\t\t\t\t $row->setFontWeight('bold');\n\n\t\t\t\t});\n\n\t\t\t});\n\t\t})->export('xls');\n\t}", "public function export() \n \t\t{\n \t\t$data = $this->model_patient->export();\n \t\t#load PHPExcel library\n \t\t$this->excel->setActiveSheetIndex(0);\n \t\t#name the worksheet\n \t\t$this->excel->getActiveSheet()->setTitle('Data Pasien SN Health Center');\n \n \t\t#STYLING\n \t\t$styleArray = array('borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN,'color' => array('argb' => '0000'))));\n \n \t\t#set report header\n \t\t$this->excel->getActiveSheet()->getStyle('A:K')->getFont()->setName('Times New Roman');\n \t\t$this->excel->getActiveSheet()->mergeCells('A1:K1');\n \t\t$this->excel->getActiveSheet()->setCellValue('A1', 'DAFTAR PASIEN APLIKASI SN HEALTH CENTER');\n \t\t$this->excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t$this->excel->getActiveSheet()->getStyle('A1')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t$this->excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);\n \t\t$this->excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(12);\n \n \n \t\t//set column name\n \t\t$this->excel->getActiveSheet()->setCellValue('A2', 'No');\n \t\t$this->excel->getActiveSheet()->setCellValue('B2', 'Nomor Registrasi');\n \t\t$this->excel->getActiveSheet()->setCellValue('C2', 'Nomor KTP');\n \t\t$this->excel->getActiveSheet()->setCellValue('D2', 'Nama');\n \t\t$this->excel->getActiveSheet()->setCellValue('E2', 'Jenis Kelamin');\n \t\t$this->excel->getActiveSheet()->setCellValue('F2', 'Tanggal Lahir');\n \t\t$this->excel->getActiveSheet()->setCellValue('G2', 'Agama');\n \t\t$this->excel->getActiveSheet()->setCellValue('H2', 'Pekerjaan');\n \t\t$this->excel->getActiveSheet()->setCellValue('I2', 'Nomor HP');\n \t\t$this->excel->getActiveSheet()->setCellValue('J2', 'Alamat');\n \t\t$this->excel->getActiveSheet()->setCellValue('K2', 'Tanggal & Waktu Registrasi');\n \n\t\t\t $this->excel->getActiveSheet()->getStyle('A2:K2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('A')->setWidth(4);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('B')->setWidth(30);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('C')->setWidth(25);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('D')->setWidth(30);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('E')->setWidth(15);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('F')->setWidth(15);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('G')->setWidth(15);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('H')->setWidth(15);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('I')->setWidth(15);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('J')->setWidth(40);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('K')->setWidth(25);\n \n \t\t$no = 3;\n \t\t$nomor = 1;\n \t\tforeach ($data as $v) \n \t\t{\n \t\t\t\n \t\t\t$this->excel->getActiveSheet()->getStyle('A' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('A' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('A' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->setCellValue('A' . $no, $nomor);\n\n \t\t\t$this->excel->getActiveSheet()->getStyle('B' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('B' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('B' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->setCellValue('B' . $no, $v->patient_noregis);\n\n \t\t\t$this->excel->getActiveSheet()->getStyle('C' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('C' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('C' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->setCellValue('C' . $no, strval($v->patient_noktp));\n\n \t\t\t$this->excel->getActiveSheet()->getStyle('D' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('D' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('D' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('D' . $no, $v->patient_name);\n\t\t\t\t \n \t\t\t$this->excel->getActiveSheet()->getStyle('E' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('E' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('E' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('E' . $no, $v->patient_sex);\n\t\t\t\t \n \t\t\t$this->excel->getActiveSheet()->getStyle('F' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('F' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('F' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('F' . $no, $v->patient_datebirth);\n\n \t\t\t$this->excel->getActiveSheet()->getStyle('G' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('G' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('G' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('G' . $no, $v->patient_religion);\n\t\t\t\t \n \t\t\t$this->excel->getActiveSheet()->getStyle('H' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('H' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('H' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('H' . $no, $v->patient_job);\n\t\t\t\t \n \t\t\t$this->excel->getActiveSheet()->getStyle('I' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('I' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('I' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('I' . $no, $v->patient_phone);\n\t\t\t\t \n\t\t\t\t$this->excel->getActiveSheet()->getStyle('J' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('J' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('J' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t\t\t$this->excel->getActiveSheet()->setCellValue('J' . $no, $v->patient_address);\n\t\t\t\t\t\t\n\t\t\t\t$this->excel->getActiveSheet()->getStyle('K' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('K' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('K' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->setCellValue('K' . $no, $v->patient_registerdate);\n\t\t\t\t\n\t\t\t\t$no++;\n \t\t\t$nomor++;\n \t\t}\n \n \t\t$this->excel->getActiveSheet()->getStyle('A2:K' . ($no - 1))->applyFromArray($styleArray);\n \t\tob_end_clean();\n \t\t$filename = 'Daftar Pasien Aplikasi SN Health Center.xls'; //save our workbook as this file name\n \t\theader('Content-Type: application/vnd.ms-excel'); //mime type\n \t\theader('Content-Disposition: attachment;filename=\"' . $filename . '\"'); //tell browser what's the file name\n \t\theader('Cache-Control: max-age=0'); //no cache\n \t\t$objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5');\n \t\t$objWriter->save('php://output');\n \n \t\tredirect('admin/patient');\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}", "public function exportCsvAction()\n {\n $fileName = 'customers.csv';\n $content = $this->getLayout()->createBlock('adminhtml/customer_grid')\n ->getCsvFile();\n\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportExcelAction()\n {\n $fileName = 'equipment.xls';\n $content = $this->getLayout()->createBlock('bs_logistics/adminhtml_equipment_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportExcelAction()\n {\n $fileName = 'curriculumdoc.xls';\n $content = $this->getLayout()->createBlock('bs_curriculumdoc/adminhtml_curriculumdoc_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "private function _downloadApplyExcel($dataProvider) {\r\n $objPHPExcel = new \\PHPExcel();\r\n \r\n // Set document properties\r\n $objPHPExcel->getProperties()\r\n ->setCreator(\"wuliu.youjian8.com\")\r\n ->setLastModifiedBy(\"wuliu.youjian8.com\")\r\n ->setTitle(\"youjian logistics order\")\r\n ->setSubject(\"youjian logistics order\")\r\n ->setDescription(\"youjian logistics order\")\r\n ->setKeywords(\"youjian logistics order\")\r\n ->setCategory(\"youjian logistics order\");\r\n $datas = $dataProvider->query->all();\r\n if ($datas) {\r\n $objPHPExcel->setActiveSheetIndex(0)\r\n ->setCellValue('A1', '申请人')\r\n ->setCellValue('B1', '开户行')\r\n ->setCellValue('C1', '状态')\r\n ->setCellValue('D1', '申请时间')\r\n ->setCellValue('E1', '会员号')\r\n ->setCellValue('F1', '开户名')\r\n ->setCellValue('G1', '银行卡号')\r\n ->setCellValue('H1', '银行')\r\n ->setCellValue('I1', '金额')\r\n ->setCellValue('J1', '付款时间')\r\n ->setCellValue('K1', '付款人');\r\n $i = 2;\r\n $objPHPExcel->setActiveSheetIndex(0)->getStyle('E')->getNumberFormat()->setFormatCode(\\PHPExcel_Style_NumberFormat::FORMAT_TEXT);\r\n $objPHPExcel->setActiveSheetIndex(0)->getStyle('G')->getNumberFormat()->setFormatCode(\\PHPExcel_Style_NumberFormat::FORMAT_TEXT);\r\n $objPHPExcel->setActiveSheetIndex(0)->getStyle('I')->getNumberFormat()->setFormatCode(\\PHPExcel_Style_NumberFormat::FORMAT_TEXT);\r\n foreach ($datas as $model) {\r\n // Add some data\r\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A'.$i, ArrayHelper::getValue($model, 'userTrueName.user_truename'));\r\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$i, ArrayHelper::getValue($model, 'bankInfo.bank_info_bank_address'));\r\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('C'.$i, $model->getStatusName());\r\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('D'.$i, date('Y-m-d H:i', $model->add_time));\r\n $objPHPExcel->setActiveSheetIndex(0)->setCellValueExplicit('E'.$i, ''.ArrayHelper::getValue($model, 'userTrueName.username'));\r\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('F'.$i, ArrayHelper::getValue($model, 'bankInfo.bank_info_account_name'));\r\n $objPHPExcel->setActiveSheetIndex(0)->setCellValueExplicit('G'.$i, ''.ArrayHelper::getValue($model, 'bankInfo.bank_info_card_no'));\r\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('H'.$i, ArrayHelper::getValue($model, 'bankInfo.bank_info_bank_name'));\r\n $objPHPExcel->setActiveSheetIndex(0)->setCellValueExplicit('I'.$i, ''.$model->amount);\r\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('J'.$i, $model->pay_time?date('Y-m-d H:i', $model->pay_time):'');\r\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('K'.$i, $model->pay_user_id?ArrayHelper::getValue($model, 'adminUserName.username'):'');\r\n $i++;\r\n }\r\n }\r\n \r\n // Rename worksheet\r\n $objPHPExcel->getActiveSheet()->setTitle('提现记录');\r\n \r\n \r\n // Set active sheet index to the first sheet, so Excel opens this as the first sheet\r\n $objPHPExcel->setActiveSheetIndex(0);\r\n \r\n \r\n // Redirect output to a client’s web browser (Excel5)\r\n header('Content-Type: application/vnd.ms-excel');\r\n header('Content-Disposition: attachment;filename=\"提现记录.xls\"');\r\n header('Cache-Control: max-age=0');\r\n // If you're serving to IE 9, then the following may be needed\r\n header('Cache-Control: max-age=1');\r\n \r\n // If you're serving to IE over SSL, then the following may be needed\r\n header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\r\n header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified\r\n header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1\r\n header ('Pragma: public'); // HTTP/1.0\r\n \r\n $objWriter = \\PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\r\n $objWriter->save('php://output');\r\n exit;\r\n }", "public function exportXmlAction()\n {\n $fileName = 'customers.xml';\n $content = $this->getLayout()->createBlock('adminhtml/customer_grid')\n ->getExcelFile();\n\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function export()\n\t\t {\n\t\t\t return Excel::download(new UsersExport, 'users.xlsx');\n\t\t }", "function perform_export()\n {\n global $CFG;\n require_once($CFG->dirroot.'/blocks/bcgt/lib.php');\n global $CFG, $USER;\n $name = preg_replace(\"/[^a-z 0-9]/i\", \"\", $this->get_name());\n \n ob_clean();\n header(\"Pragma: public\");\n header('Content-Type: application/vnd.ms-excel; charset=utf-8');\n header('Content-Disposition: attachment; filename=\"'.$name.'.xlsx\"'); \n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Cache-Control: private\", false);\n\n require_once $CFG->dirroot . '/blocks/bcgt/lib/PHPExcel/Classes/PHPExcel.php';\n \n $objPHPExcel = new \\PHPExcel();\n $objPHPExcel->getProperties()\n ->setCreator(fullname($USER))\n ->setLastModifiedBy(fullname($USER))\n ->setTitle($this->get_name())\n ->setSubject($this->get_name())\n ->setDescription($this->get_description());\n\n // Remove default sheet\n $objPHPExcel->removeSheetByIndex(0);\n \n $sheetIndex = 0;\n \n // Set current sheet\n $objPHPExcel->createSheet($sheetIndex);\n $objPHPExcel->setActiveSheetIndex($sheetIndex);\n $objPHPExcel->getActiveSheet()->setTitle(\"Report\");\n \n $rowNum = 1;\n\n // Headers\n if(isset($this->header))\n {\n if(!$this->has_split_header())\n {\n $col = 0;\n foreach($this->header AS $head)\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $head);\n $col++;\n }\n $rowNum++;\n }\n else\n {\n //foreach row\n foreach($this->header AS $row)\n {\n $col = 0;\n foreach($row AS $rowObj)\n {\n $columnCount = $rowObj->colCount;\n $columnContent = $rowObj->content;\n //add all the cells, \n //thenmerge\n $startCol = $col;\n for($i=0;$i<$columnCount;$i++)\n {\n if($i == 0)\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $columnContent);\n }\n else\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, '');\n }\n $col++;\n }\n $endCol = $col;\n if($columnCount != 1)\n {\n $objPHPExcel->getActiveSheet()->mergeCells(''.PHPExcel_Cell::stringFromColumnIndex($startCol).\n ''.$rowNum.':'.PHPExcel_Cell::stringFromColumnIndex($endCol - 1).''.$rowNum);\n }\n \n \n }\n $rowNum++;\n }\n } \n \n }\n //data\n if(isset($this->data))\n {\n foreach($this->data AS $data)\n {\n $col = 0;\n foreach($data AS $cell)\n { \n if(is_a($cell, 'stdClass'))\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $this->build_excell_cell($cell));\n $objPHPExcel->getActiveSheet()->getStyle(''.PHPExcel_Cell::stringFromColumnIndex($col).''.$rowNum)->applyFromArray(\n array(\n 'fill' => array(\n 'type' => PHPExcel_Style_Fill::FILL_SOLID,\n 'color' => $this->get_excell_cell_color($cell)\n ),\n 'borders' => array(\n 'outline' => array(\n 'style' => PHPExcel_Style_Border::BORDER_THIN,\n 'color' => array('rgb'=>'cfcfcf')\n )\n )\n )\n ); \n if(isset($cell->colspan) && $cell->colspan > 1)\n {\n $objPHPExcel->getActiveSheet()->mergeCells(''.PHPExcel_Cell::stringFromColumnIndex($col).\n ''.$rowNum.':'.PHPExcel_Cell::stringFromColumnIndex($col + ($cell->colspan - 1)).''.$rowNum);\n \n $col = $col + ($cell->colspan - 1);\n }\n }\n else\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $cell);\n }\n \n $col++;\n } \n $rowNum++;\n }\n }\n \n // Freeze rows and cols (everything to the left of D and above 2)\n $objPHPExcel->getActiveSheet()->freezePane($this->get_frozen_panes());\n \n // End\n $objPHPExcel->setActiveSheetIndex(0);\n $objWriter = \\PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\n ob_clean();\n $objWriter->save('php://output');\n \n exit;\n }", "public function exportData(): void\n\t{\n\t\t$entries = [];\n\t\tif (!$this->exportColumns && $this->quickExport && $this->queryOptions['viewname']) {\n\t\t\t[$headers, $entries] = $this->getEntriesForQuickExport();\n\t\t} else {\n\t\t\t[$headers, $entries] = $this->getEntriesExport();\n\t\t}\n\t\t$this->output($headers, $entries);\n\t}", "public function exportExcelAction()\n {\n $fileName = 'ifeedback.xls';\n $content = $this->getLayout()->createBlock('bs_kst/adminhtml_ifeedback_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportExcelAction()\n {\n $fileName = 'kstitem.xls';\n $content = $this->getLayout()->createBlock('bs_kst/adminhtml_kstitem_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function sales_export_xls() {\n $tenant_id = $this->tenant_id;\n foreach ($this->reportsModel->get_sales_executive($tenant_id)->result() as $item) {\n $executive[$item->user_id] = $item->user_name;\n }\n\n $sales_exec = $this->input->get('sales_exec');\n\n $non_sales_exec = $this->input->get('non_sales_exec');\n if (!empty($sales_exec)) {\n $sales_exec = $sales_exec;\n } else if (!empty($non_sales_exec)) {\n $sales_exec = $non_sales_exec;\n }\n\n\n $sales_comm_result = $this->reportsModel->get_sales_comm('excel', $tenant_id, $records_per_page, $offset, $field, $order_by, $sales_exec);\n $comm_due_periods = $this->reportsModel->get_comm_due_period($tenant_id, $sales_exec);\n $year_arr = array(1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr',\n 5 => 'May', 6 =>\n 'Jun', 7 => 'Jul', 8 => 'Aug', 9 => 'Sep',\n 10 => 'Oct', 11 => 'Nov', 12 => 'Dec');\n $periods = array();\n foreach ($comm_due_periods as $val) {\n $periods[$val->sales_exec_id] .= $year_arr[$val->comm_period_mth] . ' ' . $val->comm_period_yr . \", \";\n }\n $this->load->helper('export_helper');\n $excel_titles = array('Sales Executive', 'Total Comm.', 'Total Recd.', 'Total Due', 'Due Period');\n $excel_data = array();\n $i = 0;\n foreach ($sales_comm_result as $k => $row) {\n $total = number_format($row->comm_due_amount, 2, '.', '');\n $paid = number_format($row->comm_paid_amount, 2, '.', '');\n $due = number_format($total - $paid, 2, '.', '');\n $excel_data[$i][] = $row->first_name . \" \" . $row->last_name;\n $excel_data[$i][] = '$ ' . $total . ' SGD';\n $excel_data[$i][] = '$ ' . $paid . ' SGD';\n $excel_data[$i][] = '$ ' . $due . ' SGD';\n $excel_data[$i][] = rtrim($periods[$row->sales_exec_id], \", \");\n $i++;\n }\n $excel_filename = 'sales.xls';\n $excel_sheetname = 'Sales';\n $excel_main_heading = 'Sales Commission report for ' . date('F d Y, l');\n if ($sales_exec != '') {\n $excel_main_heading .= \" '\" . $executive[$sales_exec] . \"'\";\n }\n export_page_fields($excel_titles, $excel_data, $excel_filename, $excel_sheetname, $excel_main_heading);\n }", "public function payments_export_xls() {\n ini_set('memory_limit', '-1');\n $tenant_id = $this->tenant_id;\n $company = $this->input->get('company');\n $companies = $this->classTraineeModel->get_company_for_paidinvoice($tenant_id);\n $company_arr = array();\n foreach ($companies as $row) {\n $company_arr[$row->company_id] = $row->company_name;\n }\n $invoice_id = $this->input->get('invoice_id');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'ei.invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $tabledata = $this->reportsModel->get_payment_recd($records_per_page, $offset, $field, $order_by, $company, $invoice_id, $start_date, $end_date);\n\n $tabledata_count = count($tabledata);\n $pids = array();\n for ($i = 0; $i < $tabledata_count; $i++) {\n $pids[] = $tabledata[$i]->pymnt_due_id;\n }\n $tb_extra = $this->reportsModel->get_payment_recd_trainee_company($pids);\n $tabledataextra = array();\n for ($i = 0; $i < count($tb_extra); $i++) {\n $tabledataextra[$tb_extra[$i]->pymnt_due_id] = $tb_extra[$i];\n }\n $this->load->helper('export_helper');\n $count_tabledata = count($tabledata);\n $excel_titles = array('Inv #', 'Inv Dt.', 'Inv Amt.', 'Recd. On', 'Amt. Recd.', 'Course - Class', 'Name', 'Taxcode');\n $excel_data = array();\n for ($i = 0; $i < $count_tabledata; $i++) {\n $k = $tabledata[$i]->pymnt_due_id;\n if ($tabledata[$i]->inv_type == 'INVINDV') {\n $taxcode = $tabledataextra[$k]->tax_code;\n $name = $tabledataextra[$k]->first_name . ' ' . $tabledataextra[$k]->last_name;\n } else {\n if ($tabledata[$i]->company_id[0] == 'T') {\n $tenant_details = fetch_tenant_details($tabledata[$i]->company_id);\n $name = $tenant_details->tenant_name . ' (Company)';\n $taxcode = $tenant_details->tenant_name;\n } else {\n $taxcode = $tabledataextra[$k]->comp_regist_num;\n $name = $tabledataextra[$k]->company_name . ' (Company)';\n }\n }\n $excel_data[$i][] = $tabledata[$i]->invoice_id;\n $excel_data[$i][] = date('d/m/Y', strtotime($tabledata[$i]->inv_date));\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_inv_amount, 2, '.', '');\n $excel_data[$i][] = date('d/m/Y', strtotime($tabledata[$i]->recd_on));\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->amount_recd, 2, '.', '');\n $excel_data[$i][] = $tabledataextra[$k]->crse_name . ' - ' . $tabledataextra[$k]->class_name;\n $excel_data[$i][] = $name;\n $excel_data[$i][] = $this->mask_format($taxcode);\n }\n if (!empty($tabledata)) {\n if (empty($start_date) && empty($end_date)) {\n $period = ' for ' . date('F d Y, l');\n } else {\n $period = 'for the period';\n if (!empty($start_date))\n $period .= ' from ' . date('F d Y', DateTime::createFromFormat('d-m-Y', $start_date)->getTimestamp());\n if (!empty($end_date))\n $period .= ' to ' . date('F d Y', DateTime::createFromFormat('d-m-Y', $end_date)->getTimestamp());\n }\n if (!empty($company)) {\n $period .= ' \\'' . $company_arr[$company] . '\\'';\n }\n if (!empty($invoice_id)) {\n $period .= ' - \\' Invoice No.: ' . $invoice_id . '\\'';\n }\n }\n $excel_filename = 'payments_received.xls';\n $excel_sheetname = 'Payments Received';\n $excel_main_heading = 'Accounting Reports - Payments Received' . $period;\n\n export_page_fields($excel_titles, $excel_data, $excel_filename, $excel_sheetname, $excel_main_heading);\n }", "function export_csv()\n {\n $filter_custom_fields = JRequest::getVar('filter_custom_fields');\n $a_custom_fields = $this->_build_a_custom_fields($filter_custom_fields);\n $data = array();\n $k=0;\n for($i=0; $i<count($a_custom_fields);$i++ )\n {\n $custom_field = $a_custom_fields[$i];\n $query = &$this->_buils_export_query($custom_field);\n $this->_db->setQuery((string)$query);\n $rows = $this->_db->loadAssocList();\n foreach ($rows as $row)\n {\n $data[$k]['virtuemart_custom_id'] = $row['virtuemart_custom_id'];\n $data[$k]['virtuemart_product_id'] = $row['virtuemart_product_id'];\n $data[$k]['product_name'] = iconv(\"utf-8\", \"windows-1251\",$row['product_name']);\n $data[$k]['intvalue'] = iconv(\"utf-8\", \"windows-1251\",str_replace('.', ',', $row['intvalue']));\n $data[$k]['custom_title'] = iconv(\"utf-8\", \"windows-1251\",$row['custom_title']);\n $k++;\n }\n }\n $name = 'com_condpower.csv';\n $path = JPATH_ROOT.DS.'tmp'.DS.$name;\n if ($fp = fopen($path, \"w+\"))\n {\n foreach ($data as $fields) {\n fputcsv($fp, $fields, ';', '\"');\n }\n fclose($fp);\n }\n else\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_OPEN_TO_EXPORT'));\n }\n// $href = str_replace('administrator/', '', JURI::base()).'tmp/'.$name;\n// $href = JURI::base().'components/com_condpower/download.php?path='.$path;\n return array(TRUE,'OK');\n\n }", "function excel_export($template = 0) {\n $data = $this->tour->get_tours()->result_object();\n $this->load->helper('report');\n $rows = array();\n $row = array(lang('tour_tour_id'), lang('tour_tour_name'), lang('tour_action_name_key'), lang('tour_sort'), lang('tour_deleted'));\n\n $n = 1;\n $rows[] = $row;\n foreach ($data as $r) {\n $row = array(\n $n ++,\n $r->tour_name,\n $r->action_name_key,\n $r->sort,\n $r->deleted,\n );\n $rows[] = $row;\n }\n\n $content = array_to_csv($rows);\n\n if ($template) {\n force_download('tours_export_mass_update.csv', $content);\n } else {\n force_download('tours_export.csv', $content);\n }\n exit;\n }", "public function export(){\n header(\"Content-type: application/vnd-ms-excel\");\n header(\"Content-Disposition: attachment; filename=Data_Card.xls\");\n \n $data['card'] = $this->Card_model->get_all_card();\n $this->load->view('card/export', $data);\n }", "public function exportExcelAction(){\r\n $fileName = 'siege.xls';\r\n $content = $this->getLayout()->createBlock('reseauchx_reservationreseau/adminhtml_siege_grid')->getExcelFile();\r\n $this->_prepareDownloadResponse($fileName, $content);\r\n }", "function export(){\n\n $this->load->model(\"MBenang\");\n\n $this->load->library(\"excel\");\n\n $object = new PHPExcel();\n\n $object->setActiveSheetIndex(0);\n\n // Nama Field Baris Pertama\n $table_columns = $this->MBenang->getColoumnName();\n\n $column = 0;\n\n $object->getActiveSheet()->setCellValueByColumnAndRow($column, 1, 'Data Master Benang');\n\n $object->getActiveSheet()->setTitle('Data Master Benang');\n\n foreach($table_columns as $field){\n\n\n $object->getActiveSheet()->setCellValueByColumnAndRow($column, 2, $field);\n\n $object->getActiveSheet()->getColumnDimension()->setAutoSize(true);\n\n $object->getSheet(0)->getStyle('A3:C3')->getBorders()->getAllBorders()->getColor()->setRGB('949FA8');\n\n $column++;\n\n }\n\n $benang_data = $this->MBenang->fetch_data();\n\n $excel_row = 3;\n\n foreach($benang_data as $row){\n\n $object->getActiveSheet()->setCellValueByColumnAndRow(0, $excel_row, $row->kd_jenis);\n\n $object->getActiveSheet()->setCellValueByColumnAndRow(1, $excel_row, $row->jenis_benang);\n\n $excel_row++;\n\n }\n\n $object_writer = PHPExcel_IOFactory::createWriter($object, 'Excel2007');\n\n header('Content-Type: application/vnd.ms-excel');\n\n header('Content-Disposition: attachment;filename=\"Data-master-benang.xls\"');\n\n $object_writer->save('php://output');\n\n }", "public function exportExcelAction()\n {\n $fileName = 'appointments.xml';\n $grid = $this->getLayout()->createBlock('appointments/adminhtml_appointments_grid');\n $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n }", "public function exportExcelAction()\n {\n $fileName = 'coursedoc.xls';\n $content = $this->getLayout()->createBlock('bs_coursedoc/adminhtml_coursedoc_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function actionExport()\n {\n // export data to excel file\n return $this->render('export');\n }", "public function export() { \n\t\t$type = $this->uri->segment ( 4 );\n\n\t\t$uri_array = $this->uri->uri_to_assoc ( 3, array (\n\t\t\t\t'export' \n\t\t) );\n\n\t\t// Export selected data\n\t\tif (($uri_array ['export'] == 'csv') || ($uri_array ['export'] == 'xls') && $type == \"user\") {\n\t\t\t$this->export_user ( $uri_array, $uri_array ['export'] );\n\t\t}\n\t\t\n\t}", "public function excel()\n {\n Excel::create('ReporteExcel', function($excel) {\n $excel->sheet('EdadGenero', function($sheet) {\n $usersinfo = User::select(DB::raw(\"users.cc as Cedula_Ciudadania, users.lastname as Apellidos, users.name as Nombres, users.email as Email, users.cellphone as Celular, users.department as DepartamentoNac, users.city as CiudadNac, users.created_at as FechaRegistro\"))->get();\n $sheet->fromArray($usersinfo);\n });\n })->export('xls');\n\n }", "public function export(){\n \n // Skrip berikut ini adalah skrip yang bertugas untuk meng-export data tadi ke excel\n header(\"Content-type: application/vnd-ms-excel\");\n header(\"Content-Disposition: attachment; filename=Data_Transaksi.xls\");\n \n $data['header_transaksi'] = $this->header_transaksi_model->listing();\n $this->load->view('admin/export/vw_laporan_excel', $data);\n\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 exportCouponsExcelAction()\n {\n $fileName = 'coupons.xml';\n $grid = $this->getLayout()->createBlock('adminhtml/report_sales_coupons_grid');\n $this->_initReportAction($grid);\n $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n }", "public function export()\r\n {\r\n $file_name = 'Leave_details_' . date('d-m-Y') . '.csv';\r\n // print_r($file_name);exit;\r\n header(\"Content-Description: File Transfer\");\r\n header(\"Content-Disposition: attachment; filename=$file_name\");\r\n header(\"Content-Type: application/csv;\");\r\n\r\n\r\n // get data \r\n $data = $this->model->getcsvData();\r\n // print_r($data['exportData']);exit;\r\n\r\n // file creation \r\n $file = fopen('php://output', 'w');\r\n\r\n\r\n // $header = array(\"Department id\",\"Department name\", \"description\",\"status\");\r\n // print_r($header);exit;\r\n // fputcsv($file, $header);\r\n foreach ($data as $value) {\r\n $csv = fputcsv($file, $value);\r\n }\r\n // $csv->move(WRITEPATH.'uploads');\r\n fclose($file);\r\n exit;\r\n }", "public function exportCsvAction()\n {\n $fileName = 'supplier.csv';\n $content = $this->getLayout()->createBlock('dropship360/adminhtml_logicbroker_grid')->getCsvFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportSalesCsvAction()\n {\n $fileName = 'sales.csv';\n $grid = $this->getLayout()->createBlock('adminhtml/report_sales_sales_grid');\n $this->_initReportAction($grid);\n $this->_prepareDownloadResponse($fileName, $grid->getCsvFile());\n }", "public function export_data_anggota_keluarga()\n {\n $spreadsheet = new Spreadsheet();\n $currentData = $this->AnggotaKeluargaModel->findAll();\n // tulis header/nama kolom \n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A1', 'No. KK')\n ->setCellValue('B1', 'No. KTP')\n ->setCellValue('C1', 'Nama')\n ->setCellValue('D1', 'Tempat Lahir')\n ->setCellValue('E1', 'Tanggal Lahir')\n ->setCellValue('F1', 'Jenis Kelamin')\n ->setCellValue('G1', 'Status Perkawinan')\n ->setCellValue('H1', 'Pendidikan')\n ->setCellValue('I1', 'Pekerjaan')\n ->setCellValue('J1', 'Catatan');\n\n $column = 2;\n // tulis data mobil ke cell\n foreach ($currentData as $data) {\n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A' . $column, $data['noKK'])\n ->setCellValue('B' . $column, $data['noKTP'])\n ->setCellValue('C' . $column, $data['nama'])\n ->setCellValue('D' . $column, $data['tempatLahir'])\n ->setCellValue('E' . $column, $data['tanggalLahir'])\n ->setCellValue('F' . $column, $data['jenisKelamin'])\n ->setCellValue('G' . $column, $data['statusPerkawinan'])\n ->setCellValue('H' . $column, $data['pendidikan'])\n ->setCellValue('I' . $column, $data['pekerjaan'])\n ->setCellValue('J' . $column, $data['catatan']);\n $column++;\n }\n // tulis dalam format .xlsx\n $writer = new Xlsx($spreadsheet);\n $fileName = 'Data Anggota Keluarga';\n\n // Redirect hasil generate xlsx ke web client\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment;filename=' . $fileName . '.xlsx');\n header('Cache-Control: max-age=0');\n\n $writer->save('php://output');\n }", "public function exportExcelAction()\n {\n $fileName = 'aircraft.xls';\n $content = $this->getLayout()->createBlock('bs_misc/adminhtml_aircraft_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportToExcel(){\n\t\theader('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); \n\t\theader(\"Content-Disposition: attachment; filename = DataNilaiMataKuliah.xls\"); \n\t\t$data['data_nilai'] = $this->Database_Nilai->ambil_data(); \n\t\t$this->load->view('export', $data);\n\t}", "public function exportExcel($type);", "private function customerReport()\n {\n $invoiceModel = new InvoiceModel();\n $customersReport = $invoiceModel->getAllInvoicesAmounts();\n\n $csvData = [];\n $csvData[] = [\"Company Name\", \"Total Invoiced Amount\", \"Total Amount Paid\", \"Total Amount Outstanding\"];\n if (!empty($customersReport)) {\n foreach ($customersReport as $customerReport) {\n $csvData[] = [$customerReport[\"client\"], $customerReport[\"total_invoiced\"], $customerReport[\"total_paid\"], $customerReport[\"total_outstanding\"]];\n }\n }\n\n $this->getCsvFile($csvData, \"customer_report_\" . time() . \".csv\");\n }", "public function export() \n {\n return Excel::download(new TraineeExport, 'trainees.xlsx');\n }", "public function export_order()\n {\n return Excel::download(new OrderExport, 'orders.xlsx');\n }", "public function excelExport()\n \t {\n \n $where_str = \"1 = ?\";\n $where_params = array(1);\n if (Input::has('sSearch'))\n {\n $search = Input::get('sSearch');\n\n $where_str .= \" and ( \"\n \t\t\t. \" other_name like '%{$search}%'\"\n \t\t\t. \" or surname like '%{$search}%'\"\n \t\t\t. \" or email like '%{$search}%'\"\n \t\t\t. \")\";\n }\n\n $columns = array('surname','other_name','email','countries.country_des','agencies.acronym','is_verified');\n\n\t\t$akdn = Akdn::select($columns)\n\t\t\t\t\t\t\t\t\t->leftjoin('akdn_agencies','akdn.id','=','akdn_agencies.akdn_id')\n\t\t\t\t\t\t\t\t\t->leftjoin('agencies','agencies.id','=','akdn_agencies.agency_id')\n\t\t\t\t\t\t\t\t\t->leftjoin('akdn_nationalities','akdn.id','=','akdn_nationalities.akdn_id')\n\t\t\t\t\t\t\t\t\t->leftjoin('countries','countries.id','=','akdn_nationalities.country_id')\n\t\t \t\t\t\t\t->whereRaw($where_str, $where_params);\n\n $akdn = $akdn->get()->toArray();\n \n $objPHPExcel = new PHPExcel();\n $objPHPExcel->getProperties()->setCreator(\"ConsultantDB\")\n ->setTitle(\"ConsultantDB: Excel Export\")\n ->setSubject(\"Consultant search result export\")\n ->setDescription(\"Excel export of customized search result from consultant database\")\n ->setKeywords(\"office 2007 openxml\");\n\n $objPHPExcel->setActiveSheetIndex(0);\n $objPHPExcel->getActiveSheet()->setTitle('consultant_search_export');\n\n $header = array(\n 'surname' => 'surname',\n 'Other name' => 'other_name',\n 'Email Address' => 'email',\n 'Country'=> 'country_des',\n 'Agency'=>'acronym',\n 'Verified' => 'is_verified',\n );\n\n $objPHPExcel->getActiveSheet()->fromArray( array_keys($header), NULL, 'A1');\n $objPHPExcel->getActiveSheet()->getStyle('A1:F1')->getFont()->setBold(true);\n\n $link_style_array = [\n 'font' => [\n 'color' => ['rgb' => '0000FF'],\n 'underline' => 'single'\n ]\n ];\n $rowNumber = 2;\n $col = 'A';\n\n foreach ($akdn as $akdn_data) \n {\n $insert_data = array();\n foreach ($header as $column_name) {\n\n $insert_data[$column_name] = $akdn_data[$column_name];\n }\n\n $objPHPExcel->getActiveSheet()->fromArray($akdn_data, NULL, 'A' . $rowNumber );\n\n if($insert_data['email'] != \"\"){\n\n\t\t\t $objPHPExcel->getActiveSheet()->getCell('C' . $rowNumber)->getHyperlink()->setUrl(strip_tags(\"mailto:\".$insert_data['email']));\n\t\t\t $objPHPExcel->getActiveSheet()->getStyle('C' . $rowNumber)->applyFromArray($link_style_array);\n\t\t\t}\n\n if($insert_data['is_verified'] == 1)\n {\n\n $objPHPExcel->getActiveSheet()->setCellValue('F' . $rowNumber,'Yes');\n }\n else\n {\n $objPHPExcel->getActiveSheet()->setCellValue('F' . $rowNumber,'No');\n }\n\n $rowNumber++;\n }\n\n for($j='A'; $j<'No';$j++){\n \n $objPHPExcel->getActiveSheet()->getColumnDimension($j)->setAutoSize(true);\n }\n\n $filename = 'AkdnUser_export_' . date('d_m_Y') . '.xlsx';\n header(\"Pragma: public\");\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Content-Type: application/force-download\");\n header(\"Content-Type: application/octet-stream\");\n header(\"Content-Type: application/download\");;\n header(\"Content-Disposition: attachment;filename=$filename\");\n header(\"Content-Transfer-Encoding: binary \");\n\n $objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel); \n $objWriter->setOffice2003Compatibility(true);\n $objWriter->save('php://output');\n exit();\n }", "public function exportExcelAction()\n {\n $fileName = 'offer.xls';\n $content = $this->getLayout()->createBlock('mfb_myflyingbox/adminhtml_offer_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportExcel() \n {\n $st = ST::select(\n 'no_st',\n 'tanggal_st',\n 'tujuan_st',\n 'tipe', \n 'bidang',\n 'uraian',\n \n 'tanggal_mulai',\n 'tanggal_selesai',\n 'hp',\n 'no_laporan',\n 'tanggal_laporan',\n\n 'penanggung_jawab_id',\n 'pengendali_mutu_id',\n 'pengendali_teknis_id',\n 'ketua_tim_id', \n \n 'lokasi', \n 'biaya',\n 'km_id',\n 'costsheet_id'\n \n )->get();\n\n \n\n return Excel::create('data_tugas', function($excel) use ($st){\n $excel->sheet('st_bpkp', function($sheet) use ($st) {\n $sheet->fromArray($st);\n });\n })->download('xls');\n\n }", "public function export()\n {\n return Excel::download(new PeopleExport, 'people-' . date('Y-m-d H:i:s') . '.' . request('format', 'xlsx'));\n }", "public function invoice_list_export_xls() {\n ini_set('memory_limit', '-1');\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $payment_status = $this->input->get('payment_status');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'ei.invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $company_id = $this->input->get('company_id');\n $tabledata = $this->reportsModel->get_all_invoice($tenant_id, $records_per_page, $offset, $field, $order_by, $payment_status, $start_date, $end_date, $company_id);\n\n $tabledata_count = count($tabledata);\n for ($i = 0; $i < $tabledata_count; $i++) {\n if ($tabledata[$i]->enrolment_mode === 'COMPSPON') {\n $tabledata[$i]->payment_status = $this->reportsModel->check_not_part_paid($tabledata[$i]->pymnt_due_id);\n }\n }\n $this->load->helper('export_helper');\n $count_tabledata = count($tabledata);\n $excel_titles = array('Inv #', 'Course Dt.', 'Inv Dt.', 'Taxcode', 'Name', 'Discount', 'Subsidy', 'GST', 'Net Amt.', 'Status');\n $excel_data = array();\n for ($i = 0; $i < $count_tabledata; $i++) {\n $paid_arr = array('PAID' => 'Paid', 'PARTPAID' => 'Part Paid', 'NOTPAID' => 'Not Paid');\n $paid_sty_arr = array('PAID' => 'color:green;', 'PARTPAID' => 'color:red;', 'NOTPAID' => 'color:red;');\n if ($tabledata[$i]->enrolment_mode == 'SELF') {\n $taxcode = $this->mask_format($tabledata[$i]->tax_code);\n $name = $tabledata[$i]->first_name . ' ' . $tabledata[$i]->last_name;\n $status = $paid_arr[$tabledata[$i]->payment_status];\n } else {\n if ($tabledata[$i]->company_id[0] == 'T') {\n $tenant_details = fetch_tenant_details($tabledata[$i]->company_id);\n $taxcode = $tenant_details->tenant_name;\n $name = $tenant_details->tenant_name . ' (Company)';\n } else {\n $taxcode = $tabledata[$i]->comp_regist_num;\n $name = $tabledata[$i]->company_name . ' (Company)';\n }\n $status = ($tabledata[$i]->payment_status > 0) ? 'Part Paid/Not Paid' : 'Paid';\n }\n $excel_data[$i][] = $tabledata[$i]->invoice_id;\n $excel_data[$i][] = date('d/m/Y', strtotime($tabledata[$i]->course_date));\n $excel_data[$i][] = date('d/m/Y', strtotime($tabledata[$i]->inv_date));\n $excel_data[$i][] = $taxcode;\n $excel_data[$i][] = $name;\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_inv_discnt, 2, '.', '') . ' SGD';\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_inv_subsdy, 2, '.', '') . ' SGD';\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_gst, 2, '.', '') . ' SGD';\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_inv_amount, 2, '.', '') . ' SGD';\n $excel_data[$i][] = $status;\n }\n if (empty($start_date) && empty($end_date)) {\n $period = ' for ' . date('F d Y, l');\n } else {\n $period = 'for the period';\n if (!empty($start_date))\n $period .= ' from ' . date('F d Y', DateTime::createFromFormat('d-m-Y', $start_date)->getTimestamp());\n if (!empty($end_date))\n $period .= ' to ' . date('F d Y', DateTime::createFromFormat('d-m-Y', $end_date)->getTimestamp());\n }\n $excel_filename = 'invlice_list.xls';\n $excel_sheetname = 'Invoice List';\n $excel_main_heading = 'Accounting Reports - Invoice List & Search' . $period;\n\n export_page_fields($excel_titles, $excel_data, $excel_filename, $excel_sheetname, $excel_main_heading);\n }", "public function exportSalesExcelAction()\n {\n $fileName = 'sales.xml';\n $grid = $this->getLayout()->createBlock('adminhtml/report_sales_sales_grid');\n $this->_initReportAction($grid);\n $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n }", "public function exportExcelAction()\n {\n $fileName = 'traineecert.xls';\n $content = $this->getLayout()->createBlock('bs_traineecert/adminhtml_traineecert_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function download()\n {\n return \\Excel::download(new UsersExport, 'data_buku_yang_dipinjam.xlsx'); \n }", "public function exportExcelAction()\n {\n $fileName = 'traineedoc.xls';\n $content = $this->getLayout()->createBlock('bs_traineedoc/adminhtml_traineedoc_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function export() {\n\t\t$options['conditions'] = $this->_buildQueryString();\n\t\t$options['fields'] = [\n\t\t\t'Business.id',\n\t\t\t'Business.firm',\n\t\t\t'Business.business',\n\t\t\t'Business.phone_one',\n\t\t\t'Business.phone_two',\n\t\t\t'State.name',\n\t\t\t'City.name',\n\t\t\t'Business.address',\n\t\t\t'Taxoffice.name',\n\t\t\t'Business.afm',\n\t\t];\n\t\t$this->Business->recursive = 0;\n\t\t$data = $this->Business->find('all', $options);\n\t\t$this->Csv->export($data);\n\t}", "public function exportCustomers()\n\t{\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.ProspectExportEvent' );\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.CustomerHistoryEvent' );\n\t\t\n\t\t$pageSize = 100;\n\t\t\n\t\t$allCustomers = Yii::app()->db->createCommand()\n\t ->select('u.id, u.date_create, u.email, e.name')\n\t ->from('kalitniki_user AS u')\n\t ->join('kalitniki_user_data_extended AS e', 'u.id = e.user_id')\n\t ->group('u.id');\n\t \n\t $allCustomers = $allCustomers->queryAll();\n\t \n\t $customerCount = count( $allCustomers );\n\t $pages = ( $customerCount % $pageSize ) > 0 ? floor( $customerCount / $pageSize ) + 1 : $customerCount / $pageSize;\n\t \n\t for ( $currentPage = 0; $currentPage <= $pages - 1; $currentPage++ )\n\t {\n\t \t$dataExport = new CustomerHistoryEvent;\n\t \t\n\t \t$offset = $currentPage * $pageSize;\n\t \t$collection = array_slice( $allCustomers, $offset, $pageSize );\n\t \t\n\t \tforeach ( $collection as $customer )\n\t \t{\n\t \t\t$dataCustomer = new ProspectExportEvent;\n\t\t $dataCustomer->customer_id = $customer['id'];\n\t\t $dataCustomer->customer_first_name = $customer['name'];\n\t\t $dataCustomer->customer_last_name = \"\";\n\t\t $dataCustomer->customer_email = $customer['email'];\n\t\t $dataCustomer->customer_date_created = $customer['date_create'];\n\t\t $dataCustomer->customer_last_login_date = \"\";\n \n $dataExport->prospects[] = $dataCustomer;\n\t \t}\n\n\t \t$this->client->sendEvent( $dataExport );\n\t }\n\t}", "public function exportExcelAction()\n {\n $contenedor = $this->container;\n\n $xlsExport = $contenedor->get('xls.service_xls2007');\n\n $xlsExport->excelObj->getProperties()->setCreator(\"Proyecto Base\")\n ->setLastModifiedBy(\"Proyecto Base\")\n ->setTitle(\"Demo Excel\")\n ->setSubject(\"Demo Excel\")\n ->setDescription(\"Demo Excel\")\n ->setKeywords(\"demo excel proyecto base\")\n ->setCategory(\"demo\");\n\n $xlsExport->excelObj->setActiveSheetIndex(0)\n ->setCellValue('A2', 'Título Columna 1')\n ->setCellValue('B2', 'Título Columna 2');\n\n $xlsExport->excelObj->setActiveSheetIndex(0)\n ->setCellValue('A1', \"Este el el valor de la celda\")\n ->setCellValue('B1', \"Otro valor\");\n\n $xlsExport->excelObj->getActiveSheet()->setTitle(\"Demo\");\n\n // Set active sheet index to the first sheet, so Excel opens this as the first sheet\n $xlsExport->excelObj->setActiveSheetIndex(0);\n\n //create the response\n $response = $xlsExport->getResponse();\n $response->headers->set('Content-Type', 'text/vnd.ms-excel; charset=utf-8');\n $response->headers->set('Content-Disposition', 'attachment;filename=demo_excel.xls');\n\n // If you are using a https connection, you have to set those two headers for compatibility with IE <9\n $response->headers->set('Pragma', 'public');\n $response->headers->set('Cache-Control', 'maxage=1');\n return $response;\n }", "public function InquiryExport()\n {\n $searchModel = new RecordInquirySearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams)->query->all();\n $count = count($dataProvider);\n $objPHPExcel = new PHPExcel();\n\n $objPHPExcel->setActiveSheetIndex(0);\n $objPHPExcel->getActiveSheet()->SetCellValue('A1', 'DATE');\n $objPHPExcel->getActiveSheet()->SetCellValue('B1', 'INQUIRY ADDED');\n $objPHPExcel->getActiveSheet()->SetCellValue('C1', 'QUOTATION SENT');\n $objPHPExcel->getActiveSheet()->SetCellValue('D1', 'FOLLOWUPS TAKEN');\n $objPHPExcel->getActiveSheet()->SetCellValue('E1', 'BOOKINGS');\n $objPHPExcel->getActiveSheet()->SetCellValue('F1', 'CANCELLED INQUIRIES');\n\n for ($i = 2; $i < $count + 2; $i++) {\n $objPHPExcel->getActiveSheet()->SetCellValue('A' . $i, Yii::$app->formatter->asDate($dataProvider[$i - 2]->date));\n $objPHPExcel->getActiveSheet()->SetCellValue('B' . $i, $dataProvider[$i - 2]->new_inquiry_count);\n $objPHPExcel->getActiveSheet()->SetCellValue('C' . $i, $dataProvider[$i - 2]->quotation_count);\n $objPHPExcel->getActiveSheet()->SetCellValue('D' . $i, $dataProvider[$i - 2]->followup_count);\n $objPHPExcel->getActiveSheet()->SetCellValue('E' . $i, $dataProvider[$i - 2]->booking_count);\n $objPHPExcel->getActiveSheet()->SetCellValue('F' . $i, $dataProvider[$i - 2]->cancellation_count);\n }\n\n $objPHPExcel->getActiveSheet()->setTitle('Inquiry Report');\n\n// Redirect output to a client’s web browser (Excel5)\n $filename = \"inquiry Report\" . date('m-d-Y_his') . \".xls\";\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"' . $filename . '\"');\n header('Cache-Control: max-age=0');\n// If you're serving to IE 9, then the following may be needed\n header('Cache-Control: max-age=1');\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 $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n $objWriter->save('php://output');\n }", "public function download_category_excel_sheet() {\n $spreadsheet = new Spreadsheet();\n $sheet = $spreadsheet->getActiveSheet();\n $sheet->setCellValue('A1', 'ar_name');\n $sheet->setCellValue('B1', 'en_name');\n $sheet->setCellValue('C1', 'discount');\n\n $writer = new Xlsx($spreadsheet);\n\n $filename = 'add_category_template';\n\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"' . $filename . '.xlsx\"');\n\n $writer->save('php://output');\n }", "function csv_export() {\n\t\t$export = \"\";\n\n\t\t$record = $this->records[0];\n\t\t$export = \"ORD,5322048,\" . substr($record[\"batch_date\"],5,2) . substr($record[\"batch_date\"],8,2) . \n\t\t\t\t substr($record[\"batch_date\"],2,2) . \",,3,,,5322048,,5322048\\n\";\n\t\t\n\t\t$sequence = 0;\n\t\tforeach($this->records as $record) {\n//print_r($record);\n\t\t\t$sequence++;\n\t\t\t$line = \"DET,\" . $sequence . \",\" . $record[\"sku\"] . \",\" . $record[\"qty\"] . \",,,,,,\\n\";\n\t\t\t$export .= $line;\n\t\t}\n\n\t\treturn $export;\n\t}", "public function export()\n {\n $this->loadModel(\"ExportModel\")->exportCSVResults();\n }", "public function export()\n {\n return Excel::download(new ProductExport, 'products-' . date('Y-m-d') . '.xlsx');\n }", "public function exportToExcel()\n {\n $data = $this->index();\n $availment_per_month_per_client = [];\n $availment_per_month_per_client['data'] = $data;\n // // use return view(path.of.blade.file, $data);\n return Excel::download(new AvailmentPerMonthPerClientExport($availment_per_month_per_client['data']), 'AVAILMENT PER MONTH PER CLIENT REPORT.xlsx');\n // return $data;\n }", "public function execute()\n {\n\n \n $storeManager = $this->_objectManager->get('\\Magento\\Store\\Model\\StoreManagerInterface');\n $storeURL = $storeManager->getStore()->getBaseUrl();\n\n $lastCustomerId = $this->getlastCustomerId();\n \n $URL = 'http://127.0.0.1/otpdev/pub/exportcustomer.php?entity_id='.$lastCustomerId; //$storeURL.\n \n $httpClientFactory = $this->_objectManager->create('Magento\\Framework\\HTTP\\ZendClientFactory');\n $client = $httpClientFactory->create();\n $client->setUri($URL);\n $client->setMethod(\\Zend_Http_Client::GET);\n $client->setHeaders(\\Zend_Http_Client::CONTENT_TYPE, 'application/json');\n $client->setHeaders('Accept','application/json');\n //$client->setHeaders(\"Authorization\",\"Bearer 1212121212121\");\n //$client->setParameterPost($params); //json\n $response= $client->request(); \n\n $customers = json_decode($response->getBody(),true);\n \n if(isset($customers['customercollection']) && count($customers['customercollection']))\n {\n $total_rows = 0;\n $success_rows = 0;\n $error_rows = 0;\n $customercollection = $customers['customercollection']; \n $last_id_from_inportData = $customercollection[0]['customer_id'];\n\n foreach ($customercollection as $key => $importData) {\n $total_rows ++;\n\n $result = $this->_importCustomerSimple($importData,$last_id_from_inportData);\n if ($result == \"\") {\n $success_rows ++;\n } else {\n $error_rows ++;\n \n }\n }\n $out=array();\n if ($total_rows==$success_rows) {\n\n $processHandler = $this->_objectManager->create('ArtTech\\AdminPage\\Model\\Customer\\CustomerProcessHandler');\n\n $counts= $processHandler->createCustomerFromExternalImport($last_id_from_inportData);\n $out=array($total_rows,$success_rows,$error_rows,$counts[0],implode('| ', $counts[1]),$counts[2],implode('| ', $counts[3]),$counts[4],implode('| ', $counts[5]),$counts[6],implode('| ', $counts[7]),$counts[8]);\n\n \n $this->messageManager->addSuccess(__('%s Customer Imported.',$success_rows));\n }else\n {\n $this->messageManager->addSuccess(__('Something went wrong.')); \n } \n }\n\n \n $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);\n $resultRedirect->setUrl($this->_redirect->getRedirectUrl());\n return $resultRedirect;\n }", "public function gen_excel() {\n $this->load->library('excel');\n //activate worksheet number 1\n $this->excel->setActiveSheetIndex(0);\n //name the worksheet\n $this->excel->getActiveSheet()->setTitle('Customer list');\n\n // load database\n $this->load->database();\n\n // load model\n // get all users in array formate\n $this->load->model('Welcome_model');\n\n \n// $data['res'] = $this->customer_model->load_product_data($product, $type);\n \n $table_data = $this->Welcome_model->select_Insert_data();\n \n// echo '<pre>';\n// print_r($res);\n// exit();\n \n// $this->customer_model->create_openJobOrder_excel($data);\n $this->Welcome_model->creat_Excel($table_data);\n }", "public function action_export_obic(){\n\t\t$objPHPExcel = new \\PHPExcel();\n\t\t//add header\n $header = [\n '会社NO', '伝票番号', '発生日', 'システム分類', 'サイト番号', '仕訳区分', '伝票区分', '事業所コード', '行番号', '借方総勘定科目コード',\n '借方補助科目コード', '借方補助内訳科目コード', '借方部門コード', '借方取引先コード', '借方税区分', '借方税込区分',\n '借方金額', '借方消費税額', '借方消費税本体科目コード', '借方分析コード1', '借方分析コード2', '借方分析コード3', '借方分析コード4', '借方分析コード5',\n '借方資金コード', '借方プロジェクトコード', '貸方総勘定科目コード', '貸方補助科目コード', '貸方補助内訳科目コード', '貸方部門コード',\n '貸方取引先コード', '貸方税区分', '貸方税込区分', '貸方金額', '貸方消費税額', '貸方消費税本体科目コード',\n '貸方分析コード1', '貸方分析コード2', '貸方分析コード3', '貸方分析コード4', '貸方分析コード5', '貸方資金コード',\n '貸方プロジェクトコード', '明細摘要', '伝票摘要', 'ユーザID', '借方事業所コード', '貸方事業所コード'\n ];\n\n $objPHPExcel->getProperties()->setCreator('VisionVietnam')\n ->setLastModifiedBy('Phong Phu')\n ->setTitle('Office 2007 Document')\n ->setSubject('Office 2007 Document')\n ->setDescription('Document has been generated by PHP')\n ->setKeywords('Office 2007 openxml php')\n ->setCategory('OBIC File');\n $last_column = null;\n $explicit = [7,8,10,11,12,13,15,16,27,28,29,30,32];\n\n foreach($header as $i=>$v){\n\t\t\t$column = \\PHPExcel_Cell::stringFromColumnIndex($i);\n\t\t\t$objPHPExcel->setActiveSheetIndex(0)->setCellValue($column.'1',$v);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($column.'1')\n\t\t\t\t\t\t->applyFromArray([\n\t\t\t\t\t\t 'font' => [\n\t\t\t\t\t\t 'name' => 'Times New Roman',\n\t\t\t\t\t\t 'bold' => true,\n\t\t\t\t\t\t 'italic' => false,\n\t\t\t\t\t\t 'size' => 10,\n\t\t\t\t\t\t 'color' => ['rgb'=> \\PHPExcel_Style_Color::COLOR_WHITE]\n\t\t\t\t\t\t ],\n\t\t\t\t\t\t 'alignment' => [\n\t\t\t\t\t\t 'horizontal' => \\PHPExcel_Style_Alignment::HORIZONTAL_CENTER,\n\t\t\t\t\t\t 'vertical' => \\PHPExcel_Style_Alignment::VERTICAL_CENTER,\n\t\t\t\t\t\t 'wrap' => false\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t]);\n switch($i+1){\n case 4:\n case 15:\n case 16:\n case 18:\n $width = 20;\n break;\n case 13:\n case 14:\n case 20:\n case 21:\n case 22:\n case 23:\n case 24:\n case 25:\n case 30:\n case 31:\n $width = 25;\n break;\n case 10:\n case 11:\n case 12:\n case 19:\n case 26:\n case 27:\n case 28:\n $width = 30;\n break;\n case 29:\n case 44:\n case 45:\n $width = 40;\n break;\n default:\n $width = 15;\n break;\n }\n $objPHPExcel->getActiveSheet()->getColumnDimension($column)->setWidth($width);\n $last_column = $column;\n }\n //decode params\n $param = \\Input::param();\n parse_str(base64_decode($param['p']), $params);\n //get form payment content\n $rows = $this->generate_content($params);\n $i = 0;\n foreach($rows as $row){\n\t\t\tforeach($row as $k=>$v){\n\t\t\t\t$column = \\PHPExcel_Cell::stringFromColumnIndex($k);\n\t\t\t\tif(in_array($k+1,$explicit)){\n\t\t\t\t\t$objPHPExcel->setActiveSheetIndex()->setCellValueExplicit($column.($i+2),$v,\\PHPExcel_Cell_DataType::TYPE_STRING);\n\t\t\t\t}else{\n\t\t\t\t\t$objPHPExcel->setActiveSheetIndex()->setCellValue($column.($i+2),$v);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:'.$last_column.'1')->getFill()->setFillType(\\PHPExcel_Style_Fill::FILL_SOLID);\n $objPHPExcel->getActiveSheet()->getStyle('A1:'.$last_column.'1')->getFill()->getStartColor()->setRGB('5f5f5f');\n\n\t\t$objWriter = \\PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n\t\tob_end_clean();\n\n\t\theader(\"Last-Modified: \". gmdate(\"D, d M Y H:i:s\") .\" GMT\");\n header(\"Cache-Control: max-age=0\");\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"obic-'.date('Y-m-d').'.xls\"');\n $objWriter->save('php://output');\n\t\texit;\n }", "public function export()\n {\n if (isAdmin()) {\n return (new ContactsExport)->download('contacts_' . now()->toIso8601String() . '.csv');\n }\n abort(404);\n }", "public function exportExcelAction()\n {\n $fileName = 'schedule.xls';\n $content = $this->getLayout()->createBlock('bs_schedule/adminhtml_schedule_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "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 export()\n {\n\n $leads = $this->leads->listAsAdmin();\n\n $sheets = collect([\n ['Leads' => 'admin.v1.leads.bulk.sheets.export', 'data' => $leads, 'format' => []],\n ]);\n\n $this->excel->template($sheets, 'Leads');\n }", "public function export()\n {\n return Excel::download(new ProductExport, 'products.xlsx');\n // return (new ProductExport)->download('products.pdf', \\Maatwebsite\\Excel\\Excel\\::MDPDF);\n }", "function ExportData() {\r\n\t\t$utf8 = (strtolower(EW_CHARSET) == \"utf-8\");\r\n\t\t$bSelectLimit = FALSE;\r\n\r\n\t\t// Load recordset\r\n\t\tif ($bSelectLimit) {\r\n\t\t\t$this->TotalRecs = $this->SelectRecordCount();\r\n\t\t} else {\r\n\t\t\tif (!$this->Recordset)\r\n\t\t\t\t$this->Recordset = $this->LoadRecordset();\r\n\t\t\t$rs = &$this->Recordset;\r\n\t\t\tif ($rs)\r\n\t\t\t\t$this->TotalRecs = $rs->RecordCount();\r\n\t\t}\r\n\t\t$this->StartRec = 1;\r\n\t\t$this->SetUpStartRec(); // Set up start record position\r\n\r\n\t\t// Set the last record to display\r\n\t\tif ($this->DisplayRecs <= 0) {\r\n\t\t\t$this->StopRec = $this->TotalRecs;\r\n\t\t} else {\r\n\t\t\t$this->StopRec = $this->StartRec + $this->DisplayRecs - 1;\r\n\t\t}\r\n\t\tif (!$rs) {\r\n\t\t\theader(\"Content-Type:\"); // Remove header\r\n\t\t\theader(\"Content-Disposition:\");\r\n\t\t\t$this->ShowMessage();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$this->ExportDoc = ew_ExportDocument($this, \"v\");\r\n\t\t$Doc = &$this->ExportDoc;\r\n\t\tif ($bSelectLimit) {\r\n\t\t\t$this->StartRec = 1;\r\n\t\t\t$this->StopRec = $this->DisplayRecs <= 0 ? $this->TotalRecs : $this->DisplayRecs;\r\n\t\t} else {\r\n\r\n\t\t\t//$this->StartRec = $this->StartRec;\r\n\t\t\t//$this->StopRec = $this->StopRec;\r\n\r\n\t\t}\r\n\r\n\t\t// Call Page Exporting server event\r\n\t\t$this->ExportDoc->ExportCustom = !$this->Page_Exporting();\r\n\t\t$ParentTable = \"\";\r\n\t\t$sHeader = $this->PageHeader;\r\n\t\t$this->Page_DataRendering($sHeader);\r\n\t\t$Doc->Text .= $sHeader;\r\n\t\t$this->ExportDocument($Doc, $rs, $this->StartRec, $this->StopRec, \"view\");\r\n\r\n\t\t// Export detail records (observacion_tutor)\r\n\t\tif (EW_EXPORT_DETAIL_RECORDS && in_array(\"observacion_tutor\", explode(\",\", $this->getCurrentDetailTable()))) {\r\n\t\t\tglobal $observacion_tutor;\r\n\t\t\tif (!isset($observacion_tutor)) $observacion_tutor = new cobservacion_tutor;\r\n\t\t\t$rsdetail = $observacion_tutor->LoadRs($observacion_tutor->GetDetailFilter()); // Load detail records\r\n\t\t\tif ($rsdetail && !$rsdetail->EOF) {\r\n\t\t\t\t$ExportStyle = $Doc->Style;\r\n\t\t\t\t$Doc->SetStyle(\"h\"); // Change to horizontal\r\n\t\t\t\tif ($this->Export <> \"csv\" || EW_EXPORT_DETAIL_RECORDS_FOR_CSV) {\r\n\t\t\t\t\t$Doc->ExportEmptyRow();\r\n\t\t\t\t\t$detailcnt = $rsdetail->RecordCount();\r\n\t\t\t\t\t$observacion_tutor->ExportDocument($Doc, $rsdetail, 1, $detailcnt);\r\n\t\t\t\t}\r\n\t\t\t\t$Doc->SetStyle($ExportStyle); // Restore\r\n\t\t\t\t$rsdetail->Close();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$sFooter = $this->PageFooter;\r\n\t\t$this->Page_DataRendered($sFooter);\r\n\t\t$Doc->Text .= $sFooter;\r\n\r\n\t\t// Close recordset\r\n\t\t$rs->Close();\r\n\r\n\t\t// Call Page Exported server event\r\n\t\t$this->Page_Exported();\r\n\r\n\t\t// Export header and footer\r\n\t\t$Doc->ExportHeaderAndFooter();\r\n\r\n\t\t// Clean output buffer\r\n\t\tif (!EW_DEBUG_ENABLED && ob_get_length())\r\n\t\t\tob_end_clean();\r\n\r\n\t\t// Write debug message if enabled\r\n\t\tif (EW_DEBUG_ENABLED && $this->Export <> \"pdf\")\r\n\t\t\techo ew_DebugMsg();\r\n\r\n\t\t// Output data\r\n\t\t$Doc->Export();\r\n\t}", "function exportExcel($expTitle, $expCellName, $expTableData) {\n $xlsTitle = iconv('utf-8', 'gb2312', $expTitle); //文件名称\n $fileName = $xlsTitle . $_SESSION['loginAccount'] . date('_YmdHis'); //or $xlsTitle 文件名称可根据自己情况设定\n $cellNum = count($expCellName);\n $dataNum = count($expTableData);\n vendor(\"PhpExcel.PHPExcel\", '', '.php');\n $objPHPExcel = new \\PHPExcel();\n $cellName = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ');\n\n //$objPHPExcel->getActiveSheet(0)->mergeCells('A1:'.$cellName[$cellNum-1].'1');//合并单元格\n //$objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', $expTitle.' Export time:'.date('Y-m-d H:i:s')); \n for ($i = 0; $i < $cellNum; $i++) {\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellName[$i] . '1', $expCellName[$i][1]);\n }\n // Miscellaneous glyphs, UTF-8 \n for ($i = 0; $i < $dataNum; $i++) {\n for ($j = 0; $j < $cellNum; $j++) {\n $objPHPExcel->getActiveSheet(0)->setCellValueExplicit($cellName[$j] . ($i + 2), $expTableData[$i][$expCellName[$j][0]], \\PHPExcel_Cell_DataType::TYPE_STRING2);\n }\n }\n\n header('pragma:public');\n header('Content-type:application/vnd.ms-excel;charset=utf-8;name=\"' . $xlsTitle . '.xls\"');\n header(\"Content-Disposition:attachment;filename=$fileName.xls\"); //attachment新窗口打印inline本窗口打印\n $objWriter = \\PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n $objWriter->save('php://output');\n exit;\n}", "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 export(){\n header(\"Content-type: aplication/vnd-ms-excel\");\n header(\"Content-Disposition: attachment; filename=Data_Siswa.xls\");\n \n $data ['siswa'] = $this->SiswaModel->view();\n $this->load->view('export', $data);\n }", "function call_to_export($export){\n\t$objPHPExcel = new PHPExcel();\n\n\t// Set document properties\n\t$objPHPExcel->getProperties()\n\t\t->setCreator(\"QPP REPORTS\")\n\t\t->setLastModifiedBy(\"QPP REPORTS\")\n\t\t->setTitle(\"Office 2007 XLSX Document\")\n\t\t->setSubject(\"Office 2007 XLSX Document\")\n\t\t->setDescription(\"QPP REPORTS\")\n\t\t->setKeywords(\"office 2007 openxml php\")\n\t\t->setCategory(\"Reports\");\n\n\t$styleArray = array(\n\t\t'font' => array(\n\t\t\t'bold' => true,\n\t\t\t'color' => array('rgb' => '1A6FCD'),\n\t\t\t'size' => 10,\n\t\t\t'name' => 'arial',\n\t\t\t'underline' => 'single',\n\t\t)\n\t);\n\t\n\tif(isset($export['users_logins'])){\n\t\t$objPHPExcel->setActiveSheetIndex(0);\n\t\t$sheet_logins = $objPHPExcel->getActiveSheet(0);\n\t\t\n\t\t// set worksheet title\n\t\t$sheet_logins->setTitle($export['users_logins']['sheet1']['title']);\n\t\t\n\t\t// set report title\n\t\t$sheet_logins->getStyle('A1:z1')->getFont()->setBold(true)->setSize(16);\n\t\t$sheet_logins->mergeCells('A1:I1');\n\t\t$sheet_logins->SetCellValue('A1',$export['users_logins']['sheet1']['report_title']);\n\t\t$sheet_logins->getStyle('A2:z2')->getFont()->setBold(true)->setSize(12);\n\t\t$sheet_logins->mergeCells('A2:I2');\n\t\t$sheet_logins->SetCellValue('A2',$export['users_logins']['sheet1']['date_range']);\n\t\t\n\t\t// set column widths\n\t\t$sheet_logins->getColumnDimension('A')->setWidth(25);\n\t\t$sheet_logins->getColumnDimension('B')->setWidth(25);\n\t\t$sheet_logins->getColumnDimension('C')->setWidth(10);\n\t\t$sheet_logins->getColumnDimension('D')->setWidth(25);\n\t\t$sheet_logins->getColumnDimension('E')->setWidth(35);\n\t\t$sheet_logins->getColumnDimension('F')->setWidth(25);\n\t\t$sheet_logins->getColumnDimension('G')->setWidth(25);\n\t\t$sheet_logins->getColumnDimension('H')->setWidth(25);\n\t\t$sheet_logins->getColumnDimension('I')->setWidth(25);\n\t\t$sheet_logins->getColumnDimension('J')->setWidth(15);\n\t\t$sheet_logins->getColumnDimension('K')->setWidth(25);\n\t\t\n\t\t// set vertical alignment\n\t\t$sheet_logins->getDefaultStyle()->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP);\n\t\t\n\t\t// set column horizontal alignment\n\t\t$sheet_logins->getStyle('K4:K999')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t\t\n\t\t// set wrap text\n\t\t$sheet_logins->getStyle('C3:K999')->getAlignment()->setWrapText(true); \n\t\t\n\t\t// set column headers\n\t\tif(isset($export['users_logins']['sheet1']['header'])){\n\t\t\t$col = 0;\n\t\t\t$row = 3; //start from row 3\n\t\t\t$sheet_logins->getStyle('A3:Z3')->getFont()->setBold(true);\n\t\t\tforeach($export['users_logins']['sheet1']['header'] as $key){\n\t\t\t\t$sheet_logins->setCellValueByColumnAndRow($col, $row, $key);\n\t\t\t\t$col++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// print rows\n\t\tif(isset($export['users_logins']['sheet1']['rows'])){\n\t\t\t$row = 4;\n\t\t\tforeach($export['users_logins']['sheet1']['rows'] as $rows){\n\t\t\t\t$col = 0;\n\t\t\t\tforeach ($rows as $value){\n\t\t\t\t\t$sheet_logins->setCellValueByColumnAndRow($col, $row, $value);\n\t\t\t\t\t$col++;\t\n\t\t\t\t}\n\t\t\t\t$row++;\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\t// new worksheet for portal login totals\n\t\t$objPHPExcel->createSheet();\n\t\t$objPHPExcel->setActiveSheetIndex(1);\t\t\t\n\t\t$sheet_logins_total = $objPHPExcel->getActiveSheet(1);\n\t\t\n\t\t// set worksheet title\n\t\t$sheet_logins_total->setTitle($export['users_logins']['sheet2']['title']);\n\t\t\n\t\t// set report title\n\t\t$sheet_logins_total->getStyle('A1:z1')->getFont()->setBold(true)->setSize(16);\n\t\t$sheet_logins_total->mergeCells('A1:I1');\n\t\t$sheet_logins_total->SetCellValue('A1',$export['users_logins']['sheet2']['report_title']);\n\t\t$sheet_logins_total->getStyle('A2:z2')->getFont()->setBold(true)->setSize(12);\n\t\t$sheet_logins_total->mergeCells('A2:I2');\n\t\t$sheet_logins_total->SetCellValue('A2',$export['users_logins']['sheet2']['date_range']);\n\t\t\n\t\t// set column widths\n\t\t$sheet_logins_total->getColumnDimension('A')->setWidth(35);\n\t\t$sheet_logins_total->getColumnDimension('B')->setWidth(25);\n\t\t\n\t\t// set vertical alignment\n\t\t$sheet_logins_total->getDefaultStyle()->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP);\n\t\t\n\t\t// set column headers\n\t\tif(isset($export['users_logins']['sheet2']['header'])){\n\t\t\t$col = 0;\n\t\t\t$row = 3; //start from row 3\n\t\t\t$sheet_logins_total->getStyle('A3:Z3')->getFont()->setBold(true);\n\t\t\tforeach($export['users_logins']['sheet2']['header'] as $key){\n\t\t\t\t$sheet_logins_total->setCellValueByColumnAndRow($col, $row, $key);\n\t\t\t\t$col++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// print rows\n\t\tif(isset($export['users_logins']['sheet2']['rows'])){\n\t\t\t$row = 4;\n\t\t\tforeach($export['users_logins']['sheet2']['rows'] as $rows){\n\t\t\t\t$col = 0;\n\t\t\t\tforeach ($rows as $value){\n\t\t\t\t\t$sheet_logins_total->setCellValueByColumnAndRow($col, $row, $value);\n\t\t\t\t\t$col++;\t\n\t\t\t\t}\n\t\t\t\t$row++;\n\t\t\t}\n\n\t\t\tif(isset($export['users_logins']['sheet2']['rows_total'])){\n\t\t\t\t$row = $row+1;\n\t\t\t\tforeach($export['users_logins']['sheet2']['rows_total'] as $rows){\n\t\t\t\t\t$col = 0;\n\t\t\t\t\tforeach ($rows as $value){\n\t\t\t\t\t\t$sheet_logins_total->setCellValueByColumnAndRow($col, $row, $value);\n\t\t\t\t\t\t$col++;\n\t\t\t\t\t}\n\t\t\t\t\t$row++;\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}\n\t}\n\t\n\tif(isset($export['users_interactions'])){\n\t\t$objPHPExcel->setActiveSheetIndex(0);\n\t\t$sheet_interactions = $objPHPExcel->getActiveSheet(0);\n\t\t\n\t\t// set worksheet title\n\t\t$sheet_interactions->setTitle($export['users_interactions']['sheet1']['title']);\n\t\t\n\t\t// set report title\n\t\t$sheet_interactions->getStyle('A1:z1')->getFont()->setBold(true)->setSize(16);\n\t\t$sheet_interactions->mergeCells('A1:I1');\n\t\t$sheet_interactions->SetCellValue('A1',$export['users_interactions']['sheet1']['report_title']);\n\t\t$sheet_interactions->getStyle('A2:z2')->getFont()->setBold(true)->setSize(12);\n\t\t$sheet_interactions->mergeCells('A2:I2');\n\t\t$sheet_interactions->SetCellValue('A2',$export['users_interactions']['sheet1']['date_range']);\n\t\t\n\t\t// set column widths\n\t\t$sheet_interactions->getColumnDimension('A')->setWidth(25);\n\t\t$sheet_interactions->getColumnDimension('B')->setWidth(25);\n\t\t$sheet_interactions->getColumnDimension('C')->setWidth(25);\n\t\t$sheet_interactions->getColumnDimension('D')->setWidth(25);\n\t\t$sheet_interactions->getColumnDimension('E')->setWidth(35);\n\t\t$sheet_interactions->getColumnDimension('F')->setWidth(25);\n\t\t$sheet_interactions->getColumnDimension('G')->setWidth(35);\n\t\t$sheet_interactions->getColumnDimension('H')->setWidth(25);\n\t\t$sheet_interactions->getColumnDimension('I')->setWidth(25);\n\t\t$sheet_interactions->getColumnDimension('J')->setWidth(25);\n\t\t$sheet_interactions->getColumnDimension('K')->setWidth(25);\n\t\t$sheet_interactions->getColumnDimension('L')->setWidth(25);\n\t\t$sheet_interactions->getColumnDimension('M')->setWidth(25);\n\t\t\n\t\t// set vertical alignment\n\t\t$sheet_interactions->getDefaultStyle()->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP);\n\t\t\n\t\t// set column horizontal alignment\n\t\t$sheet_interactions->getStyle('M4:M999')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t\t\n\t\t// set wrap text\n\t\t$sheet_interactions->getStyle('C3:M999')->getAlignment()->setWrapText(true); \n\t\t\n\t\t// set column headers\n\t\tif(isset($export['users_interactions']['sheet1']['header'])){\n\t\t\t$col = 0;\n\t\t\t$row = 3; //start from row 3\n\t\t\t$sheet_interactions->getStyle('A3:Z3')->getFont()->setBold(true);\n\t\t\tforeach($export['users_interactions']['sheet1']['header'] as $key){\n\t\t\t\t$sheet_interactions->setCellValueByColumnAndRow($col, $row, $key);\n\t\t\t\t$col++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// print rows\n\t\tif(isset($export['users_interactions']['sheet1']['rows'])){\n\t\t\t$row = 4;\n\t\t\tforeach($export['users_interactions']['sheet1']['rows'] as $rows){\n\t\t\t\t$col = 0;\n\t\t\t\tforeach ($rows as $value){\n\t\t\t\t\t$sheet_interactions->setCellValueByColumnAndRow($col, $row, $value);\n\t\t\t\t\t$col++;\t\n\t\t\t\t}\n\t\t\t\t$row++;\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\t// new worksheet for portal login totals\n\t\t$objPHPExcel->createSheet();\n\t\t$objPHPExcel->setActiveSheetIndex(1);\t\t\t\n\t\t$sheet_interactions_total = $objPHPExcel->getActiveSheet(1);\n\t\t\n\t\t// set worksheet title\n\t\t$sheet_interactions_total->setTitle($export['users_interactions']['sheet2']['title']);\n\t\t\n\t\t// set report title\n\t\t$sheet_interactions_total->getStyle('A1:z1')->getFont()->setBold(true)->setSize(16);\n\t\t$sheet_interactions_total->mergeCells('A1:I1');\n\t\t$sheet_interactions_total->SetCellValue('A1',$export['users_interactions']['sheet2']['report_title']);\n\t\t$sheet_interactions_total->getStyle('A2:z2')->getFont()->setBold(true)->setSize(12);\n\t\t$sheet_interactions_total->mergeCells('A2:I2');\n\t\t$sheet_interactions_total->SetCellValue('A2',$export['users_interactions']['sheet2']['date_range']);\n\t\t\n\t\t// set column widths\n\t\t$sheet_interactions_total->getColumnDimension('A')->setWidth(35);\n\t\t$sheet_interactions_total->getColumnDimension('B')->setWidth(25);\n\t\t$sheet_interactions_total->getColumnDimension('C')->setWidth(25);\n\t\t\n\t\t// set vertical alignment\n\t\t$sheet_interactions_total->getDefaultStyle()->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP);\n\t\t\n\t\t// set column headers\n\t\tif(isset($export['users_interactions']['sheet2']['header'])){\n\t\t\t$col = 0;\n\t\t\t$row = 3; //start from row 3\n\t\t\t$sheet_interactions_total->getStyle('A3:Z3')->getFont()->setBold(true);\n\t\t\tforeach($export['users_interactions']['sheet2']['header'] as $key){\n\t\t\t\t$sheet_interactions_total->setCellValueByColumnAndRow($col, $row, $key);\n\t\t\t\t$col++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// print rows\n\t\tif(isset($export['users_interactions']['sheet2']['rows'])){\n\t\t\t$row = 4;\n\t\t\tforeach($export['users_interactions']['sheet2']['rows'] as $rows){\n\t\t\t\t$col = 0;\n\t\t\t\tforeach ($rows as $value){\n\t\t\t\t\t$sheet_interactions_total->setCellValueByColumnAndRow($col, $row, $value);\n\t\t\t\t\t$col++;\t\n\t\t\t\t}\n\t\t\t\t$row++;\n\t\t\t}\n\n\t\t\tif(isset($export['users_interactions']['sheet2']['rows_total'])){\n\t\t\t\t$row = $row+1;\n\t\t\t\tforeach($export['users_interactions']['sheet2']['rows_total'] as $rows){\n\t\t\t\t\t$col = 0;\n\t\t\t\t\tforeach ($rows as $value){\n\t\t\t\t\t\t$sheet_interactions_total->setCellValueByColumnAndRow($col, $row, $value);\n\t\t\t\t\t\t$col++;\n\t\t\t\t\t}\n\t\t\t\t\t$row++;\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}\n\t}\n\t\n\t$filename = isset($export['filename']) ? $export['filename'] . \".xlsx\" : \"qpp_portal_report_\" . date('m-d-Y_h-i') . \".xlsx\";\n\t\n\t$objPHPExcel->setActiveSheetIndex(0);\n\theader('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n\theader('Content-Disposition: attachment;filename=\"' . $filename . '\"');\n\theader('Cache-Control: max-age=0');\n\n\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\tob_end_clean();\n\t$objWriter->save('php://output');\n\n\texit;\n}", "public function actionExport()\n\t{\n\n\t\t$dataProvider=new CActiveDataProvider('Consegne', array(\n\t\t\t'sort'=>array(\n\t \t\t'defaultOrder'=>array(\n\t \t\t\t'id_archive'=>false\n\t \t\t)\n\t \t\t),\n\t\t));\n\n\t\t$Creator = Yii::app()->params['nomeAssociazione'];\n\t\t$LastModifiedBy = \"Sergio Casizzone\";\n\t\t$Title = \"Office 2007 XLSX Test Document\";\n\t\t$Subject = \"Office 2007 XLSX Test Document\";\n\t\t$Description = \"Estrazione dati per Office 2007 XLSX, generated using PHP classes.\";\n\t\t$Keywords = \"office 2007 openxml php\";\n\t\t$Category = \"export\";\n\n\t\t// Create new PHPExcel object\n\t\t$objPHPExcel = new PHPExcel();\n\t\t// Set document properties\n\t\t$objPHPExcel->getProperties()->setCreator($Creator)\n\t\t\t\t\t\t\t\t\t ->setLastModifiedBy($LastModifiedBy)\n\t\t\t\t\t\t\t\t\t ->setTitle($Title)\n\t\t\t\t\t\t\t\t\t ->setSubject($Subject)\n\t\t\t\t\t\t\t\t\t ->setDescription($Description)\n\t\t\t\t\t\t\t\t\t ->setKeywords($Keywords)\n\t\t\t\t\t\t\t\t\t ->setCategory($Category);\n\n\t\t// Add header\n\t\t$colonne = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u');\n\t\t$intestazione = array(\n\t\t\t\"ID\",\n\t\t\t\"Data Inserimento\",\n\t\t\t\"ID User che inserisce\",\n\t\t\t\"Nome User che inserisce\",\n\t\t\t\"Codice Fiscale\",\n\t\t\t\"Nome\",\n\t\t\t\"Cognome\",\n\t\t\t\"Telefono\",\n\t\t\t\"Adulti\",\n\t\t\t\"Neonati\",\n\t\t\t\"Indirizzo\",\n\t\t\t\"Quartiere\",\n\t\t\t\"Municipalità\",\n\t\t\t\"Alert se < 7gg\",\n\t\t\t\"ID User in consegna\",\n\t\t\t\"Nome User in consegna\",\n\t\t\t\"Pacco in consegna\",\n\t\t\t\"Data presa in carico\",\n\t\t\t\"Consegnato\",\n\t\t\t\"Data consegna\",\n\t\t\t\"Note\"\n\t\t);\n\n\t\tforeach ($colonne as $n => $l){\n\t\t\t$objPHPExcel->setActiveSheetIndex(0)\n\t\t\t\t\t\t->setCellValue($l.'1', $intestazione[$n]);\n\t\t}\n\t\t$transactions = new CDataProviderIterator($dataProvider);\n\t\t$riga = 2;\n\t\t$Rows = 1; //$transactions->totalItemCount;\n\n\t\tforeach($transactions as $item) {\n\t\t\t// Miscellaneous glyphs, UTF-8\n\t\t\t$objPHPExcel->setActiveSheetIndex(0)\n\t\t\t ->setCellValue('A'.$riga, $item->id_archive)\n\t\t\t ->setCellValue('B'.$riga, date(\"d/m/Y\",$item->data))\n\t\t\t\t\t\t->setCellValue('C'.$riga, $item->id_user)\n\t\t\t\t\t\t->setCellValue('D'.$riga, Users::model()->findByPk($item->id_user)->email)\n\t\t\t\t\t\t->setCellValue('E'.$riga, $item->codfisc)\n\t\t\t\t\t\t->setCellValue('F'.$riga, $item->nome)\n\t\t\t\t\t\t->setCellValue('G'.$riga, $item->cognome)\n\t\t\t\t\t\t->setCellValue('H'.$riga, $item->telefono)\n\t\t\t\t\t\t->setCellValue('I'.$riga, $item->adulti)\n\t\t\t\t\t\t->setCellValue('J'.$riga, $item->bambini)\n\t\t\t\t\t\t->setCellValue('K'.$riga, $item->indirizzo.\" \".$item->civico)\n\t\t\t\t\t\t->setCellValue('L'.$riga, $item->quartiere)\n\t\t\t\t\t\t->setCellValue('M'.$riga, $item->municipalita)\n\t\t\t\t\t\t->setCellValue('N'.$riga, $item->trigger_alert)\n\t\t\t\t\t\t->setCellValue('O'.$riga, $item->id_volontario)\n\t\t\t\t\t\t->setCellValue('P'.$riga, ($item->id_volontario == 0) ? '' : Users::model()->findByPk($item->id_volontario)->email)\n\t\t\t\t\t\t->setCellValue('Q'.$riga, $item->in_consegna)\n\t\t\t\t\t\t->setCellValue('R'.$riga, ($item->time_inconsegna == 0) ? '' : date(\"d/m/Y H:i:s\",$item->time_inconsegna))\n\t\t\t\t\t\t->setCellValue('S'.$riga, $item->consegnato)\n\t\t\t\t\t\t->setCellValue('T'.$riga, ($item->time_consegnato == 0) ? '' : date(\"d/m/Y H:i:s\",$item->time_consegnato))\n\t\t\t\t\t\t->setCellValue('U'.$riga, $item->note);\n\n\t\t\t$riga++;\n\t\t\t$Rows++;\n\t\t}\n\n\t\t// Rename worksheet\n\t\t$objPHPExcel->getActiveSheet()->setTitle('export');\n\t\t// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n\t\t$objPHPExcel->setActiveSheetIndex(0);\n\t\t// Redirect output to a client’s web browser (Excel5)\n\t\t$time = time();\n\t\t$date = date('Y/m/d H:i:s', $time);\n\t\theader('Content-Type: application/vnd.ms-excel');\n\t\theader('Content-Disposition: attachment;filename=\"'.$date.'-export.xls\"');\n\t\theader('Cache-Control: max-age=0');\n\t\t// If you're serving to IE 9, then the following may be needed\n\t\theader('Cache-Control: max-age=1');\n\t\t// If you're serving to IE over SSL, then the following may be needed\n\t\theader ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\n\t\theader ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified\n\t\theader ('Cache-Control: cache, must-revalidate'); // HTTP/1.1\n\t\theader ('Pragma: public'); // HTTP/1.0\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n\t\t$objWriter->save('php://output');\n\t}", "public function exportCsvAction()\r\n {\r\n $fileName = 'customer_store_credit_balances.csv';\r\n $content = $this->getLayout()->createBlock('wf_customerbalance/adminhtml_balances_grid')\r\n ->getCsvFile();\r\n\r\n $this->_prepareDownloadResponse($fileName, $content);\r\n }", "public function actionExport(){\t\n\t\t$tglIn=date(\"Y-m-d\");\n\t\t\t\n\t\t//Search STATUS\n\t\t$searchModel = new StoreSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\t\t\t\t\n\t\t//Models\n\t\t$model=$dataProvider->getModels();\n\t\t//Models\n\t\t$aryStore=ArrayHelper::toArray($model);\t\t\t\n\t\t\n\t\t// print_r($aryStore);\n\t\t// die();\n\t\t//Excute - Export Excel.\t\t\n\t\t$excel_content = [\n\t\t\t[\n\t\t\t\t'sheet_name' => 'RasaSayang-Store',\t\t\t\t\t\n\t\t\t\t'sheet_title' => [\n\t\t\t\t\t['OUTLET_BARCODE','OUTLET_NM','LOCATE','LOCATE_SUB','ALAMAT','PIC','TLP','STATUS','CREATE_BY','CREATE_AT','UPDATE_BY,UPDATE_AT']\n\t\t\t\t],\n\t\t\t\t'ceils' =>$aryStore,\n\t\t\t\t'freezePane' => 'A2',\n\t\t\t\t'headerColor' => Postman4ExcelBehavior::getCssClass(\"header\"),\n\t\t\t\t'columnGroup'=>[''],\n\t\t\t\t'autoSize'=>false,\n\t\t\t\t'headerStyle'=>[\t\t\t\t\t\n\t\t\t\t\t[\n\t\t\t\t\t\t'OUTLET_BARCODE' => ['font-size'=>'8','align'=>'center','width'=>'28.14','valign'=>'center','wrap'=>true],\n\t\t\t\t\t\t'OUTLET_NM' => ['font-size'=>'8','align'=>'center','width'=>'8.14','valign'=>'center'],\t\t\t\t\t\t\t\n\t\t\t\t\t\t'LOCATE' =>['font-size'=>'8','align'=>'center','width'=>'11','valign'=>'center'],\n\t\t\t\t\t\t'LOCATE_SUB' =>['font-size'=>'8','align'=>'center','width'=>'11','valign'=>'center'],\n\t\t\t\t\t\t'ALAMAT' =>['font-size'=>'8','align'=>'center','width'=>'11','valign'=>'center'],\n\t\t\t\t\t\t'PIC' => ['font-size'=>'8','align'=>'center','width'=>'7','valign'=>'center'],\n\t\t\t\t\t\t'TLP' =>['font-size'=>'8','align'=>'center','width'=>'29.29','wrap'=>true,'valign'=>'center',], \n\t\t\t\t\t\t'STATUS' =>['font-size'=>'8','align'=>'center','width'=>'34.14','wrap'=>true,'valign'=>'center',],\n\t\t\t\t\t\t'CREATE_BY' => ['font-size'=>'8','align'=>'center','width'=>'34.14','wrap'=>true,'valign'=>'center',],\n\t\t\t\t\t\t'CREATE_AT' => ['font-size'=>'8','align'=>'center','width'=>'34.14','wrap'=>true,'valign'=>'center',],\t\t\t\t\t\n\t\t\t\t\t\t'UPDATE_BY' => ['font-size'=>'8','align'=>'center','width'=>'14.86','valign'=>'center'],\t\t\t\t\t\t\n\t\t\t\t\t\t'UPDATE_AT' => ['font-size'=>'8','align'=>'center','width'=>'15','valign'=>'center']\n\t\t\t\t\t]\n\t\t\t\t\t\n\t\t\t\t],\n\t\t\t\t'contentStyle'=>[\n\t\t\t\t\t[\t\t\t\t\t\t\n\t\t\t\t\t\t'OUTLET_BARCODE' => ['font-size'=>'8','align'=>'left',],\n\t\t\t\t\t\t'OUTLET_NM' => ['font-size'=>'8','align'=>'left'],\t\t\t\t\t\t\t \n\t\t\t\t\t\t'LOCATE' =>['font-size'=>'8','align'=>'center'],\n\t\t\t\t\t\t'LOCATE_SUB' =>['font-size'=>'8','align'=>'center'],\n\t\t\t\t\t\t'ALAMAT' =>['font-size'=>'8','align'=>'center'],\n\t\t\t\t\t\t'PIC' => ['font-size'=>'8','align'=>'center'],\n\t\t\t\t\t\t'TLP' =>['font-size'=>'8','align'=>'left'],\n\t\t\t\t\t\t'STATUS' =>['font-size'=>'8','align'=>'left'],\n\t\t\t\t\t\t'KOMPENSASI' => ['font-size'=>'8','align'=>'left'],\n\t\t\t\t\t\t'CREATE_BY' => ['font-size'=>'8','align'=>'left'],\n\t\t\t\t\t\t'CREATED_BY' => ['font-size'=>'8','align'=>'left'],\t\t\t\t\t\t\n\t\t\t\t\t\t'UPDATE_BY' => ['font-size'=>'8','align'=>'center'],\t\t\t\t\t\t\n\t\t\t\t\t\t'UPDATE_AT' => ['align'=>'left']\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t]\n\t\t\t\t], \n\t\t\t\t'oddCssClass' => Postman4ExcelBehavior::getCssClass(\"odd\"),\n\t\t\t\t'evenCssClass' => Postman4ExcelBehavior::getCssClass(\"even\"),\n\t\t\t],\t\t\t\n\t\t];\n\t\t$excel_file = \"RasaSayang-Store\".\"-\".$tglIn;\n\t\t$this->export4excel($excel_content, $excel_file,0); \n\t}", "public function exportUsersExcel() {\n\n $handle = fopen('php://temp', 'w+');\n\n $header = [\n 'Name',\n ];\n\n fputcsv($handle, $header);\n\n $names = $this->exportUsersExcelService->csvExport();\n\n foreach ($names as $name) {\n\n fputcsv($handle, [$name->name]);\n }\n\n rewind($handle);\n\n $csv_data = stream_get_contents($handle);\n\n fclose($handle);\n\n $response = new Response();\n $response->headers->set('Content-Type', 'text/csv');\n $response->headers->set('Content-Disposition', 'attachment; filename=\"my_users.csv\"');\n $response->setContent($csv_data);\n\n return $response;\n\n }", "public function DowloadExcel()\n {\n return $export->sheet('sheetName', function($sheet)\n {\n\n })->export('xls');\n }", "public function payments_due_export_xls() {\n $tenant_id = $this->tenant_id;\n $executive = array('' => 'Select');\n foreach ($this->reportsModel->get_sales_executive($tenant_id)->result() as $item) {\n $executive[$item->user_id] = $item->user_name;\n }\n $salesexec = $this->input->get('salesexec');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'ei.invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $tabledata = $this->reportsModel->get_payment_due($tenant_id, $records_per_page, $offset, $field, $order_by, $salesexec, $start_date, $end_date);\n $tabledata_count = count($tabledata);\n $invs = array();\n for ($i = 0; $i < $tabledata_count; $i++) {\n $invs[] = $tabledata[$i]->invoice_id;\n }\n $tb_recd = $this->reportsModel->get_payment_recd_sum($invs);\n $tabledatarecd = array();\n for ($i = 0; $i < count($tb_recd); $i++) {\n $tabledatarecd[$tb_recd[$i]->invoice_id] = $tb_recd[$i]->amount_recd;\n }\n $tb_refund = $this->reportsModel->get_payment_refund_sum($invs);\n $tabledatarefund = array();\n for ($i = 0; $i < count($tb_refund); $i++) {\n $tabledatarefund[$tb_refund[$i]->invoice_id] = $tb_refund[$i]->amount_refund;\n }\n $this->load->helper('export_helper');\n $count_tabledata = count($tabledata);\n $excel_titles = array('Inv #', 'Inv Dt.', 'Inv Amt.', 'Amt. Recd.', 'Amt. Due.', 'Amt. Refd.', 'Course - Class', 'Name', 'Taxcode');\n $excel_data = array();\n for ($i = 0; $i < $count_tabledata; $i++) {\n $excel_data[$i][] = $tabledata[$i]->invoice_id;\n $excel_data[$i][] = date('d/m/Y', strtotime($tabledata[$i]->inv_date));\n $excel_data[$i][] = '$ ' . $total_inv = number_format($tabledata[$i]->total_inv_amount, 2, '.', '');\n $excel_data[$i][] = '$ ' . $total_recd = number_format($tabledatarecd[$tabledata[$i]->invoice_id], 2, '.', '');\n $excel_data[$i][] = '$ ' . number_format($total_inv - $total_recd, 2, '.', '');\n $excel_data[$i][] = '$ ' . number_format($tabledatarefund[$tabledata[$i]->invoice_id], 2, '.', '');\n $excel_data[$i][] = $tabledata[$i]->crse_name . ' - ' . $tabledata[$i]->class_name;\n if ($tabledata[$i]->inv_type == 'INVINDV') {\n $taxcode = $this->mask_format($tabledata[$i]->tax_code);\n $name = $tabledata[$i]->first_name . ' ' . $tabledata[$i]->last_name;\n } else {\n if ($tabledata[$i]->company_id[0] == 'T') {\n $tenant_details = fetch_tenant_details($tabledata[$i]->company_id);\n $taxcode = $tenant_details->tenant_name;\n $name = $tenant_details->tenant_name . ' (Company)';\n } else {\n $taxcode = $tabledata[$i]->comp_regist_num;\n $name = $tabledata[$i]->company_name . ' (Company)';\n }\n }\n $excel_data[$i][] = $name;\n $excel_data[$i][] = $taxcode;\n }\n if (!empty($tabledata)) {\n if (empty($start_date) && empty($end_date)) {\n $period = ' for ' . date('F d Y, l');\n } else {\n $period = 'for the period';\n if (!empty($start_date))\n $period .= ' from ' . date('F d Y', DateTime::createFromFormat('d-m-Y', $start_date)->getTimestamp());\n if (!empty($end_date))\n $period .= ' to ' . date('F d Y', DateTime::createFromFormat('d-m-Y', $end_date)->getTimestamp());\n }\n if (!empty($salesexec)) {\n $period .= ' \\'' . $executive[$salesexec] . '\\'';\n }\n }\n $excel_filename = 'payments_due.xls';\n $excel_sheetname = 'Payments Due';\n $excel_main_heading = 'Accounting Reports - Payments Due' . $period;\n export_page_fields($excel_titles, $excel_data, $excel_filename, $excel_sheetname, $excel_main_heading);\n }", "public function exportCSV()\n {\n $date1 = date('d-m-Y', strtotime($this->input->get('date1')));\n $date2 = date('d-m-Y', strtotime($this->input->get('date2')));\n\n $data = $this->ModelAdmin->fetchLaporanByDate($date1, $date2);\n\n header('Content-Type: text/csv; charset=utf-8');\n header(\"Content-Disposition: attachment; filename=Laporan Kehadiran periode $date1 - $date2.csv\");\n\n $output = fopen('php://output', 'w');\n fputcsv($output, array('NRP', 'Nama', 'Tanggal', 'Jam Masuk', 'Jam Keluar'));\n\n foreach ($data as $i) {\n fputcsv($output, array($i->nrp, $i->nama, $i->tanggal, $i->jam_masuk, $i->jam_keluar));\n }\n fclose($output);\n }", "public function exportCsvAction()\n {\n $fileName = 'equipment.csv';\n $content = $this->getLayout()->createBlock('bs_logistics/adminhtml_equipment_grid')\n ->getCsv();\n $this->_prepareDownloadResponse($fileName, $content);\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 }" ]
[ "0.7273157", "0.71103466", "0.68950903", "0.6861178", "0.6842097", "0.68392146", "0.67696273", "0.676585", "0.6759252", "0.6742916", "0.67324704", "0.6712874", "0.6661427", "0.6622592", "0.66106033", "0.66018516", "0.6594915", "0.6557342", "0.6557279", "0.6537715", "0.65153694", "0.65112305", "0.6504597", "0.6502054", "0.64977384", "0.6479167", "0.6466645", "0.6438293", "0.6423482", "0.64193237", "0.6415888", "0.6404589", "0.6392852", "0.638382", "0.6383358", "0.6372863", "0.6363364", "0.63498306", "0.6341119", "0.6329218", "0.63280004", "0.6320172", "0.6316444", "0.6315082", "0.6310795", "0.6290464", "0.6278736", "0.62781507", "0.62675893", "0.6262095", "0.6261629", "0.6261216", "0.6259041", "0.62562007", "0.62511533", "0.62451535", "0.6243959", "0.62229186", "0.62204593", "0.6216112", "0.6215566", "0.62124354", "0.62073183", "0.6206953", "0.62066054", "0.62046176", "0.6199621", "0.619377", "0.6169061", "0.61625123", "0.61569047", "0.61490244", "0.61377347", "0.61362696", "0.6125827", "0.61181027", "0.61137116", "0.6100654", "0.60961884", "0.6079788", "0.6074675", "0.607308", "0.6061955", "0.60590935", "0.60548353", "0.6051572", "0.6051372", "0.60468465", "0.6045409", "0.603942", "0.6034549", "0.60338223", "0.60319906", "0.60218316", "0.6020978", "0.6020583", "0.6018589", "0.6015478", "0.60139614", "0.6011369" ]
0.60140264
98
Upload image to folder "upload/image"
public function upload($image = '', $name = '') { $config['upload_path'] = './' . $this->upload_dir; $config['allowed_types'] = 'jpg|jpeg|png|gif'; $config['file_name'] = $name; $config['overwrite'] = $name == '' ? FALSE : TRUE; $this->CI->upload->initialize($config); if(!$this->CI->upload->do_upload($image)) { exit($this->CI->upload->display_errors()); } else { return array( 'status' => TRUE, 'data' => $this->CI->upload->data() ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function uploadImage() \n {\n if (is_null($this->image)) {\n return;\n }\n \n // move image from temp directory to destination one\n $this->image->move(\n $this->getUploadRootDir(),\n $this->image->getClientOriginalName()\n );\n\n $this->path = $this->image->getClientOriginalName();\n $this->image = null;\n }", "public function upload()\n {\n if (null === $this->image) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the target filename to move to\n $this->file->move($this->getUploadRootDir(), $this->image->getClientOriginalName());\n\n // set the path property to the filename where you'ved saved the file\n $this->path = $this->image->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n Image::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->path\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "function upload_image()\n {\n $file = $this->request->getFile('image');\n $fileName = $file->getRandomName();\n $file->move('./assets/img/beranda/post/inside', $fileName);\n echo base_url('assets/img/beranda/post/inside') . '/' . $fileName;\n }", "public function upload()\n {\n if (null === $this->getImg()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getImg()->move(\n self::SERVER_PATH_TO_PRESS_IMAGE_FOLDER,\n $this->getImg()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->imageUrl = $this->getImg()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setImg(null);\n }", "public function upload() {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "public function uploadImage()\n {\n if (null === $this->fileimage) {\n return;\n }\n\n $upload = new Upload();\n $this->image = $upload->createName(\n $this->fileimage->getClientOriginalName(),\n $this->getUploadRootDir().'/',\n array('tmp/','miniature/')\n );\n\n $imagine = new Imagine();\n\n /* Tmp */\n $size = new Box(1920,1080);\n $imagine->open($this->fileimage)\n ->thumbnail($size, 'inset')\n ->save($this->getUploadRootDir().'tmp/'.$this->image);\n\n /* Miniature */\n $size = new Box(300,300);\n $imagine->open($this->fileimage)\n ->thumbnail($size, 'outbound')\n ->save($this->getUploadRootDir().'miniature/'.$this->image);\n\n }", "public function uploadImage()\n {\n /* Getting current user's data */\n $user = Auth::getUser();\n\n /* Checking if user is online */\n if ($user) {\n\n /* Checking if image was upload */\n if (is_uploaded_file($_FILES['image']['tmp_name'])) {\n\n /* Creating new Upload's object */\n $upload = new Upload([\n 'subfolder' => 'answers/',\n 'name' => $_FILES['image']['name'],\n 'type' => $_FILES['image']['type'],\n 'tmp_name' => $_FILES['image']['tmp_name'],\n 'error' => $_FILES['image']['error'],\n 'size' => $_FILES['image']['size'],\n ]);\n\n /* Setting new random title for image */\n $upload->name = $upload->getRandomFilename(pathinfo($_FILES['image']['name'], PATHINFO_EXTENSION));\n\n /* Uploading image */\n if ($upload->upload()) {\n\n /* Return response */\n header('Content-Type: application/json');\n echo json_encode('/media/images/answers/'.$upload->name);\n }\n }\n }\n\n return false;\n }", "public function uploadAction() {\n $imgId = $this->getInput('imgId');\n $this->assign('imgId', $imgId);\n $this->getView()\n ->display('common/upload.phtml');\n }", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "function uploadImage($image, $imagefile){\r\n $target_dir = $_SERVER['DOCUMENT_ROOT'] . \"/assets/images/news/\";\r\n $target_file = $target_dir . basename($image);\r\n $imageFileType = pathinfo($target_file, PATHINFO_EXTENSION);\r\n if ($imageFileType != \"jpg\" && $imageFileType != \"png\" && $imageFileType != \"jpeg\") {\r\n } else {\r\n move_uploaded_file($imagefile[\"tmp_name\"], $target_file);\r\n }\r\n }", "public function upload(): void\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->logo = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "public function actionUploadImageDepartment()\n {\n $filename = $_FILES['file']['name'];\n /* Location */\n $location = \"C:/OpenServer/domains/localhost/application/photo/department/\" . $filename;\n $uploadOk = 1;\n $imageFileType = pathinfo($location, PATHINFO_EXTENSION);\n /* Valid Extensions */\n $valid_extensions = array(\"jpg\", \"jpeg\", \"png\");\n /* Check file extension */\n if (!in_array(strtolower($imageFileType), $valid_extensions)) {\n $uploadOk = 0;\n }\n if ($uploadOk == 0) {\n echo 0;\n } else {\n /* Upload file */\n if (move_uploaded_file($_FILES['file']['tmp_name'], $location)) {\n echo $filename;\n } else {\n // echo 0;\n }\n }\n }", "public function upload()\n\t{\n\t if (null === $this->getFile()) {\n\t return;\n\t }\n\t\n\t // use the original file name here but you should\n\t // sanitize it at least to avoid any security issues\n\t\n\t // move takes the target directory and then the\n\t // target filename to move to\n\t \n\t $this->getFile()->move($this->getWebPath(),$this->imagen);\n\t \n\t \n\t // set the path property to the filename where you've saved the file\n\t $this->path = $this->getFile()->getClientOriginalName();\n\t\t//$this->temp = \n\t // clean up the file property as you won't need it anymore\n\t $this->file = null;\n\t}", "public function upload();", "public function uploadImage()\n {\n if ((isset($_FILES['image']['name']))\n && (!empty($_FILES['image']['name']))\n ) {\n try {\n $uploader = new Varien_File_Uploader('image');\n $uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));\n $uploader->setAllowRenameFiles(FALSE);\n $uploader->setFilesDispersion(FALSE);\n $path = Mage::getBaseDir('media') . DS . 'catalog' . DS . 'slidermanager';\n $uploader->save($path, $_FILES['image']['name']);\n\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')\n ->addError($e->getMessage());\n }\n\n return $_FILES['image']['name'];\n }\n\n return '';\n }", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n if(!is_dir($this->getTargetUploadRootDir())){\n mkdir($this->getTargetUploadRootDir(), 0777, true);\n }\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getTargetUploadRootDir(),\n $this->file->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = date('Y-m-d').DIRECTORY_SEPARATOR.$this->id.DIRECTORY_SEPARATOR.$this->file->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n //Checks if the path is null\n if (null === $this->file) {\n return;\n }\n\n $hash = uniqid('', true);\n $extension = $this->file->getClientOriginalExtension();\n $newFilename = $hash.'.'.$extension;\n\n $this->file->move($this->getUploadRootDir(), $newFilename);\n $this->path = $newFilename;\n\n // Clean the path file\n $this->file = null;\n }", "public function upload()\n{\n if(null === $this->getFile())\n {\n return;\n }\n\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n $this->filename =$this->getFile()->getClientOriginalName();\n\n $this->setFile(null);\n}", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->backgroundImage = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload($image)\n {\n // $image = Image::make($image)->fit(300);\n // Storage::put($path, (string) $image->encode());\n // return $url = Storage::url($path);\n\n $image_name = time() . rand(1, 100000) . '.' . $image->getClientOriginalExtension();\n $image->move(public_path('images'), $image_name);\n return 'images/' . $image_name;\n }", "function uploadFile($name)\n{\n // Gets the paths, full and local directory\n global $image_dir, $image_dir_path;\n if (isset($_FILES[$name])) {\n // Gets the actual file name\n $filename = $_FILES[$name]['name'];\n if (empty($filename)) {\n return;\n }\n // Get the file from the temp folder on the server\n $source = $_FILES[$name]['tmp_name'];\n // Sets the new path - images folder in this directory\n $target = $image_dir_path . '/' . $filename;\n // Moves the file to the target folder\n move_uploaded_file($source, $target);\n // Send file for further processing\n processImage($image_dir_path, $filename);\n // Sets the path for the image for Database storage\n $filepath = $image_dir . '/' . $filename;\n // Returns the path where the file is stored\n return $filepath;\n }\n}", "public function actionUploadImageNews()\n {\n $filename = $_FILES['file']['name'];\n /* Location */\n $location = \"C:/OpenServer/domains/localhost/application/photo/news/\".$filename;\n $uploadOk = 1;\n $imageFileType = pathinfo($location,PATHINFO_EXTENSION);\n /* Valid Extensions */\n $valid_extensions = array(\"jpg\",\"jpeg\",\"png\");\n /* Check file extension */\n if( !in_array(strtolower($imageFileType),$valid_extensions) ) {\n $uploadOk = 0;\n }\n if($uploadOk == 0){\n echo 0;\n }else{\n /* Upload file */\n if(move_uploaded_file($_FILES['file']['tmp_name'],$location)){\n echo $filename;\n\n }else{\n // echo 0;\n }\n }\n }", "function submitImage($userId){\n $target_dir = \"uploads/$userId/\"; //String interpolation is available this way in PHP, but not suggested\n createDirIfNeeded($target_dir);\n $target_file = $target_dir . basename($_FILES[\"fileToUpload\"][\"name\"]);\n $uploadOk = 1;\n $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));\n // Check if image file is a actual image or fake image\n if(isset($_POST[\"submit\"])) {\n $check = getimagesize($_FILES[\"fileToUpload\"][\"tmp_name\"]);\n if($check !== false) {\n echo \"File is an image - \" . $check[\"mime\"] . \".\";\n $uploadOk = 1;\n } else {\n echo \"File is not an image.\";\n $uploadOk = 0;\n }\n }\n if ($uploadOk == 0) {\n echo \"Sorry, your file was not uploaded.\";\n // if everything is ok, try to upload file\n } else {\n if (move_uploaded_file($_FILES[\"fileToUpload\"][\"tmp_name\"], $target_file)) {\n echo \"The file \". basename( $_FILES[\"fileToUpload\"][\"name\"]). \" has been uploaded.\";\n } else {\n echo \"Sorry, there was an error uploading your file.\";\n }\n }\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->setImageName($this->getFile()->getClientOriginalName());\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->avatar)\n {\n return;\n }\n\n //Lastname du fichier\n $file = $this->id_user.'.'.$this->avatar->guessExtension();\n // move takes the target directory and then the target filename to move to\n $this->avatar->move($this->getUploadRootDir(), $file);\n //Suppression des thumbnail déjà en cache\n @unlink(__DIR__.'/../../../../../web/imagine/thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/avatar_thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/moyen_thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/mini_thumbnail/avatars/'.$file);\n\n // set the path property to the filename where you'ved saved the file\n $this->avatar = $file;\n }", "public function upload_img()\r\n {\r\n if(!is_dir('./uploads/groups'))mkdir(('./uploads/groups')); \r\n if (!empty($_FILES)) \r\n { \r\n $tempFile = $_FILES['file']['tmp_name']; \r\n\r\n $file_info = explode('.',$_FILES['file']['name']);\r\n $file_ext = $file_info[1];\r\n\r\n $targetPath = './uploads/groups'; \r\n\r\n $newFile = time().'.'.$file_ext;\r\n \r\n $targetFile = $targetPath.$newFile; \r\n \r\n move_uploaded_file($tempFile,$targetFile); \r\n\r\n $this->output->set_output(json_encode($newFile));\r\n }\r\n }", "public function uploadImageSave($file_image) {\n if (!empty($file_image)) {\n $upload_folder = WWW_ROOT . \"files\" . DS . \"slide-app\";\n $upload_folder_specific = $upload_folder . DS;\n if (!is_dir($upload_folder)) {\n mkdir($upload_folder, 0755, true);\n }\n if (!is_dir($upload_folder_specific)) {\n mkdir($upload_folder_specific, 0755, true);\n }\n $tmp_file = WWW_ROOT . \"tmp\" . DS . $file_image;\n if (file_exists($tmp_file)) {\n $image = new File($tmp_file, true, 0755);\n $file_name = md5(time() + rand(0, 1000));\n $ext = $image->ext();\n $mime_type = $image->mime();\n $size = $image->size();\n $aft_file = $upload_folder_specific . DS . $file_name . \".\" . $ext;\n $image->copy($aft_file);\n array_map('unlink', glob(WWW_ROOT . \"tmp\" . DS . '*'));\n }\n }\n return $file_name . \".\" . $ext;\n }", "public function upload()\n {\n if(!Csrf::checkToken($this->_request->getInput('_CSRF')))\n {\n $response = [\n 'status' => 'error',\n 'message' => 'csrf'\n ];\n return $this->_response->returnJson($response);\n }\n\n $file = $this->_request->getUploadedFile('img');\n $uploader = new ImageUpload(new Imagick($file['tmp_name']));\n $uploadResult = $uploader->upload($file);\n\n return $this->_response->returnJson($uploadResult);\n }", "public function upload(){\n if( NULL === $this->getFile()){\n return;\n }\n $filename= $this->getFile()->getClientOriginalName();\n\n // Move to the target directory\n \n $this->getFile()->move(\n $this->getAbsolutePath(), \n $filename);\n\n //Set the logo\n $this->setFilename($filename);\n\n $this->setFile();\n\n }", "public static function uploadImage($imageFolder, $upload_file_name)\n {\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n if (is_uploaded_file($_FILES['image']['tmp_name'])) {\n //First, Validate the file name\n if (empty($_FILES['image']['name'])) {\n exit;\n }\n\n //Too long file name\n if (strlen($upload_file_name) > 100) {\n exit;\n }\n\n //replace any non-alpha-numeric cracters in th file name\n $upload_file_name = preg_replace(\"/[^A-Za-z0-9 \\.\\-_]/\", '', $upload_file_name);\n\n //set a limit to the file upload size\n if ($_FILES['image']['size'] > 1000000) {\n exit;\n }\n\n //Save the file\n $dest = __DIR__ . '/../public/images/' . $imageFolder . \"/\" . $upload_file_name;\n if (move_uploaded_file($_FILES['image']['tmp_name'], $dest)) {\n }\n }\n }\n }", "public function uploadAction()\n {\n $logedUser = $this->getServiceLocator()\n ->get('user')\n ->getUserSession();\n $permission = $this->getServiceLocator()\n ->get('permissions')\n ->havePermission($logedUser[\"idUser\"], $logedUser[\"idWebsite\"], $this->moduleId);\n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\")) {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Get Message Service\n $message = $this->getServiceLocator()->get('systemMessages');\n \n $files = $request->getFiles()->toArray();\n $temp = explode(\".\", $files[\"file\"][\"name\"]);\n $newName = round(microtime(true));\n $newfilename = $newName . '.' . end($temp);\n $image = new Image();\n $image->exchangeArray(array(\n \"website_id\" => $logedUser[\"idWebsite\"],\n \"name\" => $newName,\n \"extension\" => end($temp)\n ));\n if ($image->validation()) {\n if (move_uploaded_file($_FILES[\"file\"][\"tmp_name\"], \"public/files_database/\" . $logedUser[\"idWebsite\"] . \"/\" . $newfilename)) {\n $result = $this->getImageTable()->saveImage($image);\n $message->setCode($result);\n // Log\n $this->getServiceLocator()\n ->get('systemLog')\n ->addLog(0, $message->getMessage(), $message->getLogPriority());\n die('uploadSucess');\n } else {\n die('uploadError');\n }\n } else {\n die('Invalid extension');\n }\n }\n die(\"forbiden\");\n } else {\n die(\"forbiden - without permission\");\n }\n }", "public function actionUpload()\n {\n if (isset($_GET['department_id_from_url'])) {\n $filename = $_FILES['file']['name'];\n /* Location */\n $location = \"C:/OpenServer/domains/localhost/application/photo/\".$_GET['department_id_from_url'].\"/\" . $filename;\n $uploadOk = 1;\n $imageFileType = pathinfo($location, PATHINFO_EXTENSION);\n /* Valid Extensions */\n $valid_extensions = array(\"jpg\", \"jpeg\", \"png\");\n /* Check file extension */\n if (!in_array(strtolower($imageFileType), $valid_extensions)) {\n $uploadOk = 0;\n echo 0;\n }\n if ($uploadOk == 0) {\n echo 0;\n } else {\n /* Upload file */\n if (move_uploaded_file($_FILES['file']['tmp_name'], $location)) {\n echo $filename;\n } else {\n echo 0;\n }\n }\n }\n }", "function media_upload_image()\n {\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $filename = substr( md5(rand()), 0, 15).'.'.$this->getFile()->guessExtension();\n // move takes the target directory and then the\n // target filename to move to\n\n\n\t\t\t\tif(!file_exists($this->getUploadRootDir())) mkdir($this->getUploadRootDir(), 0777, true);\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function store(){\n $url_path = 'assets/imgs/' . $_FILES['file']['name'];\n move_uploaded_file($_FILES['file']['tmp_name'], $url_path);\n $_POST['url_image'] = $url_path;\n echo parent::register($_POST) ? header('location: ?controller=admin') : 'Error en el registro';\n }", "function m_uploadImage()\n\t{\n\t\t$fileUpload = new FileUpload();\n\t\t$name=$this->request['img'];\n\t\tif($this->libFunc->checkImageUpload(\"image\"))\n\t\t{\n\t\t\t\t$fileUpload->source = $_FILES[\"image\"][\"tmp_name\"];\n\t\t\t\t$fileUpload->target = $this->imagePath.\"giftwrap/\".$_FILES[\"image\"][\"name\"];\n\t\t\t\t$newName1 = $fileUpload->upload();\n\t\t\t\t$this->obDb->query=\"UPDATE \".GIFTWRAPS.\" set\n\t\t\t\t $name='$newName1' where iGiftwrapid_PK='\".$this->request['id'].\"'\";\n\t\t\t\t$this->obDb->updateQuery();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->libFunc->m_mosRedirect(SITE_URL.\"sales/adminindex.php?action=promotions.giftwrap.uploadForm&msg=2&img=\".$this->request['img'].\"&id=\".$this->request['id']);\n\t\t}\n\t\t$this->libFunc->m_mosRedirect(SITE_URL.\"sales/adminindex.php?action=promotions.giftwrap.uploadForm&msg=1&img=\".$this->request['img'].\"&id=\".$this->request['id']);\n\t}", "public function postProjectImageUpload()\n\t{\n\t\t#Get project id\n\t\t$id = Input::get( \"id\" );\n\t\t$type = Input::get( \"type\" );\n\n\t\t#Move upload file\n\t\t$file = Input::file( 'file' );\n\t\t$file_name = $file->getClientOriginalName();\n\t\t$file_name = preg_replace( '/\\s+/', '', $file_name );\n\t\t$file->move( 'uploads/project_' . $this->_getTypeName( $type ), $file_name );\n\n\t\t//Store image to session\n\t\t$images_arr = Session::has( \"image[{$type}]\" ) ? Session::get( \"image[{$type}]\" ) : array();\n\t\t$image_item = array( 'image' => $file_name );\n\t\tarray_push( $images_arr, $image_item );\n\t\tSession::set( \"image[{$type}]\", $images_arr );\n\n\t\treturn $file_name;\n\t}", "public function photoupload()\n\t{\n\t\ttry {\n\t\t\t\n\t\t\t$uploader = new fUpload();\n\t\t\t$uploader->setMIMETypes(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'image/gif',\n\t\t\t\t\t\t\t'image/jpeg',\n\t\t\t\t\t\t\t'image/pjpeg',\n\t\t\t\t\t\t\t'image/png'\n\t\t\t\t\t),\n\t\t\t\t\ts('upload_no_image')\n\t\t\t);\n\t\t\t$uploader->setMaxSize('5MB');\n\t\t\t\n\t\t\tif(($error = $uploader->validate('photo', TRUE)) !== null)\n\t\t\t{\n\t\t\t\t$func = 'parent.join.photoUploadError(\\''.$error.'\\');';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// move the uploaded file in a temp folder\n\t\t\t\t$image = $uploader->move(ROOT_DIR . 'tmp/', 'photo');\n\t\t\t\t\t\n\t\t\t\t// generate an unique name for the photo\n\t\t\t\t$name = uniqid() . '.' . strtolower($image->getExtension());\n\t\t\t\t\t\n\t\t\t\t$image->rename($name, true);\n\t\t\t\t\n\t\t\t\t$image = new fImage(ROOT_DIR . 'tmp/' . $name);\n\t\t\t\t\t\n\t\t\t\t$image->resize(800, 0);\n\t\t\t\t$image->saveChanges();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t$func = 'parent.join.readyUpload(\\''.$name.'\\');';\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t$func = 'parent.join.photoUploadError(\\''.s('error_image').'\\');';\n\t\t}\n\t\t\n\t\techo '<html>\n<head><title>Upload</title></head><body onload=\"'.$func.'\"></body>\n</html>';\n\t\texit();\n\t}", "function do_upload($filepath, $image_name, $folder)\n {\n $this->load->library('cloudinarylib');\n $return = \\Cloudinary\\Uploader::upload($filepath,\n array(\n \"folder\" => $folder,\n \"public_id\" => $image_name,\n \"resource_type\" => \"image\",\n \"eager_async\" => true,\n \"quality\" => 60,\n 'eager' => array(\"width\" => 630, \"height\" => 570, \"crop\" => \"fill\")\n )\n );\n return $return;\n }", "function uploadFile($name) {\r\n // Gets the paths, full and local directory\r\n global $image_dir, $image_dir_path;\r\n if (isset($_FILES[$name])) {\r\n // Gets the actual file name\r\n $filename = $_FILES[$name]['name'];\r\n if (empty($filename)) {\r\n return;\r\n }\r\n // Get the file from the temp folder on the server\r\n $source = $_FILES[$name]['tmp_name'];\r\n // Sets the new path - images folder in this directory\r\n $target = $image_dir_path . '/' . $filename;\r\n // Moves the file to the target folder\r\n move_uploaded_file($source, $target);\r\n // Send file for further processing\r\n processImage($image_dir_path, $filename);\r\n // Sets the path for the image for Database storage\r\n $filepath = $image_dir . '/' . $filename;\r\n // Returns the path where the file is stored\r\n return $filepath;\r\n }\r\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // if there is an error when moving the file, an exception will\n // be automatically thrown by move(). This will properly prevent\n // the entity from being persisted to the database on error\n $this->getFile()->move($this->getUploadRootDir(), $this->fileName);\n\n // check if we have an old image\n if (isset($this->temp)) {\n // delete the old image\n unlink($this->getUploadRootDir().'/'.$this->temp);\n // clear the temp image path\n $this->temp = null;\n }\n $this->file = null;\n }", "public function upload_file(){\n //return from method if file name is sample\n if($this->file_name == 'sample.jpg'){\n return;\n }\n\n $allowed_types = ['image/jpeg', 'image/gif', 'image/png'];\n //check file is an image\n if(!in_array($this->file_type, $allowed_types)){\n throw new Exception('File must be an image');\n exit;\n }\n\n //move from temp dir in to uploads folder\n move_uploaded_file($this->tmp_file_name, $this->dir_location . $this->file_name );\n }", "protected function getUploadDir()\n {\n return 'images';\n }", "public function getUploadImageDir()\n {\n return 'uploads/images';\n }", "public function actionUpload()\n\t{\n\n\t\t$input = craft()->request->getPost();\n\n\t\t$file = UploadedFile::getInstanceByName('file');\n\n\t\t$folder = craft()->assets->findFolder(array(\n\t\t 'id' => $input['id']\n\t\t));\n\n\t\tif ($folder) {\n\t\t\t$folderId = $input['id'];\n\t\t}\n\n\t\tcraft()->assets->insertFileByLocalPath(\n\t\t $file->getTempName(),\n\t\t $file->getName(),\n\t\t $folderId,\n\t\t AssetConflictResolution::KeepBoth);\n\n\t\tcraft()->end();\n\t}", "public function upload()\n\t{\n\t\t$field \t\t = $this->getUploadField();\n\t\t$newName \t = $this->getUploadNewName();\n\t\t//$destination = 'assets/images/location';\t\n\t\t$destination = $this->getUploadDestination();\n\n\t\tif (\\Input::hasFile($field))\n\t\t{\n\t\t \\Input::file($field)->move($destination, $newName);\n\t\t}\n\t\t\n\t\t$this->entity->fill([$field => $newName]);\n\t\t$this->entity->save();\n\n\t\treturn true;\n\t}", "public function upload()\n {\n // The file property can be empty if the field is not required\n if (null === $this->file) {\n return;\n }\n\n // Use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->path\n );\n\n // Set the path property to the filename where you've saved the file\n $this->path = $this->file->getClientOriginalName();\n\n // Clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->id . '.' .$this->ext\n );\n\n // set the ext property to the filename where you've saved the file\n //$this->ext = $this->file->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload(): void\n {\n // check if we have an old image\n if ($this->oldFileName !== null) {\n $this->removeOldFile();\n }\n\n if (!$this->hasFile()) {\n return;\n }\n\n $this->writeFileToDisk();\n\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n\n $filePath = md5(uniqid($this->getIdUser().\"_profil\",true)).\".\".\n $this->getFile()->guessClientExtension();\n\n $this->getFile()->move(\n $this->getUploadRootDir(),$filePath\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filePath;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload_image($file, $savePath, $partternPath)\n\t{\n\t\t$this->_upload();\t\n\t}", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // si on avait un ancien fichier on le supprime\n if (null !== $this->tempFilename) {\n $oldFile = $this->getUploadRootDir().'/'.$this->id.'.'.$this->tempFilename;\n if (file_exists($oldFile)) {\n unlink($oldFile);\n }\n }\n\n // déplace le fichier envoyé dans le répertoire de notre choix\n $this->file->move(\n $this->getUploadRootDir(), // répertoire de destination\n $this->id.'.'.$this->url // nom du fichier à créer \"id.extension\"\n );\n\n }", "public function uploadPath();", "function imageUpload( $directory, $key ) {\n if (!empty( $_FILES ) ) {\n $filename = $_FILES[ $key ][ 'tmp_name' ];\n $path = $directory . htmlspecialchars( $_FILES [ $key ][ 'name' ] );\n $success = move_uploaded_file( $filename, $path );\n if ( $success ) {\n return $path;\n }\n else {\n return false;\n }\n }\n return false;\n }", "public function upload() {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(), $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->photo = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function uploadimage()\n\t{\n\t\t$user = User::find($_POST['user_id']);\n\n\t\t$userprofile = Input::file( 'user_profile_image' );\n\n\t\tif( !empty( $userprofile ) )\n\t\t{\n\t\t\t$file_in = $userprofile->getRealPath();\n\n\t\t\t$file_out = 'profile/' . $_POST['user_id'] . \"-\" . str_random( 12 ) . \".jpg\";\n\n\t\t\t$img = Image::make( $file_in );\n\n\t\t\t$img->resize( 200, 200 );\n\n\t\t\t$img->save( Config::get('app.home') . '/public/' . $file_out, 80 );\n\n\t\t\t$handle = fopen( Config::get('app.home') . '/public/' . $file_out, \"r\" );\n\n\t\t\tFlysystem::connection( 'awss3' )->put( $file_out,\n\t\t\t\t\t\t\t\t\t\t\t\t fread( $handle,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t filesize( Config::get('app.home') . '/public/' . $file_out ) ) );\n\n\t\t\t$user->user_profile_image = $file_out;\n\t\t}\n\n\t\t$usercoverprofile = Input::file( 'user_cover_image' );\n\n\t\tif( !empty( $usercoverprofile ) )\n\t\t{\n\t\t\t$file_in = $usercoverprofile->getRealPath();\n\t\t\t$file_out = 'profile/' . $_POST['user_id'] . \"-\" . str_random( 12 ) . \".jpg\";\n\n\t\t\t$img = Image::make( $file_in );\n\n\t\t\t$img->resize( 200, 200 );\n\n\t\t\t$img->save( Config::get('app.home') . '/public/' . $file_out, 80 );\n\n\t\t\t$handle = fopen( Config::get('app.home') . '/public/' . $file_out, \"r\" );\n\n\t\t\tFlysystem::connection( 'awss3' )->put( $file_out,\n\t\t\t\t\t\t\t\t\t\t\t\t fread( $handle,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t filesize( Config::get('app.home') . '/public/' . $file_out ) ) );\n\n\t\t\t$user->user_cover_image = $file_out;\n\t\t}\n\t\t$user->save();\n\t\theader(\"Location:http://\".Config::get('app.url_admin').\"/user/\".$_POST['user_id']);\n\t\texit();\n\t\t/*end of code for upload user profile and cover image*/\n\t}", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $filename = substr( md5(rand()), 0, 15).'.'.$this->getFile()->guessExtension();\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function getUploadDir()\n {\n return 'uploads/img';\n }", "public function getUploadDir()\n {\n return 'uploads/img';\n }", "public function upload(UploadRequest $request)\n {\n\n \t$user = JWTAuth::authenticate(JWTAuth::getToken());\n $file = $request->file('avatar');\n $filename = date('dmY') . str_random(6) . '.' . $file->getClientOriginalExtension();\n\n $file->move(public_path('images'),$filename);\n DB::table('users')\n ->where('id', $user->id)\n ->update(['avatar' => url('images/'.$filename)]);\n \n return response()->json(['message' => 'photo uploaded'],201); \n\n }", "public function getUploadDir()\n {\n return 'uploads/images';\n }", "public function move_photo(){\n move_uploaded_file($this->tmp_path, '/home/a1031316/public_html/uploaded_images/'.$this->name);\n\n }", "protected function getUploadDir()\n {\n return 'uploads/images';\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n// use the original file name here but you should\n// sanitize it at least to avoid any security issues\n// move takes the target directory and then the\n// target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n// set the path property to the filename where you've saved the file\n $this->logo = $this->getFile()->getClientOriginalName();\n// clean up the file property as you won't need it anymore\n $this->file = null;\n\n\n }", "public function upload($img, $folder)\n {\n if (!$img) {\n return null;\n }\n $ext=$img->getClientOriginalExtension();\n $newImageName=\"$folder-\".now().uniqid().\".$ext\";\n $img->move(public_path(\"uploads/$folder\"), $newImageName);\n return \"/uploads/$folder/$newImageName\";\n }", "public function uploadImage(){\n\n $fileExt = explode('.', $this->fileName);\n $fileActualExt = strtolower(end($fileExt));\n $allowedExt = array('jpg', 'jpeg');\n\n if($this->fileError !== 0 && $this->fileSize > 8000 && !in_array($fileActualExt, $allowedExt)){\n return false;\n }\n $fileId = uniqid('', false).'.'.$fileActualExt;\n $fileDestination = '../api/image_entity/'.$fileId;\n\n $transfertDone = move_uploaded_file($this->fileTmp, $fileDestination);\n\n if($transfertDone){\n $app = App::getInstance();\n $systemManager = $app->getManager('System');\n $imageId = $systemManager->addImage($fileId);\n\n return $imageId;\n }\n\n }", "public function actionImageUpload()\n {\n $model = new WhateverYourModel();\n\n $imageFile = UploadedFile::getInstance($model, 'photo');\n\n $directory = Yii::getAlias('@common/upload') . DIRECTORY_SEPARATOR . Yii::$app->session->id . DIRECTORY_SEPARATOR;\n if (!is_dir($directory))\n {\n FileHelper::createDirectory($directory);\n }\n\n if ($imageFile)\n {\n $uid = uniqid(time(), true);\n $fileName = $uid . '.' . $imageFile->extension;\n $filePath = $directory . $fileName;\n if ($imageFile->saveAs($filePath))\n {\n $path = '/img/temp/' . Yii::$app->session->id . DIRECTORY_SEPARATOR . $fileName;\n return Json::encode([\n 'files' => [\n [\n 'name' => $fileName,\n 'size' => $imageFile->size,\n 'url' => $path,\n 'thumbnailUrl' => $path,\n 'deleteUrl' => 'image-delete?name=' . $fileName,\n 'deleteType' => 'POST',\n ],\n ],\n ]);\n }\n }\n\n return '';\n }", "public function store(Request $request)\n {\n //\n\n $user_id = Auth::id();\n $request->validate([\n\n 'image' => 'required|image|mimes:jpeg,png,jpg,webp|max:2048 '\n ]);\n $directory = public_path('images').'/'.$user_id;\n $imageName = time().'.'.$request->image->extension();\n\n //move the uploaded file to a directory named as user_id\n $saved = $request->image->move($directory, $imageName);\n $imagePath= \"$user_id/$imageName\";\n\n $imageUpload = new imageUpload;\n $imageUpload->name=$imageName;\n $imageUpload->path = \"images/$user_id/$imageName\";\n $imageUpload->user_id= $user_id;\n $imageUpload->save();\n\n return redirect()->route('getajaxupdate',['id' => $user_id])\n ->with('success','You have successfully uploaded image.')\n ->with('image',$imageName)\n ->with('id',$user_id);\n\n\n\n }", "public function upload(Request $request){\n if($request->hasFile('image')){\n $resorce = $request->file('image');\n $name = $resorce->getClientOriginalName();\n $resorce->move(\\base_path() .\"/public/images\", $name);\n $save = DB::table('images')->insert(['image' => $name]);\n echo \"Gambar berhasil di upload\";\n }else{\n echo \"Error to upload this file\";\n }\n }", "public function upload()\n\t{\n\t}", "public function Upload($object, $image)\n {\n $config = array(\n 'path' => DOCROOT . 'assets/img',\n 'randomize' => true,\n 'ext_whitelist' => array('img', 'jpg', 'jpeg', 'gif', 'png'),\n );\n // process the uploaded files in $_FILES\n Upload::process($config);\n // if there are any valid files\n if (Upload::is_valid())\n {\n // save them according to the config\n Upload::save();\n foreach(Upload::get_files() as $file)\n {\n $object->picture = 'http://localhost/ApiMusic/public/assets/img/' . $file['saved_as'];\n \n }\n }\n // and process any errors\n foreach (Upload::get_errors() as $file)\n {\n $this->Mensaje('500', 'Error al subir la imagen', $file);\n }\n $this->Mensaje('200', 'Imagen subida con exito', $file);\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n \n\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function uploadImage()\r\n {\r\n /*\r\n * Response codes\r\n * 000 - Нет ошибок\r\n * 001 - Нет данных\r\n * 002 - Ошибка получения параметров файла\r\n * 003 - Ошибка получения пути файла\r\n * 004 - Ошибка перемещения файла\r\n * 005 - Требования не соблюдены\r\n * 006 - Нет папки салона\r\n */\r\n if (isset($_POST) &&\r\n isset($_FILES) &&\r\n array_key_exists('upload', $_FILES) &&\r\n count($_FILES['upload']) > 0 &&\r\n array_key_exists('slug', $_POST) &&\r\n array_key_exists('img_name', $_POST) &&\r\n array_key_exists('type', $_POST)\r\n ) {\r\n $type = $_POST['type'];\r\n if ($this->authentication->has_permission($type . '_upload')) {\r\n $img_name = $_POST['img_name'];\r\n $tmpFilePath = $_FILES['upload']['tmp_name'][0];\r\n $tmpFileType = $_FILES['upload']['type'][0];\r\n $tmpFileExtension = pathinfo($_FILES['upload']['name'][0], PATHINFO_EXTENSION);\r\n $tmpFileSize = $_FILES['upload']['size'][0];\r\n $tmpImageInfo = getimagesize($_FILES['upload']['tmp_name'][0]);\r\n if (array_key_exists('img_slug', $_POST)) {\r\n $fileParams = $this->FieldsModel->getFile($_POST['img_slug'], $_POST['img_slug']);\r\n } else {\r\n $fileParams = $this->FieldsModel->getFile($type, $img_name);\r\n }\r\n if ($fileParams) {\r\n if (\r\n $tmpFileType != $fileParams['mime'] ||\r\n $tmpImageInfo['mime'] != $fileParams['mime'] ||\r\n $tmpFileExtension != $fileParams['ext'] ||\r\n $tmpFileSize > $fileParams['max_size'] ||\r\n $tmpImageInfo[0] > $fileParams['max_width'] ||\r\n $tmpImageInfo[0] < $fileParams['min_width'] ||\r\n $tmpImageInfo[1] > $fileParams['max_height'] ||\r\n $tmpImageInfo[1] < $fileParams['min_height']\r\n ) {\r\n if ($tmpFileExtension === 'svg') {\r\n //Do nothing\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не удовлетворяет требованиям.', 'code' => '005', 'fileparams' => $fileParams));\r\n return;\r\n }\r\n }\r\n // Make sure we have a file path\r\n if ($tmpFilePath != '') {\r\n // Setup new file path\r\n if (!file_exists('./media/' . $_POST['type'] . '/' . $_POST['slug'] . '/')) {\r\n mkdir('./media/' . $_POST['type'] . '/' . $_POST['slug']);\r\n //echo json_encode(array('status' => 'fail', 'message' => 'Салон не сконфигурирован. Обратитесь к поставщику услуг.', 'code' => '006'));\r\n //return;\r\n }\r\n $newFilePath = './media/' . $_POST['type'] . '/' . $_POST['slug'] . '/' . $_POST['img_name'] . '.' . $tmpFileExtension;\r\n // Upload the file into the temp dir\r\n if (move_uploaded_file($tmpFilePath, $newFilePath)) {\r\n // Create path to update image in frontend\r\n $path = base_url() . 'media/' . $_POST['type'] . '/' . $_POST['slug'] . '/' . $_POST['img_name'] . '.' . $tmpFileExtension;\r\n echo json_encode(array('status' => 'ok', 'message' => 'Изображение загружено.', 'code' => '000', 'path' => $path));\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, попробуйте еще раз!', 'code' => '004'));\r\n }\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, попробуйте еще раз!', 'code' => '003'));\r\n }\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, попробуйте еще раз!', 'code' => '002'));\r\n }\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, у вас нет прав!', 'code' => '999'));\r\n }\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, попробуйте еще раз!', 'code' => '001'));\r\n }\r\n }", "public function upload(){\n if (null === $this->getProductsFileImage()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getProductsFileImage()->move(\n $this->getUploadRootDir(),\n $this->getProductsFileImage()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getProductsFileImage()->getClientOriginalName();\n $this->productsImage = $this->getProductsFileImage()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->productsFileImage = null;\n }", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'gou_brand');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('code' , $ret['data']);\n\t\t$this->assign('msg' , $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadFile(){\n\n if (!$this->request->is('post'))\n {\n $this->setErrorMessage('Post method required');\n return;\n }\n\n if (!isset($this->request->data['currentPath']) ||\n !isset($this->request->params['form']) ||\n !isset($this->request->params['form']['idia'])\n ){\n $this->setErrorMessage('Invalid parameters');\n return;\n }\n\n $path = ltrim(trim($this->request->data['currentPath']), DS);\n $tokens = explode(DS, strtolower($path));\n\n ($tokens[0] == 'root') && ($tokens = array_slice($tokens, 1, null, true));\n\n $path = implode(DS, $tokens);\n $fullPath = WWW_FILE_ROOT . strtolower($path);\n\n if(!is_dir($fullPath)){\n $this->setErrorMessage('Invalid path');\n return;\n }\n\n if(is_file($fullPath . DS . strtolower($this->request->params['form']['idia']['name']))){\n $this->setErrorMessage('File with similar name already exist');\n return;\n }\n\n $newFile = new File($fullPath . DS . strtolower($this->request->params['form']['idia']['name']), true );\n $newFile->close();\n\n $tempFile = new File(($this->request->params['form']['idia']['tmp_name']));\n $tempFile->copy($fullPath . DS .$this->request->params['form']['idia']['name']);\n $tempFile->delete();\n\n $this->set(array(\n 'status' => 'ok',\n \"message\" => 'successful',\n \"_serialize\" => array(\"message\", \"status\")\n ));\n }", "public function uploadImage($image){\n\t\t\n\t\t$ruta = \"../public/uploads/\";\n\t\tini_set(\"max_execution_time\",0);\n\t\t$handle->forbidden \t= array('application/*');\n\t\t$handle \t\t\t= new Upload($image);\n\t\t\n\t\tif( $handle->uploaded ){\n\t\t\t\n\t\t\t$path1 = $ruta;\t\n\t\t\tif (!file_exists(\"$path1\")){\n\t\t\t\tmkdir($path1,0777);\n\t\t\t}\n\t\t\t//original <<<<<---------------------------- VER SI PUEDO BORRAR\n\t\t\t$path_ori1 = $ruta.'original/';\n\t\t\tif (!file_exists(\"$path_ori1\")){\n\t\t\t\tmkdir($path_ori1,0777);\n\t\t\t}\n\t\t\t$imagename =\t$handle->Process($path_ori1);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t// big-muro (height: 184px; width: 256px;)\n\t\t\t$path_big = $ruta.'big-post/';\n\t\t\t$handle->image_resize \t= true;\n\t\t\t$handle->image_ratio = true;\n \t\t \t$handle->jpeg_quality \t\t\t= 100;\n \t\t \tlist($org_width, $org_height) = getimagesize($image['tmp_name']);\n \t\t \t$handle->image_ratio_crop\t = true;\n\t\t\t$handle->image_resize = true;\n\t\t\t$handle->image_ratio = true;\n \t\t \t$handle->jpeg_quality \t\t\t= 100;\n\t\t\t$handle->image_x = 256;\n\t\t\t$handle->image_y = 184;\n\t\t\tif (!file_exists(\"$path_tapa\")){\n\t\t\t\tmkdir($path_tapa,0777);\n\t\t\t}\n\t\t\t$imagename = $handle->Process($path_big);\n\t\t\t\n\t\t\t// ampliada (width =\"758\" height =\"544\") \n\t\t\t$path_ampliada = $ruta.'ampliada/';\n\t\t\t$handle->image_resize \t= true;\n\t\t\t$handle->image_ratio = true;\n \t\t \t$handle->jpeg_quality \t\t\t= 100;\n \t\t \tlist($org_width, $org_height) = getimagesize($image['tmp_name']);\n \t\t \t$handle->image_ratio_crop\t = true;\n\t\t\t$handle->image_resize = true;\n\t\t\t$handle->image_ratio = true;\n \t\t \t$handle->jpeg_quality \t\t\t= 100;\n\t\t\t$handle->image_x = 658;\n\t\t\t$handle->image_y = 444;\n\t\t\tif (!file_exists(\"$path_tapa\")){\n\t\t\t\tmkdir($path_tapa,0777);\n\t\t\t}\n\t\t\t$imagename = $handle->Process($path_ampliada);\t\t\t\t\t\n\t\t\t\n\t\t\t$handle->Clean();\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $imagename; \n\t\t\n\t}", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'bestj');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('code' , $ret['data']);\n\t\t$this->assign('msg' , $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'Recsite');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('code' , $ret['data']);\n\t\t$this->assign('msg' , $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n }", "function do_upload($field_name , $path = '') {\n $config = array(\n 'upload_path' => $this->config->item ( 'admin_upload_path' ).$path,\n 'upload_url' => base_url() . $this->config->item ( 'admin_upload_path' ).$path,\n 'allowed_types' => \"gif|jpg|png|jpeg\"\n );\n $this->load->library('upload', $config);\n // create folder\n if (! is_dir ( $config ['upload_path'] )) {\n mkdir ( $config ['upload_path'], 0777, TRUE );\n }\n\n if ($this->upload->do_upload($field_name)) {\n //If image upload in folder, set also this value in \"$image_data\".\n $image_data = $this->upload->data();\n return $image_data;\n }\n else\n {\n $this->session->set_flashdata ( 'error', lang ( 'badge_upload_failure' ) . $this->upload->display_errors () );\n return false;\n }\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload_foto_file()\n\t{\n\t\tif (!$this->is_allowed('m_ads_add', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$uuid = $this->input->post('qquuid');\n\n\t\techo $this->upload_file([\n\t\t\t'uuid' \t\t \t=> $uuid,\n\t\t\t'table_name' \t=> 'm_ads',\n\t\t]);\n\t}", "public function uploads() {\n $this->Authorization->authorize($this->Settings->newEmptyEntity(), 'create');\n if ($this->request->is(\"Ajax\")) {\n $is_dest = \"img/tmp/\";\n if (!file_exists($is_dest)) {\n //mkdir($is_dest, 0777, true);\n $dir = new Folder(WWW_ROOT . 'img/tmp/', true, 0755);\n $is_dest = $dir->path;\n }\n $fileData = $this->request->getData('file');\n if (strlen($fileData->getClientFilename()) > 1) {\n $ext = pathinfo($fileData->getClientFilename(), PATHINFO_EXTENSION);\n $allowedExt = array('gif', 'jpeg', 'png', 'jpg', 'tif', 'bmp', 'ico');\n if ($this->request->getData('allow_ext')) {\n $allowedExt = explode(\",\", $this->request->getData('allow_ext'));\n }\n if (in_array(strtolower($ext), $allowedExt)) {\n $upload_img = $fileData->getClientFilename();\n $ran = time();\n $upload_img = $ran . \"_\" . $fileData->getClientFilename();\n if (strlen($upload_img) > 100) {\n $upload_img = $ran . \"_\" . rand() . \".\" . $ext;\n }\n $upload_img = str_replace(' ', '_', $upload_img);\n $fileData->moveTo($is_dest . $upload_img);\n $data['filename'] = $upload_img;\n $data['image_path'] = $this->request->getAttribute(\"webroot\") . \"img/tmp/\" . $upload_img;\n $data['success'] = true;\n $data['message'] = \"file successfully uploaded!\";\n } else {\n $data['success'] = false;\n $data['message'] = \"invalid file type!\";\n }\n } else {\n $data['success'] = false;\n $data['message'] = \"invalid file!\";\n }\n }\n $this->set($data);\n $this->viewBuilder()->setOption('serialize', ['filename', 'image_path','success', 'message']);\n }", "public function getUploadDir() {\n \treturn 'uploads/img';\n }", "public function upload(UploadableInterface $image);", "public function uploadImage()\n {\n $file = array('image' => \\Input::file('image'));\n // setting up rules\n $rules = array('image' => 'required',); //mimes:jpeg,bmp,png and for max size max:10000\n // doing the validation, passing post data, rules and the messages\n $validator = Validator::make($file, $rules);\n if ($validator->fails()) {\n // send back to the page with the input data and errors\n return Redirect::back()->withInput()->withErrors($validator);\n }\n else {\n // checking file is valid.\n if (Input::file('image')->isValid()) {\n $destinationPath = 'temp'; // upload path\n $extension = Input::file('image')->getClientOriginalExtension(); // getting image extension\n $fileName = rand(11111, 99999) . '.' . $extension; // renaming image\n Input::file('image')->move($destinationPath, $fileName); // uploading file to given path\n // sending back with message\n Session::flash('success', 'Upload successfully');\n return Redirect::to('upload');\n } else {\n // sending back with error message.\n Session::flash('error', 'uploaded file is not valid');\n return Redirect::to('upload');\n }\n }\n }", "function upload_image ()\n\t{\n\t\tif (!isset($_FILES) || empty($_FILES))\n\t\t\treturn \"img/noImage.jpg\";\n\n\t\t$extentions = array(\"jpg\",\"jpeg\",\"gif\",\"png\");\n\t\t$filetypes = array(\"image/gif\",\"image/jpeg\",\"image/png\",\"image/pjpeg\");\n\n\t\t$extracted_ext = explode(\".\",$_FILES[\"file\"][\"name\"]);\n\t\t$extracted_ext = end($extracted_ext);\n\n\t\tif (!in_array($_FILES[\"file\"][\"type\"], $filetypes) || !in_array($extracted_ext, $extentions))\n\t\t\treturn \"img/noImage.jpg\";\n\n\t\tif (file_exists(\"img/\".$_FILES[\"file\"][\"name\"]))\n\t\t\treturn \"img/\" . $_FILES[\"file\"][\"name\"];\n\n\t\tmove_uploaded_file($_FILES[\"file\"][\"tmp_name\"], \"img/\".$_FILES[\"file\"][\"name\"]);\n\n\t\treturn \"img/\" . $_FILES[\"file\"][\"name\"];\n\t}", "public function upload()\n {\n }", "function subir_img($directorio,$name){\n move_uploaded_file($_FILES['imagen']['tmp_name'],\"$directorio/$name\");\n}", "final private function uploadImage($file, string $dir) : string {\n # Directorio real\n $dir = str_replace('{{id_user}}',$this->id,$dir);\n \n # Crear el directorio si no existe\n if(!is_dir($dir)) {\n mkdir($dir,0777,true);\n } \n # Borrar todo contenido de allí \n else {\n foreach(glob($dir . '*') as $f) {\n if(is_file($f)) {\n unlink($f);\n }\n }\n }\n # Subir el archivo\n $file->move($dir, ($name = $file->getClientOriginalName()));\n return $name;\n }" ]
[ "0.75014377", "0.7426471", "0.73365986", "0.72539794", "0.7206848", "0.7186193", "0.7074563", "0.7059047", "0.70299363", "0.7007299", "0.7007299", "0.6988962", "0.6988962", "0.6988962", "0.6988962", "0.6988962", "0.6988962", "0.69413173", "0.6932226", "0.6901961", "0.6900001", "0.6871887", "0.6831288", "0.68256456", "0.6799945", "0.67837805", "0.67724144", "0.6750388", "0.67405784", "0.6740007", "0.6736802", "0.673648", "0.6723462", "0.6717494", "0.67086285", "0.67083055", "0.67080784", "0.6693609", "0.66863346", "0.667108", "0.6665412", "0.6665388", "0.6629502", "0.662019", "0.6616965", "0.6612674", "0.6609821", "0.65982187", "0.65979034", "0.6587407", "0.6581775", "0.65715873", "0.657042", "0.65594643", "0.6559101", "0.6557184", "0.6556664", "0.6552161", "0.65514547", "0.65469456", "0.65314484", "0.6527113", "0.65204155", "0.65133655", "0.65066606", "0.65061975", "0.65061975", "0.64983857", "0.64969707", "0.6491763", "0.64870554", "0.64857966", "0.6476947", "0.6459025", "0.6453416", "0.6451415", "0.64472705", "0.6444506", "0.6437685", "0.64308405", "0.6427833", "0.6418159", "0.6416847", "0.64095205", "0.64037275", "0.64026", "0.63994783", "0.6379665", "0.637049", "0.637049", "0.637049", "0.637049", "0.6369187", "0.6365479", "0.636152", "0.6359404", "0.6353855", "0.6353689", "0.6349268", "0.6349161", "0.6346232" ]
0.0
-1
Funtion to get the orientation and size (width & height) of source and target image
private function _calculate_size($source = array(), $target = array()) { $return = $target; switch($target['orientation']) { case 'portrait' : if($source['orientation'] == 'portrait') { if($source['height'] > $target['height']) { $test_width = $source['width'] / ($source['height'] / $target['height']); } else { $test_width = $source['width'] * ($target['height'] / $source['height']); } if($test_width >= $target['width']) { $return['height'] = $target['height']; $return['width'] = ''; } else { $return['width'] = $target['width']; $return['height'] = ''; } } else { $return['height'] = $target['height']; $return['width'] = ''; } break; case 'landscape' : if($source['orientation'] == 'landscape') { if($source['width'] > $target['width']) { $test_height = $source['height'] / ($source['width'] / $target['width']); } else { $test_height = $source['height'] * ($target['width'] / $source['width']); } if($test_height >= $target['height']) { $return['width'] = $target['width']; $return['height'] = ''; } else { $return['height'] = $target['height']; $return['width'] = ''; } } else { $return['width'] = $target['width']; $return['height'] = ''; } break; case 'box' : if($source['orientation'] == 'portrait') { $return['width'] = $target['width']; $return['height'] = ''; } elseif($source['orientation'] == 'landscape') { $return['height'] = $target['height']; $return['width'] = ''; } break; } return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_image_matches_ratio($source_width, $source_height, $target_width, $target_height)\n {\n }", "function get_intermediate_image_sizes()\n {\n }", "public function _get_img_info()\n {\n if ( ! file_exists($this->source_file) || ! filesize($this->source_file)) {\n return false;\n }\n list($this->source_width, $this->source_height, $type, $this->source_atts) = getimagesize($this->source_file);\n return isset($this->_avail_types[$type]) ? ($this->source_type = $this->_avail_types[$type]) : false;\n }", "function getImageSize() \n { \n return array($this->_width,$this->_height); \n }", "function _image_get_preview_ratio($w, $h)\n {\n }", "private static function resize_image($source, $width, $height){\n\t\t$source_width = imagesx($source);\n\t\t$source_height = imagesy($source);\n\t\t$source_aspect = round($source_width / $source_height, 1);\n\t\t$target_aspect = round($width / $height, 1);\n\t\n\t\t$resized = imagecreatetruecolor($width, $height);\n\t\n\t\tif ($source_aspect < $target_aspect){\n\t\t\t// higher\n\t\t\t$new_size = array($width, ($width / $source_width) * $source_height);\n\t\t\t$source_pos = array(0, (($new_size[1] - $height) * ($source_height / $new_size[1])) / 2);\n\t\t}else if ($source_aspect > $target_aspect){\n\t\t\t// wider\n\t\t\t$new_size = array(($height / $source_height) * $source_width, $height);\n\t\t\t$source_pos = array((($new_size[0] - $width) * ($source_width / $new_size[0])) / 2, 0);\n\t\t}else{\n\t\t\t// same shape\n\t\t\t$new_size = array($width, $height);\n\t\t\t$source_pos = array(0, 0);\n\t\t}\n\t\n\t\tif ($new_size[0] < 1) $new_size[0] = 1;\n\t\tif ($new_size[1] < 1) $new_size[1] = 1;\n\t\n\t\timagecopyresampled($resized, $source, 0, 0, $source_pos[0], $source_pos[1], $new_size[0], $new_size[1], $source_width, $source_height);\n\t\n\t\treturn $resized;\n\t}", "public function size()\n { \n $props = $this->uri->ruri_to_assoc();\n\n if (!isset($props['o'])) exit(0);\n $w = -1;\n $h = -1;\n $m = 0;\n if (isset($props['w'])) $w = $props['w'];\n if (isset($props['h'])) $h = $props['h'];\n if (isset($props['m'])) $m = $props['m'];\n\n $this->img->set_img($props['o']);\n $this->img->set_size($w, $h, $m);\n $this->img->set_square($m);\n $this->img->get_img();\n }", "function imageCheck($target,$width=1,$height=1){\n if($width==1&&$height==1){\n return is_array(getimagesize($target));\n }else{\n $rvalue = false;\n if(is_array(getimagesize($target))){\n try {\n $img = new Imagick($target);\n if(strtoupper($img->getImageFormat())=='GIF'){\n $img = $img->coalesceImages();\n $img = $img->coalesceImages();\n do {\n if($width==0||$height==0)\n $img->resizeImage($width, $height, Imagick::FILTER_BOX, 1);\n else $img->resizeImage($width, $height, Imagick::FILTER_BOX, 1,true);\n } while ($img->nextImage());\n $img = $img->deconstructImages();\n $img->writeImages($target,true);\n }else{\n if($width==0||$height==0)\n $img->thumbnailImage($width, $height);\n else $img->thumbnailImage($width, $height,true);\n $img->writeImage($target);\n }\n $img->destroy();\n $rvalue = true;\n } catch (Exception $e) {\n }\n }\n return $rvalue;\n }\n}", "public function getImageSize()\n\t{\n\t\tlist($width, $height) = getimagesize($this->getFullpath());\n\n\t\treturn compact('width', 'height');\n\t}", "function guy_imagedims($src) {\n\tif (substr($src,0,1)=='/') $src = \nsubstr_replace($src,$_SERVER['DOCUMENT_ROOT'].'/',0,1);\n\tif (is_file($src)) {\n\t\t$wh = @GetImageSize($src);\n\t\treturn $wh[3];\n\t}\n\treturn '';\n}", "private function _getProjectionSize() {\n\t\t$sourceWidth = $this->params['sourceWidth'];\n\t\t$sourceHeight = $this->params['sourceHeight'];\n\t\t$sourceRatio = $sourceWidth / $sourceHeight;\n\n\t\t$canvasWidth = $this->params['w'];\n\t\t$canvasHeight = $this->params['h'];\n\t\t$canvasRatio = $canvasWidth / $canvasHeight;\n\n\n\t\t//\tthe image is not allowed to be cut off in any dimension\n\t\tif ($sourceRatio < $canvasRatio) {\n\t\t\t//\tsource is less landscape-like than canvas\n\t\t\t$leadDimension = !$this->params['crop'] ?\n\t\t\t\t'Height' : 'Width';\n\t\t} else {\n\t\t\t//\tsource is more landscape-like than canvas\n\t\t\t$leadDimension = !$this->params['crop'] ?\n\t\t\t\t'Width' : 'Height';\n\t\t}\n\n\t\tif (\n\t\t\t!$this->params['grow'] &&\n\t\t\t${'source'.$leadDimension} < ${'canvas'.$leadDimension}\n\t\t) {\n\t\t\t${'projection'.$leadDimension} = ${'source'.$leadDimension};\n\t\t} else {\n\t\t\t${'projection'.$leadDimension} = ${'canvas'.$leadDimension};\n\t\t}\n\n\t\tif (isset($projectionWidth)) {\n\t\t\t$projectionHeight = $projectionWidth / $sourceRatio;\n\t\t} elseif (isset($projectionHeight)) {\n\t\t\t$projectionWidth = $projectionHeight * $sourceRatio;\n\t\t}\n\n\t\treturn array(round($projectionWidth), round($projectionHeight));\n\t}", "private function determineImageScale($sourceWidth, $sourceHeight, $targetWidth, $targetHeight) {\n\t $scalex = $targetWidth / $sourceWidth;\n\t $scaley = $targetHeight / $sourceHeight;\n\t return min($scalex, $scaley);\n\t}", "function image_reproportion()\n\t{\n\t\tif ( ! is_numeric($this->dst_width) OR ! is_numeric($this->dst_height) OR $this->dst_width == 0 OR $this->dst_height == 0)\n\t\t\treturn;\n\t\t\n\t\tif ( ! is_numeric($this->src_width) OR ! is_numeric($this->src_height) OR $this->src_width == 0 OR $this->src_height == 0)\n\t\t\treturn;\n\t\n\t\tif (($this->dst_width >= $this->src_width) AND ($this->dst_height >= $this->src_height))\n\t\t{\n\t\t\t$this->dst_width = $this->src_width;\n\t\t\t$this->dst_height = $this->src_height;\n\t\t}\n\t\t\n\t\t$new_width\t= ceil($this->src_width*$this->dst_height/$this->src_height);\t\t\n\t\t$new_height\t= ceil($this->dst_width*$this->src_height/$this->src_width);\n\t\t\n\t\t$ratio = (($this->src_height/$this->src_width) - ($this->dst_height/$this->dst_width));\n\n\t\tif ($this->master_dim != 'width' AND $this->master_dim != 'height')\n\t\t{\n\t\t\t$this->master_dim = ($ratio < 0) ? 'width' : 'height';\n\t\t}\n\t\t\n\t\tif (($this->dst_width != $new_width) AND ($this->dst_height != $new_height))\n\t\t{\n\t\t\tif ($this->master_dim == 'height')\n\t\t\t{\n\t\t\t\t$this->dst_width = $new_width;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->dst_height = $new_height;\n\t\t\t}\n\t\t}\n\t}", "function wp_image_src_get_dimensions($image_src, $image_meta, $attachment_id = 0)\n {\n }", "public function getImageDetails() {\n\t\t$details = getimagesize($this->file);\n\n\t\tif(!$details) throw new Exception('Falha na busca dos parametros da imagem!');\n\n\t\tlist($width, $height, $type, $attr, $mime) = $details;\n\t\t$aspect = ($width > $height)?'landscape':'portrait';\n\t\t$ration = $width / $height;\n\n\t\treturn array('width' => $width,'height' => $height,'aspect' => $aspect,'ratio' => $ratio,'mime' => $mime,'type' => $type);\n\t}", "public static function calculateScaleDimensions($source, $targetSize)\n {\n // Get size of image (handle different param-possibilities)\n if (is_string($source)) {\n $sourceSize = @getimagesize($source);\n } else if ($source instanceof Imagick) {\n $sourceSize = $source->getImageGeometry();\n $source = null;\n } else {\n $sourceSize = $source;\n $source = null;\n }\n\n if (!$sourceSize) return false;\n\n $w = null;\n if (isset($sourceSize[0])) $w = $sourceSize[0];\n if (isset($sourceSize['width'])) $w = $sourceSize['width'];\n\n $h = null;\n if (isset($sourceSize[1])) $h = $sourceSize[1];\n if (isset($sourceSize['height'])) $h = $sourceSize['height'];\n\n if (!$w || !$h) return false;\n\n $originalSize = array($w, $h);\n\n // get output-width\n $outputWidth = 0;\n if (isset($targetSize[0])) $outputWidth = $targetSize[0];\n if (isset($targetSize['width'])) $outputWidth = $targetSize['width'];\n\n // get output-height\n $outputHeight = 0;\n if (isset($targetSize[1])) $outputHeight = $targetSize[1];\n if (isset($targetSize['height'])) $outputHeight = $targetSize['height'];\n\n // get crop-data\n $crop = isset($targetSize['crop']) ? $targetSize['crop'] : null;\n\n // get cover\n $cover = isset($targetSize['cover']) ? $targetSize['cover'] : true;\n\n if ($outputWidth == 0 && $outputHeight == 0) {\n if ($crop) {\n return array(\n 'width' => $crop['width'],\n 'height' => $crop['height'],\n 'rotate' => null,\n 'crop' => array(\n 'x' => $crop['x'],\n 'y' => $crop['y'],\n 'width' => $crop['width'],\n 'height' => $crop['height']\n ),\n );\n } else {\n // Handle keep original\n return array(\n 'width' => $originalSize[0],\n 'height' => $originalSize[1],\n 'rotate' => null,\n 'crop' => array(\n 'x' => 0,\n 'y' => 0,\n 'width' => $originalSize[0],\n 'height' => $originalSize[1]\n ),\n 'keepOriginal' => true,\n );\n }\n }\n\n // Check if image has to be rotated\n $rotate = null;\n if (Kwf_Registry::get('config')->image->autoExifRotate\n && $source\n && function_exists('exif_read_data')\n && isset($sourceSize['mime'])\n && ($sourceSize['mime'] == 'image/jpg'\n || $sourceSize['mime'] == 'image/jpeg')\n ) {\n try {\n $exif = exif_read_data($source);\n if (isset($exif['Orientation'])) {\n switch ($exif['Orientation']) {\n case 6:\n $originalSize = array($h, $w);\n $rotate = 90;\n case 8:\n $originalSize = array($h, $w);\n $rotate = -90;\n }\n }\n } catch (ErrorException $e) {\n $rotate = null;\n }\n }\n\n // Calculate missing dimension\n $calculateWidth = $originalSize[0];\n $calculateHeight = $originalSize[1];\n if ($crop) {\n $calculateWidth = $crop['width'];\n $calculateHeight = $crop['height'];\n }\n\n if ($cover) { // image will always have defined size\n\n if ($outputWidth == 0) {\n if (isset($targetSize['aspectRatio'])) {\n $outputWidth = round($outputHeight * $targetSize['aspectRatio']);\n } else {\n $outputWidth = round($outputHeight * ($calculateWidth / $calculateHeight));\n }\n if ($outputWidth <= 0) $outputWidth = 1;\n }\n if ($outputHeight == 0) {\n if (isset($targetSize['aspectRatio']) && $targetSize['aspectRatio']) {\n $outputHeight = round($outputWidth * $targetSize['aspectRatio']);\n } else {\n $outputHeight = round($outputWidth * ($calculateHeight / $calculateWidth));\n }\n if ($outputHeight <= 0) $outputHeight = 1;\n }\n if (!$crop) { // crop from complete image\n $crop = array();\n // calculate crop depending on target-size\n if (($outputWidth / $outputHeight) >= ($originalSize[0] / $originalSize[1])) {\n $crop['width'] = $originalSize[0];\n $crop['height'] = $originalSize[0] * ($outputHeight / $outputWidth);\n } else {\n $crop['height'] = $originalSize[1];\n $crop['width'] = $originalSize[1] * ($outputWidth / $outputHeight);\n }\n // calculate x and y of crop\n $xDiff = $originalSize[0] - $crop['width'];\n $crop['x'] = $xDiff > 0 ? $xDiff / 2 : 0;\n $yDiff = $originalSize[1] - $crop['height'];\n $crop['y'] = $yDiff > 0 ? $yDiff / 2 : 0;\n } else {\n $oldCrop['width'] = $crop['width'];\n $oldCrop['height'] = $crop['height'];\n if (($outputWidth / $outputHeight) >= ($crop['width'] / $crop['height'])) {\n $crop['width'] = $crop['width'];\n $crop['height'] = $crop['width'] * ($outputHeight / $outputWidth);\n } else {\n $crop['height'] = $crop['height'];\n $crop['width'] = $crop['height'] * ($outputWidth / $outputHeight);\n }\n $xDiff = $oldCrop['width'] - $crop['width'];\n $crop['x'] += $xDiff > 0 ? $xDiff / 2 : 0;\n $yDiff = $oldCrop['height'] - $crop['height'];\n $crop['y'] += $yDiff > 0 ? $yDiff / 2 : 0;\n }\n\n } elseif (!$cover) { // image keeps aspectratio and will not be scaled up\n\n // calculateWidth is cropWidth if existing else originalWidth.\n // prevent image scale up\n if (!$crop) {\n $crop = array(\n 'x' => 0,\n 'y' => 0,\n 'width' => $originalSize[0],\n 'height' => $originalSize[1]\n );\n }\n if ($calculateWidth <= $outputWidth && $calculateHeight <= $outputHeight) {\n $outputWidth = $calculateWidth;\n $outputHeight = $calculateHeight;\n } else {\n if ($calculateWidth < $outputWidth) {\n $outputWidth = $calculateWidth;\n }\n if ($calculateHeight < $outputHeight) {\n $outputHeight = $calculateHeight;\n }\n }\n $widthRatio = $outputWidth ? $calculateWidth / $outputWidth : null;\n $heightRatio = $outputHeight ? $calculateHeight / $outputHeight : null;\n if ($widthRatio > $heightRatio) {\n $outputWidth = $calculateWidth / $widthRatio;\n $outputHeight = $calculateHeight / $widthRatio;\n } else if ($heightRatio > $widthRatio) {\n $outputWidth = $calculateWidth / $heightRatio;\n $outputHeight = $calculateHeight / $heightRatio;\n }\n\n }\n\n $outputWidth = round($outputWidth);\n if ($outputWidth <= 0) $outputWidth = 1;\n $outputHeight = round($outputHeight);\n if ($outputHeight <= 0) $outputHeight = 1;\n\n $ret = array(\n 'width' => round($outputWidth),\n 'height' => round($outputHeight),\n 'rotate' => $rotate,\n 'crop' => $crop\n );\n\n //Set values to match original-parameters when original won't change\n if ($ret['crop']['x'] == 0\n && $ret['crop']['y'] == 0\n && $ret['crop']['width'] == $originalSize[0]\n && $ret['crop']['height'] == $originalSize[1]\n && $ret['width'] == $originalSize[0]\n && $ret['height'] == $originalSize[1]\n ) {\n $ret['rotate'] = null;\n $ret['keepOriginal'] = true;\n }\n\n return $ret;\n }", "public function getImageDetails($image) {\r\n\r\n$temp = getimagesize($this->src);\r\nif(null == $temp)\r\nthrow new Exception('Error while extracting the source image information');\r\n\r\n$this->width = $temp[0];\r\n$this->height = $temp[1];\r\n$this->type = $temp[2];\r\n}", "function width_height($imgurl){\n\n $data = getimagesize( $imgurl );\n $width = $data[0];\n $height = $data[1];\n\n echo 'width=\"'.$width.'\" height=\"'.$height.'\"';\n}", "function makeIcons_MergeCenter($src, $dst, $dstx, $dsty) {\n // $dst = destination image location\n // $dstx = user defined width of image\n // $dsty = user defined height of image\n $allowedExtensions = 'jpg jpeg gif png';\n\n $name = explode(\".\", $src);\n $currentExtensions = $name[count($name) - 1];\n $extensions = explode(\" \", $allowedExtensions);\n\n for ($i = 0; count($extensions) > $i; $i = $i + 1) {\n if ($extensions[$i] == $currentExtensions) {\n $extensionOK = 1;\n $fileExtension = $extensions[$i];\n break;\n }\n }\n\n if ($extensionOK) {\n $size = getImageSize($src);\n $width = $size[0];\n $height = $size[1];\n\n if ($width >= $dstx AND $height >= $dsty) {\n $proportion_X = $width / $dstx;\n $proportion_Y = $height / $dsty;\n\n if ($proportion_X > $proportion_Y) {\n $proportion = $proportion_Y;\n } else {\n $proportion = $proportion_X;\n }\n $target['width'] = $dstx * $proportion;\n $target['height'] = $dsty * $proportion;\n\n $original['diagonal_center'] =\n round(sqrt(($width * $width) + ($height * $height)) / 2);\n $target['diagonal_center'] =\n round(sqrt(($target['width'] * $target['width']) +\n ($target['height'] * $target['height'])) / 2);\n\n $crop = round($original['diagonal_center'] - $target['diagonal_center']);\n\n if ($proportion_X < $proportion_Y) {\n $target['x'] = 0;\n $target['y'] = round((($height / 2) * $crop) / $target['diagonal_center']);\n } else {\n $target['x'] = round((($width / 2) * $crop) / $target['diagonal_center']);\n $target['y'] = 0;\n }\n\n if ($fileExtension == \"jpg\" OR $fileExtension == 'jpeg') {\n $from = ImageCreateFromJpeg($src);\n } elseif ($fileExtension == \"gif\") {\n $from = ImageCreateFromGIF($src);\n } elseif ($fileExtension == 'png') {\n $from = imageCreateFromPNG($src);\n }\n\n $new = ImageCreateTrueColor($dstx, $dsty);\n\n imagecopyresampled($new, $from, 0, 0, $target['x'], $target['y'], $dstx, $dsty, $target['width'], $target['height']);\n\n if ($fileExtension == \"jpg\" OR $fileExtension == 'jpeg') {\n imagejpeg($new, $dst, 70);\n } elseif ($fileExtension == \"gif\") {\n imagegif($new, $dst);\n } elseif ($fileExtension == 'png') {\n imagepng($new, $dst);\n }\n }\n }\n}", "function imagethumb( $image_src , $image_dest = NULL , $max_size = 500, $expand = FALSE, $square = FALSE )\n{\n\tif( !file_exists($image_src) ) return FALSE;\n\n\t// Récupère les infos de l'image\n\t$fileinfo = getimagesize($image_src);\n\n\techo \"file infos :\".$fileinfo[0].\"---\".$fileinfo[1];\n\t\n\tif( !$fileinfo ) return FALSE;\n\n\t$width = $fileinfo[0];\n\t$height = $fileinfo[1];\n\n\n\t$type_mime = $fileinfo['mime'];\n\n\n\t$type = str_replace('image/', '', $type_mime);\n\n\t//echo \"\\ntype_mime --> \".$type;\n\n\tif( !$expand && max($width, $height)<=$max_size && (!$square || ($square && $width==$height) ) )\n\t{\n\t\t// L'image est plus petite que max_size\n\t\tif($image_dest)\n\t\t{\n\t\t\treturn copy($image_src, $image_dest);\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader('Content-Type: '. $type_mime);\n\t\t\treturn (boolean) readfile($image_src);\n\t\t}\n\t}\n\n\t// Calcule les nouvelles dimensions\n\t$ratio = $width / $height;\n\n\tif( $square )\n\t{\n\t\t$new_width = $new_height = $max_size;\n\n\t\tif( $ratio > 1 )\n\t\t{\n\t\t\t// Paysage\n\t\t\t$src_y = 0;\n\t\t\t$src_x = round( ($width - $height) / 2 );\n\n\t\t\t$src_w = $src_h = $height;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Portrait\n\t\t\t$src_x = 0;\n\t\t\t$src_y = round( ($height - $width) / 2 );\n\n\t\t\t$src_w = $src_h = $width;\n\t\t}\n\t}\n\telse\n\t{\n\t\t$src_x = $src_y = 0;\n\t\t$src_w = $width;\n\t\t$src_h = $height;\n\n\t\tif ( $ratio > 1 )\n\t\t{\n\t\t\t// Paysage\n\t\t\t$new_width = $max_size;\n\t\t\t$new_height = round( $max_size / $ratio );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Portrait\n\t\t\t$new_height = $max_size;\n\t\t\t$new_width = round( $max_size * $ratio );\n\t\t}\n\t}\n\n\t// Ouvre l'image originale\n\t$func = 'imagecreatefrom' . $type;\n\tif( !function_exists($func) ) return FALSE;\n\n\t$image_src = $func($image_src);\n\t$new_image = imagecreatetruecolor($new_width,$new_height);\n\n\t// Gestion de la transparence pour les png\n\tif( $type=='png' )\n\t{\n\t\timagealphablending($new_image,false);\n\t\tif( function_exists('imagesavealpha') )\n\t\t\timagesavealpha($new_image,true);\n\t}\n\n\t// Gestion de la transparence pour les gif\n\telseif( $type=='gif' && imagecolortransparent($image_src)>=0 )\n\t{\n\t\t$transparent_index = imagecolortransparent($image_src);\n\t\t$transparent_color = imagecolorsforindex($image_src, $transparent_index);\n\t\t$transparent_index = imagecolorallocate($new_image, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\n\t\timagefill($new_image, 0, 0, $transparent_index);\n\t\timagecolortransparent($new_image, $transparent_index);\n\t}\n\n\t// Redimensionnement de l'image\n\timagecopyresampled(\n\t\t$new_image, $image_src,\n\t\t0, 0, $src_x, $src_y,\n\t\t$new_width, $new_height, $src_w, $src_h\n\t);\n\n\t// Enregistrement de l'image\n\t$func = 'image'. $type;\n\tif($image_dest)\n\t{\n\t\t$func($new_image, $image_dest);\n\t}\n\telse\n\t{\n\t\theader('Content-Type: '. $type_mime);\n\t\t$func($new_image);\n\t}\n\n\t// Libération de la mémoire\n\timagedestroy($new_image); \n\n\treturn TRUE;\n}", "function create($filename=\"\")\n{\nif ($filename) {\n $this->src_image_name = trim($filename);\n}\n$dirname=explode(\"/\",$this->src_image_name);\nif(!file_exists(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\")){\n\t@mkdir(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\", 0755);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$this->src_image_name = @iconv(\"utf-8\",\"GBK\",$this->src_image_name);\n\t$this->met_image_name = @iconv(\"utf-8\",\"GBK\",$this->met_image_name);\n}\n$src_image_type = $this->get_type($this->src_image_name);\n$src_image = $this->createImage($src_image_type,$this->src_image_name);\nif (!$src_image) return;\n$src_image_w=ImageSX($src_image);\n$src_image_h=ImageSY($src_image);\n\n\nif ($this->met_image_name){\n $this->met_image_name = strtolower(trim($this->met_image_name));\n $met_image_type = $this->get_type($this->met_image_name);\n $met_image = $this->createImage($met_image_type,$this->met_image_name);\n $met_image_w=ImageSX($met_image);\n $met_image_h=ImageSY($met_image);\n $temp_met_image = $this->getPos($src_image_w,$src_image_h,$this->met_image_pos,$met_image);\n $met_image_x = $temp_met_image[\"dest_x\"];\n $met_image_y = $temp_met_image[\"dest_y\"];\n\t if($this->get_type($this->met_image_name)=='png'){imagecopy($src_image,$met_image,$met_image_x,$met_image_y,0,0,$met_image_w,$met_image_h);}\n\t else{imagecopymerge($src_image,$met_image,$met_image_x,$met_image_y,0,0,$met_image_w,$met_image_h,$this->met_image_transition);}\n}\nif ($this->met_text){\n $temp_met_text = $this->getPos($src_image_w,$src_image_h,$this->met_text_pos);\n $met_text_x = $temp_met_text[\"dest_x\"];\n $met_text_y = $temp_met_text[\"dest_y\"];\n if(preg_match(\"/([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i\", $this->met_text_color, $color))\n {\n $red = hexdec($color[1]);\n $green = hexdec($color[2]);\n $blue = hexdec($color[3]);\n $met_text_color = imagecolorallocate($src_image, $red,$green,$blue);\n }else{\n $met_text_color = imagecolorallocate($src_image, 255,255,255);\n }\n imagettftext($src_image, $this->met_text_size, $this->met_text_angle, $met_text_x, $met_text_y, $met_text_color,$this->met_text_font, $this->met_text);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$save_files=explode('/',$this->save_file);\n\t$save_files[count($save_files)-1]=@iconv(\"utf-8\",\"GBK\",$save_files[count($save_files)-1]);\n\t$this->save_file=implode('/',$save_files);\n}\nif ($this->save_file)\n{\n switch ($this->get_type($this->save_file)){\n case 'gif':$src_img=ImagePNG($src_image, $this->save_file); break;\n case 'jpeg':$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n case 'png':$src_img=ImagePNG($src_image, $this->save_file); break;\n default:$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n }\n}\nelse\n{\nif ($src_image_type = \"jpg\") $src_image_type=\"jpeg\";\n header(\"Content-type: image/{$src_image_type}\");\n switch ($src_image_type){\n case 'gif':$src_img=ImagePNG($src_image); break;\n case 'jpg':$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n case 'png':$src_img=ImagePNG($src_image);break;\n default:$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n }\n}\nimagedestroy($src_image);\n}", "function image_info($image)\n{\n // http://stackoverflow.com/a/2756441/1459873\n $is_path = preg_match('#^(\\w+/){1,2}\\w+\\.\\w+$#', $image);\n if ($is_path && false !== ($info = getimagesize($image))) {\n return array(\n 'width' => $info[0],\n 'height' => $info[1],\n 'mime' => $info['mime'],\n 'type' => 'file',\n );\n }\n $im = new \\Imagick();\n if ($im->readImageBlob($image)) {\n return array(\n 'width' => $im->getImageWidth(),\n 'height' => $im->getImageHeight(),\n 'mime' => $im->getImageMimeType(),\n 'type' => 'blob',\n );\n }\n return array('width' => 0, 'height' => 0, 'mime'=>'', 'type' => '');\n\n}", "function imageResize($imageResourceId=null,$width=null,$height=null, $targetWidth=null, $targetHeight=null) {\n\n// $targetWidth =300;\n// $targetHeight =260;\n// dd($imageResourceId,$width,$height, $targetWidth, $targetHeight);\n\n $targetLayer=imagecreatetruecolor($targetWidth,$targetHeight);\n imagecopyresampled($targetLayer,$imageResourceId,0,0,0,0,$targetWidth,$targetHeight, $width,$height );\n// imagecopyresized($targetLayer,$imageResourceId,0,0,0,0, $width,$height,$targetWidth,$targetHeight);\n\n return $targetLayer;\n }", "public function compress_image($source_file, $target_file, $nwidth, $nheight, $quality) {\r\n\t //Return an array consisting of image type, height, widh and mime type.\r\n\t $image_info = getimagesize($source_file);\r\n\t if(!($nwidth > 0)) $nwidth = $image_info[0];\r\n\t if(!($nheight > 0)) $nheight = $image_info[1];\r\n\r\n\t if(!empty($image_info)) {\r\n\t switch($image_info['mime']) {\r\n\t case 'image/jpeg' :\r\n\t if($quality == '' || $quality < 0 || $quality > 100) $quality = 75; //Default quality\r\n\t // Create a new image from the file or the url.\r\n\t $image = imagecreatefromjpeg($source_file);\r\n\t $thumb = imagecreatetruecolor($nwidth, $nheight);\r\n\t //Resize the $thumb image\r\n\t imagecopyresized($thumb, $image, 0, 0, 0, 0, $nwidth, $nheight, $image_info[0], $image_info[1]);\r\n\t // Output image to the browser or file.\r\n\t return imagejpeg($thumb, $target_file, $quality);\r\n\r\n\t break;\r\n\r\n\t case 'image/png' :\r\n\t if($quality == '' || $quality < 0 || $quality > 9) $quality = 6; //Default quality\r\n\t // Create a new image from the file or the url.\r\n\t $image = imagecreatefrompng($source_file);\r\n\t $thumb = imagecreatetruecolor($nwidth, $nheight);\r\n\t //Resize the $thumb image\r\n\t imagecopyresized($thumb, $image, 0, 0, 0, 0, $nwidth, $nheight, $image_info[0], $image_info[1]);\r\n\t // Output image to the browser or file.\r\n\t return imagepng($thumb, $target_file, $quality);\r\n\t break;\r\n\r\n\t case 'image/gif' :\r\n\t if($quality == '' || $quality < 0 || $quality > 100) $quality = 75; //Default quality\r\n\t // Create a new image from the file or the url.\r\n\t $image = imagecreatefromgif($source_file);\r\n\t $thumb = imagecreatetruecolor($nwidth, $nheight);\r\n\t //Resize the $thumb image\r\n\t imagecopyresized($thumb, $image, 0, 0, 0, 0, $nwidth, $nheight, $image_info[0], $image_info[1]);\r\n\t // Output image to the browser or file.\r\n\t return imagegif($thumb, $target_file, $quality); //$success = true;\r\n\t break;\r\n\r\n\t default:\r\n\t echo \"<h4>Not supported file type!</h4>\";\r\n\t break;\r\n\t }\r\n\t }\r\n\t}", "function imageResize($width, $height, $target){\n //formula accordingly...this is so this script will work\n //dynamically with any size image\n\n if ($width > $height) {\n $percentage = ($target / $width);\n } else {\n $percentage = ($target / $height);\n }\n\n //gets the new value and applies the percentage, then rounds the value\n $width = round($width * $percentage);\n $height = round($height * $percentage);\n\n //returns the new sizes in html image tag format...this is so you\n //\tcan plug this function inside an image tag and just get the\n\n return \"width=\".$width.\" height=\".$height.\"\";\n\n }", "public function getDimensions() {\n\t\treturn array('width' => $this->getImageWidth(),'height' =>$this->getImageHeight());\t\n\t}", "function resizeCropImage($src, $dst, $dstx, $dsty){\n\t\t//$dst = destination image location\n\t\t//$dstx = user defined width of image\n\t\t//$dsty = user defined height of image\n\t\t$allowedExtensions = 'jpg jpeg gif png';\n\t\t$name = explode(\".\", strtolower($src));\n\t\t$currentExtensions = $name[count($name)-1];\n\t\t$extensions = explode(\" \", $allowedExtensions);\n\n\t\tfor($i=0; count($extensions)>$i; $i=$i+1) {\n\t\t\tif($extensions[$i]==$currentExtensions)\n\t\t\t{ \n\t\t\t\t$extensionOK=1; \n\t\t\t\t$fileExtension=$extensions[$i]; \n\t\t\t\tbreak; \n\t\t\t}\n\t\t}\n\n\t\tif($extensionOK){\n\t\t\t$size = getImageSize($src);\n\t\t\t$width = $size[0];\n\t\t\t$height = $size[1];\n\t\t\tif($width >= $dstx AND $height >= $dsty){\n\t\t\t\t$proportion_X = $width / $dstx;\n\t\t\t\t$proportion_Y = $height / $dsty;\n\t\t\t\tif($proportion_X > $proportion_Y ){\n\t\t\t\t\t$proportion = $proportion_Y;\n\t\t\t\t}else{\n\t\t\t\t\t$proportion = $proportion_X ;\n\t\t\t\t}\n\t\t\t\t$target['width'] = $dstx * $proportion;\n\t\t\t\t$target['height'] = $dsty * $proportion;\n\t\t\t\t$original['diagonal_center'] = round(sqrt(($width*$width)+($height*$height))/2);\n\t\t\t\t$target['diagonal_center'] = round(sqrt(($target['width']*$target['width']) + ($target['height']*$target['height']))/2);\n\t\t\t\t$crop = round($original['diagonal_center'] - $target['diagonal_center']);\n\t\t\t\tif($proportion_X < $proportion_Y ){\n\t\t\t\t\t$target['x'] = 0;\n\t\t\t\t\t$target['y'] = round((($height/2)*$crop)/$target['diagonal_center']);\n\t\t\t\t}else{\n\t\t\t\t\t$target['x'] = round((($width/2)*$crop)/$target['diagonal_center']);\n\t\t\t\t\t$target['y'] = 0;\n\t\t\t\t}\n\t\t\t\tif($fileExtension == \"jpg\" OR $fileExtension=='jpeg'){ \n\t\t\t\t\t$from = ImageCreateFromJpeg($src); \n\t\t\t\t} elseif ($fileExtension == \"gif\"){ \n\t\t\t\t\t$from = ImageCreateFromGIF($src); \n\t\t\t\t} elseif ($fileExtension == 'png'){\n\t\t\t\t\t$from = imageCreateFromPNG($src);\n\t\t\t\t}\n\t\t\t\t$new = ImageCreateTrueColor ($dstx,$dsty);\n\t\t\t\timagecopyresampled ($new, $from, 0, 0, $target['x'], \n\t\t\t\t$target['y'], $dstx, $dsty, $target['width'], $target['height']);\n\t\t\t\tif($fileExtension == \"jpg\" OR $fileExtension == 'jpeg'){ \n\t\t\t\t\timagejpeg($new, $dst, 70); \n\t\t\t\t} elseif ($fileExtension == \"gif\"){ \n\t\t\t\t\timagegif($new, $dst); \n\t\t\t\t}elseif ($fileExtension == 'png'){\n\t\t\t\t\timagepng($new, $dst);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcopy($src, $dst);\n\t\t\t}\n\t\t}\n\t}", "protected function _generateThumbnail() {\n if ( $this->attributes['width'] == $this->_original_image_info[0] && $this->attributes['height'] == $this->_original_image_info[1] ) {\n $this->_calculated_width = $this->attributes['width'];\n return $this->_calculated_height = $this->attributes['height'];\n }\n if ( $this->attributes['width'] == 0 || $this->attributes['height'] == 0 ) {\n $this->_calculated_width = $this->_original_image_info[0];\n return $this->_calculated_height = $this->_original_image_info[1]; \n }\n //make sure the thumbnail directory exists. \n if ( !is_writable ( $this->thumbs_dir_path ) ) { \n trigger_error ( 'Cannot detect a writable thumbs directory!', E_USER_NOTICE );\n }\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = (int)$this->attributes['width'];\n $this->_calculated_height = (int)$this->attributes['height'];\n return $this->src = $this->_thumb_src; \n }\n // resize image\n $image = new Image();\n $image->open( $this->src, $this->thumb_background_rgb )\n ->resize( (int)$this->attributes['width'], (int)$this->attributes['height'] )\n ->save( $this->_thumb_src, (int)$this->thumb_quality );\n $this->_thumbnail = $image;\n $this->_calculated_width = $this->_thumbnail->getWidth();\n $this->_calculated_height = $this->_thumbnail->getHeight();\n $this->src = $this->_thumb_src;\n }", "function themify_img_resize_dimensions( $default, $orig_w, $orig_h, $dest_w, $dest_h ) {\r\n\t// set portion of the original image that we can size to $dest_w x $dest_h\r\n\t$aspect_ratio = $orig_w / $orig_h;\r\n\t$new_w = $dest_w;\r\n\t$new_h = $dest_h;\r\n\r\n\tif ( !$new_w ) {\r\n\t\t$new_w = (int)( $new_h * $aspect_ratio );\r\n\t}\r\n\r\n\tif ( !$new_h ) {\r\n\t\t$new_h = (int)( $new_w / $aspect_ratio );\r\n\t}\r\n\r\n\t$size_ratio = max( $new_w / $orig_w, $new_h / $orig_h );\r\n\r\n\t$crop_w = round( $new_w / $size_ratio );\r\n\t$crop_h = round( $new_h / $size_ratio );\r\n\r\n\t$s_x = floor( ( $orig_w - $crop_w ) / 2 );\r\n\t$s_y = floor( ( $orig_h - $crop_h ) / 2 );\r\n\r\n\t// the return array matches the parameters to imagecopyresampled()\r\n\t// int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h\r\n\treturn array( 0, 0, (int) $s_x, (int) $s_y, (int) $new_w, (int) $new_h, (int) $crop_w, (int) $crop_h );\r\n}", "function calc_size()\n\t{\n\t\t\t$size = getimagesize(ROOT_PATH . $this->file);\n\t\t\t$this->width = $size[0];\n\t\t\t$this->height = $size[1];\n\t}", "function ImageInfo($file){\n $ret=array('width'=>0,'height'=>0,'ImageExt'=>'');\n $size = getimagesize($file);\nif($size==FALSE){\n\n\n}else{\n $ext=explode(\"/\", $size['mime']);\n $ret['ImageExt']=$ext[1]; \n $ret['width']=$size[0]; \n $ret['height']=$size[1];\n}\nreturn $ret;\n}", "function makeIcons_MergeCenter($src, $dst, $dstx, $dsty){\n//$dst = destination image location\n//$dstx = user defined width of image\n//$dsty = user defined height of image\n\n$allowedExtensions = 'jpg jpeg gif png';\n\n$name = explode(\".\", $src);\n$currentExtensions = $name[count($name)-1];\n$extensions = explode(\" \", $allowedExtensions);\n\nfor($i=0; count($extensions)>$i; $i=$i+1){\nif($extensions[$i]==$currentExtensions)\n{ $extensionOK=1;\n$fileExtension=$extensions[$i];\nbreak; }\n}\n\nif($extensionOK){\n\n$size = getImageSize($src);\n$width = $size[0];\n$height = $size[1];\n\nif($width >= $dstx AND $height >= $dsty){\n\n$proportion_X = $width / $dstx;\n$proportion_Y = $height / $dsty;\n\nif($proportion_X > $proportion_Y ){\n$proportion = $proportion_Y;\n}else{\n$proportion = $proportion_X ;\n}\n$target['width'] = $dstx * $proportion;\n$target['height'] = $dsty * $proportion;\n\n$original['diagonal_center'] =\nround(sqrt(($width*$width)+($height*$height))/2);\n$target['diagonal_center'] =\nround(sqrt(($target['width']*$target['width'])+\n($target['height']*$target['height']))/2);\n\n$crop = round($original['diagonal_center'] - $target['diagonal_center']);\n\nif($proportion_X < $proportion_Y ){\n$target['x'] = 0;\n$target['y'] = round((($height/2)*$crop)/$target['diagonal_center']);\n}else{\n$target['x'] = round((($width/2)*$crop)/$target['diagonal_center']);\n$target['y'] = 0;\n}\n\nif($fileExtension == \"jpg\" OR $fileExtension=='jpeg'){\n$from = ImageCreateFromJpeg($src);\n}elseif ($fileExtension == \"gif\"){\n$from = ImageCreateFromGIF($src);\n}elseif ($fileExtension == 'png'){\n $from = imageCreateFromPNG($src);\n}\n\n$new = ImageCreateTrueColor ($dstx,$dsty);\n\nimagecopyresampled ($new, $from, 0, 0, $target['x'],\n$target['y'], $dstx, $dsty, $target['width'], $target['height']);\n\n if($fileExtension == \"jpg\" OR $fileExtension == 'jpeg'){\nimagejpeg($new, $dst, 70);\n}elseif ($fileExtension == \"gif\"){\nimagegif($new, $dst);\n}elseif ($fileExtension == 'png'){\nimagepng($new, $dst);\n}\n}\n}\n}", "public function write($_size, $src_path, $dst_path, $_resize = 0, $_trans = false)\r\n {\r\n if ( ! file_exists($src_path) ) return;\r\n if ( ! file_exists($dst_path) ) self::createPath($dst_path);\r\n \r\n //load the args\r\n $this->_Load_Args($_size, $_resize);\r\n $img_size = getimagesize($src_path);\r\n if ( $img_size[0] <= $this->_size[0] ) return true;\r\n\r\n $this->img_src = $this->getImageSource($src_path);\r\n if ($this->img_src == NULL) return;\r\n $w_src = imagesx( $this->img_src );\r\n $h_src = imagesy( $this->img_src );\r\n \r\n $_dst_posi = array();\r\n $_dst_size = array();\r\n switch ( $this->_resize )\r\n {\r\n case 0:\r\n $_dst_posi[0] = 0; $_dst_posi[1] = 0;\r\n $_dst_size[0] = $this->_size[0];\r\n $_dst_size[1] = $this->_size[1];\r\n $this->img_dst = imagecreatetruecolor($this->_size[0], $this->_size[1]);\r\n break;\r\n case 1:\r\n if ( $w_src < $this->_size[0] && $h_src < $this->_size[1] )\r\n {\r\n $this->_size[0] = $w_src;\r\n $this->_size[1] = $h_src;\r\n $_dst_size[0] = $this->_size[0]; $_dst_size[1] = $this->_size[1];\r\n $_dst_posi[0] = 0; $_dst_posi[1] = 0;\r\n }\r\n else\r\n {\r\n $_per = $w_src / $h_src;\r\n $aim_w = $this->_size[1] * $_per; //aim width\r\n if ( $aim_w < $this->_size[0] )\r\n {\r\n $_dst_size[0] = $aim_w;\r\n $_dst_size[1] = $this->_size[1];\r\n $_dst_posi[0] = ($this->_size[0] - $aim_w) / 2;\r\n $_dst_posi[1] = 0;\r\n }\r\n else\r\n {\r\n $_dst_size[0] = $this->_size[0];\r\n $_dst_size[1] = $this->_size[0] / $_per;\r\n $_dst_posi[0] = 0;\r\n $_dst_posi[1] = ($this->_size[1] - $_dst_size[1]) / 2; \r\n }\r\n }\r\n $this->img_dst = imagecreatetruecolor($this->_size[0], $this->_size[1]);\r\n break;\r\n case 2:\r\n \r\n if ( max($this->_size) == 0 ) return;\r\n $_ac = $this->_size[0] == 0 ? 1 : 0;\r\n //echo $w_src.', '.$h_src.', '.$_ac;\r\n \r\n if ( $_ac == 0 )\r\n {\r\n $_dst_size[0] = min($this->_size[0], $w_src);\r\n $_dst_size[1] = $_dst_size[0] * $h_src / $w_src;\r\n //echo $_dst_size[0].', '.$_dst_size[1];\r\n }\r\n else\r\n {\r\n $_dst_size[1] = min($this->_size[1], $h_src);\r\n $_dst_size[0] = $_dst_size[1] * $w_src / $h_src;\r\n //echo $_dst_size[0].', '.$_dst_size[1]; \r\n }\r\n $_dst_posi[0] = 0; $_dst_posi[1] = 0;\r\n $this->img_dst = imagecreatetruecolor($_dst_size[0], $_dst_size[1]);\r\n break;\r\n }\r\n \r\n if ( $this->img_dst == NULL ) return;\r\n //build a white background for the resource \r\n\r\n if ($_trans){\r\n $bg = imagecolorallocatealpha($this->img_dst, 255, 255, 255, 127);\r\n imagefill($this->img_dst, 0, 0, $bg);\r\n } else {\r\n $bg = imagecolorallocate($this->img_dst, 255, 255, 255);\r\n imagefill($this->img_dst, 0, 0, $bg);\r\n }\r\n /*\r\n bool imagecopyresampled ( resource dst_image, resource src_image, \r\n int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h )\r\n */\r\n $_copy = imagecopyresampled($this->img_dst, $this->img_src, $_dst_posi[0], $_dst_posi[1], 0, 0,\r\n $_dst_size[0], $_dst_size[1], $w_src, $h_src);\r\n $_out = true;\r\n //imagejpeg($this->img_dst, $dst_path, 100);\r\n switch ($this->_extension)\r\n {\r\n case 'GIF':\r\n $_out = imagegif($this->img_dst, $dst_path);\r\n break;\r\n case 'JPG':\r\n case 'JPEG':\r\n $_out = imagejpeg($this->img_dst, $dst_path, 100);\r\n break;\r\n case 'PNG':\r\n // support transparent background\r\n // add by dongyado<[email protected]>\r\n if ($_trans){\r\n imagealphablending( $this->img_dst, false );\r\n imagesavealpha( $this->img_dst, true ); \r\n }\r\n $_out = imagepng($this->img_dst, $dst_path);\r\n break;\r\n case 'WBMP':\r\n $_out = imagewbmp($this->img_dst, $dst_path);\r\n }\r\n \r\n return $_copy && $_out; \r\n }", "public function CalcWidthHeight()\n {\n list($this->width, $this->height) = $this->imgInfo;\n\n $aspectRatio = $this->width / $this->height;\n\n if($this->cropToFit && $this->newWidth && $this->newHeight) {\n $targetRatio = $this->newWidth / $this->newHeight;\n $this->cropWidth = $targetRatio > $aspectRatio ? $this->width : round($this->height * $targetRatio);\n $this->cropHeight = $targetRatio > $aspectRatio ? round($this->width / $targetRatio) : $this->height;\n if($this->verbose) { self::verbose(\"Crop to fit into box of {$this->newWidth}x{$this->newHeight}. Cropping dimensions: {$this->cropWidth}x{$this->cropHeight}.\"); }\n }\n else if($this->newWidth && !$this->newHeight) {\n $this->newHeight = round($this->newWidth / $aspectRatio);\n if($this->verbose) { self::verbose(\"New width is known {$this->newWidth}, height is calculated to {$this->newHeight}.\"); }\n }\n else if(!$this->newWidth && $this->newHeight) {\n $this->newWidth = round($this->newHeight * $aspectRatio);\n if($this->verbose) { self::verbose(\"New height is known {$this->newHeight}, width is calculated to {$this->newWidth}.\"); }\n }\n else if($this->newWidth && $this->newHeight) {\n $ratioWidth = $this->width / $this->newWidth;\n $ratioHeight = $this->height / $this->newHeight;\n $ratio = ($ratioWidth > $ratioHeight) ? $ratioWidth : $ratioHeight;\n $this->newWidth = round($this->width / $ratio);\n $this->newHeight = round($this->height / $ratio);\n if($this->verbose) { self::verbose(\"New width & height is requested, keeping aspect ratio results in {$this->newWidth}x{$this->newHeight}.\"); }\n }\n else {\n $this->newWidth = $this->width;\n $this->newHeight = $this->height;\n if($this->verbose) { self::verbose(\"Keeping original width & heigth.\"); }\n }\n }", "function imgSize($width, $height, $thumb_width = '100', $thumb_height = '100') {\n\t\t\n\t\t\n\t\t\n\t\t\tif($thumb_width == '') \n\t\t\t\t$thumb_width = '100';\n\t\t\tif($thumb_height == '') \n\t\t\t\t$thumb_height = '100';\n\t\t\t\t\n\t\t\techo $thumb_width.\" \\n\";\n\t\t\techo $thumb_height.\" \\n\";\n\t\t\t\n\t\t\t/*if($width > $thumb_width) {\n\t\t\t\t $image_size['width'] = $thumb_width;\n\t\t\t\t $image_size['height'] = round($height*$thumb_width/$width);\n\n\t\t\t\t\tif($image_size['height'] > $thumb_height) {\n\t\t\t\t\t\t $image_size['width'] = round($image_size['width']*$thumb_height/$image_size['height']);\n\t\t\t\t\t\t $image_size['height'] = $thumb_height;\n\t\t\t\t\t}\n\t\t\t} elseif($height > $thumb_height) {\n\t\t\t\t $image_size['height'] = $thumb_height;\n\t\t\t\t $image_size['width'] = round($width*$image_size['height']/$height);\n\t\t\t} else {\n\t\t\t\t\t$image_size['width'] = $width;\n\t\t\t\t\t$image_size['height'] = $height;\n\t\t\t\t}*/\n\t\t\t\t\n\t\t\t$image_size['width'] = $width;\n\t\t\t$image_size['height'] = $height;\n\t\t\t\t\n\t\t\treturn $image_size;\n\t\t}", "function _resizeImageGD2($src_file, $dest_file, $new_size, $imgobj) {\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n // GD can only handle JPG, PNG & GIF images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\" && $imgobj->_type !== \"gif\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"gif\" && !function_exists(\"imagecreatefromgif\")) {\r\n \treturn false;\r\n }\r\n \r\n // height/width\r\n $ratio = max($imgobj->_size[0], $imgobj->_size[1]) / $new_size;\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($imgobj->_size[0] / $ratio);\r\n $destHeight = (int)($imgobj->_size[1] / $ratio);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = @imagecreatefromjpeg($src_file);\r\n $dst_img = imagecreatetruecolor($destWidth, $destHeight);\r\n } else if ($imgobj->_type == \"png\") {\r\n $src_img = @imagecreatefrompng($src_file);\r\n $dst_img = imagecreatetruecolor($destWidth, $destHeight);\r\n \t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = @imagefill($dst_img, 0, 0, $img_white);\r\n } else {\r\n \t$src_img = @imagecreatefromgif($src_file);\r\n \t$dst_img = imagecreatetruecolor($destWidth,$destHeight);\r\n\t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = @imagefill($dst_img, 0, 0, $img_white);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $destWidth, $destHeight, $imgobj->_size[0], $imgobj->_size[1]);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $dest_file, $this->_JPEG_quality);\r\n } else if ($imgobj->_type == \"png\") {\r\n imagepng($dst_img, $dest_file);\r\n } else {\r\n \timagegif($dst_img, $dest_file);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true;\r\n }", "function imageresize($img,$target=\"\",$width=0,$height=0,$percent=0)\n{\n if (strpos($img,\".jpg\") !== false or strpos($img,\".jpeg\") !== false){\n\t $image = ImageCreateFromJpeg($img);\n\t $extension = \".jpg\";\n } elseif (strpos($img,\".png\") !== false) {\n\t $image = ImageCreateFromPng($img);\n\t $extension = \".png\";\n } elseif (strpos($img,\".gif\") !== false) {\n\t $image = ImageCreateFromGif($img);\n\t $extension = \".gif\";\n }elseif(getfiletype($img)=='bmp'){\n\t\t$image = ImageCreateFromwbmp($img);\n\t\t$extension = '.bmp';\n }\n\n $size = getimagesize ($img);\n\n // calculate missing values\n if ($width and !$height) {\n\t $height = ($size[1] / $size[0]) * $width;\n } elseif (!$width and $height) {\n\t $width = ($size[0] / $size[1]) * $height;\n } elseif ($percent) {\n\t $width = $size[0] / 100 * $percent;\n\t $height = $size[1] / 100 * $percent;\n } elseif (!$width and !$height and !$percent) {\n\t $width = 100; // here you can enter a standard value for actions where no arguments are given\n\t $height = ($size[1] / $size[0]) * $width;\n }\n\n $thumb = imagecreatetruecolor ($width, $height);\n\n if (function_exists(\"imageCopyResampled\"))\n {\n\t if (!@ImageCopyResampled($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1])) {\n\t\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t }\n\t} else {\n\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t}\n\n //ImageCopyResampleBicubic ($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\n if (!$target) {\n\t $target = \"temp\".$extension;\n }\n\n $return = true;\n\n switch ($extension) {\n\t case \".jpeg\":\n\t case \".jpg\": {\n\t\t imagejpeg($thumb, $target, 100);\n\t break;\n\t }\n\t case \".gif\": {\n\t\t imagegif($thumb, $target);\n\t break;\n\t }\n\t case \".png\": {\n\t\t imagepng($thumb, $target);\n\t break;\n\t }\n\t case \".bmp\": {\n\t\t imagewbmp($thumb,$target);\n\t }\n\t default: {\n\t\t $return = false;\n\t }\n }\n\n // report the success (or fail) of the action\n return $return;\n}", "function convertImageUA($imagepath,$ua)\n{\n\nglobal $defaultFormat,$defaultWidth,$defaultHeight,$defaultJSON;\n\n\n\tlist ($imwidth,$imheight)= getimagesize($imagepath);\n\tlist($format,$devwidth,$devheight,$resizeOption)= getCAP($ua);\n\t\n\tif ($resizeOption==1)// So it is not mobile. ust return the main image path\n\t{\n\treturn $imagepath;\n\t}\n\tif ($resizeOption==0)// Use default value as Screen resolution\n\t{\n \t\tlist($Rwidth,$Rheight)= array($defaultWidth,$defaultHeight); \n\t}\n\telse // So the Value is 2. You got a device, resize it\n\t{\n\t\tlist($Rwidth,$Rheight)=setImageDimension($imwidth,$imheight,$devwidth,$devheight);\n\t}\n\nlist ($imwidth,$imheight)= getimagesize($imagepath);\n\n$convD=$Rwidth.\"X\".$Rheight;\n$InputPathArr=explode(\"/\",$imagepath);\n$InputPathArrSize=count($InputPathArr);\n$InputImageFileName=$InputPathArr[$InputPathArrSize-1];\n$farray=explode(\".\",$InputImageFileName);\n$InputImageName=strtolower($farray[0]);\n$outputImageName=$InputImageName.\"_\".$Rwidth.\"x\".$Rheight;\n\n$outputFileFullpath=\"\";\n\n$OutputImageDir=\"\";\n for ($i=0; $i < ($InputPathArrSize-1); $i++ )\n {\n $OutputImageDir=$OutputImageDir.$InputPathArr[$i].\"/\";\t\n }\n$outputFileFullpath=$OutputImageDir.\"Resized/\".$outputImageName;\n$outputImageFull=$outputFileFullpath.\".\".$format;\n$uri=\"\";\nif (file_exists($outputImageFull))// So no need to resize again\n {\n return $outputImageFull;\n }\nif (($imwidth<= $devwidth)&&($imheight <= $devheight))// Image is shorter than screen \n $uri=$imagepath;\nelse\n $uri=resizeImage($imagepath,$format,$outputImageName,$Rwidth,$Rheight); \n \nreturn $uri;\n\n}", "protected function _generateThumbnail() {\n if ( $this->attributes['width'] == $this->_original_image_info[0] && $this->attributes['height'] == $this->_original_image_info[1] ) {\n $this->_calculated_width = $this->attributes['width'];\n return $this->_calculated_height = $this->attributes['height'];\n }\n if ( $this->attributes['width'] == 0 || $this->attributes['height'] == 0 ) {\n $this->_calculated_width = $this->_original_image_info[0];\n return $this->_calculated_height = $this->_original_image_info[1]; \n }\n //make sure the thumbnail directory exists. \n if ( !is_writable ( $this->thumbs_dir_path ) ) { \n trigger_error ( 'Cannot detect a writable thumbs directory!', E_USER_NOTICE );\n }\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = (int)$this->attributes['width'];\n $this->_calculated_height = (int)$this->attributes['height'];\n return $this->src = $this->_thumb_src; \n }\n // resize image\n $image = new Image();\n $image->open( $this->src, $this->thumb_background_rgb )\n ->resize( (int)$this->attributes['width'], (int)$this->attributes['height'] )\n ->save( $this->_thumb_src, (int)$this->thumb_quality );\n $this->_thumbnail = $image;\n $this->_calculated_width = $this->_thumbnail->getWidth();\n $this->_calculated_height = $this->_thumbnail->getHeight();\n $this->src = $this->_thumb_src;\n }", "function imageResize($width, $height, $target) {\t\n\tif ($width > $height) { \n\t\t$percentage = ($target / $width); \n\t} else { \n\t\t$percentage = ($target / $height); \n\t} \n\n\t//gets the new value and applies the percentage, then rounds the value \n\t$width = round($width * $percentage); \n\t$height = round($height * $percentage); \n\n\t//returns the new sizes in html image tag format...this is so you \n\t//can plug this function inside an image tag and just get the \n\treturn \"width=\\\"$width\\\" height=\\\"$height\\\"\"; \n\t}", "function _resizeImageGD1($src_file, $dest_file, $new_size, $imgobj) {\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n // GD1 can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\") {\r\n return false;\r\n }\r\n // height/width\r\n $ratio = max($imgobj->_size[0], $imgobj->_size[1]) / $new_size;\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($imgobj->_size[0] / $ratio);\r\n $destHeight = (int)($imgobj->_size[1] / $ratio);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = imagecreatefromjpeg($src_file);\r\n } else {\r\n $src_img = imagecreatefrompng($src_file);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n $dst_img = imagecreate($destWidth, $destHeight);\r\n imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $imgobj->_size[0], $imgobj->_size[1]);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $dest_file, $this->_JPEG_quality);\r\n } else {\r\n imagepng($dst_img, $dest_file);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true; \r\n }", "function reduce_image(string $fileName, string $targetFile, int $maxWidth, int $maxHeight, string $outFormat = \"image/png\", string $img_string=\"\") : bool{\n\t\n\t//Check if we have to reduce physical image or an image contained in a variable\n\tif($fileName != \"string\"){\n\n\t\t//Check if image exists or not\n\t\tif(!file_exists($fileName))\n\t\t\treturn false;\n\t\t\n\t\t//Try to get image size\n\t\tif(!$imageInfos = getimagesize($fileName))\n\t\t\treturn false; //File doesn't seems to be an image\n\n\t}\n\telse {\n\t\t//Get informations about the image in the string\n\t\tif(!$imageInfos = getimagesizefromstring($img_string))\n\t\t\treturn false; //Couldn't create image\n\t}\n\n\t//Extract image width and height\n\t$width = $imageInfos[0];\n\t$height = $imageInfos[1];\n\n\t//Check image size\n\tif($width == 0 || $height == 0)\n\t\treturn false; //Can't process such image\n\n\t//Try to open image\n\tif($fileName === \"string\")\n\t\t$src = imagecreatefromstring($img_string);\n\telseif($imageInfos['mime'] === \"image/png\")\n\t\t$src = imagecreatefrompng($fileName);\n\telseif($imageInfos['mime'] === \"image/jpeg\")\n\t\t$src = imagecreatefromjpeg($fileName);\n\telseif($imageInfos['mime'] === \"image/gif\")\n\t\t$src = imagecreatefromgif($fileName);\n\t//elseif($imageInfos['mime'] === \"image/x-ms-bmp\")\n\t//\t$src = imagecreatefrombmp($fileName);\n\telse\n\t\treturn false; //Unrecognized image type\n\t\n\t//Check if image size can be kept as is\n\tif($width <= $maxWidth AND $height <= $maxHeight){\n\t\t//We keep the same dimensions\n\t\t$newWidth = $width;\n\t\t$newHeight = $height;\n\t}\n\telseif($width > $maxWidth){\n\t\t$newWidth = $maxWidth;\n\t\t$newHeight = floor(($height*$maxWidth)/$width);\n\t}\n\telse {\n\t\t$newHeight = $maxHeight;\n\t\t$newWidth = floor(($width*$maxHeight)/$height);\n\t}\n\n\t//Create reduced image\n\t$dest = imagecreatetruecolor($newWidth, $newHeight);\n\n\t//Copy image\n\timagecopyresized($dest, $src, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);\n\n\t//Try to export image\n\t//PNG\n\tif($outFormat === \"image/png\"){\n\t\tif(!imagepng($dest, $targetFile, 2))\n\t\t\treturn false;\n\t}\n\n\t//JPEG\n\telseif($outFormat === \"image/jpeg\"){\n\t\tif(!imagejpeg($dest, $targetFile, 2))\n\t\t\treturn false;\n\t}\n\n\t//UNSUPPORTED\n\telse\n\t\treturn false; //Unkown export format\n\n\t//Success\n\treturn true;\n}", "public function resize($width = NULL, $height = NULL, $master = NULL)\n {\n if ($master === NULL)\n {\n // Choose the master dimension automatically\n $master = Image::AUTO;\n }\n // Image::WIDTH and Image::HEIGHT depricated. You can use it in old projects,\n // but in new you must pass empty value for non-master dimension\n elseif ($master == Image::WIDTH AND ! empty($width))\n {\n $master = Image::AUTO;\n\n // Set empty height for backvard compatibility\n $height = NULL;\n }\n elseif ($master == Image::HEIGHT AND ! empty($height))\n {\n $master = Image::AUTO;\n\n // Set empty width for backvard compatibility\n $width = NULL;\n }\n\n if (empty($width))\n {\n if ($master === Image::NONE)\n {\n // Use the current width\n $width = $this->width;\n }\n else\n {\n // If width not set, master will be height\n $master = Image::HEIGHT;\n }\n }\n\n if (empty($height))\n {\n if ($master === Image::NONE)\n {\n // Use the current height\n $height = $this->height;\n }\n else\n {\n // If height not set, master will be width\n $master = Image::WIDTH;\n }\n }\n\n switch ($master)\n {\n case Image::AUTO:\n // Choose direction with the greatest reduction ratio\n $master = ($this->width / $width) > ($this->height / $height) ? Image::WIDTH : Image::HEIGHT;\n break;\n case Image::INVERSE:\n // Choose direction with the minimum reduction ratio\n $master = ($this->width / $width) > ($this->height / $height) ? Image::HEIGHT : Image::WIDTH;\n break;\n }\n\n switch ($master)\n {\n case Image::WIDTH:\n // Recalculate the height based on the width proportions\n $height = $this->height * $width / $this->width;\n break;\n case Image::HEIGHT:\n // Recalculate the width based on the height proportions\n $width = $this->width * $height / $this->height;\n break;\n }\n\n // Convert the width and height to integers\n $width = round($width);\n $height = round($height);\n\n $this->_do_resize($width, $height);\n\n return $this;\n }", "public function getImage();", "public function getImage();", "public function getImage();", "public function getImage();", "function create($filename=\"\")\n{\nif ($filename) {\n $this->src_image_name = trim($filename);\n}\n$dirname=explode(\"/\",$this->src_image_name);\nif(!file_exists(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\")){\n\t@mkdir(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\", 0755);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$this->src_image_name = @iconv(\"utf-8\",\"GBK\",$this->src_image_name);\n\t$this->gz_image_name = @iconv(\"utf-8\",\"GBK\",$this->gz_image_name);\n}\n$src_image_type = $this->get_type($this->src_image_name);\n$src_image = $this->createImage($src_image_type,$this->src_image_name);\nif (!$src_image) return;\n$src_image_w=ImageSX($src_image);\n$src_image_h=ImageSY($src_image);\n\n\nif ($this->gz_image_name){\n $this->gz_image_name = strtolower(trim($this->gz_image_name));\n $gz_image_type = $this->get_type($this->gz_image_name);\n $gz_image = $this->createImage($gz_image_type,$this->gz_image_name);\n $gz_image_w=ImageSX($gz_image);\n $gz_image_h=ImageSY($gz_image);\n $temp_gz_image = $this->getPos($src_image_w,$src_image_h,$this->gz_image_pos,$gz_image);\n $gz_image_x = $temp_gz_image[\"dest_x\"];\n $gz_image_y = $temp_gz_image[\"dest_y\"];\n\t if($this->get_type($this->gz_image_name)=='png'){imagecopy($src_image,$gz_image,$gz_image_x,$gz_image_y,0,0,$gz_image_w,$gz_image_h);}\n\t else{imagecopymerge($src_image,$gz_image,$gz_image_x,$gz_image_y,0,0,$gz_image_w,$gz_image_h,$this->gz_image_transition);}\n}\nif ($this->gz_text){\n $temp_gz_text = $this->getPos($src_image_w,$src_image_h,$this->gz_text_pos);\n $gz_text_x = $temp_gz_text[\"dest_x\"];\n $gz_text_y = $temp_gz_text[\"dest_y\"];\n if(preg_match(\"/([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i\", $this->gz_text_color, $color))\n {\n $red = hexdec($color[1]);\n $green = hexdec($color[2]);\n $blue = hexdec($color[3]);\n $gz_text_color = imagecolorallocate($src_image, $red,$green,$blue);\n }else{\n $gz_text_color = imagecolorallocate($src_image, 255,255,255);\n }\n imagettftext($src_image, $this->gz_text_size, $this->gz_text_angle, $gz_text_x, $gz_text_y, $gz_text_color,$this->gz_text_font, $this->gz_text);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$save_files=explode('/',$this->save_file);\n\t$save_files[count($save_files)-1]=@iconv(\"utf-8\",\"GBK\",$save_files[count($save_files)-1]);\n\t$this->save_file=implode('/',$save_files);\n}\nif ($this->save_file)\n{\n switch ($this->get_type($this->save_file)){\n case 'gif':$src_img=ImagePNG($src_image, $this->save_file); break;\n case 'jpeg':$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n case 'png':$src_img=ImagePNG($src_image, $this->save_file); break;\n default:$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n }\n}\nelse\n{\nif ($src_image_type = \"jpg\") $src_image_type=\"jpeg\";\n header(\"Content-type: image/{$src_image_type}\");\n switch ($src_image_type){\n case 'gif':$src_img=ImagePNG($src_image); break;\n case 'jpg':$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n case 'png':$src_img=ImagePNG($src_image);break;\n default:$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n }\n}\nimagedestroy($src_image);\n}", "function acf_get_image_sizes()\n{\n}", "public static function setSize($path,$target_width=150,$target_height=100) {\n\t\t$img = imagecreatefromjpeg($path);\n\t\tif (!$img) {\n\t\t\techo \"ERROR:could not create image handle \".$path;\n\t\t\texit(0);\n\t\t}\n\t\t$width = imageSX($img);\n\t\t$height = imageSY($img);\n\t\t$size = getimagesize($path);\n\t\tif (!$width || !$height) {\n\t\t\techo \"ERROR:Invalid width or height\";\n\t\t\texit(0);\n\t\t}\n\t\tif ($width > $target_width) {\n\t\t\t$width_ratio = $target_width/$width;\n\t\t}\n\t\telse {\n\t\t\t$width_ratio = 1;\t\n\t\t}\n\t\tif ($height > $target_height) {\n\t\t\t$height_ratio = $target_height/$height;\n\t\t}\n\t\telse {\n\t\t\t$height_ratio = 1;\t\n\t\t}\n\t\tif ($width_ratio==1 && $height_ratio==1) return $img;\n\t\t$ratio = min($width_ratio,$height_ratio);\n\t\t$new_height = $ratio * $height;\n\t\t$new_width = $ratio * $width;\n\t\t//file_put_contents(\"1.log\",\"$new_height = $ratio m $height; $new_width = $ratio m $width;\\n\",FILE_APPEND);\n\t\t$new_img = ImageCreateTrueColor($new_width, $new_height);\n\t\tif (!@imagecopyresampled($new_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height)) {\n\t\t\techo \"ERROR:Could not resize image\";\n\t\t\texit(0);\n\t\t}\t\t\n\t\treturn $new_img;\n\t}", "function cs_getimagesize($imagePath, $maxWidth = 0, $maxHeight = 0)\r\n{\r\n\t$use_curl = false;\r\n\tif (strtolower(substr($imagePath, 0, 7)) == 'http://'\r\n\t\t\t|| strtolower(substr($imagePath, 0, 6) == 'ftp://'))\r\n\t\t$use_curl = true;\n\t/* use curl if available, we can set decent timeouts for it */\r\n\tif ($use_curl && function_exists('curl_version') && function_exists('gd_info'))\n\t{\n\t\t$file_contents = cs_curl_contents($imagePath);\n\r\n\t\tif ($file_contents === false)\n\t\t\treturn false;\n\t\t$new_image = imagecreatefromstring($file_contents);\n\t\tif ($new_image !== false)\n\t\t{\n\t\t\t$size = array();\n\t\t\t$size[0] = imagesx($new_image);\n\t\t\t$size[1] = imagesy($new_image);\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}\n\telse\n\t\t$size = getimagesize($imagePath);\r\n\t\n\tif ($size === false)\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\tif ($maxWidth > 0)\r\n\t{\r\n\t\tif ($maxHeight > 0)\r\n\t\t{\r\n\t\t\t/* both matter */\r\n\t\t\tif ($size[0] > $maxWidth)\r\n\t\t\t{\r\n\t\t\t\tif ($size[1] > $maxHeight)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ((1.0*$size[0] / $maxWidth ) > (1.0*$size[1] / $maxHeight))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t/* width is the important factor */ \r\n\t\t\t\t\t\t$size[1] = (int) ($size[1] * (1.0*$maxWidth / $size[0]));\r\n\t\t\t\t\t\t$size[0] = $maxWidth;\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/* height is the important factor */ \r\n\t\t\t\t\t\t$size[0] = (int) ($size[0] * (1.0*$maxHeight / $size[1]));\r\n\t\t\t\t\t\t$size[1] = $maxHeight;\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\t/* only width */\r\n\t\t\t\t\tif ($size[0] > $maxWidth)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$size[1] = (int) ($size[1] * (1.0*$maxWidth / $size[0]));\r\n\t\t\t\t\t\t$size[0] = $maxWidth;\r\n\t\t\t\t\t}\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\tif ($size[1] > $maxHeight)\r\n\t\t\t\t{\r\n\t\t\t\t\t/* only height */\r\n\t\t\t\t\t$size[0] = (int) ($size[0] * (1.0*$maxHeight / $size[1]));\r\n\t\t\t\t\t$size[1] = $maxHeight;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/* only width matters */\r\n\t\t\tif ($size[0] > $maxWidth)\r\n\t\t\t{\r\n\t\t\t\t$size[1] = (int) ($size[1] * (1.0*$maxWidth / $size[0]));\r\n\t\t\t\t$size[0] = $maxWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif ($maxHeight > 0)\r\n\t\t{\r\n\t\t\t/* only height matters */\r\n\t\t\tif ($size[1] > $maxHeight)\r\n\t\t\t{\r\n\t\t\t\t$size[0] = (int) ($size[0] * (1.0*$maxHeight / $size[1]));\r\n\t\t\t\t$size[1] = $maxHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* else if both are 0, we don't need to do anything */\r\n\t}\r\n\treturn $size;\r\n}", "function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop = \\false)\n {\n }", "public function getSize() {\n return array(\"x\" => imagesx($this->current), \"y\" => imagesy($this->current));\n }", "private function get_image_sizes() {\n\n\t\treturn array(\n\t\t\t'square_medium' => array( 200, 200 ),\n\t\t\t'full' => array( 1200, 1200 ),\n\t\t);\n\n\t}", "function fa_get_custom_image_size( $image_id, $width, $height ){\n\t$image_id \t= absint( $image_id );\n\t$width \t\t= absint( $width );\n\t$height \t= absint( $height );\n\t// if width or height is 0, don't do anything\n\tif( $width == 0 || $height == 0 ){\n\t\treturn false;\n\t}\n\t// get the metadata from image\t\n\t$attachment_meta = get_post_meta( $image_id, '_wp_attachment_metadata', true );\n\tif( !$attachment_meta ){\n\t\treturn false;\n\t}\n\t// if width and height exceed the full image size, return the full image\n\tif( $width >= $attachment_meta['width'] && $height >= $attachment_meta['height'] ){\n\t\t$attachment = wp_get_attachment_image_src( $image_id, 'full' );\n\t\treturn $attachment[0];\n\t}\n\t\n\t// check if any of the registered sizes match the size we're looking for\n\tforeach( $attachment_meta['sizes'] as $size_name => $size_details ){\n\t\t// size matched, return it\n\t\tif( $width == $size_details['width'] && $height == $size_details['height'] ){\n\t\t\t$attachment = wp_get_attachment_image_src( $image_id, $size_name );\t\n\t\t\treturn $attachment[0];\t\t\n\t\t}\n\t}\n\t\n\t// get the upload dir details\n\t$wp_upload_dir = wp_upload_dir();\n\t// an extra meta field on image to store fa image sizes of resized images\n\t$fa_sizes = get_post_meta( $image_id, '_fa_attachment_metadata', true );\n\n\t// check sizes stored by FA\n\tif( $fa_sizes ){\n\t\tforeach( $fa_sizes as $details ){\n\t\t\tif( $width == $details['width'] && $height == $details['height'] ){\n\t\t\t\treturn $wp_upload_dir['baseurl'] . wp_normalize_path( $details['rel_path'] );\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// create the new size if not found yet\n\t$image_path = path_join( $wp_upload_dir['basedir'] , $attachment_meta['file'] );\n\t// create the new image size\n\t$img_editor = wp_get_image_editor( $image_path );\n\t$img_editor->set_quality( 90 );\t\t\t\n\t$resized \t= $img_editor->resize( $width, $height, true );\n\t$new_file \t= $img_editor->generate_filename( null, null );\n\t$saved \t\t= $img_editor->save( $new_file );\n\t// relative file path\n\t$rel_path = str_replace( $wp_upload_dir['basedir'], '', $new_file );\n\t$new_file_url = $wp_upload_dir['baseurl'] . wp_normalize_path( $rel_path );\n\t\n\t// store the new size on image meta\n\t$fa_sizes = is_array( $fa_sizes ) ? $fa_sizes : array();\n\t$file_details = array(\n\t\t'basename' \t=> wp_basename( $new_file ),\n\t\t'rel_path' \t=> $rel_path,\n\t\t'width' \t=> $width,\n\t\t'height' \t=> $height\n\t);\n\t$fa_sizes[] = $file_details;\n\tupdate_post_meta( $image_id, '_fa_attachment_metadata', $fa_sizes);\n\treturn $new_file_url;\n}", "public function image_reproportion()\n\t{\n\t\tif (($this->width === 0 && $this->height === 0) OR $this->orig_width === 0 OR $this->orig_height === 0\n\t\t\tOR ( ! ctype_digit((string) $this->width) && ! ctype_digit((string) $this->height))\n\t\t\tOR ! ctype_digit((string) $this->orig_width) OR ! ctype_digit((string) $this->orig_height))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Sanitize\n\t\t$this->width = (int) $this->width;\n\t\t$this->height = (int) $this->height;\n\n\t\tif ($this->master_dim !== 'width' && $this->master_dim !== 'height')\n\t\t{\n\t\t\tif ($this->width > 0 && $this->height > 0)\n\t\t\t{\n\t\t\t\t$this->master_dim = ((($this->orig_height/$this->orig_width) - ($this->height/$this->width)) < 0)\n\t\t\t\t\t\t\t? 'width' : 'height';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->master_dim = ($this->height === 0) ? 'width' : 'height';\n\t\t\t}\n\t\t}\n\t\telseif (($this->master_dim === 'width' && $this->width === 0)\n\t\t\tOR ($this->master_dim === 'height' && $this->height === 0))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif ($this->master_dim === 'width')\n\t\t{\n\t\t\t$this->height = (int) ceil($this->width*$this->orig_height/$this->orig_width);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->width = (int) ceil($this->orig_width*$this->height/$this->orig_height);\n\t\t}\n\t}", "function compress_image($source_file, $target_file, $nwidth, $nheight, $quality) {\n $image_info = getimagesize($source_file);\n if(!($nwidth > 0)) $nwidth = $image_info[0];\n if(!($nheight > 0)) $nheight = $image_info[1];\n \n if(!empty($image_info)) {\n switch($image_info['mime']) {\n case 'image/jpeg' :\n if($quality == '' || $quality < 0 || $quality > 100) $quality = 75; //Default quality\n // Create a new image from the file or the url.\n $image = imagecreatefromjpeg($source_file);\n $thumb = imagecreatetruecolor($nwidth, $nheight);\n //Resize the $thumb image\n imagecopyresized($thumb, $image, 0, 0, 0, 0, $nwidth, $nheight, $image_info[0], $image_info[1]);\n // Output image to the browser or file.\n return imagejpeg($thumb, $target_file, $quality); \n \n break;\n \n case 'image/png' :\n if($quality == '' || $quality < 0 || $quality > 9) $quality = 6; //Default quality\n // Create a new image from the file or the url.\n $image = imagecreatefrompng($source_file);\n $thumb = imagecreatetruecolor($nwidth, $nheight);\n //Resize the $thumb image\n imagecopyresized($thumb, $image, 0, 0, 0, 0, $nwidth, $nheight, $image_info[0], $image_info[1]);\n // Output image to the browser or file.\n return imagepng($thumb, $target_file, $quality);\n break;\n \n case 'image/gif' :\n if($quality == '' || $quality < 0 || $quality > 100) $quality = 75; //Default quality\n // Create a new image from the file or the url.\n $image = imagecreatefromgif($source_file);\n $thumb = imagecreatetruecolor($nwidth, $nheight);\n //Resize the $thumb image\n imagecopyresized($thumb, $image, 0, 0, 0, 0, $nwidth, $nheight, $image_info[0], $image_info[1]);\n // Output image to the browser or file.\n return imagegif($thumb, $target_file, $quality); //$success = true;\n break;\n \n default:\n echo \"<h4>Not supported file type!</h4>\";\n break;\n }\n }\n }", "function _process_image($data){\n\t\t\n\t\t// Largest side dimensions for small and large thumbnails\n\t\t$px_sm = 320;\n\t\t$px_lg = 640;\n\t\t\n\t\t// Generate new base name for this image\n\t\t$new_name = uniqid(TRUE);\n\t\t\n\t\t// Initialise array for resizing errors\n\t\t$this->resize_errors = array();\n\t\t\n\t\t// Array to hold the new dimensions\n\t\t$dimensions = array();\n\t\t\n\t\t// Work out the dimensions of the image based on longest side, or set both to same if equal\n\t\tif ($data['image_width'] > $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $px_sm;\n\t\t\t$dimensions['lg']['w'] = $px_lg;\n\t\t\t$dimensions['sm']['h'] = $data['image_height'] * ($px_sm / $data['image_width']);\n\t\t\t$dimensions['lg']['h'] = $data['image_height'] * ($px_lg / $data['image_width']);\n\t\t} elseif($data['image_width'] < $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $data['image_width'] * ($px_sm / $data['image_height']);\n\t\t\t$dimensions['lg']['w'] = $data['image_width'] * ($px_lg / $data['image_height']);\n\t\t\t$dimensions['sm']['h'] = $px_sm;\n\t\t\t$dimensions['lg']['h'] = $px_lg;\n\t\t} elseif ($data['image_width'] == $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $px_sm;\n\t\t\t$dimensions['lg']['w'] = $px_lg;\n\t\t\t$dimensions['sm']['h'] = $px_sm;\n\t\t\t$dimensions['lg']['h'] = $px_lg;\n\t\t}\n\t\t\n\t\t// Global resize vars\n\t\t$config['image_library'] = 'gd2';\n\t\t$config['source_image']\t= $data['full_path'];\n\t\t$config['create_thumb'] = FALSE;\n\t\t$config['maintain_ratio'] = TRUE;\n\t\t$config['quality'] = 100;\n\t\t$this->load->library('image_lib', $config);\n\t\t\n\t\t// Create small image\n\t\t$config['width'] = $dimensions['sm']['w'];\n\t\t$config['height'] = $dimensions['sm']['h'];\n\t\t$config['new_image'] = sprintf('%s/%s.sm%s', realpath('web/upload/'), $new_name, $data['file_ext']);\n\t\t$this->image_lib->initialize($config);\n\t\t$result_sm = $this->image_lib->resize();\n\t\tif($result_sm == FALSE){\n\t\t\tarray_push($this->resize_errors, $this->image_lib->display_errors());\n\t\t}\n\t\t\n\t\t// Create larger image\n\t\t$config['width'] = $dimensions['lg']['w'];\n\t\t$config['height'] = $dimensions['lg']['h'];\n\t\t$config['new_image'] = sprintf('%s/%s.lg%s', realpath('web/upload/'), $new_name, $data['file_ext']);\n\t\t$this->image_lib->initialize($config);\n\t\t$result_lg = $this->image_lib->resize();\n\t\tif($result_lg == FALSE){\n\t\t\tarray_push($this->resize_errors, $this->image_lib->display_errors());\n\t\t}\n\t\t\n\t\t// Delete the original source file now we're finished with it\n\t\t@unlink($data['full_path']);\n\t\t\n\t\t// Finished resizing functions - test for errors and return\n\t\tif($this->resize_errors == NULL){\n\t\t\t// No errors encountered - delete original image\n\t\t\t$name = sprintf('%s.#%s', $new_name, $data['file_ext']);\n\t\t\treturn $name;\n\t\t} else {\n\t\t\t// One or more errors occured when resizing the images\n\t\t\t$this->lasterr = 'Failed to resize the images.';\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t}", "public function getImageDimension(): ImageDimensionInterface;", "public function getImgSize() {\n\t\t$this->imgSize = getimagesize($this->imgUri);\n\t}", "function image_dimensions ( $image_path ) {\r\n\t\t$image = image_read($image_path,false);\r\n\t\tif ( !$image ) return $image;\r\n\t\t$width = imagesx($image);\r\n\t\t$height = imagesy($image);\r\n\t\t$dimensions = compact('width','height');\r\n\t\treturn $dimensions;\r\n\t}", "function wp_calculate_image_sizes($size, $image_src = \\null, $image_meta = \\null, $attachment_id = 0)\n {\n }", "function resize($src_file, $dest_file, $new_size, $img_meta) {\n if (!zmgGd1xTool::isSupportedType($img_meta['extension'], $src_file)) {\n return false;\n }\n \n // height/width\n $ratio = max($img_meta['width'], $img_meta['height']) / $new_size;\n $ratio = max($ratio, 1.0);\n $destWidth = (int)($img_meta['width'] / $ratio);\n $destHeight = (int)($img_meta['height'] / $ratio);\n if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n $src_img = imagecreatefromjpeg($src_file);\n } else {\n $src_img = imagecreatefrompng($src_file);\n }\n if (!$src_img) {\n return zmgToolboxPlugin::registerError($src_file, 'GD 1.x: Could not convert image.');\n }\n $dst_img = imagecreate($destWidth, $destHeight);\n imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight,\n $img_meta['width'], $img_meta['height']);\n\n if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n imagejpeg($dst_img, $dest_file, $img_meta['jpeg_qty']);\n } else {\n imagepng($dst_img, $dest_file);\n }\n\n imagedestroy($src_img);\n imagedestroy($dst_img);\n return true;\n }", "protected function resize()\n {\n $width = $this->width;\n $height = $this->height;\n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n // Determine new image dimensions\n if($this->mode === \"crop\"){ // Crop image\n \n $max_width = $crop_width = $width;\n $max_height = $crop_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if($orig_width > $orig_height){ // Original is wide\n $height = $max_height;\n $width = ceil($y_ratio * $orig_width);\n \n } elseif($orig_height > $orig_width){ // Original is tall\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n \n } else { // Original is square\n $this->mode = \"fit\";\n \n return $this->resize();\n }\n \n // Adjust if the crop width is less than the requested width to avoid black lines\n if($width < $crop_width){\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n }\n \n } elseif($this->mode === \"fit\"){ // Fits the image according to aspect ratio to within max height and width\n $max_width = $width;\n $max_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if( ($orig_width <= $max_width) && ($orig_height <= $max_height) ){ // Image is smaller than max height and width so don't resize\n $tn_width = $orig_width;\n $tn_height = $orig_height;\n \n } elseif(($x_ratio * $orig_height) < $max_height){ // Wider rather than taller\n $tn_height = ceil($x_ratio * $orig_height);\n $tn_width = $max_width;\n \n } else { // Taller rather than wider\n $tn_width = ceil($y_ratio * $orig_width);\n $tn_height = $max_height;\n }\n \n $width = $tn_width;\n $height = $tn_height;\n \n } elseif($this->mode === \"fit-x\"){ // Sets the width to the max width and the height according to aspect ratio (will stretch if too small)\n $height = @round($orig_height * $width / $orig_width);\n \n if($orig_height <= $height){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n \n } elseif($this->mode === \"fit-y\"){ // Sets the height to the max height and the width according to aspect ratio (will stretch if too small)\n $width = @round($orig_width * $height / $orig_height);\n \n if($orig_width <= $width){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n } else {\n throw new \\Exception('Invalid mode: ' . $this->mode);\n }\n \n\n // Resize\n $this->temp = imagecreatetruecolor($width, $height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n \n imagecopyresampled($this->temp, $this->image, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height);\n $this->sync();\n \n \n // Cropping?\n if($this->mode === \"crop\"){ \n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n $x_mid = $orig_width/2; // horizontal middle\n $y_mid = $orig_height/2; // vertical middle\n \n $this->temp = imagecreatetruecolor($crop_width, $crop_height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n\n imagecopyresampled($this->temp, $this->image, 0, 0, ($x_mid-($crop_width/2)), ($y_mid-($crop_height/2)), $crop_width, $crop_height, $crop_width, $crop_height);\n $this->sync();\n }\n }", "protected function calculateMediaWidthsAndHeights() {}", "function exif_imagetype ( $image_location ) {\r\n\t\t$image_size = getimagesize($image_location);\r\n\t\tif ( !$image_size )\r\n\t\t\treturn $image_size;\r\n\t\t$image_type = $image_size[2];\r\n\t\treturn $image_type;\r\n\t}", "function resizeImage($sourceImage, $targetImage, $maxWidth, $maxHeight, $quality = 80) {\n echo 'sourceImage ';\n echo $sourceImage;\n echo ' targetImage ';\n echo $targetImage;\n // Obtain image from given source file.\n\tif (!$image = @imagecreatefromjpeg($sourceImage)) {\n\t\techo 'false';\n return false;\n }\n\techo ' pre list ';\n // Get dimensions of source image.\n list($origWidth, $origHeight) = getimagesize($sourceImage);\n\n if ($maxWidth == 0) {\n $maxWidth = $origWidth;\n }\n\n if ($maxHeight == 0) {\n $maxHeight = $origHeight;\n }\n\n // Calculate ratio of desired maximum sizes and original sizes.\n $widthRatio = $maxWidth / $origWidth;\n $heightRatio = $maxHeight / $origHeight;\n\n // Ratio used for calculating new image dimensions.\n $ratio = min($widthRatio, $heightRatio);\n\n // Calculate new image dimensions.\n $newWidth = (int)$origWidth * $ratio;\n $newHeight = (int)$origHeight * $ratio;\n\techo 'pre true color ';\n // Create final image with new dimensions.\n\t$newImage = imagecreatetruecolor($newWidth, $newHeight);\n\techo 'post true color ';\n\n // $image = str_replace(' ','_',$image);\n\n\timagecopyresampled($newImage, $image, 0, 0, 0, 0, $newWidth, $newHeight, $origWidth, $origHeight);\n\techo 'post resampled ';\n\n // CREATE PROGRESSIVE IMG INSTANCE\n // $imageProg = imagecreatefromjpeg($image);\n // imageinterlace($imageProg, true);\n // echo 'post progressive';\n\n\timagejpeg($newImage, $targetImage, $quality);\n // imagejpeg($imageProg, $targetImage, $quality);\n\techo 'post imagejpeg ';\n\n // FREE UP MEMORY\n imagedestroy($image);\n imagedestroy($newImage);\n // imagedestroy($imageProg);\n\n return true;\n}", "public static function getOrientation($width, $height) {}", "function resizeImage($src_file, $dest_file, $new_size=100, $resize_aspect=\"sq\", $quality=\"80\")\n\t{\n\t\t$imginfo = getimagesize($src_file);\n\t\t\n\t\tif ($imginfo == null) {\n\t\treturn false;\n\t\t}\t \n\t\t\n\t\t// GD2 can only handle JPG, PNG & GIF images\n\t\tif (!$imginfo[2] > 0 && $imginfo[2] <= 3 ) {\n\t\t return false;\n\t\t}\n\t\t\n\t\t// height/width\n\t\t$srcWidth = $imginfo[0];\n\t\t$srcHeight = $imginfo[1];\n\t\t//$resize_aspect = \"sq\";\n\t\tif ($resize_aspect == 'ht') {\n\t\t $ratio = $srcHeight / $new_size;\n\t\t} elseif ($resize_aspect == 'wd') {\n\t\t $ratio = $srcWidth / $new_size;\n\t\t} elseif ($resize_aspect == 'sq') {\n\t\t $ratio = min($srcWidth, $srcHeight) / $new_size;\n\t\t} else {\n\t\t $ratio = max($srcWidth, $srcHeight) / $new_size;\n\t\t}\n\t\t\n\t\t/**\n\t\t* Initialize variables\n\t\t*/\n\t\t$clipX = 0;\n\t\t$clipY = 0;\n\t\t\n\t\t$ratio = max($ratio, 1.0);\n\t\tif ($resize_aspect == 'sq'){\n\t\t$destWidth = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\t$destHeight = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\tif($srcHeight > $srcWidth){\n\t\t$clipX = 0;\n\t\t$clipY = ((int)($srcHeight - $srcWidth)/2);\n\t\t$srcHeight = $srcWidth;\n\t\t}elseif($srcWidth > $srcHeight){\n\t\t$clipX = ((int)($srcWidth - $srcHeight)/2);\n\t\t$clipY = 0;\n\t\t$srcWidth = $srcHeight;\n\t\t}\n\t\t}else{\n\t\t$destWidth = (int)($srcWidth / $ratio);\n\t\t$destHeight = (int)($srcHeight / $ratio);\n\t\t}\n\t\t\n\t\tif (!function_exists('imagecreatefromjpeg')) {\n\t\t echo 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed';\n\t\t exit;\n\t\t}\n\t\tif (!function_exists('imagecreatetruecolor')) {\n\t\t echo 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the admin page';\n\t\t exit;\n\t\t}\n\t\t\n\t\tif ($imginfo[2] == 1 )\n\t\t $src_img = imagecreatefromgif($src_file);\n\t\telseif ($imginfo[2] == 2)\n\t\t $src_img = imagecreatefromjpeg($src_file);\n\t\telse\n\t\t $src_img = imagecreatefrompng($src_file);\n\t\tif (!$src_img){\n\t\t return false;\n\t\t}\n\t\tif ($imginfo[2] == 1 ) {\n\t\t$dst_img = imagecreate($destWidth, $destHeight);\n\t\t} else {\n\t\t$dst_img = imagecreatetruecolor($destWidth, $destHeight);\n\t\t}\n\t\t\n\t\timagecopyresampled($dst_img, $src_img, 0, 0, $clipX, $clipY, (int)$destWidth, (int)$destHeight, $srcWidth, $srcHeight);\n\t\timagejpeg($dst_img, $dest_file, $quality);\n\t\timagedestroy($src_img);\n\t\timagedestroy($dst_img);\n\t\t\n\t\t// We check that the image is valid\n\t\t$imginfo = getimagesize($dest_file);\n\t\tif ($imginfo == null) {\n\t\t\t@unlink($dest_file);\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "static function resize($sourcePath, $newWidth = 100, $newHeight = 100)\n {\n switch (exif_imagetype($sourcePath)) {\n case IMAGETYPE_JPEG :\n $sourceImage = imagecreatefromjpeg($sourcePath);\n break;\n case IMAGETYPE_PNG :\n $sourceImage = imagecreatefrompng($sourcePath);\n break;\n case IMAGETYPE_GIF :\n $sourceImage = imagecreatefromgif($sourcePath);\n break;\n default:\n return;\n }\n\n // Create the new image (still blank/empty)\n $newImage = imagecreatetruecolor($newWidth, $newHeight);\n imagesetinterpolation($newImage, IMG_SINC);\n\n // Determine the source image Dimensions\n $sourceImageWidth = imagesx($sourceImage);\n $sourceImageHeight = imagesy($sourceImage);\n $sourceImageAspectRatio = $sourceImageWidth / $sourceImageHeight;\n $newImageAspectRatio = $newWidth / $newHeight;\n\n // Determine parameters and copy part of the source image into the new image\n if ($newImageAspectRatio >= $sourceImageAspectRatio) { // width is the limiting factor for the source image\n $src_x = 0;\n $src_w = $sourceImageWidth;\n $src_h = $src_w / $newImageAspectRatio;\n $src_y = ($sourceImageHeight - $src_h) / 2;\n } else { // height of source image is limiting factor\n $src_y = 0;\n $src_h = $sourceImageHeight;\n $src_w = $src_h * $newImageAspectRatio;\n $src_x = ($sourceImageWidth - $src_w) / 2;\n }\n\n imagecopyresampled($newImage, $sourceImage, 0, 0, $src_x, $src_y, $newWidth, $newHeight, $src_w, $src_h);\n\n // Save new image to destination path\n switch (exif_imagetype($sourcePath)) {\n case IMAGETYPE_JPEG :\n imagejpeg($newImage, $sourcePath, 100);\n break;\n case IMAGETYPE_PNG :\n imagepng($newImage, $sourcePath);\n break;\n case IMAGETYPE_GIF :\n imagegif($newImage, $sourcePath);\n break;\n }\n\n // Remove image resources to reallocate space\n imagedestroy($sourceImage);\n imagedestroy($newImage);\n }", "function redimage($img_src,$img_dest,$dst_w,$dst_h) {\n // Lit les dimensions de l'image\n $size = GetImageSize($img_src); \n $src_w = $size[0]; $src_h = $size[1]; \n // Teste les dimensions tenant dans la zone\n $test_h = round(($dst_w / $src_w) * $src_h);\n $test_w = round(($dst_h / $src_h) * $src_w);\n // Si Height final non précisé (0)\n if(!$dst_h) $dst_h = $test_h;\n // Sinon si Width final non précisé (0)\n elseif(!$dst_w) $dst_w = $test_w;\n // Sinon teste quel redimensionnement tient dans la zone\n elseif($test_h>$dst_h) $dst_w = $test_w;\n else $dst_h = $test_h;\n\n // La vignette existe ?\n $test = (file_exists($img_dest));\n // L'original a été modifié ?\n if($test)\n $test = (filemtime($img_dest)>filemtime($img_src));\n // Les dimensions de la vignette sont correctes ?\n if($test) {\n $size2 = GetImageSize($img_dest);\n $test = ($size2[0]==$dst_w);\n $test = ($size2[1]==$dst_h);\n }\n\n // Créer la vignette ?\n if(!$test) {\n // Crée une image vierge aux bonnes dimensions\t\n $dst_im = ImageCreateTrueColor($dst_w,$dst_h); \n // Copie dedans l'image initiale redimensionnée\n $src_im = ImageCreateFromJpeg($img_src);\n ImageCopyResampled($dst_im,$src_im,0,0,0,0,$dst_w,$dst_h,$src_w,$src_h);\n // Sauve la nouvelle image\n ImageJpeg($dst_im,$img_dest);\n // Détruis les tampons\n ImageDestroy($dst_im);\n ImageDestroy($src_im);\n }\n}", "function image_mirror_gd()\n\t{\t\t\n\t\tif ( ! $src_img = $this->image_create_gd())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$width = $this->src_width;\n\t\t$height = $this->src_height;\n\n\t\tif ($this->rotation == 'hor')\n\t\t{\n\t\t\tfor ($i = 0; $i < $height; $i++)\n\t\t\t{\t\t \n\t\t\t\t$left = 0; \n\t\t\t\t$right = $width-1; \n\t\n\t\t\t\twhile ($left < $right)\n\t\t\t\t{ \n\t\t\t\t\t$cl = imagecolorat($src_img, $left, $i); \n\t\t\t\t\t$cr = imagecolorat($src_img, $right, $i);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $left, $i, $cr); \n\t\t\t\t\timagesetpixel($src_img, $right, $i, $cl); \n\t\t\t\t\t\n\t\t\t\t\t$left++; \n\t\t\t\t\t$right--; \n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < $width; $i++)\n\t\t\t{\t\t \n\t\t\t\t$top = 0; \n\t\t\t\t$bot = $height-1; \n\t\n\t\t\t\twhile ($top < $bot)\n\t\t\t\t{ \n\t\t\t\t\t$ct = imagecolorat($src_img, $i, $top);\n\t\t\t\t\t$cb = imagecolorat($src_img, $i, $bot);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $i, $top, $cb); \n\t\t\t\t\timagesetpixel($src_img, $i, $bot, $ct); \n\t\t\t\t\t\n\t\t\t\t\t$top++; \n\t\t\t\t\t$bot--; \n\t\t\t\t} \n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Save the Image\n\t\t/** ---------------------------------*/\n\t\tif ( ! $this->image_save_gd($src_img))\n\t\t{\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Kill the file handles\n\t\t/** ---------------------------------*/\n\t\timagedestroy($src_img);\n\t\t\n\t\t// Set the file to 777\n\t\t@chmod($this->full_dst_path, FILE_WRITE_MODE);\t\t\t\n\t\t\n\t\treturn TRUE;\n\t}", "function flexibleCropper($source_location, $desc_location=null,$crop_size_w=null,$crop_size_h=null)\n\t{\n\t list($src_w, $src_h) = getimagesize($source_location);\n\n\t $image_source = imagecreatefromjpeg($source_location);\n\t $image_desc = imagecreatetruecolor($crop_size_w,$crop_size_h);\n\n\t/*\n\t if ($crop_size_w>$crop_size_h) {$my_crop_size_w=null;}\n\t elseif ($crop_size_h>$crop_size_w)\n\t {$my_crop_size_h=null;\n\n\t if (is_null($my_crop_size_h) and !is_null($my_crop_size_w))\n\t { $my_crop_size_h=$src_h*$my_crop_size_w/$src_w; }\n\t elseif (!is_null($my_crop_size_h))\n\t { $my_crop_size_w=$src_w*$my_crop_size_h/$src_h; }\n\t*/\n\n\t if ($src_w<$src_h) {$my_crop_size_h=$src_h*$crop_size_w/$src_w;} else {$my_crop_size_h=$crop_size_h;}\n\t if ($src_h<$src_w) {$my_crop_size_w=$src_w*$crop_size_h/$src_h;} else {$my_crop_size_w=$crop_size_w;}\n\t// echo \"($my_crop_size_w-$my_crop_size_h)\";\n\t if ($my_crop_size_w>$crop_size_w) {$additional_x=round(($crop_size_w-$my_crop_size_w)/2);} else {$additional_x=0;}\n\t if ($my_crop_size_h>$crop_size_h) {$additional_y=round(($crop_size_h-$my_crop_size_h)/2);} else {$additional_y=0;}\n\n\t $off_x=round($src_w/2)-round($my_crop_size_w/2);\n\t $off_y=round($src_h/2)-round($my_crop_size_h/2)+$additional_y;\n\t $off_w=(round($src_w/2)+round($my_crop_size_w/2))-$off_x;\n\t $off_h=(round($src_h/2)+round($my_crop_size_h/2))-$off_y;\n\n\t imagecopyresampled($image_desc, $image_source,$additional_x, $additional_y, $off_x, $off_y, $my_crop_size_w, $my_crop_size_h, $off_w, $off_h);\n\n\t if (!is_null($desc_location))\n\t imagejpeg($image_desc, $desc_location,100);\n\t else\n\t imagejpeg($image_desc);\n\t}", "public function calcRatio()\n {\n // round to 5DP (0.1px for a 10k image)\n $this->ratio = round($this->loaded_width / $this->loaded_height, 5);\n // orientation\n $this->orientation = 'x';\n if ($this->loaded_width < $this->loaded_height) {\n $this->orientation = 'y';\n }\n }", "function yz_attachments_get_cover_image_dimensions( $wh ) {\n return array( 'width' => 1350, 'height' => 350 );\n}", "public function getImageDimensions()\n {\n $dimension = $this->_getSetting('dimension');\n if ($this->getRow()->use_crop) {\n $parentDimension = $this->_getImageEnlargeComponent()->getImageDimensions();\n $dimension['crop'] = $parentDimension['crop'];\n }\n $data = $this->getImageData();\n return Kwf_Media_Image::calculateScaleDimensions($data['file'], $dimension);\n }", "public function image_mirror_gd()\n\t{\n\t\tif ( ! $src_img = $this->image_create_gd())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$width = $this->orig_width;\n\t\t$height = $this->orig_height;\n\n\t\tif ($this->rotation_angle === 'hor')\n\t\t{\n\t\t\tfor ($i = 0; $i < $height; $i++)\n\t\t\t{\n\t\t\t\t$left = 0;\n\t\t\t\t$right = $width - 1;\n\n\t\t\t\twhile ($left < $right)\n\t\t\t\t{\n\t\t\t\t\t$cl = imagecolorat($src_img, $left, $i);\n\t\t\t\t\t$cr = imagecolorat($src_img, $right, $i);\n\n\t\t\t\t\timagesetpixel($src_img, $left, $i, $cr);\n\t\t\t\t\timagesetpixel($src_img, $right, $i, $cl);\n\n\t\t\t\t\t$left++;\n\t\t\t\t\t$right--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < $width; $i++)\n\t\t\t{\n\t\t\t\t$top = 0;\n\t\t\t\t$bottom = $height - 1;\n\n\t\t\t\twhile ($top < $bottom)\n\t\t\t\t{\n\t\t\t\t\t$ct = imagecolorat($src_img, $i, $top);\n\t\t\t\t\t$cb = imagecolorat($src_img, $i, $bottom);\n\n\t\t\t\t\timagesetpixel($src_img, $i, $top, $cb);\n\t\t\t\t\timagesetpixel($src_img, $i, $bottom, $ct);\n\n\t\t\t\t\t$top++;\n\t\t\t\t\t$bottom--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Show the image\n\t\tif ($this->dynamic_output === TRUE)\n\t\t{\n\t\t\t$this->image_display_gd($src_img);\n\t\t}\n\t\telseif ( ! $this->image_save_gd($src_img)) // ... or save it\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Kill the file handles\n\t\timagedestroy($src_img);\n\n\t\tchmod($this->full_dst_path, $this->file_permissions);\n\n\t\treturn TRUE;\n\t}", "function wp_get_additional_image_sizes()\n {\n }", "function cropImage($param=array())\r\n {\r\n $ret = array(\r\n 'msg' => false,\r\n 'sts' => false,\r\n );\r\n\r\n $final_size = $param['final_size'];\r\n #$filename = $final_size.'-'.$param['img_newname'];\r\n $filename = $param['img_newname'];\r\n $target_dir = $param['dest_path'];\r\n $target_name = $target_dir.$filename;\r\n $source_name = $param['img_real'];\r\n \r\n //get size from real image \r\n $size = getimagesize($source_name);\r\n $targ_w = $param['w'];\r\n $targ_h = $param['h'];\r\n\r\n //get size from ratio\r\n $final_size = explode(\"x\", $final_size);\r\n $final_w = $final_size[0];\r\n $final_h = $final_size[1];\r\n \r\n if($final_w==='auto' && $final_h==='auto'){ //detect if width and height ratio is \"auto\" then readjust width and height size\r\n $final_w = $targ_w;\r\n $final_h = $targ_h;\r\n }elseif($final_w==='auto'){ //detect if width ratio is \"auto\" then readjust width size\r\n $final_w = intval(($final_size[1] * $targ_w) / $targ_h);\r\n }elseif($final_h==='auto'){ //detect if height ratio is \"auto\" then readjust height size\r\n $final_h = intval(($final_size[0] * $targ_h) / $targ_w);\r\n }\r\n //end\r\n \r\n \r\n $jpeg_quality = 90;\r\n $img_r = imagecreatefromjpeg($source_name);\r\n $dst_r = ImageCreateTrueColor( $final_w, $final_h );\r\n \r\n imagecopyresized(\r\n $dst_r, $img_r, \r\n 0,0, \r\n $param['x'],$param['y'], \r\n $final_w,$final_h,\r\n $param['w'],$param['h']\r\n );\r\n \r\n imagejpeg($dst_r,$target_name,$jpeg_quality);\r\n #$this->send_to_server( array($target_name) );\r\n $url_target_name = str_replace('/data/shopkl/_assets/', 'http://klimg.com/kapanlagi.com/klshop/', $target_name);\r\n \r\n\t\t\t\r\n //find image parent url and dir path from config\r\n //reset($this->imgsize['article']['size']);\r\n //$first_key = key($this->imgsize['article']['size']);\r\n //end find\r\n $ret['sts'] = true;\r\n $ret['filename'] = $filename;\r\n $ret['msg'] = '<div class=\"alert alert-success\">Image is cropped and saved in <a href=\"'. $url_target_name .'?'.date('his').'\" target=\"_blank\">'.$target_name.' !</a></div>';\r\n \r\n return $ret;\r\n }", "function ImageResize($w, $h, $from, $to, $upsample = false) {\n\t$im_infos = getimagesize($from);\n\t\n\tif ($im_infos)\n\t{\n\t\t//$mts[\"total\"][\"start\"] = microtime(true);\n\t\t$data = file_get_contents($from);\n\t\t//$mts[\"imagecreatefromjpeg\"][\"start\"] = microtime(true);\n\t\t$im = @imagecreatefromstring($data);\n\t\t\n\t\t/*switch ($im_infos[2])\n\t\t{\n\t\t\tcase IMAGETYPE_GIF :\t$im = @imagecreatefromgif($from); break;\n\t\t\tcase IMAGETYPE_JPEG :\t$im = @imagecreatefromjpeg($from); break;\n\t\t\tcase IMAGETYPE_PNG :\t$im = @imagecreatefrompng($from); break;\n\t\t\tdefault :\t\t\t\t$im = false; break;\n\t\t}*/\n\t\t//$mts[\"imagecreatefromjpeg\"][\"end\"] = microtime(true);\n\t\t\n\t\t$w_ratio = $im_infos[0] / $w;\t// Width Ratio\n\t\t$h_ratio = $im_infos[1] / $h;\t// Height Ratio\n\t\t\n\t\tif ($w_ratio > 1 || $h_ratio > 1)\n\t\t{\n\t\t\t// Image > max size -> resizing keeping the ratio\n\t\t\t$ratio = max($w_ratio, $h_ratio);\n\t\t\t\n\t\t\t$wd = floor($im_infos[0] / $ratio);\t// Width Destination\n\t\t\t$hd = floor($im_infos[1] / $ratio);\t// Height Destination\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($upsample)\n\t\t\t{\n\t\t\t\t// Upsampling the image\n\t\t\t\t$ratio = max($w_ratio, $h_ratio);\n\t\t\t\t\n\t\t\t\t$wd = floor($im_infos[0] / $ratio);\t// Width Destination\n\t\t\t\t$hd = floor($im_infos[1] / $ratio);\t// Height Destination\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// No upsample\n\t\t\t\t$wd = $im_infos[0];\n\t\t\t\t$hd = $im_infos[1];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//$mts[\"imagecreatetruecolor\"][\"start\"] = microtime(true);\n\t\t$imd = imagecreatetruecolor($wd, $hd);\t// Image Destination\n\t\t//$mts[\"imagecreatetruecolor\"][\"end\"] = microtime(true);\n\t\t\n\t\t//$mts[\"imagecopyresampled\"][\"start\"] = microtime(true);\n\t\timagecopyresampled($imd, $im, 0, 0, 0, 0, $wd, $hd, $im_infos[0], $im_infos[1]);\n\t\t//$mts[\"imagecopyresampled\"][\"end\"] = microtime(true);\n\t\t\n\t\t//$mts[\"imagejpeg\"][\"start\"] = microtime(true);\n\t\timagejpeg($imd, $to);\n\t\t//$mts[\"imagejpeg\"][\"end\"] = microtime(true);\n\t\t\n\t\t//$mts[\"total\"][\"end\"] = microtime(true);\n\t\t\n\t\t//return $mts;\n\t\t/*\n\t\tswitch ($im_infos[2])\n\t\t{\n\t\t\tcase IMAGETYPE_GIF :\timagegif($imd, $to); break;\n\t\t\tcase IMAGETYPE_JPEG :\timagejpeg($imd, $to); break;\n\t\t\tcase IMAGETYPE_PNG :\timagepng($imd, $to); break;\n\t\t\tdefault : break;\n\t\t}\n\t\t*/\n\t}\n}", "function image_arr_resize_to_folder($source_pic, $destination_folder, $filename, $max_width, $max_height)\n{\n $tmp_dest = $destination_folder;\n for ($index = 0; $index < count($source_pic['tmp_name']); $index++) {\n $destination_folder = $tmp_dest;\n $image_info = getimagesize($source_pic['tmp_name'][$index]);\n $source_pic_name = $source_pic['name'][$index];\n $source_pic_tmpname = $source_pic['tmp_name'][$index];\n $source_pic_size = $source_pic['size'][$index];\n $source_pic_width = $image_info[0];\n $source_pic_height = $image_info[1];\n $x_ratio = $max_width / $source_pic_width;\n $y_ratio = $max_height / $source_pic_height;\n\n if (($source_pic_width <= $max_width) && ($source_pic_height <= $max_height)) {\n $tn_width = $source_pic_width;\n $tn_height = $source_pic_height;\n } elseif (($x_ratio * $source_pic_height) < $max_height) {\n $tn_height = ceil($x_ratio * $source_pic_height);\n $tn_width = $max_width;\n } else {\n $tn_width = ceil($y_ratio * $source_pic_width);\n $tn_height = $max_height;\n }\n\n switch ($image_info['mime']) {\n case 'image/gif':\n if (imagetypes() & IMG_GIF) {\n $src = imageCreateFromGIF($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].gif\";\n $namafile = \"$filename[$index].gif\";\n }\n break;\n\n case 'image/jpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].jpg\";\n $namafile = \"$filename[$index].jpg\";\n }\n break;\n\n case 'image/pjpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].jpg\";\n $namafile = \"$filename[$index].jpg\";\n }\n break;\n\n case 'image/png':\n if (imagetypes() & IMG_PNG) {\n $src = imageCreateFromPNG($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].png\";\n $namafile = \"$filename[$index].png\";\n }\n break;\n\n case 'image/wbmp':\n if (imagetypes() & IMG_WBMP) {\n $src = imageCreateFromWBMP($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].bmp\";\n $namafile = \"$filename[$index].bmp\";\n }\n break;\n }\n\n //chmod($destination_pic,0777);\n $tmp = imagecreatetruecolor($tn_width, $tn_height);\n imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tn_width, $tn_height, $source_pic_width, $source_pic_height);\n\n //**** 100 is the quality settings, values range from 0-100.\n switch ($image_info['mime']) {\n case 'image/jpeg':\n imagejpeg($tmp, $destination_folder, 100);\n break;\n\n case 'image/gif':\n imagegif($tmp, $destination_folder, 100);\n break;\n\n case 'image/png':\n imagepng($tmp, $destination_folder);\n break;\n\n default:\n imagejpeg($tmp, $destination_folder, 100);\n break;\n }\n $url[] = $namafile;\n }\n return ($url);\n}", "public function correctImage(){\n parent::isImage();\n parent::exist();\n parent::sizeFile();\n return $this->uploadOk;\n }", "static function resize (\n $src,\n $dest,\n $width = 85,\n $height = 55,\n $exact = true,\n $watermark = false,\n $mode = 1,\n $watermark_position = [4]\n ) {\n $quality = 100;\n\n if (! file_exists($src)) {\n return false;\n }\n\n $size = getimagesize($src);\n if ($size === false) {\n return false;\n }\n\n if (!is_array($watermark_position)) {\n $watermark_position = [$watermark_position];\n }\n\n $format = strtolower(substr($size ['mime'], strpos($size ['mime'], '/')+ 1));\n\n switch($size['mime']) {\n case 'image/jpeg' :\n $isrc = imagecreatefromjpeg($src);\n break;\n case 'image/gif' :\n $isrc = imagecreatefromgif ($src);\n break;\n case 'image/png' :\n $isrc = imagecreatefrompng($src);\n break;\n case 'image/bmp' :\n $isrc = imagecreatefrombmp($src);\n break;\n default :\n return false;\n break;\n }\n $ow = $size [0]; //original width\n $oh = $size [1]; //original height\n\n if ($width === false) $width = $size [0];\n if ($height === false) $height = $size [1];\n\n $zero = false;\n $w = $width;\n $h = $height;\n if ($w <= 0) {\n $zero = true;\n $w = $ow;\n }\n if ($h <= 0) {\n $zero = true;\n $h = $oh;\n }\n $rw = $ow / $w;\n $rh = $oh / $h;\n if ($mode == 0)\n $r = $rw < $rh ? $rw : $rh;\n else\n $r = $rw > $rh ? $rw : $rh;\n\n //если исходное изображение меньше по размера нового, то новые размеры приравниваем к исходным\n if ($r < 1) $r = 1;\n $res_w = $ow / $r;\n $res_h = $oh / $r;\n if ($r == 1) {\n $w = $ow;\n $h = $oh;\n }\n if ($exact && ! $zero) {\n $idest = imagecreatetruecolor($w, $h);\n $bgcolor = imagecolorallocate($idest, 255, 255, 255);\n imagefill($idest, 0, 0, $bgcolor);\n imagecopyresampled($idest, $isrc,($w - $res_w) / 2,($h - $res_h) / 2, 0, 0, $res_w, $res_h, $ow, $oh);\n } else {\n $idest = imagecreatetruecolor($res_w, $res_h);\n imagecopyresampled($idest, $isrc, 0, 0, 0, 0, $res_w, $res_h, $ow, $oh);\n }\n if ($watermark) {\n if (file_exists($watermark)) {\n $wm_image = imagecreatefrompng($watermark);\n $wsize = getimagesize($watermark);\n $wrw = $width / $wsize[0];\n $wrh = $height / $wsize[1];\n\n $ww = $res_w / $wrw;\n $wh = $res_h / $wrh;\n\n if ($exact && ! $zero) {\n /*\tdstX, dstY - Точка на изображении назначения, которая определяет левый верхний угол прямоугольника в который будет вставляться копируемая область.\n dstW, dstH - ширина и высота прямоугольника в который будет вписана копируемая область.\n srcX, srcY - Точка на изображении-источнике, которая определяет левый верхний угол прямоугольника, содержащего копируемую.\n srcW, srcH - ширина и высота копируемой области на изображении-источнике.\n */\n if (in_array(1,$watermark_position)) { //left,top\n $dstX = 0; $dstY = 0; $srcX = 0; $srcY = 0;\n $dstW = $ww; $dstH = $wh; $srcW = $wsize[0]; $srcH = $wsize[1];\n imagecopyresampled($idest, $wm_image, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);\n }\n if (in_array(2,$watermark_position)) { //right,top\n $dstX = $w - $ww -(($w - $res_w) / 2); $dstY = 0; $srcX = 0; $srcY = 0;\n $dstW = $ww; $dstH = $wh; $srcW = $wsize[0]; $srcH = $wsize[1];\n imagecopyresampled($idest, $wm_image, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);\n }\n if (in_array(3,$watermark_position)) { //left,bottom\n $dstX = 0; $dstY = $h - $wh -(($h - $res_h) / 2); $srcX = 0; $srcY = 0;\n $dstW = $ww; $dstH = $wh; $srcW = $wsize[0]; $srcH = $wsize[1];\n imagecopyresampled($idest, $wm_image, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);\n }\n if (in_array(4,$watermark_position)) { //right,bottom\n $dstX = $w - $ww -(($w - $res_w) / 2); $dstY = $h - $wh -(($h - $res_h) / 2); $srcX = 0; $srcY = 0;\n $dstW = $ww; $dstH = $wh; $srcW = $wsize[0]; $srcH = $wsize[1];\n imagecopyresampled($idest, $wm_image, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);\n }\n\n } else {\n if (in_array(1,$watermark_position)) { //left,top\n $dstX = 0; $dstY = 0; $srcX = 0; $srcY = 0;\n $dstW = $wsize[0]; $dstH = $wsize[1]; $srcW = $wsize[0]; $srcH = $wsize[1];\n imagecopyresampled($idest, $wm_image, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);\n }\n if (in_array(2,$watermark_position)) { //right,top\n $dstX = $res_w - $wsize[0]; $dstY = 0; $srcX = 0; $srcY = 0;\n $dstW = $wsize[0]; $dstH = $wsize[1]; $srcW = $wsize[0]; $srcH = $wsize[1];\n imagecopyresampled($idest, $wm_image, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);\n }\n if (in_array(3,$watermark_position)) { //left,bottom\n $dstX = 0; $dstY = $res_h - $wsize[1]; $srcX = 0; $srcY = 0;\n $dstW = $wsize[0]; $dstH = $wsize[1]; $srcW = $wsize[0]; $srcH = $wsize[1];\n imagecopyresampled($idest, $wm_image, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);\n }\n if (in_array(4,$watermark_position)) { //right,bottom\n $dstX = $res_w - $wsize[0]; $dstY = $res_h - $wsize[1]; $srcX = 0; $srcY = 0;\n $dstW = $wsize[0]; $dstH = $wsize[1]; $srcW = $wsize[0]; $srcH = $wsize[1];\n imagecopyresampled($idest, $wm_image, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);\n }\n\n }\n } else {\n $wm_image = imagecreatefrompng($watermark);\n var_dump(__FILE__);\n }\n }\n imagejpeg($idest, $dest, $quality);\n /*switch($size ['mime'])\n {\n case 'image/jpeg':\n imagejpeg( $idest, $dest, $quality); //100 is the quality settings, values range from 0-100.\n break;\n case 'image/gif':\n imagegif ($idest, $dest, $quality); //100 is the quality settings, values range from 0-100.\n break;\n case 'image/png':\n imagepng( $idest, $dest, $quality); //100 is the quality settings, values range from 0-100.\n break;\n case 'image/bmp':\n imagebmp( $idest, $dest, $quality); //100 is the quality settings, values range from 0-100.\n break;\n }*/\n imagedestroy($isrc);\n imagedestroy($idest);\n\n return true;\n }", "function image_resize_to_folder($source_pic, $destination_folder, $filename, $max_width, $max_height)\n{\n $image_info = getimagesize($source_pic['tmp_name']);\n $source_pic_name = $source_pic['name'];\n $source_pic_tmpname = $source_pic['tmp_name'];\n $source_pic_size = $source_pic['size'];\n $source_pic_width = $image_info[0];\n $source_pic_height = $image_info[1];\n if (!is_dir($destination_folder)) {\n mkdir($destination_folder, 0755);\n }\n\n $x_ratio = $max_width / $source_pic_width;\n $y_ratio = $max_height / $source_pic_height;\n\n if (($source_pic_width <= $max_width) && ($source_pic_height <= $max_height)) {\n $tn_width = $source_pic_width;\n $tn_height = $source_pic_height;\n } elseif (($x_ratio * $source_pic_height) < $max_height) {\n $tn_height = ceil($x_ratio * $source_pic_height);\n $tn_width = $max_width;\n } else {\n $tn_width = ceil($y_ratio * $source_pic_width);\n $tn_height = $max_height;\n }\n\n switch ($image_info['mime']) {\n case 'image/gif':\n if (imagetypes() & IMG_GIF) {\n $src = imageCreateFromGIF($source_pic['tmp_name']);\n $destination_folder.=\"$filename.gif\";\n $namafile = \"$filename.gif\";\n }\n break;\n\n case 'image/jpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name']);\n $destination_folder.=\"$filename.jpg\";\n $namafile = \"$filename.jpg\";\n }\n break;\n\n case 'image/pjpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name']);\n $destination_folder.=\"$filename.jpg\";\n $namafile = \"$filename.jpg\";\n }\n break;\n\n case 'image/png':\n if (imagetypes() & IMG_PNG) {\n $src = imageCreateFromPNG($source_pic['tmp_name']);\n $destination_folder.=\"$filename.png\";\n $namafile = \"$filename.png\";\n }\n break;\n\n case 'image/wbmp':\n if (imagetypes() & IMG_WBMP) {\n $src = imageCreateFromWBMP($source_pic['tmp_name']);\n $destination_folder.=\"$filename.bmp\";\n $namafile = \"$filename.bmp\";\n }\n break;\n }\n\n //chmod($destination_pic,0777);\n $tmp = imagecreatetruecolor($tn_width, $tn_height);\n imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tn_width, $tn_height, $source_pic_width, $source_pic_height);\n\n //**** 100 is the quality settings, values range from 0-100.\n switch ($image_info['mime']) {\n case 'image/jpeg':\n imagejpeg($tmp, $destination_folder, 100);\n break;\n\n case 'image/gif':\n imagegif($tmp, $destination_folder, 100);\n break;\n\n case 'image/png':\n imagepng($tmp, $destination_folder);\n break;\n\n default:\n imagejpeg($tmp, $destination_folder, 100);\n break;\n }\n\n return ($namafile);\n}", "public function getImageSize()\n {\n return $this->ImageSize;\n }", "public function calculateMediaWidthsAndHeightsDataProvider() {}", "public function imageThumb($src,$dest,$desired_width = false, $desired_height = false){\n\t\t // if (!$desired_height&&!$desired_width) return false;\n\t\t $fparts = pathinfo($src);\n\n\t\t $ext = strtolower($fparts['extension']);\n\t\t /* if its not an image return false */\n\t\t if (!in_array($ext,array('gif','jpg','png','jpeg'))) return false;\n\n\t\t /* read the source image */\n\t\t if ($ext == 'gif')\n\t\t $resource = imagecreatefromgif($src);\n\t\t else if ($ext == 'png')\n\t\t $resource = imagecreatefrompng($src);\n\t\t else if ($ext == 'jpg' || $ext == 'jpeg')\n\t\t $resource = imagecreatefromjpeg($src);\n\n\t\t $width = imagesx($resource);\n\t\t $height = imagesy($resource);\n\t\t /* find the \"desired height\" or \"desired width\" of this thumbnail, relative to each other, if one of them is not given */\n\t\t if(!$desired_height) $desired_height = floor($height*($desired_width/$width));\n\t\t if(!$desired_width) $desired_width = floor($width*($desired_height/$height));\n\n\t\t /* create a new, \"virtual\" image */\n\t\t $virtual_image = imagecreatetruecolor($desired_width,$desired_height);\n\n\t\t /* copy source image at a resized size */\n\t\t imagecopyresized($virtual_image,$resource,0,0,0,0,$desired_width,$desired_height,$width,$height);\n\n\t\t /* create the physical thumbnail image to its destination */\n\t\t /* Use correct function based on the desired image type from $dest thumbnail source */\n\t\t $fparts = pathinfo($dest);\n\t\t $ext = strtolower($fparts['extension']);\n\t\t /* if dest is not an image type, default to jpg */\n\t\t if (!in_array($ext,array('gif','jpg','png','jpeg'))) $ext = 'jpg';\n\t\t $dest = $fparts['dirname'].'/'.$fparts['filename'].'.'.$ext;\n\n\t\t if ($ext == 'gif')\n\t\t imagegif($virtual_image,$dest);\n\t\t else if ($ext == 'png')\n\t\t imagepng($virtual_image,$dest,1);\n\t\t else if ($ext == 'jpg' || $ext == 'jpeg')\n\t\t imagejpeg($virtual_image,$dest,100);\n\n\t\t return true;\n\t\t}", "function get_img_size_format($width, $height, $max_width = false)\n\t{\n\t\t// Maximum Width the Image can take\n\t\t$max_width = ($max_width !== false) ? $max_width : (($this->config['img_max_thumb_width']) ?: 400);\n\n\t\tif ($width > $height)\n\t\t{\n\t\t\treturn array(\n\t\t\t\tround($width * ($max_width / $width)),\n\t\t\t\tround($height * ($max_width / $width))\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array(\n\t\t\t\tround($width * ($max_width / $height)),\n\t\t\t\tround($height * ($max_width / $height))\n\t\t\t);\n\t\t}\n\t}", "function getImagePathInfo() \n { \n return $this->_imagePathInfo; \n }", "function funcs_imageResize(&$width, &$height, $target, $bywidth = null) {\n\tif ($width<=$target && $height<=$target){\n\t\treturn;\n\t}\n\t//takes the larger size of the width and height and applies the \n\t//formula accordingly...this is so this script will work \n\t//dynamically with any size image \n\tif (is_null($bywidth)){\n\t\tif ($width > $height) { \n\t\t\t$percentage = ($target / $width); \n\t\t} else { \n\t\t\t$percentage = ($target / $height); \n\t\t}\n\t}else{\n\t\tif ($bywidth){\n\t\t\t$percentage = ($target / $width);\n\t\t\t//if height would increase as a result\n\t\t\tif ($height < round($height * $percentage)){\n\t\t\t\treturn;\n\t\t\t} \n\t\t}else{\n\t\t\t$percentage = ($target / $height); \n\t\t\t//if width would increase as a result\n\t\t\tif ($width < round($width * $percentage)){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t} \n\t//gets the new value and applies the percentage, then rounds the value \n\t$width = round($width * $percentage); \n\t$height = round($height * $percentage); \n}", "function compress($source, $destination) {\n\n // Get the dimensions of the image\n list($img_in_width, $img_in_height) = getimagesize($source);\n\n // Define the output width\n $out_width = 200;\n \n // Define the height based on the aspect ratio\n $out_height = $out_width * $img_in_height / $img_in_width;\n\n // Create an output image\n $img_out = imagecreatetruecolor($out_width, $out_height);\n \n // Load the input image\n $img_in = imagecreatefromjpeg($source);\n \n // Copy the contents of the image to the output, resizing in the process\n imagecopyresampled($img_out, $img_in, 0, 0, 0, 0, $out_width, $out_height, $img_in_width, $img_in_height);\n \n // Save the file as a JPEG image to the destination\n imagejpeg($img_out, $destination);\n}", "function get_image_size($image) {\n if($image = getimagesize($image)) {\n $image[2] = image_type_to_extension($image[2],false);\n if($image[2] == 'jpeg') {\n $image[2] = 'jpg';\n }\n return $image;\n } else {\n return false;\n }\n}", "function thumb($width, $height)\n\t\t{\n\t\t // not allowing it to be more than 3x greater than the other\n\t\t if (!$height) {\n $reduction = $width / $this->width;\n $height = $this->height * $reduction;\n if ($height > 3*$width) $height = 3*$width;\n\t\t }\n\t\t if (!$width) {\n $reduction = $height / $this->height;\n $width = $this->width * $reduction;\n if ($width > 3*$height) $width = 3*$height;\n\t\t }\n\t\t \n\t\t\t// Picks the best fit from the original to the destination image, cropping when necessary\n\t\t\tif (!$this->image) return;\n\t\t\t$ratio = $this->width / $this->height;\n\t\t \n\t\t\tif ($width / $height > $ratio) {\n\t\t\t\t $new_height = $width / $ratio;\n\t\t\t\t $new_width = $width;\n\t\t\t} else {\n\t\t\t\t $new_width = $height * $ratio;\n\t\t\t\t $new_height = $height;\n\t\t\t}\n\t\t \n\t\t\t$x_mid = $new_width / 2; //horizontal middle\n\t\t\t$y_mid = $new_height / 2; //vertical middle\n\t\t \n\t\t\t$process = imagecreatetruecolor(round($new_width), round($new_height));\n\t\t \n\t\t\timagecopyresampled($process, $this->image, 0, 0, 0, 0, $new_width, $new_height, $this->width, $this->height);\n\t\t\t$thumb = imagecreatetruecolor($width, $height);\n\t\t\timagecopyresampled($thumb, $process, 0, 0, ($x_mid-($width/2)), ($y_mid-($height/2)), $width, $height, $width, $height);\n\t\t\t\n\t\t\timagedestroy($process);\n\t\t\treturn $this->image = $thumb;\n\t\t}", "private function makeImageSize(): void\n {\n list($width, $height) = getimagesize($this->getUrl());\n $size = array('height' => $height, 'width' => $width );\n\n $this->width = $size['width'];\n $this->height = $size['height'];\n }", "function pwg_image_infos($path)\n{\n list($width, $height) = getimagesize($path);\n $filesize = floor(filesize($path)/1024);\n\n return array(\n 'width' => $width,\n 'height' => $height,\n 'filesize' => $filesize,\n );\n}", "function copy_image_resize_to_folder($source_file, $destination_folder, $filename, $max_width, $max_height)\n{\n $image_info = getimagesize($source_file);\n $source_pic_width = $image_info[0];\n $source_pic_height = $image_info[1];\n\n $x_ratio = $max_width / $source_pic_width;\n $y_ratio = $max_height / $source_pic_height;\n\n if (($source_pic_width <= $max_width) && ($source_pic_height <= $max_height)) {\n $tn_width = $source_pic_width;\n $tn_height = $source_pic_height;\n } elseif (($x_ratio * $source_pic_height) < $max_height) {\n $tn_height = ceil($x_ratio * $source_pic_height);\n $tn_width = $max_width;\n } else {\n $tn_width = ceil($y_ratio * $source_pic_width);\n $tn_height = $max_height;\n }\n \n if (!is_dir($destination_folder)) {\n mkdir($destination_folder, 0755);\n }\n\n switch ($image_info['mime']) {\n case 'image/gif':\n if (imagetypes() & IMG_GIF) {\n $src = imageCreateFromGIF($source_file);\n $destination_folder.=\"$filename.gif\";\n $namafile = \"$filename.gif\";\n }\n break;\n\n case 'image/jpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_file);\n $destination_folder.=\"$filename.jpg\";\n $namafile = \"$filename.jpg\";\n }\n break;\n\n case 'image/pjpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_file);\n $destination_folder.=\"$filename.jpg\";\n $namafile = \"$filename.jpg\";\n }\n break;\n\n case 'image/png':\n if (imagetypes() & IMG_PNG) {\n $src = imageCreateFromPNG($source_file);\n $destination_folder.=\"$filename.png\";\n $namafile = \"$filename.png\";\n }\n break;\n\n case 'image/wbmp':\n if (imagetypes() & IMG_WBMP) {\n $src = imageCreateFromWBMP($source_file);\n $destination_folder.=\"$filename.bmp\";\n $namafile = \"$filename.bmp\";\n }\n break;\n }\n \n $tmp = imagecreatetruecolor($tn_width, $tn_height);\n imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tn_width, $tn_height, $source_pic_width, $source_pic_height);\n\n //**** 100 is the quality settings, values range from 0-100.\n switch ($image_info['mime']) {\n case 'image/jpeg':\n imagejpeg($tmp, $destination_folder, 100);\n break;\n\n case 'image/gif':\n imagegif($tmp, $destination_folder, 100);\n break;\n\n case 'image/png':\n imagepng($tmp, $destination_folder);\n break;\n\n default:\n imagejpeg($tmp, $destination_folder, 100);\n break;\n }\n\n return ($namafile);\n}", "function setImageOrientation()\n\t{\n\n\t\tif ($this->width < $this->height) {\n\t\t\t$this->orientation = 'portrait';\n\t\t}\n\n\t\tif ($this->width > $this->height) {\n\t\t\t$this->orientation = 'landscape';\n\t\t}\n\n\t\tif ($this->width == $this->height) {\n\t\t\t$this->orientation = 'square';\n\t\t}\n\t}", "function resize($image,$x,$y=NULL,$wm=NULL,$wml='br'){\n if(!file_exists($image)){\n return false;\n }\n $images = array();\n if($wm !== '' && $wm !== NULL && file_exists($wm)){\n $images['wmimg'] = $wm;\n }\n $images['img'] = $image;\n foreach($images as $key=>$value){\n $type = substr($value,strrpos($value,'.'));\n if(stristr($type,'i')){\n $$key = imagecreatefromgif($value);\n }\n if(stristr($type,'j')){\n $$key = imagecreatefromjpeg($value);\n }\n if(stristr($type,'n')){\n $$key = imagecreatefrompng($value);\n }\n }\n $size = array();\n if($y === '' || $y === NULL){\n $size['x'] = imageSX($img);\n $size['y'] = imageSY($img);\n if($size['x'] >= $size['y']){\n $size['dest_x'] = $x;\n $size['dest_y'] = ceil($size['y'] * ($x / $size['x']));\n }else{\n $size['dest_y'] = $x;\n $size['dest_x'] = ceil($size['x'] * ($x / $size['y']));\n }\n $dest = imageCreatetruecolor($size['dest_x'],$size['dest_y']);\n }else{\n $dest = imagecreatetrueColor($x,$y);\n $size['x'] = imageSX($img);\n $size['y'] = imageSY($img);\n $size['dest_x'] = $x;\n $size['dest_y'] = $y;\n }\n imagecopyresized($dest, $img, 0, 0, 0, 0, $size['dest_x'], $size['dest_y'], $size['x'], $size['y']);\n if(isset($wmimg)){\n $size['wmx'] = imageSX($wmimg);\n $size['wmy'] = imageSY($wmimg);\n $size['wmh'] = strtolower($wml{0}) === 'b' ? ($size['dest_y'] - $size['wmy'] - 0) : 0;\n $size['wmw'] = strtolower($wml{1}) === 'r' ? ($size['dest_x'] - $size['wmx'] - 0) : 0;\n imagecopy($dest, $wmimg, $size['wmw'], $size['wmh'], 0, 0, $size['wmx'], $size['wmy']);\n imagedestroy($wmimg);\n }\n imagedestroy($img);\n return $dest;\n }", "function resize_image($src, $width, $height){\n // initializing\n $save_path = Wordless::theme_temp_path();\n $img_filename = Wordless::join_paths($save_path, md5($width . 'x' . $height . '_' . basename($src)) . '.jpg');\n\n // if file doesn't exists, create it\n if (!file_exists($img_filename)) {\n $to_scale = 0;\n $to_crop = 0;\n\n // Get orig dimensions\n list ($width_orig, $height_orig, $type_orig) = getimagesize($src);\n\n // get original image ... to improve!\n switch($type_orig){\n case IMAGETYPE_JPEG: $image = imagecreatefromjpeg($src);\n break;\n case IMAGETYPE_PNG: $image = imagecreatefrompng($src);\n break;\n case IMAGETYPE_GIF: $image = imagecreatefromgif($src);\n break;\n default:\n return;\n }\n\n // which is the new smallest?\n if ($width < $height)\n $min_dim = $width;\n else\n $min_dim = $height;\n\n // which is the orig smallest?\n if ($width_orig < $height_orig)\n $min_orig = $width_orig;\n else\n $min_orig = $height_orig;\n\n // image of the right size\n if ($height_orig == $height && $width_orig == $width) ; // nothing to do\n // if something smaller => scale\n else if ($width_orig < $width) {\n $to_scale = 1;\n $ratio = $width / $width_orig;\n }\n else if ($height_orig < $height) {\n $to_scale = 1;\n $ratio = $height / $height_orig;\n }\n // if both bigger => scale\n else if ($height_orig > $height && $width_orig > $width) {\n $to_scale = 1;\n $ratio_dest = $width / $height;\n $ratio_orig = $width_orig / $height_orig;\n if ($ratio_dest > $ratio_orig)\n $ratio = $width / $width_orig;\n else\n $ratio = $height / $height_orig;\n }\n // one equal one bigger\n else if ( ($width == $width_orig && $height_orig > $height) || ($height == $height_orig && $width_orig > $width) )\n $to_crop = 1;\n // some problem...\n else\n echo \"ALARM\";\n\n // we need to zoom to get the right size\n if ($to_scale == 1) {\n $new_width = $width_orig * $ratio;\n $new_height = $height_orig * $ratio;\n $image_scaled = imagecreatetruecolor($new_width, $new_height);\n // scaling!\n imagecopyresampled($image_scaled, $image, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n $image = $image_scaled;\n\n if($new_width > $width || $new_height > $height)\n $to_crop = 1;\n }\n else {\n $new_width = $width_orig;\n $new_height = $height_orig;\n }\n\n // we need to crop the image\n if ($to_crop == 1) {\n $image_cropped = imagecreatetruecolor($width, $height);\n\n // find margins for images\n $margin_x = ($new_width - $width) / 2;\n $margin_y = ($new_height - $height) / 2;\n\n // cropping!\n imagecopy($image_cropped, $image, 0, 0, $margin_x, $margin_y, $width, $height);\n $image = $image_cropped;\n }\n\n // Save image\n imagejpeg($image, $img_filename, 95);\n }\n\n // Return image URL\n return Wordless::join_paths(Wordless::theme_temp_path(), basename($img_filename));\n }", "public function get_image_width()\n {\n }" ]
[ "0.65955704", "0.6293387", "0.62654376", "0.60870034", "0.60772336", "0.60467917", "0.6022207", "0.59446186", "0.5915781", "0.5891282", "0.58888495", "0.5829087", "0.5817982", "0.580959", "0.5809302", "0.57964665", "0.5788052", "0.5767061", "0.5764752", "0.5748477", "0.57390517", "0.5730023", "0.5687444", "0.56566733", "0.56260794", "0.56222266", "0.56146437", "0.5598207", "0.5592983", "0.5590179", "0.558763", "0.5573942", "0.55322534", "0.5532024", "0.5525715", "0.55253756", "0.55181813", "0.550957", "0.5507953", "0.55075115", "0.5504589", "0.54965293", "0.54897034", "0.54836506", "0.54836506", "0.54836506", "0.54836506", "0.5483423", "0.5461342", "0.5461063", "0.54578507", "0.54531604", "0.54359", "0.543396", "0.54250264", "0.54220855", "0.5417467", "0.5404681", "0.5395314", "0.53862023", "0.5383287", "0.53773135", "0.5376537", "0.5373317", "0.5343841", "0.53353924", "0.533491", "0.532864", "0.5324749", "0.53190875", "0.5318749", "0.5316715", "0.5313888", "0.5313241", "0.53097403", "0.5306486", "0.5300491", "0.5298753", "0.5293645", "0.5287964", "0.5272908", "0.5270906", "0.5268472", "0.5267699", "0.52620256", "0.52467525", "0.5246386", "0.5235975", "0.5235211", "0.5232847", "0.52305925", "0.52269304", "0.5223864", "0.52163947", "0.5215447", "0.52149844", "0.52122945", "0.5202594", "0.5202248", "0.51979923" ]
0.72320074
0
Function to resize uploaded image
public function resize($source = array(), $new_name = '', $config = array()) { $source_width = $source['image_width']; $source_height = $source['image_height']; $width = $config['width']; $height = $config['height']; $max = FALSE; if(array_key_exists('max', $config)) $max = $config['max']; $mark = ''; if(array_key_exists('mark', $config)) $mark = $config['mark']; $create_new = FALSE; if(array_key_exists('create_new', $config)) $create_new = $config['create_new']; if($create_new && $mark == '') $mark = 'resized-'; $orientation = 'box'; if($height > $width) { $orientation = 'portrait'; } elseif($height < $width) { $orientation = 'landscape'; } $source_orientation = 'box'; if($source_height > $source_width) { $source_orientation = 'portrait'; } elseif($source_height < $source_width) { $source_orientation = 'landscape'; } if($max) { $size = array( 'width' => $width, 'height' => $height ); } else { $size = $this->_calculate_size(array( 'orientation' => $source_orientation, 'width' => $source_width, 'height' => $source_height ), array( 'orientation' => $orientation, 'width' => $width, 'height' => $height )); } $thumb['image_library'] = 'gd2'; $thumb['source_image'] = $source['full_path']; $thumb['width'] = $size['width']; $thumb['height'] = $size['height']; $thumb['maintain_ratio'] = TRUE; $thumb['quality'] = 100; if($create_new) { $thumb['new_image'] = './' . $this->upload_dir . $mark . $new_name . $source['file_ext']; } $this->CI->image_lib->initialize($thumb); if($this->CI->image_lib->resize()) { return array( 'status' => TRUE ); } else { exit($this->image_lib->display_errors()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function resize() {\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$originalImage = imagecreatefromjpeg($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t$originalImage = imagecreatefrompng($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$originalImage = imagecreatefromgif($this->tempName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// Determine new height\n\t\t$this->newHeight = ($this->height / $this->width) * $this->newWidth;\n\n\t\t// Create new image\n\t\t$this->newImage = imagecreatetruecolor($this->newWidth, $this->newHeight);\n\n\t\t// Resample original image into new image\n\t\timagecopyresampled($this->newImage, $originalImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->width, $this->height);\n\n\t\t// Switch based on image being resized\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t// Source, Dest, Quality 0 to 100\n\t\t\t\timagejpeg($this->newImage, $this->destinationFolder.'/'.$this->newName, 80);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t// Source, Dest, Quality 0 (no compression) to 9\n\t\t\t\timagepng($this->newImage, $this->destinationFolder.'/'.$this->newName, 0);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($this->newImage, $this->destinationFolder.'/'.$this->newName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('YOUR FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// DESTROY NEW IMAGE TO SAVE SERVER SPACE\n\t\timagedestroy($this->newImage);\n\t\timagedestroy($originalImage);\n\n\t\t// SUCCESSFULLY UPLOADED\n\t\t$this->result = true;\n\t\t$this->message = 'Image uploaded and resized successfully';\n\t}", "public function resize()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('resize');\n\t}", "function resize_image($src, $width, $height){\n // initializing\n $save_path = Wordless::theme_temp_path();\n $img_filename = Wordless::join_paths($save_path, md5($width . 'x' . $height . '_' . basename($src)) . '.jpg');\n\n // if file doesn't exists, create it\n if (!file_exists($img_filename)) {\n $to_scale = 0;\n $to_crop = 0;\n\n // Get orig dimensions\n list ($width_orig, $height_orig, $type_orig) = getimagesize($src);\n\n // get original image ... to improve!\n switch($type_orig){\n case IMAGETYPE_JPEG: $image = imagecreatefromjpeg($src);\n break;\n case IMAGETYPE_PNG: $image = imagecreatefrompng($src);\n break;\n case IMAGETYPE_GIF: $image = imagecreatefromgif($src);\n break;\n default:\n return;\n }\n\n // which is the new smallest?\n if ($width < $height)\n $min_dim = $width;\n else\n $min_dim = $height;\n\n // which is the orig smallest?\n if ($width_orig < $height_orig)\n $min_orig = $width_orig;\n else\n $min_orig = $height_orig;\n\n // image of the right size\n if ($height_orig == $height && $width_orig == $width) ; // nothing to do\n // if something smaller => scale\n else if ($width_orig < $width) {\n $to_scale = 1;\n $ratio = $width / $width_orig;\n }\n else if ($height_orig < $height) {\n $to_scale = 1;\n $ratio = $height / $height_orig;\n }\n // if both bigger => scale\n else if ($height_orig > $height && $width_orig > $width) {\n $to_scale = 1;\n $ratio_dest = $width / $height;\n $ratio_orig = $width_orig / $height_orig;\n if ($ratio_dest > $ratio_orig)\n $ratio = $width / $width_orig;\n else\n $ratio = $height / $height_orig;\n }\n // one equal one bigger\n else if ( ($width == $width_orig && $height_orig > $height) || ($height == $height_orig && $width_orig > $width) )\n $to_crop = 1;\n // some problem...\n else\n echo \"ALARM\";\n\n // we need to zoom to get the right size\n if ($to_scale == 1) {\n $new_width = $width_orig * $ratio;\n $new_height = $height_orig * $ratio;\n $image_scaled = imagecreatetruecolor($new_width, $new_height);\n // scaling!\n imagecopyresampled($image_scaled, $image, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n $image = $image_scaled;\n\n if($new_width > $width || $new_height > $height)\n $to_crop = 1;\n }\n else {\n $new_width = $width_orig;\n $new_height = $height_orig;\n }\n\n // we need to crop the image\n if ($to_crop == 1) {\n $image_cropped = imagecreatetruecolor($width, $height);\n\n // find margins for images\n $margin_x = ($new_width - $width) / 2;\n $margin_y = ($new_height - $height) / 2;\n\n // cropping!\n imagecopy($image_cropped, $image, 0, 0, $margin_x, $margin_y, $width, $height);\n $image = $image_cropped;\n }\n\n // Save image\n imagejpeg($image, $img_filename, 95);\n }\n\n // Return image URL\n return Wordless::join_paths(Wordless::theme_temp_path(), basename($img_filename));\n }", "function imgResize($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0,$postFix=\"\") {\n\t\t$dest_filename='';\n\t\t$handle = new upload($file_ori);\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\tif ($handle->uploaded) {\n\t\t\tif($img_proper[0]>$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]>$imgx && $img_proper[1]<$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]<$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t}\n\t\t\t$handle->file_name_body_add = $postFix;\n\t\t\t$handle->process($UploadPath);\n\t\t\tif ($handle->processed) {\n\t\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\t\tif($clean==1)\n\t\t\t\t\t$handle->clean();\n\t\t\t} else\n\t\t\t\t$dest_filename='';\n\t\t}\n\t\treturn $dest_filename;\n\t}", "function media_upload_max_image_resize()\n {\n }", "function uploadAndResizeImage(array $fileToUpload, $uploadFolder, array $sizes) {\n\n $result = [];\n\n /*\n Vi smider værdierne fra $_FILES super global\n variablen i vores egne variabler og giver dem\n et mere beskrivende variabel navn\n */\n\n $originalFile = $fileToUpload['name'];\n\n /*\n pathinfo er en function til at få information omkring en fil, samt stien til den fil.\n i dette tilfælde benytter vi den til at få endelsen på filen altså: jpg, gif, png osv\n\n Vi kører pathinfo igennem en strtolower (string to lower) function, således at fil\n endelsen altid kommer ud i små bogstaver.\n\n Vi ved ikke hvad brugerne kommer med, så dette er en måde at sikre os, at vi altid\n arbejder på den samme måde, nemlig med små bogstaver\n */\n\n $fileType = strtolower(pathinfo($originalFile, PATHINFO_EXTENSION));\n\n // var_dump($fileType);\n // die;\n\n /*\n Vi benytter samme metode til at få filnavnet ud, uden endelsen: .jpg, .png osv\n */\n\n $originalFilename = pathinfo($originalFile, PATHINFO_FILENAME);\n\n // var_dump($originalFilename);\n // die;\n\n $uploadedFile = $fileToUpload['tmp_name'];\n $errors = $fileToUpload['error'];\n $fileSize = $fileToUpload['size'];\n\n /*\n Det er nu tid til at kigge på hvilken fil og filtype vi har fået ind\n og teste på om dette er den rette.\n\n Vi begynder samtidig med at se på selve resize delen af scriptet\n\n Til denne del, benytter vi en række functions som går ind og opfører\n sig lidt som et billedredigerings program, som eksempelvis Photoshop.\n\n Det betyder at vi begynder at kigge på hvad der er i selve filen vi uploader,\n vi ser på billedet i pixels, som man ville gøre det i et billedredigeringsprogram\n\n Da måden PHP ser på hvad der er i et billede rent pixelmæssigt er udgjort på baggrund\n af filtypen: png, jpg osv, kan vi slå \"valideringen\" af filtypen sammen med denne del\n */\n\n switch ($fileType) {\n case 'png':\n\n /*\n png formatet er i orden, her beder vi php om at\n skabe et kilde billede i pixels, i hukommelsen, vi kan arbejde med\n som var det et billedredigerings program.\n */\n\n $sourceImage = imagecreatefrompng($uploadedFile);\n\n break;\n\n case 'gif':\n\n /* samme som ovenstående bare i forhold til gif billeder */\n\n $sourceImage = imagecreatefromgif($uploadedFile);\n\n break;\n\n case 'jpeg':\n case 'jpg':\n\n /* samme som ovenstående bare i forhold til jpg billeder */\n\n $sourceImage = imagecreatefromjpeg($uploadedFile);\n\n break;\n\n default:\n\n /* skulle vi få et format ind vi ikke kender, stopper vi scriptet */\n\n throw new Exception('Unknown image filetype given');\n\n break;\n }\n\n /*\n Nu hvor vi skal til at arbejde med vores kilde billede, er vi nødt til at kende\n størrelsen.\n getimagesize functionen returnerer et array med størrelses informationerne.\n Her skal vi benytte de 2 første værdier, som angiver størrelsen i integers\n */\n\n $sourceImageWidth = getimagesize($uploadedFile)[0];\n\n // var_dump($sourceImageWidth);\n // var_dump($sourceImageHeight);\n // die;\n\n /*\n Alternativt kan man bruge list functionen, som giver os mulighed for at\n overføre værdier fra et array, direkte til variabler.\n\n Her er det dog vigtigt at kende placeringerne i det array der returneres.\n\n Vi ved at de 2 første er vores vidde og bredde og kunne derfor skrive\n list($variabeltilvidde, $variabeltilhøjdre) = getimagesize($uploadedFile);\n */\n\n list($sourceImageWidth, $sourceImageHeight) = getimagesize($uploadedFile);\n\n /*\n Vi skal nu til selve resizing af billeder.\n\n Da vi angiver disse i et array, vil vi løbe over dem\n igennem en foreach\n */\n\n foreach ($sizes as $prefix => $size) {\n /*\n Vi angiver først vores ønskede billedstørrelse\n Vidden kan vi tage fra vores sizes array.\n\n Højden bruger vi i en udregning for at holde vores aspect ratio.\n Formlen for denne lyder:\n Original højde / original vidde * ny vidde = ny højde\n */\n\n $width = $size;\n $height = ($sourceImageHeight / $sourceImageWidth) * $size;\n\n // echo $width;\n // echo $height;\n // die;\n\n /*\n Vi skaber et tomt canvas, som vi kan fylde ud med pixels fra\n det originale billede. Dette canvas sætter vi størrelsen på.\n imagecreatetruecolor functionen benyttes til at skabe dette tomme canvas\n */\n\n $newImage = imagecreatetruecolor($width, $height);\n /*\n Vi benytter imagecopyresample functionen til at kopiere pixels fra vores originale billede\n over til vores nye billede.\n\n Måden dette gøres på, er ved at skabe et rektangel på det originale billede, hvor de pixels\n som ligger inden for denne rektangel bliver kopieret.\n\n Dernæst benytter vi endnu et rektangel på det nye billede, hvorved de kopierede pixels\n pastes ind.\n\n Hvis det nye billede er mindre, vel der her skabes en resizing, som derved får de kopierede\n pixels til at passe ind i det rektangel de skal passe i.\n\n Vi angiver vores nye billede, vores originale billede og dernes koordinaterne for:\n Hvor på x aksen rektanglet på det nye billede skal placeres\n Hvor på y aksen rektanglet på det nye billede skal placeres\n\n Hvor på x aksen rektanglet på det originale billede skal placeres\n Hvor på y aksen rektanglet på det originale billede skal placeres.\n\n Dernæst angiver vi størrelsen på vores rekstangler, altså:\n Vidden på rektanglet på vores nye billede\n Højden på rektanglet på vores nye billede\n\n Vidden på rektanglet på vores originale billede\n Højde på rektanglet på vores originale billede\n */\n\n imagecopyresampled($newImage, $sourceImage, 0, 0, 0, 0, $width, $height, $sourceImageWidth, $sourceImageHeight);\n\n /*\n Når det nye billede har modtagede de kopierede pixels\n fra det originale er vi klar til at gemme det.\n\n Vi opbygger derefter filnavnet samt stien hvor dette skal gemmes.\n $uploadFolder stien bliver givet igennem denne functions parameter\n\n time() functionen giver os et timestamp for det øjeblik filens skal gemmes.\n vi benytter dette, for at få et unikt filnavn, således at vi ikke overskriver\n eksisterende filer med samme navn\n\n $prefix bliver givet igennem vores sizes array\n\n $originalFilename blev fundet igennem overførslen fra Super global variablen\n øverst i denne function.\n\n Dernæst vælger vi at gemme denne fil som jpg.\n\n */\n if ($fileType == \"jpeg\") {\n $filename = $uploadFolder . $prefix . '_' . time() . '_' . $originalFilename . '.jpg';\n imagejpeg($newImage, $filename, 100);\n }\n if ($fileType == \"jpg\") {\n $filename = $uploadFolder . $prefix . '_' . time() . '_' . $originalFilename . '.jpg';\n imagejpeg($newImage, $filename, 100);\n }\n if ($fileType == \"gif\") {\n $filename = $uploadFolder . $prefix . '_' . time() . '_' . $originalFilename . '.gif';\n imagegif($newImage, $filename, 100);\n }\n if ($fileType == \"png\") {\n $filename = $uploadFolder . $prefix . '_' . time() . '_' . $originalFilename . '.png';\n imagepng($newImage, $filename, 100);\n }\n\n /*\n Vores nye billede ligger stadigvæk i serverens hukommelse\n For at være gode og ansvarlige programmører, sletter vi dette, således\n at hukommelsen frigives til de andre brugere af serveren :-)\n */\n\n imagedestroy($newImage);\n\n /*\n Til sidst smider vi vores filsti i vores result array, således\n at det efterfølgende kan benyttes i en database.\n\n Vi genbruger her vores prefix fra vores sizes array, således\n at fil stierne kan adskilles\n */\n\n $result[$prefix] = $filename;\n }\n\n /*\n Da vores originale billede også ligger i serverens hukommelse,\n vil vi igen være gode og ansvarlige programmører der fjerner dette\n */\n\n imagedestroy($sourceImage);\n\n return $result;\n}", "function image_resize()\n\t{\n\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\tif (substr($protocol, -3) == 'gd2')\n\t\t{\n\t\t\t$protocol = 'image_process_gd';\n\t\t}\n\t\t\n\t\treturn $this->$protocol('resize');\n\t}", "public static function resizeImageUpload($upload_field_name, $max_width, $max_height)\n\t{\n\t\t$filename = $_FILES[$upload_field_name]['tmp_name'];\n\t\t// Get new dimensions\n\t\tlist($width, $height) = getimagesize($filename);\n\t\t\n\t\t$width_percent = $max_width / $width;\n\t\t$height_percent = $max_height / $height;\n\t\t\n\t\t$final_percent = 0.00;\n\t\tif ($width_percent < $height_percent)\n\t\t\t$final_percent = $width_percent;\n\t\telse\n\t\t\t$final_percent = $height_percent;\n\t\t\n\t\t$new_width = $width * $final_percent;\n\t\t$new_height = $height * $final_percent;\n\n\t\t// Resample\n\t\t$image_p = imagecreatetruecolor($max_width, $max_height);\n\t\t\n\t\t$info = getimagesize($filename);\n\n\t\t$image = null;\n\t\tif ($info['mime'] == \"image/png\")\n\t\t\t$image = imagecreatefrompng($filename);\n\t\telse if ($info['mime'] == \"image/gif\")\n\t\t\t$image = imagecreatefromgif($filename);\n\t\telse\n\t\t\t$image = imagecreatefromjpeg($filename);\n\n\t\timagefill($image_p, 0, 0, imagecolorallocate($image_p, 255,255,255));\n\t\timagecopyresampled($image_p, $image, ($max_width - $new_width) / 2, ($max_height - $new_height) / 2, 0, 0, $new_width, $new_height, $width, $height);\n\n\t\t// Output\n\t\timagepng($image_p, $filename, 0);\n\t}", "public function image_resize()\n {\n $url = $this->input->get('pic');\n $width = $this->input->get('width');\n $height = $this->input->get('height');\n $bgcolor = $this->input->get('color');\n $type = $this->input->get('type');\n $loc = $this->input->get('loc');\n if (empty($type)) {\n $type = 'fit'; // fit, fill\n }\n if (empty($loc)) {\n $loc = 'Center'; // NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast\n }\n $strict = FALSE;\n if (substr($width, -1) == \"*\" && substr($height, -1) == \"*\") {\n $width = substr($width, 0, -1);\n $height = substr($height, 0, -1);\n $strict = TRUE;\n }\n\n// $bgcolor = (trim($bgcolor) == \"\") ? \"FFFFFF\" : $bgcolor;\n// $props = array(\n// 'picture' => $url,\n// 'resize_width' => $width,\n// 'resize_height' => $height,\n// 'bg_color' => $bgcolor\n// );\n//\n// $this->load->library('Image_resize', $props);\n// $this->skip_template_view();\n\n $dest_folder = APPPATH . 'cache' . DS . 'temp' . DS;\n $this->general->createFolder($dest_folder);\n\n $pic = trim($url);\n $pic = base64_decode($pic);\n $pic = str_replace(\" \", \"%20\", $pic);\n $url = $pic;\n $url = str_replace(\" \", \"%20\", $url);\n $props = array(\n 'picture' => $url,\n 'resize_width' => $width,\n 'resize_height' => $height,\n 'bg_color' => $bgcolor\n );\n $md5_url = md5($url . serialize($props));\n $tmp_path = $tmp_file = $dest_folder . $md5_url;\n\n if (strpos($url, $this->config->item('site_url')) === FALSE && strpos($url, 's3.amazonaws') === FALSE) {\n $this->output->set_status_header(400);\n exit;\n }\n \n if (!is_file($tmp_path)) {\n $image_data = file_get_contents($url);\n if ($image_data == FALSE) {\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($curl, CURLOPT_TIMEOUT, 600);\n curl_setopt($curl, CURLOPT_COOKIEJAR, \"cookie.txt\");\n curl_setopt($curl, CURLOPT_COOKIEFILE, \"cookie.txt\");\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($curl, CURLOPT_VERBOSE, TRUE);\n //curl_setopt($curl, CURLOPT_HEADER, TRUE);\n $image_data = curl_exec($curl);\n\n if ($image_data == FALSE) {\n \t\n $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n if ($httpCode != 200) {\n $this->output->set_status_header($httpCode);\n exit;\n }\n }\n curl_close($curl);\n// $headers = parse_response_header($http_response_header);\n// if ($headers['reponse_code'] != 200) {\n// $this->output->set_status_header($headers['reponse_code']);\n// exit;\n// }\n }\n $handle = fopen($tmp_path, 'w+');\n fwrite($handle, $image_data);\n fclose($handle);\n\n $img_info = getimagesize($tmp_path);\n $img_ext = end(explode(\"/\", $img_info['mime']));\n if ($img_ext == 'jpeg' || $img_ext == \"pjpeg\") {\n $img_ext = 'jpg';\n }\n if ($strict == TRUE && $img_info[0] < $width && $img_info[1] < $height) {\n $tmp_file = $tmp_path;\n } else {\n\n $this->load->library('image_lib');\n\n $image_process_tool = $this->config->item('imageprocesstool');\n $config['image_library'] = $image_process_tool;\n if ($image_process_tool == \"imagemagick\") {\n $config['library_path'] = $this->config->item('imagemagickinstalldir');\n }\n// if ($img_ext == \"jpg\") {\n// $png_convert = $this->image_lib->convet_jpg_png($tmp_path, $tmp_path . \".png\", $config['library_path']);\n// if ($png_convert) {\n// unlink($tmp_path);\n// rename($tmp_path . \".png\", $tmp_path);\n// }\n// }\n\n if ($type == 'fill') {\n $img_info = getimagesize($tmp_path);\n $org_width = $img_info[0];\n $org_height = $img_info[1];\n\n $width_ratio = $width / $org_width;\n $height_ratio = $height / $org_height;\n if ($width_ratio > $height_ratio) {\n $resize_width = $org_width * $width_ratio;\n $resize_height = $org_height * $width_ratio;\n } else {\n $resize_width = $org_width * $height_ratio;\n $resize_height = $org_height * $height_ratio;\n }\n\n $crop_width = $width;\n $crop_height = $height;\n\n $width = $resize_width;\n $height = $resize_height;\n }\n\n $config['source_image'] = $tmp_path;\n $config['width'] = $width;\n $config['height'] = $height;\n $config['gravity'] = $loc; //center/West/East\n $config['bgcolor'] = (trim($bgcolor) != \"\") ? trim($bgcolor) : $this->config->item('imageresizebgcolor');\n $this->image_lib->initialize($config);\n $this->image_lib->resize();\n\n if ($type == 'fill') {\n $config['source_image'] = $tmp_path;\n $config['width'] = $crop_width;\n $config['height'] = $crop_height;\n $config['gravity'] = 'center';\n $config['maintain_ratio'] = FALSE;\n\n $this->image_lib->initialize($config);\n $this->image_lib->crop();\n }\n }\n }\n\n $this->image_display($tmp_file);\n }", "function imgResizeHeight($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0) {\n\t\t$dest_filename='';\n\t\t$handle = new upload($file_ori);\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\t\n\t\tif ($handle->uploaded) {\n\t\t\t//$handle->image_x = $imgx;\n\t\t\t$handle->image_y = $imgy;\n\t\t\t$handle->image_resize = true;\n\t\t\t$handle->image_ratio_x = true;\n\t\t}\n\t\t$handle->process($UploadPath);\n\t\tif ($handle->processed) {\n\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\tif($clean==1)\n\t\t\t\t$handle->clean();\n\t\t} else\n\t\t\t$dest_filename='';\n\t\treturn $dest_filename;\n\t}", "function imgResize_gallery($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0,$allowedFormat=array('image/*'),$Maxfilesize=2097152,$filename_body='')\t{\n\t\t$dest_filename='';\n\t\t\n\t\t$handle = new upload($file_ori);\n\t\t$handle->allowed = $allowedFormat;\n\t\t$handle->file_max_size = $Maxfilesize;\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\t\n\t\tif($filename_body!='')\n\t\t\t$handle->file_name_body_add = $filename_body;\n\t\t\n\t\tif ($handle->uploaded) {\n\t\t\tif((($img_proper[0]>$imgx && $img_proper[1]>$imgy) || ($img_proper[0]>$imgx && $img_proper[1]<$imgy)) && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]<$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t}\n\t\t\t$handle->process($UploadPath);\n\t\t\tif ($handle->processed) {\n\t\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\t\tif($clean==1)\n\t\t\t\t\t$handle->clean();\n\t\t\t} else\n\t\t\t\t$dest_filename='';\n\t\t}\n\t\treturn $dest_filename;\n\t}", "public function image_resize($width = 0, $height = 0, $image_url, $filename, $upload_url)\n {\n $source_path = realpath($image_url);\n list($source_width, $source_height, $source_type) = getimagesize($source_path);\n switch ($source_type)\n {\n case IMAGETYPE_GIF:\n $source_gdim = imagecreatefromgif($source_path);\n break;\n case IMAGETYPE_JPEG:\n $source_gdim = imagecreatefromjpeg($source_path);\n break;\n case IMAGETYPE_PNG:\n $source_gdim = imagecreatefrompng($source_path);\n break;\n }\n\n $source_aspect_ratio = $source_width / $source_height;\n $desired_aspect_ratio = $width / $height;\n\n if ($source_aspect_ratio > $desired_aspect_ratio)\n {\n /*\n * Triggered when source image is wider\n */\n $temp_height = $height;\n $temp_width = (int)($height * $source_aspect_ratio);\n }\n else\n {\n /*\n * Triggered otherwise (i.e. source image is similar or taller)\n */\n $temp_width = $width;\n $temp_height = (int)($width / $source_aspect_ratio);\n }\n\n /*\n * Resize the image into a temporary GD image\n */\n\n $temp_gdim = imagecreatetruecolor($temp_width, $temp_height);\n imagecopyresampled($temp_gdim, $source_gdim, 0, 0, 0, 0, $temp_width, $temp_height, $source_width, $source_height);\n\n /*\n * Copy cropped region from temporary image into the desired GD image\n */\n\n $x0 = ($temp_width - $width) / 2;\n $y0 = ($temp_height - $height) / 2;\n $desired_gdim = imagecreatetruecolor($width, $height);\n imagecopy($desired_gdim, $temp_gdim, 0, 0, $x0, $y0, $width, $height);\n\n /*\n * Render the image\n * Alternatively, you can save the image in file-system or database\n */\n\n $image_url = $upload_url . $filename;\n\n imagepng($desired_gdim, $image_url);\n\n return $image_url;\n\n /*\n * Add clean-up code here\n */\n }", "function upload_passport($path, $ext, $sn) {\n $img_url = 'passport' . $sn . '-' . date('mdYHis.') . $ext;\n move_uploaded_file($path, \"temp_img/\" . $img_url);\n $resizeObj = new resize(\"temp_img/\" . $img_url);\n $resizeObj->resizeImage(280, 350, 'crop');\n $resizeObj->saveImage(\"pics/\" . $img_url, 100);\n unlink(\"temp_img/\" . $img_url);\n return $img_url;\n}", "public function ImageResize($file_resize_width, $file_resize_height){\r\n $this->proc_filewidth=$file_resize_width;\r\n $this->proc_fileheight=$file_resize_height;\r\n }", "protected function resizeImage($path)\n\t{\n\t\t$iP = &$this->uploader->imageProcessor;\n\t\t$iP->load($this->uploader->mediaService->getItem($path));\n\t\t$iP->resize_square(500);\n\t\t$iP->saveImage();\n }", "public function resize(IImageInformation $src, $width, $height);", "public function uploadAndResize($request, $width=null, $height=null)\n {\n if( is_null($width) && is_null($height) )\n {\n $width = 1600; \n $height = 1000;\n }\n\n if($request->file('file'))\n {\n $this->validate($request, ['file' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048']);\n $image = $request->file('file');\n $input['imagename'] = time().'.'.$image->getClientOriginalExtension();\n $destinationPath = public_path('/images');\n\n //redimensionner Image\n $image_resize = Resize::make($image->getRealPath()); \n $resultat = $image_resize->resize($width, $height);\n $path = $destinationPath . '/' . $input['imagename'];\n $image_resize->save($path);\n return $input['imagename'];\n }\n }", "function resize_image($filename)\n {\n $img_source = 'assets/images/products/'. $filename;\n $img_target = 'assets/images/thumb/';\n\n // image lib settings\n $config = array(\n 'image_library' => 'gd2',\n 'source_image' => $img_source,\n 'new_image' => $img_target,\n 'maintain_ratio' => FALSE,\n 'width' => 128,\n 'height' => 128\n );\n // load image library\n $this->load->library('image_lib', $config);\n\n // resize image\n if(!$this->image_lib->resize())\n echo $this->image_lib->display_errors();\n $this->image_lib->clear();\n }", "function imgResize($filename, $newWidth, $newHeight, $dir_out){\n\t\n\t// изменение размера изображения\n\n\t// 1 создадим новое изображение из файла\n\t$scr = imagecreatefromjpeg($filename); // или $imagePath\n\t\n\t// 2 создадим новое полноцветное изображение нужного размера\n\t$newImg = imagecreatetruecolor($newWidth, $newHeight);\n\n\t// 3 определим размер исходного изображения для 4 пункта\n\t$size = getimagesize($filename);\n\n\t// 4 копирует прямоугольную часть одного изображения на другое изображение, интерполируя значения пикселов таким образом, чтобы уменьшение размера изображения не уменьшало его чёткости\n\timagecopyresampled($newImg, $scr, 0, 0, 0, 0, $newWidth, $newHeight, $size[0], $size[1]);\n\n\t// 5 запишем изображение в файл по нужному пути\n\timagejpeg($newImg, $dir_out);\n\n\timagedestroy($scr);\n\timagedestroy($newImg);\t\t\n\t\n}", "public function resizeImage()\n {\n \treturn view('resizeImage');\n }", "function image_resize($filename){\n\t\t$width = 1000;\n\t\t$height = 500;\n\t\t$save_file_location = $filename;\n\t\t// File type\n\t\t//header('Content-Type: image/jpg');\n\t\t$source_properties = getimagesize($filename);\n\t\t$image_type = $source_properties[2];\n\n\t\t// Get new dimensions\n\t\tlist($width_orig, $height_orig) = getimagesize($filename);\n\n\t\t$ratio_orig = $width_orig/$height_orig;\n\t\tif ($width/$height > $ratio_orig) {\n\t\t\t$width = $height*$ratio_orig;\n\t\t} else {\n\t\t\t$height = $width/$ratio_orig;\n\t\t}\n\t\t// Resampling the image \n\t\t$image_p = imagecreatetruecolor($width, $height);\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\t$image = imagecreatefromjpeg($filename);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\t$image = imagecreatefromgif($filename);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$image = imagecreatefrompng($filename);\n\t\t}\n\t\t$finalIMG = imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n\t\t$width, $height, $width_orig, $height_orig);\n\t\t// Display of output image\n\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\timagejpeg($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\timagegif($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$imagepng = imagepng($image_p, $save_file_location);\n\t\t}\n\t}", "function sharpen_resized_jpeg_images($resized_file) {\r\n $image = wp_load_image($resized_file); \r\n if(!is_resource($image))\r\n return new WP_Error('error_loading_image', $image, $file); \r\n $size = @getimagesize($resized_file);\r\n if(!$size)\r\n return new WP_Error('invalid_image', __('Could not read image size'), $file); \r\n list($orig_w, $orig_h, $orig_type) = $size; \r\n switch($orig_type) {\r\n case IMAGETYPE_JPEG:\r\n $matrix = array(\r\n array(-1, -1, -1),\r\n array(-1, 16, -1),\r\n array(-1, -1, -1),\r\n ); \r\n $divisor = array_sum(array_map('array_sum', $matrix));\r\n $offset = 0; \r\n imageconvolution($image, $matrix, $divisor, $offset);\r\n imagejpeg($image, $resized_file,apply_filters('jpeg_quality', 90, 'edit_image'));\r\n break;\r\n case IMAGETYPE_PNG:\r\n return $resized_file;\r\n case IMAGETYPE_GIF:\r\n return $resized_file;\r\n } \r\n return $resized_file;\r\n}", "public function ratioResize($file, $width=null, $height=null, $rename='') {\n\n $file = $this->uploadPath . $file;\n $imginfo = $this->getInfo($file);\n\n if ($rename == '')\n $newName = substr($imginfo['name'], 0, strrpos($imginfo['name'], '.')) . $this->thumbSuffix . '.' . $this->generatedType;\n else\n $newName = $rename . '.' . $this->generatedType;\n\n if ($width === null && $height === null) {\n return false;\n } elseif ($width !== null && $height === null) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } elseif ($width === null && $height !== null) {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n } else {\n\t\t\t\n\t\t\tif($imginfo['width'] < $width and $imginfo['height'] < $height) {\n\t\t\t\t$width = $imginfo['width'];\n\t\t\t\t$height = $imginfo['height'];\n\t\t\t}\n\t\t\t\n if ($imginfo['width'] > $imginfo['height']) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } else {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n }\n }\n\n //create image object based on the image file type, gif, jpeg or png\n $this->createImageObject($img, $imginfo['type'], $file);\n if (!$img)\n return false;\n\n if (function_exists('imagecreatetruecolor')) {\n $newImg = imagecreatetruecolor($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, 0, 0, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n } else {\n $newImg = imagecreate($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, ($width - $resizeWidth) / 2, ($height - $resizeHeight) / 2, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n }\n\n imagedestroy($img);\n\n if ($this->saveFile) {\n //delete if exist\n if (file_exists($this->processPath . $newName))\n unlink($this->processPath . $newName);\n $this->generateImage($newImg, $this->processPath . $newName);\n imagedestroy($newImg);\n return $this->processPath . $newName;\n }\n else {\n $this->generateImage($newImg);\n imagedestroy($newImg);\n }\n\n return true;\n }", "private function doImageResize($img){\n\t\t//Determine the new dimensions\n\t\t$d=$this->getNewDims($img);\n\t\t\n\t\t//Determine which function to use\n\t\t$funcs=$this->getImageFunctions($img);\n\t\t\n\t\t//Determine the image type\n\t\t$src_img=$funcs[0]($img);\n\t\t\n\t\t//Determine the new image size\n\t\t$new_img=imagecreatetruecolor($d[0], $d[1]);\n\t\t\n\t\tif(imagecopyresampled\n\t\t\t\t($new_img, $src_img, 0, 0, 0, 0, $d[0],$d[1] , $d[2], $d[3])){\n\t\t\timagedestroy($src_img);\n\t\t\t//check if the new image has the same file type as the original one\n\t\t\tif($new_img && $funcs[1]($new_img,$img)){\n\t\t\t\timagedestroy($new_img);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthrow new Exception('Failed to save the new image!');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception(\"Could not resample the image!\");\n\t\t}\n\t\t\n\t}", "function resizeImage ( $sourcePathFilename, $extension, $destinationPath, $maxWidth, $maxHeight ) {\n $result = '';\n debug_log ( __FILE__, __LINE__, $sourcePathFilename );\n debug_log ( __FILE__, __LINE__, $extension );\n\n if ( $sourcePathFilename != '' && $extension != '' ) {\n if ( in_array ( $extension, array ( 'jpg', 'jpeg', 'png', 'gif' ) ) ) {\n switch ( $extension ) {\n case 'jpg':\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n break;\n\n case 'jpeg':\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n break;\n\n case 'png':\n $imageOldData = imagecreatefrompng ( $sourcePathFilename );\n break;\n\n case 'gif':\n $imageOldData = imagecreatefromgif ( $sourcePathFilename );\n break;\n\n default:\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n }\n\n $imageOldWidth = imagesx ( $imageOldData );\n $imageOldHeight = imagesy ( $imageOldData );\n\n $imageScale = min ( $maxWidth / $imageOldWidth, $maxHeight / $imageOldHeight );\n\n $imageNewWidth = ceil ( $imageScale * $imageOldWidth );\n $imageNewHeight = ceil ( $imageScale * $imageOldHeight );\n\n $imageNewData = imagecreatetruecolor ( $imageNewWidth, $imageNewHeight );\n\n $colorWhite = imagecolorallocate ( $imageNewData, 255, 255, 255 );\n imagefill ( $imageNewData, 0, 0, $colorWhite );\n\n imagecopyresampled ( $imageNewData, $imageOldData, 0, 0, 0, 0, $imageNewWidth, $imageNewHeight, $imageOldWidth, $imageOldHeight );\n\n ob_start ();\n imagejpeg ( $imageNewData, NULL, 100 );\n $imageNewDataString = ob_get_clean ();\n\n $imageNewFilename = hash ( 'sha256', $imageNewDataString ) . uniqid () . '.jpg';\n\n $imageNewPathFilename = $destinationPath . $imageNewFilename;\n\n if ( file_put_contents ( $imageNewPathFilename, $imageNewDataString ) !== false )\n {\n $result = $imageNewFilename;\n }\n\n imagedestroy ( $imageNewData );\n imagedestroy ( $imageOldData );\n }\n }\n\n return $result;\n}", "protected function resize()\n {\n $width = $this->width;\n $height = $this->height;\n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n // Determine new image dimensions\n if($this->mode === \"crop\"){ // Crop image\n \n $max_width = $crop_width = $width;\n $max_height = $crop_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if($orig_width > $orig_height){ // Original is wide\n $height = $max_height;\n $width = ceil($y_ratio * $orig_width);\n \n } elseif($orig_height > $orig_width){ // Original is tall\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n \n } else { // Original is square\n $this->mode = \"fit\";\n \n return $this->resize();\n }\n \n // Adjust if the crop width is less than the requested width to avoid black lines\n if($width < $crop_width){\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n }\n \n } elseif($this->mode === \"fit\"){ // Fits the image according to aspect ratio to within max height and width\n $max_width = $width;\n $max_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if( ($orig_width <= $max_width) && ($orig_height <= $max_height) ){ // Image is smaller than max height and width so don't resize\n $tn_width = $orig_width;\n $tn_height = $orig_height;\n \n } elseif(($x_ratio * $orig_height) < $max_height){ // Wider rather than taller\n $tn_height = ceil($x_ratio * $orig_height);\n $tn_width = $max_width;\n \n } else { // Taller rather than wider\n $tn_width = ceil($y_ratio * $orig_width);\n $tn_height = $max_height;\n }\n \n $width = $tn_width;\n $height = $tn_height;\n \n } elseif($this->mode === \"fit-x\"){ // Sets the width to the max width and the height according to aspect ratio (will stretch if too small)\n $height = @round($orig_height * $width / $orig_width);\n \n if($orig_height <= $height){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n \n } elseif($this->mode === \"fit-y\"){ // Sets the height to the max height and the width according to aspect ratio (will stretch if too small)\n $width = @round($orig_width * $height / $orig_height);\n \n if($orig_width <= $width){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n } else {\n throw new \\Exception('Invalid mode: ' . $this->mode);\n }\n \n\n // Resize\n $this->temp = imagecreatetruecolor($width, $height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n \n imagecopyresampled($this->temp, $this->image, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height);\n $this->sync();\n \n \n // Cropping?\n if($this->mode === \"crop\"){ \n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n $x_mid = $orig_width/2; // horizontal middle\n $y_mid = $orig_height/2; // vertical middle\n \n $this->temp = imagecreatetruecolor($crop_width, $crop_height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n\n imagecopyresampled($this->temp, $this->image, 0, 0, ($x_mid-($crop_width/2)), ($y_mid-($crop_height/2)), $crop_width, $crop_height, $crop_width, $crop_height);\n $this->sync();\n }\n }", "function resizeImage($fileName,$maxWidth,$maxHight,$originalFileSufix=\"\")\n{\n $limitedext = array(\".gif\",\".jpg\",\".png\",\".jpeg\");\n\n //check the file's extension\n $ext = strrchr($fileName,'.');\n $ext = strtolower($ext);\n\n //uh-oh! the file extension is not allowed!\n if (!in_array($ext,$limitedext)) {\n exit();\n }\n\n if($ext== \".jpeg\" || $ext == \".jpg\"){\n $new_img = imagecreatefromjpeg($fileName);\n }elseif($ext == \".png\" ){\n $new_img = imagecreatefrompng($fileName);\n }elseif($ext == \".gif\"){\n $new_img = imagecreatefromgif($fileName);\n }\n\n //list the width and height and keep the height ratio.\n list($width, $height) = getimagesize($fileName);\n\n //calculate the image ratio\n $imgratio=$width/$height;\n $newwidth = $width;\n $newheight = $height;\n\n //Image format -\n if ($imgratio>1){\n if ($width>$maxWidth) {\n $newwidth = $maxWidth;\n $newheight = $maxWidth/$imgratio;\n }\n //image format |\n }else{\n if ($height>$maxHight) {\n $newheight = $maxHight;\n $newwidth = $maxHight*$imgratio;\n }\n }\n\n //function for resize image.\n $resized_img = imagecreatetruecolor($newwidth,$newheight);\n\n //the resizing is going on here!\n imagecopyresized($resized_img, $new_img, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n\n //finally, save the image\n if ($originalFileSufix!=\"\") {\n $path_parts=pathinfo($fileName);\n rename($fileName,$path_parts[\"dirname\"].DIRECTORY_SEPARATOR.$path_parts[\"filename\"].\"_\".$originalFileSufix.\".\".$path_parts[\"extension\"]);\n }\n ImageJpeg ($resized_img,$fileName,80);\n\n ImageDestroy ($resized_img);\n ImageDestroy ($new_img);\n}", "function vt_resize( $attach_id = null, $img_url = null, $width, $height, $crop = false ) {\n\t\n\t//initialise variable to prevent wp_debug mode error.\n\t$file_path = '';\n\t$image_src[0] = '';\n\t$image_src[1] = '';\n\t$image_src[2] = '';\n\t\t\n\t// we use the attachment id if it is given.\n\tif ( $attach_id ) {\n\t\n\t\t$image_src = wp_get_attachment_image_src( $attach_id, 'full' );\n\t\t//file path will return abnormally if given attachment id is wrong.\n\t\t$file_path = get_attached_file( $attach_id );\n\t\t\n\t\t//echo \"This is from attachment id \".$file_path.\"<br/>\";\n\t\n\t// if not use the image url to find the attachment ID!\n\t} else if ( $img_url ) {\n\t\t\n\t\t\n\t\t$attachment_id = truethemes_get_attachment_id_from_src($img_url);\n\t\t$image_src_ed = wp_get_attachment_image_src( $attachment_id, 'full' );\n\t\t$get_file_path = get_attached_file( $attachment_id );\n\t\t//file path will return abnormally if given image url is wrong. \n\t\t$file_path = $get_file_path;\n\t\t\n\t\t//echo \"This is from image src \".$file_path.\"<br/>\";\n\t\t\n\t $orig_size = $image_src_ed;\n\t\t\n\t\t$image_src[0] = $orig_size[0];\n\t\t$image_src[1] = $orig_size[1];\n\t\t$image_src[2] = $orig_size[2];\n\t\t\t\t\t\t\t\t\t\n\t}\n\t\n\t$file_info = pathinfo( $file_path );\n\t//initialise variable to prevent WP_debug mode error.\n\t$file_info['extension'] = '';\n\t$file_info['dirname'] = '';\n\t$extension = '.'. $file_info['extension'];\n\n\t// the image path without the extension\n\t$no_ext_path = $file_info['dirname'].'/'.$file_info['filename'];\n\n\t$cropped_img_path = $no_ext_path.'-'.$width.'x'.$height.$extension;\n\n\t// checking if the file size is larger than the target size\n\t// if it is smaller or the same size, stop right here and return\n\tif ( $image_src[1] > $width || $image_src[2] > $height ) {\n\n\t\t// the file is larger, check if the resized version already exists (for $crop = true but will also work for $crop = false if the sizes match)\n\t\tif ( file_exists( $cropped_img_path ) ) {\n\n\t\t\t$cropped_img_url = str_replace( basename( $image_src[0] ), basename( $cropped_img_path ), $image_src[0] );\n\t\t\t\n\t\t\t$vt_image = array (\n\t\t\t\t'url' => $cropped_img_url,\n\t\t\t\t'width' => $width,\n\t\t\t\t'height' => $height\n\t\t\t);\n\t\t\t\n\t\t\treturn $vt_image;\n\t\t}\n\n\t\t// $crop = false\n\t\tif ( $crop == false ) {\n\t\t\n\t\t\t// calculate the size proportionaly\n\t\t\t$proportional_size = wp_constrain_dimensions( $image_src[1], $image_src[2], $width, $height );\n\t\t\t$resized_img_path = $no_ext_path.'-'.$proportional_size[0].'x'.$proportional_size[1].$extension;\t\t\t\n\n\t\t\t// checking if the file already exists\n\t\t\tif ( file_exists( $resized_img_path ) ) {\n\t\t\t\n\t\t\t\t$resized_img_url = str_replace( basename( $image_src[0] ), basename( $resized_img_path ), $image_src[0] );\n\n\t\t\t\t$vt_image = array (\n\t\t\t\t\t'url' => $resized_img_url,\n\t\t\t\t\t'width' => $proportional_size[0],\n\t\t\t\t\t'height' => $proportional_size[1]\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\treturn $vt_image;\n\t\t\t}\n\t\t}\n\n\t\t// no cache files - let's finally resize it\n\t\t\n\t\t//function check for WordPress 3.5 wp_get_image_editor\n\t\tif(function_exists('wp_get_image_editor')){\n\t\t$new_img_path = tt_resize_image( $file_path, $width, $height, $crop );\n\t\t}else{\n\t\t$new_img_path = image_resize( $file_path, $width, $height, $crop );\t\t\n\t\t}\n\n\t\t$new_img_size = getimagesize( $new_img_path );\n\t\t$new_img = str_replace( basename( $image_src[0] ), basename( $new_img_path ), $image_src[0] );\n\n\t\t// resized output\n\t\t$vt_image = array (\n\t\t\t'url' => $new_img,\n\t\t\t'width' => $new_img_size[0],\n\t\t\t'height' => $new_img_size[1]\n\t\t);\n\t\t\n\t\treturn $vt_image;\n\t}\n\n\t// default output - without resizing\n\t$vt_image = array (\n\t\t'url' => $image_src[0],\n\t\t'width' => $image_src[1],\n\t\t'height' => $image_src[2]\n\t);\n\n\treturn $vt_image;\n}", "function resize( $jpg ) {\n\t$im = @imagecreatefromjpeg( $jpg );\n\t$filename = $jpg;\n\t$percent = 0.5;\n\tlist( $width, $height ) = getimagesize( $filename );\n\tif ( $uploader_name == \"c_master_imgs\" ):\n\t\t$new_width = $width;\n\t$new_height = $height;\n\telse :\n\t\tif ( $width > 699 ): $new_width = 699;\n\t$percent = 699 / $width;\n\t$new_height = $height * $percent;\n\telse :\n\t\t$new_width = $width;\n\t$new_height = $height;\n\tendif;\n\tendif; // end if measter images do not resize\n\t//if ( $new_height>600){ $new_height = 600; }\n\t$im = imagecreatetruecolor( $new_width, $new_height );\n\t$image = imagecreatefromjpeg( $filename );\n\timagecopyresampled( $im, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height );\n\t@imagejpeg( $im, $jpg, 80 );\n\t@imagedestroy( $im );\n}", "function resizeImage($input,$output,$wid,$hei,$auto=false,$quality=80) {\n\n\t// File and new size\n\t//the original image has 800x600\n\t$filename = $input;\n\t//the resize will be a percent of the original size\n\t$percent = 0.5;\n\n\t// Get new sizes\n\tlist($width, $height) = getimagesize($filename);\n\t$newwidth = $wid;//$width * $percent;\n\t$newheight = $hei;//$height * $percent;\n\tif($auto) {\n\t\tif($width>$height) {\n\t\t\t$newheight=$wid*0.75;\n\t\t} else if($height>$width) {\n\t\t\t$newwidth=$hei*0.75;\n\t\t}\n\t}\n\n\t// Load\n\t$thumb = imagecreatetruecolor($newwidth, $newheight);\n\t$source = imagecreatefromjpeg($filename);\n\n\t// Resize\n\timagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n\n\t// Output and free memory\n\t//the resized image will be 400x300\n\timagejpeg($thumb,$output,$quality);\n\timagedestroy($thumb);\n}", "function _resizeImageIM($src_file, $dest_file, $new_size) {\r\n \t$retval = $output = null;\r\n $cmd = $this->_IM_path.\"convert -resize $new_size \\\"$src_file\\\" \\\"$dest_file\\\"\";\r\n exec($cmd, $output, $retval);\r\n if($retval) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "public function resize_fit(IImageInformation $src, $width, $height);", "function resizeImage($image,$width,$height,$scale) {\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$image,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tchmod($image, 0777);\n\t\t\t\treturn $image;\n\t\t\t}", "public function ResizeImageThumbnail($image_path, $height, $width,$image){\n\t $img_name_only = explode('.', $image);\n\t $img_name_only = $img_name_only[0];\n\t $image = new \\Imagick($image_path.'/'.$image);\n\t $image->thumbnailImage($width, $height);\n\t $store_image_with_new_name=$image_path.'/'.$img_name_only.'_'.$width.'X'.$height.'.jpeg';\n\t $image->writeImage($store_image_with_new_name);\n\t $image->destroy();\n\t return $img_name_only.'.jpeg';\n \t}", "public function getImageResized()\n {\n return $this->performImageResize($this->Image());\n }", "function resizeUpload($field,$pic_dir,$name_dir,$cropratio=NULL,$watermark=NULL,$max_width,$max_height,$add_to_filename=NULL, $quality=90){\r\n\t\tglobal $font_path, $font_size, $water_mark_text_1, $water_mark_text;\r\n\t\t$maxwidth = $max_width; // Max new width or height, can not exceed this value.\r\n\t\t$maxheight = $max_height;\r\n\t\t$dir = $pic_dir; // Directory to save resized image. (Include a trailing slash - /)\r\n\t\t// Collect the post variables.\r\n\t\t$postvars = array(\r\n\t\t\t\"image\" => trim($_FILES[\"$field\"][\"name\"]),\r\n\t\t\t\"image_tmp\" => $_FILES[\"$field\"][\"tmp_name\"],\r\n\t\t\t\"image_size\" => (int)$_FILES[\"$field\"][\"size\"],\r\n\t\t\t);\r\n\t\t\t// Array of valid extensions.\r\n\t\t\t$valid_exts = array(\"jpg\",\"jpeg\",\"gif\",\"png\");\r\n\t\t\t$mod_exts = array(\"gif\",\"png\");\r\n\t\t\t// Select the extension from the file.\r\n\t\t\t$ext = end(explode(\".\",strtolower(trim($_FILES[\"$field\"][\"name\"]))));\r\n\t\t\t//echo (\"Image size: \" . $postvars[\"image_size\"] . \"<br> Ext: \" . $ext . \"<br>\");\r\n\t\t\t// Check is valid extension.\r\n\t\t\tif(in_array($ext,$valid_exts)){\r\n\t\t\t\tif($ext == \"jpg\" || $ext == \"jpeg\"){\r\n\t\t\t\t\t$image = imagecreatefromjpeg($postvars[\"image_tmp\"]);\r\n\t\t\t\t}\r\n\t\t\t\telse if($ext == \"gif\"){\r\n\t\t\t\t\t$image = imagecreatefromgif($postvars[\"image_tmp\"]);\r\n\t\t\t\t}\r\n\t\t\t\telse if($ext == \"png\"){\r\n\t\t\t\t\t$image = imagecreatefrompng($postvars[\"image_tmp\"]);\r\n\t\t\t\t}\r\n\t\t\t\t// Grab the width and height of the image.\r\n\t\t\t\tlist($width,$height) = getimagesize($postvars[\"image_tmp\"]);\r\n\t\t\t\t// Ratio cropping\r\n\t\t\t\t$offsetX\t= 0;\r\n\t\t\t\t$offsetY\t= 0;\r\n\t\t\t\tif ($cropratio) {\r\n\t\t\t\t\t\t$cropRatio = explode(':', (string) $cropratio);\r\n\t\t\t\t\t\t$ratioComputed\t\t= $width / $height;\r\n\t\t\t\t\t\t$cropRatioComputed\t= (float) $cropRatio[0] / (float) $cropRatio[1];\r\n\t\t\t\t\t\tif ($ratioComputed < $cropRatioComputed)\r\n\t\t\t\t\t\t{ // Image is too tall so we will crop the top and bottom\r\n\t\t\t\t\t\t\t$origHeight\t= $height;\r\n\t\t\t\t\t\t\t$height\t\t= $width / $cropRatioComputed;\r\n\t\t\t\t\t\t\t$offsetY\t= ($origHeight - $height) / 2;\r\n\t\t\t\t\t\t\t$smallestSide = $width;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if ($ratioComputed > $cropRatioComputed)\r\n\t\t\t\t\t\t{ // Image is too wide so we will crop off the left and right sides\r\n\t\t\t\t\t\t\t$origWidth\t= $width;\r\n\t\t\t\t\t\t\t$width\t\t= $height * $cropRatioComputed;\r\n\t\t\t\t\t\t\t$offsetX\t= ($origWidth - $width) / 2;\r\n\t\t\t\t\t\t\t$smallestSide = $height;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// We get the other dimension by multiplying the quotient of the new width or height divided by\r\n\t\t\t\t// the old width or height.\r\n\t\t\t $w_adjust = ($maxwidth / $width);\r\n\t\t\t $h_adjust = ($maxheight / $height);\r\n\t\t\t if (($width >= $maxwidth)||($height >= $maxheight)) {\r\n\t\t\t\t if($w_adjust <= $h_adjust)\r\n\t\t\t\t {\r\n\t\t\t\t\t $newwidth=floor($width*$w_adjust);\r\n\t\t\t\t\t $newheight=floor($height*$w_adjust);\r\n\t\t\t\t } else {\r\n\t\t\t\t\t $newwidth=floor($width*$h_adjust);\r\n\t\t\t\t\t $newheight=floor($height*$h_adjust);\r\n\t\t\t\t }\r\n\t\t\t } else {\r\n\t\t\t\t \t$newwidth=$width;\r\n\t\t\t\t\t$newheight=$height;\r\n\t\t\t }\r\n\t\t\t\t// Create temporary image file.\r\n\t\t\t\t$tmp = imagecreatetruecolor($newwidth,$newheight);\r\n\t\t\t\t\r\n\t\t\t\t// Copy the image to one with the new width and height.\r\n\t\t\t\t\timagecopyresampled($tmp,$image,0,0,$offsetX,$offsetY,$newwidth,$newheight,$width,$height);\r\n\t\t\t\t\t// Create random 5 digit number for filename. Add to current timestamp.\r\n\t\t\t\t\t$rand = rand(10000,99999);\r\n\t\t\t\t\t$rand .= time();\r\n\t\t\t\t\t$origfilename = $name_dir.$rand ;\r\n if ($add_to_filename){ $origfilename .= \"_\".$add_to_filename; }\r\n $origfilename .= \".jpg\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t$filename = $dir.$rand;\r\n if ($add_to_filename){ $filename .= \"_\".$add_to_filename; }\r\n $filename .= \".jpg\";\r\n\r\n\t\t\t\tif ($watermark) {\r\n\t\t\t\t\t//Apply watermark here\t\t\t\t\t\r\n\t\t\t\t\t$maroon = imagecolorallocate($tmp, 134, 22, 0);\r\n\t\t\t\t\t$white = imagecolorallocate($tmp, 255, 255, 255);\r\n\t\t\t\t\t/*$base_height = $newheight-20;\r\n\t\t\t\t\t$base_width = $newwidth/5;*/\r\n\t\t\t\t\t//$borderOffset = 4;\r\n\t\t\t\t\t$dimensions = imagettfbbox($font_size, 0, $font_path, $water_mark_text);\r\n\t\t\t\t\t$lineWidth = ($dimensions[2] - $dimensions[0]);\r\n\t\t\t\t\t$textX = (ImageSx($tmp) - $lineWidth) / 2;\r\n\t\t\t\t\t$textY = ($newheight/10)*9;\t\t\t\t\t\r\n\t\t\t\t // Add some shadow to the text\t\t\t\t\t\r\n\t\t\t\t\timagettftext($tmp, $font_size, 0, $textX+1,$textY+1, $white, $font_path, $water_mark_text);\r\n\t\t\t\t\timagettftext($tmp, $font_size, 0, $textX, $textY, $maroon, $font_path, $water_mark_text);\r\n\t\t\t\t}\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t// Create image file with specified quality in % (low quality image in less image sharpness)\r\n\t\t\t\timagejpeg($tmp,$filename,$quality);\r\n\t\t\t\treturn $origfilename;\r\n\r\n\t\t\t\timagedestroy($image);\r\n\t\t\t\timagedestroy($tmp);\t\r\n\r\n\t\t\t}\r\n\r\n\t\r\n\r\n\t}", "public function resizeImagePost(Request $request)\n {\n\t $this->validate($request, [\n 'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',\n ]);\n\n $sizenames = ['MDPI', 'HDPI', 'XHDPI', 'XXHDPI','XXXHDPI','PlayStore'];\n $sizeW = ['48','72','96','144','192','512'];\n\n for ($i = 0; $i < 6; $i++){\n $image = $request->file('image');\n $input['imagename'] = $sizenames[$i].'.'.\"png\";\n \n \n $destinationPath = public_path('/thumbnail');\n $img = Image::make($image->getRealPath());\n $img->resize($sizeW[$i], $sizeW[$i], function ($constraint) {\n //$constraint->aspectRatio();\n })->save($destinationPath.'/'.$input['imagename']);\n\n\n $destinationPath = public_path('/images');\n $image->move($destinationPath, $input['imagename']);\n }\n \n //$this->postImage->add($input);\n\n\n return back()\n \t->with('success','Image Upload successful')\n \t->with('imageName',$input['imagename']);\n }", "function spc_resizeImage( $file, $thumbpath, $max_side , $fixfor = NULL ) {\n\n\tif ( file_exists( $file ) ) {\n\t\t$type = getimagesize( $file );\n\n\t\tif (!function_exists( 'imagegif' ) && $type[2] == 1 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagejpeg' ) && $type[2] == 2 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagepng' ) && $type[2] == 3 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t} else {\n\n\t\t\t// create the initial copy from the original file\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\t$image = imagecreatefromgif( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\t$image = imagecreatefromjpeg( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\t$image = imagecreatefrompng( $file );\n\t\t\t}\n\n\t\t\tif ( function_exists( 'imageantialias' ))\n\t\t\t\timageantialias( $image, TRUE );\n\n\t\t\t$image_attr = getimagesize( $file );\n\n\t\t\t// figure out the longest side\n if($fixfor){\n \t if($fixfor == 'width'){\n \t \t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n \t }elseif($fixfor == 'height'){\n \t $image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\t\n \t }\n }else{\n\t\t\tif ( $image_attr[0] > $image_attr[1] ) {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n\t\t\t\t//width is > height\n\t\t\t} else {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\n\t\t\t\t//height > width\n\t\t\t}\n }\t\n\n\t\t\t$thumbnail = imagecreatetruecolor( $image_new_width, $image_new_height);\n\t\t\t@ imagecopyresampled( $thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1] );\n\n\t\t\t// move the thumbnail to its final destination\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\tif (!imagegif( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\tif (!imagejpeg( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\tif (!imagepng( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$error = 0;\n\t}\n\n\tif (!empty ( $error ) ) {\n\t\treturn $error;\n\t} else {\n\t\treturn $thumbpath;\n\t}\n}", "public function do_profile_resize_image($data){\n\t\t//Your Image\n\t\t$imgSrc = 'public/upload/img/profile/' . $data['file'];\n\n\t\t//getting the image dimensions\n\t\tlist($width, $height) = getimagesize($imgSrc);\n\n\t\t//saving the image into memory (for manipulation with GD Library)\n\t\tif ($data['type'] == \"jpeg\" || $data['type'] == \"jpg\")\n\t\t\t$myImage = imagecreatefromjpeg($imgSrc);\n\t\telse if ($data['type'] == \"png\")\n\t\t\t$myImage = imagecreatefrompng($imgSrc);\n\t\telse if ($data['type'] == \"gij\")\n\t\t\t$myImage = imagecreatefromgif($imgSrc);\n\n\t\t// calculating the part of the image to use for thumbnail\n\t\tif ($width > $height) {\n\t\t $y = 0;\n\t\t $x = ($width - $height) / 2;\n\t\t $smallestSide = $height;\n\t\t} else {\n\t\t $x = 0;\n\t\t $y = ($height - $width) / 2;\n\t\t $smallestSide = $width;\n\t\t}\n\n\t\t// copying the part into thumbnail\n\t\t$thumbSize = 300;\n\t\t$thumb = imagecreatetruecolor($thumbSize, $thumbSize);\n\t\timagecopyresampled($thumb, $myImage, 0, 0, $x, $y, $thumbSize, $thumbSize, $smallestSide, $smallestSide);\n\n\t\t//final output\n\t\t$thumbnail_path = 'public/upload/img/profile/thumbnail_' . $data['file'];\n\t\tif ($data['type'] == \"jpeg\" || $data['type'] == \"jpg\") {\n\t\t\timagejpeg($thumb, $thumbnail_path);\n\t\t}\n\t\telse if ($data['type'] == \"png\") {\n\t\t\timagepng($thumb, $thumbnail_path);\n\t\t}\n\t\telse if ($data['type'] == \"gif\") {\n\t\t\timagegif($thumb, $thumbnail_path);\n\t\t}\n\n\t}", "private function _resizeThumbnailImage($thumb_image_name, $image, $width, $height, $src_width, $src_height, $scale){\n\t\t$newImageWidth = ceil($width * $scale);\n\t\t$newImageHeight = ceil($height * $scale);\n\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t$source = imagecreatefromjpeg($image);\n\t\timagecopyresampled($newImage,$source,0,0,0,0,$width,$height,$src_width,$src_height);\n\t\timagejpeg($newImage,$thumb_image_name,90);\n\t\tchmod($thumb_image_name, 0777);\n\t\t//return $thumb_image_name;\n\t}", "function resizeSaveImage($filename, $destinationFile, $newWidth){\n\t\t \n\t\t list($width, $height) = getimagesize($filename);\n\t\t if($width > $newWidth){\n\t\t\t\t$percent = $newWidth / $width;\n\t\t\t\t$newHeight = $height * $percent;\n\t\t\t\t\n\t\t\t\t// Load\n\t\t\t\t$resizedImage = imagecreatetruecolor($newWidth, $newHeight);\n\t\t\t\t$source = imagecreatefromjpeg($filename);\n\t\t\t\t\n\t\t\t\t// Resize\n\t\t\t\timagecopyresized($resizedImage, $source, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);\n\t\t\t\t\n\t\t\t\t// Output\n\t\t\t\timagejpeg($resizedImage, $destinationFile, 100 );\n\t\t\t\t\n\t\t\t\t//memory clean up.\n\t\t\t\timagedestroy($source);\n\t\t\t\timagedestroy($resizedImage);\n\t\t }\n\t }", "private function resizeImage($filename, $width, $height)\n {\n $config['image_library'] = 'gd2';\n $config['create_thumb'] = TRUE;\n $config['maintain_ratio'] = TRUE;\n $config['width'] = $width;\n $config['height'] = $height;\n $config['source_image'] = $filename;\n $this->load->library('image_lib', $config);\n $this->image_lib->resize();\n }", "public function resizeImage($image, $width = MEDIUM_IMAGE_MAX_WIDTH, $height = MEDIUM_IMAGE_MAX_HEIGHT, $subpath = IMG_SUBPATH_MEDIUM, $quality = JPEG_QUALITY) \n {\n // check if file is image\n if (!$this->isFileImage($image) ) {\n $this->throwException(FILE_IS_NOT_IMAGE, \"File is not an image\");\n }\n list($imgWidth, $imgHeight) = getimagesize($image);\n \n if ($imgWidth > $imgHeight) {\n $newWidth = $imgWidth / ($imgWidth / $width);\n $newHeight = $imgHeight / ($imgWidth / $width);\n } else {\n $newWidth = $imgWidth / ($imgHeight / $height);\n $newHeight = $imgHeight / ($imgHeight / $height);\n }\n\n $path = pathinfo($image);\n //print_r($path); // debug\n $src_img = imagecreatefromjpeg($image);\n $dest_img = imagecreatetruecolor($newWidth, $newHeight);\n imagecopyresampled($dest_img, $src_img, 0, 0, 0, 0, $newWidth, $newHeight, $imgWidth, $imgHeight);\n \n if (ADD_WATERMARK_TO_PHOTO) {\n //TODO: Add optional watermark to photo\n }\n \n imagejpeg($dest_img, IMAGE_STORAGE_PATH . $subpath . $path['filename'] . \".\" . $path['extension'], $quality);\n \n \n return IMAGE_STORAGE_PATH . $subpath . $path['filename'] . \".\" . $path['extension'];\n }", "public function resizeImage($filepath) {\n if (is_file($filepath)) {\n \n $dir_name = $this->destinationDirectory;\n\n $drawable_dpi = array();\n $drawable_dpi['drawable-ldpi'] = 0.1875;\n $drawable_dpi['drawable-mdpi'] = 0.25;\n $drawable_dpi['drawable-hdpi'] = 0.375;\n $drawable_dpi['drawable-xhdpi'] = 0.5;\n $drawable_dpi['drawable-xxhdpi'] = 0.75;\n $drawable_dpi['drawable-xxxhdpi'] = 1.0;\n\n $mipmap_dpi = array();\n $mipmap_dpi['mipmap-ldpi'] = 0.1875;\n $mipmap_dpi['mipmap-mdpi'] = 0.25;\n $mipmap_dpi['mipmap-hdpi'] = 0.375;\n $mipmap_dpi['mipmap-xhdpi'] = 0.5;\n $mipmap_dpi['mipmap-xxhdpi'] = 0.75;\n $mipmap_dpi['mipmap-xxxhdpi'] = 1.0;\n\n $selected_dpi = array();\n if($this->folderCode == 0) {\n $selected_dpi = $drawable_dpi; \n }\n if($this->folderCode == 1) {\n $selected_dpi = $mipmap_dpi; \n }\n if($this->folderCode == 2) {\n $selected_dpi = array_merge($drawable_dpi, $mipmap_dpi); \n }\n\n\n // Content type\n $image_ext = \"png\";\n header('\"Content-Type: image/\"'.$image_ext);\n\n // Get new sizes\n $dir_path = $this->dirHelper($dir_name);\n $imageFileName = $this->extract_file_name($filepath);\n $final_dir_path = $dir_path.\"res/\"; \n if (!is_dir($final_dir_path)) {\n mkdir($final_dir_path);\n }\n foreach ($selected_dpi as $key => $value) {\n if (!is_dir($final_dir_path.$key)) {\n mkdir($final_dir_path.$key);\n }\n list($width, $height) = getimagesize($filepath);\n $newwidth = $width * $value;\n $newheight = $height * $value;\n\n // Load\n $thumb = imagecreatetruecolor($newwidth, $newheight);\n $source = imagecreatefrompng($filepath);\n\n // Resize\n imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n imagepng($thumb, $final_dir_path.$key.\"/\".$imageFileName);\n }\n echo \"<h1>$filepath has been resized into different sizes</h1>\";\n }\n elseif(!file_exists($filepath)) {\n echo \"<h1>Invalid File path</h1>\";\n }\n else {\n echo \"<h1>This is not a file</h1>\";\n }\n\n }", "function resizeImage($image,$width,$height,$scale) {\n\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t$imageType = image_type_to_mime_type($imageType);\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t\t\t$source=imagecreatefromgif($image); \n\t\t\tbreak;\n\t case \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\tbreak;\n\t case \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\t$source=imagecreatefrompng($image); \n\t\t\tbreak;\n \t}\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t \t\timagegif($newImage,$image); \n\t\t\tbreak;\n \tcase \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t \t\timagejpeg($newImage,$image,90); \n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\timagepng($newImage,$image); \n\t\t\tbreak;\n }\n\t\n\tchmod($image, 0777);\n\treturn $image;\n}", "function resize_image( $url, $width, $height, $crop = true, $id = null )\n {\n $image = wp_get_image_editor( $url );\n if( is_wp_error( $image ) ) return;\n $image_name = explode( '/', $url );\n $image_name = explode( '.', $image_name[count( $image_name ) - 1] );\n $image_extension = strtolower( $image_name[count( $image_name ) - 1] );\n $image_name = $image_name[0];\n $upload_dir = wp_upload_dir();\n $filename = sprintf(\n '/%s%s-%sx%s.%s',\n ( $id === null ? '' : $id . '-' ),\n $image_name,\n $width,\n $height,\n $image_extension\n );\n $image->resize( $width, $height, $crop );\n $image->save( $upload_dir['path'] . $filename );\n return $upload_dir['url'] . $filename;\n }", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t$source = imagecreatefromjpeg($image);\n\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\timagejpeg($newImage,$thumb_image_name,90);\n\tchmod($thumb_image_name, 0777);\n\treturn $thumb_image_name;\n}", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\n\t\t$newImageWidth = ceil($width * $scale);\n\t\t$newImageHeight = ceil($height * $scale);\n\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\tswitch($imageType) {\n\t\t\tcase \"image/gif\":\n\t\t\t\t$source=imagecreatefromgif($image); \n\t\t\t\tbreak;\n\t\t\tcase \"image/pjpeg\":\n\t\t\tcase \"image/jpeg\":\n\t\t\tcase \"image/jpg\":\n\t\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\t\tbreak;\n\t\t\tcase \"image/png\":\n\t\t\tcase \"image/x-png\":\n\t\t\t\t$source=imagecreatefrompng($image); \n\t\t\t\tbreak;\n\t\t}\n\t\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\t\tswitch($imageType) {\n\t\t\tcase \"image/gif\":\n\t\t\t\timagegif($newImage,$thumb_image_name); \n\t\t\t\tbreak;\n\t\t\tcase \"image/pjpeg\":\n\t\t\tcase \"image/jpeg\":\n\t\t\tcase \"image/jpg\":\n\t\t\t\timagejpeg($newImage,$thumb_image_name,90); \n\t\t\t\tbreak;\n\t\t\tcase \"image/png\":\n\t\t\tcase \"image/x-png\":\n\t\t\t\timagepng($newImage,$thumb_image_name); \n\t\t\t\tbreak;\n\t\t}\n\t\tchmod($thumb_image_name, 0777);\n\t\treturn $thumb_image_name;\n\t}", "function ImageUpload($imagefieldname, $savename, $maxheight, $maxwidth, $minheight, $minwidth) {\r\n global $imageuploaddir, $imageuploadmaxsize, $debuglog;\r\n // first 2 globals are only retrieved for use here, debuglog is to append error messages\r\n $imagedir = $imageuploaddir;\r\n $thiserror = \"\";\r\n $uploadedfile_name = $_FILES[$imagefieldname]['name'];\r\n $uploadedfile_tmp = $_FILES[$imagefieldname]['tmp_name'];\r\n $uploadedfile_size = $_FILES[$imagefieldname]['size'];\r\n $uploadedfile_type = $_FILES[$imagefieldname]['type'];\r\n if ($uploadedfile_size > $imageuploadmaxsize) {\r\n $thiserror .= \"Error: Uploaded image size must be less than \" . $imageuploadmaxsize/1000000 . \" MB!<br />\";\r\n } else {\r\n if (isset($_FILES[$imagefieldname]['name'])) {\r\n $temp_img = $imagedir.'tmp_'.$savename;\r\n $prod_img = $imagedir.$savename;\r\n move_uploaded_file($uploadedfile_tmp, $temp_img);\r\n chmod ($temp_img, octdec('0666'));\r\n $sizes = getimagesize($temp_img);\r\n if ($sizes[0] == 0 || $sizes[1] == 0) { $imageszerror = \"Y\"; $imageulerror = \"Y\"; }\r\n else {\r\n $aspect_ratio = $sizes[1]/$sizes[0];\r\n if ($sizes[1] <= $maxheight) { $new_width = $sizes[0]; $new_height = $sizes[1]; }\r\n else { $new_height = $maxheight; $new_width = abs($new_height/$aspect_ratio); }\r\n if ($new_width <= $maxwidth) { $new_width = $new_width; $new_height = $new_height; }\r\n else { $new_width = $maxwidth; $new_height = abs($new_width*$aspect_ratio); }\r\n $destimg=ImageCreateTrueColor($new_width,$new_height);\r\n }\r\n $debuglog .= \"W: $new_width H: $new_height (After Max Adjustment)<br />\\n\";\r\n if ($uploadedfile_type == \"image/jpeg\" || $uploadedfile_type == \"image/pjpeg\") { $srcimg=ImageCreateFromJPEG($temp_img); }\r\n else if ($uploadedfile_type == \"image/gif\") { $srcimg=ImageCreateFromGIF($temp_img); }\r\n else if ($uploadedfile_type == \"image/png\" || $uploadedfile_type == \"image/x-png\") { $srcimg=ImageCreateFromPNG($temp_img); }\r\n else if ($uploadedfile_type == \"image/bmp\") { $srcimg=ImageCreateFromBMP($temp_img); }\r\n else {\r\n $imageulerror = \"Y\";\r\n if ($imageszerror == \"Y\") { $thiserror .= \"Error: Uploaded file has 0 for either height or length!<br />\"; }\r\n $thiserror .= \"Error: $uploadedfile_type used.<br>Only GIF, JPEG, PNG, and Windows BMP files allowed!<br />\";\r\n }\r\n if ($imageulerror != \"Y\") {\r\n if(function_exists('imagecopyresampled')) {\r\n imagecopyresampled($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg));\r\n } else {\r\n Imagecopyresized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg));\r\n }\r\n }\r\n if ($srcimg) {\r\n // Fix for minimum width and height\r\n if ($new_width < $minwidth || $new_height < $minheight) {\r\n if ($new_height < $minheight) {\r\n $newy = intval(($minheight-$new_height)/2);\r\n $thisheight = $minheight;\r\n } else {\r\n $newy = 0;\r\n $thisheight = $new_height;\r\n }\r\n if ($new_width < $minwidth) {\r\n $newx = intval(($minwidth-$new_width)/2);\r\n $thiswidth = $minwidth;\r\n } else {\r\n $newx = 0;\r\n $thiswidth = $new_width;\r\n }\r\n $debuglog .= \"W: $thiswidth H: $thisheight (After Min Adjustment)<br />\\n\";\r\n $destimg=imagecreatetruecolor($thiswidth, $thisheight);\r\n $bk=imagecolorallocate($destimg, 255, 255, 255);\r\n imagefill($destimg,0,0,$bk);\r\n imagecopy($destimg, $srcimg, $newx, $newy, 0, 0, $new_width, $new_height);\r\n }\r\n // Sharpen image\r\n $sharpenmatrix = array(\r\n array(-1.2, -1, -1.2), // array(-1, -1, -1),\r\n array(-1.0, 28, -1.0), // array(-1, 16, -1),\r\n array(-1.2, -1, -1.2), // array(-1, -1, -1),\r\n );\r\n $sharpendivisor = array_sum(array_map('array_sum', $sharpenmatrix));\r\n imageconvolution($destimg, $sharpenmatrix, $sharpendivisor, 0);\r\n // Finally output production image\r\n ImageJPEG($destimg,$prod_img,95);\r\n }\r\n if ($imageulerror != \"Y\") { imagedestroy($destimg); }\r\n if (file_exists($temp_img)) { unlink($temp_img); }\r\n }\r\n }\r\n if ($imageulerror != \"Y\") { $success = \"Y\"; } else { $success = \"N|$thiserror\"; }\r\n return $success;\r\n}", "public function resize()\n {\n foreach ($this->getList() as $image) {\n if (!$image instanceof mtmdImage) {\n continue;\n }\n\n mtmdUtils::output(\n sprintf(\n '\"%s\": Resizing to %dx%d (was %dx%d)...',\n $image->getFileName(),\n $this->getThumbWidth(),\n $this->getThumbHeight(),\n $image->getWidth(),\n $image->getHeight()\n )\n );\n\n $targetPath = $this->getCachedFilePath(dirname($image->getFileName()));\n\n // Prepare target dirs.\n mtmdUtils::mkDir($targetPath, 0755, true);\n // Resize image.\n $image->resizeImage($targetPath, $this->thumbWidth, $this->thumbHeight);\n\n }\n\n }", "function img_resize( $tmpname, $size, $save_dir, $save_name )\r\n {\r\n $save_dir .= ( substr($save_dir,-1) != \"/\") ? \"/\" : \"\";\r\n $gis = GetImageSize($tmpname);\r\n $type = $gis[2];\r\n switch($type)\r\n {\r\n case \"1\": $imorig = imagecreatefromgif($tmpname); break;\r\n case \"2\": $imorig = imagecreatefromjpeg($tmpname);break;\r\n case \"3\": $imorig = imagecreatefrompng($tmpname); break;\r\n default: $imorig = imagecreatefromjpeg($tmpname);\r\n }\r\n\r\n $x = imageSX($imorig);\r\n $y = imageSY($imorig);\r\n if($gis[0] <= $size)\r\n {\r\n $av = $x;\r\n $ah = $y;\r\n }\r\n else\r\n {\r\n $yc = $y*1.3333333;\r\n $d = $x>$yc?$x:$yc;\r\n $c = $d>$size ? $size/$d : $size;\r\n $av = $x*$c; \r\n $ah = $y*$c; \r\n } \r\n $im = imagecreate($av, $ah);\r\n $im = imagecreatetruecolor($av,$ah);\r\n if (imagecopyresampled($im,$imorig , 0,0,0,0,$av,$ah,$x,$y))\r\n if (imagejpeg($im, $save_dir.$save_name))\r\n\t\t return true;\r\n else\r\n return false;\r\n }", "public function thumbnail($image_path, $size_name, $maxWidth = 370, $maxHeight = 370)\n\t{\n\t\t$img = $this->intervention->make($image_path);\n\t\t$img->interlace();\n\t\t\n\t\tif($img->height()>$maxHeight){\n\n\t\t\t// method 1\n\t\t\t// add callback functionality to retain maximal original image size\n\t\t\t$img->fit($maxWidth, $maxHeight, function ($constraint) {\n\t\t\t $constraint->upsize();\n\t\t\t});\n\t\t\n\t\t}else{\n\t\t\t// method 2\n\t\t // resize image to 370x370 and keep the aspect ratio\n\t\t\t$img->resize($maxWidth, $maxHeight, function ($constraint) {\n\t\t\t\t$constraint->aspectRatio();\n\t\t\t});\n\t\t\t\n\t\t\t// Fill up the blank spaces with transparent color\n\t\t\t$img->resizeCanvas($maxWidth, $maxHeight, 'center', false, array(255, 255, 255, 0));\n\t\t}\n\t\t\n\t\t$new_image_path = str_replace(\"-source\", \"-$size_name\", $image_path);\n\t\t$img->save($new_image_path, 80);\n\t\t\n\t\treturn $new_image_path;\n\t}", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$thumb_image_name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$thumb_image_name,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$thumb_image_name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tchmod($thumb_image_name, 0777);\n\t\t\t\treturn $thumb_image_name;\n\t\t\t}", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t$imageType = image_type_to_mime_type($imageType);\n\t\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t\t\t$source=imagecreatefromgif($image); \n\t\t\tbreak;\n\t case \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\tbreak;\n\t case \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\t$source=imagecreatefrompng($image); \n\t\t\tbreak;\n \t}\n\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t \t\timagegif($newImage,$thumb_image_name); \n\t\t\tbreak;\n \tcase \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t \t\timagejpeg($newImage,$thumb_image_name,90); \n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\timagepng($newImage,$thumb_image_name); \n\t\t\tbreak;\n }\n\tchmod($thumb_image_name, 0777);\n\treturn $thumb_image_name;\n}", "function funcs_resizeImageFile($file,$newWidth,$newHeight,$oldWidth,$oldHeight,$destination = null,$quality = 75){\n\t//create a new pallete for both source and destination\n\t$dest = imagecreatetruecolor($newWidth, $newHeight);\n\tif (preg_match('/\\.gif$/',$file)){\n\t\t$source = imagecreatefromgif($file);\n\t}else{\n\t\t//assume jpeg since we only allow jpeg and gif\n\t\t$source = imagecreatefromjpeg($file);\n\t}\n\t//copy the source pallete onto destination pallete\n\timagecopyresampled($dest,$source,0,0,0,0, $newWidth, $newHeight, $oldWidth,$oldHeight);\n\t//save file\n\tif (preg_match('/\\.gif$/',$file)){\n\t\timagegif($dest,((is_null($destination))?$file:$destination));\n\t}else{\n\t\timagejpeg($dest,((is_null($destination))?$file:$destination),$quality);\n\t}\n}", "function saveFile(UploadedFile $file, $width)\n{\n $filename = md5(mt_rand().$file->getBasename()).'.'.$file->guessClientExtension();\n\n $file->move(__DIR__.'/../../img', $filename);\n\n $imagine = new Imagine\\Gd\\Imagine();\n $image = $imagine->open(__DIR__.'/../../img/'.$filename);\n\n $box = $image->getSize();\n $box = $box->widen((int) $width);\n\n $image = $image->thumbnail($box, Imagine\\Image\\ImageInterface::THUMBNAIL_OUTBOUND);\n $image->save(__DIR__.'/../../img/mini_'.$filename);\n\n return $filename;\n}", "function resize($image_name, $size, $folder_name) {\n $file_extension = getFileExtension($image_name);\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n $image_src = imagecreatefromjpeg($folder_name . '/' . $image_name);\n break;\n case 'png':\n $image_src = imagecreatefrompng($folder_name . '/' . $image_name);\n break;\n case 'gif':\n $image_src = imagecreatefromgif($folder_name . '/' . $image_name);\n break;\n }\n $true_width = imagesx($image_src);\n $true_height = imagesy($image_src);\n\n $width = $size;\n $height = ($width / $true_width) * $true_height;\n\n $image_des = imagecreatetruecolor($width, $height);\n\n imagecopyresampled($image_des, $image_src, 0, 0, 0, 0, $width, $height, $true_width, $true_height);\n\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n imagejpeg($image_des, $folder_name . '/' . $image_name, 100);\n break;\n case 'png':\n imagepng($image_des, $folder_name . '/' . $image_name, 8);\n break;\n case 'gif':\n imagegif($image_des, $folder_name . '/' . $image_name, 100);\n break;\n }\n return $image_des;\n}", "function resize_image($path, $filename, $maxwidth, $maxheight, $quality=75, $type = \"small_\", $new_path = \"\")\n{\n $filename = DIRECTORY_SEPARATOR.basename($filename);\n $sExtension = substr($filename, (strrpos($filename, \".\") + 1));\n $sExtension = strtolower($sExtension);\n\n // check ton tai thu muc khong\n if (!file_exists($path.$type))\n {\n @mkdir($path.$type, 0777, true);\n chmod($path.$type, 0777);\n }\n // Get new dimensions\n $size = getimagesize($path . $filename);\n $width = $size[0];\n $height = $size[1];\n if($width != 0 && $height !=0)\n {\n if($maxwidth / $width > $maxheight / $height) $percent = $maxheight / $height;\n else $percent = $maxwidth / $width;\n }\n\n $new_width\t= $width * $percent;\n $new_height\t= $height * $percent;\n\n // Resample\n $image_p = imagecreatetruecolor($new_width, $new_height);\n //check extension file for create\n switch($size['mime'])\n {\n case 'image/gif':\n $image = imagecreatefromgif($path . $filename);\n break;\n case 'image/jpeg' :\n case 'image/pjpeg' :\n $image = imagecreatefromjpeg($path . $filename);\n break;\n case 'image/png':\n $image = imagecreatefrompng($path . $filename);\n break;\n }\n //Copy and resize part of an image with resampling\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\n\n // Output\n // check new_path, nếu new_path tồn tại sẽ save ra đó, thay path = new_path\n if($new_path != \"\")\n {\n $path = $new_path;\n if (!file_exists($path.$type))\n {\n @mkdir($path.$type, 0777, true);\n chmod($path.$type, 0777);\n }\n }\n\n switch($sExtension)\n {\n case \"gif\":\n imagegif($image_p, $path . $type . $filename);\n break;\n case $sExtension == \"jpg\" || $sExtension == \"jpe\" || $sExtension == \"jpeg\":\n imagejpeg($image_p, $path . $type . $filename, $quality);\n break;\n case \"png\":\n imagepng($image_p, $path . $type . $filename);\n break;\n }\n imagedestroy($image_p);\n}", "public function resize($resized_image_width, $save_to_file=NULL, $output_mimetype=NULL, $scale_up=FALSE, $offset=\"center\") {\n\t\t// set the resized image display size\n\t\t$this->setDisplaySize($resized_image_width, $scale_up);\n\t\t// create a resized image resource from the source image\n\t\t$resized_image = ImageLib::thumbnail(\n\t\t\t\t\t\t\t\t\t$this->source_image, \n\t\t\t\t\t\t\t\t\t$this->resized_image_width, \n\t\t\t\t\t\t\t\t\t$this->resized_image_height, \n\t\t\t\t\t\t\t\t\t$this->source_image_width, \n\t\t\t\t\t\t\t\t\t$this->source_image_height,\n\t\t\t\t\t\t\t\t\t$resized_image_width,\n\t\t\t\t\t\t\t\t\t$offset\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\tif(!is_null($save_to_file)) {\n\t\t// save the resized image to file\n\t\t\t$output_image_mimetype = $output_mimetype ? $output_mimetype : $this->source_image_mimetype;\n\t\t\tImageLib::save($resized_image, $save_to_file, $output_image_mimetype);\n\t\t}\n\t\treturn $resized_image;\n\t}", "public function imageResize($file, $path, $filename, $width, $height)\n\t{\n\n\t\t$img = Image::make($file);\n\t\t$img->resize($width, $height, function ($constraint) {\n $constraint->aspectRatio();\n });\n\n\t\t// if ($request->has('optimize')) {\n\t\t\t// ImageOptimizer::optimize($path);\n\t\t// }\n $img->resizeCanvas($width, $height, 'center', false, array(255, 255, 255, 0));\n\t\t$img->save($path);\n\t\t//dd($path);\n\t\tImageOptimizer::optimize($path);\n\t}", "public function test_resize() {\n\t\t$file = DIR_TESTDATA . '/images/waffles.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->resize( 100, 50 );\n\n\t\t$this->assertSame(\n\t\t\tarray(\n\t\t\t\t'width' => 75,\n\t\t\t\t'height' => 50,\n\t\t\t),\n\t\t\t$imagick_image_editor->get_size()\n\t\t);\n\t}", "public function sizeImg($width, $height, $crop = true);", "public function resizeImages()\n {\n $conn = $this->getConnection();\n if ($images = $this->getImages($conn)) {\n $imagePath = $this->getNameImages($conn, $images[0]['image_id']);\n\n if ($images[0]['image_id'] == $images[1]['image_id']) {\n //blocks records while they are in resizing, status in progress\n for ($i = 0; $i < 2; $i++) {\n $id = $images[$i]['id'];\n $this->changeStatus($conn, 'in progress', 'new', $id);\n }\n for ($i = 0; $i < 2; $i++) {\n $id = $images[$i]['id'];\n // $image_id = $images[$i]['image_id'];\n if ($this->setNewSize($imagePath, $this->size[$i], $this->size[$i])) {\n $this->updateImages($conn, 'complete', 'done', $imagePath, $id, $this->size[$i]);\n } else\n $this->updateImages($conn, 'error', 'something wrong', $imagePath, $id, $this->size[$i]);\n }\n }\n $conn = null;\n } else echo \"everything is done \\n\";\n }", "function image_auto_resize($file_name){\t\n\t\t$config['image_library'] = 'gd2'; \n\t\t$config['source_image'] = './assets/img/profiles/'.$file_name; \n $config['create_thumb'] = FALSE; \n $config['maintain_ratio'] = FALSE; \n $config['quality'] = '60%'; \n $config['width'] = 250; \n $config['height'] = 250; \n $config['new_image'] = './assets/img/profiles/'.$file_name; \n $this->load->library('image_lib', $config); \n\t\t$this->image_lib->resize();\n\t\t$this->image_lib->clear();\n\t}", "function processImage($dir, $filename)\n{\n // Set up the variables\n $dir = $dir . '/';\n\n // Set up the image path\n $image_path = $dir . $filename;\n\n // Set up the thumbnail image path\n $image_path_tn = $dir . makeThumbnailName($filename);\n\n // Create a thumbnail image that's a maximum of 200 pixels square\n resizeImage($image_path, $image_path_tn, 200, 200);\n\n // Resize original to a maximum of 500 pixels square\n resizeImage($image_path, $image_path, 500, 500);\n}", "public function copyResized() {\n\t\t\n\t\t$output = array();\n\t\t\n\t\t$options = array_merge(\n\t\t\tarray(\n\t\t\t\t'url' => '',\n\t\t\t\t'filename' => '',\n\t\t\t\t'width' => false,\n\t\t\t\t'height' => false,\n\t\t\t\t'crop' => false\n\t\t\t),\n\t\t\t$_POST\n\t\t);\n\t\t\n\t\t$width = $options['width'];\n\t\t$height = $options['height'];\n\t\t\n\t\tif (!((is_numeric($width) || is_bool($width)) && (is_numeric($height) || is_bool($height)))) {\n\t\t\t$output['error'] = Text::get('error_file_size');\n\t\t\treturn $output;\n\t\t}\n\t\t\n\t\tif ($options['filename']) {\n\t\t\n\t\t\t// Get parent directory.\n\t\t\tif ($options['url']) {\n\t\t\t\t$Page = $this->Automad->getPage($options['url']);\n\t\t\t\t$directory = AM_BASE_DIR . AM_DIR_PAGES . $Page->path;\n\t\t\t} else {\n\t\t\t\t$directory = AM_BASE_DIR . AM_DIR_SHARED . '/';\n\t\t\t}\n\t\t\n\t\t\t$file = $directory . $options['filename'];\n\t\t\n\t\t\tCore\\Debug::log($file, 'file');\n\t\t\tCore\\Debug::log($options, 'options');\n\t\t\t\t\n\t\t\tif (file_exists($file)) {\n\t\t\t\t\n\t\t\t\tif (is_writable($directory)) {\n\t\t\t\t\t\n\t\t\t\t\t$img = new Core\\Image(\n\t\t\t\t\t\t$file, \n\t\t\t\t\t\t$width, \n\t\t\t\t\t\t$height,\n\t\t\t\t\t\tboolval($options['crop'])\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$cachedFile = AM_BASE_DIR . $img->file;\n\t\t\t\t\t$resizedFile = preg_replace('/(\\.\\w{3,4})$/', '-' . floor($img->width) . 'x' . floor($img->height) . '$1', $file);\n\t\t\t\t\t\n\t\t\t\t\tif (!$output['error'] = FileSystem::renameMedia($cachedFile, $resizedFile)) {\n\t\t\t\t\t\t$output['success'] = Text::get('success_created') . ' \"' . basename($resizedFile) . '\"';\n\t\t\t\t\t\t$this->clearCache();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$output['error'] = Text::get('error_permission') . ' \"' . $directory . '\"';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$output['error'] = Text::get('error_file_not_found');\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "function resize_rep_image($rep_image)\n{\n if (($rep_image != '') && (function_exists('imagepng')) && (get_value('resize_rep_images') !== '0') && (preg_match('#^uploads/repimages/#', $rep_image) != 0)) {\n $_rep_image = $rep_image;\n if (url_is_local($rep_image)) {\n $_rep_image = get_custom_base_url() . '/' . $rep_image;\n }\n convert_image($_rep_image, get_custom_file_base() . '/uploads/repimages/' . basename(rawurldecode($rep_image)), -1, -1, intval(get_option('thumb_width')), true, null, false, true);\n }\n\n return $rep_image;\n}", "function resizeImage($filename, $max_width, $max_height)\n{\n list($orig_width, $orig_height) = getimagesize($filename);\n\n $width = $orig_width;\n $height = $orig_height;\n\n # taller\n if ($max_height != 0 && $max_width != 0)\n {\n\t if ($height > $max_height) {\n\t\t $width = ($max_height / $height) * $width;\n\t\t $height = $max_height;\n\t }\n\n\t # wider\n\t if ($width > $max_width) {\n\t\t $height = ($max_width / $width) * $height;\n\t\t $width = $max_width;\n\t }\n }\n\n $image_p = imagecreatetruecolor($width, $height);\n\n $image = imagecreatefromjpeg($filename);\n\n imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n $width, $height, $orig_width, $orig_height);\n\n return $image_p;\n}", "public static function resize($id, $options = [])\n {\n $fileRecord = static::data($id);\n if (empty($fileRecord)) {\n return false;\n }\n\n // Create the file object from the file info\n $file = new File(Configure::read('FileApi.basePath') . $fileRecord->category . DS . $fileRecord->tag . DS . $fileRecord->filename);\n\n // Make sure the file exists, otherwise we're done!\n if (!$file->exists()) {\n throw new StatusMessageException('file_api_resize_missing_file');\n }\n\n // Get additional image data\n try {\n $imageInfo = getimagesize($file->path);\n } catch (Exception $e) {\n $imageInfo = [];\n }\n\n if (!in_array($imageInfo['mime'], self::$validImageMimeTypes)) {\n throw new StatusMessageException('file_api_resize_invalid_type');\n }\n\n // Make sure the Imagick class is available to use, otherwise just copy it.\n if (class_exists('Imagick')) {\n // Resize and Save Image\n $image = new Imagick($file->path);\n $width = $image->getImageWidth();\n $height = $image->getImageHeight();\n\n $imgWidth = self::$defaultImageWidth; // Set default width\n $imgHeight = self::$defaultImageHeight; // Set default height\n\n // Override the width\n if (!empty($options['width'])) {\n $imgWidth = $options['width'];\n }\n\n // Override the height\n if (!empty($options['height'])) {\n $imgHeight = $options['height'];\n }\n\n $imgWidth = $imgWidth >= 0 ? $imgWidth : self::$defaultImageWidth;\n $imgHeight = $imgHeight >= 0 ? $imgHeight : self::$defaultImageHeight;\n\n // Keep image width in bounds and preserve aspect ratio\n if ($width > $imgWidth) {\n $image->scaleImage($imgWidth, $imgHeight, true);\n }\n\n // Keep image height in bounds and preserve aspect ratio\n if ($height > $imgHeight) {\n $image->scaleImage($imgWidth, $imgHeight, true);\n }\n\n $image->writeImage();\n } else {\n return false;\n }\n\n return true;\n }", "function resizeImage($image,$width,$height) {\n\t$newImageWidth = $width;\n\t$newImageHeight = $height;\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t$source = imagecreatefromjpeg($image);\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}", "function cropimage($source_url, $new_width=250, $quality=75){\n return false;\n \n if (!file_exists($source_url)){\n echo alertbuilder(\"File does not exist: $source_url\",'warning');\n return false;\n }\n \n //separate the file name and the extention\n $source_url_parts = pathinfo($source_url);\n $filename = $source_url_parts['filename'];\n $extension = strtolower($source_url_parts['extension']);\n \n //detect the width and the height of original image\n $info = getimagesize($source_url);\n \n if($info === false){\n echo alertbuilder('This file is not a valid image', 'warning');\n return false;\n }\n \n $type = $info[2];\n $width = $info[0];\n $height = $info[1];\n \n // resize only when the original image is larger than new width.\n // this helps you to avoid from unwanted resizing.\n if ($width > $new_width) {\n // cool to resize\n } else {\n echo alertbuilder('The image is already smaller than width', 'warning');\n return false;\n }\n \n //get the reduced width\n $reduced_width = ($width - $new_width);\n \n //now convert the reduced width to a percentage, round to 2 decimals\n $reduced_radio = round(($reduced_width / $width) * 100, 2);\n \n // reduce the same percentage from the height, round to 2 decimals\n $reduced_height = round(($height / 100) * $reduced_radio, 2);\n \n //reduce the calculated height from the original height\n $new_height = $height - $reduced_height;\n \n $img = null;\n $imgResized = null;\n \n switch($type) {\n case IMAGETYPE_JPEG:\n $img = imagecreatefromjpeg($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagejpeg($imgResized, $source_url); \n break;\n \n case IMAGETYPE_GIF:\n $img = imagecreatefromgif($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagegif($imgResized, $source_url); \n break;\n \n case IMAGETYPE_PNG:\n $img = imagecreatefrompng($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagepng($imgResized, $source_url); \n break;\n \n default:\n echo alertbuilder('This file is not in JPG, GIF, or PNG format!');\n return false;\n }\n\n //Finally frees any memory associated with image\n imagedestroy($img);\n imagedestroy($imgResized);\n \n return true;\n}", "function image_resize_to_folder($source_pic, $destination_folder, $filename, $max_width, $max_height)\n{\n $image_info = getimagesize($source_pic['tmp_name']);\n $source_pic_name = $source_pic['name'];\n $source_pic_tmpname = $source_pic['tmp_name'];\n $source_pic_size = $source_pic['size'];\n $source_pic_width = $image_info[0];\n $source_pic_height = $image_info[1];\n if (!is_dir($destination_folder)) {\n mkdir($destination_folder, 0755);\n }\n\n $x_ratio = $max_width / $source_pic_width;\n $y_ratio = $max_height / $source_pic_height;\n\n if (($source_pic_width <= $max_width) && ($source_pic_height <= $max_height)) {\n $tn_width = $source_pic_width;\n $tn_height = $source_pic_height;\n } elseif (($x_ratio * $source_pic_height) < $max_height) {\n $tn_height = ceil($x_ratio * $source_pic_height);\n $tn_width = $max_width;\n } else {\n $tn_width = ceil($y_ratio * $source_pic_width);\n $tn_height = $max_height;\n }\n\n switch ($image_info['mime']) {\n case 'image/gif':\n if (imagetypes() & IMG_GIF) {\n $src = imageCreateFromGIF($source_pic['tmp_name']);\n $destination_folder.=\"$filename.gif\";\n $namafile = \"$filename.gif\";\n }\n break;\n\n case 'image/jpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name']);\n $destination_folder.=\"$filename.jpg\";\n $namafile = \"$filename.jpg\";\n }\n break;\n\n case 'image/pjpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name']);\n $destination_folder.=\"$filename.jpg\";\n $namafile = \"$filename.jpg\";\n }\n break;\n\n case 'image/png':\n if (imagetypes() & IMG_PNG) {\n $src = imageCreateFromPNG($source_pic['tmp_name']);\n $destination_folder.=\"$filename.png\";\n $namafile = \"$filename.png\";\n }\n break;\n\n case 'image/wbmp':\n if (imagetypes() & IMG_WBMP) {\n $src = imageCreateFromWBMP($source_pic['tmp_name']);\n $destination_folder.=\"$filename.bmp\";\n $namafile = \"$filename.bmp\";\n }\n break;\n }\n\n //chmod($destination_pic,0777);\n $tmp = imagecreatetruecolor($tn_width, $tn_height);\n imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tn_width, $tn_height, $source_pic_width, $source_pic_height);\n\n //**** 100 is the quality settings, values range from 0-100.\n switch ($image_info['mime']) {\n case 'image/jpeg':\n imagejpeg($tmp, $destination_folder, 100);\n break;\n\n case 'image/gif':\n imagegif($tmp, $destination_folder, 100);\n break;\n\n case 'image/png':\n imagepng($tmp, $destination_folder);\n break;\n\n default:\n imagejpeg($tmp, $destination_folder, 100);\n break;\n }\n\n return ($namafile);\n}", "public function resize($img_filename, $size)\n {\n $height = $this->config->get($size . '/height');\n $width = $this->config->get($size . '/width');\n $crop = $this->config->get($size . '/crop');\n $filters = $this->config->get($size . '/filters');\n $src_image_name = $this->config->get('archive') . $img_filename;\n $dst_image_name = $this->config->get('imageCache') . $size . $img_filename;\n if ($this->isResizeNeeded($src_image_name, $dst_image_name)) {\n if (is_int($height) && is_int($width) && $crop) {\n $this->resizer->crop($src_image_name, $dst_image_name, $width, $height, $filters);\n } elseif ($height !== null && $width !== null) {\n $this->resizer->scale($src_image_name, $dst_image_name, $width, $height, $filters);\n } else {\n die('Error resizing image');\n }\n }\n return $dst_image_name;\n }", "function imageResize($file, $dest, $height, $width, $thumb = FALSE) {\n\tglobal $ighMaxHeight, $ighMaxWidth, $ighThumbHeight, $ighThumbWidth;\n\n\tif (strstr(@mime_content_type($file), \"png\"))\n\t\t$oldImage = imagecreatefrompng($file);\n\telseif (strstr(@mime_content_type($file), \"jpeg\"))\n\t\t$oldImage = imagecreatefromjpeg($file);\n\telseif (strstr(@mime_content_type($file), \"gif\"))\n\t\t$oldImage = imagecreatefromgif($file);\n\telse\n\t\tdie (\"oh shit\");\n\n\t$base_img = $oldImage;\n $img_width = imagesx($base_img);\n $img_height = imagesy($base_img);\n\n $thumb_height = $height;\n $thumb_width = $width;\n\n // Work out which way it needs to be resized\n $img_width_per = $thumb_width / $img_width;\n $img_height_per = $thumb_height / $img_height;\n \n if ($img_width_per <= $img_height_per) {\n $thumb_height = intval($img_height * $img_width_per); \n }\n else {\n $thumb_width = intval($img_width * $img_height_per);\n }\n\n\tif ($thumb) {\n\t\t$thumb_width = $width;\t\t// 120\n\t\t$thumb_height = $height*3/4;\t// 120 * 3 / 4 = 90\n\t}\n\n // Create the new thumbnail image\n $thumb_img = ImageCreateTrueColor($thumb_width, $thumb_height); \n\n\tif ($thumb) {\t// Do the Square from the Centre thing.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, \n\t\t\t\t($img_width/2)-($thumb_width/2), ($img_height/2)-($thumb_height/2), \n\t\t\t\t$thumb_width, $thumb_height, $thumb_width, $thumb_height);\t\t\t\n\t} else {\t// standard image to image resize.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, 0, 0, \n\t\t\t\t$thumb_width, $thumb_height, $img_width, $img_height);\n\t}\n\n\t// using jpegs!\n\timagejpeg($thumb_img, $dest);\n\timagedestroy($base_img);\n\timagedestroy($thumb_img);\n}", "function resize($iNewWidth, $iNewHeight)\n\t{\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tif (function_exists(\"imagecopyresampled\")) {\n\t\t\t$ResizedImageStream = imagecreatetruecolor($iNewWidth, $iNewHeight);\n\t\t\timagecopyresampled($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t} else {\n\t\t\t$ResizedImageStream = imagecreate($iNewWidth, $iNewHeight);\n\t\t\timagecopyresized($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t}\n\n\t\t$this->ImageStream = $ResizedImageStream;\n\t\t$this->width = $iNewWidth;\n\t\t$this->height = $iNewHeight;\n\t\t$this->setImageOrientation();\n\t}", "public function resizeImage($request)\n {\n $returnType = '\\SplFileObject';\n $isBinary = true;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'GET');\n $options = $this->createHttpClientOptions();\n \n try {\n $response = $this->client->send($request, $options);\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n } catch (RequestException $e) {\n $this->processException($e);\n }\n }", "function resizeImage($file, $desfile, $size, $imgobj) {\r\n switch ($this->_conversiontype){\r\n //Imagemagick\r\n case 1:\r\n if($this->_resizeImageIM($file, $desfile, $size))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //NetPBM\r\n case 2:\r\n if($this->_resizeImageNETPBM($file, $desfile, $size, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //GD1\r\n case 3:\r\n if($this->_resizeImageGD1($file, $desfile, $size, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //GD2\r\n case 4:\r\n if($this->_resizeImageGD2($file, $desfile, $size, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n }\r\n return true;\r\n }", "function resizeImage($old_image_path, $new_image_path, $max_width, $max_height) {\r\n \r\n // Get image type\r\n $image_info = getimagesize($old_image_path);\r\n $image_type = $image_info[2];\r\n \r\n // Set up the function names\r\n switch ($image_type) {\r\n case IMAGETYPE_JPEG:\r\n $image_from_file = 'imagecreatefromjpeg';\r\n $image_to_file = 'imagejpeg';\r\n break;\r\n case IMAGETYPE_GIF:\r\n $image_from_file = 'imagecreatefromgif';\r\n $image_to_file = 'imagegif';\r\n break;\r\n case IMAGETYPE_PNG:\r\n $image_from_file = 'imagecreatefrompng';\r\n $image_to_file = 'imagepng';\r\n break;\r\n default:\r\n return;\r\n } // ends the swith\r\n \r\n // Get the old image and its height and width\r\n $old_image = $image_from_file($old_image_path);\r\n $old_width = imagesx($old_image);\r\n $old_height = imagesy($old_image);\r\n \r\n // Calculate height and width ratios\r\n $width_ratio = $old_width / $max_width;\r\n $height_ratio = $old_height / $max_height;\r\n \r\n // If image is larger than specified ratio, create the new image\r\n if ($width_ratio > 1 || $height_ratio > 1) {\r\n \r\n // Calculate height and width for the new image\r\n $ratio = max($width_ratio, $height_ratio);\r\n $new_height = round($old_height / $ratio);\r\n $new_width = round($old_width / $ratio);\r\n \r\n // Create the new image\r\n $new_image = imagecreatetruecolor($new_width, $new_height);\r\n \r\n // Set transparency according to image type\r\n if ($image_type == IMAGETYPE_GIF) {\r\n $alpha = imagecolorallocatealpha($new_image, 0, 0, 0, 127);\r\n imagecolortransparent($new_image, $alpha);\r\n }\r\n \r\n if ($image_type == IMAGETYPE_PNG || $image_type == IMAGETYPE_GIF) {\r\n imagealphablending($new_image, false);\r\n imagesavealpha($new_image, true);\r\n }\r\n \r\n // Copy old image to new image - this resizes the image\r\n $new_x = 0;\r\n $new_y = 0;\r\n $old_x = 0;\r\n $old_y = 0;\r\n imagecopyresampled($new_image, $old_image, $new_x, $new_y, $old_x, $old_y, $new_width, $new_height, $old_width, $old_height);\r\n \r\n // Write the new image to a new file\r\n $image_to_file($new_image, $new_image_path);\r\n // Free any memory associated with the new image\r\n imagedestroy($new_image);\r\n } else {\r\n // Write the old image to a new file\r\n $image_to_file($old_image, $new_image_path);\r\n }\r\n // Free any memory associated with the old image\r\n imagedestroy($old_image);\r\n }", "public function imageResize($imageUrl, $imageSize) {\n if (! file_exists ( Mage::getBaseDir ( static::MEDIA ) . DS . static::MOBILEAPP . DS . static::RESIZED )) {\n mkdir ( Mage::getBaseDir ( static::MEDIA ) . DS . static::MOBILEAPP . DS . static::RESIZED, 0777 );\n }\n \n $imageName = substr ( strrchr ( $imageUrl, \"/\" ), 1 );\n // get file extension\n $extension = end ( explode ( \".\", $imageName ) );\n $imageName = uniqid () . '.' . $extension;\n $imageResized = Mage::getBaseDir ( static::MEDIA ) . DS . static::MOBILEAPP . DS . static::RESIZED . DS . $imageName;\n $dirImg = Mage::getBaseDir () . str_replace ( \"/\", DS, strstr ( $imageUrl, '/' . static::MEDIA ) );\n if (! file_exists ( $imageResized ) && file_exists ( $dirImg )) :\n $imageObj = new Varien_Image ( $dirImg );\n $imageObj->constrainOnly ( true );\n $imageObj->keepAspectRatio ( true );\n $imageObj->keepFrame ( false );\n $imageObj->resize ( $imageSize, null );\n $imageObj->save ( $imageResized );\n \n \n \n \n \n \n endif;\n return Mage::getBaseUrl ( static::MEDIA ) . static::MOBILEAPP . \"/\" . static::RESIZED . \"/\" . $imageName;\n }", "function _resizeImageGD1($src_file, $dest_file, $new_size, $imgobj) {\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n // GD1 can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\") {\r\n return false;\r\n }\r\n // height/width\r\n $ratio = max($imgobj->_size[0], $imgobj->_size[1]) / $new_size;\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($imgobj->_size[0] / $ratio);\r\n $destHeight = (int)($imgobj->_size[1] / $ratio);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = imagecreatefromjpeg($src_file);\r\n } else {\r\n $src_img = imagecreatefrompng($src_file);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n $dst_img = imagecreate($destWidth, $destHeight);\r\n imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $imgobj->_size[0], $imgobj->_size[1]);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $dest_file, $this->_JPEG_quality);\r\n } else {\r\n imagepng($dst_img, $dest_file);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true; \r\n }", "public function image_size(){\n\t\t//add_image_size( 'thumb-owl', 205, 205, true );\n//\tadd_image_size( 'thumb-150', 150, 150, true);\n//\tadd_image_size( 'thumb-120', 120, 120, true);\n//\tadd_image_size( 'thumb-100', 100, 100, true );\n//\tadd_image_size( 'thumb-250', 250, 250, true );\n// // add_image_size( 'thumb-150', 150, 150, true ); //wordpress thumbail\n// add_image_size( 'thumb-60', 60, 60, true);\n//\t\t//add_image_size( 'thumb-editor', 500, 9999, true );\n//remove_image_size( 'thumb-editor');\n\t\t//remove_image_size('large');\n\t\t//remove_image_size('medium_large');\n\t}", "function imageResize($width, $height, $target){\n //formula accordingly...this is so this script will work\n //dynamically with any size image\n\n if ($width > $height) {\n $percentage = ($target / $width);\n } else {\n $percentage = ($target / $height);\n }\n\n //gets the new value and applies the percentage, then rounds the value\n $width = round($width * $percentage);\n $height = round($height * $percentage);\n\n //returns the new sizes in html image tag format...this is so you\n //\tcan plug this function inside an image tag and just get the\n\n return \"width=\".$width.\" height=\".$height.\"\";\n\n }", "function themify_make_image_size( $attachment_id, $width, $height, $meta, $img_url ) {\r\n\t\tsetlocale( LC_CTYPE, get_locale() . '.UTF-8' );\r\n\t\t$attached_file = get_attached_file( $attachment_id );\r\n\r\n\t\t$source_size = apply_filters( 'themify_image_script_source_size', 'large' );\r\n\t\tif ( $source_size !== 'full' && isset( $meta['sizes'][ $source_size ]['file'] ) )\r\n\t\t\t$attached_file = str_replace( $meta['file'], trailingslashit( dirname( $meta['file'] ) ) . $meta['sizes'][ $source_size ]['file'], $attached_file );\r\n\r\n\t\t$resized = image_make_intermediate_size( $attached_file, $width, $height, true );\r\n\t\tif ( $resized && ! is_wp_error( $resized ) ) {\r\n\r\n\t\t\t// Save the new size in meta data\r\n\t\t\t$key = sprintf( 'resized-%dx%d', $width, $height );\r\n\t\t\t$meta['sizes'][$key] = $resized;\r\n\t\t\t$img_url = str_replace( basename( $img_url ), $resized['file'], $img_url );\r\n\r\n\t\t\twp_update_attachment_metadata( $attachment_id, $meta );\r\n\r\n\t\t\t// Save size in backup sizes so it's deleted when original attachment is deleted.\r\n\t\t\t$backup_sizes = get_post_meta( $attachment_id, '_wp_attachment_backup_sizes', true );\r\n\t\t\tif ( ! is_array( $backup_sizes ) ) $backup_sizes = array();\r\n\t\t\t$backup_sizes[$key] = $resized;\r\n\t\t\tupdate_post_meta( $attachment_id, '_wp_attachment_backup_sizes', $backup_sizes );\r\n\r\n\t\t\t// Return resized image url, width and height.\r\n\t\t\treturn array(\r\n\t\t\t\t'url' => esc_url( $img_url ),\r\n\t\t\t\t'width' => $width,\r\n\t\t\t\t'height' => $height,\r\n\t\t\t);\r\n\t\t}\r\n\t\t// Return original image url, width and height.\r\n\t\treturn array(\r\n\t\t\t'url' => $img_url,\r\n\t\t\t'width' => $width,\r\n\t\t\t'height' => $height,\r\n\t\t);\r\n\t}", "function reduce_image_size($dest_folder,$image_name,$files)\n{\n //REDUCE IMAGE RESOLUTION\n if($files)\n {\n //echo 123;exit;\n $dest = $dest_folder.$image_name;\n $width = 300;\n $height = 300;\n list($width_orig, $height_orig) = getimagesize($files);\n $ratio_orig = $width_orig/$height_orig;\n if ($width/$height > $ratio_orig)\n {\n $width = $height*$ratio_orig;\n }\n else\n {\n $height = $width/$ratio_orig;\n }\n $image_p = imagecreatetruecolor($width, $height);\n $image = imagecreatefromjpeg($files);\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);\n imagejpeg($image_p,$dest, 100);\n ImageDestroy ($image_p);\n }\n //END OF REDUCING IMAGE RESOLUTION\n}", "public function resizeAndSaveImage($imagePath, $dimensions, $cutToFit = false)\n\t{\n\t\tif (!$this->awsService->isFile($imagePath)) {\n\t\t\treturn array($imagePath, null, null);\n\t\t}\n\n\t\t$info = pathinfo($imagePath);\n\n\t\t$imageDir = $info['dirname'].'/';\n\t\t$imageName = basename($imagePath);\n\n\t\t////////////////////////////////////////\n\t\t// read dimensions\n\t\t////////////////////////////////////////\n\t\t$dim = explode('x', $dimensions);\n\t\t$newWidth = isset($dim[0]) ? $dim[0] : null;\n\t\t$newHeight = isset($dim[1]) ? $dim[1] : null;\n\t\ttry {\n\t\t\t$resizedImageName = Strings::webalize(basename($imagePath, '.' . $info['extension']))\n\t\t\t\t. '-' . $newWidth\n\t\t\t\t. 'x'\n\t\t\t\t. $newHeight\n\t\t\t\t. '.'\n\t\t\t\t. $info['extension'];\n\t\t\t$resizedImagePath = $imageDir . $resizedImageName;\n\n\t\t\t// check if resized image is already on s3, if yes, return, if not, generate and save\n\t\t\tif ($this->awsService->isFile($resizedImagePath)) {\n\t\t\t\t$resizedImagePath = $this->baseUrl . $resizedImagePath;\n\t\t\t\t$result = array($resizedImagePath, $newWidth, $newHeight);\n\t\t\t\treturn $result;\n\t\t\t}\n\n\t\t\t// need to download the original image and convert the sizes\n\t\t\t$tempImagePath = $this->tempDir . $imageName;\n\n\t\t\t// download image from s3 to temporary directory\n\t\t\t$this->awsService->downloadFile($imagePath, $tempImagePath);\n\n\t\t\t// load and resize image\n\t\t\t$image = Image::fromFile($tempImagePath);\n\t\t\tif ($cutToFit) {\n\t\t\t\tif ($image->height > $image->width) {\n\t\t\t\t\t$image->resize($newWidth, $newHeight, Image::FILL);\n\t\t\t\t\t$image->sharpen();\n\t\t\t\t\t$blank = Image::fromBlank($newWidth, $newHeight, Image::rgb(255, 255, 255));\n\t\t\t\t\t$blank->place($image, 0, '20%');\n\t\t\t\t\t$image = $blank;\n\t\t\t\t} else {\n\t\t\t\t\t$image->resize($newWidth, $newHeight, Image::FILL | Image::EXACT);\n\t\t\t\t\t$image->sharpen();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$image->resize((int) $newWidth, (int) $newHeight, Image::SHRINK_ONLY);\n\t\t\t\t$image->sharpen();\n\t\t\t}\n\n\t\t\t// generate new image\n\t\t\t$image->save($tempImagePath, 85); // 85% quality\n\t\t\t// upload file to s3 storage\n\t\t\t$this->awsService->uploadFile($tempImagePath, $resizedImagePath);\n\n\t\t\t$result = array($this->baseUrl . $resizedImagePath, $image->width, $image->height);\n\n\t\t\t// free memory\n\t\t\t$image = null;\n\t\t\tunset($image);\n\t\t\t// remove temporary file\n\t\t\tif(file_exists($tempImagePath)) unlink($tempImagePath);\n\t\t\treturn $result;\n\t\t} catch (\\Exception $e) {\n\t\t\t//$this->logger->logError($e);\n\t\t\treturn array($this->baseUrl . $imagePath, null, null);\n\t\t}\n\n\t}", "private function moveAndCreatePhoto(\n UploadedFile $file,\n $size = ['l' => [1000, 1000], 's' => [300, 300]]\n ) {\n $extension = '.' . $file->extension();\n\n $name = token();\n $filename = $name . $extension;\n\n $path = upload_path_images();\n $imageTmp = Image::make($file->getRealPath());\n\n if (!$imageTmp) {\n return false;\n }\n\n $largeSize = $size['l'];\n $thumbSize = $size['s'];\n\n // save original\n $imageTmp->save($path . $name . ImageThumb::$originalAppend . $extension);\n\n // if width is the biggest - resize on max width\n if ($imageTmp->width() > $imageTmp->height()) {\n // resize the image to the large height and constrain aspect ratio (auto width)\n $imageTmp->resize(null, $largeSize[1], function ($constraint) {\n $constraint->aspectRatio();\n })->save($path . $filename);\n\n // resize the image to the thumb height and constrain aspect ratio (auto width)\n $imageTmp->resize(null, $thumbSize[1], function ($constraint) {\n $constraint->aspectRatio();\n })->save($path . $name . ImageThumb::$thumbAppend . $extension);\n }\n else {\n // resize the image to the large width and constrain aspect ratio (auto height)\n $imageTmp->resize($largeSize[0], null, function ($constraint) {\n $constraint->aspectRatio();\n })->save($path . $filename);\n\n // resize the image to the thumb width and constrain aspect ratio (auto width)\n $imageTmp->resize($thumbSize[0], null, function ($constraint) {\n $constraint->aspectRatio();\n })->save($path . $name . ImageThumb::$thumbAppend . $extension);\n }\n\n return $filename;\n }", "public function getResize()\n {\n $ratio = 1.0;\n $image = Input::get('img');\n $dir = Input::get('dir');\n\n $original_width = Image::make(base_path() . \"/\" . Config::get('lfm.images_dir') . $dir . \"/\" . $image)->width();\n $original_height = Image::make(base_path() . \"/\" . Config::get('lfm.images_dir') . $dir . \"/\" . $image)->height();\n\n $scaled = false;\n\n if ($original_width > 600)\n {\n $ratio = 600 / $original_width;\n $width = $original_width * $ratio;\n $height = $original_height * $ratio;\n $scaled = true;\n } else\n {\n $height = $original_height;\n $width = $original_width;\n }\n\n if ($height > 400)\n {\n $ratio = 400 / $original_height;\n $width = $original_width * $ratio;\n $height = $original_height * $ratio;\n $scaled = true;\n }\n\n return View::make('laravel-filemanager::resize')\n ->with('img', Config::get('lfm.images_url') . $dir . \"/\" . $image)\n ->with('dir', $dir)\n ->with('image', $image)\n ->with('height', number_format($height, 0))\n ->with('width', $width)\n ->with('original_height', $original_height)\n ->with('original_width', $original_width)\n ->with('scaled', $scaled)\n ->with('ratio', $ratio);\n }", "function resizer($image_file_name,$desc_location=null,$new_width=null,$new_height=null,$min_size=null,$show_image=true)\n\t{\n\t list($width, $height) = @getimagesize($image_file_name);\n\t if (empty($width) or empty($height)) {return false;}\n\n\t if (!is_null($min_size)) {\n\t if (is_null($min_size)) {$min_size=$new_width;}\n\t if (is_null($min_size)) {$min_size=$new_height;}\n\n\t if ($width>$height) {$new_height=$min_size;$new_width=null;}\n\t else {$new_width=$min_size;$new_height=null;}\n\t }\n\n\t// $my_new_height=$new_height;\n\t if (is_null($new_height) and !is_null($new_width))\n\t { $my_new_height=round($height*$new_width/$width);$my_new_width=$new_width; }\n\t elseif (!is_null($new_height))\n\t { $my_new_width=round($width*$new_height/$height);$my_new_height=$new_height; }\n\t//echo \"$my_new_width, $my_new_height <br/>\";\n\t $image_resized = imagecreatetruecolor($my_new_width, $my_new_height);\n\t $image = imagecreatefromjpeg($image_file_name);\n\t imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $my_new_width, $my_new_height, $width, $height);\n\n\t //--(BEGIN)-->save , show or send image pointer as result\n\t if (!is_null($desc_location))\n\t imagejpeg($image_resized, $desc_location,100);\n\t elseif ($show_image==true)\n\t imagejpeg($image_resized);\n\t return $image_resized;\n\t //--(END)-->save , show or send image pointer as result\n\t}", "function resizeImage($image,$width,$height,$scale,$stype) {\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($stype) {\n case 'gif':\n $source = imagecreatefromgif($image);\n break;\n case 'jpg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'jpeg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'png':\n $source = imagecreatefrompng($image);\n break;\n }\n\timagecopyresampled($newImage, $source,0,0,0,0, $newImageWidth, $newImageHeight, $width, $height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}", "function imageResize($imageResourceId=null,$width=null,$height=null, $targetWidth=null, $targetHeight=null) {\n\n// $targetWidth =300;\n// $targetHeight =260;\n// dd($imageResourceId,$width,$height, $targetWidth, $targetHeight);\n\n $targetLayer=imagecreatetruecolor($targetWidth,$targetHeight);\n imagecopyresampled($targetLayer,$imageResourceId,0,0,0,0,$targetWidth,$targetHeight, $width,$height );\n// imagecopyresized($targetLayer,$imageResourceId,0,0,0,0, $width,$height,$targetWidth,$targetHeight);\n\n return $targetLayer;\n }", "static function ResizeImage($OriginalFilePath, $NewfilePath, $newWidth, $newHeight, $quality) {\n\n Image::getImagine()->open($OriginalFilePath)->thumbnail(new Box($newWidth, $newHeight))->save($NewfilePath, ['quality' => $quality]);\n }", "public function test_resize() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->resize( 100, 50 );\n\n\t\t$this->assertEquals( array( 'width' => 50, 'height' => 50 ), $imagick_image_editor->get_size() );\n\t}", "function resizeImage($src_file, $dest_file, $new_size=100, $resize_aspect=\"sq\", $quality=\"80\")\n\t{\n\t\t$imginfo = getimagesize($src_file);\n\t\t\n\t\tif ($imginfo == null) {\n\t\treturn false;\n\t\t}\t \n\t\t\n\t\t// GD2 can only handle JPG, PNG & GIF images\n\t\tif (!$imginfo[2] > 0 && $imginfo[2] <= 3 ) {\n\t\t return false;\n\t\t}\n\t\t\n\t\t// height/width\n\t\t$srcWidth = $imginfo[0];\n\t\t$srcHeight = $imginfo[1];\n\t\t//$resize_aspect = \"sq\";\n\t\tif ($resize_aspect == 'ht') {\n\t\t $ratio = $srcHeight / $new_size;\n\t\t} elseif ($resize_aspect == 'wd') {\n\t\t $ratio = $srcWidth / $new_size;\n\t\t} elseif ($resize_aspect == 'sq') {\n\t\t $ratio = min($srcWidth, $srcHeight) / $new_size;\n\t\t} else {\n\t\t $ratio = max($srcWidth, $srcHeight) / $new_size;\n\t\t}\n\t\t\n\t\t/**\n\t\t* Initialize variables\n\t\t*/\n\t\t$clipX = 0;\n\t\t$clipY = 0;\n\t\t\n\t\t$ratio = max($ratio, 1.0);\n\t\tif ($resize_aspect == 'sq'){\n\t\t$destWidth = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\t$destHeight = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\tif($srcHeight > $srcWidth){\n\t\t$clipX = 0;\n\t\t$clipY = ((int)($srcHeight - $srcWidth)/2);\n\t\t$srcHeight = $srcWidth;\n\t\t}elseif($srcWidth > $srcHeight){\n\t\t$clipX = ((int)($srcWidth - $srcHeight)/2);\n\t\t$clipY = 0;\n\t\t$srcWidth = $srcHeight;\n\t\t}\n\t\t}else{\n\t\t$destWidth = (int)($srcWidth / $ratio);\n\t\t$destHeight = (int)($srcHeight / $ratio);\n\t\t}\n\t\t\n\t\tif (!function_exists('imagecreatefromjpeg')) {\n\t\t echo 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed';\n\t\t exit;\n\t\t}\n\t\tif (!function_exists('imagecreatetruecolor')) {\n\t\t echo 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the admin page';\n\t\t exit;\n\t\t}\n\t\t\n\t\tif ($imginfo[2] == 1 )\n\t\t $src_img = imagecreatefromgif($src_file);\n\t\telseif ($imginfo[2] == 2)\n\t\t $src_img = imagecreatefromjpeg($src_file);\n\t\telse\n\t\t $src_img = imagecreatefrompng($src_file);\n\t\tif (!$src_img){\n\t\t return false;\n\t\t}\n\t\tif ($imginfo[2] == 1 ) {\n\t\t$dst_img = imagecreate($destWidth, $destHeight);\n\t\t} else {\n\t\t$dst_img = imagecreatetruecolor($destWidth, $destHeight);\n\t\t}\n\t\t\n\t\timagecopyresampled($dst_img, $src_img, 0, 0, $clipX, $clipY, (int)$destWidth, (int)$destHeight, $srcWidth, $srcHeight);\n\t\timagejpeg($dst_img, $dest_file, $quality);\n\t\timagedestroy($src_img);\n\t\timagedestroy($dst_img);\n\t\t\n\t\t// We check that the image is valid\n\t\t$imginfo = getimagesize($dest_file);\n\t\tif ($imginfo == null) {\n\t\t\t@unlink($dest_file);\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function upload_data_resize($pathFolder)\n {\n\t\t$image_upload_folder = FCPATH . $pathFolder;\n\t\tif (!file_exists($image_upload_folder)) {\n\t\t\tmkdir($image_upload_folder, DIR_WRITE_MODE, true);\n\t\t}\n \t$this->upload_config = array(\n 'upload_path' => $image_upload_folder,\n 'allowed_types' => 'png|jpg|jpeg|bmp|tiff',\n 'max_size' => 10240,\n 'remove_space' => TRUE,\n 'encrypt_name' => FALSE,\n\t\t\t'quality' \t\t=> '100%',\n\t\t\t'overwrite'\t\t=>FALSE\n );\n $this->upload->initialize($this->upload_config);\n if(!$this->upload->do_upload()){\n $dataReturn = $this->upload->display_errors();\n }\n\t\telse{\n $dataReturn = $this->upload->data();\t\t\t\n\t\t\t$config = array(\n\t\t\t\t\t\"source_image\" => $dataReturn['full_path'],\n\t\t\t\t\t\"new_image\" => $this->_gallery_path . \"/thumbs\",\n\t\t\t\t\t\"maintain_ration\" => true,\n\t\t\t\t\t\"width\" => 100,\n\t\t\t\t\t\"quality\" => '100%',\n\t\t\t\t\t\"height\" => 100);\n\t\t\t$this->load->library(\"image_lib\",$config);\n\t\t\t$this->image_lib->resize();\n }\n\t\treturn json_encode($dataReturn);\n\t}", "function resizeImage($sourceImage, $targetImage, $maxWidth, $maxHeight, $quality = 80) {\n echo 'sourceImage ';\n echo $sourceImage;\n echo ' targetImage ';\n echo $targetImage;\n // Obtain image from given source file.\n\tif (!$image = @imagecreatefromjpeg($sourceImage)) {\n\t\techo 'false';\n return false;\n }\n\techo ' pre list ';\n // Get dimensions of source image.\n list($origWidth, $origHeight) = getimagesize($sourceImage);\n\n if ($maxWidth == 0) {\n $maxWidth = $origWidth;\n }\n\n if ($maxHeight == 0) {\n $maxHeight = $origHeight;\n }\n\n // Calculate ratio of desired maximum sizes and original sizes.\n $widthRatio = $maxWidth / $origWidth;\n $heightRatio = $maxHeight / $origHeight;\n\n // Ratio used for calculating new image dimensions.\n $ratio = min($widthRatio, $heightRatio);\n\n // Calculate new image dimensions.\n $newWidth = (int)$origWidth * $ratio;\n $newHeight = (int)$origHeight * $ratio;\n\techo 'pre true color ';\n // Create final image with new dimensions.\n\t$newImage = imagecreatetruecolor($newWidth, $newHeight);\n\techo 'post true color ';\n\n // $image = str_replace(' ','_',$image);\n\n\timagecopyresampled($newImage, $image, 0, 0, 0, 0, $newWidth, $newHeight, $origWidth, $origHeight);\n\techo 'post resampled ';\n\n // CREATE PROGRESSIVE IMG INSTANCE\n // $imageProg = imagecreatefromjpeg($image);\n // imageinterlace($imageProg, true);\n // echo 'post progressive';\n\n\timagejpeg($newImage, $targetImage, $quality);\n // imagejpeg($imageProg, $targetImage, $quality);\n\techo 'post imagejpeg ';\n\n // FREE UP MEMORY\n imagedestroy($image);\n imagedestroy($newImage);\n // imagedestroy($imageProg);\n\n return true;\n}", "function image_scale($src_abspath, $dest_abspath, $aspect, $width, $strategy)\n{\n $im = new \\Imagick($src_abspath);\n $im = image_scale_im_obj($im, $aspect, $width, $strategy);\n return image_return_write($im, $dest_abspath);\n}", "function imageResize($width, $height, $target) {\t\n\tif ($width > $height) { \n\t\t$percentage = ($target / $width); \n\t} else { \n\t\t$percentage = ($target / $height); \n\t} \n\n\t//gets the new value and applies the percentage, then rounds the value \n\t$width = round($width * $percentage); \n\t$height = round($height * $percentage); \n\n\t//returns the new sizes in html image tag format...this is so you \n\t//can plug this function inside an image tag and just get the \n\treturn \"width=\\\"$width\\\" height=\\\"$height\\\"\"; \n\t}", "protected function _resizeImage($imagePath, $height = 150, $width = 150)\n {\n Image::make(storage_path('app/public/' . $imagePath))->resize($width, $height)->save(storage_path('app/public/' . $imagePath));\n }", "function getImageResize($image, $width, $height = 0, $adds)\r\n {\r\n $imageinfo = getimagesize($image);\r\n if (!$imageinfo[0] and !$imageinfo[1]) {\r\n // TO DO***** copy file to server, get size, than delete...\r\n }\r\n $out['w'] = $imageinfo[0];\r\n $out['h'] = $imageinfo[1]; \r\n if ($height == 0) {\r\n $input_ratio = $imageinfo[0] / $imageinfo[1];\r\n $height = $width / $input_ratio;\r\n if ($imageinfo[0] < $width) {\r\n $width = $imageinfo[0];\r\n $height = $imageinfo[1];\r\n }\r\n }\r\n else {\r\n $input_ratio = $imageinfo[0] / $imageinfo[1];\r\n $ratio = $width / $height;\r\n if ($ratio < $input_ratio) {\r\n $height = $width / $input_ratio;\r\n }\r\n else {\r\n $width = $height * $input_ratio;\r\n }\r\n if (($imageinfo[0] < $width) && ($imageinfo[1] < $height)) {\r\n $width = $imageinfo[0];\r\n $height = $imageinfo[1];\r\n }\r\n }\r\n $attr = ' height=\"' . floor($height) . '\" width=\"' . floor($width) . '\"';\r\n return $this->imageHtmlCode($image, $adds, $attr);\r\n }", "function resize_image($src_file, $dest_file, $new_size, $method, $thumb_use)\r\n{\r\n global $CONFIG, $ERROR;\r\n global $lang_errors;\r\n\r\n $imginfo = getimagesize($src_file);\r\n if ($imginfo == null)\r\n return false;\r\n // GD can only handle JPG & PNG images\r\n if ($imginfo[2] != GIS_JPG && $imginfo[2] != GIS_PNG && ($method == 'gd1' || $method == 'gd2')) {\r\n $ERROR = $lang_errors['gd_file_type_err'];\r\n return false;\r\n }\r\n // height/width\r\n $srcWidth = $imginfo[0];\r\n $srcHeight = $imginfo[1];\r\n if ($thumb_use == 'ht') {\r\n $ratio = $srcHeight / $new_size;\r\n } elseif ($thumb_use == 'wd') {\r\n $ratio = $srcWidth / $new_size;\r\n } else {\r\n $ratio = max($srcWidth, $srcHeight) / $new_size;\r\n }\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($srcWidth / $ratio);\r\n $destHeight = (int)($srcHeight / $ratio);\r\n // Method for thumbnails creation\r\n switch ($method) {\r\n case \"im\" :\r\n if (preg_match(\"#[A-Z]:|\\\\\\\\#Ai\", __FILE__)) {\r\n // get the basedir, remove '/include'\r\n $cur_dir = substr(dirname(__FILE__), 0, -8);\r\n $src_file = '\"' . $cur_dir . '\\\\' . strtr($src_file, '/', '\\\\') . '\"';\r\n $im_dest_file = str_replace('%', '%%', ('\"' . $cur_dir . '\\\\' . strtr($dest_file, '/', '\\\\') . '\"'));\r\n } else {\r\n $src_file = escapeshellarg($src_file);\r\n $im_dest_file = str_replace('%', '%%', escapeshellarg($dest_file));\r\n }\r\n\r\n $output = array();\r\n /*\r\n * Hack for working with ImageMagick on WIndows even if IM is installed in C:\\Program Files.\r\n * By Aditya Mooley <[email protected]>\r\n */\r\n if (eregi(\"win\",$_ENV['OS'])) {\r\n $cmd = \"\\\"\".str_replace(\"\\\\\",\"/\", $CONFIG['impath']).\"convert\\\" -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} -geometry {$destWidth}x{$destHeight} \".str_replace(\"\\\\\",\"/\" ,$src_file ).\" \".str_replace(\"\\\\\",\"/\" ,$im_dest_file );\r\n exec (\"\\\"$cmd\\\"\", $output, $retval);\r\n } else {\r\n $cmd = \"{$CONFIG['impath']}convert -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} -geometry {$destWidth}x{$destHeight} $src_file $im_dest_file\";\r\n exec ($cmd, $output, $retval);\r\n }\r\n\r\n\r\n if ($retval) {\r\n $ERROR = \"Error executing ImageMagick - Return value: $retval\";\r\n if ($CONFIG['debug_mode']) {\r\n // Re-execute the command with the backtit operator in order to get all outputs\r\n // will not work is safe mode is enabled\r\n $output = `$cmd 2>&1`;\r\n $ERROR .= \"<br /><br /><div align=\\\"left\\\">Cmd line : <br /><font size=\\\"2\\\">\" . nl2br(htmlspecialchars($cmd)) . \"</font></div>\";\r\n $ERROR .= \"<br /><br /><div align=\\\"left\\\">The convert program said:<br /><font size=\\\"2\\\">\";\r\n $ERROR .= nl2br(htmlspecialchars($output));\r\n $ERROR .= \"</font></div>\";\r\n }\r\n @unlink($dest_file);\r\n return false;\r\n }\r\n break;\r\n\r\n case \"gd1\" :\r\n if (!function_exists('imagecreatefromjpeg')) {\r\n cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__);\r\n }\r\n if ($imginfo[2] == GIS_JPG)\r\n $src_img = imagecreatefromjpeg($src_file);\r\n else\r\n $src_img = imagecreatefrompng($src_file);\r\n if (!$src_img) {\r\n $ERROR = $lang_errors['invalid_image'];\r\n return false;\r\n }\r\n $dst_img = imagecreate($destWidth, $destHeight);\r\n imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $srcWidth, $srcHeight);\r\n imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n break;\r\n\r\n case \"gd2\" :\r\n if (!function_exists('imagecreatefromjpeg')) {\r\n cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__);\r\n }\r\n if (!function_exists('imagecreatetruecolor')) {\r\n cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the config page', __FILE__, __LINE__);\r\n }\r\n if ($imginfo[2] == GIS_JPG)\r\n $src_img = imagecreatefromjpeg($src_file);\r\n else\r\n $src_img = imagecreatefrompng($src_file);\r\n if (!$src_img) {\r\n $ERROR = $lang_errors['invalid_image'];\r\n return false;\r\n }\r\n $dst_img = imagecreatetruecolor($destWidth, $destHeight);\r\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $srcWidth, $srcHeight);\r\n imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n break;\r\n }\r\n // Set mode of uploaded picture\r\n chmod($dest_file, octdec($CONFIG['default_file_mode']));\r\n // We check that the image is valid\r\n $imginfo = getimagesize($dest_file);\r\n if ($imginfo == null) {\r\n $ERROR = $lang_errors['resize_failed'];\r\n @unlink($dest_file);\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "public function resize_image($width, $height)\n\t{\n $image_size = $this->image_size();\n if ($image_size[0] == $width && $image_size[1] == $height) {\n // Already correct size,\n return;\n }\n if (!$image_size[0]) {\n \tabort(500, \"Unable to load remote image\");\n }\n\n // Create a new image for the resized image\n $newimage = imagecreatetruecolor($width, $height);\n $oldimage = $this->load_image();\n imagecopyresampled($newimage, $oldimage, 0, 0, 0, 0, $width, $height, $image_size[0], $image_size[1]);\n\n $filename = $this->new_local_file_name();\n if (preg_match('/jpeg/', $image_size['mime'])) {\n imagejpeg($newimage, $filename, 100);\n } elseif (preg_match('/gif/', $image_size['mime'])) {\n imagegif($newimage, $filename);\n } elseif (preg_match('/png/', $image_size['mime'])) {\n imagepng($newimage, $filename);\n }\n $this->delete_local_file();\n $this->local_file = $filename;\n\t}" ]
[ "0.76179403", "0.73459333", "0.73206663", "0.7294077", "0.7253657", "0.72468084", "0.7239712", "0.71652424", "0.71518344", "0.7131445", "0.7058114", "0.70504713", "0.702063", "0.70206153", "0.69948167", "0.698871", "0.6972791", "0.69624656", "0.6939342", "0.6890605", "0.6874016", "0.6862101", "0.68604356", "0.6806024", "0.68008935", "0.6773885", "0.6755121", "0.6749457", "0.6746997", "0.6727581", "0.6726116", "0.6714191", "0.6713144", "0.66900736", "0.6676717", "0.66731733", "0.66661936", "0.6666138", "0.66648096", "0.66495544", "0.66429824", "0.66330606", "0.6622937", "0.6622852", "0.66224176", "0.66179174", "0.6616637", "0.6614538", "0.6613038", "0.66103125", "0.660793", "0.6587311", "0.6584977", "0.65827584", "0.6582289", "0.6575506", "0.6572228", "0.65484995", "0.65467954", "0.6525538", "0.6524992", "0.65246516", "0.6518888", "0.6513966", "0.6513387", "0.650878", "0.6482986", "0.64804333", "0.6479442", "0.6478543", "0.647458", "0.64712477", "0.64697933", "0.6463576", "0.6460621", "0.64596486", "0.64474696", "0.6447327", "0.6446717", "0.6424353", "0.6423996", "0.64223164", "0.6415637", "0.639771", "0.6391954", "0.6384562", "0.6383865", "0.63743186", "0.63690186", "0.6365093", "0.6363589", "0.63622004", "0.6354887", "0.6352724", "0.6352387", "0.6347948", "0.6344989", "0.63437784", "0.63311136", "0.6328238", "0.6321471" ]
0.0
-1
Crop image center of it's
public function crop($source = array(), $new_name, $config = array()) { $source_width = $source['image_width']; $source_height = $source['image_height']; $width = $config['width']; $height = $config['height']; $mark = ''; if(array_key_exists('mark', $config)) $mark = $config['mark']; $create_new = FALSE; if(array_key_exists('create_new', $config)) $create_new = $config['create_new']; if($create_new && $mark == '') $mark = 'cropped-'; $orientation = 'box'; if($height > $width) { $orientation = 'portrait'; } elseif($height < $width) { $orientation = 'landscape'; } $source_orientation = 'box'; if($source_height > $source_width) { $source_orientation = 'portrait'; } elseif($source_height < $source_width) { $source_orientation = 'landscape'; } $size = $this->_calculate_size(array( 'orientation' => $source_orientation, 'width' => $source_width, 'height' => $source_height ), array( 'orientation' => $orientation, 'width' => $width, 'height' => $height )); $thumb['image_library'] = 'gd2'; $thumb['source_image'] = $source['full_path']; $thumb['width'] = $size['width']; $thumb['height'] = $size['height']; $thumb['maintain_ratio'] = TRUE; $thumb['quality'] = 100; if($create_new) { $thumb['new_image'] = './' . $this->upload_dir . $mark . $new_name; } $this->CI->image_lib->initialize($thumb); if($this->CI->image_lib->resize()) { $this->CI->image_lib->clear(); if($create_new) { $thumb['source_image'] = $source['file_path'] . $mark . $new_name; } else { $thumb['source_image'] = $source['file_path'] . $new_name; } $thumb['width'] = $width; $thumb['height'] = $height; $thumb['maintain_ratio'] = FALSE; $thumb['quality'] = 100; $thumb['new_image'] = ''; if($create_new) { list($thumb_width, $thumb_height) = getimagesize($source['file_path'] . $mark . $new_name); } else { list($thumb_width, $thumb_height) = getimagesize($source['file_path'] . $new_name); } if($thumb_height == $height) { $thumb['x_axis'] = ($thumb_width - $width) / 2; $thumb['y_axis'] = 0; } else { $thumb['y_axis'] = ($thumb_height - $height) / 2; $thumb['x_axis'] = 0; } $this->CI->image_lib->initialize($thumb); if($this->CI->image_lib->crop()) { return array( 'status' => TRUE ); } else { exit($this->image_lib->display_errors()); } } else { exit($this->image_lib->display_errors()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function image_crop()\n\t{\n\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\tif (substr($protocol, -3) == 'gd2')\n\t\t{\n\t\t\t$protocol = 'image_process_gd';\n\t\t}\n\t\t\n\t\treturn $this->$protocol('crop');\n\t}", "public function crop()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('crop');\n\t}", "public function crop()\n {\n }", "protected function cropMagic(): void\n {\n $this->image->crop($this->cropWidth, $this->cropHeight, $this->cropLeft, $this->cropTop);\n }", "public static function crop(){\n\n}", "public function crop()\n {\n $this->_pid = $this->_request->getInput('pid');\n $imgUrl = $this->_request->getInput('imgUrl');\n $imgInfo = new SplFileInfo($imgUrl);\n $cropParams = $this->_request->getAllPostInput();\n $cropParams['img_final_dir'] = '/images/properties/';\n $cropParams['image_out'] = $this->_pid . '-' . uniqid() . '.' . $imgInfo->getExtension();\n\n $this->_imageOut = $cropParams['img_final_dir'] . $cropParams['image_out'];\n\n if($this->_cropper->crop($cropParams))\n {\n return true;\n }\n return false;\n }", "public function center_crop( $args ) {\n\t\t\t$size = $this->get_dimensions( $args );\n\n\t\t\tif ( empty( $size ) ) {\n\t\t\t\treturn array();\n\t\t\t}\n\n\t\t\t$horizontal_offset = $this->get_center_crop_offset( $size );\n\n\t\t\treturn $this->set_conditional_args(\n\t\t\t\tarray(\n\t\t\t\t\t'w' => $size['width'],\n\t\t\t\t\t'crop' => '0,' . $horizontal_offset . 'px,100,' . $size['height'],\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public function crop($width, $height, $offset_x=null, $offset_y=null);", "function FE_CropImage($img, $w=0, $h=0, $a=''){\t\t\r\n\t\t$q=80; /* calitate 0-100 */\t\t\r\n\t\t$src =__URL__.'app/tt/tt.php?src='.$img.($w>0 ? \"&w=$w\" : \"\").($h>0 ? \"&h=$h\" : \"\").\"&q=$q\".(!empty($a) ? \"&a=$a\" : \"\");\r\n\t\treturn $src;\r\n\t\t\r\n }", "function crop( $x = 0, $y = 0, $w = 0, $h = 0 )\n\t{\n\t\tif( $w == 0 || $h == 0 )\n\t\t\treturn FALSE;\n\t\t\n\t\t//create a target canvas\n\t\t$new_im = imagecreatetruecolor ( $w, $h );\n\t\n\t\t//copy and resize image to new canvas\n\t\timagecopyresampled( $new_im, $this->im, 0, 0, $x, $y, $w, $h, $w, $h );\n\t\t\n\t\t//delete the old image handle\n\t\timagedestroy( $this->im );\n\t\t\n\t\t//set the new image as the current handle\n\t\t$this->im = $new_im;\n\t}", "function _crop_image_resource($img, $x, $y, $w, $h)\n {\n }", "public function initCropBox() {\n $this->setImage($this->configuration['image']);\n $this->setCropBoxProperties();\n $this->setOriginalSize();\n $this->setAspectRatio();\n $this->setDelta();\n\n return $this;\n }", "abstract public function calculateCropBoxCoordinates();", "function imgcrop(){\n\t\t$id = $this->session->userdata(SESSION_CONST_PRE.'userId');\n\t\t$dir_path = './assets/uploads/students/';\n\t\n\t\t$file_path = $dir_path . \"/Profile.small.jpg\";\n\t\t$src = $dir_path .'Profile.jpg';\n\t\tif(file_exists($file_path)){\n\t\t\t$src = $dir_path .'Profile.small.jpg';\n\t\t}\n\t\n\t\t$imgW = $_POST['w'];\n\t\t$imgH = $_POST['h'];\n\t\t$imgY1 = $_POST['y'];\n\t\t$imgX1 = $_POST['x'];\n\t\t$cropW = $_POST['w'];\n\t\t$cropH = $_POST['h'];\n\t\n\t\t$jpeg_quality = 100;\n\t\n\t\t//$img_r = imagecreatefromjpeg($src);\n\t\t$what = getimagesize($src);\n\t\t//list($imgInitW, $imgInitH, $type, $what) = getimagesize($src);\n\t\t$imgW = $imgInitW = $what[0];\n\t\t$imgH = $imgInitH = $what[1];\n\t\tswitch(strtolower($what['mime']))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\t$img_r = imagecreatefrompng($src);\n\t\t\t\t$source_image = imagecreatefrompng($src);\n\t\t\t\t$type = '.png';\n\t\t\t\tbreak;\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$img_r = imagecreatefromjpeg($src);\n\t\t\t\t$source_image = imagecreatefromjpeg($src);\n\t\t\t\t$type = '.jpeg';\n\t\t\t\tbreak;\n\t\t\tcase 'image/jpg':\n\t\t\t\t$img_r = imagecreatefromjpeg($src);\n\t\t\t\t$source_image = imagecreatefromjpeg($src);\n\t\t\t\t$type = '.jpg';\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$img_r = imagecreatefromgif($src);\n\t\t\t\t$source_image = imagecreatefromgif($src);\n\t\t\t\t$type = '.gif';\n\t\t\t\tbreak;\n\t\t\tdefault: die('image type not supported');\n\t\t}\n\t\n\t\t$resizedImage = imagecreatetruecolor($imgW, $imgH);\n\t\timagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $imgW,\n\t\t$imgH, $imgInitW, $imgInitH);\n\t\n\t\n\t\t$dest_image = imagecreatetruecolor($cropW, $cropH);\n\t\timagecopyresampled($dest_image, $source_image, 0, 0, $imgX1, $imgY1, $cropW,\n\t\t$cropH, $cropW, $cropH);\n\t\n\t\n\t\timagejpeg($dest_image, $dir_path.'Profile.small.jpg', $jpeg_quality);\n\t\n\t}", "public function crop($value) {\n return $this->setProperty('crop', $value);\n }", "public function crop($value = null)\n {\n $this->crop = $value;\n }", "public function test_crop() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->crop( 0, 0, 50, 50 );\n\n\t\t$this->assertEquals( array( 'width' => 50, 'height' => 50 ), $imagick_image_editor->get_size() );\n\n\t}", "private function _setCrop()\n {\n if (isset($this->crop) && $this->crop && $this->bbox_rubberband && $this->_isResize()) {\n\n $bbox_rubberband = explode(',', $this->bbox_rubberband);\n\n //lower-left coordinate\n $ll_point = new \\stdClass();\n $ll_point->x = $bbox_rubberband[0];\n $ll_point->y = $bbox_rubberband[3];\n $ll_coord = $this->pix2Geo($ll_point);\n\n //upper-right coordinate\n $ur_point = new \\stdClass();\n $ur_point->x = $bbox_rubberband[2];\n $ur_point->y = $bbox_rubberband[1];\n $ur_coord = $this->pix2Geo($ur_point);\n\n //set the size as selected\n $width = abs($bbox_rubberband[2]-$bbox_rubberband[0]);\n $height = abs($bbox_rubberband[3]-$bbox_rubberband[1]);\n\n $this->map_obj->setSize($width, $height);\n if ($this->_isResize() && $this->_download_factor > 1) {\n $this->map_obj->setSize($this->_download_factor*$width, $this->_download_factor*$height);\n }\n\n //set the extent to match that of the crop\n $this->map_obj->setExtent($ll_coord->x, $ll_coord->y, $ur_coord->x, $ur_coord->y);\n }\n }", "function resizeCropImage($src, $dst, $dstx, $dsty){\n\t\t//$dst = destination image location\n\t\t//$dstx = user defined width of image\n\t\t//$dsty = user defined height of image\n\t\t$allowedExtensions = 'jpg jpeg gif png';\n\t\t$name = explode(\".\", strtolower($src));\n\t\t$currentExtensions = $name[count($name)-1];\n\t\t$extensions = explode(\" \", $allowedExtensions);\n\n\t\tfor($i=0; count($extensions)>$i; $i=$i+1) {\n\t\t\tif($extensions[$i]==$currentExtensions)\n\t\t\t{ \n\t\t\t\t$extensionOK=1; \n\t\t\t\t$fileExtension=$extensions[$i]; \n\t\t\t\tbreak; \n\t\t\t}\n\t\t}\n\n\t\tif($extensionOK){\n\t\t\t$size = getImageSize($src);\n\t\t\t$width = $size[0];\n\t\t\t$height = $size[1];\n\t\t\tif($width >= $dstx AND $height >= $dsty){\n\t\t\t\t$proportion_X = $width / $dstx;\n\t\t\t\t$proportion_Y = $height / $dsty;\n\t\t\t\tif($proportion_X > $proportion_Y ){\n\t\t\t\t\t$proportion = $proportion_Y;\n\t\t\t\t}else{\n\t\t\t\t\t$proportion = $proportion_X ;\n\t\t\t\t}\n\t\t\t\t$target['width'] = $dstx * $proportion;\n\t\t\t\t$target['height'] = $dsty * $proportion;\n\t\t\t\t$original['diagonal_center'] = round(sqrt(($width*$width)+($height*$height))/2);\n\t\t\t\t$target['diagonal_center'] = round(sqrt(($target['width']*$target['width']) + ($target['height']*$target['height']))/2);\n\t\t\t\t$crop = round($original['diagonal_center'] - $target['diagonal_center']);\n\t\t\t\tif($proportion_X < $proportion_Y ){\n\t\t\t\t\t$target['x'] = 0;\n\t\t\t\t\t$target['y'] = round((($height/2)*$crop)/$target['diagonal_center']);\n\t\t\t\t}else{\n\t\t\t\t\t$target['x'] = round((($width/2)*$crop)/$target['diagonal_center']);\n\t\t\t\t\t$target['y'] = 0;\n\t\t\t\t}\n\t\t\t\tif($fileExtension == \"jpg\" OR $fileExtension=='jpeg'){ \n\t\t\t\t\t$from = ImageCreateFromJpeg($src); \n\t\t\t\t} elseif ($fileExtension == \"gif\"){ \n\t\t\t\t\t$from = ImageCreateFromGIF($src); \n\t\t\t\t} elseif ($fileExtension == 'png'){\n\t\t\t\t\t$from = imageCreateFromPNG($src);\n\t\t\t\t}\n\t\t\t\t$new = ImageCreateTrueColor ($dstx,$dsty);\n\t\t\t\timagecopyresampled ($new, $from, 0, 0, $target['x'], \n\t\t\t\t$target['y'], $dstx, $dsty, $target['width'], $target['height']);\n\t\t\t\tif($fileExtension == \"jpg\" OR $fileExtension == 'jpeg'){ \n\t\t\t\t\timagejpeg($new, $dst, 70); \n\t\t\t\t} elseif ($fileExtension == \"gif\"){ \n\t\t\t\t\timagegif($new, $dst); \n\t\t\t\t}elseif ($fileExtension == 'png'){\n\t\t\t\t\timagepng($new, $dst);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcopy($src, $dst);\n\t\t\t}\n\t\t}\n\t}", "public function crop(IImageInformation $src, $x, $y, $width, $height);", "function imagecropauto($image, $mode = -1, $threshold = 0.5, $color = -1)\n{\n}", "public function getMapCropTopLeft(): XY\n {\n return $this->mapCropTopLeft;\n }", "public function test_crop() {\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->crop( 0, 0, 50, 50 );\n\n\t\t$this->assertSame(\n\t\t\tarray(\n\t\t\t\t'width' => 50,\n\t\t\t\t'height' => 50,\n\t\t\t),\n\t\t\t$imagick_image_editor->get_size()\n\t\t);\n\t}", "public function get_center_crop_offset( $size ) {\n\t\t\t// Return the whole image.\n\t\t\t$offset = 0;\n\t\t\t$width = $size['width'];\n\t\t\t$height = $size['height'];\n\t\t\tif ( 100 !== $height && preg_match( '/^(\\d+)px$/i', $height, $matches ) ) {\n\t\t\t\t$height = $matches[1];\n\t\t\t\tif ( ! empty( $this->args['attachment_id'] ) ) {\n\t\t\t\t\t$attachment_meta = wp_get_attachment_metadata( $this->args['attachment_id'], true );\n\t\t\t\t\tif ( ! empty( $attachment_meta['height'] ) && ! empty( $attachment_meta['width'] ) ) {\n\t\t\t\t\t\t$new_size = wp_constrain_dimensions( $attachment_meta['width'], $attachment_meta['height'], $width, 9999 );\n\t\t\t\t\t\tif ( $new_size[1] > $height ) {\n\t\t\t\t\t\t\t$offset = floor( ( $new_size[1] - $height ) / 2.00 );\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\treturn $offset;\n\t\t}", "function wp_ajax_crop_image()\n {\n }", "public function maybeCropImage($data)\n {\n if (!$data['mod_image_crop']) {\n return $data['mod_image_image']['sizes'][$data['mod_image_size']];\n }\n\n $imageSrc = wp_get_attachment_image_src(\n $data['mod_image_image']['ID'],\n apply_filters('Modularity/image/image',\n municipio_to_aspect_ratio('16:9', array($data['mod_image_crop_width'], $data['mod_image_crop_height']))\n )\n );\n\n return $imageSrc[0];\n }", "public function getCropX()\n {\n return $this->_daImage->getCropX( $this->getId() );\n }", "function crop($rect=array(),&$autosave=null) \n { \n //invalid rectangle defintion \n if(empty($rect)) \n { \n return $this; \n } \n \n if(count($rect)==2) \n { \n $_rect=$rect; \n $rect=array(0,0,$_rect[0],$_rect[1]); \n unset($_rect); \n } \n \n if(count($rect)==3) \n { \n $_rect=array($rect[0],$rect[1],$rect[2]); \n $rect=array(0,0,$_rect[1],$_rect[2]); \n \n switch(trim(strtolower($_rect[0]))) \n { \n case 'lt': \n $rect[0]=0; \n $rect[1]=0; \n break; \n case 'rt': \n $rect[0]=$this->_width-$rect[2]; \n $rect[1]=0; \n break; \n case 'lb': \n $rect[0]=0; \n $rect[1]=$this->_height-$rect[3]; \n break; \n case 'rb': \n $rect[0]=$this->_width-$rect[2]; \n $rect[1]=$this->_height-$rect[3]; \n break; \n case 'center': \n $rect[0]=($this->_width-$rect[2])*0.5; \n $rect[1]=($this->_height-$rect[3])*0.5; \n break; \n } \n unset($_rect); \n } \n \n if(count($rect)!=4 || $rect[0]<0 || $rect[1]<0 || $rect[2]<=0 || $rect[3]<0) \n { \n return $this; \n } \n \n //overflow \n if($rect[0]+$rect[2]>$this->_width || $rect[1]+$rect[3]>$this->_height) \n { \n return $this; \n } \n \n $_tmpImage=imagecreatetruecolor($rect[2],$rect[3]); \n imagecopy($_tmpImage,$this->_image,0,0,$rect[0],$rect[1],$rect[2],$rect[3]); \n imagedestroy($this->_image); \n $this->_image=&$_tmpImage; \n \n $this->_width=$rect[2]; \n $this->_height=$rect[3]; \n \n if(isset($autosave)) \n { \n $_file=sprintf('%s%s_%sx%s.%s', \n $this->_imagePathInfo['dirname'].DS, \n $this->_imagePathInfo['filename'], \n $this->_width,$this->_height, \n $this->_imagePathInfo['extension'] \n ); \n \n if($this->saveAs($_file,$this->default_qulity,$this->default_smooth,$this->auto_dispose)) \n { \n $autosave=$_file; \n } \n } \n \n return $this; \n }", "public function crop($value)\n {\n $this->args = array_merge($this->args, ['crop' => $value]);\n\n return $this;\n }", "public function cropAvatarAction()\n {\n // TODO: swap web dir to product path\n //$imgRealPath = '/Users/leonqiu/www/choumei.me/Symfony/web/' . $_POST['imageSource'];\n $imgRealPath = dirname(__FILE__) . '/../../../../web/' . $_POST['imageSource'];\n list($width, $height) = getimagesize($imgRealPath);\n \n $viewPortW = $_POST[\"viewPortW\"];\n\t $viewPortH = $_POST[\"viewPortH\"];\n $pWidth = $_POST[\"imageW\"];\n $pHeight = $_POST[\"imageH\"];\n $tmp = explode(\".\",$_POST[\"imageSource\"]);\n $ext = end(&$tmp);\n $function = $this->returnCorrectFunction($ext);\n //$image = $function($_POST[\"imageSource\"]);\n $image = $function($imgRealPath);\n $width = imagesx($image);\n $height = imagesy($image);\n \n // Resample\n $image_p = imagecreatetruecolor($pWidth, $pHeight);\n $this->setTransparency($image,$image_p,$ext);\n\t\timagecopyresampled($image_p, $image, 0, 0, 0, 0, $pWidth, $pHeight, $width, $height);\n\t\timagedestroy($image);\n\t\t$widthR = imagesx($image_p);\n\t\t$hegihtR = imagesy($image_p);\n\t\t\n\t\t$selectorX = $_POST[\"selectorX\"];\n\t\t$selectorY = $_POST[\"selectorY\"];\n\t\t\n\t\tif($_POST[\"imageRotate\"]){\n\t\t $angle = 360 - $_POST[\"imageRotate\"];\n\t\t $image_p = imagerotate($image_p,$angle,0);\n\t\t \n\t\t $pWidth = imagesx($image_p);\n\t\t $pHeight = imagesy($image_p);\n\t\t \n\t\t //print $pWidth.\"---\".$pHeight;\n\t\t\n\t\t $diffW = abs($pWidth - $widthR) / 2;\n\t\t $diffH = abs($pHeight - $hegihtR) / 2;\n\t\t \n\t\t $_POST[\"imageX\"] = ($pWidth > $widthR ? $_POST[\"imageX\"] - $diffW : $_POST[\"imageX\"] + $diffW);\n\t\t $_POST[\"imageY\"] = ($pHeight > $hegihtR ? $_POST[\"imageY\"] - $diffH : $_POST[\"imageY\"] + $diffH);\n\t\t\n\t\t \n\t\t}\n\t\t\n\t\t$dst_x = $src_x = $dst_y = $dst_x = 0;\n\t\t\n\t\tif($_POST[\"imageX\"] > 0){\n\t\t $dst_x = abs($_POST[\"imageX\"]);\n\t\t}else{\n\t\t $src_x = abs($_POST[\"imageX\"]);\n\t\t}\n\t\tif($_POST[\"imageY\"] > 0){\n\t\t $dst_y = abs($_POST[\"imageY\"]);\n\t\t}else{\n\t\t $src_y = abs($_POST[\"imageY\"]);\n\t\t}\n\t\t\n\t\t\n\t\t$viewport = imagecreatetruecolor($_POST[\"viewPortW\"],$_POST[\"viewPortH\"]);\n\t\t$this->setTransparency($image_p,$viewport,$ext);\n\t\t\n\t\timagecopy($viewport, $image_p, $dst_x, $dst_y, $src_x, $src_y, $pWidth, $pHeight);\n\t\timagedestroy($image_p);\n\t\t\n\t\t\n\t\t$selector = imagecreatetruecolor($_POST[\"selectorW\"],$_POST[\"selectorH\"]);\n\t\t$this->setTransparency($viewport,$selector,$ext);\n\t\timagecopy($selector, $viewport, 0, 0, $selectorX, $selectorY,$_POST[\"viewPortW\"],$_POST[\"viewPortH\"]);\n\t\t\n\t\t//$file = \"tmp/test\".time().\".\".$ext;\n\t\t// TODO: generate file name\n\t\t$fileName = uniqid() . \".\" . $ext;\n\t\t$user = $this->get('security.context')->getToken()->getUser();\n\t\t$avatarFile = dirname(__FILE__).'/../../../../web/uploads/avatar/'.$user->getId(). '/' .$fileName;\n\t\t$avatarUrl = '/uploads/avatar/'. $user->getId() . '/' . $fileName;\n\t\t$this->parseImage($ext,$selector,$avatarFile);\n\t\timagedestroy($viewport);\n\t\t//Return value\n\t\t//update avatar\n $em = $this->getDoctrine()->getEntityManager();\n $user->setAvatar($avatarUrl);\n $em->persist($user);\n $em->flush();\n\t\techo $avatarUrl;\n\t\texit;\n }", "function cropImage($param=array())\r\n {\r\n $ret = array(\r\n 'msg' => false,\r\n 'sts' => false,\r\n );\r\n\r\n $final_size = $param['final_size'];\r\n #$filename = $final_size.'-'.$param['img_newname'];\r\n $filename = $param['img_newname'];\r\n $target_dir = $param['dest_path'];\r\n $target_name = $target_dir.$filename;\r\n $source_name = $param['img_real'];\r\n \r\n //get size from real image \r\n $size = getimagesize($source_name);\r\n $targ_w = $param['w'];\r\n $targ_h = $param['h'];\r\n\r\n //get size from ratio\r\n $final_size = explode(\"x\", $final_size);\r\n $final_w = $final_size[0];\r\n $final_h = $final_size[1];\r\n \r\n if($final_w==='auto' && $final_h==='auto'){ //detect if width and height ratio is \"auto\" then readjust width and height size\r\n $final_w = $targ_w;\r\n $final_h = $targ_h;\r\n }elseif($final_w==='auto'){ //detect if width ratio is \"auto\" then readjust width size\r\n $final_w = intval(($final_size[1] * $targ_w) / $targ_h);\r\n }elseif($final_h==='auto'){ //detect if height ratio is \"auto\" then readjust height size\r\n $final_h = intval(($final_size[0] * $targ_h) / $targ_w);\r\n }\r\n //end\r\n \r\n \r\n $jpeg_quality = 90;\r\n $img_r = imagecreatefromjpeg($source_name);\r\n $dst_r = ImageCreateTrueColor( $final_w, $final_h );\r\n \r\n imagecopyresized(\r\n $dst_r, $img_r, \r\n 0,0, \r\n $param['x'],$param['y'], \r\n $final_w,$final_h,\r\n $param['w'],$param['h']\r\n );\r\n \r\n imagejpeg($dst_r,$target_name,$jpeg_quality);\r\n #$this->send_to_server( array($target_name) );\r\n $url_target_name = str_replace('/data/shopkl/_assets/', 'http://klimg.com/kapanlagi.com/klshop/', $target_name);\r\n \r\n\t\t\t\r\n //find image parent url and dir path from config\r\n //reset($this->imgsize['article']['size']);\r\n //$first_key = key($this->imgsize['article']['size']);\r\n //end find\r\n $ret['sts'] = true;\r\n $ret['filename'] = $filename;\r\n $ret['msg'] = '<div class=\"alert alert-success\">Image is cropped and saved in <a href=\"'. $url_target_name .'?'.date('his').'\" target=\"_blank\">'.$target_name.' !</a></div>';\r\n \r\n return $ret;\r\n }", "public function user_crop()\r\n\t{\r\n\t\t// Get uploaded photo\r\n\t\t$uploaded_photo = $this->input->post('uploaded_photo');\r\n\r\n\t\t// Get image width, height\r\n\t\tlist($width, $height) = @getimagesize('./assets/uploads/' . $uploaded_photo);\r\n\r\n\t\t// Calculate ratio\r\n\t\t$ratio = $width / 536;\r\n\r\n\t\t// Get chosen crop coordinates\r\n\t\t$coords_x1 = round($ratio * $this->input->post('coords-x1'));\r\n\t\t$coords_y1 = round($ratio * $this->input->post('coords-y1'));\r\n\t\t$coords_x2 = round($ratio * $this->input->post('coords-x2'));\r\n\t\t$coords_y2 = round($ratio * $this->input->post('coords-y2'));\r\n\t\t$coords_w = round($ratio * $this->input->post('coords-w'));\r\n\t\t$coords_h = round($ratio * $this->input->post('coords-h'));\r\n\r\n\t\t// Profile thumbnail crop config\r\n\t\t$config['source_image'] = './assets/uploads/' . $uploaded_photo;\r\n\t\t$config['new_image'] = './assets/uploads/tall-' . strtolower($uploaded_photo);\r\n\t\t$config['width'] = $coords_w;\r\n\t\t$config['height'] = $coords_h;\r\n\t\t$config['maintain_ratio'] = FALSE;\r\n\t\t$config['x_axis'] = $coords_x1;\r\n\t\t$config['y_axis'] = $coords_y1;\r\n\r\n\t\t// Initialize the image library with config\r\n\t\t$this->image_lib->initialize($config);\r\n\r\n\t\t// Crop the image\r\n\t\tif (!$this->image_lib->crop())\r\n\t\t{\r\n\t\t\t$errors[] = $this->image_lib->display_errors('', '');\r\n\t\t}\r\n\r\n\t\t// Clear the config to start next thumbnail\r\n\t\t$config = array();\r\n\t\t$this->image_lib->clear();\r\n\r\n\t\t// Profile thumbnail resize config\r\n\t\t$config['source_image'] = './assets/uploads/tall-' . strtolower($uploaded_photo);\r\n\t\t$config['width'] = 385;\r\n\t\t$config['height'] = 465;\r\n\t\t$config['maintain_ratio'] = FALSE;\r\n\r\n\t\t// Initialize the image library with config\r\n\t\t$this->image_lib->initialize($config);\r\n\r\n\t\t// Resize the image\r\n\t\tif (!$this->image_lib->resize())\r\n\t\t{\r\n\t\t\t$errors[] = $this->image_lib->display_errors('', '');\r\n\t\t}\r\n\t}", "function admin_cropImage()\r\n {\r\n // setting the layout for admin\r\n $this->layout = 'admin';\r\n \r\n // Setting the page title\r\n $this->set(\"title_for_layout\",\"Image Crop\");\r\n \r\n }", "public function imageCrop()\n {\n return view('ImageCrop');\n }", "function getImageCropWindow() {\n printf(\n '<html><head><title>%s</title></head><body>'.\n '<object type=\"application/x-shockwave-flash\" width=\"640\" height=\"540\"\n data=\"flash/imagecrop.swf?lzproxied=false&imageid=%s\">\n <param name=\"movie\" value=\"flash/imagecrop.swf?lzproxied=false&imageid=%s\">\n <param name=\"quality\" value=\"high\">\n <param name=\"scale\" value=\"noscale\">\n <param name=\"salign\" value=\"LT\">\n <param name=\"menu\" value=\"false\"></object></body></html>',\n papaya_strings::escapeHTMLChars($this->_gt('Crop image')),\n papaya_strings::escapeHTMLChars($this->params['file_id']),\n papaya_strings::escapeHTMLChars($this->params['file_id'])\n );\n exit;\n }", "abstract function crop($properties);", "public function crop($startX,$startY,$width,$height){\n\t\t$this->cropimage($width,$height,$startX,$startY);\n\t\treturn $this;\t\n\t}", "function myImageCrop($imgSrc,$newfilename,$thumbWidth=100,$output=false,$thumbHeight=0){\n \t\n\t\tif($thumbHeight == 0) $thumbHeight = $thumbWidth;\n\t\t\n\t\t//getting the image dimensions\n\t\tlist($width, $height) = getimagesize($this->path.$imgSrc); \n\t\t\n\t\t\n\t\t$extension = strtolower($this->getExtension($imgSrc,false)); // false - tells to get \"jpg\" NOT \".jpg\" GOT IT :P\n\t\t\n\t\t//saving the image into memory (for manipulation with GD Library)\n\t\tswitch($extension) {\n\t\t\tcase 'gif':\n\t\t\t$myImage = imagecreatefromgif($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t\tcase 'jpg':\n\t\t\t$myImage = imagecreatefromjpeg($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t$myImage = imagecreatefrompng($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t}\n\t\t\n\n\n\t\t ///-------------------------------------------------------- \n\t\t //setting the crop size \n\t\t //-------------------------------------------------------- \n\t\t if($width > $height){ \n\t\t\t $biggestSide = $width; \n\t\t\t $cropPercent = .6; \n\t\t\t $cropWidth = $biggestSide*$cropPercent; \n\t\t\t $cropHeight = $biggestSide*$cropPercent; \n\t\t\t $c1 = array(\"x\"=>($width-$cropWidth)/2, \"y\"=>($height-$cropHeight)/2); \n\t\t }else{ \n\t\t\t $biggestSide = $height; \n\t\t\t $cropPercent = .6; \n\t\t\t $cropWidth = $biggestSide*$cropPercent; \n\t\t\t $cropHeight = $biggestSide*$cropPercent; \n\t\t\t $c1 = array(\"x\"=>($width-$cropWidth)/2, \"y\"=>($height-$cropHeight)/7); \n\t\t } \n\t\t \n\t\t //--------------------------------------------------------\n\t\t// Creating the thumbnail\n\t\t//--------------------------------------------------------\n\t\t$thumb = imagecreatetruecolor($thumbWidth, $thumbHeight); \n\t\timagecopyresampled($thumb, $myImage, 0, 0, $c1['x'], $c1['y'], $thumbWidth, $thumbHeight, $cropWidth, $cropHeight); \n\n\t\tif($output == false){\n\t\t\tif($extension==\"jpg\" ){\n\t\t\t\timagejpeg($thumb,$this->path.$newfilename,100);\n\t\t\t}elseif($extension==\"gif\" ){\n\t\t\t\timagegif($thumb,$this->path.$newfilename,100);\n\t\t\t}elseif($extension==\"png\" ){\n\t\t\t\timagepng($thumb,$this->path.$newfilename,9);\n\t\t\t}\n\t\t}else{\n\t\t\t//final output \n\t\t\t//imagejpeg($thumb);\n\t\t\tif($extension==\"jpg\" ){\n\t\t\t\theader('Content-type: image/jpeg');\n\t\t\t\timagejpeg($thumb);\n\t\t\t}elseif($extension==\"gif\" ){\n\t\t\t\theader('Content-type: image/gif');\n\t\t\t\timagegif($thumb);\n\t\t\t}elseif($extension==\"png\" ){\n\t\t\t\theader('Content-type: image/png');\n\t\t\t\timagepng($thumb);\n\t\t\t}\n\t\t} \n\t\timagedestroy($thumb); \n\t}", "public function testManualCornerCrop() {\n\t\t$image = $this->getSampleImage();\n\t\t$this->assertTrue( !empty($image->ID) && $image->exists() );\n\n\t\t$original_url = $image->getAbsoluteURL();\n\n\t\t$in_from_left = 20;\n\t\t$in_from_top = 20;\n\t\t$in_from_right = 40;\n\t\t$in_from_bottom = 40;\n\n\t\t$width_original = $image->getWidth();\n\t\t$height_original = $image->getHeight();\n\n\t\t$bottom_right_x = $width_original - $in_from_right;\n\t\t$bottom_right_y = $height_original - $in_from_bottom;\n\n\t\t$width_thumb = $width_original - $in_from_left - $in_from_right;\n\t\t$height_thumb = $height_original - $in_from_top - $in_from_bottom;\n\n\t\t$thumb = $image->ManualCropFromCorners($in_from_left,$in_from_top,$in_from_right,$in_from_bottom)->Original();\n\n\t\t// Get its URL\n\t\t$url = $thumb->getAbsoluteURL();\n\n\t\t// should end with this command/path\n\t\t$this->assertStringEndsWith(\"=/{$in_from_left}x{$in_from_top}:{$bottom_right_x}x{$bottom_right_y}/{$original_url}\", $url);\n\n\t\t$this->getRemoteImageDimensions($url, $returned_width_thumb, $returned_height_thumb);\n\n\t\t$this->assertEquals( $returned_width_thumb, $width_thumb );// width\n\t\t$this->assertEquals( $returned_height_thumb, $height_thumb );// height\n\n\t}", "public function saveCroppedAsset()\n {\n if(!empty($this->uploadedFile))\n {\n // If file is exist -> remove him\n if(file_exists($this->getFilePath()))\n {\n unlink($this->getFilePath());\n }\n\n $this->genFilename();\n $imagine = Image::getImagine()->open($this->uploadedFile->tempName);\n }\n else\n {\n if(file_exists($this->getFilePath())) {\n $imagine = Image::getImagine()->open($this->getFilePath());\n } else return false;\n }\n\n $size = $imagine->getSize();\n $width = $size->getWidth();\n $height = $size->getHeight();\n\n $cropData = explode(';', $this->cropData);\n\n if(count($cropData) == 4)\n {\n $point = new Point($cropData[0]*$width, $cropData[1]*$height);\n $box = new Box($cropData[2]*$width, $cropData[3]*$height);\n $imagine->crop($point, $box);\n // $imageBox = $this->getImageBox($size);\n // $imagine->resize($imageBox);\n }\n $imagine->save($this->getFilePath());\n\n return $this->save(false);\n }", "function _crop(){\n echo_array($_POST);\n\n if (!empty($_POST['x'])) { $x=$_POST['x'];}else{$x=100;}\n if (!empty($_POST['y'])) { $y=$_POST['y'];}else{$y=100;}\n if (!empty($_POST['w'])) { $w=$_POST['w'];}else{$w=100;}\n if (!empty($_POST['h'])) { $h=$_POST['h'];}else{$h=100;}\n $data['raw_name']=$_POST['raw_name'];\n $data['file_ext']=$_POST['file_ext'];\n $targ_w =$w; $targ_h = $h;\n $jpeg_quality = 90;\n $src = './uploads/'.trim($_POST['image']);\n $img_r = imagecreatefromjpeg($src);\n $dst_r = ImageCreateTrueColor( $targ_w, $targ_h );\n imagecopyresampled($dst_r,$img_r,0,0,$x,$y,\n $targ_w,$targ_h,$w,$h);\n $dst=imagefilter($dst_r, IMG_FILTER_GRAYSCALE);\n imagefilter($dst_r,IMG_FILTER_COLORIZE,80,60,40); //sepia\n imagejpeg($dst_r, './uploads/'.'crop_'.trim($_POST['image']), 80);\n //echo_array($data);\n $this->load->library('tcontrol');\n $this->load->library('tpanel');\n $class=\"tpanel\";\n $s=$this->tpanel->get('date',$data);\n $s.=$this->tpanel->get('navigation_menu',$data);\n $s.=$this->tpanel->get('ajax_menu',$data);\n $s.=$this->tpanel->get('spacer',$data);\n\n $s.=$this->load->view('image_lab_view',$data,TRUE);\n $data['title']='The Tlist Class';\n $data['content']=$s;\n $data['panel']='';\n\n $this->template($data) ;\n //$this->load->view('image_crop_view', $data);\n\n ;}", "function crop($x, $y, $width, $height){\n\n $new_image = imagecreatetruecolor($width, $height);\n imagecopy($new_image, $this->image, 0, 0, $x, $y, $width, $height);\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $width;\n $this->height = $height;\n\n return true;\n }", "abstract public function calculateCropBoxSize();", "function image_crop(){\n\n\t\t\t$imgUrl = $_POST['imgUrl'];\n\t\t\t/*explored image URL and get image name*/\n\t\t\t$expImgUrl=explode(\"/\", $imgUrl);\n\t\t\t$LengthOfArray = sizeof($expImgUrl);\n\t\t\t$imageName = $LengthOfArray-1;\n\t\t\t$imgName = $expImgUrl[$imageName];\n\t\t\t$imgInitW = $_POST['imgInitW'];\n\t\t\t$imgInitH = $_POST['imgInitH'];\n\t\t\t$imgW = $_POST['imgW'];\n\t\t\t$imgH = $_POST['imgH'];\n\t\t\t$imgY1 = $_POST['imgY1'];\n\t\t\t$imgX1 = $_POST['imgX1'];\n\t\t\t$cropW = $_POST['cropW'];\n\t\t\t$cropH = $_POST['cropH'];\n\n\t\t\t$jpeg_quality = 100;\n\t\t\t$rand = rand();\n\t\t\t$output_filename = \"../webroot/img/uploads/croppedImg_\".$rand;\n\t\t\t$oname = \"img/uploads/croppedImg_\".$rand;\n\t\t\t$Pname = \"img/uploads/\";\n\t\t\t$path = BASE_PATH;\n\n\t\t\t$what = getimagesize($Pname.\"/\".$imgName);\n\t\t\t\n\t\t\tswitch(strtolower($what['mime']))\n\t\t\t{\n\t\t\t\tcase 'image/png':\n\t\t\t\t\t$img_r = imagecreatefrompng($Pname.\"/\".$imgName);\n\t\t\t\t\t$source_image = imagecreatefrompng($Pname.\"/\".$imgName);\n\t\t\t\t\t$type = '.png';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/jpeg':\n\t\t\t\t\t$img_r = imagecreatefromjpeg($Pname.\"/\".$imgName);\n\t\t\t\t\t$source_image = imagecreatefromjpeg($Pname.\"/\".$imgName);\n\t\t\t\t\t$type = '.jpeg';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/gif':\n\t\t\t\t\t$img_r = imagecreatefromgif($Pname.\"/\".$imgName);\n\t\t\t\t\t$source_image = imagecreatefromgif($Pname.\"/\".$imgName);\n\t\t\t\t\t$type = '.gif';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: die('image type not supported');\n\t\t\t}\n\t\t\t\t\n\t\t\t$resizedImage = imagecreatetruecolor($imgW, $imgH);\n\t\t\timagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $imgW, \n\t\t\t\t\t\t$imgH, $imgInitW, $imgInitH);\t\n\t\t\t\n\t\t\t\n\t\t\t$dest_image = imagecreatetruecolor($cropW, $cropH);\n\t\t\timagecopyresampled($dest_image, $resizedImage, 0, 0, $imgX1, $imgY1, $cropW, \n\t\t\t\t\t\t$cropH, $cropW, $cropH);\t\n\n\n\t\t\timagejpeg($dest_image, $output_filename.$type, $jpeg_quality);\n\t\t\t\n\t\t\t$response = array(\n\t\t\t\t\t\"status\" => 'success',\n\t\t\t\t\t\"url\" => $oname.$type, \n\t\t\t\t\t\"base\" => $path \n\t\t\t\t );\n\t\t\t print json_encode($response);\n\t\t\t exit;\n\t}", "function crop_algorithm($location, $save_to, $set_width, $set_height){\n\t// Algoritam developed by Mirza Ohranovic | [email protected]\n\t// Coded by Mirza Ohranovic\n\t// October 2014.\n\n\t$image = new Imagick;\n\t$image->readImage($location);\n\n\t// Get size\n\tlist($width, $height) = getimagesize($location);\n\n\t\t$hratio \t= $set_height / $height;\n\t\t$wratio\t\t= $set_width / $width;\n\n\t\tif($wratio < 1 && $hratio < 1){\n\t\t\t$odabran = min($hratio, $wratio);\n\n\t\t\tif($odabran == $hratio){\n\t\t\t\t$nova = $width * $wratio;\n\t\t\t\t$image->scaleImage($nova, 0);\n\t\t\t}elseif($odabran == $wratio){\n\t\t\t\t$nova = $height * $hratio;\n\t\t\t\t$image->scaleImage(0, $nova);\n\t\t\t}\n\t\t}elseif($wratio < 1 && $hratio >= 1){\n\t\t\t$nova = $height * $hratio;\n\t\t\t$image->scaleImage(0, $nova);\n\t\t}elseif($wratio >= 1 && $hratio < 1){\n\t\t\t$nova = $width * $wratio;\n\t\t\t$image->scaleImage($nova, 0);\n\t\t}else{\n\t\t\t$image->scaleImage($set_width, 0);\n\t\t}\n\n\t\t$v = $image->getImageGeometry();\n\t\t\t$w = $v['width'];\n\t\t\t$h = $v['height'];\n\n\t\t$x = floor(($w - $set_width) / 2);\n\t\t$y = floor(($h - $set_height) / 2);\n\n\t\tif($x <= 1) $x = 0;\n\t\tif($y <= 1) $y = 0;\n\n\t\t$image->cropImage($set_width, $set_height, $x, $y);\n\t\t$image->writeImage($save_to);\n\t\t$image->clear();\n\t\t$image->destroy();\n\t}", "public function crop_image($w, $h)\n\t{\n // This function resizes this image to fit in the box $w x $h, cropping to fill the entire image\n $image_size = $this->image_size();\n if ($image_size[0] == $w && $image_size[1] == $h) {\n // No need to crop\n return;\n }\n $ratio = $image_size[0] / $image_size[1];\n $goal_ratio = $w / $h;\n\n // Calculate the new image size\n if ($ratio < $goal_ratio) {\n // Tall image, crop top and bottom\n $l = 0;\n $r = $image_size[0];\n $height = $image_size[0] / $goal_ratio;\n $t = ($image_size[1] / 2) - ($height / 2);\n $b = ($image_size[1] / 2) + ($height / 2);\n } else {\n // Wide image, crop top and bottom\n $t = 0;\n $b = $image_size[1];\n $width = $image_size[1] * $goal_ratio;\n $l = ($image_size[0] / 2) - ($width / 2);\n $r = ($image_size[0] / 2) + ($width / 2);\n }\n\n // Create a new image for the resized image\n $oldimage = $this->load_image();\n $newimage = imagecreatetruecolor($w, $h);\n imagecopyresampled($newimage, $oldimage, 0, 0, $l, $t, $w, $h, $r - $l, $b - $t);\n $filename = tempnam(sys_get_temp_dir(), 'img');\n if (preg_match('/jpeg/', $image_size['mime'])) {\n imagejpeg($newimage, $filename, 100);\n } elseif (preg_match('/gif/', $image_size['mime'])) {\n imagegif($newimage, $filename);\n } elseif (preg_match('/png/', $image_size['mime'])) {\n imagepng($newimage, $filename);\n }\n $this->delete_local_file();\n $this->local_file = $filename;\n\t}", "function logonscreener_image_scale_and_crop($image, $source_width, $source_height) {\n global $screen_width, $screen_height;\n\n // Phase 1: Scale.\n $scale = max($screen_width / $source_width, $screen_height / $source_height);\n $scaled_width = (int) round($source_width * $scale);\n $scaled_height = (int) round($source_height * $scale);\n\n if ($scale != 1) {\n logonscreener_log(\"Scale = $scale. Scaled width = $scaled_width. Scaled height = $scaled_height.\");\n\n $res2 = imagecreatetruecolor($scaled_width, $scaled_height);\n imagefill($res2, 0, 0, imagecolorallocate($res2, 255, 255, 255));\n if (!imagecopyresampled($res2, $image, 0, 0, 0, 0, $scaled_width, $scaled_height, $source_width, $source_height)) {\n logonscreener_log('Scale did not worked out. HZ.');\n return FALSE;\n }\n\n // Destroy the original image and update image object.\n imagedestroy($image);\n $image = $res2;\n }\n\n // Phase 2: Crop.\n if ($scaled_width != $screen_width || $scaled_height != $screen_height) {\n $screen_width = (int) $screen_width;\n $screen_height = (int) $screen_height;\n\n $x = ($scaled_width - $screen_width) / 2;\n $y = ($scaled_height - $screen_height) / 2;\n logonscreener_log(\"Crop source X = $x. Crop source Y = $y.\");\n\n $res = imagecreatetruecolor($screen_width, $screen_height);\n imagefill($res, 0, 0, imagecolorallocate($res, 255, 255, 255));\n if (!imagecopyresampled($res, $image, 0, 0, $x, $y, $screen_width, $screen_height, $screen_width, $screen_height)) {\n logonscreener_log('Crop did not worked out. HZ.');\n return FALSE;\n }\n\n // Destroy the original image and update image object.\n imagedestroy($image);\n $image = $res;\n }\n\n return $image;\n}", "public function firstCrop() : Crop\n {\n if($this->firstCrop) {\n return $this->firstCrop;\n }\n return $this->firstCrop = Crop::find(1);\n }", "public function cropAction()\n {\n $candidate = $this->getRequest()->server->get('HTTP_REFERER');\n\n // make sure we get back to product page (fallback to admin home)\n if (strpos($candidate, '/product/product/') !== false) {\n $return_path = $candidate;\n $this->getRequest()->getSession()->set('crop_return_path', $return_path);\n } else {\n $return_path = $this->getRequest()->getSession()->get('crop_return_path');\n if (empty($return_path)) {\n $return_path = '/admin/dashboard';\n }\n }\n\n $path = $this->getRequest()->get('path');\n\n $source_path = $this->container->getParameter('kernel.root_dir') . \"/../web\" . $this->getRequest()->get('src');\n list( $source_width, $source_height, $source_type ) = getimagesize($source_path);\n\n if ($this->getRequest()->isMethod('post')) {\n\n $vector = $this->getRequest()->get('v');\n\n switch ( $source_type )\n {\n case IMAGETYPE_GIF:\n $source_gdim = imagecreatefromgif($source_path);\n break;\n\n case IMAGETYPE_JPEG:\n $source_gdim = imagecreatefromjpeg($source_path);\n break;\n\n case IMAGETYPE_PNG:\n $source_gdim = imagecreatefrompng($source_path);\n break;\n }\n\n $width = $vector[2] - $vector[0];\n $height = $vector[3] - $vector[1];\n\n // if crop makes sense\n if ($width < $source_width) {\n $dest = imagecreatetruecolor($width, $height);\n imagecopy($dest, $source_gdim, 0, 0, $vector[0], $vector[1], $width, $height);\n\n switch ( $source_type )\n {\n case IMAGETYPE_GIF:\n imagegif($dest, $source_path);\n break;\n\n case IMAGETYPE_JPEG:\n imagejpeg($dest, $source_path);\n break;\n\n case IMAGETYPE_PNG:\n imagepng($dest, $source_path);\n break;\n }\n\n // use new width for rendering\n list( $source_width, $source_height, $source_type ) = getimagesize($source_path);\n\n $this->addFlash('sonata_flash_success', 'Image cropped');\n } else {\n $this->addFlash('sonata_flash_error', 'Image not cropped: wrong dimensions');\n }\n }\n\n return $this->render('TeoProductBundle:Admin:crop_image.html.twig', array(\n 'path' => $path,\n 'action' => 'crop',\n 'teo_product_aspect_ratio' => $this->container->getParameter('teo_product_aspect_ratio'),\n 'actual_width' => $source_width,\n 'return_path' => $return_path,\n 'random' => md5(mt_rand()) . md5(mt_rand())\n ));\n }", "function flexibleCropper($source_location, $desc_location=null,$crop_size_w=null,$crop_size_h=null)\n\t{\n\t list($src_w, $src_h) = getimagesize($source_location);\n\n\t $image_source = imagecreatefromjpeg($source_location);\n\t $image_desc = imagecreatetruecolor($crop_size_w,$crop_size_h);\n\n\t/*\n\t if ($crop_size_w>$crop_size_h) {$my_crop_size_w=null;}\n\t elseif ($crop_size_h>$crop_size_w)\n\t {$my_crop_size_h=null;\n\n\t if (is_null($my_crop_size_h) and !is_null($my_crop_size_w))\n\t { $my_crop_size_h=$src_h*$my_crop_size_w/$src_w; }\n\t elseif (!is_null($my_crop_size_h))\n\t { $my_crop_size_w=$src_w*$my_crop_size_h/$src_h; }\n\t*/\n\n\t if ($src_w<$src_h) {$my_crop_size_h=$src_h*$crop_size_w/$src_w;} else {$my_crop_size_h=$crop_size_h;}\n\t if ($src_h<$src_w) {$my_crop_size_w=$src_w*$crop_size_h/$src_h;} else {$my_crop_size_w=$crop_size_w;}\n\t// echo \"($my_crop_size_w-$my_crop_size_h)\";\n\t if ($my_crop_size_w>$crop_size_w) {$additional_x=round(($crop_size_w-$my_crop_size_w)/2);} else {$additional_x=0;}\n\t if ($my_crop_size_h>$crop_size_h) {$additional_y=round(($crop_size_h-$my_crop_size_h)/2);} else {$additional_y=0;}\n\n\t $off_x=round($src_w/2)-round($my_crop_size_w/2);\n\t $off_y=round($src_h/2)-round($my_crop_size_h/2)+$additional_y;\n\t $off_w=(round($src_w/2)+round($my_crop_size_w/2))-$off_x;\n\t $off_h=(round($src_h/2)+round($my_crop_size_h/2))-$off_y;\n\n\t imagecopyresampled($image_desc, $image_source,$additional_x, $additional_y, $off_x, $off_y, $my_crop_size_w, $my_crop_size_h, $off_w, $off_h);\n\n\t if (!is_null($desc_location))\n\t imagejpeg($image_desc, $desc_location,100);\n\t else\n\t imagejpeg($image_desc);\n\t}", "public function getCropBox($fallback = true, $asRect = true) {}", "public function executeCrop(sfWebRequest $request)\n {\n $this->hasPermissionsForSelect();\n \n $selection = aMediaTools::getSelection();\n $id = $request->getParameter('id');\n $index = array_search($id, $selection);\n if ($index === false)\n {\n $this->forward404();\n }\n $cropLeft = floor($request->getParameter('cropLeft'));\n $cropTop = floor($request->getParameter('cropTop'));\n $cropWidth = floor($request->getParameter('cropWidth'));\n $cropHeight = floor($request->getParameter('cropHeight'));\n $width = floor($request->getParameter('width'));\n $height = floor($request->getParameter('height'));\n $imageInfo = aMediaTools::getAttribute('imageInfo');\n $imageInfo[$id]['cropLeft'] = $cropLeft;\n $imageInfo[$id]['cropTop'] = $cropTop;\n $imageInfo[$id]['cropWidth'] = $cropWidth;\n $imageInfo[$id]['cropHeight'] = $cropHeight;\n $imageInfo[$id]['width'] = $width;\n $imageInfo[$id]['height'] = $height;\n aMediaTools::setAttribute('imageInfo', $imageInfo);\n return $this->renderTemplate();\n }", "protected function _do_crop($width, $height, $offset_x, $offset_y)\n {\n $image = $this->_create($width, $height);\n\n // Loads image if not yet loaded\n $this->_load_image();\n\n // Execute the crop\n if (imagecopyresampled($image, $this->_image, 0, 0, $offset_x, $offset_y, $width, $height, $width, $height))\n {\n // Swap the new image for the old one\n imagedestroy($this->_image);\n $this->_image = $image;\n\n // Reset the width and height\n $this->width = imagesx($image);\n $this->height = imagesy($image);\n }\n }", "public function crop($startX,$startY,$width,$height){\n\t\t// do some calculations\n\t\t$cropWidth\t= ($this->_width < $width) ? $this->_width : $width;\n\t\t$cropHeight = ($this->_height < $height) ? $this->_height : $height;\n\t\t\n\t\t$this->_width = $cropWidth;\n\t\t$this->_height = $cropHeight;\n\t\treturn $this;\n\t}", "private function __setOptimalSizeByCrop() {\n \n $heightRatio = $this->__originalImageHeight / $this->__requestedHeight;\n $widthRatio = $this->__originalImageWidth / $this->__requestedWidth;\n \n if ($heightRatio < $widthRatio) {\n $optimalRatio = $heightRatio;\n } else {\n $optimalRatio = $widthRatio;\n }\n \n $this->__optimalHeight = $this->__originalImageHeight / $optimalRatio;\n $this->__optimalWidth = $this->__originalImageWidth / $optimalRatio;\n \n }", "public function crop($width, $height, $offset_x = NULL, $offset_y = NULL)\n {\n if ($width > $this->width)\n {\n // Use the current width\n $width = $this->width;\n }\n\n if ($height > $this->height)\n {\n // Use the current height\n $height = $this->height;\n }\n\n if ($offset_x === NULL)\n {\n // Center the X offset\n $offset_x = round(($this->width - $width) / 2);\n }\n elseif ($offset_x === TRUE)\n {\n // Bottom the X offset\n $offset_x = $this->width - $width;\n }\n elseif ($offset_x < 0)\n {\n // Set the X offset from the right\n $offset_x = $this->width - $width + $offset_x;\n }\n\n if ($offset_y === NULL)\n {\n // Center the Y offset\n $offset_y = round(($this->height - $height) / 2);\n }\n elseif ($offset_y === TRUE)\n {\n // Bottom the Y offset\n $offset_y = $this->height - $height;\n }\n elseif ($offset_y < 0)\n {\n // Set the Y offset from the bottom\n $offset_y = $this->height - $height + $offset_y;\n }\n\n // Determine the maximum possible width and height\n $max_width = $this->width - $offset_x;\n $max_height = $this->height - $offset_y;\n\n if ($width > $max_width)\n {\n // Use the maximum available width\n $width = $max_width;\n }\n\n if ($height > $max_height)\n {\n // Use the maximum available height\n $height = $max_height;\n }\n\n $this->_do_crop($width, $height, $offset_x, $offset_y);\n\n return $this;\n }", "function cropImage($CurWidth,$CurHeight,$iSize,$DestFolder,$SrcImage,$Quality,$ImageType)\r\n{\t \r\n\t//Check Image size is not 0\r\n\tif($CurWidth <= 0 || $CurHeight <= 0) \r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//abeautifulsite.net has excellent article about \"Cropping an Image to Make Square\"\r\n\t//http://www.abeautifulsite.net/blog/2009/08/cropping-an-image-to-make-square-thumbnails-in-php/\r\n\tif($CurWidth>$CurHeight)\r\n\t{\r\n\t\t$y_offset = 0;\r\n\t\t$x_offset = ($CurWidth - $CurHeight) / 2;\r\n\t\t$square_size \t= $CurWidth - ($x_offset * 2);\r\n\t}else{\r\n\t\t$x_offset = 0;\r\n\t\t$y_offset = ($CurHeight - $CurWidth) / 2;\r\n\t\t$square_size = $CurHeight - ($y_offset * 2);\r\n\t}\r\n\t\r\n\t$NewCanves \t= imagecreatetruecolor($iSize, $iSize);\t\r\n\tif(imagecopyresampled($NewCanves, $SrcImage,0, 0, $x_offset, $y_offset, $iSize, $iSize, $square_size, $square_size))\r\n\t{\r\n\t\tswitch(strtolower($ImageType))\r\n\t\t{\r\n\t\t\tcase 'image/png':\r\n\t\t\t\timagepng($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'image/gif':\r\n\t\t\t\timagegif($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\t\t\t\r\n\t\t\tcase 'image/jpeg':\r\n\t\t\tcase 'image/pjpeg':\r\n\t\t\t\timagejpeg($NewCanves,$DestFolder,$Quality);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t//Destroy image, frees memory\t\r\n\tif(is_resource($NewCanves)) {imagedestroy($NewCanves);} \r\n\treturn true;\r\n\r\n\t}\r\n\t \r\n}", "public function getCroppedImage($image, $w, $h, $x=false, $y=false) {\n\t\t$source = $image->getSource();\n\t\tif ($source->type != 'Local') {\n\t\t\t// ignore crop for remote sources at the moment\n\t\t\treturn $image->url;\n\t\t}\n\n\t\t$sourcePath = $source->settings['path'];\n\t\t$folderPath = $image->getFolder()->path;\n\n\t\t$imagePath = $sourcePath . $folderPath . $image->filename;\n\n\t\tif (!file_exists($imagePath)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlist($imgW, $imgH) = getimagesize($imagePath);\n\n\t\tif ($w == $imgW && $h == $imgH) {\n\t\t\treturn $image->url;\n\t\t}\n\n\t\t$x = false;\n\t\t$y = false;\n\n\t\tif (isset($image->focalPoint)) {\n\t\t\tif (isset($image->focalPoint['x'])) {\n\t\t\t\t$x = $image->focalPoint['x'];\n\t\t\t}\n\t\t\tif (isset($image->focalPoint['y'])) {\n\t\t\t\t$y = $image->focalPoint['y'];\n\t\t\t}\t\t\t\n\t\t}\n\n\t\tif ($x === false) {\n\t\t\t$x = round($imgW / 2);\n\t\t}\n\t\tif ($y === false) {\n\t\t\t$y = round($imgH / 2);\n\t\t}\t\t\n\n\t\t$wOut = $w;\n\t\t$hOut = $h;\n\n\t\t$imgRatio = $imgW / $imgH;\n\t\t$cropRatio = $w / $h;\n\n\t\tif ($w > $h && $imgRatio < $cropRatio) { // crop as portrait\n\t\t\t$cropScale = $imgW / $w;\n\n\t\t\t$w *= $cropScale;\n\t\t\t$h *= $cropScale;\n\n\t\t\t$cropX = 0;\n\t\t\t$cropY = $y - $h/2;\n\n\t\t\t// focus point bounds checking\n\t\t\tif ($cropY < 0) {\n\t\t\t\t$cropY = 0;\n\t\t\t}\n\t\t\tif ($cropY + $h > $imgH) {\n\t\t\t\t$cropY = $imgH - $h;\n\t\t\t}\n\t\t}\n\t\telse { // crop as landscape\n\t\t\t$cropScale = $imgH / $h;\n\n\t\t\t$w *= $cropScale;\n\t\t\t$h *= $cropScale;\n\n\t\t\t$cropY = 0;\n\t\t\t$cropX = $x - $w/2;\n\n\t\t\t// focus point bounds checking\n\t\t\tif ($cropX < 0) {\n\t\t\t\t$cropX = 0;\n\t\t\t}\n\t\t\tif ($cropX + $w > $imgW) {\n\t\t\t\t$cropX = $imgW - $w;\n\t\t\t}\n\t\t}\n\t\treturn $this->cropImage($imagePath, $cropX, $cropY, $w, $h, $wOut, $hOut);\t\n\t}", "public function crop($width, $height)\n\t{\n\t\t// Resize to minimum size\n\t\t$wScale = $this->width / $width; // 4\n\t\t$hScale = $this->height / $height; // 3\n\t\t$minScale = min($wScale, $hScale);\n\t\t// Decrease image dimensions\n\t\tif($minScale > 1)\n\t\t{\n\t\t\t$widthResize = $this->width / $minScale;\n\t\t\t$heightResize = $this->height / $minScale;\n\t\t}\n\t\t// Increase image dimensions\n\t\telse\n\t\t{\n\t\t\t$widthResize = $this->width / $minScale;\n\t\t\t$heightResize = $this->height / $minScale;\n\t\t}\n\t\t$image = imagecreatetruecolor($width, $height);\n\t\t$x = ($widthResize - $width) / 2;\n\t\t$y = ($heightResize - $height) / 2;\n\t\timagecopyresampled($image, $this->image, 0, 0, $x, $y, $width, $height, $widthResize, $heightResize);\n\n\t\t$this->image = $image;\n\t\t$this->width = $width;\n\t\t$this->height = $height;\n\t}", "public function setCrop($x, $y)\n\t{\n\t\tif ($x === null || $y === null)\n\t\t{\n\t\t\t$this->cropX = $x;\n\t\t\t$this->cropY = $y;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->cropX = intval($x);\n\t\t\t$this->cropY = intval($y);\n\t\t}\n\t}", "public function ieditor_crop ($sImagePath){\n\n\t\t\tclearstatcache();\n\t\t\t$iSelectionLeft = intval(getRequest('x1')) ? intval(getRequest('x1')) : 0;\n\t\t\t$iSelectionTop = intval(getRequest('y1')) ? intval(getRequest('y1')) : 0;\n\t\t\t$iSelectionWidth = intval(getRequest('width'));\n\t\t\t$iSelectionHeight = intval(getRequest('height'));\n\t\t\t$iScale = floatval(getRequest('scale')) ? floatval(getRequest('scale')) : 1;\n\n\t\t\tif ($iScale < 1) {\n\t\t\t\t$iSelectionLeft = round($iSelectionLeft / $iScale);\n\t\t\t\t$iSelectionTop = round($iSelectionTop / $iScale);\n\t\t\t\t$iSelectionWidth = round($iSelectionWidth / $iScale);\n\t\t\t\t$iSelectionHeight = round($iSelectionHeight / $iScale);\n\t\t\t}\n\n\t\t\t$sNewOriginalImagePath = $this->generateOriginalImagePath(pathinfo($sImagePath), array($iSelectionWidth, $iSelectionHeight, $iSelectionLeft, $iSelectionTop));\n\n\t\t\t$arOriginalImages = $this->findOriginalImages($sImagePath);\n\n\t\t\tif (empty($arOriginalImages)) {\n\t\t\t\t$bCopyResult = @copy($sImagePath, $sNewOriginalImagePath);\n\t\t\t\tif (!$bCopyResult || !file_exists($sNewOriginalImagePath)) {\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$bRenameResult = @rename($arOriginalImages[0], $sNewOriginalImagePath);\n\t\t\t\tif (!$bRenameResult || !file_exists($sNewOriginalImagePath)) {\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$sTmpImagePath = $this->getIeditorImagesPath(true) . '/__ieditor_tmp';\n\t\t\tif (file_exists($sTmpImagePath)) {\n\t\t\t\t@unlink($sTmpImagePath);\n\t\t\t}\n\n\t\t\t@copy($sNewOriginalImagePath, $sTmpImagePath);\n\t\t\tif (!file_exists($sTmpImagePath)) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * UMIRU CUSTOM - START\n\t\t\t */\n\t\t\ttry {\n\t\t\t\t$oImagemagic = $this->getImageMagic();\n\t\t\t\tif (!$oImagemagic->crop($sNewOriginalImagePath, $iSelectionLeft, $iSelectionWidth, $iSelectionTop, $iSelectionHeight)) {\n\t\t\t\t\tthrow new Exception('Failed to crop image by ImageMagic');\n\t\t\t\t}\n\t\t\t} catch (Exception $e) {\n\t\t\t/**\n\t\t\t * UMIRU CUSTOM - END\n\t\t\t */\n\n\t\t\t$oImage = new umiImageFile($sNewOriginalImagePath);\n\t\t\ttry {\n\t\t\t\t$oImage->crop($iSelectionLeft, $iSelectionWidth, $iSelectionTop, $iSelectionHeight);\n\t\t\t} catch (coreException $e) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * UMIRU CUSTOM - START\n\t\t\t */\n\t\t\t}\n\t\t\t/**\n\t\t\t * UMIRU CUSTOM - END\n\t\t\t */\n\n\t\t\t@unlink($sImagePath);\n\t\t\t@copy($sNewOriginalImagePath, $sImagePath);\n\t\t\t@unlink($sNewOriginalImagePath);\n\t\t\t@rename($sTmpImagePath, $sNewOriginalImagePath);\n\n\t\t\treturn str_replace(CURRENT_WORKING_DIR, '', $sImagePath);\n\n\t\t}", "public static function crop($image = NULL, $coordinateX = NULL, $coordinateY = NULL, $width = NULL, $height = NULL)\n\t{\n\n\t\tif (!($image instanceof Default_Model_MediaImage)) {\n\t\t\tthrow new Default_Model_MediaImage_Exception('Image needs to be an instance of Default_Model_MediaImage.');\n\t\t}\n\n\t\tif ($coordinateX &&\n\t\t\t!is_int($coordinateX)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Coordinate X needs to be an integer, if specified.');\n\t\t}\n\n\t\tif ($coordinateY &&\n\t\t\t!is_int($coordinateY)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Coordinate Y needs to be an integer, if specified.');\n\t\t}\n\n\t\tif ($width &&\n\t\t\t!is_int($width)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Width needs to be an integer, if specified.');\n\t\t}\n\n\t\tif ($height &&\n\t\t\t!is_int($height)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Height needs to be an integer, if specified.');\n\t\t}\n\n\t\t$cropedImage = Default_Service_MediaImage::fromMediaImage($image);\n\t\t$cropedImage->width = 0;\n\t\t$cropedImage->height = 0;\n\t\t$cropedImage->file_size = 0;\n\t\t$cropedImage->role_id = $image->role_id;\n\t\tif (isset($image['entity_id'])) {\n\t\t\t$cropedImage->entity_id = $image->entity_id;\n\t\t} else\n\t\tif (Zend_Auth::getInstance()->hasIdentity()) {\n\t\t\t$cropedImage->entity_id = Zend_Auth::getInstance()->getIdentity()->id;\n\t\t}\n\t\t$cropedImage->short = Default_Service_Media::getShort($image->short, $cropedImage->width, $cropedImage->height, $cropedImage->file_size);\n\t\t$cropedImage->save();\n\n\n\t\t/**\n\t\t * imageinstance file does not exist yet and needs to be created\n\t\t */\n\t\tif (!file_exists($cropedImage->getStoredFilePath())) {\n\n\t\t\t/**\n\t\t\t * use Imagick for croping the image ?\n\t\t\t */\n\t\t\tif (Zend_Registry::get('Imagick')) {\n\n\t\t\t\t/**\n\t\t\t\t * Imagick\n\t\t\t\t */\n\t\t\t\t$imagickError = NULL;\n\t\t\t\ttry {\n\t\t\t\t\t$imagickObj = new Imagick($image->getStoredFilePath());\n\t\t\t\t\t$imagickCropResult = $imagickObj->cropImage($width, $height, $coordinateX, $coordinateY);\n\t\t\t\t\tif ($imagickCropResult) {\n\t\t\t\t\t\t$imagickObj->writeimage($cropedImage->getStoredFilePath());\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * retrieve image infos\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$cropedImage->file_size = $imagickObj->getImageLength();\n\t\t\t\t\t\t$imagickDimensions = $imagickObj->getImageGeometry();\n\t\t\t\t\t\t$cropedImage->width = $imagickDimensions['width'];\n\t\t\t\t\t\t$cropedImage->height = $imagickDimensions['height'];\n\t\t\t\t\t\t$cropedImage->short = Default_Service_Media::getShort($image->short, $cropedImage->width, $cropedImage->height, $cropedImage->file_size);\n\t\t\t\t\t\t$cropedImage->save();\n\t\t\t\t\t}\n\t\t\t\t} catch (ImagickException $imagickError) {\n\n\t\t\t\t}\n\n\t\t\t\tif ($imagickError ||\n\t\t\t\t\t!$imagickCropResult) {\n\n\t\t\t\t\t$cropedImage->hardDelete();\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t$imageFile = L8M_Image::fromFile($image->getStoredFilePath());\n\n\t\t\t\tif ($imageFile instanceof L8M_Image_Abstract) {\n\n\t\t\t\t\t$imageFile\n\t\t\t\t\t\t->crop($coordinateX, $coordinateY, $width, $height)\n\t\t\t\t\t\t->save($cropedImage->getStoredFilePath(), TRUE)\n\t\t\t\t\t;\n\n\t\t\t\t\t/**\n\t\t\t\t\t * retrieve image infos\n\t\t\t\t\t */\n\t\t\t\t\t$cropedImage->file_size = $imageFile->getFilesize();\n\t\t\t\t\t$cropedImage->width = $imageFile->getWidth();\n\t\t\t\t\t$cropedImage->height = $imageFile->getHeight();\n\t\t\t\t\t$cropedImage->short = Default_Service_Media::getShort($image->short, $cropedImage->width, $cropedImage->height, $cropedImage->file_size);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * save\n\t\t\t\t\t */\n\t\t\t\t\tif (!$imageFile->isErrorOccured()) {\n\t\t\t\t\t\t$cropedImage->save();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$cropedImage->hardDelete();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn $cropedImage;\n\t}", "function imagecropper($source_path, $max_width, $max_height, $bili) {\n $source_info = getimagesize($source_path); //获取原始图片信息\n $source_width = $source_info[0]; //获取原始图片的宽度\n $source_height = $source_info[1]; //获取原始图片的高度\n $source_mime = $source_info['mime']; //获取原始图片的文件类型\n\n //先计算出要裁剪后的图片尺寸是多大\n if($source_width<=$max_width) { //1、如果原始图片的宽,小于最大允许的宽\n $newwidth = $source_width;\n $newheight = $source_width*$bili;\n }elseif($source_height<=$max_height) {//2、如果原始图片的高,小于最大允许的高\n $newheight = $source_height;\n $newwidth = $newheight/$bili;\n }else {\n $b1 = $max_width/$source_width;\n $b2 = $max_height/$source_height;\n $b3 = $b1<$b2 ? $b1 : $b2;\n $newwidth = ceil($source_width*$b3);\n $newheight = ceil($source_height*$b3);\n }\n\n $target_width = $newwidth>$newheight ? $newwidth : $newheight;\n $target_height = $newwidth<$newheight ? $newwidth : $newheight;\n\n if($target_width*$bili>$target_height) {\n $target_width = $target_height/$bili;\n }\n if($target_height*$bili>$target_width) {\n $target_height = $target_width/$bili;\n }\n\n $source_ratio = $source_height / $source_width;\n $target_ratio = $target_height / $target_width;\n\n if ($source_ratio > $target_ratio) {\n $cropped_width = $source_width;\n $cropped_height = $source_width * $target_ratio;\n $source_x = 0;\n $source_y = ($source_height - $cropped_height) / 2;\n }elseif ($source_ratio < $target_ratio) {\n $cropped_width = $source_height / $target_ratio;\n $cropped_height = $source_height;\n $source_x = ($source_width - $cropped_width) / 2;\n $source_y = 0;\n }else {\n $cropped_width = $source_width;\n $cropped_height = $source_height;\n $source_x = 0;\n $source_y = 0;\n }\n\n switch ($source_mime) {\n case 'image/gif':\n $source_image = imagecreatefromgif($source_path);\n break;\n case 'image/jpeg':\n $source_image = imagecreatefromjpeg($source_path);\n break;\n case 'image/png':\n $source_image = imagecreatefrompng($source_path);\n break;\n default:\n return false;\n break;\n }\n\n $target_image = imagecreatetruecolor($target_width, $target_height);\n $cropped_image = imagecreatetruecolor($cropped_width, $cropped_height);\n\n // 裁剪\n imagecopy($cropped_image, $source_image, 0, 0, $source_x, $source_y, $cropped_width, $cropped_height);\n // 缩放\n imagecopyresampled($target_image, $cropped_image, 0, 0, 0, 0, $target_width, $target_height, $cropped_width, $cropped_height);\n\n imagejpeg($target_image,$source_path);\n imagedestroy($source_image);\n imagedestroy($target_image);\n imagedestroy($cropped_image);\n}", "public function crop($target_width, $target_height, $crop_X, $crop_Y, $crop_width, $crop_height, $save_to_file, $output_mimetype=NULL) {\n\t\t// create a blank image of the target dimensions\n\t\t$cropped_image = imagecreatetruecolor($target_width, $target_height);\n\t\t// resample the image to the cropped constraints\n\t\timagecopyresampled(\n\t\t\t\t$cropped_image,\n\t\t\t\t$this->source_image,\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t$crop_X,\n\t\t\t\t$crop_Y,\n\t\t\t\t$target_width,\n\t\t\t\t$target_height,\n\t\t\t\t$crop_width,\n\t\t\t\t$crop_height\n\t\t);\n\t\t// save the cropped image and create a new Image \n\t\t$output_image_mimetype = $output_mimetype ? $output_mimetype : $this->source_image_mimetype;\n\t\tImageLib::save($cropped_image, $save_to_file, $output_image_mimetype);\n\t\treturn new static($save_to_file);\n\t}", "public function ImgCropToFile(){\r\n $imgUrl = $_POST['imgUrl'];\r\n// original sizes\r\n $imgInitW = $_POST['imgInitW'];\r\n $imgInitH = $_POST['imgInitH'];\r\n// resized sizes\r\n $imgW = $_POST['imgW'];\r\n $imgH = $_POST['imgH'];\r\n// offsets\r\n $imgY1 = $_POST['imgY1'];\r\n $imgX1 = $_POST['imgX1'];\r\n// crop box\r\n $cropW = $_POST['cropW'];\r\n $cropH = $_POST['cropH'];\r\n// rotation angle\r\n $angle = $_POST['rotation'];\r\n\r\n $jpeg_quality = 100;\r\n\r\n $what = new \\Think\\Image();\r\n $name = './'.$this::getPath($imgUrl).$this::getFileName($imgUrl);\r\n $c_name = './'.$this::getPath($imgUrl).'c_'.$this::getFileName($imgUrl);\r\n $p_name = './'.$this::getPath($imgUrl).'p_'.$this::getFileName($imgUrl);\r\n $what ->open($name);\r\n $what ->thumb($imgW, $imgH)->save($c_name);\r\n $what ->open($c_name);\r\n $what ->crop(($cropW),($cropH),$imgX1,$imgY1)->save($p_name);\r\n unlink($c_name);\r\n unlink($name);\r\n\r\n $m = M('img_mapping');\r\n $data = array();\r\n $data['user'] = $_SESSION['current_user']['id'];\r\n $data['img'] = './'.$this::getPath($p_name).$this::getFileName($p_name);\r\n $m->data($data)->add();\r\n\r\n $response = Array(\r\n \"status\" => 'success',\r\n \"url\" => __ROOT__.'/'.$this::getPath($p_name).$this::getFileName($p_name)\r\n );\r\n print json_encode($response);\r\n }", "function imagetrim($im) {\n // imagecropauto() doesn't work reliably. For example, it doesn't crop SGRMTW2C.png.\n //$im2 = imagecropauto($im);\n\n $tbox = null;\n $w = imagesx($im);\n $h = imagesy($im);\n for ($x = $w; $x--; ) {\n for ($y = $h; $y--; ) {\n if (imagecolorat($im, $x, $y) >> 24 !== 127) {\n $tbox = combineRect([$x, $y, $x + 1, $y + 1], $tbox);\n }\n }\n }\n\n $im2 = imagecrop($im, ['x' => $tbox[0], 'y' => $tbox[1], 'width' => $tbox[2] - $tbox[0], 'height' => $tbox[3] - $tbox[1]]);\n imagedestroy($im);\n return $im2;\n}", "public static function crop()\n {\n return new CropMode(CropMode::CROP);\n }", "private function intern_resize_crop($newWidth, $newHeight)\n\t{\n\t\t/*\n\t\t * Crop-to-fit PHP-GD\n\t\t * http://salman-w.blogspot.com/2009/04/crop-to-fit-image-using-aspphp.html\n\t\t *\n\t\t * Resize and center crop an arbitrary size image to fixed width and height\n\t\t * e.g. convert a large portrait/landscape image to a small square thumbnail\n\t\t *\n\t\t * Modified by Fry\n\t\t */\n\t\t$desired_aspect_ratio = $newWidth / $newHeight;\n\n\t\tif ($this->srcAspectRatio > $desired_aspect_ratio) {\n\t\t\t/*\n\t\t\t * Triggered when source image is wider\n\t\t\t */\n\t\t\t$temp_height = $newHeight;\n\t\t\t$temp_width = ( int ) ($newHeight * $this->srcAspectRatio);\n\t\t} else {\n\t\t\t/*\n\t\t\t * Triggered otherwise (i.e. source image is similar or taller)\n\t\t\t */\n\t\t\t$temp_width = $newWidth;\n\t\t\t$temp_height = ( int ) ($newWidth / $this->srcAspectRatio);\n\t\t}\n\n\t\t/*\n\t\t * Resize the image into a temporary GD image\n\t\t */\n\n\t\t$tempImage = imagecreatetruecolor($temp_width, $temp_height);\n\t\timagecopyresampled(\n\t\t\t$tempImage,\t\t\t\t\t$this->srcImage,\n\t\t\t0, 0,\t\t\t0, 0,\n\t\t\t$temp_width, $temp_height,\t$this->srcWidth, $this->srcHeight\n\t\t);\n\n\t\t/*\n\t\t * Copy cropped region from temporary image into the desired GD image\n\t\t */\n\n\t\t$x0 = ($temp_width - $newWidth) / 2;\n\t\t$y0 = ($temp_height - $newHeight) / 2;\n\t\t$this->newImage = imagecreatetruecolor($newWidth, $newHeight);\n\t\timagecopy(\n\t\t\t$this->newImage,\t$tempImage,\n\t\t\t0, 0,\t$x0, $y0,\n\t\t\t$newWidth, $newHeight\n\t\t);\n\t\timagedestroy($tempImage);\n\t}", "function centerImage($image, $xmin, $ymin, $width, $height){\n\t// this will center an image within the specified values, \n\t// at maximum size to fill the area.\n\t$sizing = getimagesize($image); // 0 is width, 1 is height\n\t\t\n\t\tif($sizing[0] > $sizing[1]){\n\t\t\t// wider than taller.\n\t\t\t$xoffset = $xmin;\n\t\t\t\n\t\t\t$setwidth = $width;\n\t\t\t$setheight = round($width/$sizing[0]*$sizing[1]);\n\t\t\t\n\t\t\t$yoffset = floor(($height - $setheight) / 2) + $ymin;\n\t\t\t\n\t\t\tif($setheight > $height){\n\t\t\t\t// image is too large for contraints. re-adjust for width. \n\t\t\t\t$yoffset = $ymin;\n\t\t\t\n\t\t\t\t$setheight = $height;\n\t\t\t\t$setwidth = round($height/$sizing[1]*$sizing[0]);\n\t\t\t\t\n\t\t\t\t$xoffset = floor(($width - $setwidth) / 2) + $xmin;\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t// taller than wider\n\t\t\t$yoffset = $ymin;\n\t\t\t\n\t\t\t$setheight = $height;\n\t\t\t$setwidth = round($height/$sizing[1]*$sizing[0]);\n\t\t\t\n\t\t\t$xoffset = floor(($width - $setwidth) / 2) + $xmin;\n\t\t\t\n\t\t\tif($setwidth > $width){\n\t\t\t\t$xoffset = $xmin;\n\t\t\t\n\t\t\t\t$setwidth = $width;\n\t\t\t\t$setheight = round($width/$sizing[0]*$sizing[1]);\n\t\t\t\t\n\t\t\t\t$yoffset = floor(($height - $setheight) / 2) + $ymin;\n\t\t\t}\n\t\t}\n\t\treturn array(\n\t\t\t'x' => $xoffset,\n\t\t\t'y' => $yoffset,\n\t\t\t'w' => $setwidth,\n\t\t\t'h' => $setheight);\n}", "public static function resizeCoverCentered(Task $task) {\r\n $task->params = self::parseDimensions($task->params);\r\n if ($task->params == false) {\r\n return false;\r\n }\r\n $task->image->resize($task->params[0], $task->params[1], 'outside')\r\n ->crop('center', 'center', $task->params[0], $task->params[1])\r\n ->saveToFile($task->destFile);\r\n }", "function cropImage($CurWidth, $CurHeight, $iSize, $DestFolder, $SrcImage, $Quality, $ImageType) { \n\t//Check Image size is not 0\n\tif($CurWidth <= 0 || $CurHeight <= 0) \n\t{\n\t\treturn false;\n\t}\n\t\n\t//abeautifulsite.net has excellent article about \"Cropping an Image to Make Square bit.ly/1gTwXW9\n\tif($CurWidth>$CurHeight)\n\t{\n\t\t$y_offset = 0;\n\t\t$x_offset = ($CurWidth - $CurHeight) / 2;\n\t\t$square_size \t= $CurWidth - ($x_offset * 2);\n\t}else{\n\t\t$x_offset = 0;\n\t\t$y_offset = ($CurHeight - $CurWidth) / 2;\n\t\t$square_size = $CurHeight - ($y_offset * 2);\n\t}\n\t\n\t$NewCanvas \t= imagecreatetruecolor($iSize, $iSize);\t\n\t\n\tif(strtolower($ImageType) == 'image/png') {\n\t\t// Saves Alpha\n\t\timagealphablending($NewCanvas, false);\n\t\timagesavealpha($NewCanvas,true);\n\t\t$transparent = imagecolorallocatealpha($NewCanvas, 255, 255, 255, 127);\n\t\timagefilledrectangle($NewCanvas, 0, 0, $square_size, $square_size, $transparent);\n\t}\n\t\n\tif(imagecopyresampled($NewCanvas, $SrcImage, 0, 0, $x_offset, $y_offset, $iSize, $iSize, $square_size, $square_size))\n\t{\n\t\tswitch(strtolower($ImageType))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\timagepng($NewCanvas,$DestFolder);\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($NewCanvas,$DestFolder);\n\t\t\t\tbreak;\t\t\t\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/pjpeg':\n\t\t\t\timagejpeg($NewCanvas,$DestFolder,$Quality);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//Destroy image, frees memory\t\n\t\tif(is_resource($NewCanvas)) {imagedestroy($NewCanvas);} \n\t\treturn true;\n\t} \n}", "function makeIcons_MergeCenter($src, $dst, $dstx, $dsty) {\n // $dst = destination image location\n // $dstx = user defined width of image\n // $dsty = user defined height of image\n $allowedExtensions = 'jpg jpeg gif png';\n\n $name = explode(\".\", $src);\n $currentExtensions = $name[count($name) - 1];\n $extensions = explode(\" \", $allowedExtensions);\n\n for ($i = 0; count($extensions) > $i; $i = $i + 1) {\n if ($extensions[$i] == $currentExtensions) {\n $extensionOK = 1;\n $fileExtension = $extensions[$i];\n break;\n }\n }\n\n if ($extensionOK) {\n $size = getImageSize($src);\n $width = $size[0];\n $height = $size[1];\n\n if ($width >= $dstx AND $height >= $dsty) {\n $proportion_X = $width / $dstx;\n $proportion_Y = $height / $dsty;\n\n if ($proportion_X > $proportion_Y) {\n $proportion = $proportion_Y;\n } else {\n $proportion = $proportion_X;\n }\n $target['width'] = $dstx * $proportion;\n $target['height'] = $dsty * $proportion;\n\n $original['diagonal_center'] =\n round(sqrt(($width * $width) + ($height * $height)) / 2);\n $target['diagonal_center'] =\n round(sqrt(($target['width'] * $target['width']) +\n ($target['height'] * $target['height'])) / 2);\n\n $crop = round($original['diagonal_center'] - $target['diagonal_center']);\n\n if ($proportion_X < $proportion_Y) {\n $target['x'] = 0;\n $target['y'] = round((($height / 2) * $crop) / $target['diagonal_center']);\n } else {\n $target['x'] = round((($width / 2) * $crop) / $target['diagonal_center']);\n $target['y'] = 0;\n }\n\n if ($fileExtension == \"jpg\" OR $fileExtension == 'jpeg') {\n $from = ImageCreateFromJpeg($src);\n } elseif ($fileExtension == \"gif\") {\n $from = ImageCreateFromGIF($src);\n } elseif ($fileExtension == 'png') {\n $from = imageCreateFromPNG($src);\n }\n\n $new = ImageCreateTrueColor($dstx, $dsty);\n\n imagecopyresampled($new, $from, 0, 0, $target['x'], $target['y'], $dstx, $dsty, $target['width'], $target['height']);\n\n if ($fileExtension == \"jpg\" OR $fileExtension == 'jpeg') {\n imagejpeg($new, $dst, 70);\n } elseif ($fileExtension == \"gif\") {\n imagegif($new, $dst);\n } elseif ($fileExtension == 'png') {\n imagepng($new, $dst);\n }\n }\n }\n}", "function cropImage($CurWidth, $CurHeight, $iSize, $DestFolder, $SrcImage, $Quality, $ImageType)\n{\t \n\t//Check Image size is not 0\n\tif($CurWidth <= 0 || $CurHeight <= 0) \n\t{\n\t\treturn false;\n\t}\n\t//abeautifulsite.net has excellent article about \"Cropping an Image to Make Square\"\n\t//http://www.abeautifulsite.net/blog/2009/08/cropping-an-image-to-make-square-thumbnails-in-php/\n\tif($CurWidth>$CurHeight)\n\t{\n\t\t$y_offset = 0;\n\t\t$x_offset = ($CurWidth - $CurHeight) / 2;\n\t\t$square_size \t= $CurWidth - ($x_offset * 2);\n\t}\n\telse\n\t{\n\t\t$x_offset = 0;\n\t\t$y_offset = ($CurHeight - $CurWidth) / 2;\n\t\t$square_size = $CurHeight - ($y_offset * 2);\n\t}\n\t\n\t$NewCanves \t= imagecreatetruecolor($iSize, $iSize);\t\n\tif(imagecopyresampled($NewCanves, $SrcImage, 0, 0, $x_offset, $y_offset, $iSize, $iSize, $square_size, $square_size))\n\t{\n\t\tswitch(strtolower($ImageType))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\timagepng($NewCanves, $DestFolder);\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($NewCanves, $DestFolder);\n\t\t\t\tbreak;\t\t\t\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/pjpeg':\n\t\t\t\timagejpeg($NewCanves, $DestFolder, $Quality);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\tif(is_resource($NewCanves))\n\t\t{ \n\t\t\timagedestroy($NewCanves); \n\t } \n\t\treturn true;\n\t}\n}", "public function cropImage($width, $height , $target) {\r\n // load an image\r\n $i = new Imagick($this->src);\r\n // get the current image dimensions\r\n $geo = $i -> getImageGeometry();\r\n\r\n // crop the image\r\n if (($geo['width'] / $width) < ($geo['height'] / $height)) {\r\n $i -> cropImage($geo['width'], floor($height * $geo['width'] / $width), 0, (($geo['height'] - ($height * $geo['width'] / $width)) / 2));\r\n } else {\r\n $i -> cropImage(ceil($width * $geo['height'] / $height), $geo['height'], (($geo['width'] - ($width * $geo['height'] / $height)) / 2), 0);\r\n }\r\n\r\n // save or show or whatever the image\r\n $i -> setImageFormat(\"jpeg\");\r\n $i -> writeImage($target);\r\n\r\n\r\n $wrapper2 = new ImagickWrapper($target);\r\n $wrapper2 -> generateThumbnail($target,$width.\"x\".$height);\r\n }", "public function getTinyCropImage()\n {\n return $this->getFilterImage(TinyCrop::identifier());\n }", "public static function CROP()\n {\n return new ThumbnailAspectMode(self::CROP);\n }", "public function apply() {\n\t\t$w = $this->getWidth();\n\t\t$h = $this->getHeight();\n\n\t\timagecopyresampled($this->original->getImage(), $this->getImage(), $this->x, $this->y, 0, 0, $w, $h, $w, $h);\n\t}", "function cropImage($nw, $nh, $source,$newfileName,$case='top') {\n\t\t$thumb_croped = false;\n\t\t\n\t\t$size = getimagesize($this->path.$source);\n\t\t$w = $size[0];\n\t\t$h = $size[1];\n\t\t\n\t\t$extension = strtolower($this->getExtension($source,false)); // false - tells to get \"jpg\" NOT \".jpg\" GOT IT :P\n\t\t\n\t\tswitch($extension) {\n\t\t\tcase 'gif':\n\t\t\t$simg = imagecreatefromgif($this->path.$source);\n\t\t\tbreak;\n\t\t\tcase 'jpg':\n\t\t\t$simg = imagecreatefromjpeg($this->path.$source);\n\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t$simg = imagecreatefrompng($this->path.$source);\n\t\t\tbreak;\n\t\t}\n\t\t\n\n\t\t$dimg = imagecreatetruecolor($nw, $nh);\n\t\t$wm = $w/$nw;\n\t\t$hm = $h/$nh;\n\t\t$h_height = $nh/2;\n\t\t$w_height = $nw/2;\n\t\tif($w> $h) {\n\t\t\t$adjusted_width = $w / $hm;\n\t\t\t$half_width = $adjusted_width / 2;\n\t\t\t$int_width = $half_width - $w_height;\n\t\t\timagecopyresampled($dimg,$simg,-$int_width,0,0,0,$adjusted_width,$nh,$w,$h);\n\t\t} elseif(($w <$h) || ($w == $h)) {\n\t\t\t$adjusted_height = $h / $wm;\n\t\t\t$half_height = $adjusted_height / 2;\n\t\t\t$int_height = $half_height - $h_height;\n\t\t\timagecopyresampled($dimg,$simg,0,-$int_height,0,0,$nw,$adjusted_height,$w,$h);\n\t\t} else {\n\t\t\timagecopyresampled($dimg,$simg,0,0,0,0,$nw,$nh,$w,$h);\n\t\t}\n\t\t\n\t\tif($extension==\"jpg\" ){\n\t\t\timagejpeg($dimg,$this->path.$newfileName,100);\n\t\t\t$thumb_croped = true;\n\t\t}elseif($extension==\"gif\" ){\n\t\t\timagegif($dimg,$this->path.$newfileName,100);\n\t\t\t$thumb_croped = true;\n\t\t}elseif($extension==\"png\" ){\n\t\t\timagepng($dimg,$this->path.$newfileName,100);\n\t\t\t$thumb_croped = true;\n\t\t}\n\t\t\n\t\treturn $thumb_croped;\n\t\t\n\t\t//imagejpeg($dimg,$dest,100);\n\t}", "function smarty_function_get_image_src_resized_and_cropped_to($params, &$smarty)\n{\n\tif(empty($params['filename']) || empty($params['width']) || empty($params['height']))\n\t\treturn false;\n\t\n\t$image_path_and_filename = IMAGE_UPLOADS_DIR . '/' . $params['filename'];\n\t\n\tif(!file_exists($image_path_and_filename))\n\t{\n\t\t//Use the default image instead\n\t\t$image = model::create('image');\n\t\t$image->find(DEFAULT_IMAGE_ID);\n\t\t\n\t\t$image_path_and_filename = IMAGE_UPLOADS_DIR . '/' . $image->filename;\n\t}\n\telse\t\n\t\tmodel::include_model('image');\n\t\n\tlist($current_image_width, $current_image_height) = getimagesize($image_path_and_filename);\n\n\t$filename_split_by_dot = explode('.',$params['filename']);\n\t$file_extension = array_pop($filename_split_by_dot);\n\t$filename_without_extension = implode('.',$filename_split_by_dot);\n\n\t$cached_image_filename = \t$filename_without_extension . \n\t\t\t\t\t\t\t\t'-' . \n\t\t\t\t\t\t\t\t$params['width'] . \n\t\t\t\t\t\t\t\t'x' . \n\t\t\t\t\t\t\t\t$params['height'] . \n\t\t\t\t\t\t\t\t'.' . $file_extension;\n\t\t\t\t\t\t\t\t\t\t\t\n\t$cached_image_path_and_filename = \tIMAGE_CACHE_DIR . '/' . $cached_image_filename;\n\t\n\t\n\tif(!file_exists($cached_image_path_and_filename))\n\t{\t\n\t\t$resized_image_resource = image::resize_image_and_crop($params['width'], $params['height'], $image_path_and_filename);\n\t\n\t\timage::save_image_resource_to_file($resized_image_resource, $cached_image_path_and_filename);\n\t}\n\t\n\t$image_cache_path = substr(IMAGE_CACHE_DIR,strlen(PUBLIC_DIR));\n\t\n\t$cached_image_url = config::get('current_location') . $image_cache_path . '/' . $cached_image_filename;\n\n\treturn $cached_image_url;\n}", "public function refitCropCoords($coords,$targetAspect)\n {\n $ocoords = $coords;\n\n if(!isset($coords['w']) || !$coords['w'])\n {\n $coords['w'] = $coords['x2']-$coords['x'];\n }\n if(!isset($coords['h']) || !$coords['h'])\n {\n $coords['h'] = $coords['y2']-$coords['y']; \n }\n\n $originalAspect = $oA = $coords['w']/$coords['h'];\n $tA = $targetAspect;\n\n if($tA< $coords['w']/$coords['h'])\n {\n //widen\n $origW = $coords['w'];\n $coords['w'] = $coords['w']*($tA/$oA);//anaW\n $coords['x'] = $coords['x']-($coords['w'] - $origW)/2;\n $coords['x2']= $coords['x']+$coords['w'];\n }\n else\n {\n //heighten\n $origH = $coords['h'];\n $coords['h'] = $coords['h']/($tA/$oA);//anaH\n $coords['y'] = $coords['y']-($coords['h'] - $origH)/2;\n $coords['y2'] = $coords['y']+$coords['h'];\n }\n\n return $coords;\n }", "public function testSmartCrop() {\n\t\t$image = $this->getSampleImage();\n\t\t$this->assertTrue( !empty($image->ID) && $image->exists() );\n\n\t\t$original_url = $image->getAbsoluteURL();\n\n\t\t$width = self::WIDTH;\n\t\t$height = 0;\n\t\t$thumb = $image->Smart(true)->ScaleWidth( $width );\n\n\t\t// Get its URL\n\t\t$url = $thumb->getAbsoluteURL();\n\n\t\t// should end with this command/path\n\t\t$this->assertStringEndsWith(\"=/{$width}x{$height}/smart/{$original_url}\", $url);\n\n\t}", "public function crop(){\n return $this->zajlib->json(['status'=>'ok']);\n }", "public function actionSaveCroppedImage() {\n\n if ($_REQUEST['output_filename'] == '') {\n $output_filename = \"media/croppic/croppedimg/croppedImg_\" . time();\n } else {\n $output_filename = $_REQUEST['output_filename'] . time();\n }\n $output_filename2 = Yii::app()->request->baseUrl . '/' . $output_filename;\n\n $imgUrl = Yii::app()->basePath.'/..'.str_replace(Yii::app()->request->baseUrl,'',$_POST['imgUrl']);\n $imgInitW = $_POST['imgInitW'];\n $imgInitH = $_POST['imgInitH'];\n $imgW = $_POST['imgW'];\n $imgH = $_POST['imgH'];\n $imgY1 = $_POST['imgY1'];\n $imgX1 = $_POST['imgX1'];\n $cropW = $_POST['cropW'];\n $cropH = $_POST['cropH'];\n\n $jpeg_quality = 100;\n\n $what = getimagesize($imgUrl);\n \n switch (strtolower($what['mime'])) {\n case 'image/png':\n $img_r = imagecreatefrompng($imgUrl);\n $source_image = imagecreatefrompng($imgUrl);\n $type = '.png';\n break;\n case 'image/jpeg':\n $img_r = imagecreatefromjpeg($imgUrl);\n $source_image = imagecreatefromjpeg($imgUrl);\n $type = '.jpeg';\n break;\n case 'image/gif':\n $img_r = imagecreatefromgif($imgUrl);\n $source_image = imagecreatefromgif($imgUrl);\n $type = '.gif';\n break;\n default: die('image type not supported');\n }\n\n $resizedImage = imagecreatetruecolor($imgW, $imgH);\n imagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $imgW, $imgH, $imgInitW, $imgInitH);\n\n\n $dest_image = imagecreatetruecolor($cropW, $cropH);\n imagecopyresampled($dest_image, $resizedImage, 0, 0, $imgX1, $imgY1, $cropW, $cropH, $cropW, $cropH);\n\n\n imagejpeg($dest_image, $output_filename . $type, $jpeg_quality);\n\n $response = array(\n \"status\" => 'success',\n \"url\" => $output_filename2 . $type\n );\n print json_encode($response);\n }", "public function photo() {\n\t\t$this->layout = null;\n\t\t$uploadPath = Configure::read(\"App.UPLOAD_PATH\");\n\t\t$thumbnailPath = Configure::read(\"App.PROFILE_IMG_PATH\");\n\t\t$uploadUrl = Configure::read(\"App.UPLOAD_PATH_URL\");\n\t\t$webFolder = $thumbnailPath;\n\t\t$tempUrl = FULL_BASE_URL . \"/uploads/tmp/\";\n\t\t$webUrl = FULL_BASE_URL . \"/uploads/user_profile\";\n\t\t/*\n\t\t * Do the image Cropping\n\t\t */\n\t\tif (isset($this->request->data['crop_image'])) {\n\n\n\t\t\t$uploadedImage = $this->request->data['cropfileName'];\n\n\t\t\ttry {\n\n\t\t\t\t$options = array('thumbnail' => array(\n\t\t\t\t\t\t\"max_width\" => $this->minimumImageSize[0],\n\t\t\t\t\t\t\"max_height\" => $this->minimumImageSize[1],\n\t\t\t\t\t\t\"path\" => $thumbnailPath\n\t\t\t\t\t),\n\t\t\t\t\t'max_width' => 700\n\t\t\t\t);\n\t\t\t\t$x1 = $_POST[\"x1\"];\n\t\t\t\t$y1 = $_POST[\"y1\"];\n\t\t\t\t$width = $_POST[\"w\"];\n\t\t\t\t$height = $_POST[\"h\"];\n\t\t\t\t$fileName = $_POST['cropfileName'];\n\t\t\t\t$imageUrl = $tempUrl . $_POST['cropfileName'];\n\n\t\t\t\t$photoPath = $uploadPath . DIRECTORY_SEPARATOR . $uploadedImage;\n\n\t\t\t\tif ($width <= 0) {\n\t\t\t\t\t$width = $this->minimumImageSize[0];\n\t\t\t\t\t$x1 = 0;\n\t\t\t\t}\n\n\t\t\t\tif ($height <= 0) {\n\t\t\t\t\t$height = $this->minimumImageSize[1];\n\t\t\t\t\t$y1 = 0;\n\t\t\t\t}\n\n\t\t\t\tif ($width > 0 && $height > 0) {\n\t\t\t\t\t$status = ImageTool::crop(array(\n\t\t\t\t\t\t\t\t'input' => $photoPath,\n\t\t\t\t\t\t\t\t'output' => $photoPath,\n\t\t\t\t\t\t\t\t'width' => $width,\n\t\t\t\t\t\t\t\t'height' => $height,\n\t\t\t\t\t\t\t\t'output_width' => $this->minimumImageSize[0],\n\t\t\t\t\t\t\t\t'output_height' => $this->minimumImageSize[1],\n\t\t\t\t\t\t\t\t'top' => $y1,\n\t\t\t\t\t\t\t\t'left' => $x1,\n\t\t\t\t\t));\n\n\t\t\t\t\t$result['success'] = true;\n\t\t\t\t\t$result['fileUrl'] = $tempUrl . \"\" . $uploadedImage;\n\t\t\t\t\t$result['fileName'] = $uploadedImage;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Exception(\"Image Not cropped\");\n\t\t\t\t}\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$result['success'] = false;\n\t\t\t\t$result['message'] = $e->getMessage();\n\t\t\t}\n\n\t\t\t$result = htmlspecialchars(json_encode($result), ENT_NOQUOTES);\n\t\t\techo $result;\n\t\t} else {\n\t\t\t/*\n\t\t\t * Functionality to upload the image to a temporary folder\n\t\t\t */\n\t\t\t$uploader = new $this->Uploader();\n\t\t\t//$webFolder\n\n\t\t\t$uploader->allowedExtensions = array(\"jpg\", \"jpeg\", \"png\", \"gif\"); // all files types allowed by default\n\t\t\t// Specify max file size in bytes.\n\t\t\t$uploader->sizeLimit = 5 * 1024 * 1024; // default is 5 MiB\n\n\t\t\t$uploader->minImageSize = array('200', '200');\n\n\t\t\t// Specify the input name set in the javascript.\n\t\t\t$uploader->inputName = \"qqfile\"; // matches Fine Uploader's default inputName value by default\n\t\t\t// If you want to use the chunking/resume feature, specify the folder to temporarily save parts.\n\t\t\t$uploader->chunksFolder = \"chunks\";\n\n\t\t\t$method = $_SERVER[\"REQUEST_METHOD\"];\n\t\t\tif ($method == \"POST\") {\n\t\t\t\theader(\"Content-Type: text/plain\");\n\n\t\t\t\t// Call handleUpload() with the name of the folder, relative to PHP's getcwd()\n\t\t\t\t$result = $uploader->handleUpload($uploadPath);\n\n\t\t\t\tif (isset($result['success'])) {\n\t\t\t\t\t$result['file_name'] = $uploader->getUploadName();\n\n\t\t\t\t\t$photoPath = $uploadPath . DIRECTORY_SEPARATOR . $result['file_name'];\n\t\t\t\t\t$status = ImageTool::resize(array(\n\t\t\t\t\t\t\t\t'quality' => 90,\n\t\t\t\t\t\t\t\t'enlarge' => false,\n\t\t\t\t\t\t\t\t'keepRatio' => true,\n\t\t\t\t\t\t\t\t'paddings' => false,\n\t\t\t\t\t\t\t\t'crop' => false,\n\t\t\t\t\t\t\t\t'input' => $photoPath,\n\t\t\t\t\t\t\t\t'output' => $photoPath,\n\t\t\t\t\t\t\t\t'width' => '520',\n\t\t\t\t\t\t\t\t'height' => '220'\n\t\t\t\t\t));\n\n\t\t\t\t\t// image dimension\n\t\t\t\t\tlist($imageWidth, $imageHeight) = getimagesize($photoPath);\n\n\t\t\t\t\t$result['imageWidth'] = $imageWidth;\n\t\t\t\t\t$result['imageHeight'] = $imageHeight;\n\t\t\t\t\t$result['fileName'] = $result['file_name'];\n\t\t\t\t\t$result['fileurl'] = $tempUrl . DIRECTORY_SEPARATOR . $result['file_name'];\n\t\t\t\t}\n\n\t\t\t\techo json_encode($result);\n\t\t\t} else {\n\t\t\t\theader(\"HTTP/1.0 405 Method Not Allowed\");\n\t\t\t}\n\t\t}\n\n\t\texit;\n\t}", "public function cropImage($width, $height, $x, $y)\n {\n if ($this->resource->getNumberImages() > 0) {\n $frames = $this->resource->coalesceImages();\n foreach ($frames as $frame) {\n $frame->setImageBackgroundColor('none');\n $frame->cropImage($width, $height, $x, $y);\n $frame->thumbnailImage($width, $height);\n $frame->setImagePage($width, $height, 0, 0);\n }\n $this->resource = $frames->deconstructImages();\n $this->resource->resizeImage($width, $height, $this->imageFilter, $this->imageBlur);\n } else {\n $this->resource->cropImage($width, $height, $x, $y);\n }\n\n return $this;\n }", "public function whitespaceCropperAction()\n {\n $image = __DIR__ . '/../../../data/media/test_whitespace.jpg';\n $cropper = $this->thumbnailer->createWhitespaceCropper(0, 0x000000);\n $thumb = $this->thumbnailer->create($image, [], [$cropper]);\n\n $thumb\n ->resize(200, 200)\n ->show()\n ->save('public/resized_test.jpg');\n\n return false;\n }", "public function setCropX( $cropX )\n {\n $this->_daImage->setCropX( $this->getId(), $cropX );\n }", "public static function crop($img_name, $x, $y, $type = 'fit')\n {\n $full_path = storage_path('app/public/'.$img_name);\n $full_thumb_path = storage_path('app/public/thumbs/'.$img_name);\n $thumb = Image::make($full_path);\n\n if ($type == 'fit')\n self::fit($thumb, $x, $y, $full_thumb_path);\n else\n self::resize($thumb, $x, $y, $full_thumb_path);\n }", "public function getCroppedImageSrcByFile(FileInterface $file, $ratio)\n {\n $absoluteImageName = GeneralUtility::getFileAbsFileName($file->getPublicUrl());\n $focusPointX = MathUtility::forceIntegerInRange((int)$file->getProperty('focus_point_x'), -100, 100, 0);\n $focusPointY = MathUtility::forceIntegerInRange((int)$file->getProperty('focus_point_y'), -100, 100, 0);\n\n $tempImageFolder = 'typo3temp/focuscrop/';\n $tempImageName = $tempImageFolder . $file->getSha1() . '-' . str_replace(':', '-',\n $ratio) . '-' . $focusPointX . '-' . $focusPointY . '.' . $file->getExtension();\n $absoluteTempImageName = GeneralUtility::getFileAbsFileName($tempImageName);\n if (is_file($absoluteTempImageName)) {\n return $tempImageName;\n }\n\n $absoluteTempImageFolder = GeneralUtility::getFileAbsFileName($tempImageFolder);\n if (!is_dir($absoluteTempImageFolder)) {\n GeneralUtility::mkdir_deep($absoluteTempImageFolder);\n }\n\n $this->graphicalFunctions = GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Core\\\\Imaging\\\\GraphicalFunctions');\n\n $imageSizeInformation = getimagesize($absoluteImageName);\n $width = $imageSizeInformation[0];\n $height = $imageSizeInformation[1];\n\n // dimensions\n /** @var \\HDNET\\Focuspoint\\Service\\DimensionService $service */\n $dimensionService = GeneralUtility::makeInstance('HDNET\\\\Focuspoint\\\\Service\\\\DimensionService');\n list($focusWidth, $focusHeight) = $dimensionService->getFocusWidthAndHeight($width, $height, $ratio);\n $cropMode = $dimensionService->getCropMode($width, $height, $ratio);\n list($sourceX, $sourceY) = $dimensionService->calculateSourcePosition($cropMode, $width, $height, $focusWidth,\n $focusHeight, $focusPointX, $focusPointY);\n\n // generate image\n $sourceImage = $this->graphicalFunctions->imageCreateFromFile($absoluteImageName);\n $destinationImage = imagecreatetruecolor($focusWidth, $focusHeight);\n $this->graphicalFunctions->imagecopyresized($destinationImage, $sourceImage, 0, 0, $sourceX, $sourceY, $focusWidth,\n $focusHeight, $focusWidth, $focusHeight);\n $this->graphicalFunctions->ImageWrite($destinationImage, $absoluteTempImageName,\n $GLOBALS['TYPO3_CONF_VARS']['GFX']['jpg_quality']);\n return $tempImageName;\n }", "public function cropImage($width, $height, $x, $y) {\n return $this->im->cropImage($width, $height, $x, $y);\n }", "public function actionCropTemp()\n {\n $error = \"\";\n $msg = \"\";\n if(!empty($_FILES['crop_image']['error']))\n {\n switch($_FILES['crop_image']['error'])\n {\n\n case '1':\n $error = 'The uploaded file exceeds the upload_max_filesize directive in php.ini';\n break;\n case '2':\n $error = 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form';\n break;\n case '3':\n $error = 'The uploaded file was only partially uploaded';\n break;\n case '4':\n $error = 'No file was uploaded.';\n break;\n case '6':\n $error = 'Missing a temporary folder';\n break;\n case '7':\n $error = 'Failed to write file to disk';\n break;\n case '8':\n $error = 'File upload stopped by extension';\n break;\n case '999':\n default:\n $error = 'No error code available';\n }\n }elseif(empty($_FILES['crop_image']['tmp_name']) || $_FILES['crop_image']['tmp_name'] == 'none')\n {\n $error = 'No file was uploaded..';\n }else\n { \n if($_FILES['crop_image']['type']===\"image/jpeg\" || $_FILES['crop_image']['type']===\"image/gif\" || $_FILES['crop_image']['type']===\"image/png\" )\n {\n $newName = preg_replace('/[\\s\\/%*:|\"<>?]+/', '_', $_FILES['crop_image']['name']);\n $uploadRoot = Yii::getPathOfAlias('webroot').DIRECTORY_SEPARATOR.'upload';\n if(!is_dir($uploadRoot))\n {\n mkdir($uploadRoot);\n }\n\n $uploadDirectory = Yii::getPathOfAlias('webroot').DIRECTORY_SEPARATOR.'upload'.DIRECTORY_SEPARATOR.'tempCrop';\n if(!is_dir($uploadDirectory))\n {\n mkdir($uploadDirectory);\n }\n $uploadDirectory .= DIRECTORY_SEPARATOR;\n $tempName=$newName;\n $i=1;\n while(file_exists($uploadDirectory.$newName))\n {\n $newName = $i.\"_\".$tempName;\n $i++;\n }\n $uploadResult = move_uploaded_file($_FILES['crop_image']['tmp_name'], $uploadDirectory.$newName);\n if($uploadResult)\n $msg.= Yii::app()->baseUrl.'/upload/tempCrop/'.$newName;\n else\n $msg.= '1';\n\n @unlink($_FILES['crop_image']);//for security reason, we force to remove all uploaded file\n }\n else\n {\n @unlink($_FILES['crop_image']);\n $msg .= '1';\n }\n }\n echo json_encode(array(\"error\"=>$error,\"msg\"=>$msg));\n }", "function resize_crop_image($max_width, $max_height, $source_file, $dst_dir, $quality=80){\r\n $imgsize = getimagesize($source_file);\r\n $width = $imgsize[0];\r\n $height = $imgsize[1];\r\n $mime = $imgsize['mime'];\r\n\r\n switch($mime){\r\n case 'image/gif':\r\n $image_create = \"imagecreatefromgif\";\r\n $image = \"imagegif\";\r\n break;\r\n\r\n case 'image/png':\r\n $image_create = \"imagecreatefrompng\";\r\n $image = \"imagepng\";\r\n //$quality = 7;\r\n break;\r\n\r\n case 'image/jpeg':\r\n $image_create = \"imagecreatefromjpeg\";\r\n $image = \"imagejpeg\";\r\n break;\r\n\r\n default:\r\n return false;\r\n break;\r\n }\r\n\r\n $dst_img = imagecreatetruecolor($max_width, $max_height);\r\n $src_img = $image_create($source_file);\r\n\r\n $width_new = $height * $max_width / $max_height;\r\n $height_new = $width * $max_height / $max_width;\r\n //if the new width is greater than the actual width of the image, then the height is too large and the rest cut off, or vice versa\r\n if($width_new > $width){\r\n //cut point by height\r\n $h_point = (($height - $height_new) / 2);\r\n //copy image\r\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, $h_point, $max_width, $max_height, $width, $height_new);\r\n }else{\r\n //cut point by width\r\n $w_point = (($width - $width_new) / 2);\r\n imagecopyresampled($dst_img, $src_img, 0, 0, $w_point, 0, $max_width, $max_height, $width_new, $height);\r\n }\r\n\r\n //$image($dst_img, $dst_dir, $quality);\r\n imagejpeg($dst_img, $dst_dir, $quality);\r\n\r\n if($dst_img)imagedestroy($dst_img);\r\n if($src_img)imagedestroy($src_img);\r\n}", "public function centerImage($targetWidth, $targetHeight)\n {\n $position = $this->getCenteredImagePostion($targetWidth, $targetHeight);\n\n // Do nothing if the top left of the image in the canvas is x = 0, y = 0\n if ($position->x == 0 && $position->y == 0) {\n return;\n }\n\n $image = $this->createNewTransparentImage($targetWidth, $targetHeight);\n\n imagecopyresampled(\n $image,\n $this->image,\n $position->x,\n $position->y,\n 0,\n 0,\n $this->width,\n $this->height,\n $this->width,\n $this->height\n );\n\n imagedestroy($this->image);\n $this->image = $image;\n }", "function cropImageRpc() {\n $result = '';\n // we need the surfer id to save the file owner\n if (!$this->loadSurferData()) {\n return sprintf(\n '<error>%s</error>'.LF,\n papaya_strings::escapeHTMLChars($this->_gt('Surfer not found.'))\n );\n }\n if ($file = $this->getFile($this->params['file_id'])) {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_thumbnail.php');\n $thumbnail = new base_thumbnail;\n // otherwise the filename would have an extension, which the temp filename hasn't\n $thumbnail->forceExtension = FALSE;\n $tempFileName = tempnam(PAPAYA_PATH_CACHE, '.mdb_crop');\n $srcFileName = $this->getFileName($file['file_id'], $file['current_version_id']);\n $orgType = $this->mimeToInteger($file['mimetype']);\n $cropped = $thumbnail->imageCrop(\n $srcFileName,\n $tempFileName,\n $orgType,\n $this->params['width'],\n $this->params['height'],\n $this->params['x'],\n $this->params['y']\n );\n if ($cropped) {\n // set the extension of the file to the current thumbnail type extension\n $newFileName = $file['file_name'];\n if ($thumbnail->getThumbFileExt() != $this->getFileExtension($newFileName)) {\n if ($pos = strrpos($newFileName, '.')) {\n $newFileName = substr($newFileName, 0, $pos) .'.'. $thumbnail->getThumbFileExt();\n }\n }\n $newFileId = $this->addFile($tempFileName, $newFileName, -1, $this->surfer['surfer_id']);\n if ($newFileId) {\n $linked = $this->addDerivation(\n $newFileId, $this->params['file_id'], $file['current_version_id']\n );\n if (!$linked) {\n $result .= sprintf(\n '<error>%s</error>',\n papaya_strings::escapeHTMLChars($this->_gt('Derivation could not be created.'))\n );\n }\n $result .= sprintf(\n '<message>%s</message>',\n papaya_strings::escapeHTMLChars($this->_gt('Image cropped.'))\n );\n } else {\n $result .= sprintf(\n '<error>%s</error>',\n papaya_strings::escapeHTMLChars($this->_gt('Could not save file.'))\n );\n }\n }\n } else {\n $result .= sprintf(\n '<error>%s</error>',\n papaya_strings::escapeHTMLChars($this->_gt('File not found.'))\n );\n }\n return $result;\n }", "function crop_image_square($source, $destination, $image_type, $square_size, $image_width, $image_height, $quality){\n if($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n if($image_width > $image_height)\n {\n $y_offset = 0;\n $x_offset = ($image_width - $image_height) / 2;\n $s_size \t= $image_width - ($x_offset * 2);\n }else{\n $x_offset = 0;\n $y_offset = ($image_height - $image_width) / 2;\n $s_size = $image_height - ($y_offset * 2);\n }\n $new_canvas\t= imagecreatetruecolor( $square_size, $square_size); //Create a new true color image\n\n //Copy and resize part of an image with resampling\n if(imagecopyresampled($new_canvas, $source, 0, 0, $x_offset, $y_offset, $square_size, $square_size, $s_size, $s_size)){\n save_image($new_canvas, $destination, $image_type, $quality);\n }\n\n return true;\n}", "public static function crop($image, $width, $height, array $start = [0, 0])\n {\n if (!isset($start[0], $start[1])) {\n throw new InvalidParamException('$start must be an array of two elements.');\n }\n\n return static::ensureImageInterfaceInstance($image)\n ->copy()\n ->crop(new Point($start[0], $start[1]), new Box($width, $height));\n }", "public function setCropBox($boundary, $checkBoundary = true) {}", "public function cropThumb($px, $offset = null)\n {\n $xOffset = 0;\n $yOffset = 0;\n\n if (null !== $offset) {\n if ($this->width > $this->height) {\n $xOffset = $offset;\n $yOffset = 0;\n } else if ($this->width < $this->height) {\n $xOffset = 0;\n $yOffset = $offset;\n }\n }\n\n $scale = ($this->width > $this->height) ? ($px / $this->height) : ($px / $this->width);\n\n $wid = round($this->width * $scale);\n $hgt = round($this->height * $scale);\n\n // Create a new image output resource.\n if (null !== $offset) {\n $this->resizeImage($wid, $hgt, $this->imageFilter, $this->imageBlur);\n $this->cropImage($px, $px, $xOffset, $yOffset);\n } else {\n $this->cropThumbnailImage($px, $px);\n }\n\n $this->width = $px;\n $this->height = $px;\n return $this;\n }", "public function crop(array $dimensions, array $coordinates) {\n// is there an image resource to work with?\n if (isset($this->_resource)) {\n// do the dimensions have and coordinates have the appropriate values to work with (checking the keys)? \n if (array_keys($dimensions) == array(\"width\", \"height\") && array_keys($coordinates) == array(\"x1\", \"x2\", \"y1\", \"y2\")) {\n $is_all_int = true;\n foreach (array_merge($dimensions, $coordinates) as $value) {\n if (is_int($value) == false) {\n $is_all_int = false;\n }\n }\n if ($is_all_int == true) {\n $width = $dimensions[\"width\"];\n $height = $dimensions[\"height\"];\n $x1 = $coordinates[\"x1\"];\n $x2 = $coordinates[\"x2\"];\n $y1 = $coordinates[\"y1\"];\n $y2 = $coordinates[\"y2\"];\n\n// generating the placeholder resource\n $cropped_image = $this->newImageResource($width, $height);\n\n// copying the original image's resource into the placeholder and cropping it accordingly\n imagecopyresampled($cropped_image, $this->_resource, 0, 0, $x1, $y1, $width, $height, ($x2 - $x1), ($y2 - $y1));\n\n// assigning the new image attributes\n $this->_resource = $cropped_image;\n $this->_width = $width;\n $this->_height = $height;\n } else {\n trigger_error(\"CAMEMISResizeImage::crop() was provided values that were not integers (check the dimensions or coordinates for strings or floats)\", E_USER_WARNING);\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::crop() was not provided the appropriate arguments (first given parameter must be an array and must contain \\\"width\\\" and \\\"height\\\" elements, and the second given parameter must be an array and contain \\\"x1\\\", \\\"x2\\\", \\\"y2\\\", and \\\"y2\\\" elements)\", E_USER_WARNING);\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::crop() attempting to access a non-existent resource (check if the image was loaded by CAMEMISResizeImage::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }", "function crop($inFile, $outFile, $top, $right, $bottom, $left) {\n if ($inFile == $outFile) {\n // cannot write to source file\n return FALSE;\n }\n $cmd = sprintf(\n '%s -i %s -sameq -croptop %d -cropright %d -cropbottom %d -cropleft %d %s',\n escapeshellcmd($this->encoder),\n escapeshellarg($inFile),\n escapeshellcmd($top),\n escapeshellcmd($right),\n escapeshellcmd($bottom),\n escapeshellcmd($left),\n escapeshellcmd($outFile)\n );\n $this->execCmd($cmd, $null, $info);\n // base_object::debug($cmd, $null, $info);\n }", "public function trimPixels($coords) {\n list($x1, $y1, $x2, $y2) = $coords;\n $this->thumb->crop($x1, $y1, $x2 - $x1, $y2 - $y1);\n return $this;\n }" ]
[ "0.69298387", "0.6836823", "0.6823078", "0.66575724", "0.6652952", "0.66306645", "0.6507793", "0.6440605", "0.639549", "0.6372605", "0.63682693", "0.6302628", "0.6299234", "0.6244354", "0.623321", "0.6232006", "0.62100184", "0.6194608", "0.6143459", "0.61158496", "0.6101551", "0.60791385", "0.6060343", "0.6032205", "0.5976267", "0.59496707", "0.59473324", "0.5903878", "0.5892042", "0.5880034", "0.58473563", "0.58358175", "0.583378", "0.5817041", "0.5809466", "0.57829803", "0.57685167", "0.5741255", "0.5723602", "0.57162434", "0.5702874", "0.5696675", "0.5664795", "0.564072", "0.56264603", "0.5611299", "0.5595213", "0.5562133", "0.5551346", "0.55355394", "0.5527706", "0.55216295", "0.55169046", "0.5516228", "0.5506413", "0.5506397", "0.5502891", "0.54910636", "0.5484976", "0.54693455", "0.54435366", "0.5442048", "0.5437576", "0.5406264", "0.5404873", "0.53950167", "0.5383836", "0.53783536", "0.53752506", "0.53699046", "0.5364993", "0.53430015", "0.5341081", "0.53295636", "0.5322141", "0.5318222", "0.5314448", "0.5314338", "0.5307127", "0.5306972", "0.53068256", "0.52984434", "0.52890825", "0.52614444", "0.5257542", "0.52548456", "0.5254011", "0.5250951", "0.52413934", "0.52412045", "0.5231218", "0.5220551", "0.5218312", "0.5216839", "0.52066976", "0.518702", "0.5177458", "0.51774514", "0.51659286", "0.5157557", "0.5157531" ]
0.0
-1
Function to get image(s) in folder "upload/image"
public function get($name = '', $mark = '', $wildcard = FALSE) { $img = array(); $wildcard_character = $wildcard ? '*.*' : ''; $search = ''; $search = ($mark != '') ? $search . $mark : '' ; $search = ($name == '') ? $search . $wildcard_character : $search . $name . $wildcard_character ; foreach(glob($this->upload_dir . $search) as $filename){ $img[] = $filename; } return $img; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_all_image_uploaded(){\n if($this->username && $this->id){\n if(file_exists($this->image_path . DS . $this->username)){\n $images = scandir($this->image_path . DS . $this->username);\n if(!empty($images)){\n $images = array_diff($images,array('.','..'));\n $allowed_ex = array(\"jpg\",\"jpeg\",\"png\"); \n foreach($images as $image){\n $exArr = explode('.',$image);\n $ex = end($exArr);\n $ex = strtolower($ex);\n if(!in_array($ex,$allowed_ex)){\n $images = array_diff($images,array($image));\n }\n }\n sort($images);\n return $images;\n }else{\n return false;\n }\n }\n }else{\n return false;\n }\n }", "public function getAllImages() {\n\t\t$returnArr = array();\n\n\t\tforeach (File::allFiles($this->imageFolder) as $file) {\n\t\t\t$fileName = $file->getRelativePathName();\n\n\t\t\t$returnArr[] = url() . '/uploads/images/'.$fileName;\n\t\t}\n\n\t\treturn $returnArr;\n\t}", "private function images()\n {\n return File::allFiles(public_path('img/gallery'));\n }", "function GetImages(){\n\t\t$this->MediaType = 'image/jpeg';\n\t\t$this->SetFileName();\n\t\treturn $this->get();\n\t}", "public function getImages($type=''){\n \n $imagetypes = array(\"image/png\",\"image/jpeg\", \"image/gif\");\n $dir = self::IMAGEPATH;\n\n // array to hold return value\n $retval = array();\n\n // add trailing slash if missing\n if(substr($dir, -1) != \"/\") $dir .= \"/\";\n\n // full server path to directory\n $fulldir = \"{$_SERVER['DOCUMENT_ROOT']}/$dir\";\n\n $d = @dir($fulldir) or die(\"getImages: Failed opening directory $dir for reading\");\n while(false !== ($entry = $d->read())) {\n // skip hidden files\n if($entry[0] == \".\") continue;\n\n \n // check for image files\n $f = escapeshellarg(\"$fulldir$entry\");\n \n \n \n if((!$type)||(strpos(' '.$entry, $type)))\n $retval[] = $entry;\n \n \n }\n $d->close();\n\n return $retval;\n }", "function getImages($hello) {\n\n\t$imagetypes = array(\"image/jpg\",\"image/jpeg\",\"image/png\");\n\t$dir = \"/assets/galleries/\".$hello.\"/images/\";\n\t$dir2 = \"/assets/galleries/\".$hello.\"/thumbs/\";\n\t$dir3 = \"/assets/galleries/\".$hello.\"/downloads/\";\n\n\t#array to hold return value\n\t$retval = array();\n\n\t#full server path to directory\n\t$fulldir = \"{$_SERVER['DOCUMENT_ROOT']}$dir2\"; \n\t$idir = \"{$_SERVER['DOCUMENT_ROOT']}$dir\"; \n\n\t$d = @dir($fulldir) or die(\"getImages: Failed opening directory $dir for reading\"); \n\twhile(false !== ($entry = $d->read())) { \n\t\t# skip hidden files \n\t\tif($entry[0] == \".\") continue; \n\n\t\t# check for image files \n\t\tif(in_array(mime_content_type(\"$fulldir$entry\"), $imagetypes)) { \n\t\t\t$retval[] = array( \"file\" => \"$dir$entry\", \n\t\t\t\"size\" => getimagesize(\"$fulldir$entry\"),\n\t\t\t\"name\" => \"$entry\",\n\t\t\t\"thumb\"=>\"$dir2$entry\",\n\t\t\t\"download\"=>\"$dir3$entry\",\n\t\t\t\"isize\" => getimagesize(\"$idir$entry\")\n\t\t\t); \n\t\t}\n\t}\n\t$d->close(); \n\treturn $retval;\n}", "final public function get_images() : array {\n Helper::load('files');\n\n return Files::get_files_in_dir($this->route);\n }", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "function getImages($dir)\n {\n global $imagetypes;\n\n // array to hold return value\n $retval = array();\n\n // add trailing slash if missing\n if(substr($dir, -1) != \"/\") $dir .= \"/\";\n\n \n \n \n // full server path to directory\n $fulldir = \"{$_SERVER['DOCUMENT_ROOT']}/$dir\";\n \n\n $d = @dir($fulldir) or die(\"getImages: Failed opening directory $dir for reading\");\n while(false !== ($entry = $d->read())) {\n // skip hidden files\n if($entry[0] == \".\") continue;\n\n // check for image files\n if(in_array(mime_content_type(\"$fulldir$entry\"), $imagetypes)) {\n $retval[] = array(\n \"file\" => \"/$dir$entry\",\n \"size\" => getimagesize(\"$fulldir$entry\")\n );\n }\n }\n $d->close();\n\n return $retval;\n }", "public function getImages(){\n $images =[];\n $files=[];\n $imageDir=opendir(IMAGES_DIR);\n while(false !==($file=readdir($imageDir))){\n // $imageDirから一行ずつ読み込んで,$fileに入れて行く そんでそれがfalseにならない限り回し続ける\n if($file === '.'||$file =='..'){\n // カレントディレクトリやルートディレクトリを飛ばして回す\n continue;\n }\n $files[]=$file;\n //thumnailは imagesdirに存在するのかな\n if(file_exists(THUMBNAIL_DIR.'/'.$file)){\n $images[]=basename(THUMBNAIL_DIR).'/'.$file;\n } else{\n $images[]=basename(IMAGES_DIR).'/'.$file;\n }\n }\n array_multisort($files,SORT_DESC,$images);\n // 逆向き順に$filesに入っているimagesをそr・せよ\n return $images;\n}", "function get_pages_images_list() {\n\t$files = scandir(BASEPATH . \"/../public/images/pages\");\n\tarray_shift($files); // remove \".\"\n\tarray_shift($files); // remove \"..\"\n\treturn $files;\n}", "public function actionGalleryImages() {\n\n // # Cache result forever\n $cached = Cache::rememberForever( 'actionGalleryImages', function () {\n\n // # Conatiner init\n $container = [];\n\n // # Directory iterator\n $iterator = new \\DirectoryIterator( \"./images/gallery/images\" );\n\n // # Loop through files and dir\n foreach( $iterator as $item ) {\n\n // # Avoid dirs\n if( is_dir( $item ) ) {\n continue;\n }\n\n // # Get pathname\n $path = ltrim( $item->getPathname(), \".\" );\n $tmp[ 'src' ] = $path;\n $tmp[ 'thumb' ] = $path;\n $container[] = $tmp;\n }\n\n // # toJson\n return json_encode($container);\n });\n\n return response()->make( $cached );\n\n }", "function getImageByFilename() {\n\t\tif($this->file_name == '') return ;\n\t\t\n\t\t$sql = \"SELECT * FROM \".$this->tableImages().\" WHERE path_image = '$this->file_name'\";\n\t\treturn $this->db->query($sql)->row_array();\n\t}", "function get_image_paths($base_url, $base_path)\n{\n $out = array();\n\n require_code('images');\n require_code('files');\n\n $handle = @opendir($base_path);\n if ($handle !== false) {\n while (false !== ($file = readdir($handle))) {\n if (!should_ignore_file($file, IGNORE_ACCESS_CONTROLLERS)) {\n $this_path = $base_path . $file;\n if (is_file($this_path)) {\n if (is_image($file)) {\n $this_url = cms_rawurlrecode($base_url . rawurlencode($file));\n $out[$this_path] = $this_url;\n }\n } elseif ((strlen($file) != 2) || (strtoupper($file) != $file)) {\n $out = array_merge($out, get_image_paths($base_url . $file . '/', $base_path . $file . '/'));\n }\n }\n }\n closedir($handle);\n }\n\n return $out;\n}", "public function getImgs(){\n \n if ( is_null($this->getId()) ){\n return null;\n }\n\n $d = APPLICATION_PATH . '/../storage/category_pictures/' . $this->getId().'/';\n\n $pics = array();\n\n $dir = opendir($d);\n\n while($file = readdir($dir)){\n if ( $file != \".\" && $file != \"..\" && $file != \".svn\" && $file != \".DS_Store\" ) {\n $pics[] = '/../storage/category_pictures/' . $this->getId() . '/' . $file;\n }\n }\n\n return $pics;\n }", "public function get_file_list() {\n\t\tset_time_limit( 0 );\n\n\t\t$this->image_dir = self::_add_trailing_slash( $this->image_dir );\n\n\t\tif ( is_dir( $this->image_dir ) ) {\n $result = array();\n\t\t\t$iterator = new \\RecursiveDirectoryIterator( $this->image_dir, \\FileSystemIterator::SKIP_DOTS );\n\t\t\t$iterator = new \\RecursiveIteratorIterator( $iterator );\n\t\t\t$iterator = new \\RegexIterator( $iterator, '/^.+\\.(jpe?g|png|gif|svg)$/i', \\RecursiveRegexIterator::MATCH );\n\n\t\t\tforeach ( $iterator as $info ) {\n\t\t\t if ( $info->isFile() ) {\n $result[] = $info->getPathname();\n }\n\t\t\t}\n\n\t\t\tunset( $iterator );\n\t\t} else {\n $result = false;\n }\n\n\t\treturn $result;\n\t}", "function getImages() {\n $bdd = getBdd();\n $users = $bdd->query('select IMG_PATH as path,'\n . ' USER_ID as user_id, REV_ID as rev_id'\n . ' from T_IMAGES')->fetchAll(PDO::FETCH_ASSOC);\n return $users;\n}", "public function getGalleryImages()\n {\n $user_id = Auth::user()->user_id;\n\n $images = Azure::getImageThumbnailFiles($user_id);\n $imageOrder = DB::table(\"users\")\n ->select(\"gallery_order\")\n ->where(\"user_id\", $user_id)\n ->first();\n\n return array(\"success\" => true, \"data\" => array(\n \"images\" => $images,\n \"order\" => $imageOrder->gallery_order\n ));\n }", "function GetImages() {\n //Select folder to scan\n $handle = opendir(\"Images/Tea\");\n\n //Read all files and store names in array\n while ($image = readdir($handle)) {\n $images[] = $image;\n }\n\n closedir($handle);\n\n //Exclude all filenames where filename length < 3\n $imageArray = array();\n foreach ($images as $image) {\n if (strlen($image) > 2) {\n array_push($imageArray, $image);\n }\n }\n\n //Create <select><option> Values and return result\n $result = $this->CreateOptionValues($imageArray);\n return $result;\n }", "public function getImages()\n\t\t{\n\t\t\t$this->createDir();\n\t\t\t//sacamos la lista de ficheros de la carpeta photos\n\t\t\t$files = $this->getFileList();\n\t\t\t//array de salida\n\t\t\t$image_List = array();\n\t\t\t\n\t\t\t//recorremos el contenido de esa carpeta\n\t\t\tforeach($files as $file)\n\t\t\t{\n\t\t\t\t//tiene que ser jpg, gif o png para que muestre las imagenes y que no sea . o ..\n\t\t\t\tif($file!=\".\" && $file!=\"..\" && $this->validatePhoto($file))\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t//guardo en el array la lista de imagenes\n\t\t\t\t\tarray_push($image_List, $file);\n\t\t\t\t\t\n\t\t\t\t\t//miro si existe la imagen en el thumbs si no lo creo\n\t\t\t\t\tif(!$this->checkIfFileExistes($file))\n\t\t\t\t\t{\n\t\t\t\t\t\t//como NO existe la minituara la creamos\n\t\t\t\t\t\t$this->createThumb(\"$file\");\n\t\t\t\t\t}\n\t\t\t\t\t//mostramos la miniatura y al hacer clic mostramos original \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\techo \"<a href='\".$this->ruta.\"/$file' target='_blank' ><img src='\".$this->rutaMini.\"/$file'/></a>\";\t\n\t\t\t\t}\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "function upload_image() {\n $image = array();\n for ($i = 0; $i <= count($_FILES['image']['name']); $i++) {\n if (@$_FILES['image']['size'][$i] > 0) {\n $dir = '../images/album_images';\n $filename[$i] = $_FILES['image']['name'][$i];\n $srcfile[$i] = $_FILES['image']['tmp_name'][$i];\n $targetfile[$i] = $dir . '/' . $filename[$i];\n move_uploaded_file($srcfile[$i], $targetfile[$i]);\n $image[] = $filename[$i];\n }\n }\n return $image;\n }", "public function get_images()\r\n\t\t{\r\n\t\t\t$images = $this->obj->result;\r\n\t\t\treturn $images;\r\n\t\t}", "public function actionCarouselImages() {\n\n // # Cache result forever\n $cached = Cache::rememberForever( 'actionCarouselImages', function () {\n\n // # Conatiner init\n $container = [];\n\n // # Directory iterator\n $iterator = new \\DirectoryIterator( \"./images/carousel\" );\n\n // # Loop through files and dir\n foreach( $iterator as $item ) {\n\n // # Avoid dirs\n if( is_dir( $item ) ) {\n continue;\n }\n\n // # Get pathname\n $path = ltrim( $item->getPathname(), \".\" );\n $tmp[ 'src' ] = $path;\n $tmp[ 'thumb' ] = $path;\n $container[] = $tmp;\n }\n\n // # toJson\n return json_encode($container);\n });\n\n return response()->make( $cached );\n\n }", "public function browse_files()\n {\n // Scan file directory, render the images.\n if (is_dir($this->file_path)) {\n $files = preg_grep('/^([^.])/', scandir($this->file_path));\n return $files;\n }\n \n }", "public function listDirectoryPicturesAndApplyId() \n {\n if (is_dir($this->picturesFolder)){\n $this->files = scandir($this->picturesFolder);\n } else {\n echo 'No image directory';\n }\n \n $values = array();\n foreach ($this->files as $key => $var) {\n if (($var === '.') || ($var === '..') || (substr($var, -4, 1) !== '.')) {\n unset($this->files[$key]);\n } else {\n $id = $this->generateRandomKey();\n $values[] = array(\n 'id' => $id, \n 'picture' => $this->files[$key], \n 'qrcode' => $id . '-qrcode' . $this->outputFileExtension\n ); \n }\n }\n $this->files = $values;\n return (array) $this->files;\n }", "function getAllImages() {\n global $pdo;\n $statement = $pdo->prepare('SELECT `sid`, `mime_type`, `name`, `comment` from `file` WHERE `mime_type` LIKE \\'image/%\\' AND NOT comment = \\'Uploaded via Contact Form\\'');\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n}", "static function getList()\n {\n $out = array();\n\n if ($dh = opendir(__DIR__ . '/../img/')) {\n while (($file = readdir($dh)) !== false) {\n if (substr($file, -4) === '.jpg') {\n $filename = substr($file, 0, -4);\n $out[$filename] = realpath(__DIR__ . '/../img/' . $file);\n }\n }\n\n closedir($dh);\n }\n\n return $out;\n }", "private function parse_images($category) {\n\t\t$image_list = array();\n\t\t$relpath = \"images/$category\";\n\n\t\tforeach (glob($this->root . \"/$relpath/*\") as $image) {\n\t\t\tif (preg_match(self::IMAGE_FILTER, $image)) {\n\t\t\t\t// We got a valid image, now lets make it into a relative path.\n\t\t\t\tpreg_match(\"/(projects\\/\" . $this->id .\"\\/images.+)/\", $image, $matches);\n\t\t\t\tarray_push($image_list, $matches[1]);\n\t\t\t}\n\t\t}\n\n\t\treturn $image_list;\n\t}", "function getImages($dir) {\n\n\t $retval = array();\n\n\t # add trailing slash if missing\n\n\t if(substr($dir, -1) != \"/\") $dir .= \"/\";\n\n\t # full server path to directory\n\n\t $fulldir = \"{$_SERVER['DOCUMENT_ROOT']}$dir\";\n\t if (file_exists($fulldir)) {\n\t $d = @dir($fulldir) or die(\"getImages: Failed opening directory $dir for reading\");\n\t while(false !== ($entry = $d->read())) {\n\n\t # skip hidden files\n\n\t if($entry[0] == \".\") continue;\n\n\t # check for image files\n\n\t if(substr(\"$fulldir$entry\", -11, 5) == \"image\") {\n\t $retval[] = array( \"file\" => \"$dir$entry\", \"size\" => getimagesize(\"$fulldir$entry\") );\n\n\t }\n\n\t }\n\n\t $d->close();\n\n\t }\n\n\t return $retval;\n\n\t }", "function getImageFiles() {\n $path = dirname(__FILE__) . \"/img\";\n $images = array();\n $folder = opendir($path);\n while (false !== ($filename = readdir($folder))) {\n if ($filename != \"ajax-loader.gif\") {\n $parts = serendipity_parseFileName($filename);\n $img_data = serendipity_getimagesize($path . '/' . $filename);\n if (!isset($img_data['noimage'])) {\n // Curly braces are just a different syntax of associative array assignment\n $images[$filename] = array('fname'=>$filename, 'width'=>$img_data[0], 'height'=>$img_data[1]);\n }\n }\n }\n closedir($folder);\n ksort($images);\n return $images;\n }", "public function getImages()\n {\n $res=array();\n $this->objTable = new Model($this->getLangAndID['lang'].'_slide_image');\n $select = array('id','title','description','slide_id','src_link','order_by','avatar');\n $this->objTable->where('slide_id',$this->id);\n $this->objTable->where('idw',$this->idw);\n $data = $this->objTable->get(null,null,$select);\n \n return $data; \n }", "function getImages($dir) {\n $directory = 'webcam';\n //realpath($dir);\n $allFiles = scandir($dir);\n $files = array_diff($allFiles, array('.', '..'));\n foreach ($files as $f) {\n chmod($dir . '/' . $f, 0644); // uploaded images are set to 0640 and can't be read on a page. Must set CHMOD to 644\n }\n\n $ignored = array('.', '..'); // ignore this\n\n $files = array();\n foreach (scandir($dir) as $file) {\n if (in_array($file, $ignored)) continue;\n $files[$file] = fileatime($dir . '/' . $file);\n }\n\n $files = array_keys($files); // sort images\n $files = array_reverse($files);\n\n foreach ($files as $k => $file) {\n if ($k > 99) { // delete old images, leave 100 freshest on server\n unlink($dir . '/' . $file);\n }\n }\n\n return ($files[0]) ? $files[0] : false; // return freshest image\n}", "public function getImages()\n {\n\t\t//TODO Image 2. What should our query builder do?\n\t\t// $data = ImageModel::???();\n\t\t$data = [];\n\t\treturn $this->sendResponse($data);\n }", "function getImagesInFolder(string $folder = null)\n{\n $supported_formats = array(\n 'gif',\n 'jpg',\n 'jpeg',\n 'png'\n );\n try {\n return getFilenamesInFolder($folder, $supported_formats);\n } catch (Exception $e) {\n throw $e;\n }\n}", "function albums_get_images($album) {\n\t$files = read_dir_contents(ALBUMS_DIR.'/'.$album, 'files');\n\tif (!$files)\n\t\treturn FALSE;\n\n\telseif ($files) {\n\t\tnatcasesort($files);\n\t\tforeach ($files as $file) {\n\t\t\t$parts = explode('.', $file);\n\t\t\tif (count($parts) == 4) {\n\t\t\t\tlist($number, $fdirname, $ext, $php) = $parts;\n\t\t\t\tinclude_once (ALBUMS_DIR.'/'.$album.'/'.$file);\n\t\t\t\t$images[] = array(\n\t\t\t\t\t'title' => $name,\n\t\t\t\t\t'info' => $info,\n\t\t\t\t\t'seoname' => $fdirname,\n\t\t\t\t\t'filename' => $file,\n\t\t\t\t\t'filename_image' => $fdirname.'.'.$ext\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tunset($file);\n\n\t\treturn $images;\n\t}\n}", "function get_image() {\n $sql = \"SELECT * FROM photos\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "public function firstParty()\n {\n $images = [];\n\n foreach ((new Finder())->in($this->path)->directories()->sortByName() as $directory) {\n /* @var $directory \\Symfony\\Component\\Finder\\SplFileInfo */\n $images[] = new Image($this->getImageName($directory, $this->name), $directory->getRealPath());\n }\n\n return $images;\n }", "function get_uploaded_header_images()\n {\n }", "public function getImagesFromBatch() {\n\t\t$images = array();\n\t\t$images = icms_core_Filesystem::getFileList(ALBUM_UPLOAD_ROOT.'batch/', '', array('gif', 'jpg', 'png'));\n\t\t$ret = array();\n\t\tforeach(array_keys($images) as $i ) {\n\t\t\t$ret[$i] = $images[$i];\n\t\t}\n\t\treturn $ret;\n\t}", "public function get() {\n $images = Storage::disk('public')->files('assets');\n // Sort naturally (e.g. so 1.png is followed by 2.png not 10.png)\n sort($images, SORT_NATURAL);\n \n return response()->json(['images' => $images]);\n }", "function liste_images($dossier_images) // le dossier des images de l'article\n{\n\t$dossier = opendir($dossier_images);\n\t\n\t$images = array();\n\t\n\twhile (false !== ($image = readdir($dossier)) AND !in_array($image, array('0.jpg', '.', '..'))) { //toutes les images sans la principale de bandeau\n\t\t$images[] = $image;\n\t}\n\t\n\treturn $images;\n}", "public function getImage();", "public function getImage();", "public function getImage();", "public function getImage();", "public function get_image()\n {\n // cache?\n if ($this->folder_image !== null) return $this->folder_image;\n\n $this->folder_image = false;\n $dir = $this->path;\n\n // simply pick the first image inside this folder\n // search subdirectories if first directory have no images\n while ($dir !== false)\n {\n $dh = self::get_dh($dir);\n $ds = false;\n\n // search folder\n while (($file = readdir($dh)) !== false)\n {\n if ($file == \".\" || $file == \"..\") continue;\n $p = $dir . \"/\" . $file;\n\n if (is_file($p) && image::is_image_type($p))\n {\n $f = new file($p);\n $this->folder_image = $f->image;\n closedir($dh);\n break 2;\n }\n\n elseif (is_dir($p) && $ds === false) {\n $ds = $p;\n }\n }\n\n closedir($dh);\n $dir = $ds;\n }\n\n return $this->folder_image;\n }", "function get_user_images($user_id) {\n $images = DAO_user::DAO_fetch_user_images($user_id);\n if (is_array($images)) {\n $i = 0;\n $result = array();\n foreach ($images as $image) {\n $result[$i++] = $image;\n }\n return $result;\n }\n else return -1;\n }", "function getUserPhotos ($dir, $userName = '') {\r\n $filesArray = getFilesFromDir($dir);\r\n $outputPhotoBook = '';\r\n foreach ($filesArray as $fileName) {\r\n $outputPhotoBook .= '<div><img src=\"img/' . $userName . '/' . $fileName. '\"></div>';\r\n }\r\n return $outputPhotoBook;\r\n}", "function get_mediaImages()\n\t\t{\n\t\t\t$query = $this -> db -> get('MediaSlider');\n\n\n\t\t\treturn $query->result();\n\t\t}", "public function imagesManager()\n\t{\n\t\t$images = array();\n\n\t\t// Grab all images in the directory\n\t\t$files = File::allFiles(public_path() . '/uploads');\n\n\t\tforeach ($files as $file) {\n\t\t\t// Ignore thumbnail image\n\t\t\tif (!strpos($file, 'thumb_')) {\n\t\t\t\t// Get the image extension\n\t\t\t\t$ext = '.' . pathinfo($file, PATHINFO_EXTENSION);\n\t\t\t\t// Get the directory path for the image\n\t\t\t\t$path = explode( \"/\", substr($file,strpos($file,\"/uploads\")));\n\t\t\t\t// Remove file name to get only directory name\n\t\t\t\tarray_pop($path);\n\n\t\t\t\t$image_path = implode(\"/\", $path);\n\n\t\t\t\t$images[] = array(\"thumb\" => $image_path .'/thumb_' . basename($file), \"image\" => $image_path .'/' . basename($file), \"title\" => basename($file, $ext), \"link\" => $image_path .'/' . basename($file));\n\t\t\t}\n\t\t}\n\n\t\treturn Response::json($images);\n\t}", "public function getImages()\n {\n $url = str_replace(\"[:action]\", \"images\", self::ImgUrAPI_MINE_URL);\n $url = str_replace(\"[:user_id]\", $this->user_id, $url);\n $result = self::excuteHTTPSRequest($url, $this->accessToken);\n\n $_images = '';\n foreach ($result['data'] as $item) {\n $_img = new ImgUrImage();\n $_img->setAttributes($item);\n $_images[] = $_img;\n }\n\n return $_images;\n }", "public function imagesAction()\n {\n $logedUser = $this->getServiceLocator()\n ->get('user')\n ->getUserSession();\n $permission = $this->getServiceLocator()\n ->get('permissions')\n ->havePermission($logedUser[\"idUser\"], $logedUser[\"idWebsite\"], $this->moduleId);\n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\")) {\n \n \n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\") || $logedUser[\"idCompany\"] == 1) {\n $request = $this->getRequest();\n }\n \n $images = $this->getImageTable()->fetchAll($logedUser[\"idWebsite\"]);\n $this->layout(\"layout/images.phtml\");\n return array(\n \"images\" => $images,\n \"idWebsite\" => $logedUser[\"idWebsite\"]\n );\n } else {\n return $this->redirect()->toRoute(\"noPermission\");\n }\n }", "function getImagesDirectory($limitImages=0) { \t\t \n if (is_dir($this->config['startingpoint'])) {\n \t\t $images = array(); \n \t\t $images = $this->getFiles($this->config['startingpoint']); \t\n // randomise and limit image items returned from images array\n // also useful to limit items in array to 1 item for use when no javascript in browser\n // if $limitImages=0 then this if statement is bypassed and all images in images array returned for processing\n if ($limitImages>0) {\n \t$images=$this->getSlicedRandomArray($images,0,$limitImages);\n }\n\n $content.= $this->beginGallery($this->cObj->data['uid'],$limitImages);\n\n // read the description from field in flexforms\n \t$caption = explode(\"\\n\",$this->config['text']);\n \n // add the images\n foreach ($images as $key=>$value) {\n $path = $this->config['startingpoint'].$value;\n \n // caption text\n $text =explode('|',$caption[$key]);\n \n // add element to slideshow\n $content.=$this->addImage(\n \t\t\t $path,\n $text[0], \n $text[1],\n $this->config['showThumbs'],\n $this->config['showLightbox'],\n $path,\n $limitImages\n );\n \n } # end foreach file\n \n \t\t $content.=$this->endGallery();\n \t\t} # end is_dir \n \t\treturn $content;\n }", "function ListFiles($folder,$mask)\r\n{\t// $extension is like '*.png'\r\n\t$images = glob(\"\" . $folder . $mask);\r\n\treturn $images;\r\n}", "public function getImageList()\n {\n $list = [];\n $path = $this->_filesystem->getDirectoryRead(\n DirectoryList::MEDIA\n )->getAbsolutePath(\n self::MEDIA_IMAGE_DIR\n );\n $baseUrl = $this->getStore()\n ->getBaseUrl('media').self::MEDIA_IMAGE_DIR.'/';\n $readFactory = $this->readFactory->create($path);\n if (!$readFactory->isExist()) {\n return [];\n }\n $fileList = $readFactory->read();\n\n if (!empty($fileList)) {\n foreach ($fileList as $entry) {\n if ($entry != '.' && $entry!= '..') {\n $extension = explode('.', $entry);\n if (in_array(end($extension), $this->availableImageFormat)) {\n $list[] = $baseUrl.$entry;\n }\n }\n }\n }\n return $list;\n }", "public function actionimages()\n {\n $module = \"DocumentAttachments\";\n $urlquerystring = $_SERVER['QUERY_STRING'];\n $paraArr = explode(\"/\", $urlquerystring);\n $ticketId = $paraArr['2'];\n $model = new Troubleticket;\n $imagedata = $model->getimage($module, $ticketId);\n header(\"Content-Type: image/jpeg\");\n header(\"Content-Disposition: inline;filename=\" . $imagedata['result']['filename']);\n echo base64_decode($imagedata['result'][filecontent]);\n die;\n }", "public function images()\n {\n return get_field('images');\n }", "function upload_image2($images) {\n\n $image_urls = array();\n\n foreach ($images as $image) {\n $src_url = $image['src'];\n $dst_url = $image['dst'];\n $type = $image['image_type'];\n\n if($stored_url = upload_image($dst_url, $src_url)) {\n $image_urls[$type] = $stored_url;\n }\n }\n return $image_urls;\n}", "protected function getUploadDir()\n {\n return 'images';\n }", "public function listImage()\n {\n $data = Image::all();\n return response()->json($data);\n return $this->showAll($image);\n }", "public function load_images(Request $request)\n {\n $loggedin_user = Helper::get_logged_in_user();\n $pile = Date_metron::where(\"id\", $request->id)\n ->select('image_one', 'image_one_url', 'image_two', 'image_two_url')\n ->first();\n $data = array();\n $image_one = asset('public/assets/media/users/noimage.jpg');\n $image_two = asset('public/assets/media/users/noimage.jpg');\n if($pile)\n {\n if(!empty($pile['image_one']))\n {\n if(file_exists(base_path().'/public/date_metron/'.$pile['image_one'])) \n $image_one = $pile['image_one_url']; \n }\n if(!empty($pile['image_two']))\n {\n if(file_exists(base_path().'/public/date_metron/'.$pile['image_two'])) \n $image_two = $pile['image_two_url']; \n }\n $data = array('image_one'=>$image_one,'image_two'=>$image_two);\n }\n echo json_encode($data);\n }", "function tp_get_img_dir() {\n\t$file = new ElggFile();\n\t$file->setFilename('image/');\n\treturn $file->getFilenameOnFilestore();\n}", "private function getRequestImages(): array\n\t{\n\t\t$result = [];\n\n\t\t$files = Context::getCurrent()->getRequest()->getFileList();\n\t\t$requestFiles = $files['fields'] ?? null;\n\t\tif (is_array($requestFiles))\n\t\t{\n\t\t\tCFile::ConvertFilesToPost($requestFiles, $result);\n\n\t\t\t// remove UF_FILE key\n\t\t\t$result = $result['DIRECTORY_ITEMS'] ?? [];\n\t\t\tforeach ($result as $rowId => $data)\n\t\t\t{\n\t\t\t\t$result[$rowId] = $data['UF_FILE'];\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "function getImages() \t{\n \t\treturn $this->images_array;\n \t}", "public function getUploadImageDir()\n {\n return 'uploads/images';\n }", "function images_add_folder($image_data_url,$folder_name)\r\n{\r\n\t \r\n\t\r\n\t foreach($image_data_url as $file)\r\n {\r\n //get image contents\r\n $image = file_get_contents($file);\r\n\t\t\t\t\t $f_name=explode (\"?\",$file);\r\n\t\t\t\t $image_url=explode('/',$f_name[0]);\r\n $only_name=$image_url[count($image_url)-1];\r\n //put image contents\r\n file_put_contents($folder_name.\"/\".$only_name, $image);\r\n\t\t\t }\r\n}", "public function get_image_path($image)\n{\n\treturn \"data/\". $image. \".jpg\";\n}", "public function actionImages() {\n// if (file_exists($filePath)) {\n// header('Content-Type: image/jpeg');\n// header('Content-Length: ' . filesize($filePath));\n// readfile($filePath);\n// } else {\n// return \"\";\n// }\n return \"\";\n }", "function display_image($picture) {\n return \"uploads\" . DS . $picture;\n}", "public static function getGalleryImages($key) {\n $gallery = array();\n\n $path = ImageHelper::IMAGE_DIR . $key . '/gallery/';\n\n if (file_exists($path)) {\n foreach (scandir($path) as $file) {\n if (ImageHelper::endsWith($file, \".jpg\") || ImageHelper::endsWith($file, \".jpeg\") || ImageHelper::endsWith($file, \".png\")) {\n $tempPath = $path . $file;\n \n $filename = pathinfo($tempPath, PATHINFO_FILENAME);\n $small = ImageHelper::CACHE_DIR . $key . '_' . $filename . \"_small.jpg\";\n\n if (!file_exists($small)) {\n ImageHelper::convertToJPG($tempPath, 256, 256, $small);\n }\n\n array_push($gallery, $small);\n }\n }\n }\n\n return $gallery;\n }", "function culturefeed_entry_ui_collaboration_get_image_from_url($image) {\n\n // See if the image is stored on the local url.\n $base_path = $GLOBALS['base_url'] . '/' . variable_get('file_public_path', conf_path() . '/files') . '/';\n $parts = explode($base_path, $image);\n if (count($parts) == 2 && $parts[1]) {\n\n $files = entity_load('file', FALSE, array('uri' => 'public://' . $parts[1]));\n if (!empty($files)) {\n return reset($files);\n }\n\n }\n\n}", "public function getFiles();", "public function getFiles();", "public function getFiles();", "function get_arr_pics_from_folder( $img_folder, $img_folder_url, $thumb_width = 50, $thumb_height = 50 )\n\t{\n\t\t$arr_filenames = $filesnames =array();\n\t\tif(file_exists($img_folder))\n\t\t{\n\t\t\t$filesnames = scandir($img_folder);\n\t\t}\n\t\t$count = 0;\n\t\tforeach ( $filesnames as $name )\n\t\t{\n\t\t\t$count++;\n\t\t\tif ( $name != \".\" && $name != \"..\" && $name != \"_evocache\" && $this->isImage($img_folder.$name) ) //not the folder and other files\n\t\t\t{\n\t\t\t\t$arr_filenames[] = array( $img_folder_url.$name,\n\t\t\t\t\"<a href='\".$img_folder_url.$name.\"' target='blank'><img src='\".$img_folder_url.$name.\"' width=\".$thumb_width.\"px heigh=\".$thumb_height.\"px /></a>\" );\n\t\t\t}\n\t\t\tif ($count==30) break; // The max number of the images we want to show\n\t\t}\n\t\t$arr_filenames[] = array(\"none\",T_(\"Transparent\"));\n\t\treturn $arr_filenames;\n\t}", "function loadImages($user_id = 0){\n\t\tglobal $tsUser;\n\t\t//\n\t\tif(empty($user_id)) $user_id = $tsUser->uid;\n\t\t$images = $this->fetch_array($this->select(\"u_fotos\",\"*\",\"f_user = $user_id\",\"\",\"\"));\n\t\t//\n\t\treturn $images;\n\t}", "function getFilesByObject() {\n if($this->object_id == '') return ;\n $sql = \"SELECT * FROM \".$this->tableImages().\" WHERE object_id = $this->object_id \";\n return $this->db->query($sql)->result('array');\n\t}", "public function get_images(){\n\t\treturn $this->images;\n\t}", "public function getFiles ();", "function getImageByImageId() {\n if($this->image_id == '') return;\n\n $sql = \"SELECT * FROM \".$this->tableImages().\" WHERE image_id = \".$this->image_id;\n return $this->db->query($sql)->row_array();\n\t}", "public function getImage() {}", "protected function generateImages() {\n if ($this->buildNamespace($this->imageFolder) && $this->createShortUrl()) {\n foreach ($this->inputs as $input) {\n $this->generate($input);\n }\n }\n\n return $this->responseJSON();\n }", "function _findimages(&$data){\n global $conf;\n $files = array();\n\n // http URLs are supposed to be media RSS feeds\n if(preg_match('/^https?:\\/\\//i',$data['ns'])){\n $files = $this->_loadRSS($data['ns']);\n $data['_single'] = false;\n }else{\n $dir = utf8_encodeFN(str_replace(':','/',$data['ns']));\n // all possible images for the given namespace (or a single image)\n if(is_file($conf['mediadir'].'/'.$dir)){\n require_once(DOKU_INC.'inc/JpegMeta.php');\n $files[] = array(\n 'id' => $data['ns'],\n 'isimg' => preg_match('/\\.(jpe?g|gif|png)$/',$dir),\n 'file' => basename($dir),\n 'mtime' => filemtime($conf['mediadir'].'/'.$dir),\n 'meta' => new JpegMeta($conf['mediadir'].'/'.$dir)\n );\n $data['_single'] = true;\n }else{\n $depth = $data['recursive'] ? 0 : 1;\n search($files,\n $conf['mediadir'],\n 'search_media',\n array('depth'=>$depth),\n $dir);\n $data['_single'] = false;\n }\n }\n\n // done, yet?\n $len = count($files);\n if(!$len) return $files;\n if($data['single']) return $files;\n\n // filter images\n for($i=0; $i<$len; $i++){\n if(!$files[$i]['isimg']){\n unset($files[$i]); // this is faster, because RE was done before\n }elseif($data['filter']){\n if(!preg_match($data['filter'],noNS($files[$i]['id']))) unset($files[$i]);\n }\n }\n if($len<1) return $files;\n\n // random?\n if($data['random']){\n shuffle($files);\n }else{\n // sort?\n if($data['sort'] == 'date'){\n usort($files,array($this,'_datesort'));\n }elseif($data['sort'] == 'mod'){\n usort($files,array($this,'_modsort'));\n }elseif($data['sort'] == 'title'){\n usort($files,array($this,'_titlesort'));\n }\n\n // reverse?\n if($data['reverse']) $files = array_reverse($files);\n }\n\n // limits and offsets?\n if($data['offset']) $files = array_slice($files,$data['offset']);\n if($data['limit']) $files = array_slice($files,0,$data['limit']);\n\n return $files;\n }", "private static function get_media_images($table){\n $database = Database::instance();\n $sql = \"SELECT DISTINCT image FROM \" . $table . \" WHERE image IS NOT NULL\";\n $query = $database->prepare($sql);\n $query->execute();\n $result = $query->fetchAll(\\PDO::FETCH_ASSOC);\n $query->closeCursor();\n if( $result === false || $result === null) {\n APIService::response_fail(HttpFailCodes::http_response_fail()->get_media_images);\n }\n $media_images = array();\n foreach ($result as $image){\n array_push($media_images, $image[\"image\"]);\n }\n return $media_images;\n }", "public function getImages()\r\n {\r\n if (!isset($this->_images)) {\r\n $this->_images = [];\r\n for ($i=1; $i<=6; $i++) {\r\n if ($data = $this->getData('image' . $i)) {\r\n $image = $this->imageRepository->getById($data);\r\n if ($image->isActive()) {\r\n $this->_images[] = $image->getUrl();\r\n }\r\n }\r\n }\r\n }\r\n return $this->_images;\r\n }", "public function listImages()\n {\n $images = $this->docker(\"images --format '\\\"{{.Repository}}:{{.Tag}}\\\"' --filter=reference='*' | jq -r\");\n\n $image = explode(\"\\n\", substr($images, 0, -1));\n\n return $image;\n }", "public function getImagePath ($upc) {\n \n $query = \"SELECT file\n FROM ea_images\n WHERE upc = '$upc' \";\n //print(\"$query\");\n foreach($this->dbo->query($query) as $row) {\n $file = stripslashes($row[0]);\n $folder = substr($upc,0,4);\n $path = \"./uploads/$folder/$file\";\n }\n \n return $path;\n }", "private function readImages()\r\n {\r\n if(file_exists($this->location) && is_readable($this->location))\r\n {\r\n $images = array();\r\n\r\n foreach(array_diff(scandir($this->location), array('.', '..')) as $file)\r\n {\r\n if($this->isValidImageType($file))\r\n {\r\n $type = strtolower(pathinfo($file, PATHINFO_EXTENSION));\r\n\r\n if(!in_array($type, $this->extensions))\r\n {\r\n $this->extensions[] = $type;\r\n }\r\n\r\n $images[] = new Image($this->location . '/' . $file);\r\n }\r\n }\r\n\r\n usort($images, function($a, $b) {\r\n return $a->getWidth() > $b->getWidth();\r\n });\r\n\r\n $this->images = $images;\r\n }\r\n }", "private function getImageContent($path) {\n $hash = md5($path);\n if (!isset($this->images[$hash])) {\n // If its unique image - upload it\n $image_mime = image_type_to_mime_type(exif_imagetype($path));\n switch ($image_mime) {\n case \"image/png\":\n $image = imagecreatefrompng($path);\n break;\n case \"image/jpeg\":\n $image = imagecreatefromjpeg($path);\n break;\n case \"default\":\n throw new \\Exception(\"Can add just png or jpeg image-type\");\n }\n\n // Add to array of used images\n $this->images[$hash] = $image;\n }\n\n return $this->images[$hash];\n }", "function retrieveOneImageId($folderId, $apiKey){\n $fileArray = retrieveOneFileArray($folderId, $apiKey);\n $filteredFileArray = filterByMimeType($fileArray, \"image/\");\n return getfileIds($filteredFileArray);\n}", "function getImagePath () {\n return luxbum::getImage($this->dir, $this->file);\n }", "public static function get_image($user_id);", "public function getListImageSlider() {\n header('Access-Control-Allow-Origin: *');\n header(\"Access-Control-Allow-Credentials: true\");\n header('Content-Type: application/json; charset=utf-8');\n header(\"Access-Control-Allow-Methods: POST, GET, OPTIONS\");\n header('Access-Control-Allow-Headers \"Origin, X-Requested-With, Content-Type, Accept');\n $this->load->helper('directory');\n $list_image = directory_map('./media/slides');\n $aListImage = array();\n foreach ($list_image as $key => $sImage) {\n $aListImage[$key] = array(\n 'image_name' => str_replace('.jpg', '', $sImage),\n 'image_url' => base_url().'media/slides/'.$sImage\n );\n }\n\n echo json_encode($aListImage);\n die();\n }", "public function index()\n {\n return Image::all();\n }", "public function get_images($tut_id = ''){\n\t\tif($tut_id !== ''){\n\t\t\t// getting specific product images if product id is passed in parameter\n\t\t\t$query = $this->db->get_where('images', array('product_id' => $tut_id));\n\t\t\treturn $query->result();\n\t\t}\n\t}", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "private function list_local_images($dir)\n {\n $files = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($dir,\n FilesystemIterator::CURRENT_AS_FILEINFO |\n FilesystemIterator::KEY_AS_PATHNAME |\n FilesystemIterator::SKIP_DOTS\n )\n );\n\n $files = new RegexIterator($files, '/^.+\\.jpg$/i', RecursiveRegexIterator::MATCH);\n\n return $files;\n }", "function _getThumbnails($id)\n {\n global $serendipity;\n\n $file = serendipity_fetchImageFromDatabase($id);\n $name = $file['name'];\n\n $imagePath = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $file['path'] . $file['realname'];\n $thumbnailBase = str_replace($file['extension'], '', $imagePath);\n $uploadDir = dirname($imagePath);\n\n return glob(\"$thumbnailBase*{$file['thumbnail_name']}.{$file['extension']}\");\n }", "public function get_uploaded_header_images()\n {\n }", "function random_image($dir){\n$directory=\"{$_SERVER['DOCUMENT_ROOT']}/novademo-localhost/$dir\";\n\n$leading = substr($directory,0,1);\n$trailing = substr($directory,-1,1);\n\nif($leading=='/')\n$directory=substr($directory,1);\n\nif($trailing!='/')\n$directory = $directory.'/';\nif(empty($directory) or !is_dir($directory))\n{\ndie('Directory :\"'.$directory.'\" ,Not Found...Sorry !!');\n}\n$files=scandir($directory,1);\n$make_array = array();\nforeach($files as $id => $files)\n{\n$info =pathinfo($directory.$file);\n$image_extensions = array('jpg','jpeg','png','gif','ico');\nif(!in_array($info['extension'],$image_extensions))\n\tunset($file);\nelse\n\t{\n\t$file=str_replace(' ','%20',$file);\n\t$temp=array($id=>$file);\n\tarray_push($make_array,$temp);\n\t}\n}\nif(sizeof($make_array)==0)\n{\ndie('No images in, \"'.$directory.'\" ,Directory');\n}\n$total = count($make_array)-1;\n$random_image=rand(0,$total);\nreturn $directory;\n$make_array[$random_image][$random_image];\n}", "function get_files($images_dir,$exts = array('jpg')) {\n $files = array();\n if($handle = opendir($images_dir)) {\n while(false !== ($file = readdir($handle))) {\n $extension = strtolower(get_file_extension($file));\n if($extension && in_array($extension,$exts)) {\n $files[] = $file;\n }\n }\n closedir($handle);\n } else { echo \"Unable to read $images_dir directory!\"; }\n return $files;\n}" ]
[ "0.73892516", "0.72510624", "0.7110068", "0.6849811", "0.68296015", "0.67516506", "0.6742462", "0.6713042", "0.66894954", "0.664664", "0.66405356", "0.66364115", "0.66085684", "0.65916353", "0.65871584", "0.6571846", "0.64799213", "0.6452745", "0.6440676", "0.6440374", "0.6428441", "0.6403394", "0.6390133", "0.63884884", "0.6382412", "0.63384527", "0.633386", "0.63185614", "0.63174045", "0.6307465", "0.6305543", "0.6275197", "0.6255164", "0.62454283", "0.62303716", "0.62181515", "0.62031096", "0.6191962", "0.618464", "0.6174313", "0.6171004", "0.61690116", "0.61690116", "0.61690116", "0.61690116", "0.61624897", "0.61588717", "0.6157906", "0.6156478", "0.6135819", "0.61313564", "0.6130579", "0.6128396", "0.6126772", "0.6091078", "0.6084798", "0.6074065", "0.6065155", "0.60586333", "0.6054207", "0.6039977", "0.602603", "0.60233676", "0.6005884", "0.60054916", "0.60051364", "0.6000079", "0.59998196", "0.5973576", "0.59691215", "0.59646106", "0.5959353", "0.5959353", "0.5959353", "0.5958984", "0.5957927", "0.59533626", "0.5949565", "0.59449184", "0.594303", "0.59351534", "0.5907006", "0.5906137", "0.5905796", "0.5905291", "0.590343", "0.5899123", "0.58923864", "0.5892385", "0.5878902", "0.5869512", "0.58523095", "0.58517396", "0.5851086", "0.58492553", "0.5846055", "0.583916", "0.5836855", "0.58361375", "0.5833658", "0.5832224" ]
0.0
-1
Function to convert base64 image source to actual image (saved in folder "upload/image/") from textarea
public function convert_inline($str = '', $new_name = '', $mark = 'inline-') { $img = array(); $start = '<img'; $end = '>'; $pattern = sprintf('/%s(.+?)%s/ims', preg_quote($start, '/'), preg_quote($end, '/')); $search = true; $i = 1; while($search) { if (preg_match($pattern, $str, $matches)) { list(, $match) = $matches; $img[$i] = $start . $match . $end; $str = str_replace($start . $match . $end, "{gambar_$i}", $str); $i++; } else { $search = false; break; } } $start = 'src="data:image/'; $end = '"'; $pattern = sprintf('/%s(.+?)%s/ims', preg_quote($start, '/'), preg_quote($end, '/')); $img_to_check = array(); foreach ($img as $key=>$val) { if (preg_match($pattern, $val, $matches)) { list(, $match) = $matches; $img[$key] = str_replace($start . $match . $end, '{new_src}', $img[$key]); $ex_match = explode(',', $match); $base64_image = trim($ex_match[1]); $ex_type = explode(';', $ex_match[0]); $type = $ex_type[0]; $image = base64_decode($base64_image); $image_name = $mark . $new_name . '-img-' . $key . '.' . $type; file_put_contents($this->upload_dir . $image_name, $image); $new_source = base_url($this->upload_dir . $image_name); $img[$key] = str_replace('{new_src}', 'src="' . $new_source . '"', $img[$key]); } else { if(strpos($val, base_url($this->upload_dir)) !== FALSE) { $ex_val = explode(base_url(), $val); $to_check = substr($ex_val[1], 0, strpos($ex_val[1], '"')); $img_nm = str_replace($this->upload_dir, '', $to_check); $img_nm_2 = substr($img_nm, 0, strpos($img_nm, '-img')); if(!in_array($img_nm_2, $img_to_check)) $img_to_check[] = $img_nm_2; } } $str = str_replace("{gambar_$key}", $img[$key], $str); } foreach ($img_to_check as $k => $v) { $old_images = $this->get($v, '', TRUE); foreach($old_images as $k2 => $v2) { $found = FALSE; $file = base_url($v2); foreach($img as $k3 => $v3) { if(strpos($v3, $file) !== FALSE) { $found = TRUE; } } if(!$found) { unlink($v2); } } } return $str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function base64_to_jpeg($base64_string, $output_file) {\r\n $ifp = fopen( $output_file, 'wb' ); \r\n\r\n // split the string on commas\r\n // $data[ 0 ] == \"data:image/png;base64\"\r\n // $data[ 1 ] == <actual base64 string>\r\n $data = explode( ',', $base64_string );\r\n\r\n // we could add validation here with ensuring count( $data ) > 1\r\n fwrite( $ifp, base64_decode( $data[ 1 ] ) );\r\n\r\n // clean up the file resource\r\n fclose( $ifp ); \r\n\r\n return $output_file; \r\n}", "function base64_to_jpeg($base64_string, $output_file) {\n $ifp = fopen( $output_file, 'wb' ); \n\n // split the string on commas\n // $data[ 0 ] == \"data:image/png;base64\"\n // $data[ 1 ] == <actual base64 string>\n $data = explode( ',', $base64_string );\n\n // we could add validation here with ensuring count( $data ) > 1\n fwrite( $ifp, base64_decode( $data[ 1 ] ) );\n\n // clean up the file resource\n fclose( $ifp ); \n\n return $output_file; \n}", "function base64_to_jpeg($base64_string, $output_file) {\n $ifp = fopen( $output_file, 'wb' ); \n\n // split the string on commas\n // $data[ 0 ] == \"data:image/png;base64\"\n // $data[ 1 ] == <actual base64 string>\n $data = explode( ',', $base64_string );\n\n // we could add validation here with ensuring count( $data ) > 1\n fwrite( $ifp, base64_decode( $data[ 1 ] ) );\n\n // clean up the file resource\n fclose( $ifp ); \n\n return $output_file; \n}", "function base64_to_jpeg($base64_string, $output_file) {\n $ifp = fopen( $output_file, 'wb' ); \n\n // split the string on commas\n // $data[ 0 ] == \"data:image/png;base64\"\n // $data[ 1 ] == <actual base64 string>\n $data = explode( ',', $base64_string );\n\n // we could add validation here with ensuring count( $data ) > 1\n fwrite( $ifp, base64_decode( $data[ 1 ] ) );\n\n // clean up the file resource\n fclose( $ifp ); \n\n return $output_file; \n}", "function base64_to_jpeg($base64_string, $output_file)\n{\n $ifp = fopen($output_file, 'wb');\n\n // split the string on commas\n // $data[ 0 ] == \"data:image/png;base64\"\n // $data[ 1 ] == <actual base64 string>\n $data = explode(',', $base64_string);\n\n // we could add validation here with ensuring count( $data ) > 1\n fwrite($ifp, base64_decode($data[1]));\n\n // clean up the file resource\n fclose($ifp);\n\n return $output_file;\n}", "function base64_to_jpeg($base64_string, $output_file) {\r\n $ifp = fopen($output_file, \"wb\");\r\n fwrite($ifp, base64_decode($base64_string));\r\n fclose($ifp);\r\n return $output_file;\r\n}", "function updateImg(){\n $image = str_replace('data:image/png;base64,', '', $_POST['image']);\n $image = str_replace(' ', '+', $image);\n // Decode the Base64 encoded Image\n $data = base64_decode($image);\n // Create Image path with Image name and Extension\n $file = '../images/' . \"MyImage\" . '.jpg';\n // Save Image in the Image Directory\n $success = file_put_contents($file, $data);\n}", "function base64_to_jpeg($base64_string, $output_file)\n {\n $ifp = fopen($output_file, 'wb');\n\n // split the string on commas\n // $data[ 0 ] == \"data:image/png;base64\"\n // $data[ 1 ] == <actual base64 string>\n $data = explode(',', $base64_string);\n\n // we could add validation here with ensuring count( $data ) > 1\n fwrite($ifp, base64_decode($data[1]));\n\n // clean up the file resource\n fclose($ifp);\n return $output_file;\n }", "public function base64()\n {\n ob_start();\n\n imagepng($this->image);\n\n $string = ob_get_contents();\n\n ob_end_clean();\n\n return 'data:image/png;base64,'.base64_encode($string);\n }", "function base64_to_jpeg($base64_string, $output_file) {\n \n\t// apre in lettura il file\n $ifp = fopen( $output_file, 'wb' ); \n\n // divide il contenuto della stringa per eliminare il tag\n $data = explode( ',', $base64_string );\n\n // scrive nel file\n fwrite( $ifp, base64_decode( $data[ 1 ] ) );\n\n // chiude il file\n fclose( $ifp ); \n\n\t// restituisce il file\n return $output_file; \n}", "function base64_to_jpeg( $base64_string, $output_file ) {\r\n $ifp = fopen( $output_file, \"wb\" ); \r\n fwrite( $ifp, base64_decode( $base64_string) ); \r\n fclose( $ifp ); \r\n return( $output_file ); \r\n }", "public function base64_to_jpeg($base64_string) {\n\t\t $src = 'data:image/jpg;base64,'.$base64_string;\n\t\t return $src;\n\t\t}", "public static function base64ImageContent($base64_image_content)\r\n {\r\n if (preg_match('/^(data:\\s*image\\/(\\w+);base64,)/', $base64_image_content, $result)) {\r\n $type = $result[2];\r\n if (!in_array($type, ['jpg', 'jpeg', 'png',])) {\r\n return false;\r\n }\r\n $path = '/upload/' . date('Ymd') . '/';\r\n $new_file = public_path() . $path;\r\n if (!file_exists($new_file)) {\r\n //Check If The Folder Exists,If Not, Create It,And Give The Highest Authority\r\n mkdir($new_file, 0700);\r\n }\r\n $filename = time() . rand(0, 999999) . \".{$type}\";\r\n $full_file = $new_file . $filename;\r\n if (file_put_contents($full_file, base64_decode(str_replace($result[1], '', $base64_image_content)))) {\r\n return $path . $filename;\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n }", "function base64ToJpeg($base64String, $dir, $fileName) {\n $ifp = fopen( $this->rootFolder.$dir.$fileName, 'wb' );\n\n // split the string on commas\n // $data[ 0 ] == \"data:image/png;base64\"\n // $data[ 1 ] == <actual base64 string>\n $data = explode( ',', $base64String );\n\n // we could add validation here with ensuring count( $data ) > 1\n fwrite( $ifp, base64_decode( $data[ 1 ] ) );\n\n // clean up the file resource\n fclose( $ifp );\n\n return $dir.$fileName;\n }", "public function base64encode($meu_captcha){\n\t\t\t$img = @file_get_contents( $meu_captcha );\n\n\t\t\t$img_64 = base64_encode( $img ); //codifica a imagem para a base64\n\t\t\t$img_64 = urlencode($img_64); // codifica a imagem para ser passada via url\n\n\t\t\treturn $img_64;\n\t\t}", "public static function getImage($base64) {\n $data = null;\n if (($data = base64_decode($base64)) != false) {\n return $data;\n }\n return $data;\n }", "function base64_to_jpeg( $inputfile, $outputfile ) { \n $ifp = fopen( $inputfile, \"rb\" ); \n $imageData = fread( $ifp, filesize( $inputfile ) ); \n fclose( $ifp ); \n /* encode & write data (binary) */ \n $ifp = fopen( $outputfile, \"wb\" ); \n fwrite( $ifp, base64_decode( $imageData ) ); \n fclose( $ifp ); \n /* return output filename */ \n return( $outputfile ); \n }", "function base64_to_jpeg($base64_string, $output_file) {\n\t $ifp = fopen($output_file, \"wb\");\n\n\t $data = explode(',', $base64_string);\n\n\t fwrite($ifp, base64_decode($data[1]));\n\t fclose($ifp);\n\n\t return $output_file;\n\t}", "public static function makeFromEncoded($image) {\n define (\"MAX_SIZE\",\"5000\");\n\n if (startsWith($image, \"data:image/png;base64,\")) {\n $image = str_replace('data:image/png;base64,', '', $image);\n } else if (startsWith($image, \"data:image/jpeg;base64,\")) {\n $image = str_replace('data:image/jpeg;base64,', '', $image);\n } else {\n if (startsWith($image, \"data:image/\")) {\n echo \"Unsupported filetype [\".substr($image, 11, 4).\"]. Please use JPG or PNG\";\n } else {\n echo \"Unsupported filetype [UNKNOWN]. Please use JPG or PNG\";\n }\n return null;\n }\n\n $image = str_replace(' ', '+', $image);\n\n if (!$image) {\n echo \"I have no idea why... But this didn't work...\";\n return null;\n }\n\n $uploadedfile = base64_decode($image);\n if (!$uploadedfile) {\n echo \"Sorry. We could not process this photo. [ERROR CODE 2]\";\n return null;\n }\n return $uploadedfile;\n }", "public function base64_to_png($base64_string) {\n\t\t $src = 'data:image/png;base64,'.$base64_string;\n\t\t return $src;\n\t\t}", "function save ($input) {\r\n // Do your processing\r\n // Save to database of something\r\n //processin here cuz\r\n\r\n// $fp = fopen('images/test.txt', 'w');//opens file in append mode \r\n// fwrite($fp, $input); \r\n// fclose($fp);\r\n\r\n// $fp = fopen('images/len.txt', 'w');//opens file in append mode \r\n// fwrite($fp, strlen($input)); \r\n// fclose($fp);\r\n\r\n $img = str_replace('data:image/png;base64,', '', $input);\r\n $img = str_replace(' ', '+', $img);\r\n\r\n// $fp = fopen('images/img2.txt', 'w');//opens file in append mode \r\n// fwrite($fp, $img); \r\n// fclose($fp);\r\n\r\n $fileData = base64_decode($img);\r\n file_put_contents('images/photo.png',$fileData);\r\n return true;\r\n}", "public function getBase64Image( Request $request ) {\n\t\t$this->validate( $request, [\n\t\t\t'image_data' => 'required'\n\t\t] );\n\t\t$image = str_replace( '_', '/', $request->image_data );\n\n\t\techo str_replace( '-', '+', $image );\n\t\texit;\n\t}", "public static function base64Encode($imagefile){\n if( !($str = file_get_contents( $imagefile ))){\n return NULL;\n }\n $strEncoded = base64_encode($str);\n return $strEncoded;\n }", "private function __saveUserImage( $base64 ) {\n\t\t\n\t\t// Busca a extensao e os dados da imagem\n\t\tlist( $ext, $data ) = explode( ';', $base64 );\n\t\tlist( , $ext ) = explode( '/', $ext );\n\t\tlist( , $data ) = explode( ',', $data );\n\n\t\t// Seta as propriedades restantes\n\t\t$data = base64_decode($data);\n\t\t$hash = getToken();\n\t\t$filename = $hash.'.'.$ext;\n\t\t$inputName = 'user_image';\n\t\t$size = file_put_contents( 'public/uploads/'.$filename, $data );\n\t\tif( !$size ) return false;\n\t\t\n\t\t// Carrega a model e cria uma nova instancia\n\t\t$this->load->model( 'midia' );\n\t\t$midia = $this->Midia->new();\n\n\t\t// Seta as propriedades\n\t\t$midia->name = $inputName;\n\t\t$midia->hash = $hash;\n\t\t$midia->type = 'image';\n\t\t$midia->ext = $ext;\n\t\t$midia->size = $size;\n\n\t\t// Salva a imagem no banco\n\t\tif( $midia->save() ) {\n\t\t\treturn $midia->id;\n\t\t} else return false;\n\t}", "public static function genImageFromBase64($str, $filename)\n {\n // Obtain the original content (usually binary data)\n $result = \\explode(';base64,', $str);\n $bin = base64_decode($result[1]);\n\n // Load GD resource from binary data\n $im = imageCreateFromString($bin);\n\n // Make sure that the GD library was able to load the image\n // This is important, because you should not miss corrupted or unsupported images\n if (!$im)\n throw new Exception('Base64 value is not a valid image');\n\n // Save the GD resource as PNG in the best possible quality (no compression)\n // This will strip any metadata or invalid contents (including, the PHP backdoor)\n // To block any possible exploits, consider increasing the compression level\n imagepng($im, $filename, 0);\n }", "public function getBase64Content(): string;", "function image_data_uri($image, $max_width = 0)\n{\n $info = image_info($image);\n if (!$info['type']) {\n return $image;\n }\n if ($info['type'] == 'file') {\n $image = file_get_contents($image);\n }\n if ($max_width && $max_width < $info['width']) {\n $image = image_scale_blob($image, $info, $max_width, 'crop');\n $info = image_info($image);\n }\n return sprintf('data:%s;base64,%s', $info['mime'], base64_encode($image));\n}", "function encodeImage($path)\n{\n\t$type = pathinfo($path, PATHINFO_EXTENSION);\n\t$data = @file_get_contents($path);\n\t$base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);\n\n\treturn $base64;\n}", "public static function generateBase64($path = null) {\n\n if(isset($path)) {\n\n $img = Image::make(public_path('storage/'.$path));\n\n $data = (string) $img->encode('data-url', 60);\n\n return $data;\n\n } else {\n throw new ImageUploaderException(\n \"Path is empty\"\n );\n }\n\n }", "function getImage($id){\n\trequire_once __DIR__ . '/database_handler.php';\n\t$db = new database_handler();\n\t//$id = $_POST['id'];\n\t$imageQuery = \"SELECT image from IMAGE where id = '$id'\";\n\t$imageString=\"\";\n\tif(!$imageStmt = $db->con->prepare($imageQuery)){\n\t\t\techo \"Prepare failed: (\" . $db->con->errno . \")\" . $db->con->error;\n\t\t}\n\t\t$imageStmt->execute();\n\t\t$imageStmt->bind_result($imageString);\n\t\t$imageStmt->fetch();\n\t\t$imageStmt->close();\n\t\t$imageString = base64_encode($imageString);\n\t\treturn $imageString;\n}", "function base64_encode_image ($filename=string,$filetype=string) {\n\t\tif ($filename) {\n\t\t\t$imgbinary = fread(fopen($filename, \"r\"), filesize($filename));\n\t\t\treturn base64_encode($imgbinary);\n\t\t}\n\t}", "function save_camp_image(){\n\t\n\t\n\t$data = $_POST['data'];\n\tlist($type, $data) = explode(';', $data);\n\tlist(, $data) = explode(',', $data);\n\t$data = base64_decode($data);\t\t\n\t$img_name = 'tshirt'.time().'.png';\n\t\n\t$upload_dir = wp_upload_dir();\t\n\t\n\t$target_path_image = $upload_dir['path'].'/'.$img_name;\n\t\n\tfile_put_contents($target_path_image, $data);\n\t\n\techo json_encode(array('action'=>'done','img'=>$img_name));\t\n\tdie();\n}", "public function base64ToJpeg($base64Str, $fileName) {\n $ifp = fopen($fileName, 'wb');\n \n // we could add validation here with ensuring count( $data ) > 1\n fwrite($ifp, base64_decode($base64Str));\n \n // clean up the file resource\n fclose($ifp);\n }", "public function encodeImage()\r\n {\r\n if (!(($_FILES[\"file-select\"][\"type\"] == \"image/gif\")\r\n || ($_FILES[\"file-select\"][\"type\"] == \"image/jpeg\")\r\n || ($_FILES[\"file-select\"][\"type\"] == \"image/jpg\")\r\n || ($_FILES[\"file-select\"][\"type\"] == \"image/pjpeg\")\r\n || ($_FILES[\"file-select\"][\"type\"] == \"image/x-png\")\r\n || ($_FILES[\"file-select\"][\"type\"] == \"image/png\")))\r\n {\r\n $data['status'] = 'fail';\r\n $data['msg'] = lang('miiicloud-files-file_type_error');\r\n echo json_encode($data);\r\n return;\r\n }\r\n $size = $_FILES[\"file-select\"][\"size\"] / 1024;\r\n if ($_FILES[\"file-select\"][\"error\"] > 0)\r\n {\r\n $data['status'] = 'fail';\r\n $data['msg'] = $_FILES[\"file-select\"][\"error\"];\r\n }\r\n else if (intval($size)> 100000000)\r\n {\r\n $data['status'] = 'fail';\r\n $data['msg'] = lang('miiicloud-files-image_too_large');\r\n }\r\n else\r\n {\r\n $content = file_get_contents($_FILES[\"file-select\"][\"tmp_name\"]);\r\n $base64 = 'data:' . $_FILES[\"file-select\"][\"type\"] . ';base64,' . base64_encode($content);\r\n $data['status'] = 'ok';\r\n $data['type'] = $_FILES[\"file-select\"][\"type\"];\r\n $data['name'] = $_FILES[\"file-select\"][\"name\"];\r\n $data['base64'] = $base64;\r\n $data['size'] = $size;\r\n }\r\n echo json_encode($data);\r\n }", "function string2image($string) {\n\t\t$converted = imagecreatefromstring($string);\n\t\tob_start();\n\t\timagepng($converted);\n\t\t$contents = ob_get_contents();\n\t\tob_end_clean();\n\t\treturn \"<img src='data:image/png;base64,\".base64_encode($contents).\"' />\";\n\t\timagedestroy($converted);\n\t}", "public function image_url_to_base64(string $url): string\n {\n $client = new GuzzleHttp\\Client();\n $response = $client->get($url);\n \n return base64_encode($response->getBody());\n }", "private function uploadBase64Image($image)\n {\n try {\n $name = time()*rand(1111, 9999).'.png';\n Image::make($image)->resize(200, 200)->save(public_path('uploads/thumbs/'.$name));\n return $name;\n } catch (\\Exception $exception) {\n return '';\n }\n }", "public function testimg_post()\n {\n echo \"FALSE\";\n $result = $this->input->post();\n $filename = $this->input->post(\"filename\");\n $string = $this->input->post(\"data\");\n $img = imagecreatefromstring(base64_decode($string));\n $img2 = imagecreatefromstring(base64_decode($result));\n if ($img != false) {\n imagejpeg($img, \"/resources/image/prueba1.jpg\");\n echo \"prueba1\";\n }\n if ($img2 != false) {\n echo \"prueba2\";\n imagejpeg($img2, \"/resources/image/prueba2.jpg\");\n }\n $config['upload_path'] = './resources/image/service';\n $config['allowed_types'] = 'gif|jpg|png';\n $config['max_size'] = 10000;\n $config['max_width'] = 9024;\n $config['max_height'] = 2768;\n $this->load->library('upload', $config);\n if (!$this->upload->do_upload()) {\n $error = array('error' => $this->upload->display_errors());\n $this->load->view('upload_form', $error);\n //print_r($error);\n }else{\n $data[\"upload_data\"] = $this->upload->data();\n }\n// $img = $this->input->post(\"image\");\n// $imgarr = explode(',', $this->image_string);\n// $image = base64_decode($imgarr[1]);\n// $results[\"data\"] = $result;\n// $results[\"parsed\"]= $result;\n// $temp_file_path = tempnam(sys_get_temp_dir(), 'androidtempimage'); // might not work on some systems, specify your temp path if system temp dir is not writeable\n// file_put_contents($temp_file_path, base64_decode($_POST['imageString']));\n $this->set_response($result, REST_Controller::HTTP_OK);\n }", "function imageAccess($file, $mime) \n{ \n $contents = file_get_contents($file);\n $base64 = base64_encode($contents); \n return ('data:' . $mime . ';base64,' . $base64);\n}", "function readyToSave($image) {\n return addslashes(file_get_contents($image['tmp_name'])); \n }", "function __checkBase64_image($img64) {\n $img64 = substr($img64, strpos($img64, ',')+1, strlen($img64));\n $img = imagecreatefromstring(base64_decode($img64));\n if (!$img) {\n return false;\n }\n imagepng($img, 'tmp.png');\n $info = getimagesize('tmp.png');\n unlink('tmp.png');\n if ($info[0] > 0 && $info[1] > 0 && $info['mime']) {\n return true;\n }\n return false;\n }", "function isImageBase64($imageBase64){\n return preg_match('/^(data:image)\\/(png|jpg|gif)(;base64,)/i', $imageBase64);\n}", "public static function fileBase64src($imgFileName) {\n return self::base64src(file_get_contents($imgFileName), mime_content_type($imgFileName));\n }", "public function convertBase64ToFile($base64_string, $destination, $firstname, $lastname){\n $firstname = strtolower($firstname);\n $lastname = strtolower($lastname);\n\n $time = time().rand(000,999);\n if(!empty($base64_string)){\n $file_path = public_path($destination);\n $file_data = str_replace(\"data:application/pdf;base64,\", \"\", $base64_string);\n $file_data = str_replace(\" \", \"+\", $file_data); // filtered strings\n $file_name = $file_path.'/'.$firstname.'-'.$lastname.'-'.$time.'.pdf'; //generating unique file name; \n $image_data = base64_decode($file_data);\n if(file_put_contents($file_name, $image_data)){\n $new_image_name = $firstname.'-'.$lastname.'-'.$time.'.pdf';\n return $new_image_name;\n }else{\n return null;\n }\n }\n }", "public function upload64() {\n $post = json_decode(file_get_contents('php://input'), true);\n\n $access = $this->_checkAccess($post['auth'],'shortLiveToken');\n\n if(!isset($access['shortLiveToken'])) {\n $result['err'] = 'Permission Denied';\n echo json_encode($result, true);\n die();\n }\n\n $imgName = md5('avatar.'.$access['shortLiveToken']);\n\n $options = array(\n 'path' => 'uploader/tmpImgStore/',\n 'width' => 300,\n 'height' => 300\n );\n\n require_once('photoProcess.php');\n $photo = new photoProcess();\n $photo->set($options);\n\n $upload = $photo->photo64($post['source'], $imgName);\n\n echo json_encode($upload, true);\n }", "function base64_png_img_tag($base64_png) {\n $tag = \"<img style='display:block;' id='base64image' \" . \n \"src='data:image/png;base64, \" . $base64_png . \"' />\";\n return $tag;\n}", "function base64Encode($plain) {\n\n // Initialise output variable\n\n $output = \"\";\n\n \n\n // Do encoding\n\n $output = base64_encode($plain);\n\n \n\n // Return the result\n\n return $output;\n\n}", "public static function convertBase64ToBlob(string $base64, &$mime = null): string {\r\n if (!self::isBase64($base64, $mime)) {\r\n throw new \\RuntimeException('Did not match data URI with image data');\r\n }\r\n $blob = base64_decode(substr($base64, strpos($base64, ',') + 1));\r\n if ($blob === false) {\r\n throw new \\RuntimeException('Base64 decode failed');\r\n }\r\n return $blob;\r\n }", "public function storeBase64($base64) {\n list($baseType, $image) = explode(';', $base64);\n list(, $image) = explode(',', $image);\n $image = base64_decode($image);\n $extension = $this->getBase64Extension($baseType);\n $imageName = rand(111111111, 999999999) . '.' . $extension;\n $exists = Storage::disk('public')->exists('uploads/'.$imageName);\n //Make sure it doesn't exist already\n while ($exists) {\n $imageName = rand(111111111, 999999999) . '.jpg';\n }\n $p = Storage::disk('public')->put('uploads/' . $imageName, $image, 'public');\n if (!$p) {\n return response()->json(['response'=>'error', 'message'=>__('attachment.save_error')], 400);\n } \n $this->file_name = $imageName;\n $this->file_extension = $extension;\n $this->mime_type = $this->getFileMime();\n $this->url = $this->getFileUrl();\n $this->file_size = $this->getFileSize();\n }", "public static function base64ToFile($base64File)\n {\n list($type, $file) = explode(';', $base64File);\n\t\t\tlist(, $file) = explode(',', $file);\n\t\t\treturn base64_decode($file);\n }", "public function getBase64(): string;", "public function screenshotAsImage($asBase64 = false)\n {\n $image = $this->getDriver()->curl(\n $this->getDriver()->factoryCommand('screenshot', WebDriver_Command::METHOD_GET)\n );\n $image = $image['value'];\n if (!$asBase64) {\n $image = base64_decode($image);\n }\n return $image;\n }", "private function decodeBase64Image($imgStr)\n { \n $img = new \\stdClass(); \n \n $splited = explode(',', substr( $imgStr , 5 ) , 2);\n \n $mime_split = explode('/', explode(';', $splited[0], 2)[0], 2);\n \n $img->extension = $mime_split[1] == 'jpeg' ? 'jpg' : $mime_split[1];\n $img->content = base64_decode($splited[1]);\n\n return $img;\n }", "static public function imgToData64($url){\n $validImgFormat = array('jpeg' => true, 'jpg' => true, 'png' => true);\n $urlLng = strlen($url);\n $ext = null;\n if( $urlLng > 2 ){\n $ext = substr($url, -3);\n }\n\n if( !is_null($ext) && isset($validImgFormat[$ext]) ){\n var_dump($url);\n $contents = file_get_contents($url);\n $base64 = base64_encode($contents);\n return 'data:image/' . $ext . ';base64,' . $base64;\n }\n\n return $url;\n }", "public function check_base64_image($base64) {\n $result = false;\n $img = imagecreatefromstring(base64_decode($base64));\n if (!$img) {\n return $result;\n }\n\n imagepng($img, 'tmp.png');\n $info = getimagesize('tmp.png');\n\n unlink('tmp.png');\n\n if ($info[0] > 0 && $info[1] > 0 && $info['mime']) {\n $result = $info;\n }\n\n return $result;\n }", "public function build()\n {\n if ($this->_inline) {\n $encoded_image = base64_encode(file_get_contents($this->_attributes['src']));\n $mime_type = image_type_to_mime_type($this->_image_type);\n $this->_attributes['src'] = \"data:{$mime_type};base64,{$encoded_image}\";\n\n if (isset($this->_attributes['async'])) {\n unset($this->_attributes['async']);\n }\n }\n\n $attributes = join(' ', $this->_makeAttributesArr());\n if (!empty($attributes)) {\n $attributes = ' ' . $attributes;\n }\n return \"<img{$attributes}>\";\n }", "abstract protected function processImage (string $src): string;", "function createImage($string){\n\t\t//pr($string);die('okszzz');\n\t\t$data\t= base64_decode($string);\n\t\t//echo ($data);die('oksss');\n\t\t\n\t\t$db_img = imagecreatefromstring($data); \n\t\t//.pr($db_img);die;\n\t\t$type = \"jpg\";\n\t\t$name\t= '';\n\t\tif ($db_img !== false) {\n\t\t\tswitch ($type) {\n\t\t\tcase \"jpg\":\n\t\t\t$rand \t= rand(0000, 9999);\n\t\t\t$name\t= $rand.\"user.jpg\";\n\t\t\t\n\t\t\timagejpeg($db_img,$name, '100');\n\t\t\t$img = imagejpeg($db_img,$name, '100');\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t\t\n\n\t\t}\n\t\treturn $name;\n\t\n\t\n\t}", "public function fullTextImage(){\n if(isset($this->imageFullText)){\n return $this->imageFullText;\n }\n $this->fetchFullTextImage();\n return $this->imageFullText;\n }", "public function pdpgraficooriginal()\n {\n $img = $this->input->post('base64'); //envia los datos del grafico tipo texto por el imput oculto\n $id = $this->input->post('id'); //devuelve el id para quedar en la grafica\n $img = str_replace('data:image/png;base64,', '', $img);\n $fileData = base64_decode($img);\n $fileName = MANEJADOR_RUTA_GRAFICAS . uniqid() . '_' . $id . '.png'; //ruta de ubicacion al cuardar mas el nombre e id del usuario\n file_put_contents($fileName, $fileData); //donde se guarda y la ruta temporal\n redirect(MANEJADOR_CONFIG . '/usuario_controller/grafica/' . $id); //redirecciona a la grafica\n }", "private function getBase64Extension($base64) {\n //All images are given in jpeg format by front-end\n if (preg_match('/image\\/jpeg/', $base64)) {\n return 'jpg';\n }\n //TODO add documents and other types\n }", "public function getImageResource()\n {\n return imagecreatefromstring($this->getRaw());\n }", "function base64_url_encode($input)\n{\nreturn strtr(base64_encode($input), '+/=', '-_,');\n}", "function base64Decode($scrambled) {\n\n // Initialise output variable\n\n $output = \"\";\n\n \n\n // Do encoding\n\n $output = base64_decode($scrambled);\n\n \n\n // Return the result\n\n return $output;\n\n}", "function base64_encode($data)\n{\n}", "public static function physicalFileToBase64($fullPathFile)\n {\n $type = pathinfo($fullPathFile, PATHINFO_EXTENSION);\n $data = file_get_contents($fullPathFile);\n $base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);\n\n return $base64;\n }", "public static function changeBase64($base, $dir, $name){\n $convert = base64_decode(preg_replace('#^data:image/\\w+;base64,#i', '', $base));\n $img = Image::make($convert);\n $size = strlen((string) $img->encode($img->mime));\n if($size <= 20000000) {\n // $path = $img->StoreAs($dir, $name);\n // dd(public_path());\n $path_tmb = public_path().'/img/thumbnails/'.Upload::generateRandomString(10).\".png\";\n \n $img->save($path_tmb);\n $path = Storage::putFileAs($dir, new File($path_tmb), $name);\n unlink($path_tmb);\n return $path;\n }else {\n redirect()\n ->back()\n ->withErrors(sprintf('Gagal Upload , file terlalu besar : %s.', \"errors\"));\n }\n }", "function base64Encode($plain) {\n // Initialise output variable\n $output = \"\";\n \n // Do encoding\n $output = base64_encode($plain);\n \n // Return the result\n return $output;\n}", "function image2string($file_name) {\n\t \n\t //load the native CI Image_lib\n\t\t$this->CI->load->library('image_lib');\n\t\t\n\t\t//change the 'upload' to your own image storage folder's name\n\t\t//and place it on root folder (beside application and system)\n\t\t$image_lib['source_image'] = getcwd().'/uploads/'.$file_name;\n\t\t\n //let the maintain_ratio TRUE if you don't want the image get stretched\n\t\t$image_lib['maintain_ratio'] = TRUE;\n\t\t\n\t\t//set the width or height of the image to you likings\n\t\tif ($upload_data['image_width'] > $upload_data['image_height']) {\n\t\t\n\t\t //for landscape\n\t\t\t$image_lib['width'] = 400;\n\t\t\t$image_lib['height'] = 300;\n\t\t} else {\n\t\t\n\t\t //for portrait\n\t\t\t$image_lib['width'] = 300;\n\t\t\t$image_lib['height'] = 400;\n\t\t}\n\t\t$this->CI->image_lib->initialize($image_lib);\n\t\t$this->CI->image_lib->resize();\n\n //load file helper so we can read the images contents\n\t\t$this->CI->load->helper('file');\n\t\t\n\t\t//set the function to return the image string\n\t\treturn read_file(base_url().'uploads/'.$upload_data['file_name']);\n\t\t\n //in case you no longer need the image file, just delete it with unlink\n\t\tunlink(getcwd().'/uploads/'.$upload_data['file_name']);\n\t\t\n\t}", "function get_profile_pic($img)\n{\n\tdefine('UPLOAD_DIR', 'ProfilePics/');\n\t$img \t= str_replace('data:image/png;base64,', '', $img);\n\t$img \t= str_replace(' ', '+', $img);\n\t$data \t= base64_decode($img);\n $file \t= UPLOAD_DIR . uniqid() . '.jpg';\n $success = file_put_contents($file, $data);\n \n\treturn $success ? $file : 'some problem occured';\n}", "function get_court_pic($img)\n{\n\tdefine('UPLOAD_DIR', 'CourtPics/');\n\t$img \t= str_replace('data:image/png;base64,', '', $img);\n\t$img \t= str_replace(' ', '+', $img);\n\t$data \t= base64_decode($img);\n $file \t= UPLOAD_DIR . uniqid() . '.jpg';\n $success = file_put_contents($file, $data);\n \n\treturn $success ? $file : 'some problem occured';\n}", "public function testImageInfoIsEncodedCorrectlyWithMimeType()\n {\n // The model must be used here or any `'` in the blob must be escaped.\n $imageBlob = file_get_contents(\"/var/www/html/tests/fixtures/image.png\");\n Entry::create(1, 1, '2020-01-01', 'content', $imageBlob);\n\n Session::getInstance()->setUser(User::login(\"someuser\", \"password\"));\n $entries = Entry::getEntriesForCurrentUser();\n $formatted = $entries[0]->getEncodedImage();\n\n $this->assertEquals($formatted, \"data:image/png;base64,\" . base64_encode($imageBlob));\n }", "function Base64Encode( $str )\n{ \n return substr(chunk_split(base64_encode( $str ),64,\"\\n\"),0,-1).\"\\n\";\n}", "function Attachment_data($image_url)\n{\n $image = file_get_contents($image_url); \n $encode = base64_encode($image);\n return chunk_split($encode); \n}", "public static function DecodeBase64Image($base64_string, $output_file)\n {\n $isUploaded = false;\n $ifp = fopen($output_file, 'w');\n chmod($output_file, 0777);\n $data = explode(',', $base64_string);\n if (fwrite($ifp, base64_decode($data[0]))) {\n $isUploaded = true;\n }\n\n // clean up the file resource\n fclose($ifp);\n\n return $isUploaded;\n }", "public function saveFromBase64($data)\n {\n $f = finfo_open();\n $mimeType = finfo_buffer($f, base64_decode($data), FILEINFO_MIME_TYPE);\n unset($f);\n if (!$mimeType || !$this->isMimeTypeValid($mimeType)) {\n throw new \\Exception('Wrong mime type. Given: '.$mimeType);\n }\n\n // Save icon to tmp file\n $fh = tmpfile();\n stream_filter_append($fh, 'convert.base64-decode', STREAM_FILTER_WRITE);\n fwrite($fh, $data);\n\n // Save icon\n $location = stream_get_meta_data($fh)['uri'];\n $icon = $this->saveIcon($location);\n\n // Close handle and return icon\n fclose($fh);\n unset($fh);\n return $icon;\n }", "function change_picture($data, $pic) {\n $data = str_replace('data:image/png;base64', '', $data);\n $data = str_replace(' ', '+', $data);\n $data = base64_decode($data);\n $source_img = imagecreatefromstring($data);\n $file = '../users/'.$_SESSION['username'].'/'.$pic.'.jpg';\n imagejpeg($source_img, $file,75);\n imagedestroy($source_img);\n http_response_code(200);\n}", "public function createImgBase64($img, $use_img_check = true){\n\t\treturn self::createImgBase64Static($img, $use_img_check);\n\t}", "public function toEncodedURI() : string {\n\t\t\tif ($this->uri === null) {\n\t\t\t\t$this->uri = 'data:image/png;base64,' . urlencode(base64_encode($this->render()));\n\t\t\t}\n\t\t\treturn $this->uri;\n\t\t}", "function base64_url_decode($input)\n{\nreturn base64_decode(strtr($input, '-_,', '+/='));\n}", "public function generateImageString($params = null)\n {\n $this->setDefineHeader(false)\n ->parseParams($params)\n ->prepareSourceImageData()\n ->validateSourceImagePath()\n ->parseSourceImageData()\n ->calculateRatio()\n ->prepareThumbData()\n ->calculateFactorHeight()\n ->calculateFactorWidth()\n ->calculateDestinationImageDimensions()\n ->calculateDestinationStartPoints();\n\n ob_start();\n $this->generateThumbnail();\n $imageString = ob_get_clean();\n ob_end_clean();\n\n $sourceImageType = pathinfo($this->getSourceFilePathName(), PATHINFO_EXTENSION);\n return 'data:image/'.$sourceImageType.';base64,'.base64_encode($imageString);\n }", "protected static function filter_base64($value)\n\t{\n\t\treturn base64_encode($value);\n\t}", "function resize($width, $height) {\n list($w, $h) = getimagesize($_FILES['file']['tmp_name']);\n /* calculate new image size with ratio */\n $ratio = max($width / $w, $height / $h);\n $h = ceil($height / $ratio);\n $x = ($w - $width / $ratio) / 2;\n $w = ceil($width / $ratio);\n /* new file name */\n $path = '../uploads/' . date(\"y\") . date(\"j\") . date(\"H\") . date(\"s\") . $width . 'x' . $height . '_'. $_FILES['file']['name'];;\n /* read binary data from image file */\n \n echo json_encode($path);\n \n \n $imgString = file_get_contents($_FILES['file']['tmp_name']);\n /* create image from string */\n $image = imagecreatefromstring($imgString);\n $tmp = imagecreatetruecolor($width, $height);\n imagecopyresampled($tmp, $image, 0, 0, $x, 0, $width, $height, $w, $h);\n /* Save image */\n switch ($_FILES['file']['type']) {\n case 'image/jpeg':\n imagejpeg($tmp, $path, 100);\n break;\n case 'image/png':\n imagepng($tmp, $path, 0);\n break;\n case 'image/gif':\n imagegif($tmp, $path);\n break;\n default:\n exit;\n break;\n }\n return $path;\n \n /* cleanup memory */\n imagedestroy($image);\n imagedestroy($tmp);\n}", "public function getFileImage(): string\n {\n return (string) $this->fileImage;\n }", "public function getImageByID ($id_image = 0) {\n $this->connection->where('id_image', $id_image);\n $result = $this->connection->select('base64', 'images');\n\n if ($result && $result->num_rows > 0) {\n while($row = $result->fetch_assoc()) {\n $image = array(\n 'base64' => $row['base64'],\n );\n\n // if (file_exists('./images/' . $row['filename'])) {\n // $image['base64'] = base64_encode(file_get_contents('./images/' . $row['filename']));\n // }\n break;\n }\n\n return $image;\n }\n\n return null;\n }", "function base64url_encode($plainText) \n{\n $base64 = base64_encode($plainText);\n $base64url = strtr($base64, '+/=', '-_,');\n return $base64url;\n}", "public static function base642base64url($data) {\n return rtrim(strtr($data, '+/', '-_'), '=');\n }", "function GetImage($path){\n if(file_exists($path)){\n $type = pathinfo($path, PATHINFO_EXTENSION);\n $data = file_get_contents($path);\n $img = 'data:image/'.$type.';base64,'.base64_encode($data);\n return $img;\n }\n else{\n return \"\";\n }\n}", "public function uploadProfilePicture(Request $request)\n {\n\n $uploadedImage = $request['profile_img'];\n\n\n\n $pictureType = $uploadedImage->getClientOriginalExtension();\n\n\n //$pictureStr = (string) Image::make( $uploadedImage )->resize( 105, 105 )->encode( $pictureType );\n\n\n $pictureStr = (string) Image::make( $uploadedImage )->\n resize( 105, null, function ( $constraint ) {\n $constraint->aspectRatio();\n })->encode( $pictureType );\n\n \n \n\n\n\n //$uuploadedImage = Image::make($uploadedImage)->resize(105, 105);\n\n //Image::make($uploadedImage)->resize(105,105)->save('foo' . $uploadedImage->getClientOriginalExtension());\n\n //$uploadedImage = Image::make($uploadedImage)->resize(105,105);\n\n //$pictureFile = file_get_contents($uuploadedImage); \n\n\n //$image = base64_encode(file_get_contents($uuploadedImage->pat‌​h()));\n \n \n $pictureBlob = base64_encode($pictureStr);\n\n\n DB::table('users')\n ->where('users.id', '=', $request->get('id'))\n ->update(['users.profile_picture' => $request->get('id'), 'users.profile_picture' => $pictureBlob, \n 'users.profile_picture_type' => $pictureType\n\n ]);\n \n \n\n \n \n\n return Redirect::back();\n\n\n }", "public static function base64ToPhysicalFile($base64EncodedString, string $pathDestDir)\n {\n $binData = base64_decode(preg_replace('#^data:image/\\w+;base64,#i', '', $base64EncodedString));\n\n $extension = self::guessExtensionOfRawData($binData);\n\n // how file will be named\n $destFilename = sprintf('%s-%s.%s', md5(microtime()), md5(rand() . 'xxx' . rand()), $extension);\n $pathDest = UtilFilesystem::joinPaths($pathDestDir, $destFilename);\n file_put_contents($pathDest, $binData);\n\n return $pathDest;\n }", "public static function imagesReplaceBase64( $html ){\n\n // $html = preg_replace('/<img%20/' , \"<img \" , $html );\n\n preg_match_all('/<img[^>]+>/i',$html,$out,PREG_PATTERN_ORDER);\n // return $out;\n if(count($out[0]) != 0 ){\n foreach($out[0] as $img){\n $begen = strpos($img, \"http\");\n $rest = substr($img,$begen);\n $LinksOfImages[] = str_replace(strstr($rest, '\"'),\"\",$rest);\n }\n } else {\n return $html ;\n }\n\n foreach($LinksOfImages as $link){\n $LinksOfImagess[$link] = str_replace(\" \",\"%20\",$link);\n }\n //return $LinksOfImagess;\n\n foreach($LinksOfImagess as $org => $link){\n try{\n\n $binary = file_get_contents($link);\n $base = base64_encode($binary);\n $mime = getimagesizefromstring($binary)[\"mime\"];\n $str=\"data:\".$mime.\";base64,\";\n $img = $str.$base;\n $arr[$org] = $img ;\n }catch (Exception $e) {\n $arr[$org] = $link;\n }\n }\n\n //return $arr;\n $htmsl = $html ;\n\n\n foreach($arr as $link => $base){\n $htmsl = str_replace($link,$base,$htmsl);\n }\n return $htmsl;\n }", "function writeimage( $imagepath ) {\r\n global $CFG;\r\n\r\n if (empty($imagepath)) {\r\n return '';\r\n }\r\n\r\n $courseid = $this->course->id;\r\n if (!$binary = file_get_contents( \"{$CFG->dataroot}/$courseid/$imagepath\" )) {\r\n return '';\r\n }\r\n\r\n $content = \" <image_base64>\\n\".addslashes(base64_encode( $binary )).\"\\n\".\r\n \"\\n </image_base64>\\n\";\r\n return $content;\r\n }", "public function base64_encode_image ($filename, $filetype) {\n\n if (is_file($filename) || (is_string($filename) && (strlen($filename) > 0))) {\n\n $imgbinary = fread(fopen($filename, \"r\"), $this->find_filesize($filename));\n\n return 'data:image/' . $filetype . ';base64,' . base64_encode($imgbinary);\n\n }else{\n\n if(!is_file($filename)){\n\n error_log(__LINE__.'base64_encode_image() NOT IS_FILE!!');\n\n }\n\n if(!is_string($filename) && (strlen($filename) > 0)){\n\n error_log(__LINE__.'base64_encode_image() NOT IS_STRING!!');\n\n }\n\n }\n\n }", "function decode($input) {\n return base64_decode($input);\n }", "public function createFromBase64String($base64String)\n {\n if (empty($base64String)) {\n throw new Exception('Empty base64 string given');\n }\n\n $picture = InterventionFacade::make($base64String);\n $picture->orientate();\n\n return $picture;\n }", "public static function uploadFileUsingBase64($fileData)\n {\n $image = base64_decode($fileData);\n $image_name = 'file' . '_' . time() . '.png';\n $path = public_path() . \"/uploads/\" . $image_name;\n file_put_contents($path, $image);\n $record = ['file_name' => $image_name, 'file_extention' => 'png', 'url' => '/uploads/' . $image_name];\n return $record;\n }", "function build_post()\n{\n $user_id = $_SESSION['id'];\n $body = $_POST['file'];\n $sticker_id = $_POST['sticker_id'];\n $sticker_coord_x = $_POST['sticker_coord_x'];\n $sticker_coord_y = $_POST['sticker_coord_y'];\n $description = $_POST['description'];\n\n if (empty($body) || empty($user_id))\n {\n echo \"oooops\";\n return FALSE;\n }\n\n // Trim off encoding string\n $prefix = strpos($body, ',') + strlen(',');\n $data = substr($body, $prefix);\n\n // Decode into binary image\n $selected_photo = base64_decode($data);\n\n // Call file name function and render image function\n $filename = generate_filename($user_id);\n// error_log(\"!!!!!\");\n// error_log($sticker_id);\n// error_log(empty($sticker_coord_x));\n// error_log($sticker_coord_y);\n// error_log(\"Tuta:\". boolval(empty($selected_photo)));\n// error_log($filename);\n $result = render_image($sticker_id, $sticker_coord_x, $sticker_coord_y, $selected_photo, $filename);\n\n if (!$result)\n {\n echo 'error';\n return FALSE;\n }\n\n if (!add_post($user_id, $filename, $description))\n {\n echo '<p class=\"error\"> Could not upload :( </p>';\n return FALSE;\n }\n echo $filename;\n return TRUE;\n}", "public function base64EncodeImage($strPrefix = false)\r\n\t\t {\r\n\t\t\t$strSourcePath = $this->objParent->target_path;\r\n\t\t\t$strReturn = false;\r\n\t\t\tif (file_exists($strSourcePath))\r\n\t\t\t{\r\n\t\t\t\t$strImageBinay = fread(fopen($strSourcePath, \"r\"), filesize($strSourcePath));\r\n \t\t\t$strReturn = ((bool) $strPrefix ? 'data:image/' . $this->getImageExtension() . ';base64,' : '') . base64_encode($strImageBinay);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn ($strReturn);\r\n\t\t }", "public function display_choice_image($choice_id){\n\n $image = $this->challenge_question_model->display_question_choice_image($choice_id);\n $this->output->set_header('Content-type: image/png');\n $this->output->set_output(base64_decode($image['image']));\n\n }", "function encodeCustomBase64($raw) {\n\t$base64 = base64_encode($raw);\n\t$customBase64 = strtr($base64, DEFAULT_BASE64, CUSTOM_BASE64);\n\treturn $customBase64;\n}", "protected function _makeImage()\n {\n $result = array();\n $width='170';\n $height='40';\n $characters= mt_rand(5,7);\n $possible = '123456789aAbBcCdDeEfFgGhHIijJKLmMnNpPqQrRstTuUvVwWxXyYZz';\n $code = '';\n $i = 0;\n while ($i < $characters) {\n $code .= substr($possible, mt_rand(0, strlen($possible)-1), 1);\n $i++;\n }\n $font = './fonts/Milonga-Regular.ttf';\n /* font size will be 70% of the image height */\n $font_size = $height * 0.67;\n try {\n $image = @imagecreate($width, $height);\n /* set the colours */\n $text_color = imagecolorallocate($image, 20, 40, 100);\n $noise_color = imagecolorallocate($image, 100, 120, 180);\n /* generate random dots in background */\n for( $i=0; $i<($width*$height)/3; $i++ ) {\n imagefilledellipse($image, mt_rand(0,$width), mt_rand(0,$height), 1, 1, $noise_color);\n }\n /* generate random lines in background */\n for( $i=0; $i<($width*$height)/150; $i++ ) {\n imageline($image, mt_rand(0,$width), mt_rand(0,$height), mt_rand(0,$width), mt_rand(0,$height), $noise_color);\n }\n /* create textbox and add text */\n $textbox = imagettfbbox($font_size, 0, $font, $code);\n $x = ($width - $textbox[4])/2;\n $y = ($height - $textbox[5])/2;\n imagettftext($image, $font_size, 0, $x, $y, $text_color, $font , $code);\n ob_start();\n imagejpeg($image);\n $image_code = ob_get_contents ();\n ob_end_clean();\n imagedestroy($image);\n $result = array();\n $result['1'] = base64_encode($image_code);\n Tinebase_Session::getSessionNamespace()->captcha['code'] = $code;\n } catch (Exception $e) {\n if (Core::isLogLevel(LogLevel::NOTICE)) Core::getLogger()->notice(__METHOD__ . '::' . __LINE__ . ' ' . $e->getMessage());\n }\n return $result;\n }" ]
[ "0.66056406", "0.6549904", "0.6549904", "0.6549904", "0.65218616", "0.6515471", "0.6508633", "0.64702266", "0.64379996", "0.64375913", "0.6426032", "0.63914585", "0.63342065", "0.6328248", "0.6311814", "0.6283171", "0.62531686", "0.62498945", "0.61767113", "0.61458457", "0.6121897", "0.610571", "0.6093569", "0.60397667", "0.59906656", "0.5978885", "0.5848938", "0.58359206", "0.58007056", "0.57853127", "0.5778537", "0.57536715", "0.56805944", "0.5678388", "0.56296676", "0.56269383", "0.5614444", "0.56070364", "0.55867326", "0.5573281", "0.55613977", "0.55551416", "0.5550917", "0.55486107", "0.5546282", "0.5543117", "0.55369544", "0.552177", "0.54875284", "0.5477283", "0.5466141", "0.54631394", "0.5456053", "0.545268", "0.54415184", "0.54378945", "0.5428624", "0.535786", "0.5356114", "0.5354619", "0.5349558", "0.5348296", "0.5347589", "0.5346793", "0.5344981", "0.53373855", "0.53286624", "0.53227955", "0.5314638", "0.52873605", "0.5272983", "0.52666104", "0.5265723", "0.52623963", "0.5261609", "0.52601206", "0.52538687", "0.5247924", "0.5238222", "0.52365094", "0.5231875", "0.5226121", "0.5225342", "0.5218318", "0.52068263", "0.51922524", "0.5182543", "0.5171238", "0.5164485", "0.51576704", "0.5151886", "0.5148621", "0.5148548", "0.51469296", "0.5139592", "0.51319665", "0.51259094", "0.5114225", "0.5100728", "0.5100613", "0.50893533" ]
0.0
-1
Function to delete image(s) in folder "upload/image/" from string (textarea)
public function delete_inline($str = '') { $img = array(); $start = '<img'; $end = '>'; $pattern = sprintf('/%s(.+?)%s/ims', preg_quote($start, '/'), preg_quote($end, '/')); $search = true; $i = 1; while($search) { if (preg_match($pattern, $str, $matches)) { list(, $match) = $matches; $img[$i] = $start . $match . $end; $str = str_replace($start . $match . $end, "{gambar_$i}", $str); $i++; } else { $search = false; break; } } $img_to_check = array(); foreach ($img as $key=>$val) { if(strpos($val, base_url($this->upload_dir)) !== FALSE) { $ex_val = explode(base_url(), $val); $to_check = substr($ex_val[1], 0, strpos($ex_val[1], '"')); $img_nm = str_replace($this->upload_dir, '', $to_check); $img_nm_2 = substr($img_nm, 0, strpos($img_nm, '-img')); if(!in_array($img_nm_2, $img_to_check)) $img_to_check[] = $img_nm_2; } } foreach ($img_to_check as $k => $v) { $old_images = $this->get($v, '', TRUE); foreach($old_images as $k2 => $v2) { unlink($v2); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteTextSectionBoxImg(){\n\t\tif(count($_POST)>0){\t\t\t\n\t\t\t\t\t\t\n\t\t\t$location_id = $_POST['location_id'];\n\t\t\t$this->db->where(\"location_id\", $location_id);\n\t\t\t\n\t\t\tif($this->db->query(\"update tbl_school_text_sections set left_photo='' where location_id=\".$location_id.\"\"))\n\t\t\t{\t\n\t\t\t\t/*$dir=pathinfo(BASEPATH);\n\t\t\t\t//echo $dir; die;\n\t\t\t\t$img=$dir['dirname'].'/'.$_POST['image_path'];\t\t\t\t\n\t\t\t\tunlink($img); */\t\t\t\t\t\n\t\t\t\techo 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 0;\n\t\t\t}\n\t\t}else{\n\t\t\t\techo 0;\n\t\t}\n\t\n\t}", "function delete_image() {\n\tif(isset($_POST['remove'])){\n\t\tglobal $wpdb;\n\t\t$img_path = $_POST['path'];\n\n\t\t// We need to get the images meta ID.\n\t\t$query = \"SELECT ID FROM wp_posts where guid = '\" . esc_url($img_path) . \"' AND post_type = 'attachment'\";\n\t\t$results = $wpdb->get_results($query);\n\n\t\t// And delete it\n\t\tforeach ( $results as $row ) {\n\t\t\twp_delete_attachment( $row->ID ); //delete the image and also delete the attachment from the Media Library.\n\t\t}\n\t\tdelete_option('pochomaps_map_image'); //delete image path from database.\n\t}\n}", "function deleteImage($image = \"\")\n {\n if (!$image)\n $image = $this->image;\n unlink ($image);\n }", "public static function deleteImage(){}", "function delete($image, $path) {\n\t\tif($path) {\n\t\t\t$path = $path.DS;\n\t\t}\n @unlink(Configure::read('__Site.upload_path').DS.$path.$image);\n\t}", "public function actionDeleteimage()\n {\n $this->enableCsrfValidation = false;\n $filename = Yii::$app->request->post('filename');\n $path_name = \"../web/web_mat/temp/\" . $filename;\n if (unlink($path_name)) {\n echo \"success\";\n } else {\n echo \"fail\";\n }\n }", "function imageAllDelete();", "public function deleteAboutImg(){\n\t\t\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\tif(count($_POST)>0){\t\t\t\n\t\t\t\t\t\t\n\t\t\t$location_id = $_POST['location_id'];\n\t\t\t$this->db->where(\"location_id\", $location_id);\n\t\t\t\n\t\t\tif($this->db->query(\"update tblschool_about_school set photo='' where location_id=\".$location_id.\"\"))\n\t\t\t{\t\n\t\t\t\t/*$dir=pathinfo(BASEPATH);\n\t\t\t\t//echo $dir; die;\n\t\t\t\t$img=$dir['dirname'].'/'.$_POST['image_path'];\t\t\t\t\n\t\t\t\tunlink($img); */\t\t\t\t\t\n\t\t\t\techo 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 0;\n\t\t\t}\n\t\t}else{\n\t\t\t\techo 0;\n\t\t}\n\t\n\t}", "function delete_logoimage() \n {\n \n $fullpath = './assets/uploads/fashion_prod/';\n $thumbpath = './assets/uploads/fashion_prod/thumbs/';\n $picture=$_POST[\"r_logoimage\"];\n \n unlink($fullpath.$picture);\n unlink($thumbpath.$picture);\n $this->db->delete('productimages', array('imagename' => $picture));\n echo true;\n \n }", "function remove_image($image_id)\n\t{\n\t\t// global variables from config/db_config.php\n\t\tglobal $idea_db;\n\t\tglobal $images_db_table;\n\t\tglobal $db_hostname;\n\t\tglobal $db_user;\n\t\tglobal $db_password;\n\n\t\t// get the image's name to remove from file system\n\t\t$image = get_image($image_id);\n\n\t\t// construct query\n\t\t$query = \"DELETE FROM images WHERE images . id='$image_id'\";\n\n\t\t//send query\n\t\tif (send_query($query,$db_hostname,$db_user,$db_password,$idea_db))\n\t\t{\n\t\t\t// remove from file system\n\t\t\tunlink($image);\n\t\t} else {\n\t\t\t// TODO: Error occured with removing image. Redirect Appropriately.\n\t\t\t// debug\n\t\t\techo \"<h1> Image Not Deleted </h1>\";\n\t\t}\n\t}", "function deletePhoto($imageNom, $link)\n{\n /* SUPPRIME DU SERVEUR */\n unlink($imageNom);\n\n /* SUPPRIME DE LA BASE DE DONNEES */\n $query = \"DELETE FROM Photo WHERE nomFich = '\" . $imageNom . \"'\";\n executeUpdate($link, $query);\n\n $imageNom = str_replace(array( '..', '/', '\\\\', ':' ), '', $imageNom);\n}", "public function deleteVideoSectionImg(){\n\t\tif(count($_POST)>0){\t\t\t\n\t\t\t\t\t\t\n\t\t\t$location_id = $_POST['location_id'];\n\t\t\t$this->db->where(\"location_id\", $location_id);\n\t\t\t\n\t\t\tif($this->db->query(\"update tbl_school_video_section set photo='' where location_id=\".$location_id.\"\"))\n\t\t\t{\t\n\t\t\t\t/*$dir=pathinfo(BASEPATH);\n\t\t\t\t//echo $dir; die;\n\t\t\t\t$img=$dir['dirname'].'/'.$_POST['image_path'];\t\t\t\t\n\t\t\t\tunlink($img); */\t\t\t\t\t\n\t\t\t\techo 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 0;\n\t\t\t}\n\t\t}else{\n\t\t\t\techo 0;\n\t\t}\n\t\n\t}", "public function deleteImage($id){\n $id = strip_tags($id);\n\n $sql = \"DELETE FROM image WHERE id = :id\";\n $query = $this->db->prepare($sql);\n $query->execute(array(':id' => $id));\n\n }", "public function deleteAboutImgMultiLocation(){\n\t\t\n\t\t\n\t\tif(count($_POST)>0){\t\t\t\n\t\t\t\t\t\t\n\t\t\t$location_id = $_POST['location_id'];\n\t\t\t$photo = $_POST['photo'];\n\t\t\t//echo $_POST['image_path'];die;\n\t\t\t$this->db->where(\"location_id\", $location_id);\n\t\t\t\n\t\t\tif($photo == 'right_photo'){\n\t\t\t\t$query = $this->db->query(\"update tblaboutschoolheader set right_photo='' where location_id=\".$location_id.\"\");\n\t\t\t}else {\n\t\t\t\t$query = $this->db->query(\"update tblaboutschoolheader set left_photo='' where location_id=\".$location_id.\"\");\n\t\t\t}\n\t\t\tif($query)\n\t\t\t{\t\n\t\t\t\t$dir=pathinfo(BASEPATH);\n\t\t\t\t//print_r($dir) ; die;\n\t\t\t\t$img=$dir['dirname'].'/'.$_POST['image_path'];\t\t\t\t\n\t\t\t\tunlink($img);\t\t\t\t\t\n\t\t\t\techo 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 0;\n\t\t\t}\n\t\t}else{\n\t\t\t\techo 0;\n\t\t}\n\t\n\t}", "public function deleteImage($path)\n {\n // $file_name = end($file);\n File::delete(public_path($path));\n // File::delete($file_name);\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "function deleteUserImageFiles($username) {\n $target_dir = \"uploads/\" . $username . \"/\";\n\n $files = glob(\"$target_dir/*.*\");\n foreach ($files as $file) {\n unlink($file);\n }\n if (is_dir($target_dir)) {\n rmdir($target_dir);\n }\n}", "public function remove_image() {\n\t\t$this->join_name = \"images\";\n\t\t$this->use_layout=false;\n\t\t$this->page = new $this->model_class(Request::get('id'));\n\t\t$image = new WildfireFile($this->param(\"image\"));\n\t\t$this->page->images->unlink($image);\n\t}", "public function deleteImage($file)\n { \n // Separate file into name and paths \n $this->parseFileName($file);\n \n $dir = new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($this->file_path));\n foreach($dir as $dir_file){ \n $parts = explode('/', str_replace($this->file_path, '', $dir_file));\n \n if($this->filename == \"/\" . $parts[ count($parts)-1 ]){\n unlink($dir_file);\n }\n }\n \n @unlink($file);\n }", "function delete_image($imageId) {\n\t\t\tglobal $wpdb;\n\t\t\t$sql = \"select `filename` from `\".$this->table_img_name.\"` where `id` = '\".$imageId.\"'\";\n\t\t\t$img = $wpdb->get_row($sql, ARRAY_A, 0);\n\n\t\t\t$sql = \"delete from `\".$this->table_img_name.\"` where `id` = '\".$imageId.\"'\";\n\t\t\t$wpdb->query($sql);\n\n\t\t\t$page = $this->plugin_path.$this->images_dir.\"/\".$img['filename'];\n\n\t\t\t@unlink( $page );\n\n\t\t\t$fileExt = split( \"\\.\", $img['filename'] );\n\t\t\tif( $fileExt[1] != \"swf\" ) \n\t\t\t\t{\n\t\t\t\t\t $thumb = $this->plugin_path.$this->images_dir.\"/thumb_\".$img['filename'];\n\t\t\t\t\t @unlink( $thumb );\n\t\t\t\t}\n\t\t}", "public function delete_img(string $table, string $image_folder = '../../../photos'){\n\n $return_info = ['error'=>1, 'message' => 'Greska pri brisanju slike.'];\n $img_name = $this->name();\n\n // iz baze\n $delete_db = $this->delete_object_from_db($table, ['id']);\n if ($delete_db['error']) return $return_info;\n\n\n //iz foldera\n $delete_from_folder = $this->delete_image_from_folers($img_name, $image_folder);\n if ($delete_from_folder) {\n $return_info['error'] = 0;\n $return_info['message'] = 'Slika uspešno izbrisana.';\n return $return_info;\n }\n\n return $return_info;\n\n }", "public function delete_multipleimage() \n {\n \n $fullpath = './assets/uploads/fashion_prod/';\n $bigpath = './assets/uploads/fashion_prod/mainimage/';\n $thumbpath = './assets/uploads/fashion_prod/thumbs/';\n $picture=$_POST[\"key\"];\n \n unlink($fullpath.$picture);\n unlink($bigpath.$picture);\n unlink($thumbpath.$picture);\n $this->db->delete('productimages', array('imagename' => $picture));\n echo true;\n \n }", "function removeImage() {\n\t\t\n $image = $this->getImageByImageId();\n \n $file_image = $this->dir_path.$image['path_image'];\n\n $this->deleteImage(array('image_id' => $image['image_id'] ));\n\n if(file_exists($file_image)) {\n @unlink($file_image);\n }\n\t\t\n\t}", "public function deleteImage($image){\n if( !empty( $image ) ){\n \t\t\t\\File::delete( public_path( $image ) );\n \t\t}\n return true;\n }", "function delete($id_img)\r\n\t{\r\n\t\tglobal $nuked, $user, $language, $repertoire, $niveau_upload, $galerie_adm, $nb_quotas;\r\n\r\n\t\tif($user[1] >= $niveau_upload)\r\n\t\t{\r\n\t\t\t$sql=mysql_query(\"SELECT fichier FROM \".ESPACE_MEMBRE_TABLE.\" WHERE id = '\".$id_img.\"' \");\r\n\t\t\tlist($fichier) = mysql_fetch_array($sql);\r\n\r\n\t\t\t$img = $repertoire.\"/\".$user[0].\"/\".$fichier;\r\n\r\n\t\t\t$del=mysql_query(\"DELETE FROM \".ESPACE_MEMBRE_TABLE.\" WHERE id='\".$id_img.\"' \");\r\n\t\t\t@unlink($img);\r\n\t\t\techo\"\t<div style=\\\"text-align: center;\\\"><br /><br /><b>\"._IMGDELETE.\"</b><br /><br /></div>\";\r\n\r\n\t\t\tredirect(\"index.php?file=Espace_membre&op=compte\",3);\r\n\t\t}else{\r\n\t\t\techo\"\t<div style=\\\"text-align: center;\\\"><br /><br /><b>\" . _NOTACCES . \"</b><br /><br /></div>\";\r\n\t\t\tredirect(\"index.php?file=Espace_membre\", 3);\r\n\t\t}\r\n\t}", "public function delete_file(){\n unlink('/opt/lampp/htdocs/specijalisticki_rad/uploaded_images/'.$this->name);\n\n }", "function delete_image($path,$file){\n \n $main = $path.$file;\n $thumb = $path.'thumb/'.$file;\n $medium = $path.'medium/'.$file;\n $large = $path.'large/'.$file;\n\n if(file_exists(FCPATH.$main)):\n unlink( FCPATH.$main);\n endif;\n if(file_exists(FCPATH.$thumb)):\n unlink( FCPATH.$thumb);\n endif;\n if(file_exists(FCPATH.$medium)):\n unlink( FCPATH.$medium);\n endif;\n if(file_exists(FCPATH.$large)):\n unlink( FCPATH.$large);\n endif;\n return TRUE;\n }", "function del_image_from_object($obj_type, $obj_id, $img_id)\n{\n db()->query('DELETE FROM object_images WHERE obj_type = \"' . strtok($obj_type, \" \") .\n '\" AND obj_id = ' . (int)$obj_id . ' AND img_id = ' . (int)$img_id);\n\n delete_image($img_id);\n}", "function deleteImage() {\n\t$errorFlag = FALSE;\n\n\t$index = intval($_POST[\"imageId\"]);\n\t$xmlImages = simplexml_load_file($_SESSION['cuneidemo']['imagesList']);\n\t$annotationfile = $_SESSION['cuneidemo']['annotationsPath'] . ($xmlImages->image[$index]->annotation);\n\t$imagefile = $_SESSION['cuneidemo']['imagesPath'] . ($xmlImages->image[$index]->file);\n\t$imageThumb = $_SESSION['cuneidemo']['collectionFolder'] . thumbs . DIRECTORY_SEPARATOR . ($xmlImages->image[$index]->file) . '-thumb.jpg';\n\t$imagefile = $imagefile . '.jpg';\n\n\t// LOG START\n\tlogMessage(\"Asked for deletion of file \" . $_POST[\"imageId\"] . \" (\" . (string) ($xmlImages->image[$index]->file) . \".jpg) in group \".$_SESSION['cuneidemo']['group']. \"(\"\n\t\t\t. $_SESSION['cuneidemo']['groupName'] . \"), collection \".$_SESSION['cuneidemo']['collection'].\" (\" . $_SESSION['cuneidemo']['collectionName'] . \")\");\n\n\t// save annotations' names\n\n\tif($xmlImages->image[$index]->annotation != \"empty\") {\n\t\t$annoList = glob(\"$annotationfile-v*.xml\");\n\t\tarray_push($annoList, \"$annotationfile.xml\");\n\t} else {\n\t\t$annoList = array();\n\t}\n\tarray_push($annoList, $imagefile);\n\tarray_push($annoList, $imageThumb);\n\n\t// BAckup everything in a zip-file\n\t$backupDirectory = 'data/trash/';\n\n\t$zip = new ZipArchive();\n\t$filename = $backupDirectory . $_SESSION['cuneidemo']['user'] . time() . \".zip\";\n\n\tif($zip->open($filename, ZipArchive::CREATE) !== TRUE) {\n\t\t$error = \"Error creating Zip file!\";\n\t\tlogMessage(\"Error creating Zip file!\");\n\t\t$errorFlag = TRUE;\n\t} else {\n\t\tforeach($annoList as $anno) {\n\t\t\t$test = (boolean) ($zip->addFile($anno));\n\n\t\t\tif($test != TRUE) {\n\t\t\t\t$error = \"Error adding file to Zip file!\";\n\t\t\t\tlogMessage(\"Error adding file '$anno' to Zip file!\");\n\t\t\t\t$errorFlag = TRUE;\n\t\t\t}\n\t\t}\n\t\t$zip->close();\n\n\t\tif(!$errorFlag) {\n\t\t\tlogMessage(\"Image and Annotations saved to ZIP: $filename\");\n\n\t\t\t// Erase Files\n\t\t\tforeach($annoList as $anno) {\n\t\t\t\t$err = unlink($anno);\n\t\t\t\tif(!$err) {\n\t\t\t\t\t$error = \"Error erasing File\";\n\t\t\t\t\tlogMessage(\"Error erasing File\");\n\t\t\t\t\t$errorFlag = TRUE;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlogmessage(\"Image and Annotations erased from disk\");\n\t\t}\n\t}\n\n\tif($errorFlag) {\n\t\techo json_encode(array(\n\t\t\t\t'error' => true,\n\t\t\t\t'Errormsg' => $error\n\t\t));\n\t} else {\n\t\t// Change image total\n\t\t$total = (int) $xmlImages->total;\n\t\t$total--;\n\t\t$xmlImages->total = $total;\n\n\t\t// REMOVE FROM XML\n\t\tunset($xmlImages->image[$index]);\n\n\t\t$counter = 1;\n\n\t\t// Change ID from files\n\t\tforeach($xmlImages->image as $imageInfo) {\n\t\t\t$imageInfo->id = $counter;\n\t\t\t$counter++;\n\t\t}\n\t\t$xmlImages->asXML($_SESSION['cuneidemo']['imagesList']);\n\n\t\tlogMessage(\"Image erased from XML and XML ids updated\");\n\t\techo json_encode(array(\n\t\t\t\t'error' => false\n\t\t));\n\t}\n}", "function unsetImage($uid,$table,$data,$path) {\n\t\n\t $this->db->select($data);\n $this->db->from($table);\n\t\t$this->db->where('uid',$uid);\n $query=$this->db->get();\t\t\n\t\tif($query->num_rows()>0)\n\t\t{\n\t\t $query=$query->result();\n\t\t $img=$query[0]->$data;\n @unlink($path.$img);\n\t\t}\t\n return true;\t\t\n\t}", "public function deleteImage($event)\n {\n $this->unlinkFiles($event->sender->{$this->attribute});\n }", "public function removeImage()\n {\n // Suppression de l'image principale\n $fichier = $this->getAbsolutePath();\n\n if (file_exists($fichier))\n {\n unlink($fichier);\n }\n\n // Suppression des thumbnails\n foreach($this->thumbnails as $key => $thumbnail)\n {\n $thumb = $this->getUploadRootDir() . '/' . $key . '-' . $this->name;\n if (file_exists($thumb))\n {\n unlink($thumb);\n }\n }\n }", "public function removeImage($image)\n {\n if (file_exists('upload_image/' . $image)) {\n unlink('upload_image/' . $image);\n }\n }", "public function deleteImageAndCleanField($id, $fieldName)\n {\n $repository = $this->repository->findOrFail($id);\n if ($image = $repository[$fieldName]) {\n $this->repository->deleteImage($image);\n }\n\n $repository[$fieldName] = \"\";\n $repository->save();\n\n return true;\n }", "function deleteImage($filename, $target_file)\n{\n // remove from list\n $list = read_file_list();\n $pivot = array_search($filename, $list);\n $left = array_slice($list, 0, $pivot);\n $right = array_slice($list, $pivot+1);\n $list = array_merge($left, $right);\n\n // remove file and output modified list\n unlink($target_file);\n write_file_list($list);\n\n echo $target_file . \" deleted successfully.<br>\";\n}", "function deleteimage()\r\n\t{ \t\r\n\t if (isset($_POST['remove']) && $_POST['remove']=='remove selected')\r\n\t {//get the values \r\n \t $id1 = array();\r\n \t $id1 = $_POST['removeid'];\r\n \t $parentid = $_POST['parentid'];\r\n \t if (count($id1) > 0)\r\n \t { //fetch each and every one check box item\r\n \t foreach ($id1 as $id)\r\n \t {\r\n \t \t$this->categeory_model->deleteimage($id);\r\n \t \tunlink('./assets/fun/image'.$id.'.jpg');\r\n \t\t unlink('./assets/fun/thumbnail_'.$id.'.jpg');\r\n \t }\r\n\t }\r\n\t }\r\n\t else{\r\n\t \t\r\n\t\t$id = $this->uri->segment(4);\r\n\t\t$parentid = $this->uri->segment(5);\r\n\t\t$this->categeory_model->deleteimage($id);\r\n\t\tunlink('./assets/fun/image'.$id.'.jpg');\r\n \t unlink('./assets/fun/thumbnail_'.$id.'.jpg');\r\n\t }\r\n\tredirect('admin/categeory/image_view/'.$parentid);\r\n\t}", "function uninstall(bool $deleteimages = false)\n{\n $meta = file_exists(DEFAULT_METAFILE) ? textFileToArray(DEFAULT_METAFILE) : null;\n $files = glob(VAR_FOLDER . DS . '{,.}[!.,!..]*', GLOB_MARK|GLOB_BRACE);\n foreach ($files as $file) {\n unlink($file);\n }\n\n if (true === $deleteimages) {\n $imagesdir = $meta && count($meta) && array_key_exists('imagesfolder', $meta) ? ROOT_FOLDER . DS . $meta['imagesfolder'] : DEFAULT_IMAGEFOLDER;\n\n $files = glob($imagesdir . DS . '{,.}[!.,!..]*', GLOB_MARK|GLOB_BRACE);\n foreach ($files as $file) {\n unlink($file);\n }\n }\n\n if ($meta) {\n unlink(DEFAULT_METAFILE);\n }\n}", "public function deleteImage1()\n {\n Storage::delete($this->image1);\n }", "function delete_image($path,$file){\n \n $main = $path.$file;\n $thumb = $path.'thumb/'.$file;\n $medium = $path.'medium/'.$file;\n $large = $path.'large/'.$file;\n //pr($thumb);\n if(file_exists(FCPATH.$main)):\n unlink( FCPATH.$main);\n endif;\n if(file_exists(FCPATH.$thumb)):\n unlink( FCPATH.$thumb);\n endif;\n if(file_exists(FCPATH.$medium)):\n unlink( FCPATH.$medium);\n endif;\n if(file_exists(FCPATH.$large)):\n unlink( FCPATH.$large);\n endif;\n return TRUE;\n }", "public function remove()\n {\n $file = $this->security->xss_clean($this->input->post(\"file\"));\n $id = $this->security->xss_clean($this->input->post(\"id\"));\n if ($file && file_exists($file)) {\n unlink($file);\n $this->db->where(array('url_image'=>$file,'idProduct'=>$id));\n $this->db->delete('imageProduct');\n }\n }", "function delete_imagemfrase($idImagemFrase)\n {\n return $this->db->delete('ImagemFrase',array('idImagemFrase'=>$idImagemFrase));\n }", "public function deleteImage($image)\n\t{\n\t\t$uploadDir = $this->getUploadDir();\n\n\t\tif ( is_array($this->thumbs) AND !empty($this->thumbs) )\n\t\t{\n\t\t\tforeach (array_keys($this->thumbs) as $thumbDir)\n\t\t\t\t@unlink($uploadDir.'/'.$thumbDir.'/'.$image);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t@unlink($uploadDir.'/'.$image);\n\t\t}\n\n\t\t// Delete all cropped images from this object\n\t\tif ( is_dir($uploadDir . '/_cropped') )\n\t\t{\n\t\t\t$croppedImages = FileHelper::findFiles($uploadDir.'/_cropped', [\n\t\t\t\t'only' => ['*_|_' . $image],\n\t\t\t]);\n\n\t\t\tforeach ($croppedImages as $croppedImage)\n\t\t\t{\n\t\t\t\t@unlink($croppedImage);\n\t\t\t}\n\t\t}\n\t}", "public function deletePicture($id){\n $picName = null;\n $images = new Images();\n $dataPic = $images->get_image($id);\n foreach ($dataPic as $key => $value) {\n $picName = $value->img_url;\n }\n $checkFile = file_exists(public_path() . '/' . $picName);\n if ($checkFile){\n unlink(public_path() . '/' . $picName);\n }\n }", "function delImage($filename)\n\t{\n\t\t// TODO: Retrieve different pictures from root model\t\t\n\t\tif(is_file(WWW_ROOT . \"img/thumbnails/\" . $filename)) {\n\t\t\tunlink(WWW_ROOT . \"img/thumbnails/\" . $filename);\n\t\t}\n\t\tif(is_file(WWW_ROOT . \"img/medium/\" . $filename)) {\n\t\t\tunlink(WWW_ROOT . \"img/medium/\" . $filename);\n\t\t}\n\t\tif(is_file(WWW_ROOT . \"img/large/\" . $filename)) {\n\t\t\tunlink(WWW_ROOT . \"img/large/\" . $filename);\n\t\t}\n\t\tif(is_file(WWW_ROOT . \"img/original/\" . $filename)) {\n\t\t\tunlink(WWW_ROOT . \"img/original/\" . $filename);\n\t\t}\n\t\treturn true;\n\t}", "public function delete_image_from_storage($image_file_name) {\n\t\t unlink(\"product_images/\".$image_file_name);\n\t }", "public function actionDeletepimage()\n\t{\n\t $sessionimagesarr = array();\n\t if($_POST['type']=='1'){\n\t\t @unlink(Yii::getPathOfAlias('webroot').'/'.$_POST['path']);\n\t\t $thumbpath = str_replace(basename($_POST['path']), 'thumb/'.basename($_POST['path']),$_POST['path']);\n\t\t @unlink(Yii::getPathOfAlias('webroot').'/'. $thumbpath);\n\t\t }else{\n\t\t $images = Images::model()->findByPK($_POST['path']);\n\t\t @unlink( Yii::getPathOfAlias('webroot').'/'.$images->image_path );\n\t\t $thumbpath = str_replace(basename($images->image_path), 'thumb/'.basename($images->image_path),$images->image_path);\n\t\t @unlink(Yii::getPathOfAlias('webroot').'/'. $thumbpath);\n\t\t $images->delete();\n\t\t }\n\t \n\t\t echo 'Deleted';\n\t\t die;\n\t}", "function _delete_photo($file){\n\t\t@unlink('web/upload/'.image_small($file));\n\t\t@unlink('web/upload/'.image_large($file));\n\t}", "public function delImage($img_name){\n\t\t\n\t\t$db = $this->_connect;\n\t\t$img = $db->prepare(\"DELETE FROM img WHERE img_name = ?\");\n\t\t$img->bind_param(\"s\",$img_name);\n\t\tif(!$img->execute()){\n\t\t\techo $db->error;\n\t\t}\n\t\t\n\t}", "public function deleteImage($field, $data) {\n if (isset($data['Tag']['id'])) {\n\n $dir = new Folder(WWW_ROOT . 'files' . DS . 'tag' . DS . $field . DS . $data['Tag']['id']);\n $files = $dir->find();\n\n foreach ($files as $file) {\n $file = new File($dir->pwd() . DS . $file);\n $file->delete();\n $file->close();\n }\n\n }\n }", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "function local_avatars_delete_image($user_id){\n\tlocal_avatars_get_plugin()->file_handler->delete_image($user_id);\n}", "function delete_commun($id_img)\r\n\t{\r\n\t\tglobal $nuked, $user, $language, $rep_comun, $niveau_upload, $galerie_adm, $nb_quotas;\r\n\r\n\t\t$sql = mysql_query(\"SELECT fichier FROM \".ESPACE_MEMBRE_COMMUN_TABLE.\" WHERE id = '\" . $id_img . \"' \");\r\n\t\tlist($fichier) = mysql_fetch_array($sql);\r\n\r\n\t\t$img = $rep_comun.$fichier;\r\n\techo $id_img;\r\n\t\t$del=mysql_query(\"DELETE FROM \".ESPACE_MEMBRE_COMMUN_TABLE.\" WHERE id='\".$id_img.\"' \");\r\n\t\t@unlink($img);\r\n\t\techo\"\t<div style=\\\"text-align: center;\\\"><br /><br /><b>\"._IMGDELETE.\"</b><br /><br /></div>\";\r\n\r\n\t\tredirect(\"index.php?file=Espace_membre\",3);\r\n\t}", "function qform_remove_file($def, $cfg)\n{\n global $config;\n if ($config['demo_mode']) {\n msg_die($cfg['msg']['ok']);\n }\n\n $field = get_param('field');\n $primary_val = get_param('primary_val');\n $idx = get_param('idx');\n\n // get field type\n foreach ($def as $t) {\n if ($t['field'] == $field) {\n $type = $t['type'];\n $prefix = (!empty($t['prefix'])) ? $t['prefix'] : '';\n }\n }\n\n // get filename\n $res = sql_query(\"SELECT $field FROM $cfg[table] WHERE $cfg[primary_key] = '$primary_val' LIMIT 1\");\n $row = sql_fetch_array($res);\n\n if (!empty($row[$field]) || ($type == 'img_series') || ($type == 'img_set')) {\n $fn = $row[$field];\n\n // remove file\n $fn = $row[$field];\n if ($type == 'file') {\n @unlink($cfg['file_folder'].'/'.$fn);\n }\n if (($type == 'img') || ($type == 'image') || ($type == 'img_resize') || ($type == 'image_resize')) {\n @unlink($cfg['img_folder'].'/'.$fn);\n }\n if ($type == 'thumb') {\n @unlink($cfg['img_folder'].'/'.$fn);\n @unlink($cfg['thumb_folder'].'/'.$fn);\n }\n if (($type == 'img_series') || ($type == 'img_set')) {\n $x = get_param('idx');\n $ok = false;\n $i = $x;\n $fn = $prefix.'_'.$primary_val.'_'.$i;\n unlink(\"$cfg[img_folder]/$fn.jpg\");\n unlink(\"$cfg[thumb_folder]/$fn.jpg\");\n\n while (!$ok) {\n $i++;\n $fn_old = $prefix.'_'.$primary_val.'_'.$i;\n $fn_new = $prefix.'_'.$primary_val.'_'.($i - 1);\n\n if (file_exists(\"$cfg[img_folder]/$fn_old.jpg\")) {\n rename(\"$cfg[img_folder]/$fn_old.jpg\", \"$cfg[img_folder]/$fn_new.jpg\");\n rename(\"$cfg[thumb_folder]/$fn_old.jpg\", \"$cfg[thumb_folder]/$fn_new.jpg\");\n } else {\n $ok = true;\n }\n }\n }\n\n // update db\n $old = sql_qquery(\"SELECT * FROM $cfg[table] WHERE $cfg[primary_key]='$primary_val' LIMIT 1\");\n sql_query(\"UPDATE $cfg[table] SET $field='' WHERE $cfg[primary_key] = '$primary_val' LIMIT 1\");\n if (!empty($cfg['enable_log'])) {\n // create log - get new values\n $new = sql_qquery(\"SELECT * FROM $cfg[table] WHERE $cfg[primary_key]='$primary_val' LIMIT 1\");\n if ($old != $new) {\n if (empty($cfg['detailed_log'])) {\n $foo = $old[$cfg['log_title']];\n $old = $new = '';\n $old[$cfg['log_title']] = $foo;\n }\n qform_log($primary_val, $old[$cfg['log_title']], LOG_DEL_FILE, $old, $new, $cfg['table']);\n }\n }\n }\n\n msg_die($cfg['msg']['ok']);\n}", "public function deleteDomainImagePreview($img,$domain_id) {\n $tempImgPath= public_path('preview_images');\n $returnurl =($domain_id)?'backend/edit-domain-image/'.$domain_id :'backend/add-domain-image';\n if($img !='' && file_exists($tempImgPath.'/'.$img)){\n unlink($tempImgPath.'/'.$img);\n }\n return Redirect::to($returnurl);\n }", "public function deleteImage($image_path,$file_name)\n {\n if($file_name!=\"\"){\n unlink($image_path.$file_name);\n unlink($image_path.'thumbnails/small/'.$file_name);\n unlink($image_path.'thumbnails/medium/'.$file_name);\n unlink($image_path.'thumbnails/large/'.$file_name);\n }\n }", "function deleteImg($myprofile, $colomn, $userID){\n\n\t\t$folder = $colomn == 'cover'? 'cover' : 'avatar'; \n\t\t$formErrors = array(); //initialize the errors array\n\n\t\tif(!empty($myprofile[0][$colomn])){\n\t\t\t$oldImg = $myprofile[0][$colomn]; //get the image string before deleting\n\n\t\t\t$update = updateItems('users', $colomn . ' = ?', array('', $userID), 'id = ?');\n\t\t\tif($update <= 0) $formErrors[] = @lang('ERR_DEL_PRO_IMG');\n\t\t\telse{\n\t\t\t\t//delete the image from the folder\t\t\t\t\t\n\t\t\t\tif(!empty($oldImg)){\n\t\t\t\t\t@unlink('layout/images/profiles/' . $folder . '/' . $oldImg);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $formErrors;\n\t}", "public function delete_related_images($column_name = 'image',$folder) {\n\t\t$image_name = $this->getOriginal($column_name);\n\t\t// if we don't have previous image then no need to delete it.\n\t\tif ( ! is_null($image_name) && file_exists($this->upload_path .$folder.'/modified/'.$image_name)) {\n\t\t\t$image_path = $this->upload_path .$folder.'/modified/'.$image_name;\n\n\t\t\t$img = Image::make($image_path);\n\t\t\t$mask = $img->filename . '*.*';\n\n\t\t\tarray_map('delete_if_exists', glob(public_path('uploads/'.$folder.'/modified/' . $mask)));\n\t\t}\n\t}", "function deleteUserImage($id)\n {\n $connect = new Config();\n $sql = \"SELECT user_info FROM user_db WHERE id = :id\";\n $query = $connect->connectPDO()->prepare($sql);\n $query->bindParam(':id', $id, \\PDO::PARAM_INT);\n $query->execute();\n $delImage = $query->fetch();\n\n $decoded = json_decode($delImage['user_info'], true);\n $image = $decoded['user_image'];\n\n if ($delImage != DEFAULT_IMAGE) {\n unlink($_SERVER['DOCUMENT_ROOT'] . $image);\n }\n }", "function delete_all()\n\t\t{\n\t\t\tif($this->input->post('checkbox_value'))\n\t\t\t{\n\t\t\t\t$id = $this->input->post('checkbox_value');\n\t\t\t/*$imgpic = $this->db->get_where('users' , array('ID' => $id))->result();\n\t\t\tforeach ($imgpic as $img_delete)\n\t\t\t{\n\n\t\t\t\t$path = './uploads/admin/'.$img_delete->image;\n\t\t\t\tunlink($path);\n\t\t\t}*/\n\t\t\tfor($count = 0; $count < count($id); $count++)\n\t\t\t{\n\t\t\t\t$this->AboutModel->delete($id[$count]);\n\t\t\t}\n\t\t}\n\t}", "public function deleteImage(string $type, $id);", "public function delete($pathToImage)\n {\n File::delete($pathToImage);\n }", "private function deleteImageFile($name){\n $path = 'assets/images/'.$name;\n return unlink($path);\n\n }", "public function delete_imagen($img_id){\n\t\t$img = $this->get_img($img_id);\n\n\t\tif(!$this->db->where(\"sli_id\",$img_id)->delete(\"slide\") ){\n\t\t\treturn FALSE;\n\t\t}\n\t\tunlink(\"./imagenes/\".$img->sli_img_nombre);\n\t\treturn TRUE;\n\t}", "public function delete_image_file()\n {\n if(Image::remove_image($this->image_url))\n {\n $this->image_url = '';\n return true;\n }\n return true; \n }", "function deletePhoto($file,$dir){\n\t\n\t@unlink($dir.$file);\n}", "private function delete_old_picture(){\n foreach ( glob( UPLOADS.$this->get_name_sanitized().'.*' ) as $picture ){\n if(is_writable($picture)){unlink($picture);}\n }\n }", "public function supprimerImageMorphoAction()\n\t{\n\t\t$id_cons = $this->params()->fromPost('id_cons');\n\t\t$id = $this->params()->fromPost('id'); //numero de l'image dans le diapo\n\t\t$typeExamen = $this->params()->fromPost('typeExamen');\n\t\n\t\t/**\n\t\t * RECUPERATION DE TOUS LES RESULTATS DES EXAMENS MORPHOLOGIQUES\n\t\t*/\n\t\t $result = $this->demandeExamensTable()->recupererDonneesExamenMorpho($id_cons, $id, $typeExamen);\n\t\t/**\n\t\t * SUPPRESSION PHYSIQUE DE L'IMAGE\n\t\t*/\n\t\t unlink ( 'C:\\wamp\\www\\simens\\public\\images\\images\\\\' . $result['NomImage'] . '.jpg' );\n\t\t/**\n\t\t * SUPPRESSION DE L'IMAGE DANS LA BASE\n\t\t*/\n\t\t $this->demandeExamensTable()->supprimerImage($result['IdImage']);\n\t\n\t\t$this->getResponse()->getHeaders ()->addHeaderLine ( 'Content-Type', 'application/html' );\n\t\treturn $this->getResponse ()->setContent(Json::encode ());\n\t}", "public function actionDeleteimg($id) {\n $model = $this->loadModel($id);\n $imagefile = $model->image;\n if ($imagefile <> '') {\n CommonFunctions::deleteFile(Yii::app()->params['blogImagePath'], $imagefile, true);\n CommonFunctions::updateFileField('', $id, 'blog_id', 'image', $model->tableName(), 'image_name_date');\n }\n EUserFlash::setSuccessMessage(CommonFunctions::getText(MSG_IMAGE_DELETE_SUCCESS));\n $this->redirect(array('update', 'id' => $model->blog_id));\n }", "public function delete()\n {\n $post_id = $this->uri->rsegment('3');\n $this->_del($post_id);\n $image = $this->input->get('image');\n unlink(\"upload/post\".$image);\n // thong bao xoa thanh cong\n $this->session->set_flashdata('message', 'Xóa thành công tin tức này');\n redirect(admin_url('blog'));\n }", "public function deleteImage()\n {\n $this->checkImage($this->logo, $this);\n }", "public function presentation_image_delete($image_id)\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$image_id = rawurldecode($image_id);\n\t\t\t$this->load->model('presentation_images_model', 'pim');\n\t\t\t$this->pim->delete($image_id);\n\t\t\tredirect('/admin/presentation_images','refresh');\n\t\t}", "public function deleteImage(){\n if(file_exists($this->getImage())){\n unlink($this->getImage());\n }\n $this->setImage(null);\n }", "function narrative_delete_pictures($pictures, $new_narrative_dir, $pictures_for_deletion = array())\n{\n foreach ($pictures as $i => $picture)\n {\n if (in_array(basename($picture), $pictures_for_deletion))\n {\n $picture_dest = $new_narrative_dir . 'deleted/' . basename($picture);\n }\n else\n {\n $picture_dest = $new_narrative_dir . basename($picture);\n }\n rename($picture, $picture_dest);\n }\n}", "function imageDelete($property);", "public function deleteImages() {\n foreach (glob( ARTICLE_IMAGE_PATH . \"/\" . IMG_TYPE_FULLSIZE . \"/\" . $this->id . \".*\") as $filename) {\n if ( !unlink( $filename ) ) trigger_error( \"Book::deleteImages(): Couldn't delete image file.\", E_USER_ERROR );\n }\n \n // Delete all thumbnail images for this book\n foreach (glob( ARTICLE_IMAGE_PATH . \"/\" . IMG_TYPE_THUMB . \"/\" . $this->id . \".*\") as $filename) {\n if ( !unlink( $filename ) ) trigger_error( \"Book::deleteImages(): Couldn't delete thumbnail file.\", E_USER_ERROR );\n }\n \n // Remove the image filename extension from the object\n $this->imageExtension = \"\";\n }", "public function actionDeleteimage($id){\n\n $image = Images::findOne($id);\n\n $service_id = $image->service_id;\n\n $url = Url::to('@frontend/web/img/clinic/services/') . $image->file;\n $urlThumb = Url::to('@frontend/web/img/clinic/services/thumbs/') . $image->file;\n\n // Delete image from the database and the folder\n if (unlink($url) && unlink($urlThumb) && $image->delete())\n return true;\n else\n return false;\n }", "public function delete_img_unlink() {\n //create ad time\n $img_name = $this->input->post('img_name');\n $type = $this->input->post('type');\n if($type == 'create'){\n echo 'create';\n $img_path_thumb = 'uploads/ads/'.$img_name;\n $img_path_thumb_view = 'uploads/ads/'.$img_name;\n \n $extension = image_type_to_extension($img_name);\n $img_path_original = 'uploads/ads/original/original-'.$img_name.$extension;\n \n unlink($img_path_original);\n //$img_path_original = base_url().'uploads/ads/_thumb/'.$img_name;\n unlink($img_path_thumb);\n unlink($img_path_thumb_view);\n\n $delete_path = $this->session->userdata['img'];\n $pos = array_search($img_name, $delete_path);\n // if($delete_path.indexOf($img_name) !== -1){\n //unset($delete_path[array_search($img_name, $delete_path)]);\n unset($delete_path[$pos]);\n $this->session->set_userdata('img',$delete_path);\n // }\n }else if($type == 'edit'){\n echo 'edit';\n $id = $this->input->post('id');\n if($id){\n $data = array(\n 'StatusID'=> 3,\n 'DeletedBy'=> $this->session->userdata('log_id'),\n 'DeletedDT'=> date('Y-m-d H:i:s')\n );\n $this->Advertisement->image_deleted($id, $data);\n }\n }\n \n \n //Edit ad then ad new pic and delete\n \n }", "public function delete_image($id)\n {\n $this->db->where_in('Id', $id);\n $this->db->delete('uploads');\n if($this->db->affected_rows() > 0)\n {\n return true;\n }\n else\n {\n return false; \n }\n }", "public function actionDeleteguideimage()\n\t{\n\t $sessionimagesarr = array();\n\t if($_POST['type']=='1'){\n\t\t unlink(Yii::getPathOfAlias('webroot').'/'.$_POST['path']);\n\t\t }else{\t\t \n\t\t $images = Images::model()->find('item_type=:item_type AND item_id=:item_id',array(':item_type'=>'guide','item_id'=>$id));\n\t\t\t unlink( Yii::getPathOfAlias('webroot').'/'.$images->image_path );\n\t\t\t $images->delete();\t\t \n\t\t }\n\t \n\t\t echo 'Deleted';\n\t\t die;\n\t}", "private static function toDelete(){\n $filesNotToDelete = [];\n $dir = public_path().'/images/';\n $filesInPublicFolder = scandir($dir);\n\n // izbacivanje assets foldera, .. i .\n $ignoreFiles = ['assets', '.', '..', 'pig.png', 'placeholder.png', 'logo.png', 'index.php'];\n foreach ($ignoreFiles as $toIgnore) {\n if (($key = array_search($toIgnore, $filesInPublicFolder)) !== false) {\n unset($filesInPublicFolder[$key]);\n }\n }\n // dd($filesInPublicFolder);\n $images = [];\n $collectionsOfObjectsWithImages = [Product::all(), ProductGroup::all(), Manufacturer::all(),\n Suggestion::all(), ImageSuggestion::all(), MainAd::all(),SecondAd::all()];\n\n foreach ($collectionsOfObjectsWithImages as $collection) {\n foreach ($collection as $object) {\n if($object->images->count()){\n foreach ($object->images as $image) {\n $images[] = $image->name;\n }\n }\n }\n }\n\n // dd($images);\n // dd(array_diff($filesInPublicFolder, $images));\n // dd($filesNotToDelete, $filesInPublicFolder);\n return $toDelete = array_diff($filesInPublicFolder, $images); //za fju array_dif vazan je redoslijed argumenata\n\n }", "function borrarImagen($idImagen, $ruta){\n $conn=connexioBD();\n $sql=\"DELETE FROM imatges WHERE id='$idImagen'\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n unlink($ruta);\n $conn->close();\n}", "function _ddb_cover_upload_cleanup() {\n $data = _ddb_cover_upload_session('ddb_cover_upload_submitted');\n\n // Mark image as upload to prevent more uploads of the same data.\n _ddb_cover_upload_session('ddb_cover_upload_submitted', '');\n\n // Remove local copy of the image.\n file_unmanaged_delete($data['image_uri']);\n}", "function deleteimages($a)\n{\n //connecting to database\n include ('dbconnect.php');\n\n //part for deleting images from folder\n $query1 = \"SELECT * FROM images WHERE id IN ($a)\";\n \n //function call to fetcharray\n $result = fetchfunction($query1);\n while( $row = $result->fetch_assoc())\n {\n unlink(\"images/\".$row[\"images\"]);\n }\n\n //query to delete images from database\n $query = \"DELETE FROM images WHERE id IN($a)\";\n\n //executing query\n mysqli_query($conn, $query);\n}", "public function deleteImage() {\n $file = $this->getImageFile();\n \n // check if file exists on server\n if (empty($file) || !file_exists($file)) {\n return false;\n }\n \n // check if uploaded file can be deleted on server\n if (!unlink($file)) {\n return false;\n }\n \n // if deletion successful, reset your file attributes\n $this->imagen = null;\n $this->file = null;\n \n return true;\n }", "function del_images_object($obj_type, $obj_id)\n{\n $rows = db()->query('SELECT img_id FROM object_images WHERE obj_type = \"' . strtok($obj_type, \" \") .\n '\" AND obj_id = ' . (int)$obj_id);\n if (!$rows)\n return false;\n\n foreach ($rows as $row)\n delete_image($row['img_id']);\n\n db()->query('DELETE FROM object_images WHERE obj_type = \"' . strtok($obj_type, \" \") .\n '\" AND obj_id = ' . (int)$obj_id);\n\n return true;\n}", "public function delImg($item_id, $imgfile)\n {\n $this->db->update(array('id'=>$item_id), array('$pull'=>array('imgs'=>$imgfile)));\n \n // if this img is defimg, remove it, and replace with next img if still exists\n if ( $this->db->getOne(array('id'=>$item_id, 'defimg'=>$imgfile)) )\n {\n $defimg = ( $imgs = $this->db->getOne(array('id'=>$item_id, array('imgs'))) ) ? $imgs[0] : null;\n $this->db->update(array('id'=>$item_id), array('defimg'=>null));\n }\n }", "public function deleteImage($id){\n $delete_image=Details::findOrFail($id);\n $image_large=public_path().'/'.$delete_image->image;\n if($delete_image){\n $delete_image->image='';\n $delete_image->save();\n \n unlink($image_large);\n }\n session()->flash('success','Image bien supprimer');\n return back();\n }", "public function removeTempAction() \n {\n $fileName = $this->params()->fromQuery('name', '');\n \n $postId = $this->params()->fromQuery('id', '');\n \n // Validate input parameters\n if (empty($fileName) || strlen($fileName)>128) {\n throw new \\Exception('File name is empty or too long');\n }\n \n // Get path to image file\n $this->imageManager->removeTemp($fileName, $postId);\n \n // Go to the next step.\n return $this->redirect()->toRoute('posts', ['action'=>'edit',\n 'id'=>$postId, 'step'=>2]);\n }", "function del_img_tour($type,$item){\n\tif($type == 'belarus'){\n\t\t$patch = '../../jsdb/JSON/tours/belarus.json';\n\t}\n\tif($type == 'belarus_pref'){\n\t\t$patch = '../../jsdb/JSON/tours/belarus_pref.json';\n\t}\n\tif($type == 'foreigners'){\n\t\t$patch = '../../jsdb/JSON/tours/foreigners.json';\n\t}\n\tif($type == 'foreigners_pref'){\n\t\t$patch = '../../jsdb/JSON/tours/foreigners_pref.json';\n\t}\n\t$exItem = explode('%',$item);\n\t$type = $exItem[0];\n\t$tour = (int)$exItem[1];\n\t$imgName = $exItem[2];\n\t$object = json_decode(file_get_contents($patch));\n\t$object_item = $object[0]->$type;\n\t$folder = $object_item[$tour]->img;\n\t// return $folder;\n\tunlink('../../'.$folder.'/'.$imgName);\n\treturn true;\n}", "public function delete_image($img) {\n $this->db->where('Images',$img);\n $this->db->update('advertisement_image',array('StatusID'=>3));\n }", "public function delete() {\n\n\t \t if(!unlink($this->directory .'/' . $_FILES[$this->inputName]['name']))\n Log::debug('Upload::delete Failed to delete upload');\n else\n Log::debug('Upload::delete Delete successful');\n\t }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n\n if($model->image_url != NULL){\n\n $images = explode(';', $model->image_url);\n\n foreach ($images as $image){\n\n $image = explode('/', $image);\n $image = $image[count($image) - 1];\n $image = Yii::getAlias('@frontend') . '/web/img/upload/' . $image;\n\n if(file_exists($image)){\n\n unlink($image);\n\n }\n\n }\n\n }\n\n $model->delete();\n\n return $this->redirect(['index']);\n }", "function cleanImages()\r\n {\r\n if (!count($this->imagesContent)) return true;\r\n $this->_echo('<br>Очистка не используемых файлов картинок...');\r\n foreach ($this->imagesContent as $file) {\r\n @unlink($this->rootPath.$file);\r\n }\r\n }", "public function actionDelImg(){\n $img_id = Yii::$app->request->post('img_id');\n $model_id = Yii::$app->request->post('model_id');\n\n $docModel = Product::find()\n ->where([\n 'id' => $model_id\n ])\n ->limit(1)\n ->one();\n $img = $docModel->getImageById($img_id);\n $docModel->removeImageNoDel($img);\n }", "function deleteSymboly($q) {\n\n\t// hodnoty parametru pro produkt\n\t$v111 = my_DB_QUERY($q,__LINE__,__FILE__);\n\twhile ($z111 = mysql_fetch_array($v111)) {\n\t\n\t\tunlink(IMG_I_S.$z111['img']);\n\t\tunlink(IMG_I_O.$z111['img']);\n\t\n\t}\n\n}", "public function validarDir(){\n\t\t\t$dir = './assets/uploads/alumnos/1.png';\n\t\t\tif (file_exists($dir)) {\n\t\t\t\tunlink($dir);\n\t \techo \"Borrado\";\n\t }\n\t else{\n\t \techo \"FALSE\";\n\t }\n\t\t}", "public function destroyimage($id) {\n $delete = ProductsGallary::find($id);\n if(!empty($delete->media) and file_exists(public_path().'/upload/products/'.$delete->media))\n {\n unlink(public_path().'/upload/products/'.$delete->media);\n }\n $delete->delete();\n session()->flash('success',trans('admin.deleted'));\n return back();\n }", "function deleteImage() \n\t{\n\t\t$filename = $this->fieldValue(\"theme_backimage\",\"\",\" and user_id=\".$this->user_id);\n\t\tif (trim($filename)!=\"\" && file_exists(THEME_BACK_IMAGE.$filename))\n\t\t\tunlink(THEME_BACK_IMAGE.$filename);\n\t\t\n\t\t$strquery=\"UPDATE \".DB_PREFIX.\"theme SET theme_backimage='', updated_date='\".$this->updated_date.\"', updated_by='\".$this->updated_by.\"' WHERE user_id=\".$this->user_id;\n\t\treturn mysql_query($strquery) or die(mysql_error());\n\t}", "function Deletepropertyimage()\n\t{\t\n\t\t\t$imageid=$this->input->post('imageid');\n\t\t\tif(!empty($imageid))\n\t\t\t{\n\t\t\t\t\t/* $imagename = $this->AddProperty_model->Getotherdata('rp_property_images',array('propertyImageID'=>$imageid));\n\t\t\t\t\tif(!empty($imagename)){ \n\t\t\t\t\t$imgName=$imagename[0]->propertyImageName; */\n\t\t\t\t\t$this->AddProperty_model->Deletepropertyimage($this->input->post('imageid'));\n\t\t\t\t\t\n\t\t\t\t\t/* $originalPath = \"/data/homeonline/$this->severname/public/uploads/property/images/original/\".$imgName; \n\t\t\t\t\t$commonThumbPath = \"/data/homeonline/$this->severname/public/uploads/property/images/thumb/\".$imgName;\n\t\t\t\t\t$mediumPath = \"/data/homeonline/$this->severname/public/uploads/property/images/medium/\".$imgName;\n\t\t\t\t\t$lightboxPath = \"/data/homeonline/$this->severname/public/uploads/property/images/lightbox/\".$imgName;\n\t\t\t\t\t\n\t\t\t\t\tif (file_exists($originalPath)){unlink($originalPath);}\n\t\t\t\t\tif (file_exists($commonThumbPath)){unlink($commonThumbPath);}\n\t\t\t\t\tif (file_exists($mediumPath)){unlink($mediumPath);}\n\t\t\t\t\tif (file_exists($lightboxPath)){unlink($lightboxPath);} */\n\t\t\t\t\t\n\t\t\t\t\techo\"Image Deleted Successfully!!\";\n\t\t\t\t\t//}\n\t\t\t}else{\n\t\t\t\t\techo\"Image Deletion Fail!!\";\n\t\t\t}\n\t\t\n\t}", "function delete_artist( $name ) {\n\n // Define extensions\n $allow_ext = array( 'jpeg', 'jpg', 'png', 'svg', 'webp' );\n\n // Set variables\n $files = browse( './../tmp/images/' );\n $name = parse_track( $name );\n\n // If name is default, skip\n if ( $name == 'default' AND empty( $_FILES[ 'image' ][ 'name' ] ) ) return false;\n\n // If is array, loop through files and match what we're deleting\n if ( is_array( $files ) ) {\n\n foreach ( $files as $file ) { // Loop files\n\n if ( ext_del( $file ) == $name ) { // File matches, delete all extensions of this artist\n\n foreach ( $allow_ext as $ext ) {\n\n // Delete file\n if ( is_file( \"./../tmp/images/\" . ext_del( $file ) . \".{$ext}\" ) )\n @unlink( \"./../tmp/images/\" . ext_del( $file ) . \".{$ext}\" );\n\n }\n return true; // stop loop\n\n } // End match\n\n // If not matched, just continue. no other work to be done.\n\n }\n\n }\n\n return false;\n\n }" ]
[ "0.71468705", "0.6568241", "0.6530515", "0.6522266", "0.64925385", "0.6433204", "0.6336417", "0.6304616", "0.6269292", "0.6255756", "0.62461334", "0.6218025", "0.6205243", "0.62029546", "0.6140321", "0.6121915", "0.6113719", "0.6076112", "0.606387", "0.60293925", "0.59917665", "0.5981081", "0.5980134", "0.5977869", "0.59705174", "0.59617305", "0.59499955", "0.593405", "0.59279776", "0.5925952", "0.59241545", "0.5906391", "0.5899491", "0.5895742", "0.58952796", "0.58895373", "0.5887111", "0.58866113", "0.5884599", "0.58793277", "0.5869823", "0.5868754", "0.58348507", "0.57931507", "0.5789602", "0.57889414", "0.57760733", "0.576691", "0.57564956", "0.57556194", "0.575539", "0.5750073", "0.5749443", "0.57368094", "0.573233", "0.57241637", "0.571588", "0.5704621", "0.5701975", "0.56978184", "0.569407", "0.5690657", "0.5682216", "0.5671148", "0.56688464", "0.56576097", "0.5653982", "0.5644439", "0.5643092", "0.5633998", "0.56326413", "0.5626865", "0.56247085", "0.56228197", "0.56126916", "0.5612254", "0.5611766", "0.55952466", "0.55851775", "0.55849487", "0.55770016", "0.556764", "0.5564997", "0.5562735", "0.555692", "0.5548982", "0.55413693", "0.5533227", "0.55267185", "0.55086666", "0.55075026", "0.5501807", "0.5499939", "0.5495495", "0.5482192", "0.5478668", "0.54767084", "0.54750603", "0.54722303", "0.5468712" ]
0.66651547
1
Function to copy image
public function copy($source, $target) { if(!copy($source, $target)) { return FALSE; } else { return TRUE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function copyImages();", "public function copy_image($image_id=null, $foreign_key=null) {\n\t // test function\n\t $this->Image->image_clone($image_id, $foreign_key);\n\t exit;\n }", "function _copy_image_file($attachment_id)\n {\n }", "function createCopy( $I )\n{\n\t// get width and height\n\t$width = imagesx( $I );\n\t$height = imagesy( $I );\n\t\t\n\t// clone image\n\t$Ires = imageCreateTrueColor($width,$height);\n\timageCopy($Ires,$I,0,0,0,0, $width, $height);\n\t\t\n\t// return image\n\treturn $Ires;\t\t\n}", "function copyImage($srcFile, $destFile, $w, $h, $quality = 75) {\n $tmpSrc = pathinfo(strtolower($srcFile));\n $tmpDest = pathinfo(strtolower($destFile));\n $size = getimagesize($srcFile);\n if ($tmpDest['extension'] == \"gif\" || $tmpDest['extension'] == \"jpg\" || $tmpDest['extension'] == \"jpeg\") {\n $destFile = substr_replace($destFile, 'jpg', -3);\n $dest = imagecreatetruecolor($w, $h);\n imageantialias($dest, TRUE);\n } elseif ($tmpDest['extension'] == \"png\") {\n $dest = imagecreatetruecolor($w, $h);\n // Make the background transparent\n imagealphablending($dest, false);\n imagesavealpha($dest, true);\n $transparentindex = imagecolorallocatealpha($dest, 255, 255, 255, 127);\n imagefill($dest, 0, 0, $transparentindex);\n //imageantialias($dest, TRUE);\n } else {\n return false;\n }\n switch ($size[2]) {\n //GIF\n case 1: $src = imagecreatefromgif($srcFile);\n break;\n //JPEG\n case 2: $src = imagecreatefromjpeg($srcFile);\n break;\n //PNG\n case 3: $src = imagecreatefrompng($srcFile);\n break;\n default: return false;\n break;\n }\n imagecopyresampled($dest, $src, 0, 0, 0, 0, $w, $h, $size[0], $size[1]);\n switch ($size[2]) {\n case 1:\n case 2: imagejpeg($dest, $destFile, $quality);\n break;\n case 3: imagepng($dest, $destFile);\n }return $destFile;\n}", "function copy(&$tmp, $applied_image, $x, $y) {\r\r\n\r\r\n\t\t// open\r\r\n\t\t//\r\r\n\t\t$ci = new Asido_Image;\r\r\n\t\tif (!@$ci->source($applied_image)) {\r\r\n\t\t\ttrigger_error(\r\r\n\t\t\t\tsprintf(\r\r\n\t\t\t\t\t'The image that is going to '\r\r\n\t\t\t\t\t\t. ' be copied \"%s\" is '\r\r\n\t\t\t\t\t\t. ' either missing or '\r\r\n\t\t\t\t\t\t. ' is not readable',\r\r\n\t\t\t\t\t$applied_image\r\r\n\t\t\t\t\t),\r\r\n\t\t\t\tE_USER_WARNING\r\r\n\t\t\t\t);\r\r\n\t\t\treturn false;\r\r\n\t\t\t}\r\r\n\t\t\r\r\n\t\t$ct = $this->prepare($ci);\r\r\n\r\r\n\t\tif (!$this->__copy($tmp, $ct, $x, $y)) {\r\r\n\t\t\ttrigger_error(\r\r\n\t\t\t\t'Failed to copy the image',\r\r\n\t\t\t\tE_USER_WARNING\r\r\n\t\t\t\t);\r\r\n\t\t\treturn false;\r\r\n\t\t\t}\r\r\n\t\t\r\r\n\t\t$this->__destroy_source($ct);\r\r\n\t\t$this->__destroy_target($ct);\r\r\n\r\r\n\t\treturn true;\r\r\n\t\t}", "function my_merge_image ($first_img_path, $second_img_path){\n $width = 1024;\n $height = 512;\n\n //Create new img from file with true color\n $first_img_path = imagecreatefrompng($first_img_path);\n $im = imagecreatetruecolor($width, $height);\n\n // copy and resize part of an img from the path and \"paste\" them side by side\n imagecopyresampled($im, $first_img_path, 0, 0, 0, 0, 1024, 1024, 1024, 1024);\n $second_img_path = imagecreatefrompng($second_img_path);\n imagecopyresampled($im, $second_img_path, 512, 0, 0, 0, 1024, 1024, 1024, 1024);\n\n //save png img from the given img ($im)\n //imagepng($im, \"final_img.png\");\n}", "function copie_image($gl,$path,$name,$mw,$mh,$type) {\n\tglobal $msg;\n\t$msg = '';\n\t\n\t$jpg_quality = 100;\n\n\t$tmp_name = $gl['tmp_name'];\n\n\t$type_f = '';\t\n\tif ($gl['type'] == 'image/jpeg' or $gl['type'] == 'image/pjpeg') { $type_f = \"jpg\"; \t}\n\tif ($gl['type'] == 'image/gif') { $type_f = \"gif\"; }\n\tif ($gl['type'] == 'image/png') { $type_f = \"png\"; }\n\t\n\t// MAUVAIS TYPE -> RENVOI\n\tif ($type_f == '') { $msg = \"Mauvais type de fichier, impossible de copier l'image.\"; return;}\n\n\t// IMAGE SIMPLE REDIMENSIONNE A mw et mh\t\n\tif ($type == 'simple') {\n\t\n\t\t// VERIF DE LA TAILLE\n\t\t$size = GetImageSize($tmp_name);\n\t\t$ow = $size[0];\n\t\t$oh = $size[1];\n\t\tif ($ow > $mw or $oh > $mh) {\n\t\t\t// REDIMENSIONNE \n\t\t\t// CALCUL LES RATIOS\n\t\t\t$rw = $mw/$ow;\n\t\t\t$rh = $mh/$oh;\n\t\t\t\n\t\t\tif ($rw<=$rh) {\n\t\t\t\t// W > H;\n\t\t\t\t$ratio = $rw;\n\t\t\t} else {\n\t\t\t\t// H > W;\n\t\t\t\t$ratio = $rh;\n\t\t\t}\n\t\t\t// CALCUL LES NOUVELLES DIMENSIONS\n\t\t\t$nw = round($ow*$ratio);\n\t\t\t$nh = round($oh*$ratio);\n\t\t\t// CREATION DE LA NOUVELLE IMAGE\n\t\t\tif ($type_f == 'jpg') {\n\t\t\t\t$img = imagecreatefromjpeg($tmp_name);\n\t\t\t\t$img_dest = imagecreatetruecolor($nw,$nh);\n\t\t\t\t//COPIE\n\t\t\t\t$copy = imagecopyresampled($img_dest,$img,0,0,0,0,$nw,$nh,$ow,$oh);\n\t\t\t\timagejpeg($img_dest,$path.$name.\".\".$type_f);//, $jpg_quality);\n\t\t\t}\n\t\t\tif ($type_f == 'gif') {\n\t\t\t\t$img = imagecreatefromgif($tmp_name);\n\t\t\t\t$img_dest = imagecreatetruecolor($nw,$nh);\n\t\t\t\t//COPIE\n\t\t\t\t$copy = imagecopyresampled($img_dest,$img,0,0,0,0,$nw,$nh,$ow,$oh);\n\t\t\t\timagegif($img_dest,$path.$name.\".\".$type_f);\n\t\t\t}\n\t\t\tif ($type_f == 'png') {\n\t\t\t\t$img = imagecreatefrompng($tmp_name);\n\t\t\t\t$img_dest = imagecreatetruecolor($nw,$nh);\n\t\t\t\t//COPIE\n\t\t\t\t$copy = imagecopyresampled($img_dest,$img,0,0,0,0,$nw,$nh,$ow,$oh);\n\t\t\t\timagepng($img_dest,$path.$name.\".\".$type_f);\n\t\t\t}\n\t\t\t// DESTRUCTION\n\t\t\timagedestroy($img_dest);\n\t\t\treturn $type_f;\n\t\t} else {\n\t\t\t// COPIE SIMPLE (LA TAILLE EST DEJA BONNE)\n\t\t\tif (!@copy($tmp_name, $path.$name.\".\".$type_f)) {\n\t\t\t\t$msg = \"Impossible de copier l'image.\";\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\treturn $type_f;\n\t\t\t}\n\t\t}\n\t}\n\n\t// COPY SANS CONTROLE\n/*\tif ($type == 'unique') {\t\n\t\tif (!@copy($tmp_name, $path.$name.\".\".$type_f)) {\n\t\t\t$msg = \"Impossible de copier l'image.\";\n\t\t\treturn;\n\t\t} else {\n\t\t\treturn $type_f;\n\t\t}\n\t}\n*/\t\n\t// COPY SANS CONTROLE\n\tif ($type == 'unique') {\t\n\t\tif (!@copy($tmp_name, $path.$name)) {\n\t\t\t$msg = \"Impossible de copier l'image.\";\n\t\t\treturn;\n\t\t} else {\n\t\t\treturn $type_f;\n\t\t}\n\t}\n\t\n}", "function merge_images($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct){\n $result = imagecreatetruecolor($src_w, $src_h);\n imagecopy($result, $dst_im, 0, 0, $dst_x, $dst_y, $src_w, $src_h);\n imagecopy($result, $src_im, 0, 0, $src_x, $src_y, $src_w, $src_h);\n imagecopymerge($dst_im, $result, $dst_x, $dst_y, 0, 0, $src_w, $src_h, $pct);\n}", "function ImageCopyBicubic ($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) {\n\n global $CFG;\n\n if (function_exists('ImageCopyResampled') and $CFG->gdversion >= 2) { \n return ImageCopyResampled($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y,\n $dst_w, $dst_h, $src_w, $src_h);\n }\n\n $totalcolors = imagecolorstotal($src_img);\n for ($i=0; $i<$totalcolors; $i++) { \n if ($colors = ImageColorsForIndex($src_img, $i)) {\n ImageColorAllocate($dst_img, $colors['red'], $colors['green'], $colors['blue']);\n }\n }\n\n $scaleX = ($src_w - 1) / $dst_w; \n $scaleY = ($src_h - 1) / $dst_h; \n\n $scaleX2 = $scaleX / 2.0; \n $scaleY2 = $scaleY / 2.0; \n\n for ($j = 0; $j < $dst_h; $j++) { \n $sY = $j * $scaleY; \n\n for ($i = 0; $i < $dst_w; $i++) { \n $sX = $i * $scaleX; \n\n $c1 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX,(int)$sY+$scaleY2)); \n $c2 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX,(int)$sY)); \n $c3 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX+$scaleX2,(int)$sY+$scaleY2)); \n $c4 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX+$scaleX2,(int)$sY)); \n\n $red = (int) (($c1['red'] + $c2['red'] + $c3['red'] + $c4['red']) / 4); \n $green = (int) (($c1['green'] + $c2['green'] + $c3['green'] + $c4['green']) / 4); \n $blue = (int) (($c1['blue'] + $c2['blue'] + $c3['blue'] + $c4['blue']) / 4); \n\n $color = ImageColorClosest ($dst_img, $red, $green, $blue); \n ImageSetPixel ($dst_img, $i + $dst_x, $j + $dst_y, $color); \n } \n } \n}", "function ImageCopyBicubic ($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) {\n\n global $CFG;\n\n if (function_exists(\"ImageCopyResampled\") and $CFG->gdversion >= 2) {\n return ImageCopyResampled($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y,\n $dst_w, $dst_h, $src_w, $src_h);\n }\n\n $totalcolors = imagecolorstotal($src_img);\n for ($i=0; $i<$totalcolors; $i++) {\n if ($colors = ImageColorsForIndex($src_img, $i)) {\n ImageColorAllocate($dst_img, $colors['red'], $colors['green'], $colors['blue']);\n }\n }\n\n $scaleX = ($src_w - 1) / $dst_w;\n $scaleY = ($src_h - 1) / $dst_h;\n\n $scaleX2 = $scaleX / 2.0;\n $scaleY2 = $scaleY / 2.0;\n\n for ($j = 0; $j < $dst_h; $j++) {\n $sY = $j * $scaleY;\n\n for ($i = 0; $i < $dst_w; $i++) {\n $sX = $i * $scaleX;\n\n $c1 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX,(int)$sY+$scaleY2));\n $c2 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX,(int)$sY));\n $c3 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX+$scaleX2,(int)$sY+$scaleY2));\n $c4 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX+$scaleX2,(int)$sY));\n\n $red = (int) (($c1['red'] + $c2['red'] + $c3['red'] + $c4['red']) / 4);\n $green = (int) (($c1['green'] + $c2['green'] + $c3['green'] + $c4['green']) / 4);\n $blue = (int) (($c1['blue'] + $c2['blue'] + $c3['blue'] + $c4['blue']) / 4);\n\n $color = ImageColorClosest ($dst_img, $red, $green, $blue);\n ImageSetPixel ($dst_img, $i + $dst_x, $j + $dst_y, $color);\n }\n }\n}", "public function apply() {\n\t\t$w = $this->getWidth();\n\t\t$h = $this->getHeight();\n\n\t\timagecopyresampled($this->original->getImage(), $this->getImage(), $this->x, $this->y, 0, 0, $w, $h, $w, $h);\n\t}", "function cilikke($src, $dest, $new_width) {\r\n\t$info = getimagesize($src);\r\n\t$mime = $info[\"mime\"];\r\n\tif( $mime == 'image/jpeg' ) $source_image = imagecreatefromjpeg($src);\r\n\telseif( $mime == 'image/png' ) $source_image = imagecreatefrompng($src);\r\n\t$width = imagesx($source_image);\r\n\t$height = imagesy($source_image);\r\n\t$new_height = floor($height * ($new_width / $width));\r\n\tif($new_width < $width && $new_height < $height)\r\n\t{\r\n\t\t$virtual_image = imagecreatetruecolor($new_width, $new_height);\t\r\n\t\timagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\r\n\t\timagejpeg($virtual_image, $dest);\r\n\t}else\r\n\t\tcopy($src, $dest);\r\n}", "public function copy();", "function create($filename=\"\")\n{\nif ($filename) {\n $this->src_image_name = trim($filename);\n}\n$dirname=explode(\"/\",$this->src_image_name);\nif(!file_exists(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\")){\n\t@mkdir(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\", 0755);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$this->src_image_name = @iconv(\"utf-8\",\"GBK\",$this->src_image_name);\n\t$this->met_image_name = @iconv(\"utf-8\",\"GBK\",$this->met_image_name);\n}\n$src_image_type = $this->get_type($this->src_image_name);\n$src_image = $this->createImage($src_image_type,$this->src_image_name);\nif (!$src_image) return;\n$src_image_w=ImageSX($src_image);\n$src_image_h=ImageSY($src_image);\n\n\nif ($this->met_image_name){\n $this->met_image_name = strtolower(trim($this->met_image_name));\n $met_image_type = $this->get_type($this->met_image_name);\n $met_image = $this->createImage($met_image_type,$this->met_image_name);\n $met_image_w=ImageSX($met_image);\n $met_image_h=ImageSY($met_image);\n $temp_met_image = $this->getPos($src_image_w,$src_image_h,$this->met_image_pos,$met_image);\n $met_image_x = $temp_met_image[\"dest_x\"];\n $met_image_y = $temp_met_image[\"dest_y\"];\n\t if($this->get_type($this->met_image_name)=='png'){imagecopy($src_image,$met_image,$met_image_x,$met_image_y,0,0,$met_image_w,$met_image_h);}\n\t else{imagecopymerge($src_image,$met_image,$met_image_x,$met_image_y,0,0,$met_image_w,$met_image_h,$this->met_image_transition);}\n}\nif ($this->met_text){\n $temp_met_text = $this->getPos($src_image_w,$src_image_h,$this->met_text_pos);\n $met_text_x = $temp_met_text[\"dest_x\"];\n $met_text_y = $temp_met_text[\"dest_y\"];\n if(preg_match(\"/([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i\", $this->met_text_color, $color))\n {\n $red = hexdec($color[1]);\n $green = hexdec($color[2]);\n $blue = hexdec($color[3]);\n $met_text_color = imagecolorallocate($src_image, $red,$green,$blue);\n }else{\n $met_text_color = imagecolorallocate($src_image, 255,255,255);\n }\n imagettftext($src_image, $this->met_text_size, $this->met_text_angle, $met_text_x, $met_text_y, $met_text_color,$this->met_text_font, $this->met_text);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$save_files=explode('/',$this->save_file);\n\t$save_files[count($save_files)-1]=@iconv(\"utf-8\",\"GBK\",$save_files[count($save_files)-1]);\n\t$this->save_file=implode('/',$save_files);\n}\nif ($this->save_file)\n{\n switch ($this->get_type($this->save_file)){\n case 'gif':$src_img=ImagePNG($src_image, $this->save_file); break;\n case 'jpeg':$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n case 'png':$src_img=ImagePNG($src_image, $this->save_file); break;\n default:$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n }\n}\nelse\n{\nif ($src_image_type = \"jpg\") $src_image_type=\"jpeg\";\n header(\"Content-type: image/{$src_image_type}\");\n switch ($src_image_type){\n case 'gif':$src_img=ImagePNG($src_image); break;\n case 'jpg':$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n case 'png':$src_img=ImagePNG($src_image);break;\n default:$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n }\n}\nimagedestroy($src_image);\n}", "public function copy($source) {}", "private function copyImages()\n {\n $media = [\n 'slider-woman-on-the-beach.jpg'\n ];\n\n $this->mediaMigration->copyMediaFiles($media, self::MIGRATION_MODULE, 'scandiweb/slider/s/l');\n }", "abstract protected function copy();", "function copyFile($oImage, $destination) {\n if (empty($oImage)) {\n $this->farrErrors[] = \"Image not set\";\n return false;\n }\n\n if (empty($destination)) {\n $this->farrErrors[] = \"Image destination path not set\";\n return false;\n }\n\n if ($destination[strlen($destination) - 1] != \"/\" &&\n $destination[strlen($destination) - 1] != \"\\\\\") {\n $destination .= \"/\";\n }\n\n $arrProperty = $oImage->getFileProperty();\n if (@copy($oImage->getFilePath().$oImage->getFileName(),\n $destination.$oImage->getFileName())) {\n\n $arrProperty['filePath'] =\n $destination.$oImage->getFileName();\n\n $oNewImage = new Image();\n\n $oNewImage->initializeByPropertyArray($arrProperty);\n\n return $oNewImage;\n } else {\n $this->farrErrors[] = \"Image copy error\";\n return false;\n }\n }", "function redimage($img_src,$img_dest,$dst_w,$dst_h) {\n // Lit les dimensions de l'image\n $size = GetImageSize($img_src); \n $src_w = $size[0]; $src_h = $size[1]; \n // Teste les dimensions tenant dans la zone\n $test_h = round(($dst_w / $src_w) * $src_h);\n $test_w = round(($dst_h / $src_h) * $src_w);\n // Si Height final non précisé (0)\n if(!$dst_h) $dst_h = $test_h;\n // Sinon si Width final non précisé (0)\n elseif(!$dst_w) $dst_w = $test_w;\n // Sinon teste quel redimensionnement tient dans la zone\n elseif($test_h>$dst_h) $dst_w = $test_w;\n else $dst_h = $test_h;\n\n // La vignette existe ?\n $test = (file_exists($img_dest));\n // L'original a été modifié ?\n if($test)\n $test = (filemtime($img_dest)>filemtime($img_src));\n // Les dimensions de la vignette sont correctes ?\n if($test) {\n $size2 = GetImageSize($img_dest);\n $test = ($size2[0]==$dst_w);\n $test = ($size2[1]==$dst_h);\n }\n\n // Créer la vignette ?\n if(!$test) {\n // Crée une image vierge aux bonnes dimensions\t\n $dst_im = ImageCreateTrueColor($dst_w,$dst_h); \n // Copie dedans l'image initiale redimensionnée\n $src_im = ImageCreateFromJpeg($img_src);\n ImageCopyResampled($dst_im,$src_im,0,0,0,0,$dst_w,$dst_h,$src_w,$src_h);\n // Sauve la nouvelle image\n ImageJpeg($dst_im,$img_dest);\n // Détruis les tampons\n ImageDestroy($dst_im);\n ImageDestroy($src_im);\n }\n}", "function imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct){\n\t$cut = imagecreatetruecolor($src_w, $src_h); \n\n // copying relevant section from background to the cut resource \n\timagecopy($cut, $dst_im, 0, 0, $dst_x, $dst_y, $src_w, $src_h); \n\n // copying relevant section from watermark to the cut resource \n\timagecopy($cut, $src_im, 0, 0, $src_x, $src_y, $src_w, $src_h); \n\n // insert cut resource to destination image \n\timagecopymerge($dst_im, $cut, $dst_x, $dst_y, 0, 0, $src_w, $src_h, $pct); \n}", "private function copyToStorage(Image $image) {\n \t$attrs = $image->attributesToArray();\n\t $this->command->info(\"Copying '{$attrs['path']}' to public folder\");\n \t$filePath = dirname(__FILE__).\"/Images/{$attrs['path']}\";\n \tStorage::put(\"public/images/{$attrs['id']}/{$attrs['path']}\", file_get_contents($filePath));\n }", "public function copy(HGImage $image)\n {\n $this->validateType($type = $image->getImgType());\n\n $newImage = $this->createImage($type, $image->getImgExtension(), $image->getHGFile()->getFilId());\n\n copy($this->getFileManager()->getFilePath($image->getHGFile()), $this->getFileManager()->getFilePath($newImage->getHGFile()));\n\n return $newImage->getImgId();\n }", "function CopyImage($oldImage, $newImage)\n {\n try\n {\n $copied = @copy($oldImage, $this->m_RootFolder.$newImage);\t//Copy image frm orginal path to new path\n if (!$copied)\n {\t//not copied\n return false;\n }\n else\n {\n return true;\n }//end of if (!$copied)\n }\n catch (Exception $ex)\n {\n return false;\n }\n }", "function getImage();", "public function getImage();", "public function getImage();", "public function getImage();", "public function getImage();", "public function generateThumbnail($src, $dst);", "function copyAndCreateThumb( $sDestDir, $mImgSrc, $sImgOutput, $sOption = null ){\n\n // zapamietanie wielkosci dla miniaturek\n $iOldSize = $this->iThumbX;\n\n if( !is_dir( $sDestDir ) )\n return null;\n\n $sImgOutput = $this->throwNameOfFile( $sImgOutput );\n\n $sImgOutput = $this->changeFileName( $sImgOutput );\n\n if( $sOption == 'upload' ){\n if( is_uploaded_file( $mImgSrc['tmp_name'] ) && is_file( $mImgSrc['tmp_name'] ) && filesize( $mImgSrc['tmp_name'] ) > 0 && $this->checkCorrectFile( $mImgSrc['name'], 'jpg|jpeg|gif|png' ) == 1 ){\n $this->sExt = $this->throwExtOfFile( $mImgSrc['name'] );\n $aNewFiles['bFile'] = $this->uploadFile( $mImgSrc, $sDestDir, $sImgOutput.'.'.$this->sExt );\n }\n else\n return null;\n }\n elseif( $sOption == 'copy' ){\n if( is_file( $mImgSrc ) && filesize( $mImgSrc ) > 0 && $this->checkCorrectFile( $mImgSrc, 'jpg|jpeg|gif|png' ) == 1 ){\n $this->sExt = $this->throwExtOfFile( $mImgSrc );\n $aNewFiles['bFile'] = $this->checkIsFile( $sImgOutput.'.'.$this->sExt, $sDestDir, $this->sExt );\n if( !copy( $mImgSrc, $sDestDir.$aNewFiles['bFile'] ) )\n return null;\n }\n else\n return null;\n }\n $sImgPatch = $sDestDir.$aNewFiles['bFile'];\n\n $aNewFiles['bName'] = basename( $aNewFiles['bFile'], '.'.$this->sExt );\n $aNewFiles['sFile'] = $aNewFiles['bName'] . $this->iThumbAdd . '.' . $this->sExt;\n $aImgSize = $this->throwImgSize( $sImgPatch );\n\n if( defined( 'MAX_DIMENSION_OF_IMAGE' ) && ( $aImgSize['width'] > MAX_DIMENSION_OF_IMAGE || $aImgSize ['height'] > MAX_DIMENSION_OF_IMAGE ) ){\n if( $aImgSize['width'] < $this->iMaxForThumbSize && $aImgSize ['height'] < $this->iMaxForThumbSize ){\n $iOldAdd = $this->iThumbAdd;\n $this->setThumbSize( MAX_DIMENSION_OF_IMAGE );\n $this->setThumbAdd( '' );\n $aNewFiles['bFile'] = $this->createThumb( $sImgPatch, $sDestDir, $aNewFiles['bFile'] );\n $this->setThumbSize( $iOldSize );\n $this->setThumbAdd( $iOldAdd );\n }\n else\n return null;\n }\n \n if( $aImgSize['width'] >= $this->iThumbX || $aImgSize['height'] >= $this->iThumbX ){\n if( $aImgSize['width'] < $this->iMaxForThumbSize && $aImgSize ['height'] < $this->iMaxForThumbSize )\n $aNewFiles['sFile'] = $this->createThumb( $sImgPatch, $sDestDir );\n else\n return null;\n }\n else\n copy( $sImgPatch, $sDestDir.$aNewFiles['sFile'] );\n\n $aNewFiles['bWidth'] = $aImgSize['width'];\n $aNewFiles['bHeight'] = $aImgSize['height'];\n $aNewFiles['sWidth'] = $this->iThumbX;\n $aNewFiles['sHeight'] = $this->iThumbY;\n $aNewFiles['sName'] = basename( $aNewFiles['sFile'], '.'.$this->sExt );\n $aNewFiles['ext'] = $this->sExt;\n\n $this->iThumbY = 100;\n $this->setThumbSize( $iOldSize );\n\n return $aNewFiles;\n }", "function compress($source, $destination) {\n\n // Get the dimensions of the image\n list($img_in_width, $img_in_height) = getimagesize($source);\n\n // Define the output width\n $out_width = 200;\n \n // Define the height based on the aspect ratio\n $out_height = $out_width * $img_in_height / $img_in_width;\n\n // Create an output image\n $img_out = imagecreatetruecolor($out_width, $out_height);\n \n // Load the input image\n $img_in = imagecreatefromjpeg($source);\n \n // Copy the contents of the image to the output, resizing in the process\n imagecopyresampled($img_out, $img_in, 0, 0, 0, 0, $out_width, $out_height, $img_in_width, $img_in_height);\n \n // Save the file as a JPEG image to the destination\n imagejpeg($img_out, $destination);\n}", "public function copy($source, $destination);", "function __copy(&$tmp_target, &$tmp_source, $destination_x, $destination_y) {\n\n\t\t// call `composite -geometry`\n\t\t//\n\t\t$cmd = $this->__command(\n\t\t\t'composite',\n\t\t\t\" -geometry {$tmp_source->image_width}x{$tmp_source->image_height}+{$destination_x}+{$destination_y} \"\n \t\t. escapeshellarg(realpath($tmp_source->source))\n \t\t. \" \"\n \t\t. escapeshellarg(realpath($tmp_target->target))\n \t\t. \" \"\n \t\t. escapeshellarg(realpath($tmp_target->target))\n \t);\n\n exec($cmd, $result, $errors);\n\t\treturn ($errors == 0);\n\t\t}", "function upgrade_profile_image($id, $dir='users') {\n global $CFG;\n\n $im = ImageCreateFromJPEG($CFG->dataroot .'/'. $dir .'/'. $id .'/f1.jpg'); \n\n if (function_exists('ImageCreateTrueColor') and $CFG->gdversion >= 2) {\n $im1 = ImageCreateTrueColor(100,100);\n $im2 = ImageCreateTrueColor(35,35);\n } else {\n $im1 = ImageCreate(100,100);\n $im2 = ImageCreate(35,35);\n }\n \n if (function_exists('ImageCopyResampled') and $CFG->gdversion >= 2) { \n ImageCopyBicubic($im1, $im, 0, 0, 2, 2, 100, 100, 96, 96);\n } else {\n imagecopy($im1, $im, 0, 0, 0, 0, 100, 100);\n $c = ImageColorsForIndex($im1,ImageColorAt($im1,2,2)); \n $color = ImageColorClosest ($im1, $c['red'], $c['green'], $c['blue']); \n ImageSetPixel ($im1, 0, 0, $color); \n $c = ImageColorsForIndex($im1,ImageColorAt($im1,2,97)); \n $color = ImageColorClosest ($im1, $c['red'], $c['green'], $c['blue']); \n ImageSetPixel ($im1, 0, 99, $color); \n $c = ImageColorsForIndex($im1,ImageColorAt($im1,97,2)); \n $color = ImageColorClosest ($im1, $c['red'], $c['green'], $c['blue']); \n ImageSetPixel ($im1, 99, 0, $color); \n $c = ImageColorsForIndex($im1,ImageColorAt($im1,97,97)); \n $color = ImageColorClosest ($im1, $c['red'], $c['green'], $c['blue']); \n ImageSetPixel ($im1, 99, 99, $color); \n for ($x = 1; $x < 99; $x++) { \n $c1 = ImageColorsForIndex($im1,ImageColorAt($im,$x,1)); \n $color = ImageColorClosest ($im, $c1['red'], $c1['green'], $c1['blue']); \n ImageSetPixel ($im1, $x, 0, $color); \n $c2 = ImageColorsForIndex($im1,ImageColorAt($im1,$x,98)); \n $color = ImageColorClosest ($im1, $red, $green, $blue); \n $color = ImageColorClosest ($im, $c2['red'], $c2['green'], $c2['blue']); \n ImageSetPixel ($im1, $x, 99, $color); \n } \n for ($y = 1; $y < 99; $y++) { \n $c3 = ImageColorsForIndex($im1,ImageColorAt($im, 1, $y)); \n $color = ImageColorClosest ($im, $red, $green, $blue); \n $color = ImageColorClosest ($im, $c3['red'], $c3['green'], $c3['blue']); \n ImageSetPixel ($im1, 0, $y, $color); \n $c4 = ImageColorsForIndex($im1,ImageColorAt($im1, 98, $y)); \n $color = ImageColorClosest ($im, $c4['red'], $c4['green'], $c4['blue']); \n ImageSetPixel ($im1, 99, $y, $color); \n } \n } \n ImageCopyBicubic($im2, $im, 0, 0, 2, 2, 35, 35, 96, 96);\n\n if (function_exists('ImageJpeg')) {\n if (ImageJpeg($im1, $CFG->dataroot .'/'. $dir .'/'. $id .'/f1.jpg', 90) and \n ImageJpeg($im2, $CFG->dataroot .'/'. $dir .'/'. $id .'/f2.jpg', 95) ) {\n @chmod($CFG->dataroot .'/'. $dir .'/'. $id .'/f1.jpg', 0666);\n @chmod($CFG->dataroot .'/'. $dir .'/'. $id .'/f2.jpg', 0666);\n return 1;\n }\n } else {\n notify('PHP has not been configured to support JPEG images. Please correct this.');\n }\n return 0;\n}", "function copy($src, $dest)\n\t{\n\t\treturn copy($src, $dest);\n\t}", "function mergeImage($imgForeground, $imgBackground, $imgFinish, $x, $y ){\n $sourceImage = $imgForeground;\n\n //set the destination image (background)\n $destImage = $imgBackground;\n\n //get the size of the source image, needed for imagecopy()\n list($srcWidth, $srcHeight) = getimagesize($sourceImage);\n\n //create a new image from the source image\n $src = imagecreatefrompng($sourceImage);\n\n //create a new image from the destination image\n $dest = imagecreatefrompng($destImage);\n\n //set the x and y positions of the source image on top of the destination image\n $src_xPosition = $x; // pixels from the left\n $src_yPosition = $y; // pixels from the top\n\n //set the x and y positions of the source image to be copied to the destination image\n $src_cropXposition = 0; //do not crop on the side\n $src_cropYposition = 0; //do not crop at the top\n\n //merge the source and destination images\n imagecopy($dest,$src,$src_xPosition,$src_yPosition,$src_cropXposition,$src_cropYposition,$srcWidth,$srcHeight);\n\n //output the merged images to a file\n imagepng($dest,$imgFinish);\n\n //destroy the source image\n imagedestroy($src);\n\n //destroy the destination image\n imagedestroy($dest);\n}", "public static function copyImage($src, $dst, $rules = array()) {\n\t\tEasyLog::log(\"Copying image from $src to $dst\");\n\t\t$Src = new File($src);\n\n\t\t$img = Image::createFromFile($src);\n\n\t\tif (!$img) {\n\t\t\tEasyLog::error(\"Could not create image resource from $src.\");\n\t\t\tif (!is_file($src)) {\n\t\t\t\tEasyLog::error(\"Could not find the source image: $src\");\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tif (empty($dst)) {\n\t\t\tEasyLog::error(\"Destination directory is blank\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// Since we're converting to JPG, remove the transparency color\n\t\t$img = Image::replaceTransparency($img, array(255,255,255));\n\t\t\n\t\t$ext = $Src->ext();\n\t\tif (!empty($rules['convert'])) {\n\t\t\t$ext = $rules['convert'];\n\t\t}\n\t\tif (!empty($rules['max'])) {\n\t\t\t//Don't allow the image to be sized past a max width or height\n\t\t\t$img = Image::constrain($img, $rules['max'][0], $rules['max'][1]);\n\t\t}\n\t\tif (!empty($rules['set'])) {\n\t\t\t//Force an image to fit dimensions. Sizes until it fits, the crops off anything hanging off the sides\n\t\t\tEasyLog::log('Forcing image to fit dimensions: ' . implode(', ', $rules['set']));\n\t\t\t$img = Image::constrainCrop($img, $rules['set'][0], $rules['set'][1]);\n\t\t}\n\t\tif (!empty($rules['setSoft'])) {\n\t\t\t//Force an image to fit dimensions. Sizes until it all fits. If dimensions don't match, background will show\n\t\t\t$img = Image::constrainCrop($img, $rules['setSoft'][0], $rules['setSoft'][1], true);\n\t\t}\n\n\t\tif (!empty($rules['copyResized'])) {\n\t\t\t$srcX = $rules['copyResized']['srcX'];\n\t\t\t$srcY = $rules['copyResized']['srcY'];\n\t\t\t$srcW = $rules['copyResized']['srcW'];\n\t\t\t$srcH = $rules['copyResized']['srcH'];\n\t\t\t$dstW = $rules['copyResized']['dstW'];\n\t\t\t$dstH = $rules['copyResized']['dstH'];\n\t\t\t$img = Image::cropPortion($img, $srcX, $srcY, $srcW, $srcH, $dstW, $dstH);\n\t\t}\n\t\t\n\t\tif (!$img) {\n\t\t\tEasyLog::error('Image conversion failed');\n\t\t\treturn false;\n\t\t}\n\t\n\t\t$dstParts = explode(DS, $dst);\n\t\t$dstName = array_pop($dstParts);\n\t\t$dstDir = Folder::slashTerm(implode(DS, $dstParts));\n\n\t\tEasyLog::log(\"Copying image filename '$dstName' into directory '$dstDir'\");\n\t\tEasyLog::log(compact('dst', 'src'));\n\t\n//debug(compact(['dstName', 'dstDir', 'dst', 'src']));\n\t\n\t\tif (!is_dir( $dstDir)) {\n\t\t\tif (!mkdir($dstDir, 0777, true)) {\n\t\t\t\tEasyLog::error('Upload image directory, ' . $dstDir . ' does not exist and could not be created');\n\t\t\t}\n\t\t}\n\n\t\t$dst = $dstDir . $dstName;\n\t\tif (!Image::imageOutput($ext, $img, $dst, 100)) {\n\t\t\tEasyLog::error(\"Could not upload image $dstName from $src to directory $dstDir\");\n\t\t\treturn false;\n\t\t} else {\n\t\t\t@chmod($dst, 0755);\n\t\t}\n\n\t\tself::dispatchAfterUpload($dst);\n\t\treturn true;\n\t}", "public function image();", "public function image();", "function fastimagecopyresampled ($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h, $quality = 3) {\r\n // Plug-and-Play fastimagecopyresampled function replaces much slower imagecopyresampled.\r\n // Just include this function and change all \"imagecopyresampled\" references to \"fastimagecopyresampled\".\r\n // Typically from 30 to 60 times faster when reducing high resolution images down to thumbnail size using the default quality setting.\r\n // Author: Tim Eckel - Date: 12/17/04 - Project: FreeRingers.net - Freely distributable.\r\n //\r\n // Optional \"quality\" parameter (defaults is 3). Fractional values are allowed, for example 1.5.\r\n // 1 = Up to 600 times faster. Poor results, just uses imagecopyresized but removes black edges.\r\n // 2 = Up to 95 times faster. Images may appear too sharp, some people may prefer it.\r\n // 3 = Up to 60 times faster. Will give high quality smooth results very close to imagecopyresampled.\r\n // 4 = Up to 25 times faster. Almost identical to imagecopyresampled for most images.\r\n // 5 = No speedup. Just uses imagecopyresampled, highest quality but no advantage over imagecopyresampled.\r\n\r\n if (empty($src_image) || empty($dst_image)) { return false; }\r\n if ($quality <= 1) {\r\n $temp = imagecreatetruecolor ($dst_w + 1, $dst_h + 1);\r\n imagecopyresized ($temp, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w + 1, $dst_h + 1, $src_w, $src_h);\r\n imagecopyresized ($dst_image, $temp, 0, 0, 0, 0, $dst_w, $dst_h, $dst_w, $dst_h);\r\n imagedestroy ($temp);\r\n } elseif ($quality < 5 && (($dst_w * $quality) < $src_w || ($dst_h * $quality) < $src_h)) {\r\n $tmp_w = $dst_w * $quality;\r\n $tmp_h = $dst_h * $quality;\r\n $temp = imagecreatetruecolor ($tmp_w + 1, $tmp_h + 1);\r\n imagecopyresized ($temp, $src_image, $dst_x * $quality, $dst_y * $quality, $src_x, $src_y, $tmp_w + 1, $tmp_h + 1, $src_w, $src_h);\r\n imagecopyresampled ($dst_image, $temp, 0, 0, 0, 0, $dst_w, $dst_h, $tmp_w, $tmp_h);\r\n imagedestroy ($temp);\r\n } else {\r\n imagecopyresampled ($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);\r\n }\r\n //return true;\r\n}", "function imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct){\n $cut = imagecreatetruecolor($src_w, $src_h); \n\n // copying relevant section from background to the cut resource \n imagecopy($cut, $dst_im, 0, 0, $dst_x, $dst_y, $src_w, $src_h); \n \n // copying relevant section from watermark to the cut resource \n imagecopy($cut, $src_im, 0, 0, $src_x, $src_y, $src_w, $src_h); \n \n // insert cut resource to destination image \n imagecopymerge($dst_im, $cut, $dst_x, $dst_y, 0, 0, $src_w, $src_h, $pct);\n\n }", "public function operateImage($src=null)\n {\n $this->image_thumb=imagecreatetruecolor($this->imageX/2,$this->imageY/2);\n imagecopyresampled($this->image_thumb,$this->image,0,0,0,0,$this->imageX/2,$this->imageY/2,$this->imageX,$this->imageY);\n }", "private function cloneImage($ext, $new, $dest, $quality){\n\t\tswitch($ext) {\n\t\t\tcase 'bmp': imagewbmp($new, $dest); break;\n\t\t\tcase 'gif': imagegif($new, $dest); break;\n\t\t\tcase 'jpg': imagejpeg($new, $dest, $quality); break;\n\t\t\tcase 'jpeg': imagejpeg($new, $dest, $quality); break;\n\t\t\tcase 'png': imagepng($new, $dest, floor($quality/11)); break;\n\t\t\tcase 'webp': \n\t\t\t\tif( function_exists('imagewebp') ){ \n\t\t\t\t\timagewebp($new, $dest, $quality); \n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "function imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct){\n // creating a cut resource \n $cut = imagecreatetruecolor($src_w, $src_h);\n\n // copying relevant section from background to the cut resource \n imagecopy($cut, $dst_im, 0, 0, $dst_x, $dst_y, $src_w, $src_h);\n\n // copying relevant section from watermark to the cut resource \n imagecopy($cut, $src_im, 0, 0, $src_x, $src_y, $src_w, $src_h);\n\n // insert cut resource to destination image \n imagecopymerge($dst_im, $cut, $dst_x, $dst_y, 0, 0, $src_w, $src_h, $pct);\n }", "function fastimagecopyresampled (&$dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h, $quality) {\n // Plug-and-Play fastimagecopyresampled function replaces much slower imagecopyresampled.\n // Just include this function and change all \"imagecopyresampled\" references to \"fastimagecopyresampled\".\n // Typically from 30 to 60 times faster when reducing high resolution images down to thumbnail size using the default quality setting.\n // Author: Tim Eckel - Date: 12/17/04 - Project: FreeRingers.net - Freely distributable.\n //\n // Optional \"quality\" parameter (defaults is 3). Fractional values are allowed, for example 1.5.\n // 1 = Up to 600 times faster. Poor results, just uses imagecopyresized but removes black edges.\n // 2 = Up to 95 times faster. Images may appear too sharp, some people may prefer it.\n // 3 = Up to 60 times faster. Will give high quality smooth results very close to imagecopyresampled.\n // 4 = Up to 25 times faster. Almost identical to imagecopyresampled for most images.\n // 5 = No speedup. Just uses imagecopyresampled, highest quality but no advantage over imagecopyresampled.\n\n if (empty($src_image) || empty($dst_image)) { return false; }\n if ($quality <= 1) {\n $temp = imagecreatetruecolor ($dst_w + 1, $dst_h + 1);\n imagecopyresized ($temp, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w + 1, $dst_h + 1, $src_w, $src_h);\n imagecopyresized ($dst_image, $temp, 0, 0, 0, 0, $dst_w, $dst_h, $dst_w, $dst_h);\n imagedestroy ($temp);\n } elseif ($quality < 5 && (($dst_w * $quality) < $src_w || ($dst_h * $quality) < $src_h)) {\n $tmp_w = $dst_w * $quality;\n $tmp_h = $dst_h * $quality;\n $temp = imagecreatetruecolor ($tmp_w + 1, $tmp_h + 1);\n imagecopyresized ($temp, $src_image, $dst_x * $quality, $dst_y * $quality, $src_x, $src_y, $tmp_w + 1, $tmp_h + 1, $src_w, $src_h);\n imagecopyresampled ($dst_image, $temp, 0, 0, 0, 0, $dst_w, $dst_h, $tmp_w, $tmp_h);\n imagedestroy ($temp);\n } else {\n imagecopyresampled ($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);\n }\n return true;\n }", "public static function crop(){\n\n}", "function create($filename=\"\")\n{\nif ($filename) {\n $this->src_image_name = trim($filename);\n}\n$dirname=explode(\"/\",$this->src_image_name);\nif(!file_exists(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\")){\n\t@mkdir(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\", 0755);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$this->src_image_name = @iconv(\"utf-8\",\"GBK\",$this->src_image_name);\n\t$this->gz_image_name = @iconv(\"utf-8\",\"GBK\",$this->gz_image_name);\n}\n$src_image_type = $this->get_type($this->src_image_name);\n$src_image = $this->createImage($src_image_type,$this->src_image_name);\nif (!$src_image) return;\n$src_image_w=ImageSX($src_image);\n$src_image_h=ImageSY($src_image);\n\n\nif ($this->gz_image_name){\n $this->gz_image_name = strtolower(trim($this->gz_image_name));\n $gz_image_type = $this->get_type($this->gz_image_name);\n $gz_image = $this->createImage($gz_image_type,$this->gz_image_name);\n $gz_image_w=ImageSX($gz_image);\n $gz_image_h=ImageSY($gz_image);\n $temp_gz_image = $this->getPos($src_image_w,$src_image_h,$this->gz_image_pos,$gz_image);\n $gz_image_x = $temp_gz_image[\"dest_x\"];\n $gz_image_y = $temp_gz_image[\"dest_y\"];\n\t if($this->get_type($this->gz_image_name)=='png'){imagecopy($src_image,$gz_image,$gz_image_x,$gz_image_y,0,0,$gz_image_w,$gz_image_h);}\n\t else{imagecopymerge($src_image,$gz_image,$gz_image_x,$gz_image_y,0,0,$gz_image_w,$gz_image_h,$this->gz_image_transition);}\n}\nif ($this->gz_text){\n $temp_gz_text = $this->getPos($src_image_w,$src_image_h,$this->gz_text_pos);\n $gz_text_x = $temp_gz_text[\"dest_x\"];\n $gz_text_y = $temp_gz_text[\"dest_y\"];\n if(preg_match(\"/([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i\", $this->gz_text_color, $color))\n {\n $red = hexdec($color[1]);\n $green = hexdec($color[2]);\n $blue = hexdec($color[3]);\n $gz_text_color = imagecolorallocate($src_image, $red,$green,$blue);\n }else{\n $gz_text_color = imagecolorallocate($src_image, 255,255,255);\n }\n imagettftext($src_image, $this->gz_text_size, $this->gz_text_angle, $gz_text_x, $gz_text_y, $gz_text_color,$this->gz_text_font, $this->gz_text);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$save_files=explode('/',$this->save_file);\n\t$save_files[count($save_files)-1]=@iconv(\"utf-8\",\"GBK\",$save_files[count($save_files)-1]);\n\t$this->save_file=implode('/',$save_files);\n}\nif ($this->save_file)\n{\n switch ($this->get_type($this->save_file)){\n case 'gif':$src_img=ImagePNG($src_image, $this->save_file); break;\n case 'jpeg':$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n case 'png':$src_img=ImagePNG($src_image, $this->save_file); break;\n default:$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n }\n}\nelse\n{\nif ($src_image_type = \"jpg\") $src_image_type=\"jpeg\";\n header(\"Content-type: image/{$src_image_type}\");\n switch ($src_image_type){\n case 'gif':$src_img=ImagePNG($src_image); break;\n case 'jpg':$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n case 'png':$src_img=ImagePNG($src_image);break;\n default:$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n }\n}\nimagedestroy($src_image);\n}", "function copy( $id, $back_url = NULL ) {\n\t\n\t}", "function upload_file($src, $dest){\t\n\t\tif(!empty($src)){\t\t\t\n\t\t\t// copy the file to the image path\t\t\t\n\t\t\tif(!copy($src, $dest)){\n\t\t\t\techo 'failed to copy the file';\n\t\t\t}else{\t\t\t\t\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t}", "function DNUI_copy($source, $dest) {\r\n if (file_exists($source)) {\r\n return copy($source, $dest);\r\n }else{\r\n return false;\r\n }\r\n}", "function copy_image_resize_to_folder($source_file, $destination_folder, $filename, $max_width, $max_height)\n{\n $image_info = getimagesize($source_file);\n $source_pic_width = $image_info[0];\n $source_pic_height = $image_info[1];\n\n $x_ratio = $max_width / $source_pic_width;\n $y_ratio = $max_height / $source_pic_height;\n\n if (($source_pic_width <= $max_width) && ($source_pic_height <= $max_height)) {\n $tn_width = $source_pic_width;\n $tn_height = $source_pic_height;\n } elseif (($x_ratio * $source_pic_height) < $max_height) {\n $tn_height = ceil($x_ratio * $source_pic_height);\n $tn_width = $max_width;\n } else {\n $tn_width = ceil($y_ratio * $source_pic_width);\n $tn_height = $max_height;\n }\n \n if (!is_dir($destination_folder)) {\n mkdir($destination_folder, 0755);\n }\n\n switch ($image_info['mime']) {\n case 'image/gif':\n if (imagetypes() & IMG_GIF) {\n $src = imageCreateFromGIF($source_file);\n $destination_folder.=\"$filename.gif\";\n $namafile = \"$filename.gif\";\n }\n break;\n\n case 'image/jpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_file);\n $destination_folder.=\"$filename.jpg\";\n $namafile = \"$filename.jpg\";\n }\n break;\n\n case 'image/pjpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_file);\n $destination_folder.=\"$filename.jpg\";\n $namafile = \"$filename.jpg\";\n }\n break;\n\n case 'image/png':\n if (imagetypes() & IMG_PNG) {\n $src = imageCreateFromPNG($source_file);\n $destination_folder.=\"$filename.png\";\n $namafile = \"$filename.png\";\n }\n break;\n\n case 'image/wbmp':\n if (imagetypes() & IMG_WBMP) {\n $src = imageCreateFromWBMP($source_file);\n $destination_folder.=\"$filename.bmp\";\n $namafile = \"$filename.bmp\";\n }\n break;\n }\n \n $tmp = imagecreatetruecolor($tn_width, $tn_height);\n imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tn_width, $tn_height, $source_pic_width, $source_pic_height);\n\n //**** 100 is the quality settings, values range from 0-100.\n switch ($image_info['mime']) {\n case 'image/jpeg':\n imagejpeg($tmp, $destination_folder, 100);\n break;\n\n case 'image/gif':\n imagegif($tmp, $destination_folder, 100);\n break;\n\n case 'image/png':\n imagepng($tmp, $destination_folder);\n break;\n\n default:\n imagejpeg($tmp, $destination_folder, 100);\n break;\n }\n\n return ($namafile);\n}", "public function copyImage($destination_path)\n\t{\n\t\t$this->image->toFile($destination_path);\n\n\t\treturn $this;\n\t}", "public function save()\n {\n $dir = $this->pathTmpImage;\n\n $files = scandir($dir);\n\n foreach ($files as $file) {\n if ($file == $_POST['image']) { \n copy($this->pathTmpImage . $file, $this->pathResult . $file);\n }\n }\n\n //$this->dbInsert($_POST['image']);\n\n unlink($this->pathTmpImage . $_POST['image']);\n }", "public function copyOtherFiles(): void;", "private function copy_image( $image_url, $new_file_name ) {\n\t\t$upload_folder = FrmSigAppController::get_signature_file_directory();\n\t\t$file_name = wp_unique_filename( $upload_folder, $new_file_name );\n\t\t$path = trailingslashit( $upload_folder );\n\n\t\t$ch = curl_init( str_replace( array( ' ' ), array( '%20' ), $image_url ) );\n\t\t$fp = fopen( $path . $file_name, 'wb' );\n\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );\n\t\tcurl_setopt( $ch, CURLOPT_FILE, $fp );\n\t\tcurl_setopt( $ch, CURLOPT_HEADER, 0 );\n\t\t$user_agent = apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ) );\n\t\tcurl_setopt( $ch, CURLOPT_USERAGENT, $user_agent );\n\t\t$result = curl_exec( $ch );\n\t\t$code = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n\t\tcurl_close( $ch );\n\t\tfclose( $fp );\n\n\t\tif ( ! $result || $code !== 200 ) {\n\t\t\t// Failed to download image\n\t\t\tunlink( $path . $file_name );\n\t\t\t$file_name = '';\n\t\t}\n\n\t\treturn $file_name;\n\t}", "function make_thumb($folder,$src,$dest,$thumb_width) {\n\n\t$source_image = imagecreatefromjpeg($folder.'/'.$src);\n\t$width = imagesx($source_image);\n\t$height = imagesy($source_image);\n\t\n\t$thumb_height = floor($height*($thumb_width/$width));\n\t\n\t$virtual_image = imagecreatetruecolor($thumb_width,$thumb_height);\n\t\n\timagecopyresampled($virtual_image,$source_image,0,0,0,0,$thumb_width,$thumb_height,$width,$height);\n\t\n\timagejpeg($virtual_image,$dest,100);\n\t\n}", "function fastimagecopyresampled ($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h, $quality = 3) {\n // Just include this function and change all \"imagecopyresampled\" references to \"fastimagecopyresampled\".\n // Typically from 30 to 60 times faster when reducing high resolution images down to thumbnail size using the default quality setting.\n // Author: Tim Eckel - Date: 09/07/07 - Version: 1.1 - Project: FreeRingers.net - Freely distributable - These comments must remain.\n //\n // Optional \"quality\" parameter (defaults is 3). Fractional values are allowed, for example 1.5. Must be greater than zero.\n // Between 0 and 1 = Fast, but mosaic results, closer to 0 increases the mosaic effect.\n // 1 = Up to 350 times faster. Poor results, looks very similar to imagecopyresized.\n // 2 = Up to 95 times faster. Images appear a little sharp, some prefer this over a quality of 3.\n // 3 = Up to 60 times faster. Will give high quality smooth results very close to imagecopyresampled, just faster.\n // 4 = Up to 25 times faster. Almost identical to imagecopyresampled for most images.\n // 5 = No speedup. Just uses imagecopyresampled, no advantage over imagecopyresampled.\n \n if (empty($src_image) || empty($dst_image) || $quality <= 0) { return false; }\n if ($quality < 5 && (($dst_w * $quality) < $src_w || ($dst_h * $quality) < $src_h)) {\n $temp = imagecreatetruecolor ($dst_w * $quality + 1, $dst_h * $quality + 1);\n imagecopyresized ($temp, $src_image, 0, 0, $src_x, $src_y, $dst_w * $quality + 1, $dst_h * $quality + 1, $src_w, $src_h);\n imagecopyresampled ($dst_image, $temp, $dst_x, $dst_y, 0, 0, $dst_w, $dst_h, $dst_w * $quality, $dst_h * $quality);\n imagedestroy ($temp);\n } else imagecopyresampled ($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);\n return true;\n}", "public function copyResized() {\n\t\t\n\t\t$output = array();\n\t\t\n\t\t$options = array_merge(\n\t\t\tarray(\n\t\t\t\t'url' => '',\n\t\t\t\t'filename' => '',\n\t\t\t\t'width' => false,\n\t\t\t\t'height' => false,\n\t\t\t\t'crop' => false\n\t\t\t),\n\t\t\t$_POST\n\t\t);\n\t\t\n\t\t$width = $options['width'];\n\t\t$height = $options['height'];\n\t\t\n\t\tif (!((is_numeric($width) || is_bool($width)) && (is_numeric($height) || is_bool($height)))) {\n\t\t\t$output['error'] = Text::get('error_file_size');\n\t\t\treturn $output;\n\t\t}\n\t\t\n\t\tif ($options['filename']) {\n\t\t\n\t\t\t// Get parent directory.\n\t\t\tif ($options['url']) {\n\t\t\t\t$Page = $this->Automad->getPage($options['url']);\n\t\t\t\t$directory = AM_BASE_DIR . AM_DIR_PAGES . $Page->path;\n\t\t\t} else {\n\t\t\t\t$directory = AM_BASE_DIR . AM_DIR_SHARED . '/';\n\t\t\t}\n\t\t\n\t\t\t$file = $directory . $options['filename'];\n\t\t\n\t\t\tCore\\Debug::log($file, 'file');\n\t\t\tCore\\Debug::log($options, 'options');\n\t\t\t\t\n\t\t\tif (file_exists($file)) {\n\t\t\t\t\n\t\t\t\tif (is_writable($directory)) {\n\t\t\t\t\t\n\t\t\t\t\t$img = new Core\\Image(\n\t\t\t\t\t\t$file, \n\t\t\t\t\t\t$width, \n\t\t\t\t\t\t$height,\n\t\t\t\t\t\tboolval($options['crop'])\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$cachedFile = AM_BASE_DIR . $img->file;\n\t\t\t\t\t$resizedFile = preg_replace('/(\\.\\w{3,4})$/', '-' . floor($img->width) . 'x' . floor($img->height) . '$1', $file);\n\t\t\t\t\t\n\t\t\t\t\tif (!$output['error'] = FileSystem::renameMedia($cachedFile, $resizedFile)) {\n\t\t\t\t\t\t$output['success'] = Text::get('success_created') . ' \"' . basename($resizedFile) . '\"';\n\t\t\t\t\t\t$this->clearCache();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$output['error'] = Text::get('error_permission') . ' \"' . $directory . '\"';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$output['error'] = Text::get('error_file_not_found');\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "protected function combineImages() {}", "public function run() {\r\nif(!($new_image = @imagecreatetruecolor($this->new_width, $this->new_height)))\r\nthrow new Exception(\"Error while the new image was initialized\");\r\n\r\nswitch($this->type) {\r\ncase 1:\r\n$image = imagecreatefromgif($this->src);\r\n$transparent_index = imagecolortransparent($image);\r\n$transparent_color = imagecolorsforindex($image, $transparent_index);\r\n$transparent_index = imagecolorallocate($new_image, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\r\nimagefill($new_image, 0, 0, $transparent_index);\r\nimagecolortransparent($new_image, $transparent_index);\r\nbreak;\r\ncase 2:\r\n$image = imagecreatefromjpeg($this->src);\r\nbreak;\r\ncase 3:\r\n$image = imagecreatefrompng($this->src);\r\nimagealphablending($new_image, false);\r\nimagesavealpha($new_image, true);\r\nbreak;\r\ndefault:\r\nthrow new Exception('<b>Error:</b> The image type was not recognized');\r\nbreak;\r\n}\r\n\r\ntry {\r\nimagecopyresampled($new_image, $image, 0, 0, 0, 0, $this->new_width, $this->new_height, $this->width, $this->height);\r\n}\r\ncatch(Exception $e) {\r\nthrow new Exception(\"<b>Error:</b> The image couldn't be resized\");\r\n}\r\n\r\nswitch($this->type) {\r\ncase 1:\r\nimagegif($new_image, $this->dest);\r\nbreak;\r\ncase 2:\r\nimagejpeg($new_image, $this->dest);\r\nbreak;\r\ncase 3:\r\nimagepng($new_image, $this->dest);\r\nbreak;\r\ndefault:\r\nthrow new Exception('Error while the image was created');\r\nbreak;\r\n}\r\n\r\n$this->releaseMemory($image, $new_image);\r\n}", "public function cropAvatarAction()\n {\n // TODO: swap web dir to product path\n //$imgRealPath = '/Users/leonqiu/www/choumei.me/Symfony/web/' . $_POST['imageSource'];\n $imgRealPath = dirname(__FILE__) . '/../../../../web/' . $_POST['imageSource'];\n list($width, $height) = getimagesize($imgRealPath);\n \n $viewPortW = $_POST[\"viewPortW\"];\n\t $viewPortH = $_POST[\"viewPortH\"];\n $pWidth = $_POST[\"imageW\"];\n $pHeight = $_POST[\"imageH\"];\n $tmp = explode(\".\",$_POST[\"imageSource\"]);\n $ext = end(&$tmp);\n $function = $this->returnCorrectFunction($ext);\n //$image = $function($_POST[\"imageSource\"]);\n $image = $function($imgRealPath);\n $width = imagesx($image);\n $height = imagesy($image);\n \n // Resample\n $image_p = imagecreatetruecolor($pWidth, $pHeight);\n $this->setTransparency($image,$image_p,$ext);\n\t\timagecopyresampled($image_p, $image, 0, 0, 0, 0, $pWidth, $pHeight, $width, $height);\n\t\timagedestroy($image);\n\t\t$widthR = imagesx($image_p);\n\t\t$hegihtR = imagesy($image_p);\n\t\t\n\t\t$selectorX = $_POST[\"selectorX\"];\n\t\t$selectorY = $_POST[\"selectorY\"];\n\t\t\n\t\tif($_POST[\"imageRotate\"]){\n\t\t $angle = 360 - $_POST[\"imageRotate\"];\n\t\t $image_p = imagerotate($image_p,$angle,0);\n\t\t \n\t\t $pWidth = imagesx($image_p);\n\t\t $pHeight = imagesy($image_p);\n\t\t \n\t\t //print $pWidth.\"---\".$pHeight;\n\t\t\n\t\t $diffW = abs($pWidth - $widthR) / 2;\n\t\t $diffH = abs($pHeight - $hegihtR) / 2;\n\t\t \n\t\t $_POST[\"imageX\"] = ($pWidth > $widthR ? $_POST[\"imageX\"] - $diffW : $_POST[\"imageX\"] + $diffW);\n\t\t $_POST[\"imageY\"] = ($pHeight > $hegihtR ? $_POST[\"imageY\"] - $diffH : $_POST[\"imageY\"] + $diffH);\n\t\t\n\t\t \n\t\t}\n\t\t\n\t\t$dst_x = $src_x = $dst_y = $dst_x = 0;\n\t\t\n\t\tif($_POST[\"imageX\"] > 0){\n\t\t $dst_x = abs($_POST[\"imageX\"]);\n\t\t}else{\n\t\t $src_x = abs($_POST[\"imageX\"]);\n\t\t}\n\t\tif($_POST[\"imageY\"] > 0){\n\t\t $dst_y = abs($_POST[\"imageY\"]);\n\t\t}else{\n\t\t $src_y = abs($_POST[\"imageY\"]);\n\t\t}\n\t\t\n\t\t\n\t\t$viewport = imagecreatetruecolor($_POST[\"viewPortW\"],$_POST[\"viewPortH\"]);\n\t\t$this->setTransparency($image_p,$viewport,$ext);\n\t\t\n\t\timagecopy($viewport, $image_p, $dst_x, $dst_y, $src_x, $src_y, $pWidth, $pHeight);\n\t\timagedestroy($image_p);\n\t\t\n\t\t\n\t\t$selector = imagecreatetruecolor($_POST[\"selectorW\"],$_POST[\"selectorH\"]);\n\t\t$this->setTransparency($viewport,$selector,$ext);\n\t\timagecopy($selector, $viewport, 0, 0, $selectorX, $selectorY,$_POST[\"viewPortW\"],$_POST[\"viewPortH\"]);\n\t\t\n\t\t//$file = \"tmp/test\".time().\".\".$ext;\n\t\t// TODO: generate file name\n\t\t$fileName = uniqid() . \".\" . $ext;\n\t\t$user = $this->get('security.context')->getToken()->getUser();\n\t\t$avatarFile = dirname(__FILE__).'/../../../../web/uploads/avatar/'.$user->getId(). '/' .$fileName;\n\t\t$avatarUrl = '/uploads/avatar/'. $user->getId() . '/' . $fileName;\n\t\t$this->parseImage($ext,$selector,$avatarFile);\n\t\timagedestroy($viewport);\n\t\t//Return value\n\t\t//update avatar\n $em = $this->getDoctrine()->getEntityManager();\n $user->setAvatar($avatarUrl);\n $em->persist($user);\n $em->flush();\n\t\techo $avatarUrl;\n\t\texit;\n }", "public function getCopy();", "public function getCopy();", "public function dup() {\n return new Image($this);\n }", "public function crop()\n {\n }", "function imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct, $dst_im_ext) {\n\tif($dst_im_ext=='jpg' && $pct==100) {\n\t\timagealphablending($dst_im, true);\n\t\timagealphablending($src_im, true);\n\t\timagecopy($dst_im, $src_im, $dst_x, $dst_y, 0, 0, $src_w, $src_h);\n\t} else {\n\t\t$transparent_index = imagecolortransparent($dst_im);\n\t\t$colors_total = imagecolorstotal($dst_im);\n\t\t$cut = imagecreatetruecolor($src_w, $src_h);\n\t\t\n\t\tif($transparent_index >= 0) {\n\t\t\t$transparent_color = imagecolorsforindex($dst_im, $transparent_index);\n\t\t\t$transparent_index = imagecolorallocatealpha($cut, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue'], 127);\n\t\t\timagefill($cut, 0, 0, $transparent_index);\n\t\t\timagecolortransparent($cut, $transparent_index);\n\t\t} else {\n\t\t\t$color = imagecolorallocatealpha($cut, 0, 0, 0, 127);\n\t\t\timagefill($cut, 0, 0, $color);\n\t\t}\n\t\t\n\t\tif($dst_im_ext=='png') {\n\t\t\timagealphablending($dst_im, false);\n\t\t\timagesavealpha($dst_im, true);\n\t\t} else {\n\t\t\tif($dst_im_ext!=='jpg') {\n\t\t\t\timagetruecolortopalette($dst_im, true, 255);\n\t\t\t\timagesavealpha($dst_im, false);\n\t\t\t}\t\n\t\t}\n\t\t\n\t\tif($dst_im_ext=='png' && $colors_total==0) {\n\t\t\tif($pct<100) filter_opacity($src_im, $pct);\n\t\t\timagealphablending($dst_im, true);\n\t\t\timagesavealpha($dst_im, true);\n\t\t\timagecopy($dst_im, $src_im, $dst_x, $dst_y, 0, 0, $src_w, $src_h);\n\t\t\timagealphablending($dst_im, false);\n\t\t} else {\n\t\t\timagecopy($cut, $dst_im, 0, 0, $dst_x, $dst_y, $src_w, $src_h);\n\t\t\timagecopy($cut, $src_im, 0, 0, $src_x, $src_y, $src_w, $src_h);\n\t\t\timagecopymerge($dst_im, $cut, $dst_x, $dst_y, 0, 0, $src_w, $src_h, $pct);\n\t\t}\n\t}\n\t\n\timagedestroy($cut);\n\timagedestroy($src_im);\n\n}", "function image_return_write($im, $write_to_abspath)\n{\n $return = $im->writeImage($write_to_abspath);\n $im->clear();\n $im->destroy();\n return $return;\n}", "public function createImage()\n {\n $name = basename($this->absoluteUrl);\n if ($this->fileExists($this->absoluteUrl) && !in_array($name, $this->notAllowedNames)) {\n $mime = @exif_imagetype($this->absoluteUrl);\n if ($mime == IMAGETYPE_JPEG || $mime == IMAGETYPE_PNG || $mime == IMAGETYPE_GIF) {\n if (!file_exists($this->imageDirectory)) {\n mkdir($this->imageDirectory, 0700);\n }\n\n copy($this->absoluteUrl, $this->imageDirectory . DIRECTORY_SEPARATOR . $name);\n }\n }\n }", "function __copy(&$tmp_target, &$tmp_source, $destination_x, $destination_y) {\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 ImageCreateForOffline($img)\n {\n list($width,$height)=getimagesize($img);\n //list($width,$height)=getimagesize(\"images/imagesevice/photoframe_bg.png\");\n $img1 = ImageCreateFromJpeg($img); \n $bg = ImageCreateFromPng(\"images/imagesevice/photoframe_bg.png\"); \n //如果图片是横的 旋转90度\n if($width > $height) {\n $img1 = imagerotate($img1, 270, 0);\n imagecopyresized($bg,$img1,13,150,0,0,720,1075,$height,$width); \n }else{\n imagecopyresized($bg,$img1,13,150,0,0,720,1075,$width,$height); \n }\n \n //$logo = ImageCreateFromPng(\"images/imagesevice/logo.png\"); \n //imagecopyresized($bg,$logo,13,10,0,0,641,29,641,29); \n \n //header(\"content-type: image/jpeg\");\n $fs = new Filesystem();\n if(!$fs->exists($this->_filedir . '/Offline'))\n $fs->mkdir($this->_filedir . '/Offline', 0700);\n $fileName = '/Offline/' . time() . rand(100,999) . '.jpg';\n $hechengImg = $this->_filedir . $fileName;\n ImageJpeg($bg,$hechengImg);\n return $fileName;\n }", "public function resizeInSquareFromFile($src_name,$dest_name,$newwidth,$newheight,$background,$ext)\n {\n //Check extension of file\n if(empty($ext))\n {\n $ext = $this->options[parent::IMAGE_ITEM_DEFAULT_TYPE];\n }\n\n //Create image source from file name\n $source_image = $this->createSourceImage($src_name,$ext);\n \n //Check source\n if(!$source_image)\n {\n return false;\n }\n\n //Check background\n if(empty($background))\n {\n $background = $this->options[self::IMAGE_ITEM_BACKGROUND];\n }\n\n //Check new height\n if(empty($newheight))\n {\n $newheight = $newwidth;\n }\n\n //Get old size\n $old_x = imagesx($source_image);\n $old_y = imagesy($source_image);\n\n //Check have correct site\n if($old_x <= $newwidth && $old_y <= $newheight)\n {\n //Destroy image source\n imagedestroy($source_image);\n\n //Return image file\n return copy($src_name,$dest_name);\n }\n\n //Resize keep width\n if($old_x < $newwidth)\n {\n //Check size\n $newwidth = $old_x;\n if($newwidth > $newheight)\n {\n $newwidth = $newheight;\n }\n\n //Crop image \n $dest_image = imagecreatetruecolor($newwidth, $newheight);\n imagecopyresampled($dest_image, $source_image, 0, 0, 0, 0, $newwidth , $newheight, $newwidth, $newheight);\n }\n else\n {\n $newheight = ceil((($newwidth*$old_y)/$old_x));\n $dest_image = imagecreatetruecolor($newwidth, $newwidth);\n list($r,$g,$b) = explode(\",\",$background);\n $color= imagecolorallocate($dest_image, $r, $g, $b);\n $move_space =0;\n if($old_x > $old_y )\n {\n $move_space = ceil(($newwidth - $newheight)/2);\n }\n\n //Check size\n if($old_y < $newwidth)\n {\n $newwidth = $old_y;\n $newheight = $newwidth;\n } \n\n //Crop image\n imagefill($dest_image,0,0,$color);\n imagecopyresampled($dest_image, $source_image, 0, -$move_space, 0, 0, $newwidth , $newheight, $old_x, $old_y);\n }\n\n //Put binary string\n imagejpeg($dest_image,$dest_name,$this->options[parent::IMAGE_ITEM_QUALITY]);\n\n //Destroy images\n imagedestroy($dest_image);\n imagedestroy($source_image);\n\n //Return boolean\n return true;\n }", "public function getAdIdToCopyImageFrom()\n {\n return $this->readOneof(3);\n }", "function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode = 0)\n {\n }", "public function toGDImage() {}", "protected function copyImagesDirectory()\n\t{\n\t\t$params = $this->getParams();\n\n\t\tif ($params->path != '') {\n\t\t\t$date = JFactory::getDate()->toFormat('%Y%m%d');\n\n\t\t\t$src = JPATH_SITE.DS.'images';\n\t\t\t$dest = JPATH_SITE.DS.'images-backup-'.$date;\n\t\t\tJFolder::move($src, $dest);\n\n\t\t\t$src = $params->path.DS.'images';\n\t\t\t$dest = JPATH_SITE.DS.'images';\n\t\t\tJFolder::copy($src, $dest);\n\t\t}\n\t}", "function custom_copy($src, $dst) {\n $dir = opendir($src); \n \n // Make the destination directory if not exist \n @mkdir($dst); \n \n // Loop through the files in source directory \n while( $file = readdir($dir) ) { \n \n if (( $file != '.' ) && ( $file != '..' )) { \n if ( is_dir($src . '/' . $file) ) \n { \n \n // Recursively calling custom copy function \n // for sub directory \n custom_copy($src . '/' . $file, $dst . '/' . $file); \n \n } \n else { \n copy($src . '/' . $file, $dst . '/' . $file); \n } \n } \n } \n \n closedir($dir); \n }", "function copiant($nombreArchivo,$Destino){\n if(!copy($nombreArchivo,$Destino))\n print(\"\\n<br>Ocurrio un error mientras se intentaba copiar el archivo $nombreArchivo !!\");\n else \n print(\"\\n<br>El archivo $nombreArchivo Se Copio Correctamente\");\n}", "public function copy() {\n\t\t$sel = new TGraphicsSelection($this->original, $this->x, $this->y, true);\n\t\t$sel->loadFromResource($this->getClipped(0, 0, $this->getWidth(), $this->getHeight())->getImage());\n\n\t\treturn $sel;\n\t}", "public function onCopy(CopyResourceEvent $event) {\n \n $toCopy = $event->getResource(); \n $new = new MediaResource();\n $new->setName($toCopy->getName());\n\n // duplicate media resource media(s) (=file(s))\n $medias = $toCopy->getMedias();\n foreach ($medias as $media) {\n $this->container->get('innova_media_resource.manager.media_resource')->copyMedia($new, $media);\n }\n\n // duplicate regions and region config\n $regions = $toCopy->getRegions();\n foreach ($regions as $region) {\n $this->container->get('innova_media_resource.manager.media_resource_region')->copyRegion($new, $region);\n }\n $event->setCopy($new);\n $event->stopPropagation();\n }", "function copyAndResize($imgReal_full_path, $imgTarget_name, $imgTarget_dir, $resize = array())\r\n {\r\n $ext = $this->getExtension($imgReal_full_path);\r\n $source_img = $imgReal_full_path;\r\n #$target_img = $imgTarget_dir . $imgTarget_name . $ext;\r\n $target_img = $imgTarget_dir . '/' . $imgTarget_name .'.'. $ext;\r\n \r\n //create dir\r\n $this->createDir($imgTarget_dir.'/');\r\n \r\n //copy real image\r\n copy($source_img, $target_img) or die('Failed to copy :'.$source_img.'--to--'.$target_img);\r\n //copy resized image\r\n $ret_dirresize = $ret_urlresize = array();\r\n foreach($resize as $key=>$size)\r\n {\r\n $crop = strpos($key, \":\") ? $key : '';\r\n $ret_dirresize[$size] = $this->resize_image($target_img, $crop, $size, false);\r\n //$ret_urlresize[$size] = str_replace(MEDIA_DIR, \"http://klimg.com/merdeka.com/cms/\", $ret_dirresize[$size]);\r\n }\r\n\t\t\t\r\n\t\t\t#harus di unremark ulang\r\n //$sourcefile = array_merge($ret_dirresize, array($target_img));\r\n //$this->send_to_server($sourcefile);\r\n \r\n $return = array(\r\n #'nama' => $target_imgName, \r\n 'nama' => $imgTarget_name .'.'. $ext,\r\n 'type' => $ext, \r\n #'path' => $target_dir, \r\n 'path' => $imgTarget_dir.'/',\r\n 'url_resize'=> $ret_urlresize,\r\n 'dir_resize'=> $ret_dirresize,\r\n //'sourcefile'=> $sourcefile,\r\n\t\t\t\t'sourcefile'=> '',\r\n 'source_img'=> $source_img,\r\n 'target_img'=> $target_img\r\n );\r\n \r\n return $return;\r\n }", "function image_mirror_gd()\n\t{\t\t\n\t\tif ( ! $src_img = $this->image_create_gd())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$width = $this->src_width;\n\t\t$height = $this->src_height;\n\n\t\tif ($this->rotation == 'hor')\n\t\t{\n\t\t\tfor ($i = 0; $i < $height; $i++)\n\t\t\t{\t\t \n\t\t\t\t$left = 0; \n\t\t\t\t$right = $width-1; \n\t\n\t\t\t\twhile ($left < $right)\n\t\t\t\t{ \n\t\t\t\t\t$cl = imagecolorat($src_img, $left, $i); \n\t\t\t\t\t$cr = imagecolorat($src_img, $right, $i);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $left, $i, $cr); \n\t\t\t\t\timagesetpixel($src_img, $right, $i, $cl); \n\t\t\t\t\t\n\t\t\t\t\t$left++; \n\t\t\t\t\t$right--; \n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < $width; $i++)\n\t\t\t{\t\t \n\t\t\t\t$top = 0; \n\t\t\t\t$bot = $height-1; \n\t\n\t\t\t\twhile ($top < $bot)\n\t\t\t\t{ \n\t\t\t\t\t$ct = imagecolorat($src_img, $i, $top);\n\t\t\t\t\t$cb = imagecolorat($src_img, $i, $bot);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $i, $top, $cb); \n\t\t\t\t\timagesetpixel($src_img, $i, $bot, $ct); \n\t\t\t\t\t\n\t\t\t\t\t$top++; \n\t\t\t\t\t$bot--; \n\t\t\t\t} \n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Save the Image\n\t\t/** ---------------------------------*/\n\t\tif ( ! $this->image_save_gd($src_img))\n\t\t{\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Kill the file handles\n\t\t/** ---------------------------------*/\n\t\timagedestroy($src_img);\n\t\t\n\t\t// Set the file to 777\n\t\t@chmod($this->full_dst_path, FILE_WRITE_MODE);\t\t\t\n\t\t\n\t\treturn TRUE;\n\t}", "function create_image(){\r\n\t$wmark = imagecreatefrompng('img/stamp.png');\r\n\t//Load jpg image\r\n\t$image = imagecreatefromjpeg('img/image'.rand(1,3).'.jpg');\r\n\t\r\n\t//Get image width/height\r\n\t$width = imagesx($image);\r\n\t$height = imagesy($image);\r\n\t\r\n\t// Set the margins for the stamp and get the height/width of the stamp image\r\n\t$marge_right = 10;\r\n\t$marge_bottom = 10;\r\n\t$sx = imagesx($wmark);\r\n\t$sy = imagesy($wmark);\r\n\t\r\n\t// Copy the stamp image onto our photo using the margin offsets and the photo width to calculate positioning of the stamp. \r\n\timagecopy($image, $wmark, $width-$sx-$marge_right, $height-$sy-$marge_bottom,0,0,$sx,$sy);\r\n\t\r\n\t// Prepare the final image and save to path. If you only pass $image it will output to the browser instead of a file.\r\n\timagepng($image,\"generatedImage.png\");\r\n\t\r\n\t// Output and free memory\r\n\timagedestroy($image);\r\n}", "private function imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $opacity = 1, $rotate = 0, $color = 0){\n $src_w = imagesx($src_im);\n $src_h = imagesy($src_im);\n if ($rotate) {\n $transparent = imagecolorallocatealpha($src_im, 0, 0, 0, 127);\n\n $src_im = imagerotate($src_im, $rotate, $transparent);\n $dx = imagesx($src_im) - $src_w;\n $dy = imagesy($src_im) - $src_h;\n }else{\n $dx = $dy = 0;\n }\n\n // Creating a cut resource\n $cut = imagecreatetruecolor($src_w + $dx, $src_h + $dy);\n // Copying relevant section from background to the cut resource\n imagecopy($cut, $dst_im, 0, 0, $dst_x - round($dx / 2), $dst_y - round($dy / 2), $src_w + $dx, $src_h + $dy);\n // Copying relevant section from watermark to the cut resource\n imagecopy($cut, $src_im, 0, 0, $src_x, $src_y, $src_w + $dx, $src_h + $dy);\n // Insert cut resource to destination image\n imagecopymerge($dst_im, $cut, $dst_x - round($dx / 2), $dst_y - round($dy / 2), 0, 0, $src_w + $dx, $src_h + $dy, round($opacity * 100));\n // Destroy temporary image\n imagedestroy($cut);\n }", "function image_crop(){\n\n\t\t\t$imgUrl = $_POST['imgUrl'];\n\t\t\t/*explored image URL and get image name*/\n\t\t\t$expImgUrl=explode(\"/\", $imgUrl);\n\t\t\t$LengthOfArray = sizeof($expImgUrl);\n\t\t\t$imageName = $LengthOfArray-1;\n\t\t\t$imgName = $expImgUrl[$imageName];\n\t\t\t$imgInitW = $_POST['imgInitW'];\n\t\t\t$imgInitH = $_POST['imgInitH'];\n\t\t\t$imgW = $_POST['imgW'];\n\t\t\t$imgH = $_POST['imgH'];\n\t\t\t$imgY1 = $_POST['imgY1'];\n\t\t\t$imgX1 = $_POST['imgX1'];\n\t\t\t$cropW = $_POST['cropW'];\n\t\t\t$cropH = $_POST['cropH'];\n\n\t\t\t$jpeg_quality = 100;\n\t\t\t$rand = rand();\n\t\t\t$output_filename = \"../webroot/img/uploads/croppedImg_\".$rand;\n\t\t\t$oname = \"img/uploads/croppedImg_\".$rand;\n\t\t\t$Pname = \"img/uploads/\";\n\t\t\t$path = BASE_PATH;\n\n\t\t\t$what = getimagesize($Pname.\"/\".$imgName);\n\t\t\t\n\t\t\tswitch(strtolower($what['mime']))\n\t\t\t{\n\t\t\t\tcase 'image/png':\n\t\t\t\t\t$img_r = imagecreatefrompng($Pname.\"/\".$imgName);\n\t\t\t\t\t$source_image = imagecreatefrompng($Pname.\"/\".$imgName);\n\t\t\t\t\t$type = '.png';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/jpeg':\n\t\t\t\t\t$img_r = imagecreatefromjpeg($Pname.\"/\".$imgName);\n\t\t\t\t\t$source_image = imagecreatefromjpeg($Pname.\"/\".$imgName);\n\t\t\t\t\t$type = '.jpeg';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/gif':\n\t\t\t\t\t$img_r = imagecreatefromgif($Pname.\"/\".$imgName);\n\t\t\t\t\t$source_image = imagecreatefromgif($Pname.\"/\".$imgName);\n\t\t\t\t\t$type = '.gif';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: die('image type not supported');\n\t\t\t}\n\t\t\t\t\n\t\t\t$resizedImage = imagecreatetruecolor($imgW, $imgH);\n\t\t\timagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $imgW, \n\t\t\t\t\t\t$imgH, $imgInitW, $imgInitH);\t\n\t\t\t\n\t\t\t\n\t\t\t$dest_image = imagecreatetruecolor($cropW, $cropH);\n\t\t\timagecopyresampled($dest_image, $resizedImage, 0, 0, $imgX1, $imgY1, $cropW, \n\t\t\t\t\t\t$cropH, $cropW, $cropH);\t\n\n\n\t\t\timagejpeg($dest_image, $output_filename.$type, $jpeg_quality);\n\t\t\t\n\t\t\t$response = array(\n\t\t\t\t\t\"status\" => 'success',\n\t\t\t\t\t\"url\" => $oname.$type, \n\t\t\t\t\t\"base\" => $path \n\t\t\t\t );\n\t\t\t print json_encode($response);\n\t\t\t exit;\n\t}", "function resizeCropImage($src, $dst, $dstx, $dsty){\n\t\t//$dst = destination image location\n\t\t//$dstx = user defined width of image\n\t\t//$dsty = user defined height of image\n\t\t$allowedExtensions = 'jpg jpeg gif png';\n\t\t$name = explode(\".\", strtolower($src));\n\t\t$currentExtensions = $name[count($name)-1];\n\t\t$extensions = explode(\" \", $allowedExtensions);\n\n\t\tfor($i=0; count($extensions)>$i; $i=$i+1) {\n\t\t\tif($extensions[$i]==$currentExtensions)\n\t\t\t{ \n\t\t\t\t$extensionOK=1; \n\t\t\t\t$fileExtension=$extensions[$i]; \n\t\t\t\tbreak; \n\t\t\t}\n\t\t}\n\n\t\tif($extensionOK){\n\t\t\t$size = getImageSize($src);\n\t\t\t$width = $size[0];\n\t\t\t$height = $size[1];\n\t\t\tif($width >= $dstx AND $height >= $dsty){\n\t\t\t\t$proportion_X = $width / $dstx;\n\t\t\t\t$proportion_Y = $height / $dsty;\n\t\t\t\tif($proportion_X > $proportion_Y ){\n\t\t\t\t\t$proportion = $proportion_Y;\n\t\t\t\t}else{\n\t\t\t\t\t$proportion = $proportion_X ;\n\t\t\t\t}\n\t\t\t\t$target['width'] = $dstx * $proportion;\n\t\t\t\t$target['height'] = $dsty * $proportion;\n\t\t\t\t$original['diagonal_center'] = round(sqrt(($width*$width)+($height*$height))/2);\n\t\t\t\t$target['diagonal_center'] = round(sqrt(($target['width']*$target['width']) + ($target['height']*$target['height']))/2);\n\t\t\t\t$crop = round($original['diagonal_center'] - $target['diagonal_center']);\n\t\t\t\tif($proportion_X < $proportion_Y ){\n\t\t\t\t\t$target['x'] = 0;\n\t\t\t\t\t$target['y'] = round((($height/2)*$crop)/$target['diagonal_center']);\n\t\t\t\t}else{\n\t\t\t\t\t$target['x'] = round((($width/2)*$crop)/$target['diagonal_center']);\n\t\t\t\t\t$target['y'] = 0;\n\t\t\t\t}\n\t\t\t\tif($fileExtension == \"jpg\" OR $fileExtension=='jpeg'){ \n\t\t\t\t\t$from = ImageCreateFromJpeg($src); \n\t\t\t\t} elseif ($fileExtension == \"gif\"){ \n\t\t\t\t\t$from = ImageCreateFromGIF($src); \n\t\t\t\t} elseif ($fileExtension == 'png'){\n\t\t\t\t\t$from = imageCreateFromPNG($src);\n\t\t\t\t}\n\t\t\t\t$new = ImageCreateTrueColor ($dstx,$dsty);\n\t\t\t\timagecopyresampled ($new, $from, 0, 0, $target['x'], \n\t\t\t\t$target['y'], $dstx, $dsty, $target['width'], $target['height']);\n\t\t\t\tif($fileExtension == \"jpg\" OR $fileExtension == 'jpeg'){ \n\t\t\t\t\timagejpeg($new, $dst, 70); \n\t\t\t\t} elseif ($fileExtension == \"gif\"){ \n\t\t\t\t\timagegif($new, $dst); \n\t\t\t\t}elseif ($fileExtension == 'png'){\n\t\t\t\t\timagepng($new, $dst);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcopy($src, $dst);\n\t\t\t}\n\t\t}\n\t}", "public function getImage() {}", "function fastimagecopyresampled(&$dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h, $quality = 3)\n{\n // Just include this function and change all \"imagecopyresampled\" references to \"fastimagecopyresampled\".\n // Typically from 30 to 60 times faster when reducing high resolution images down to thumbnail size using the default quality setting.\n // Author: Tim Eckel - Date: 12/17/04 - Project: FreeRingers.net - Freely distributable.\n //\n // Optional \"quality\" parameter (defaults is 3). Fractional values are allowed, for example 1.5.\n // 1 = Up to 600 times faster. Poor results, just uses imagecopyresized but removes black edges.\n // 2 = Up to 95 times faster. Images may appear too sharp, some people may prefer it.\n // 3 = Up to 60 times faster. Will give high quality smooth results very close to imagecopyresampled.\n // 4 = Up to 25 times faster. Almost identical to imagecopyresampled for most images.\n // 5 = No speedup. Just uses imagecopyresampled, highest quality but no advantage over imagecopyresampled.\n\n if (empty($src_image) || empty($dst_image)) {\n return false;\n }\n if ($quality <= 1) {\n $temp = imagecreatetruecolor($dst_w + 1, $dst_h + 1);\n imagecopyresized($temp, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w + 1, $dst_h + 1, $src_w, $src_h);\n imagecopyresized($dst_image, $temp, 0, 0, 0, 0, $dst_w, $dst_h, $dst_w, $dst_h);\n imagedestroy($temp);\n } elseif ($quality < 5 && (($dst_w * $quality) < $src_w || ($dst_h * $quality) < $src_h)) {\n $tmp_w = $dst_w * $quality;\n $tmp_h = $dst_h * $quality;\n $temp = imagecreatetruecolor($tmp_w + 1, $tmp_h + 1);\n imagecopyresized($temp, $src_image, $dst_x * $quality, $dst_y * $quality, $src_x, $src_y, $tmp_w + 1, $tmp_h + 1, $src_w, $src_h);\n imagecopyresampled($dst_image, $temp, 0, 0, 0, 0, $dst_w, $dst_h, $tmp_w, $tmp_h);\n imagedestroy($temp);\n } else {\n imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);\n }\n return true;\n}", "function cropImage($CurWidth,$CurHeight,$iSize,$DestFolder,$SrcImage,$Quality,$ImageType)\r\n{\t \r\n\t//Check Image size is not 0\r\n\tif($CurWidth <= 0 || $CurHeight <= 0) \r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//abeautifulsite.net has excellent article about \"Cropping an Image to Make Square\"\r\n\t//http://www.abeautifulsite.net/blog/2009/08/cropping-an-image-to-make-square-thumbnails-in-php/\r\n\tif($CurWidth>$CurHeight)\r\n\t{\r\n\t\t$y_offset = 0;\r\n\t\t$x_offset = ($CurWidth - $CurHeight) / 2;\r\n\t\t$square_size \t= $CurWidth - ($x_offset * 2);\r\n\t}else{\r\n\t\t$x_offset = 0;\r\n\t\t$y_offset = ($CurHeight - $CurWidth) / 2;\r\n\t\t$square_size = $CurHeight - ($y_offset * 2);\r\n\t}\r\n\t\r\n\t$NewCanves \t= imagecreatetruecolor($iSize, $iSize);\t\r\n\tif(imagecopyresampled($NewCanves, $SrcImage,0, 0, $x_offset, $y_offset, $iSize, $iSize, $square_size, $square_size))\r\n\t{\r\n\t\tswitch(strtolower($ImageType))\r\n\t\t{\r\n\t\t\tcase 'image/png':\r\n\t\t\t\timagepng($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'image/gif':\r\n\t\t\t\timagegif($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\t\t\t\r\n\t\t\tcase 'image/jpeg':\r\n\t\t\tcase 'image/pjpeg':\r\n\t\t\t\timagejpeg($NewCanves,$DestFolder,$Quality);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t//Destroy image, frees memory\t\r\n\tif(is_resource($NewCanves)) {imagedestroy($NewCanves);} \r\n\treturn true;\r\n\r\n\t}\r\n\t \r\n}", "private static function copyImage($patch, $id){\n if(move_uploaded_file($patch, \"img/profileImages/{$id}\".imgExtension)) //A nova imagem tera o nome igual ao id de usuario\n return \"/Treinamento2020/img/profileImages/{$id}\".imgExtension;\n return \"\";\n }", "function save_image($inPath,$outPath)\n{\n $in= fopen($inPath, \"rb\");\n $out= fopen($outPath, \"wb\");\n while ($chunk = fread($in,8192))\n {\n fwrite($out, $chunk, 8192);\n }\n fclose($in);\n fclose($out);\n}", "function cropImage($param=array())\r\n {\r\n $ret = array(\r\n 'msg' => false,\r\n 'sts' => false,\r\n );\r\n\r\n $final_size = $param['final_size'];\r\n #$filename = $final_size.'-'.$param['img_newname'];\r\n $filename = $param['img_newname'];\r\n $target_dir = $param['dest_path'];\r\n $target_name = $target_dir.$filename;\r\n $source_name = $param['img_real'];\r\n \r\n //get size from real image \r\n $size = getimagesize($source_name);\r\n $targ_w = $param['w'];\r\n $targ_h = $param['h'];\r\n\r\n //get size from ratio\r\n $final_size = explode(\"x\", $final_size);\r\n $final_w = $final_size[0];\r\n $final_h = $final_size[1];\r\n \r\n if($final_w==='auto' && $final_h==='auto'){ //detect if width and height ratio is \"auto\" then readjust width and height size\r\n $final_w = $targ_w;\r\n $final_h = $targ_h;\r\n }elseif($final_w==='auto'){ //detect if width ratio is \"auto\" then readjust width size\r\n $final_w = intval(($final_size[1] * $targ_w) / $targ_h);\r\n }elseif($final_h==='auto'){ //detect if height ratio is \"auto\" then readjust height size\r\n $final_h = intval(($final_size[0] * $targ_h) / $targ_w);\r\n }\r\n //end\r\n \r\n \r\n $jpeg_quality = 90;\r\n $img_r = imagecreatefromjpeg($source_name);\r\n $dst_r = ImageCreateTrueColor( $final_w, $final_h );\r\n \r\n imagecopyresized(\r\n $dst_r, $img_r, \r\n 0,0, \r\n $param['x'],$param['y'], \r\n $final_w,$final_h,\r\n $param['w'],$param['h']\r\n );\r\n \r\n imagejpeg($dst_r,$target_name,$jpeg_quality);\r\n #$this->send_to_server( array($target_name) );\r\n $url_target_name = str_replace('/data/shopkl/_assets/', 'http://klimg.com/kapanlagi.com/klshop/', $target_name);\r\n \r\n\t\t\t\r\n //find image parent url and dir path from config\r\n //reset($this->imgsize['article']['size']);\r\n //$first_key = key($this->imgsize['article']['size']);\r\n //end find\r\n $ret['sts'] = true;\r\n $ret['filename'] = $filename;\r\n $ret['msg'] = '<div class=\"alert alert-success\">Image is cropped and saved in <a href=\"'. $url_target_name .'?'.date('his').'\" target=\"_blank\">'.$target_name.' !</a></div>';\r\n \r\n return $ret;\r\n }", "public static function makeCover($sourceImg, $destImg)\r\n\t{\r\n\t\t$image = new Imagick($sourceImg);\r\n\t\t$w_orig = $image->getImageWidth();\r\n\t\t$h_orig = $image->getImageHeight();\r\n\t\t$w_new = SmIMAGE;\r\n\t\t$h_new = SmIMAGE * COVERASPECT;\r\n\t\t$ratio_orig = $h_orig / $w_orig;\r\n\r\n\t\tif($ratio_orig == COVERASPECT) {\r\n\t\t\t// Only resize\r\n\t\t\t$image->resizeImage($w_new, $h_new, Imagick::FILTER_CATROM, 1, TRUE);\r\n\t\t} else {\r\n\t\t\tif($ratio_orig >= COVERASPECT) {\r\n\t\t\t\t// Taller than target\r\n\t\t\t\t$w_temp = $w_new;\r\n\t\t\t\t$h_temp = $w_new * $ratio_orig;\r\n\t\t\t\t$w_center = 0;\r\n\t\t\t\t$h_center = ($h_temp - $h_new) / 2;\r\n\t\t\t} else {\r\n\t\t\t\t// Wider than target\r\n\t\t\t\t$w_temp = $h_new / $ratio_orig;\r\n\t\t\t\t$h_temp = $h_new;\r\n\t\t\t\t$w_center = ($w_temp - $w_new) / 2;\r\n\t\t\t\t$h_center = 0;\r\n\t\t\t}\r\n\t\t\t$image->resizeImage($w_temp, $h_temp, Imagick::FILTER_CATROM, 1, TRUE);\r\n\t\t\t$image->cropImage($w_new, $h_new, $w_center, $h_center);\r\n\t\t}\r\n\r\n\t\t$image->setImageCompression(Imagick::COMPRESSION_JPEG);\r\n\t\t$image->setImageCompressionQuality(80);\r\n\t\t$image->writeImage($destImg);\r\n\t\t$image->destroy();\r\n\t}", "function jCrop($src,$x,$y,$w,$h,$file_prefix='',$output=false,$quality=100,$fresh_name=false){\n\n\t\t$extension = strtolower($this->getExtension($src,false)); // false - tells to get \"jpg\" NOT \".jpg\" GOT IT :P\n\t\t\n\t\tif($fresh_name == false){\n\t\t\t$newImgName = $file_prefix.$src;\n\t\t}else{\n\t\t\t$newImgName = $file_prefix; //file_prefix contains full fresh\n\t\t}\n\t\t//saving the image into memory (for manipulation with GD Library)\n\t\tswitch($extension) {\n\t\t\tcase 'gif':\n\t\t\t$img_r = imagecreatefromgif($this->path.$src);\n\t\t\tbreak;\n\t\t\tcase 'jpg':\n\t\t\t$img_r = imagecreatefromjpeg($this->path.$src);\n\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t$img_r = imagecreatefrompng($this->path.$src);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$targ_w = $w;\n\t\t$targ_h = $h;\n\t\t$dst_r = imagecreatetruecolor( $targ_w, $targ_h );\n\t if($extension == 'png'){\n imagealphablending( $dst_r, false );\n imagesavealpha( $dst_r, true );\n }\n\t\timagecopyresampled($dst_r,$img_r,0,0,$x,$y,$targ_w,$targ_h,$w,$h);\n\t\t\n\t\tif($output){\n\t\t\tif($extension==\"jpg\" ){\n\t\t\t\theader('Content-type: image/jpeg');\n\t\t\t\timagejpeg($dst_r);\n\t\t\t}elseif($extension==\"gif\" ){\n\t\t\t\theader('Content-type: image/gif');\n\t\t\t\timagegif($dst_r);\n\t\t\t}elseif($extension==\"png\" ){\n\t\t\t\theader('Content-type: image/png');\n\t\t\t\timagepng($dst_r);\n\t\t\t}\n\t\t}else{\n\t\t\t$return = false;\n\t\t\tif($extension==\"jpg\" ){\n\t\t\t\timagejpeg( $dst_r,$this->path.$newImgName, $quality );\n\t\t\t\t$return = true;\n\t\t\t}elseif($extension==\"gif\" ){\n\t\t\t\timagegif( $dst_r, $this->path.$newImgName );\n\t\t\t\t$return = true;\n\t\t\t}elseif($extension==\"png\" ){\n\t\t\t\timagepng( $dst_r, $this->path.$newImgName, ceil( 9 ) );\n\t\t\t\t$return = true;\n\t\t\t}\n\t\t\treturn $return;\n\t\t}\n\t}", "public function resizeAndCopyImage($sourceFileName, $sourceFileExtension, $sourcePath = null, $destWidth, $destHeight, $destFileName = null, $destFileExtension = null, $destPath = null)\n\t{\n\t\t// If the destination file name is not set\n\t\tif($destFileName == null)\n\t\t{\n\t\t\t$destFileName = $sourceFileName;\n\t\t}\n\n\t\t// If the fileextension is not set\n\t\tif($destFileExtension == null)\n\t\t{\n\t\t\t$destFileExtension = $sourceFileExtension;\n\t\t}\n\n\t\t// If a custom path is not given to the destination\n\t\tif($destPath == null)\n\t\t{\n\t\t\t$destPath = $sourcePath;\n\t\t}\n\t\t\n\t\t// Generate the paths for the images\n\t\t$sourcePath = FileComponent::createFilePath($sourcePath, $sourceFileName, $sourceFileExtension, true);\n\t\t$destPath = FileComponent::createFilePath($destPath, $destFileName, $destFileExtension, true);\n\n\t $sourceFile = new File($sourcePath);\n\t $sourceFileInformation = $sourceFile->info();\n\n\t // Check if everything has one of the allowed file extension\n\t\t$allowedExtensions = array(\"gif\", \"jpeg\", \"png\");\n\t\tif(!in_array($sourceFileExtension, $allowedExtensions) ||\n\t\t !in_array($destFileExtension, $allowedExtensions) ||\n\t\t !in_array($sourceFileInformation['extension'], $allowedExtensions))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Fetch data about the image\n\t list($sourceWidth, $sourceHeight, $sourceImageType) = getimagesize($sourcePath);\n\n\t // Create an image in the cache according to the type\n\t switch ($sourceImageType) \n\t {\n\t case IMAGETYPE_GIF:\n\t $destGDImage = imagecreatefromgif($sourcePath);\n\t break;\n\t case IMAGETYPE_JPEG:\n\t $destGDImage = imagecreatefromjpeg($sourcePath);\n\t break;\n\t case IMAGETYPE_PNG:\n\t $destGDImage = imagecreatefrompng($sourcePath);\n\t break;\n\t }\n\t if ($destGDImage === false) \n\t {\n\t return false;\n\t }\n\t // Calcluates the aspects of the old and the new image\n\t $sourceAspectRatio = $sourceWidth / $sourceHeight;\n\t $destAspecRatio = $destWidth / $destHeight;\n\n\t // If the source image is smaller than the requested one\n\t if ($sourceWidth <= $destWidth && $sourceHeight <= $destHeight)\n\t {\n\t $newWidth = $sourceWidth;\n\t $newHeight = $sourceHeight;\n\t } \n\t // If the request image is wider than the source\n\t elseif ($destAspecRatio > $sourceAspectRatio) \n\t {\n\t $newWidth = (int) ($destHeight * $sourceAspectRatio);\n\t $newHeight = $destHeight;\n\t } \n\t // If the request image is taller than the source\n\t else \n\t {\n\t $newWidth = $destWidth;\n\t $newHeight = (int) ($destWidth / $sourceAspectRatio);\n\t }\n\n\t // Generate an image width the calculated width and height\n\t $newGDImage = imagecreatetruecolor($newWidth, $newHeight);\n\n\t // Resize (resample) the image\n\t imagecopyresampled($newGDImage, $destGDImage, 0, 0, 0, 0, $newWidth, $newHeight, $sourceWidth, $sourceHeight);\n\t \n\t // Check what output that is wanted\n\t switch ($sourceImageType) \n\t {\n\t case IMAGETYPE_GIF:\n\t imagegif($newGDImage, $destPath);\n\t break;\n\t case IMAGETYPE_JPEG:\n\t imagejpeg($newGDImage, $destPath, 75);\n\t break;\n\t case IMAGETYPE_PNG:\n\t imagepng($newGDImage, $destPath, 9);\n\t break;\n\t }\n\n\t // Destroy the images in the cache\n\t imagedestroy($destGDImage);\n\t imagedestroy($newGDImage);\n\n\t return true;\n\t}", "public static function _clone($a_source_xmg_id, $a_dest_xmg_id)\n\t{\n\t\t$dest = self::_getInstanceByXmgId($a_dest_xmg_id);\n\t\t$source = self::_getInstanceByXmgId($a_source_xmg_id);\n\t\tforeach($source->getArchives() as $archive)\n\t\t{\n\t\t\t$s_path = $source->getPath($archive['filename']);\n\t\t\t$d_path = $dest->getPath($archive['filename']);\n\n\t\t\t@copy($s_path, $d_path);\n\n\t\t\t$dest->addArchive($archive['filename']);\n\t\t}\n\t}", "protected function doActualConvert()\n {\n/*\n $im = \\Jcupitt\\Vips\\Image::newFromFile($this->source);\n //$im->writeToFile(__DIR__ . '/images/small-vips.webp', [\"Q\" => 10]);\n\n $im->webpsave($this->destination, [\n \"Q\" => 80,\n //'near_lossless' => true\n ]);\n return;*/\n\n $im = $this->createImageResource();\n $options = $this->createParamsForVipsWebPSave();\n $this->webpsave($im, $options);\n }", "function recurse_copy(string $src, string $dst) : void {\n\t$dir = opendir($src);\n\t@mkdir($dst);\n\twhile(false !== ( $file = readdir($dir)) ) {\n\t\tif (( $file != '.' ) && ( $file != '..' )) {\n\t\t\tif ( is_dir($src . '/' . $file) ) {\n\t\t\t\trecurse_copy($src . '/' . $file,$dst . '/' . $file);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcopy($src . '/' . $file,$dst . '/' . $file);\n\t\t\t}\n\t\t}\n\t}\n\tclosedir($dir);\n}", "public static function copy(string $srcImgPath, string $dstDirpath, string $dstImgName = null): string {\r\n FileHelper::makeDirectory($dstDirpath);\r\n $dstImgName = empty($dstImgName) \r\n ? basename($srcImgPath) : \r\n $dstImgName . '.' . pathinfo($srcImgPath, PATHINFO_EXTENSION);\r\n file_put_contents(rtrim($dstDirpath, '/') . '/' . $dstImgName, file_get_contents($srcImgPath), LOCK_EX);\r\n return $dstImgName;\r\n }", "private function imagecopymerge_alpha( $dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct ) {\n\t\t$cut = imagecreatetruecolor( $src_w, $src_h );\n\n\t\t// copy relevant section from background to the cut resource\n\t\timagecopy( $cut, $dst_im, 0, 0, $dst_x, $dst_y, $src_w, $src_h );\n\n\t\t// copy relevant section from watermark to the cut resource\n\t\timagecopy( $cut, $src_im, 0, 0, $src_x, $src_y, $src_w, $src_h );\n\n\t\t// insert cut resource to destination image\n\t\timagecopymerge( $dst_im, $cut, $dst_x, $dst_y, 0, 0, $src_w, $src_h, $pct );\n\t}", "function imagecompress($source, $destination, $quality) {\r\n $info = getimagesize($source);\r\n if ($info['mime'] == 'image/jpeg')\r\n $image = imagecreatefromjpeg($source);\r\n elseif ($info['mime'] == 'image/gif')\r\n $image = imagecreatefromgif($source);\r\n elseif ($info['mime'] == 'image/png')\r\n $image = imagecreatefrompng($source);\r\n imagejpeg($image, $destination, $quality);\r\n unlink($source);\r\n return $destination;\r\n}" ]
[ "0.86789256", "0.6987816", "0.68263185", "0.6821014", "0.67134887", "0.6627083", "0.6581096", "0.65409523", "0.6374775", "0.6354191", "0.6333342", "0.6292245", "0.62898445", "0.6280418", "0.6250946", "0.6244684", "0.62239826", "0.62184274", "0.62168634", "0.61389434", "0.604591", "0.6021256", "0.6009025", "0.5999907", "0.598175", "0.59817356", "0.59817356", "0.59817356", "0.59817356", "0.59555864", "0.5947434", "0.5938299", "0.5915854", "0.59147716", "0.59056646", "0.5885478", "0.58805275", "0.5873818", "0.5864814", "0.5864814", "0.5856084", "0.5850589", "0.5841762", "0.5839725", "0.583125", "0.5825828", "0.5812518", "0.5804523", "0.580314", "0.57956815", "0.5783171", "0.5777451", "0.57647043", "0.57508105", "0.57415587", "0.5728838", "0.57194316", "0.571664", "0.56889457", "0.5685145", "0.56667644", "0.56434476", "0.5642981", "0.5642981", "0.56257397", "0.5621392", "0.56159586", "0.55992675", "0.5595614", "0.5595132", "0.5587654", "0.5582304", "0.5562582", "0.555977", "0.55593073", "0.5558295", "0.5556745", "0.5550028", "0.5548399", "0.5540191", "0.55339557", "0.55286473", "0.5527824", "0.5515577", "0.5508174", "0.55050904", "0.5501686", "0.54972523", "0.5496883", "0.5496872", "0.5491179", "0.5489133", "0.54806757", "0.5470788", "0.5462522", "0.545439", "0.54514045", "0.54491675", "0.5445066", "0.5426066", "0.5423193" ]
0.0
-1
our list of mime types
static function get_mime_type($file) { $mime_types = array( "pdf" => "application/pdf" , "exe" => "application/octet-stream" , "zip" => "application/zip" // ,"docx"=>"application/msword" , "docx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document" , "doc" => "application/msword" , "rtf" => "text/rtf" , "txt" => "text/plain" , "xls" => "application/vnd.ms-excel" , "ppt" => "application/vnd.ms-powerpoint" , "pptx" => "application/vnd.openxmlformats-officedocument.presentationml.presentation" , "gif" => "image/gif" , "png" => "image/png" , "jpeg" => "image/jpg" , "jpg" => "image/jpg" , "mp3" => "audio/mpeg" , "wav" => "audio/x-wav" , "mpeg" => "video/mpeg" , "mpg" => "video/mpeg" , "mpe" => "video/mpeg" , "mov" => "video/quicktime" , "avi" => "video/x-msvideo" , "3gp" => "video/3gpp" , "css" => "text/css" , "jsc" => "application/javascript" , "js" => "application/javascript" , "php" => "text/html" , "htm" => "text/html" , "html" => "text/html" , "xlsx" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" , "xltx" => "application/vnd.openxmlformats-officedocument.spreadsheetml.template" , "potx" => "application/vnd.openxmlformats-officedocument.presentationml.template" , "ppsx" => "application/vnd.openxmlformats-officedocument.presentationml.slideshow" , "pptx" => "application/vnd.openxmlformats-officedocument.presentationml.presentation" , "sldx" => "application/vnd.openxmlformats-officedocument.presentationml.slide" , "docx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document" , "dotx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.template" , "xlam" => "application/vnd.ms-excel.addin.macroEnabled.12" , "xlsb" => "application/vnd.ms-excel.sheet.binary.macroEnabled.12" ); $extention = explode('.', $file); $extension = end($extention); $extension = strtolower($extension); return $mime_types[$extension]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getAllMimeTypes():array;", "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 static function getMimeTypes()\n\t{\n\t\treturn MHTTPD::$config['Mimes'];\n\t}", "public function getMimetypes()\n\t{\n\t\treturn $this->mimeTypes;\n\t}", "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}", "function mimetypes()\n {\n return json_decode(file_get_contents(__DIR__.'/../../resources/data/mimetypes.json'), true);\n }", "function wp_get_mime_types()\n {\n }", "public function getMimeTypes() {\n return $this->mimeTypes;\n }", "public function getImageMimeTypes()\n {\n return 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 'image/gif',\n 'image/x-xbitmap',\n 'image/gi_',\n 'image/png',\n 'application/png',\n 'application/x-png'\n );\n }", "public static function getCustomMimeTypeList()\n {\n # Returns the system MIME type mapping of extensions to MIME types.\n $out = array();\n $file = fopen( Configuration::mimeTypeList, 'r' );\n while ( ( $line = fgets( $file ) ) !== false ) {\n $line = trim( preg_replace( '/#.*/', '', $line ) );\n if ( ! $line )\n continue;\n $parts = preg_split( '/\\s+/', $line );\n if ( count( $parts ) == 1 )\n continue;\n $type = array_shift( $parts );\n foreach( $parts as $part )\n $out[$part] = $type;\n }\n fclose( $file );\n return $out;\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}", "public static function _mime_types($ext = '')\n {\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}", "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 getAvailableMimeTypes()\n {\n return $this->availableMimeTypes;\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 get_post_mime_types()\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}", "public function getSupportedMIMETypes(): array\n {\n $mime = null;\n $mimeTypes = [];\n\n $response = preg_split(\"/\\n/\", $this->request('mime-types')) ?: [];\n\n foreach($response as $line)\n {\n if(preg_match('/^\\w+/', $line))\n {\n $mime = trim($line);\n $mimeTypes[$mime] = ['alias' => []];\n }\n else\n {\n [$key, $value] = preg_split('/:\\s+/', trim($line));\n\n if($key == 'alias')\n {\n $mimeTypes[$mime]['alias'][] = $value;\n }\n else\n {\n $mimeTypes[$mime][$key] = $value;\n }\n }\n }\n\n\n return $mimeTypes;\n }", "public function getSupportedMimes()\n {\n if ($this->mimes) {\n return $this->mimes;\n }\n\n $response = $this->get(\n 'mime-types',\n $this->getGuzzleOptions([\n 'headers' => [\n 'Accept' => 'application/json',\n ],\n ])\n );\n\n return $this->mimes = json_decode($response->getBody(), true);\n }", "public function getSupportedMimeTypes()\n {\n return array_keys($this->convertersByMimeType);\n }", "function cc_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n }", "public function getMimeTypes()\n {\n return explode(';', $this->response->getHeader('Content-Type')[0]);\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}", "function cc_mime_types( $mimes ) {\n\n\t$mimes['svg'] = 'image/svg+xml';\n\n\treturn $mimes;\n\n}", "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 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}", "protected function get_media_types()\n {\n }", "private function getAllowedFileTypes()\n {\n return str_replace('.', '', config('media.allowed', ''));\n }", "function cc_mime_types( $mimes ){\n\t$mimes['svg'] = 'image/svg+xml';\n\treturn $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 $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n}", "public function cc_mime_types($mimes) {\n $mimes['avi'] = 'video/avi';\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n }", "private function get_mime_type($fn) {\r\n \r\n $mime_types = array(\r\n \r\n 'txt' => 'text/plain',\r\n 'htm' => 'text/html',\r\n 'html' => 'text/html',\r\n 'php' => 'text/html',\r\n 'css' => 'text/css',\r\n 'js' => 'application/javascript',\r\n 'json' => 'application/json',\r\n 'xml' => 'application/xml',\r\n 'swf' => 'application/x-shockwave-flash',\r\n 'flv' => 'video/x-flv',\r\n \r\n // images\r\n 'png' => 'image/png',\r\n 'jpe' => 'image/jpeg',\r\n 'jpeg' => 'image/jpeg',\r\n 'jpg' => 'image/jpeg',\r\n 'gif' => 'image/gif',\r\n 'bmp' => 'image/bmp',\r\n 'ico' => 'image/vnd.microsoft.icon',\r\n 'tiff' => 'image/tiff',\r\n 'tif' => 'image/tiff',\r\n 'svg' => 'image/svg+xml',\r\n 'svgz' => 'image/svg+xml',\r\n \r\n // archives\r\n 'zip' => 'application/zip',\r\n 'rar' => 'application/x-rar-compressed',\r\n 'exe' => 'application/x-msdownload',\r\n 'msi' => 'application/x-msdownload',\r\n 'cab' => 'application/vnd.ms-cab-compressed',\r\n \r\n // audio/video\r\n 'mp3' => 'audio/mpeg',\r\n 'qt' => 'video/quicktime',\r\n 'mov' => 'video/quicktime',\r\n \r\n // adobe\r\n 'pdf' => 'application/pdf',\r\n 'psd' => 'image/vnd.adobe.photoshop',\r\n 'ai' => 'application/postscript',\r\n 'eps' => 'application/postscript',\r\n 'ps' => 'application/postscript',\r\n \r\n // ms office\r\n 'doc' => 'application/msword',\r\n 'rtf' => 'application/rtf',\r\n 'xls' => 'application/vnd.ms-excel',\r\n 'ppt' => 'application/vnd.ms-powerpoint',\r\n \r\n // open office\r\n 'odt' => 'application/vnd.oasis.opendocument.text',\r\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\r\n );\r\n \r\n $ext = strtolower(array_pop(explode('.',$fn)));\r\n if (array_key_exists($ext, $mime_types)) {\r\n return $mime_types[$ext];\r\n }\r\n elseif (function_exists('finfo_open')) {\r\n $finfo = finfo_open(FILEINFO_MIME);\r\n $mimetype = finfo_file($finfo, $fn);\r\n finfo_close($finfo);\r\n return $mimetype;\r\n }\r\n else {\r\n return 'application/octet-stream';\r\n }\r\n }", "function hankart_cc_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n }", "function net_liggitt_add_mime_types($mimes) {\n $mimes = array_merge($mimes, array(\n 'epub|mobi' => 'application/octet-stream'\n ));\n return $mimes;\n}", "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}", "function get_available_post_mime_types($type = 'attachment')\n {\n }", "public function getMimetype();", "public function getMimetypeMapping()\n {\n if (isset($this->raw->mimetypes)) {\n return (array) $this->raw->mimetypes;\n }\n\n return array();\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 add_mime_types( $mime_types ) {\n\n\t\t$mime_types['json'] = 'application/json';\n\n\t\treturn $mime_types;\n\n\t}", "public function supported_filetypes() {\n return '*';\n }", "public function getSupportedFileTypes(){\n\t\t$_url = $this->constants['SERVICE_ENTRY_POINT'].$this->constants['SERVICE_VERSION'].'/'.$this->constants['MISC_PATH'].'/supported-file-types';\n\t\t$response = $this->getRequests($_url)['response'];\n\t\treturn $response;\n\t}", "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 floox_mime_types( $mimes ){\n $mimes['svg'] = 'image/svg+xml';\n $mimes['svgz'] = 'image/svg+xml';\n return $mimes;\n}", "function custom_mimes( $mimes ) {\n\t$mimes['svg'] = 'image/svg+xml';\n\t$mimes['json'] = 'application/json';\n\n\treturn $mimes;\n}", "public static function exts_by_mime($type)\r\n {\r\n static $types = array();\r\n\r\n // Fill the static array\r\n if (empty($types))\r\n {\r\n $mimes = Core::config('mimes');\r\n foreach ($mimes as $ext => $ms)\r\n {\r\n foreach ($ms as $mime)\r\n {\r\n if ($mime == 'application/octet-stream')\r\n {\r\n // octet-stream is a generic binary\r\n continue;\r\n }\r\n\r\n if (!isset($types[$mime]))\r\n {\r\n $types[$mime] = array((string)$ext);\r\n }\r\n elseif (!in_array($ext, $types[$mime]))\r\n {\r\n $types[$mime][] = (string)$ext;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return isset($types[$type])?$types[$type]:false;\r\n }", "function nylon_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $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}", "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 get_allowed_mime_types($user = \\null)\n {\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 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 function get_allowed_content_object_types()\n {\n return array(File::class);\n }", "protected function getAcceptFileTypes()\n {\n $extensions = $this->getValidator()->getAllowedExtensions();\n if (!$extensions) {\n return [];\n }\n $extentionString = \"\";\n $i = 0;\n foreach ($extensions as $extension) {\n if ($i == 0) {\n $extentionString .= \".{$extension}\";\n } else {\n $extentionString .= \", .{$extension}\";\n }\n $i++;\n }\n return $extentionString;\n }", "function getMimeType() ;", "public static function getMimeMapping()\n\t{\n\t\t// get current mimes\n\t\t$mimes = parent::getMimeMapping();\n\n\t\t// add missing mimes\n\t\t$mimes['mp3'][] = 'audio/mp3'; // necesary for Chrome unsolved bug\n\t\t$mimes['p7m'][] = 'application/pkcs7-mime';\n\t\t$mimes['kml'][] = 'application/octet-stream';\n\t\t$mimes['kmz'][] = 'application/octet-stream';\n\t\t\n\t\treturn $mimes;\n\t}", "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 }", "static function getValidContentTypes() {\n return array(\n 'image/',\n 'text/',\n 'application/pdf',\n );\n }", "function fn_get_ext_mime_types($key = 'ext')\n{\n $types = array (\n 'zip' => 'application/zip',\n 'tgz' => 'application/tgz',\n 'rar' => 'application/rar',\n\n 'exe' => 'application/exe',\n 'com' => 'application/com',\n 'bat' => 'application/bat',\n\n 'png' => 'image/png',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/x-icon',\n 'swf' => 'application/x-shockwave-flash',\n\n 'csv' => 'text/csv',\n 'txt' => 'text/plain',\n 'xml' => 'application/xml',\n 'doc' => 'application/msword',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'pdf' => 'application/pdf',\n\n 'css' => 'text/css',\n 'js' => 'text/javascript'\n );\n\n if ($key == 'mime') {\n $types = array_flip($types);\n }\n\n return $types;\n}", "function wp_match_mime_types($wildcard_mime_types, $real_mime_types)\n {\n }", "protected function getMimeContentType($filename)\r\n {\r\n $mime_types = array(\r\n\r\n 'txt' => 'text/plain',\r\n 'htm' => 'text/html',\r\n 'html' => 'text/html',\r\n 'php' => 'text/html',\r\n 'css' => 'text/css',\r\n 'js' => 'application/javascript',\r\n 'json' => 'application/json',\r\n 'xml' => 'application/xml',\r\n 'swf' => 'application/x-shockwave-flash',\r\n 'flv' => 'video/x-flv',\r\n\r\n // images\r\n 'png' => 'image/png',\r\n 'jpe' => 'image/jpeg',\r\n 'jpeg' => 'image/jpeg',\r\n 'jpg' => 'image/jpeg',\r\n 'gif' => 'image/gif',\r\n 'bmp' => 'image/bmp',\r\n 'ico' => 'image/vnd.microsoft.icon',\r\n 'tiff' => 'image/tiff',\r\n 'tif' => 'image/tiff',\r\n 'svg' => 'image/svg+xml',\r\n 'svgz' => 'image/svg+xml',\r\n\r\n // archives\r\n 'zip' => 'application/zip',\r\n 'rar' => 'application/x-rar-compressed',\r\n 'exe' => 'application/x-msdownload',\r\n 'msi' => 'application/x-msdownload',\r\n 'cab' => 'application/vnd.ms-cab-compressed',\r\n\r\n // audio/video\r\n 'mp3' => 'audio/mpeg',\r\n 'qt' => 'video/quicktime',\r\n 'mov' => 'video/quicktime',\r\n\r\n // adobe\r\n 'pdf' => 'application/pdf',\r\n 'psd' => 'image/vnd.adobe.photoshop',\r\n 'ai' => 'application/postscript',\r\n 'eps' => 'application/postscript',\r\n 'ps' => 'application/postscript',\r\n\r\n // ms office\r\n 'doc' => 'application/msword',\r\n 'rtf' => 'application/rtf',\r\n 'xls' => 'application/vnd.ms-excel',\r\n 'ppt' => 'application/vnd.ms-powerpoint',\r\n\r\n // open office\r\n 'odt' => 'application/vnd.oasis.opendocument.text',\r\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\r\n );\r\n\r\n $ext = strtolower(array_pop(explode('.',$filename)));\r\n if (array_key_exists($ext, $mime_types)) {\r\n return $mime_types[$ext];\r\n } elseif (function_exists('finfo_open')) {\r\n $finfo = finfo_open(FILEINFO_MIME);\r\n $mimeType = finfo_file($finfo, $filename);\r\n finfo_close($finfo);\r\n return $mimeType;\r\n } else {\r\n return 'application/octet-stream';\r\n }\r\n }", "public function MimeType();", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType() {}", "function cc_mime_types($mimes) {\n$mimes['svg'] = 'image/svg+xml';\nreturn $mimes;\n}", "public static function &getMimes()\n {\n static $_mimes;\n\n if (empty($_mimes)) {\n $_mimes = file_exists(__DIR__ . '/../Config/Mimes.php')\n ? include __DIR__ . '/../Config/Mimes.php'\n : array();\n\n if (file_exists(__DIR__ . '/../Config/Mimes.php')) {\n $_mimes = array_merge($_mimes, include __DIR__ . '/../Config/Mimes.php');\n }\n }\n\n return $_mimes;\n }", "function get_image_file_types() {\n return array( \n 'gif',\n 'jpg',\n 'jpeg',\n 'png',\n 'wbmp',\n );\n }", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function mime ();", "function _mime_content_type($filename) {\n $finfo = finfo_open();\n $fileinfo = finfo_file($finfo, $filename, FILEINFO_MIME);\n finfo_close($finfo);\n return reset(explode(\";\",$fileinfo));\n \n \n //hiphop workaround hiphop does not work with inotify\n //exec(\"file \".str_replace(\" \",\"\\ \",$filename).\" --mime\",$output);\n \n $half = explode(\": \",$output[0]);\n $done = explode(\"; \",$half[1]);\n return $done[0];\n }", "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 mimes_types(string $p_mime_type) {\n global $mimes;\n\n if (!isset($mime_types) || count($mime_types) == 0) {\n if (is_file(APPPATH.'config/mimes.php')) {\n include(APPPATH.'config/mimes.php');\n } else {\n return null;\n }\n\n $mime_types = $mimes;\n unset($mimes);\n }\n\n return (!isset($mime_types[$p_mime_type])) ? null : $mime_types[$p_mime_type];\n}", "function system_mime_map()\n{\n return [\n 'video/3gpp2' => '3g2',\n 'video/3gp' => '3gp',\n 'video/3gpp' => '3gp',\n 'application/x-compressed' => '7zip',\n 'audio/x-acc' => 'aac',\n 'audio/ac3' => 'ac3',\n 'application/postscript' => 'ai',\n 'audio/x-aiff' => 'aif',\n 'audio/aiff' => 'aif',\n 'audio/x-au' => 'au',\n 'video/x-msvideo' => 'avi',\n 'video/msvideo' => 'avi',\n 'video/avi' => 'avi',\n 'application/x-troff-msvideo' => 'avi',\n 'application/macbinary' => 'bin',\n 'application/mac-binary' => 'bin',\n 'application/x-binary' => 'bin',\n 'application/x-macbinary' => 'bin',\n 'image/bmp' => 'bmp',\n 'image/x-bmp' => 'bmp',\n 'image/x-bitmap' => 'bmp',\n 'image/x-xbitmap' => 'bmp',\n 'image/x-win-bitmap' => 'bmp',\n 'image/x-windows-bmp' => 'bmp',\n 'image/ms-bmp' => 'bmp',\n 'image/x-ms-bmp' => 'bmp',\n 'application/bmp' => 'bmp',\n 'application/x-bmp' => 'bmp',\n 'application/x-win-bitmap' => 'bmp',\n 'application/cdr' => 'cdr',\n 'application/coreldraw' => 'cdr',\n 'application/x-cdr' => 'cdr',\n 'application/x-coreldraw' => 'cdr',\n 'image/cdr' => 'cdr',\n 'image/x-cdr' => 'cdr',\n 'zz-application/zz-winassoc-cdr' => 'cdr',\n 'application/mac-compactpro' => 'cpt',\n 'application/pkix-crl' => 'crl',\n 'application/pkcs-crl' => 'crl',\n 'application/x-x509-ca-cert' => 'crt',\n 'application/pkix-cert' => 'crt',\n 'text/css' => 'css',\n 'text/x-comma-separated-values' => 'csv',\n 'text/comma-separated-values' => 'csv',\n 'application/vnd.msexcel' => 'csv',\n 'application/x-director' => 'dcr',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx',\n 'application/x-dvi' => 'dvi',\n 'message/rfc822' => 'eml',\n 'application/x-msdownload' => 'exe',\n 'video/x-f4v' => 'f4v',\n 'audio/x-flac' => 'flac',\n 'video/x-flv' => 'flv',\n 'image/gif' => 'gif',\n 'application/gpg-keys' => 'gpg',\n 'application/x-gtar' => 'gtar',\n 'application/x-gzip' => 'gzip',\n 'application/mac-binhex40' => 'hqx',\n 'application/mac-binhex' => 'hqx',\n 'application/x-binhex40' => 'hqx',\n 'application/x-mac-binhex40' => 'hqx',\n 'text/html' => 'html',\n 'image/x-icon' => 'ico',\n 'image/x-ico' => 'ico',\n 'image/vnd.microsoft.icon' => 'ico',\n 'text/calendar' => 'ics',\n 'application/java-archive' => 'jar',\n 'application/x-java-application' => 'jar',\n 'application/x-jar' => 'jar',\n 'image/jp2' => 'jp2',\n 'video/mj2' => 'jp2',\n 'image/jpx' => 'jp2',\n 'image/jpm' => 'jp2',\n 'image/jpeg' => 'jpg',\n // 'image/jpeg' => 'jpeg',\n 'image/pjpeg' => 'jpeg',\n 'application/x-javascript' => 'js',\n 'application/json' => 'json',\n 'text/json' => 'json',\n 'application/vnd.google-earth.kml+xml' => 'kml',\n 'application/vnd.google-earth.kmz' => 'kmz',\n 'text/x-log' => 'log',\n 'audio/x-m4a' => 'm4a',\n 'application/vnd.mpegurl' => 'm4u',\n 'audio/midi' => 'mid',\n 'application/vnd.mif' => 'mif',\n 'video/quicktime' => 'mov',\n 'video/x-sgi-movie' => 'movie',\n 'audio/mpeg' => 'mp3',\n 'audio/mpg' => 'mp3',\n 'audio/mpeg3' => 'mp3',\n 'audio/mp3' => 'mp3',\n 'video/mp4' => 'mp4',\n 'video/mpeg' => 'mpeg',\n 'application/oda' => 'oda',\n 'audio/ogg' => 'ogg',\n 'video/ogg' => 'ogg',\n 'application/ogg' => 'ogg',\n 'application/x-pkcs10' => 'p10',\n 'application/pkcs10' => 'p10',\n 'application/x-pkcs12' => 'p12',\n 'application/x-pkcs7-signature' => 'p7a',\n 'application/pkcs7-mime' => 'p7c',\n 'application/x-pkcs7-mime' => 'p7c',\n 'application/x-pkcs7-certreqresp' => 'p7r',\n 'application/pkcs7-signature' => 'p7s',\n 'application/pdf' => 'pdf',\n 'application/octet-stream' => 'pdf',\n 'application/x-x509-user-cert' => 'pem',\n 'application/x-pem-file' => 'pem',\n 'application/pgp' => 'pgp',\n 'application/x-httpd-php' => 'php',\n 'application/php' => 'php',\n 'application/x-php' => 'php',\n 'text/php' => 'php',\n 'text/x-php' => 'php',\n 'application/x-httpd-php-source' => 'php',\n 'image/png' => 'png',\n 'image/x-png' => 'png',\n 'application/powerpoint' => 'ppt',\n 'application/vnd.ms-powerpoint' => 'ppt',\n 'application/vnd.ms-office' => 'ppt',\n 'application/msword' => 'doc',\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'pptx',\n 'application/x-photoshop' => 'psd',\n 'image/vnd.adobe.photoshop' => 'psd',\n 'audio/x-realaudio' => 'ra',\n 'audio/x-pn-realaudio' => 'ram',\n 'application/rar' => 'rar',\n 'application/x-rar' => 'rar',\n 'application/x-rar-compressed' => 'rar',\n 'audio/x-pn-realaudio-plugin' => 'rpm',\n 'application/x-pkcs7' => 'rsa',\n 'text/rtf' => 'rtf',\n 'text/richtext' => 'rtx',\n 'video/vnd.rn-realvideo' => 'rv',\n 'application/x-stuffit' => 'sit',\n 'application/smil' => 'smil',\n 'text/srt' => 'srt',\n 'image/svg+xml' => 'svg',\n 'application/x-shockwave-flash' => 'swf',\n 'application/x-tar' => 'tar',\n 'application/x-gzip-compressed' => 'tgz',\n 'image/tiff' => 'tiff',\n 'text/plain' => 'txt',\n 'text/x-vcard' => 'vcf',\n 'application/videolan' => 'vlc',\n 'text/vtt' => 'vtt',\n 'audio/wav' => 'wav',\n 'audio/x-wav' => 'wav',\n 'audio/wave' => 'wav',\n 'application/wbxml' => 'wbxml',\n 'video/webm' => 'webm',\n 'audio/x-ms-wma' => 'wma',\n 'application/wmlc' => 'wmlc',\n 'video/x-ms-wmv' => 'wmv',\n 'video/x-ms-asf' => 'wmv',\n 'application/xhtml+xml' => 'xhtml',\n 'application/excel' => 'xl',\n 'application/msexcel' => 'xls',\n 'application/x-msexcel' => 'xls',\n 'application/x-ms-excel' => 'xls',\n 'application/x-excel' => 'xls',\n 'application/x-dos_ms_excel' => 'xls',\n 'application/xls' => 'xls',\n 'application/x-xls' => 'xls',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx',\n 'application/vnd.ms-excel' => 'xlsx',\n 'application/xml' => 'xml',\n 'text/xml' => 'xml',\n 'text/xsl' => 'xsl',\n 'application/xspf+xml' => 'xspf',\n 'application/x-compress' => 'z',\n 'application/zip' => 'zip',\n 'application/x-zip' => 'zip',\n 'application/x-zip-compressed' => 'zip',\n 'application/s-compressed' => 'zip',\n 'multipart/x-zip' => 'zip',\n 'text/x-scriptzsh' => 'zsh',\n ];\n}", "private function supportedTypes(): array\n {\n return [\n EmailContent::MAIL_FORMAT_TEXT,\n EmailContent::MAIL_FORMAT_MARKDOWN,\n EmailContent::MAIL_FORMAT_HTML\n ];\n }", "public function getVideoMimeTypes()\n {\n return array(\n 'video/mp4v-es',\n 'audio/mp4',\n 'video/mp4',\n 'video/x-m4v',\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 'video/x-ms-wmv',\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 '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 'video/ogg',\n 'audio/3gpp',\n 'video/3gpp',\n 'video/3gpp2',\n 'audio/3gpp2',\n 'video/x-flv',\n 'video/webm',\n );\n }", "function mime2ext($mime){\n\t $all_mimes = '{\"png\":[\"image\\/png\",\"image\\/x-png\"],\"bmp\":[\"image\\/bmp\",\"image\\/x-bmp\",\n\t \"image\\/x-bitmap\",\"image\\/x-xbitmap\",\"image\\/x-win-bitmap\",\"image\\/x-windows-bmp\",\n\t \"image\\/ms-bmp\",\"image\\/x-ms-bmp\",\"application\\/bmp\",\"application\\/x-bmp\",\n\t \"application\\/x-win-bitmap\"],\"gif\":[\"image\\/gif\"],\"jpeg\":[\"image\\/jpeg\",\n\t \"image\\/pjpeg\"],\"xspf\":[\"application\\/xspf+xml\"],\"vlc\":[\"application\\/videolan\"],\n\t \"wmv\":[\"video\\/x-ms-wmv\",\"video\\/x-ms-asf\"],\"au\":[\"audio\\/x-au\"],\n\t \"ac3\":[\"audio\\/ac3\"],\"flac\":[\"audio\\/x-flac\"],\"ogg\":[\"audio\\/ogg\",\n\t \"video\\/ogg\",\"application\\/ogg\"],\"kmz\":[\"application\\/vnd.google-earth.kmz\"],\n\t \"kml\":[\"application\\/vnd.google-earth.kml+xml\"],\"rtx\":[\"text\\/richtext\"],\n\t \"rtf\":[\"text\\/rtf\"],\"jar\":[\"application\\/java-archive\",\"application\\/x-java-application\",\n\t \"application\\/x-jar\"],\"zip\":[\"application\\/x-zip\",\"application\\/zip\",\n\t \"application\\/x-zip-compressed\",\"application\\/s-compressed\",\"multipart\\/x-zip\"],\n\t \"7zip\":[\"application\\/x-compressed\"],\"xml\":[\"application\\/xml\",\"text\\/xml\"],\n\t \"svg\":[\"image\\/svg+xml\"],\"3g2\":[\"video\\/3gpp2\"],\"3gp\":[\"video\\/3gp\",\"video\\/3gpp\"],\n\t \"mp4\":[\"video\\/mp4\"],\"m4a\":[\"audio\\/x-m4a\"],\"f4v\":[\"video\\/x-f4v\"],\"flv\":[\"video\\/x-flv\"],\n\t \"webm\":[\"video\\/webm\"],\"aac\":[\"audio\\/x-acc\"],\"m4u\":[\"application\\/vnd.mpegurl\"],\n\t \"pdf\":[\"application\\/pdf\",\"application\\/octet-stream\"],\n\t \"pptx\":[\"application\\/vnd.openxmlformats-officedocument.presentationml.presentation\"],\n\t \"ppt\":[\"application\\/powerpoint\",\"application\\/vnd.ms-powerpoint\",\"application\\/vnd.ms-office\",\n\t \"application\\/msword\"],\"docx\":[\"application\\/vnd.openxmlformats-officedocument.wordprocessingml.document\"],\n\t \"xlsx\":[\"application\\/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\"application\\/vnd.ms-excel\"],\n\t \"xl\":[\"application\\/excel\"],\"xls\":[\"application\\/msexcel\",\"application\\/x-msexcel\",\"application\\/x-ms-excel\",\n\t \"application\\/x-excel\",\"application\\/x-dos_ms_excel\",\"application\\/xls\",\"application\\/x-xls\"],\n\t \"xsl\":[\"text\\/xsl\"],\"mpeg\":[\"video\\/mpeg\"],\"mov\":[\"video\\/quicktime\"],\"avi\":[\"video\\/x-msvideo\",\n\t \"video\\/msvideo\",\"video\\/avi\",\"application\\/x-troff-msvideo\"],\"movie\":[\"video\\/x-sgi-movie\"],\n\t \"log\":[\"text\\/x-log\"],\"txt\":[\"text\\/plain\"],\"css\":[\"text\\/css\"],\"html\":[\"text\\/html\"],\n\t \"wav\":[\"audio\\/x-wav\",\"audio\\/wave\",\"audio\\/wav\"],\"xhtml\":[\"application\\/xhtml+xml\"],\n\t \"tar\":[\"application\\/x-tar\"],\"tgz\":[\"application\\/x-gzip-compressed\"],\"psd\":[\"application\\/x-photoshop\",\n\t \"image\\/vnd.adobe.photoshop\"],\"exe\":[\"application\\/x-msdownload\"],\"js\":[\"application\\/x-javascript\"],\n\t \"mp3\":[\"audio\\/mpeg\",\"audio\\/mpg\",\"audio\\/mpeg3\",\"audio\\/mp3\"],\"rar\":[\"application\\/x-rar\",\"application\\/rar\",\n\t \"application\\/x-rar-compressed\"],\"gzip\":[\"application\\/x-gzip\"],\"hqx\":[\"application\\/mac-binhex40\",\n\t \"application\\/mac-binhex\",\"application\\/x-binhex40\",\"application\\/x-mac-binhex40\"],\n\t \"cpt\":[\"application\\/mac-compactpro\"],\"bin\":[\"application\\/macbinary\",\"application\\/mac-binary\",\n\t \"application\\/x-binary\",\"application\\/x-macbinary\"],\"oda\":[\"application\\/oda\"],\n\t \"ai\":[\"application\\/postscript\"],\"smil\":[\"application\\/smil\"],\"mif\":[\"application\\/vnd.mif\"],\n\t \"wbxml\":[\"application\\/wbxml\"],\"wmlc\":[\"application\\/wmlc\"],\"dcr\":[\"application\\/x-director\"],\n\t \"dvi\":[\"application\\/x-dvi\"],\"gtar\":[\"application\\/x-gtar\"],\"php\":[\"application\\/x-httpd-php\",\n\t \"application\\/php\",\"application\\/x-php\",\"text\\/php\",\"text\\/x-php\",\"application\\/x-httpd-php-source\"],\n\t \"swf\":[\"application\\/x-shockwave-flash\"],\"sit\":[\"application\\/x-stuffit\"],\"z\":[\"application\\/x-compress\"],\n\t \"mid\":[\"audio\\/midi\"],\"aif\":[\"audio\\/x-aiff\",\"audio\\/aiff\"],\"ram\":[\"audio\\/x-pn-realaudio\"],\n\t \"rpm\":[\"audio\\/x-pn-realaudio-plugin\"],\"ra\":[\"audio\\/x-realaudio\"],\"rv\":[\"video\\/vnd.rn-realvideo\"],\n\t \"jp2\":[\"image\\/jp2\",\"video\\/mj2\",\"image\\/jpx\",\"image\\/jpm\"],\"tiff\":[\"image\\/tiff\"],\n\t \"eml\":[\"message\\/rfc822\"],\"pem\":[\"application\\/x-x509-user-cert\",\"application\\/x-pem-file\"],\n\t \"p10\":[\"application\\/x-pkcs10\",\"application\\/pkcs10\"],\"p12\":[\"application\\/x-pkcs12\"],\n\t \"p7a\":[\"application\\/x-pkcs7-signature\"],\"p7c\":[\"application\\/pkcs7-mime\",\"application\\/x-pkcs7-mime\"],\"p7r\":[\"application\\/x-pkcs7-certreqresp\"],\"p7s\":[\"application\\/pkcs7-signature\"],\"crt\":[\"application\\/x-x509-ca-cert\",\"application\\/pkix-cert\"],\"crl\":[\"application\\/pkix-crl\",\"application\\/pkcs-crl\"],\"pgp\":[\"application\\/pgp\"],\"gpg\":[\"application\\/gpg-keys\"],\"rsa\":[\"application\\/x-pkcs7\"],\"ics\":[\"text\\/calendar\"],\"zsh\":[\"text\\/x-scriptzsh\"],\"cdr\":[\"application\\/cdr\",\"application\\/coreldraw\",\"application\\/x-cdr\",\"application\\/x-coreldraw\",\"image\\/cdr\",\"image\\/x-cdr\",\"zz-application\\/zz-winassoc-cdr\"],\"wma\":[\"audio\\/x-ms-wma\"],\"vcf\":[\"text\\/x-vcard\"],\"srt\":[\"text\\/srt\"],\"vtt\":[\"text\\/vtt\"],\"ico\":[\"image\\/x-icon\",\"image\\/x-ico\",\"image\\/vnd.microsoft.icon\"],\"csv\":[\"text\\/x-comma-separated-values\",\"text\\/comma-separated-values\",\"application\\/vnd.msexcel\"],\"json\":[\"application\\/json\",\"text\\/json\"]}';\n\t $all_mimes = json_decode($all_mimes,true);\n\t foreach ($all_mimes as $key => $value) {\n\t if(array_search($mime,$value) !== false) return $key;\n\t }\n\t return false;\n\t}", "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 getFileTypes() {\r\n return $this->fileTypes;\r\n }", "private function get_mime_type(string $file_path) {\n //MIME Types\n $mime_types = array(\n 'txt' => 'text/plain',\n 'htm' => 'text/html',\n 'html' => 'text/html',\n 'php' => 'text/html',\n 'css' => 'text/css',\n 'js' => 'application/javascript',\n 'json' => 'application/json',\n 'xml' => 'application/xml',\n 'swf' => 'application/x-shockwave-unic',\n 'flv' => 'video/x-flv',\n\n //Images\n 'png' => 'image/png',\n 'jpe' => 'image/jpeg',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/vnd.microsoft.icon',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'svg' => 'image/svg+xml',\n 'svgz' => 'image/svg+xml',\n\n //Archives\n 'zip' => 'application/zip',\n 'rar' => 'application/x-rar-compressed',\n 'exe' => 'application/x-msdownload',\n 'msi' => 'application/x-msdownload',\n 'cab' => 'application/vnd.ms-cab-compressed',\n\n //Audio/Video\n 'mp3' => 'audio/mpeg',\n 'qt' => 'video/quicktime',\n 'mov' => 'video/quicktime',\n\n //Adobe\n 'pdf' => 'application/pdf',\n 'psd' => 'image/vnd.adobe.photoshop',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript',\n\n //MS Office\n 'doc' => 'application/msword',\n 'rtf' => 'application/rtf',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'docx' => 'application/msword',\n 'xlsx' => 'application/vnd.ms-excel',\n 'pptx' => 'application/vnd.ms-powerpoint',\n\n //Open Office\n 'odt' => 'application/vnd.oasis.opendocument.text',\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n );\n\n $ext_array = explode('.', $file_path);\n $extension = strtolower(end($ext_array));\n if(isset($mime_types[$extension])) {\n return $mime_types[$extension];\n } else {\n return mime_content_type($file_path);\n }\n }", "public static function getTypes() {\n\t\treturn array(self::TYPE_FILE, self::TYPE_SOURCE, self::TYPE_THUMBNAIL);\n\t}" ]
[ "0.84841037", "0.8219087", "0.81329864", "0.8121718", "0.8051271", "0.80279964", "0.8012918", "0.7993711", "0.7973081", "0.79279345", "0.78502285", "0.7840629", "0.7797382", "0.77961123", "0.77957976", "0.7763951", "0.76712495", "0.76610696", "0.7629549", "0.76218915", "0.757747", "0.7561507", "0.7555314", "0.75437", "0.75400186", "0.75400186", "0.75400186", "0.75325775", "0.7523288", "0.7516374", "0.7498732", "0.749847", "0.7494901", "0.74596465", "0.74596465", "0.74596465", "0.74596465", "0.74596465", "0.74596465", "0.74596465", "0.74596465", "0.74596465", "0.74596465", "0.74596465", "0.74308056", "0.74124235", "0.73982066", "0.73864514", "0.73685217", "0.7364529", "0.73523986", "0.7340003", "0.73302656", "0.7329989", "0.7306701", "0.72778237", "0.7275761", "0.7262258", "0.7257285", "0.72533405", "0.7250644", "0.7247959", "0.7233178", "0.72279024", "0.7211212", "0.72078454", "0.72046477", "0.7132665", "0.71237236", "0.71224797", "0.71207714", "0.70983404", "0.7070144", "0.7059428", "0.70440304", "0.702871", "0.70195025", "0.7001618", "0.7001618", "0.7001618", "0.7001618", "0.6998504", "0.6997632", "0.6994176", "0.6992777", "0.6992777", "0.6992777", "0.6992777", "0.6992777", "0.697708", "0.69703335", "0.696995", "0.6961471", "0.6953215", "0.69405663", "0.6932261", "0.69269824", "0.692118", "0.6908323", "0.6881601", "0.6866242" ]
0.0
-1
Lap de sap xep
function sapXep($arr){ for ($i = 0; $i < count($arr) - 1; $i ++){ // Tim vi tri min $min = $i; for ($j = $i +1; $j < count($arr); $j ++){ if ($arr[$j] < $arr[$min]){ $min = $j; } } //sau khi co vi tri nho nhat thi doi vi tri voi $i $temp = $arr[$i]; $arr[$i] = $arr[$min]; $arr[$min] = $temp; } return $arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function xlate($ie, $oe) {}", "function sigaloneval($origerr,$numplaces){\n\n\t\t$x=round($origerr*(pow(10,(($numplaces-1)-floor(log10($origerr)))))) * pow(10,(floor(log10($origerr)))-($numplaces-1));\n\t\n\t\treturn($x);\n\n\t}", "abstract function fromexp();", "public function elso()\n {\n }", "public function + aire()\n {\n // section -64--88--103-1-2c9bd139:16deeff2ef5:-8000:00000000000009A4 begin\n // section -64--88--103-1-2c9bd139:16deeff2ef5:-8000:00000000000009A4 end\n }", "function get_pmin_theo($t100,$v100,$v0) {\r\n\tglobal $mw,$mw_zu,$F_haft,$evmail;\r\n\t# Wieviel Leistung noetig für Beschleunigung 0-100km/h in x Sekunden?\r\n\t# Ausgangsbasis: Annahme nur Haftgrenze:\r\n\t$Pmin=$F_haft*$v100/1000; \t\t\t\t\t # 0-100km/h\r\n\t# 1.Bereich: Konstante Reifenkraftschlussgrenze\r\n\t#\t\tv=a*t ergibt: t=vx*mw/F_haft\r\n\t$vx=$Pmin*1000/$F_haft; # Schnittpunkt von F_haft mit plot_data_hyp - vx in m/s\r\n\t$tx=($vx-$v0)*($mw+$mw_zu)/$F_haft;\t\t\t\t# 0-100km/h\r\n\tif ($tx > $t100) { ### Fall 2 ### \r\n\t\t$error= \"ERROR: Traction not enough for \".$v0*3.6.\"-\".$v100*3.6.\"km/h in $t100\".\"s! Even with drag NOT taken into account.Increase traction by coeff. or axleload, minimize weight or change to AWD.\"; \r\n\t return $error;\r\n\t} else {\t### Fall 3 ### \r\n\t if ($v0 == 0) {$Pmin=ceil($Pmin*$tx/$t100);} # Anpassen von Pmin anhand von Verhaeltnis t100 zu tx, nicht bei 80-120km/h\r\n\t $n=1; $switch=false; $a=$Pmin/20; $b=$Pmin/100; $c=0.5; $d=0.01; # Genauigkeit d # Anfangswerte fuer while-Schleife - $Pmin in kW\r\n\t\twhile (abs($t100-$tx)>$d) {\r\n\t\t\t# Veraenderlicher Teil $Pmin \r\n\t\t\t# -->\r\n\t\t\tif ($t100 > $tx and $switch==false) { # $switch als check zum Schleifen sparen\r\n\t\t\t \t$Pmin=$Pmin-$a; \r\n\t\t\t} elseif ($t100 > $tx and $switch==true) {\r\n\t\t\t \t$Pmin=$Pmin-$c; \r\n\t\t\t} else {$Pmin=$Pmin+$b; $switch=true;}\t\r\n\t\t\t# <-- ENDE Veraenderlicher Teil\t\r\n\t\t\t# Erzeugen des Arrays fuer function getacctimebyforce () // tbd kuerzer mit $plot_data_hyp, weil Abschneiden aller Werte groeßer als F_haft in der Funktion\r\n\t\t\t# -->\t\r\n\t\t\t$plot_data_max = array(); //empty previous array first\r\n\t\t\t$vx=$Pmin*1000/$F_haft; # Schnittpunkt von F_haft mit plot_data_hyp - vx in m/s\r\n\t\t\tfor ($v = 0; $v <= 300 && $v < $vx*3.6; $v += 10) { # $v in km/h\r\n\t\t\t $plot_data_max[] = array('',$v,$F_haft);\r\n\t\t\t}\r\n\t\t\tif ($vx*3.6!=ceil($vx*3.6/10)*10) {\r\n\t\t\t\t$plot_data_max[] = array('',$vx*3.6,$F_haft); # Einfuegen des Schnittpunkts \r\n\t\t\t\t}\r\n\t\t\tfor ($v = ceil($vx*3.6/10)*10; $v <= 300; $v += 10) { # $v in km/h\r\n\t\t\t\t$Fmax=round($Pmin*1000/($v/3.6),1); # $v in m/s\r\n\t\t\t $plot_data_max[] = array('',$v,$Fmax);\r\n\t\t\t}\r\n\t\t\t# <-- ENDE Erzeugen des Arrays\r\n\t if ($v0 != 0) { // tbd static if? or switch-case? for not calling if in every loop\r\n\t\t\t $tx= round(getacctimebyforce($plot_data_max,$v100)-getacctimebyforce($plot_data_max,$v0),3); \r\n\t\t\t} else {\r\n\t\t\t \t$tx= round(getacctimebyforce($plot_data_max,$v100),3);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// echo \"$n: $t100, $tx , $vx , $Pmin <br>\";\t// for checking while loop\t\r\n\t\t\t\r\n\t\t\t//////////////// Troubleshooting: --> ////////////////\r\n\t\t\tif ($Pmin >= ($F_haft*$v100/1000)+1) { # falls Traktion inkl. Fahrtwiderstaende nicht ausreicht\r\n\t\t\t\t$error= \"ERROR: Traction not enough for \".$v0*3.6.\"-\".$v100*3.6.\"km/h in $t100\".\"s! Drag taken into account. Increase traction by coeff. or axleload, minimize weight or change to AWD.\";\r\n\t\t\t \treturn $error;\r\n\t\t\t}\t\r\n\t\t\t$n++; // for counting while loops \t\t\t\r\n\t\t\tif ($n > 40) { $c=0.1;};\r\n\t\t\tif ($n > 80) { $d=0.05;};\r\n\t\t\tif ($n > 200) { //tbd 3.8 @ average throws this ERROR\r\n\t\t\t\t$error= \"ERROR: Minimum Power required \".$v0*3.6.\"-\".$v100*3.6.\"km/h in $t100\".\"s could not be calculated. Please contact EV Wizard via email: $evmail.\"; \r\n\t\t\t return $error;} \r\n\t\t\t//////////////// <-- Troubleshooting ////////////////\r\n\t\t}; // <-- END while\r\n\t\tif (isset($Pmin) && is_float($Pmin)) { \r\n\t\t\t$Pmin100=ceil($Pmin);\r\n\t\t\treturn $Pmin100;\r\n\t\t} else {\r\n\t\t\t $error= \"ERROR: Have you just found a bug??? O_o Please tell us about it via email: $evmail.\"; \r\n\t\t\t return $error;\r\n\t\t}\t\t \t\r\n};}", "protected function _fixX($x) {}", "public function hapus_toko(){\n\t}", "function wtssaisieforfaits($ar){\n $p = new XParam($ar, array());\n $offre = $p->get('offre');\n // lecture des informations à partir des produits (oid=>nb) \n // par exemple si appel offre de meilleur prix\n if ($p->is_set('products')){\n $products = $p->get('products');\n $wtsvalidfrom = $p->get('validfrom');\n $perror = false;\n $wtspools = array();\n $wtspersons = array();\n $wtstickets = array();\n foreach($products as $poid=>$pnb){\n\t$rsp = selectQuery('select wtspool, wtsperson, wtsticket from '.self::$tableCATALOG.' where PUBLISH=1 and LANG=\"FR\" and KOID=\"'.$poid.'\"');\n\tif($rsp->rowCount() != 1){\n\t XLogs::critical(get_class($this). '::wtssaisieforfaits erreur appel via produits produit : '.$poid);\n\t $perror = true;\n\t}\n\t$orsp = $rsp->fetch();\n\t$wtspools[] = $orsp['wtspool'];\n\t$wtstickets[] = $orsp['wtsticket'];\n\t$wtspersons[$orsp['wtsperson']] = $pnb;\n }\n $rsp->closeCursor();\n unset($orsp);\n unset($products);\n unset($poid);\n unset($pnb);\n $wtspool = array_unique($wtspools);\n $wtsticket = array_unique($wtstickets);\n if (count($wtspool) != 1 || count($wtsticket) != 1){\n\t XLogs::critical(get_class($this). '::wtssaisieforfaits erreur appel via produits plusieurs pools, plusieurs tickets '.implode($wtspools).' '.implode($wtstickets));\n\t $perror = true;\n }\n $wtspool = $wtspools[0];\n $wtsticket = $wtstickets[0];\n $wtsperson = $wtspersons;\n unset($wtspools);\n unset($wtstickets);\n unset($wtspersons);\n if ($perror){\n\tXLogs::critical(get_class($this). '::wtssaisieforfaits erreur appel via produits');\n\tXShell::setNext($GLOBALS['HOME_ROOT_URL']);\n\treturn;\n }\n } else {\n $wtspool = $p->get('wtspool');\n $wtsperson = $p->get('wtspersonnumber');\n $wtsticket = $p->get('wtsticket');\n $wtsvalidfrom = $p->get('wtsvalidfrom');\n }\n $personpackid = uniqid('ppid_');\n $tpl = 'wts';\n // l'offre doit être valide\n if (!$this->modcatalog->validOffer($offre)){\n XLogs::critical(get_class($this). '::wtssaisieforfaits acces offre offline ');\n XShell::setNext($GLOBALS['HOME_ROOT_URL']);\n return;\n }\n if ($p->is_set('wtspersonnumbermo')){\n unset($_REQUEST['wtspersonnumber']);\n $_REQUEST['wtspersonnumber'] = $wtsperson = array($p->get('wtspersonnumbermo')=>1);\n }\n $lines = array();\n // saison\n $season = $this->getSeason();\n // lecture de l'offre en cours\n $doffre = $this->modcatalog->displayOffre(array('_options'=>array('local'=>true),\n\t\t\t\t\t\t 'tplentry'=>$tpl.'_offre',\n\t\t\t\t\t\t 'offre'=>$offre,\n\t\t\t\t\t\t 'caddie'=>true\n\t\t\t\t\t\t )\n\t\t\t\t\t );\n // correction saison dans le cas des offres flashs\n if ($doffre['doffre']['oflash']->raw == 1){\n $season['odatedeb'] = $season['odatedebflash'];\n $season['odelaitrans'] = $season['odelaitransflash'];\n $season['odelaifab'] = $season['odelaifabflash'];\n }\n // premier jour de ski pour controle des dispo cartes\n $firstdaynewcard = $this->getFirstDayNewCard($season);\n\n // lecture des produits (pour ensuite avoir le prix)\n foreach($wtsperson as $personoid=>$personnb){\n if (empty($personnb) || $personnb<1)\n continue;\n $dp = $this->modcatalog->displayProduct($offre, $wtspool, $wtsticket, $personoid);\n if ($dp == NULL)\n continue;\n $dpc = $this->modcatalog->getPrdConf($dp);\n// jcp, bloquant, c'est sur le module => xmodeplspecialoffer::getSpecialOffer\n// $dpsp = $this->dsspoffer->getSpecialOffer($dp);\n\n // ajout des assurances ...\n $assur = $this->modcatalog->getProductAssurance($dp, $dpc);\n\n // ajout des prix de cartes si achat possible a cette date pour ce produit\n $newcard = $this->modcatalog->getNewCard($dp, $dpc, $wtsvalidfrom);\n $availablesNewCards = $this->modcatalog->getAvailablesNewCards($dp, $dpc, $wtsvalidfrom, $firstdaynewcard);\n // recherche des prix fidelite (complements sur le bloc forfait)\n $loyaltymess = $loyaltyprice = $loyaltyProductOid = NULL;\n if ($this->modcustomer->loyaltyActive()){\n list($loyaltymess, $loyaltyprice, $loyaltyProductOid) = $this->modcustomer->preCheckLoyaltyReplacementProduct(array('season'=>$season, 'doffre'=>$doffre['doffre'], 'dp'=>$dp, 'dpc'=>$dpc, 'validfrom'=>$wtsvalidfrom, 'availablesNewCards'=>$availablesNewCards));\n }\n // creation des lignes pour chaque personne\n for($i = 0; $i<$personnb; $i++){\n $lines[] = array('assur'=>$assur,\n 'personpackid'=>$personpackid,\n 'productconf'=>$dpc,\n 'validfrom'=>$wtsvalidfrom,\n 'product'=>$dp,\n 'newcard'=>$newcard, /* a virer */\n 'availablesnewcards'=>$availablesNewCards,\n 'id'=>'line_'.str_replace(':', '', $dp['oid']).sprintf('_%04d', $i),\n 'label'=>$dp['owtsperson']->link['olabel']->raw.' '.($i+1),\n 'amin'=>$dp['owtsperson']->link['oamin']->raw,\n 'amax'=>$dp['owtsperson']->link['oamax']->raw,\n\t\t\t 'personoid'=>$dp['owtsperson']->raw,\n 'saisieident'=>$dp['owtsperson']->link['osaisieident']->raw,\n 'saisiedob'=>$dp['owtsperson']->link['osaisiedob']->raw,\n 'loyaltyproductoid'=>($loyaltyProductOid == NULL)?false:$loyaltyProductOid,\n 'loyaltyprice'=>($loyaltyProductOid == NULL)?false:$loyaltyprice,\n 'loyaltymess'=>($loyaltyProductOid != NULL && $loyaltymess != 'found')?$loyaltymess:false);\n }\n }\n \n // lecture des prix par validfrom/produit\n // calcul validtill\n // disponbilité des cartes / validfrom : forfaits déja présent, delais (cas des nouvelles cartes)\n $caddie = $this->getCaddie();\n $carddispo = $caddie['cards'];\n foreach($lines as $il=>&$line){\n $t = $this->modcatalog->getProductTariff($line['product'], $wtsvalidfrom);\n $line['validtill'] = $this->getValidtill($line['validfrom'], $line['product'], $line['productconf']);\n if ($t['tariff'] != 'NOT FOUND'){\n $line['price'] = $t['tariff'];\n } else {\n $line['price'] = 'NOT FOUND';\n }\n foreach($caddie['lines'] as $lineid=>$pline){\n // exclusions par date de forfaits\n if ($pline['type'] == 'forfait'){\n if (($pline['validfrom']<=$line['validtill'] && $line['validtill']<=$pline['validtill']) || \n\t ($pline['validfrom'] <= $line['validfrom'] && $line['validfrom'] <= $pline['validtill']))\n $carddispo[$pline['cardid']] = false;\n }\n // exclusion par nombre (? a paramétrer ?)\n if (count($caddie['bycards'][$pline['cardid']]['cardlines'])>=3){\n $carddispo[$pline['cardid']] = false;\n }\n // exclusion par type de carte \n }\n /* -- vente de cartes seules -- */\n /* et de toute façon */\n foreach($caddie['bycards'] as $cardid=>$carditems){\n if ($carditems['newcard'] !== false && $line['validfrom']<=$firstdaynewcard)\n $carddispo[$cardid] = false;\n }\n $line['cardsdispo'] = $carddispo;\n }\n unset($line);\n // calcul du meilleur prix (si l'offre ne l'interdit pas)\n if ($doffre['doffre']['obetterprice'] && $doffre['doffre']['obetterprice']->raw == 1){\n $rbo = $this->ctrlChoix($ar);\n if ($r->ok == 0){\n XShell::toScreen2($tpl, 'betteroffers', $rbo);\n }\n }\n // gestion du compte client : raccourcis\n if (!empty($this->aliasmyaccount)){\n $custcards = $this->modcustomer->dispCustCards();\n if (count($custcards['custcardnos'])>0)\n XShell::toScreen2($tpl, 'custcards', $custcards);\n } \n // totaux car catégories (pour offre pro entre autres)\n $summary = array('lines'=>array(), 'totforfait'=>0, 'needAssur'=>false, 'needDob'=>false, 'needIdent'=>false);\n foreach($lines as $il=>$aline){\n $aproductoid = $aline['product']['oid'];\n if (!isset($summary['lines'][$aproductoid])){\n $summary['lines'][$aproductoid] = array('label'=>$aline['product']['label'], 'nb'=>0, 'price'=>$aline['price'], 'tot'=>0);\n }\n $summary['lines'][$aproductoid]['nb'] += 1;\n $summary['lines'][$aproductoid]['tot'] += $aline['price'];\n $summary['totforfait'] += $aline['price'];\n if (isset($aline['assur']))\n $summary['needAssur'] = true;\n if ($aline['saisieident'] == 1)\n $summary['needIdent'] = true;\n if ($aline['saisiedob'] == 1)\n $summary['needDob'] = true;\n }\n // cas offre saisie modification de skieurs ! offre \"coherente ?\" \n $advanced = array('on'=>false);\n if (isset($doffre['doffre']['oadvancedinput']) && $doffre['doffre']['oadvancedinput']->raw == 1){\n //&& count($caddie['lines']) == 0){ \n $advanced['on'] = true;\n $this->defaultStepTemplates['commande2'] = $this->templatesdir.'choix-produit2.html';\n foreach($lines as $il=>&$line){\n\tforeach($doffre['tickets'] as $ticketoid=>$aticket){\n\t if (in_array($wtspool, $aticket['pools'])){\n\t $odp = $this->modcatalog->displayProduct($offre, $wtspool, $ticketoid, $line['personoid']);\n\t if ($odp != NULL){\n\t $line['advanced']['calendar'] = $this->modcatalog->configureOneCalendar($season, array($opd['oprdconf']), $doffre['doffre']);\n\t if ($line['product']['owtsticket']->raw == $ticketoid){\n\t\t$aticket['selected'] = true;\n\t }\n\t $aticket['productoid'] = $odp['oid'];\n\t $line['advanced']['tickets'][$ticketoid] = $aticket;\n\t }\n\t }\n\t}\n }\n }\n XShell::toScreen2($tpl, 'advanced', $advanced);\n XShell::toScreen2($tpl, 'summary', $summary);\n //\n XShell::toScreen2($tpl, 'lines', $lines);\n // blocage du pave haut\n XShell::toScreen1($tpl.'_offre', $doffre);\n XShell::toScreen2($tpl.'_offre', 'lock', true);\n\n // valeurs choisies\n $choix = array('wtsvalidfrom'=>$wtsvalidfrom,\n 'wtspool'=>$wtspool,\n 'wtspersonnumber'=>$wtsperson,\n 'wtsticket'=>$wtsticket);\n\n XShell::toScreen2($tpl.'_offre', 'current', $choix);\n\n $choix['wtsoffre'] = $offre;\n setSessionVar('wts_offre_current', $choix);\n\n $_REQUEST['insidefile'] = $this->defaultStepTemplates['commande2'];\n $this->setOffreLabels($doffre['doffre']);\n $this->wtscallback();\n\n }", "function xlsBOF() {\n\t\techo pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\n\t\treturn;\n\t\t}", "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 keliling()\n {\n return 2*($this->panjang + $this->lebar);\n }", "public function AggiornaPrezzi(){\n\t}", "final function velcom(){\n }", "function wtsadd2caddie($ar){\n $dps = array();\n $dos = array();\n $persByType = array();\n $switchTo = array();\n $p = new XParam($ar, array());\n $oldcaddie = $this->getCaddie();\n $linesid = $p->get('lineid');\n $formparms = array('personpackid', 'validfrom', 'offreoid', 'productoid',\n 'card', 'CHIPID', 'ACCNO', 'CRC', 'assurance',\n 'NEWCARDLabel', 'joursbonus', 'justphotoidentnom',\n 'justphotoidentprenom', 'justphotoident', 'justphotoidentdob',\n 'justetatciv', 'justdomicile', 'justgrp', 'justgrpname','customercard');\n $lineparms = array('validfrom', 'offreoid', 'productoid');\n foreach($formparms as $parm){\n $$parm = $p->get($parm);\n }\n $season = $this->getSeason();\n $lines = array();\n $cptf = 1;\n foreach($linesid as $lineid){\n $id1 = date('dhis').$cptf.uniqid('_');\n $cptf ++;\n $line = array('type'=>'forfait');\n foreach($lineparms as $parm){\n $v = $$parm;\n if (isset($v[$lineid]))\n $line[$parm]=$v[$lineid];\n else\n $line[$parm]=NULL;\n }\n // passage d'options par prog seulement\n if (isset($ar['linesOptions'][$lineid])){\n $line['options'] = $ar['linesOptions'][$lineid];\n }\n // lecture du produit et des produits associés\n if (!isset($dps[$line['productoid']])){\n\t$dps[$line['productoid']] = $this->productInfos($line['productoid'], $line['validfrom']);\n\t// cause est utilisé directement ...\n\t$dpc = $dps[$line['productoid']]['dpc'];\n }\n // lecture des offre (la meme ... ) pour avoir le flash\n if (!isset($dos[$line['offreoid']])){\n $dos[$line['offreoid']] = $this->modcatalog->displayOffre(array('_options'=>array('local'=>true),\n\t\t\t\t\t\t\t\t\t'tplentry'=>TZR_RETURN_DATA,\n\t\t\t\t\t\t\t\t\t'offre'=>$line['offreoid'],\n\t\t\t\t\t\t\t\t\t'caddie'=>false)); // le stock importe pas ici\n }\n\n // remplacement du produit si existe (fidelite - voir wtssaisieforfaits)\n if ($this->modcustomer->loyaltyActive()){\n\n // carte du forfait (!! mêmes tests que dessous)\n $rpcard2 = substr($card[$lineid], 0, 8);\n if ($rpcard2 == 'NEWCARD_'){\n $rpwtp['cardoid'] = substr($card[$lineid], 8);\n $rpwtp['cardlabel'] = $NEWCARDLabel[$lineid];\n } elseif($card[$lineid] == 'WTPCARD'){\n //$rpnewwtp = strtoupper($CHIPID[$lineid].'-'.$CRC[$lineid].'-'.$ACCNO[$lineid]);\n $rpnewwtp = $this->modresort->formatWTPParts(array($CHIPID[$lineid], $CRC[$lineid], $ACCNO[$lineid]));\n $rpwtp['cardlabel'] = $rpnewwtp;\n $rpwtp['cardoid'] = NULL;\n } elseif(!empty($card[$lineid])){ \n $rpwtp['cardlabel'] = $NEWCARDLabel[$lineid];\n $rpwtp['cardoid'] = NULL;\n $rpcardid = $card[$lineid];\n if (isset($oldcaddie['bycards']) && $oldcaddie['bycards'][$rpcardid]['newcard'] !== false){\n $rplineid = $oldcaddie['bycards'][$rpcardid]['newcard'];\n $rpwtp['cardoid'] = $oldcaddie['lines'][$rplineid]['productoid'];\n }\n }\n\n list($loyaltymess, $loyaltyprice, $loyaltyProductOid) = $this->modcustomer->checkLoyaltyReplacementProduct(array('season'=>$season, 'doffre'=>$dos[$line['offreoid']]['doffre'], 'dp'=>$dps[$line['productoid']], 'dpc'=>$dps[$line['productoid']]['dpc'], 'validfrom'=>$line['validfrom'], 'availablesNewCards'=>$dps[$line['productoid']]['availablesNewCards'],'wtp'=>$rpwtp));\n if ($loyaltyProductOid != NULL){\n XLogs::notice(get_class($this), '::wtsadd2caddie replace product '.$line['productoid'].' -> '.$loyaltyProductOid.' '.$loyaltyprice);\n $ldps = $this->productInfos($loyaltyProductOid , $line['validfrom']);\n // on remplace ... \n \n $line['productoid'] = $loyaltyProductOid;\n $dps[$line['productoid']] = $ldps;\n } else {\n XLogs::notice(get_class($this), '::wtsadd2caddie no replacement product '.$line['productoid']);\n }\n }\n // top des des produtis non dates - date si rechargement\n $line['validfrom_hidden'] = 0;\n if ($dps[$line['productoid']]['dpc']['ocalendar']->link['otype']->raw == 'NO-DATE'){\n list($drech, $dnew, $dliv) = $this->getFirstDayNoDate(date('Y-m-d h:i:s'));\n $line['validfrom_hidden'] = 1;\n if ($card[$lineid] == 'WTPCARD'){\n $line['validfrom'] = $drech;\n $line['calendar-NO-DATE'] = 0;\n } else {\n $line['calendar-NO-DATE'] = 1;\n }\n }\n // ajout d'un top flash et de l'id de la vente\n if ($dos[$line['offreoid']]['doffre']['oflash']->raw == 1){\n $line['isflash'] = true;\n foreach($dos[$line['offreoid']]['doffre']['_flash']['ventes'] as $i=>$vente){\n if (in_array($line['validfrom'], $vente['dates'])){\n $line['flashoid'] = $vente['oid'];\n break;\n }\n }\n } else {\n $line['isflash'] = false;\n }\n // ajout de l'id packpersonne et du type de personne (pour la suppression)\n if (isset($personpackid[$lineid])){\n $line['ispersonpack'] = true;\n $line['personpackid'] = $personpackid[$lineid];\n // replacement type de personne suivant composition pack\n $personType = $dps[$line['productoid']]['owtsperson']->raw;\n $persByType[$personType]++;\n if ($dos[$line['offreoid']]['persons'][$personType]->switchTo && $dos[$line['offreoid']]['persons'][$personType]->switchLimit && $persByType[$personType] == $dos[$line['offreoid']]['persons'][$personType]->switchLimit) {\n $personType = $dos[$line['offreoid']]['persons'][$personType]->switchTo;\n if (!isset($switchTo[$personType])) {\n $switchTo[$personType] = selectQuery(\"select WTSCATALOG.koid from WTSCATALOG join WTSCATALOG c2 using (wtsticket) where WTSCATALOG.wtsperson='$personType' and c2.koid='{$line['productoid']}'\")->fetch(PDO::FETCH_COLUMN);\n // lecture du produit et des produits associés\n if (!isset($dps[$switchTo[$personType]])){\n $dps[$switchTo[$personType]] = $this->productInfos($switchTo[$personType], $line['validfrom']);\n // cause est utilisé directement ...\n $dpc = $dps[$switchTo[$personType]]['dpc'];\n }\n }\n $line['productoid'] = $switchTo[$personType];\n }\n $line['wtsperson'] = $personType;\n } else {\n $line['ispersonpack'] = false;\n $line['personpackid'] = NULL;\n $line['wtsperson'] = NULL;\n }\n // ajout des champs issus du produit etc ...\n $line['validtill'] = $this->getValidtill($line['validfrom'], $dps[$line['productoid']], $dps[$line['productoid']]['dpc']);\n $line['price'] = $dps[$line['productoid']]['price']['tariff'];\n $line['label'] = $dps[$line['productoid']]['label'];\n\n // ajout carte du forfait\n $line['cardid'] = $card[$lineid];\n $line['lineid'] = $lineid;\n\n // traitement des justifs (cartes ce/ coupons ..)\n if (isset($dpc['ojustgrps']) && $dpc['ojustgrps']->raw == 1){\n $line['justifgrps'] = $justgrpname[$lineid].' '.$justgrp[$lineid];\n }\n // traitement des pièces justficaves\n if ($dpc['ojustphotoident']->raw == 1 \n && $dps[$line['productoid']]['owtsticket']->link['oduree']->raw >= $dpc['ojustphotonbjour']->raw){\n $needphotoident = true;\n } else {\n $needphotoident = false;\n }\n if (($justphotoidentnom[$lineid] && $justphotoidentprenom[$lineid])\n\t || $justphotoidentdob[$lineid]\n\t || $dpc['ojustetatciv']->raw == 1\n\t || $dpc['ojustdomicile']->raw == 1\n\t || $needphotoident){\n\t$nom = $justphotoidentnom[$lineid];\n\t$prenom = $justphotoidentprenom[$lineid];\n\t$dob = $justphotoidentdob[$lineid];\n\tif ($this->dsjustifs == NULL)\n\t $this->dsjustifs = XDataSource::objectFactoryHelper8('BCLASS=XDSTable&SPECS='.self::$tableJUSTIFS);\n\t$jar = array('lineid'=>$lineid, 'nom'=>$nom, 'prenom'=>$prenom, 'dob'=>$dob, 'photoident'=>0, 'etatciv'=>0, 'domicile'=>0, 'customercard'=>0);\n\t// utilisation d'une carte client\n\tif (isset($customercard[$lineid])){\n\t $jar['customercard'] = $customercard[$line_id];\n\t if ($needphotoident){\n\t if (!isset($dscustomercards)){\n\t $dscustomercards = XDataSource::objectFactoryHelper8('BCLASS=XDSTable&SPECS='.self::$tableCUSTOMERCARDS);\n\t }\n\t $dcard = $dscustomercards->rdisplay($customercard[$lineid]);\n\t $tmpfile = TZR_TMP_DIR.uniqid('customercard');\n\t copy($dcard['ophoto']->filename, $tmpfile);\n\t $_FILES['justphotoident']['tmp_name'][$lineid] = $tmpfile;\n\t $_FILES['justphotoident']['type'][$lineid] = $dcard['ophoto']->mime;\n\t $_FILES['justphotoident']['name'][$lineid] = $dcard['ophoto']->originalname;\n\t $_FILES['justphotoident']['type'][$lineid] = filesize($tmpfile);\n\t }\n\t}\n\tif ($dpc['ojustetatciv']->raw == 1)\n\t $jar['etatciv'] = 1;\n\tif ($dpc['ojustdomicile']->raw == 1)\n\t $jar['domicile'] = 1;\n\tif ($dpc['ojustphotoident']->raw == 1){\n\t $jar['photoident'] = 1;\n\t}\n\t$justifoid = $this->saveJustif($jar);\n\t$line['justifoid'] = $justifoid;\n }\n // ajout des lignes cartes : NEWCARD = commander; WTPCARD = saisie du WTP; autres : id de cartes deja dans le panier\n // !!! NEWCARD_WTSCATLOG:xxx = ajouter nouvelle carte, NEWCARDuniqid = nouvelle carte du panier - sera rattachée\n // !!! on a la meme chose (ou presque pour le remplacement de produit)\n $card2 = substr($line['cardid'], 0, 8);\n if ($card2 == 'NEWCARD_'){\n $cardid = uniqid('NEWCARD');\n $line['cardid'] = $cardid;\n $cardoid = substr($card[$lineid], 8);\n // trouver le bon prix et intitulé des cartes en commande\n $cardok = 0;\n foreach($dps[$line['productoid']]['availablesNewCards'] as $acarddesc){\n if($cardoid == $acarddesc['oid']){\n $cardok=1;\n break;\n }\n }\n if ($cardok !== 1){ // on doit trouver !!! sauf si on enlève\n XLogs::notice(get_class($this), '::wtsadd2caddie erreur recherche produit carte');\n //die('An error occured'.$cardoid);\n // on cherche le prix directement (DSR : rp + produit public ...)\n $ct = $this->modcatalog->getProductTariff(NULL, $line['validfrom'], $cardoid);\n if ($ct['tariff'] == 'NOT FOUND'){\n XLogs::critical(get_class($this), '::wtsadd2caddie erreur recherche produit carte');\n die('An error occured'.$cardoid);\n } else {\n $acarddesc['price'] = $ct['tariff'];\n }\n }\n $lines[$id1.'_0000'] = array('linesid'=>$lineid, 'type'=>'carte',\n\t\t\t\t 'label'=>$NEWCARDLabel[$lineid], 'cardid'=>$cardid,\n\t\t\t\t 'productoid'=>$cardoid,\n\t\t\t\t 'price'=>$acarddesc['price']);\n //les cartes ne sont pas dans le pack car elle peuvent avoir d'autres forfaits dessus\n $line['cardlabel'] = $NEWCARDLabel[$lineid];\n\t/*saisie WTP */\n } elseif($line['cardid'] == 'WTPCARD'){\n $newwtp = $this->modresort->formatWTPParts(array($CHIPID[$lineid], $CRC[$lineid], $ACCNO[$lineid]));\n // regarder si cette carte n'est pas déjà dans le panier si oui recup de sont cardid\n $cardid = array_search($newwtp, $oldcaddie['cards']);\n if ($cardid === false)\n $cardid = uniqid('WTPCARD');\n $line['cardlabel'] = $newwtp;\n $line['cardid'] = $cardid;\n\t/* autres cas : cartes du panier (WTPCARDuniq ou cartes en commandes NEWCARuniqid)*/\n } elseif(!empty($line['cardid'])){ \n $line['cardlabel'] = $NEWCARDLabel[$lineid];\n $line['cardid'] = $card[$lineid];\n }\n // ajout des lignes assurances\n if (isset($assurance[$lineid])){\n $lines[$id1.'_0020'] = array('lineid'=>$lineid, 'type'=>'assurance',\n\t\t\t\t 'label'=>$dps[$line['productoid']]['assur']['label'],\n\t\t\t\t 'productoid'=>$dps[$line['productoid']]['assur']['oid'],\n\t\t\t\t 'price'=>$dps[$line['productoid']]['assur']['price'], \n\t\t\t\t 'options'=>array());\n if (isset($dps[$line['productoid']]['assur']['options'])){\n $lines[$id1.'_0020']['options'] = $dps[$line['productoid']]['assur']['options'];\n }\n $lines[$id1.'_0020']['ispersonpack'] = $line['ispersonpack'];\n $lines[$id1.'_0020']['personpackid'] = $line['personpackid'];\n }\n // ajout des lignes bonus et calcul du bonus\n if (isset($joursbonus[$lineid]) && $joursbonus[$lineid]>0){\n // calcul du forfait bonus\n list($rline, $bline) = $this->modloyalty->getForfaitBonus($line, $joursbonus[$lineid], $dps[$line['productoid']]);\n if ($bline != NULL && $rline != NULL){\n $bline['jours'] = $joursbonus[$lineid];\n // ev garder ... $line[$id1.'_0009'] = $line\n $bline['ispersonpack'] = $line['ispersonpack'];\n $bline['personpackid'] = $line['personpackid'];\n $line = $rline;\n $lines[$id1.'_0015'] = $bline;\n }\n if ($bline != NULL && $rline == NULL){\n $bline['ispersonpack'] = $line['ispersonpack'];\n $bline['personpackid'] = $line['personpackid'];\n $lines[$id1.'_0010'] = $bline;\n $line = NULL;\n }\n }\n if ($line != NULL){\n $lines[$id1.'_0010'] = $line;\n }\n }\n // ajout des lignes au caddie\n $this->addLines2Caddie($lines);\n }", "function wtsCheckWTP($ar){\n $p = new XParam($ar, array('mode'=>'a', 'b'=>0, 'f'=>1));\n $mode = $p->get('mode');\n $bonus = $p->get('b');\n $fidelite = $p->get('f');\n $chipid = $p->get('chipid');\n $accno = $p->get('accno');\n $crc = $p->get('crc');\n // cas ski data à faire (? non fait !)\n $wtp = strtoupper($chipid.'-'.$crc.'-'.$accno);\n $r = array('ok'=>0, 'bonus'=>array('points'=>0, 'jours'=>0));\n\n $kwtp = $this->modresort->knownEPLWTP(array($chipid, $crc, $accno));\n if ($kwtp['ok'] == 1 && $this->modresort->expiredWTP($wtp)){\n $r['ok'] = 0;\n $r['errormess'] = $GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_wtpexpire');\n }\n // wtp valide : points bonus eventuels - ceux du panier si il y en a\n if ($kwtp['ok'] == 1){\n $r['ok'] = 1;\n if ($bonus == 1 && $kwtp['eplwtpoid'] != NULL){\n $rs = $this->modloyalty->getCardPoints($kwtp['eplwtpoid']);\n $r['bonus']['points'] = $rs['points'];\n $caddie = $this->getCaddie();\n if (isset($caddie['bonusbycards'][$wtp])){\n $jours = $caddie['bonusbycards'][$wtp];\n if ($jours > 0){\n $jpoints = $this->modloyalty->getPointsFromJours($jours);\n $r['bonus']['points'] = $r['bonus']['points'] - $jpoints;\n }\n }\n $r['bonus']['jours'] = $this->modloyalty->getJoursBonus($r['bonus']['points']);\n }\n if ($this->modresort->expiredWTP($wtp)){\n\t$r['ok'] = 0;\n\t$r['errormess'] = $GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_wtpexpire');\n }\n } else {\n // check de la carte 'temoin' pour assurer que c'est pas service indisponible\n if (defined('EPL_TA_CHECKWTPCARD')){\n\tif (!$this->modresort->checkWTP(explode('-', EPL_TA_CHECKWTPCARD))){\n\t $r['errormess'] = $GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_serviceindisponible');\n\t if (empty($r['errormess']))\n\t $r['errormess'] = '[Service indisponible, veuillez réessayer dans quelques instants]';\n\t $r['ok'] = 0;\n\t}\n }\n }\n if ($mode == 'a')\n die(json_encode($r));\n return $r;\n }", "function LANDINGSIDE($pid,$posx,$posz){\n// =69.GIAP=TUSHKA\n// 2011-2014\n// BOSWAR version 1.03\n// May 16, 2014\n\n\tglobal $PLID; // player plane id \n\tglobal $numplayers; // number of players\n\tglobal $Pline; // lines that define players\n\tglobal $COUNTRY; // country ID\n\tglobal $CoalID; // coalition ID\n\tglobal $numiaheaders; // number of influence area headers\n\tglobal $IAHline; // lines defining Influence Area Headers\n\tglobal $numB; // number of boundary definitions\n\tglobal $Bline; // lines defining area boundaries\n\tglobal $AID; // area ID in this context\n\tglobal $BoundaryArray; // array of point pairs defining a boundary\n\n\tif ($numiaheaders < 2 ) { // don't have two sides\n\t\t$side = \"neutral\";\n\t\treturn $side;\n\t}\n\n\t// format location the way the pointLocation class needs\n\t$location = \"$posx $posz\";\n\n\t// get player's country from PLAYERPLANE lines\n\t// loop through PLAYERPLANE lines to get the country.\n\tfor ($i = 0; $i < $numplayers; ++$i) {\n\t\t$j = $Pline[$i];\n\t\tif ( $pid == $PLID[$j] ) {\n\t\t\t$pcountry = $COUNTRY[$j];\n\t\t}\n\t}\n\n\t// get playerplane's coalition\n\tCOALITION($pcountry); \n\t$pcoalition = $CoalID;\n//\techo \"LANDINGSIDE A: pcountry = $pcountry, pcoalition = $pcoalition<br>\\n\";\n\n\t// get influence areas' countries and coalitions \n\t// get country of each area\n\tfor ($i = 0; $i < $numB; ++$i) {\n\t\t$j = $Bline[$i];\n\t\tfor ($k = 0; $k < $numB; ++$k) { // peek at each of the IAHlines\n\t\t\t$l = $IAHline[$k];\n//\t\t\techo \"LANDINGSIDE B0: i = $i, AreaID[$i] = $AID[$j]<br>\\n\";\n//\t\t\techo \"LANDINGSIDE B0.1: IAHeader AreaID[$i] = $AID[$l]<br>\\n\";\n\t\t\tif ($AID[$j] == $AID[$l]) {\n//\t\t\t\techo \"LANDINGSIDE B0.2: $AID[$j] = $AID[$l]<br>\\n\";\n//\t\t\t\techo \"LANDINGSIDE B0.3: k=$k, l=$l, COUNTRY[l]=$COUNTRY[$l]<br>\\n\";\n\t\t\t\tif (isset($COUNTRY[$l])) {\n\t\t\t\t\t@$acountry[$k] == $COUNTRY[$l]; // @ suppresses notices\n\t\t\t\t\tCOALITION($COUNTRY[$l]); \n\t\t\t\t\t$acoalition[$k] = $CoalID;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n//\t\techo \"LANDINGSIDE B1: i = $i, AreaID[$i] = $AID[$j]<br>\\n\";\n//\t\techo \"LANDINGSIDE B2: areacountry[$i] = $acluntry[$i], acoalition[$i] = $acoalition[$i]<br>\\n\";\n\t}\n\n\t// New logic\n\t// loop through defined boundaries using the $numB index\n\n\tfor ($i = 0; $i < $numB; ++$i) {\n\t\t// define the current polygon\n\t\t$polygon = $BoundaryArray[$i];\n\n\t\t// Now test whether landed inside this polygon\n// in situ test: \"20 20\" is \"inside\" this polygon\n//$polygon = array(\"10 0\", \"0 10\", \"0 20\", \"10 30\", \"20 30\", \"30 20\", \"30 10\", \"20 0\", \"10 0\");\n//$location = \"20 20\";\n\t\t$pointLocation = new pointLocation();\n//\t\techo \"($location) is \" . $pointLocation->pointInPolygon($location, $polygon) . \"<br>\";\n\t\t$place = $pointLocation->pointInPolygon($location, $polygon);\n\n\t\t// interpret result\n\t\tif ($place == \"inside\") {\n//\t\t\techo \"i = $i ,LANDINGSIDE reports inside.<br>\\n\";\n\t\t\tif ($pcoalition == @$acoalition[$i]) { // @ suppresses notices\n\t\t\t\t$side = \"friendly\"; \n\t\t\t\t$i = $numB; // we are done\n\t\t\t\t$k = $numB; // we are done\n\t\t\t} else {\n\t\t\t\t$side = \"enemy\"; \n\t\t\t\t$i = $numB; // we are done\n\t\t\t\t$k = $numB; // we are done\n\t\t\t}\n\t\t} else { // if not in either area, must be neutral\n\t\t\t$side = \"neutral\"; // but keep checking until done\n\t\t}\n\t}\n//\techo \"LANDINGSIDE reports $side<br>\\n\";\n\treturn $side;\n}", "public function extra_voor_verp()\n\t{\n\t}", "private function CsomagHozzaadasa()\r\n {\r\n foreach (Lap::Nevkeszlet() as $nev)\r\n {\r\n foreach (Lap::Szinkeszlet() as $szin)\r\n {\r\n $this->lapok[]=new Lap($szin,$nev);\r\n }\r\n }\r\n }", "public static function Parse837()\n\t{\n\n\t}", "public function emitirSom()\n {\n }", "public function calcula13o()\n {\n }", "public function calcula13o()\n {\n }", "abstract protected function faireDuSport();", "function xVoisinDroite($x, $y, $largeurPlateau, $hauteurPlateau, $tab_plateau) {\r\n //error_log(var_export(\"xVoisinDroite(\".$x.\", \".$y.\", \".$largeurPlateau.\", \".$hauteurPlateau.\")\", true));\r\n //error_log(var_export($tab_plateau, true));\r\n $xRetour = -1;\r\n $i = $x + 1;\r\n while (($i < $largeurPlateau) && ($xRetour == -1)) {\r\n //error_log(var_export(\"i: \".$i.\", y: \".$y.\" => \".$tab_plateau[$y][$i], true));\r\n if ($tab_plateau[$y][$i] == \"0\") {\r\n $xRetour = $i;\r\n }\r\n $i++;\r\n }\r\n \r\n return $xRetour;\r\n}", "public static function Parse835()\n\t{\n\n\t}", "function wtsCtrlSaisieForfaits($ar){\n\n $p = new XParam($ar, array('mode'=>'a'));\n $mode = $p->get('mode');\n $r = array('ok'=>1, 'errors'=>array(), 'message'=>'');\n $cards = $p->get('card');\n $chips = $p->get('CHIPID');\n $accs = $p->get('ACCNO');\n $crcs = $p->get('CRC');\n $cardlabels = $p->get('NEWCARDLabel');\n $usedcards = array();\n // lecture de l'offre\n $offresoid = $p->get('offreoid');\n $productsoid = $p->get('productoid');\n $validfroms = $p->get('validfrom');\n $validtills = $p->get('validtill');\n \n $justgrps = $p->get('justgrp');\n\n // parcours des lignes et controles\n foreach($cards as $lineid => $card){\n $card2 = substr($card, 0, 7);\n /*\n\t$card = \n\tNEWCARD_'oidproduit' = achat nouvelle carte\n\tNEWCARD'uniqid' = carte en commande issue du panier\n\tWTPCARD strictement = saisie du numéro ou copie choix depuis les cartes du compte\n\tWTPCARD'unidiq'= carte saisie sélectionnée dans le panier\n\tdonc si substr(card, 0, 7) == NEWCARD : controles sur cartes en achat \n si substr(card, 0, 7) == WTPCARD : controles sur cartes en rechargement\n */\n if ($card2 == 'WTPCARD'){\n //$wtp = sprintf(\"%s-%s-%s\", $chips[$lineid], $crcs[$lineid], $accs[$lineid]);\n $wtp = $this->modresort->formatWTPParts(array($chips[$lineid], $crcs[$lineid], $accs[$lineid]));\n // TA, SKD 01- ou 1- le reste est fait dans le module\n if (strlen($wtp) != 16 && strlen($wtp) != 25 && strlen($wtp) != 24){\n $r['ok'] = 0;\n $r['message'] = $GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_remplirwtp');\n break;\n } else if (!isset($usedcards[$wtp])){\n $usedcards[$wtp] = 1;\n // verification du WTP\n $r2 = $this->wtsCheckWTP(array('mode'=>'r', 'b'=>0, 'chipid'=>$chips[$lineid], 'accno'=>$accs[$lineid], 'crc'=>$crcs[$lineid]));\n if ($r2['ok'] != 1){\n $r['ok'] = 0; \n\t if (isset($r2['errormess'])){\n\t $r['message'] = $r2['errormess'];\n\t } else {\n\t $r['message'] = $GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_wtpinvalide');\n\t }\n\t array_push($r['errors'], \n\t\t array(\"CHIPDID[$lineid]\", '', $lineid), \n\t\t array(\"ACCNO[$lineid]\", '', $lineid), \n\t\t array(\"CRC[$lineid]\", '', $lineid),\n\t\t array(\"WTPMASK[$lineid]\", '', $lineid)\n\t\t );\n }\n // autres controles :\n $productoid = $productsoid[$lineid];\n $offreoid = $productsoid[$lineid];\n $validfrom = $validfroms[$lineid];\n $validtill = $validtills[$lineid];\n $justgrp = $justgrps[$lineid];\n if ($r['ok'] == 1){\n $r3 = $this->localWTPCheck($wtp, $offreoid, $productoid, $justgrp, false, $validfrom, $validtill, $lineid);\n if ($r3['ok'] != 1){\n $r['ok'] = 0;\n $r['message'] = $r3['message'];\n }\n }\n if (($r['ok'] == 1 || $r['ok'] == 0 && $r['iswarn'])){\n $r41 = $this->checkProductInCaddie($wtp, $offreoid, $productoid, $validfrom, $validtill);\n if ($r41['ok'] != 1){\n $r['ok'] = 0;\n $r['iswarn'] = $r41['iswarn'];\n if ($r['iswarn']){\n if ($r['message'] == '')\n $r['message'] = $r41['message'];\n else\n $r['message'] .= \"\\n\".$r41['message'];\n } else {\n $r['message'] = $r41['message'];\n }\n }\n }\n if (($r['ok'] == 1 || $r['ok'] == 0 && $r['iswarn'])){\n\t $r4 = $this->checkProductInOrder($wtp, $offreoid, $productoid, $validfrom, $validtill);\n if ($r4['ok'] != 1){\n $r['ok'] = 0;\n $r['iswarn'] = $r4['iswarn'];\n if ($r['iswarn']){\n if ($r['message'] == '')\n $r['message'] = $r4['message'];\n else\n $r['message'] .= \"\\n\".$r4['message'];\n } else {\n $r['message'] = $r4['message'];\n }\n }\n }\n // verifier que la carte n'est pas déjà dans le panier\n // si oui que ces forfaits sont compatibles ... avec le validfrom\n }else{\n $r['ok'] = 0;\n $r['message'] = $GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_cartesuniques');\n break;\n }\n } else if ($card2 == 'NEWCARD'){\n $wtp = $cardlabels[$lineid];\n $justgrp = $justgrps[$lineid];\n $productoid = $productsoid[$lineid];\n $validfrom = $validfroms[$lineid];\n $validtill = $validtills[$lineid];\n $r31 = $this->localWTPCheck($wtp, $offreoid, $productoid, $justgrp, true, $validfrom, $validtill, $lineid);\n if ($r31['ok'] != 1){\n $r['ok'] = 0;\n $r['message'] = $r31['message'];\n break;\n }\n if (!isset($usedcards[$wtp])){\n $usedcards[$wtp] = 1;\n }else{\n $r['ok'] = 0;\n $r['message'] = $GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_cartesuniques');\n break;\n }\n }\n }\n // sleep(10);\n\n // si ok vérification des dates (on prend le premier produit, tous devant avoir les même caractériqiques)\n if ($r['ok'] == 1){\n $this->checkDelais($r, $productsoid, $validfroms);\n }\n\n // if ($r['ok'] == 1){\n // $r['ok'] = 0; $r['message']='tests '.$r['message'];\n // $r['iswarn'] = 1;\n // }\n\n\n // TESTS PENDNT AJOUT PANIER\n // $r = array('ok'=>1,'iswarn'=>1, 'errors'=>array('kk'), 'message'=>'PAS DE CONTROLES');\n\n\n if (count($r['errors'])>0)\n $r['ok'] = 0;\n if ($mode == 'a'){\n header('Content-Type:application/json; charset=UTF-8');\n die(json_encode($r));\n }\n return $r;\n }", "public function getX(){ return $this->_x; }", "public function getAnchoPaneles()\r\n\t{\r\n\t\t$getPisosAletaVen = $this->getPisosAletaVen();\r\n\t\t$getPisosAletaAdicional7 = $this->getPisosAletaAdicional7();\r\n\t\t$getPisosAletaFlu = $this->getPisosAletaFlu();\r\n\t\t$getCantidadChapaIntermedia = $this->getCantidadChapaIntermedia();\r\n\t\t$getCantidadChapaPiso = $this->getCantidadChapaPiso();\r\n\t\t$getCantidadChapaAdicional = $this->getCantidadChapaAdicional();\r\n\t\t\r\n\t\t\t\t$anchoP1 = $getPisosAletaVen['pisosAletaVenP1'] * $this->getEspesorAletaVen() + $getPisosAletaAdicional7['pisosP1Aleta7'] * $this->espesorAire7Flu + \r\n\t\t\t\t$getPisosAletaFlu['pisosP1AletaFlu'] * $this->getEspesorAletaFlu() + $getCantidadChapaIntermedia['cantidadP1ChapaIntermedia'] * $this->getEspesorChapaIntermedia() +\r\n\t\t\t\t$getCantidadChapaPiso['cantP1Piso'] * $this->getEspesorChapaPiso() + $getCantidadChapaAdicional['cantP1PisoAd'] * $this->getEspesorChapaAdicional();\r\n\t\t\t\t\r\n\t\t\t\t$anchoP2 = $getPisosAletaVen['pisosAletaVenP2'] * $this->getEspesorAletaVen() + $getPisosAletaAdicional7['pisosP2Aleta7'] * $this->espesorAire7Flu + \r\n\t\t\t\t$getPisosAletaFlu['pisosP2AletaFlu'] * $this->getEspesorAletaFlu() + $getCantidadChapaIntermedia['cantidadP2ChapaIntermedia'] * $this->getEspesorChapaIntermedia() +\r\n\t\t\t\t$getCantidadChapaPiso['cantP2Piso'] * $this->getEspesorChapaPiso() + $getCantidadChapaAdicional['cantP2PisoAd'] * $this->getEspesorChapaAdicional();\r\n\t\t\t\t\r\n\t\t\t\t$anchoP3 = $getPisosAletaVen['pisosAletaVenP3'] * $this->getEspesorAletaVen() + $getPisosAletaAdicional7['pisosP3Aleta7'] * $this->espesorAire7Flu + \r\n\t\t\t\t$getPisosAletaFlu['pisosP3AletaFlu'] * $this->getEspesorAletaFlu() + $getCantidadChapaIntermedia['cantidadP3ChapaIntermedia'] * $this->getEspesorChapaIntermedia() +\r\n\t\t\t\t$getCantidadChapaPiso['cantP3Piso'] * $this->getEspesorChapaPiso() + $getCantidadChapaAdicional['cantP3PisoAd'] * $this->getEspesorChapaAdicional();\r\n\t\t\t\t\r\n\t\t\t\t$anchoP4 = $getPisosAletaVen['pisosAletaVenP4'] * $this->getEspesorAletaVen() + $getPisosAletaAdicional7['pisosP4Aleta7'] * $this->espesorAire7Flu + \r\n\t\t\t\t$getPisosAletaFlu['pisosP4AletaFlu'] * $this->getEspesorAletaFlu() + $getCantidadChapaIntermedia['cantidadP4ChapaIntermedia'] * $this->getEspesorChapaIntermedia() +\r\n\t\t\t\t$getCantidadChapaPiso['cantP4Piso'] * $this->getEspesorChapaPiso() + $getCantidadChapaAdicional['cantP4PisoAd'] * $this->getEspesorChapaAdicional();\r\n\t\t\t\t\n\t\t\t\t$res = array(\r\n\t\t\t\t\t'anchoTotal' => $anchoP1 + $anchoP2 + $anchoP3 + $anchoP4,\r\n\t\t\t\t\t'anchoP1' => $anchoP1,\r\n\t\t\t\t\t'anchoP2' => $anchoP2,\r\n\t\t\t\t\t'anchoP3' => $anchoP3,\r\n\t\t\t\t\t'anchoP4' => $anchoP4,\r\n\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\treturn $res;\t\t\r\n\t}", "function fu_eps(&$states, &$rules, &$f_states) // funkce pro odstraneni eps prechodu\n{\n\t$n_f_states = array(); // nove koncove stavy\n\t$n_rules = array(); // nove pravidla\n\t\n\t// vytvoreni epsilon uzaveru podle algoritmu z IFJ (8/36)\n\t\n\tforeach($states as $c_state) // vytvarim uzaver pro kazdy stav jednotlive\n\t{\n\t\t$eps_closure = array($c_state); //promenna pro stavy v uzaveru\n\t\t\n\t\tdo\n\t\t{\n\t\t\t$prev_eps_closure = $eps_closure;\n\t\t\t\n\t\t\tforeach($prev_eps_closure as $eps_state) // projizdim kazdy stav z uzaveru\n\t\t\t{\n\t\t\t\tforeach($rules as $c_rule)\n\t\t\t\t{\n\t\t\t\t\tif($c_rule->symbol == \"eps\" && $eps_state == $c_rule->from) // pokud narazim na epsilon prechod\n\t\t\t\t\t{\n\t\t\t\t\t\t$in = false;\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach($prev_eps_closure as $c_eps_state) //kontrola zda jiz neni obsazen\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($c_eps_state == $c_rule->to)\n\t\t\t\t\t\t\t\t$in = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!$in) // pokud neni pridam jej do uzaveru\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarray_push($eps_closure, $c_rule->to);\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}while($prev_eps_closure != $eps_closure);\n\t\t\n\t\t// odstraneni epsilon prechodu podle algoritmu z IFJ (10/36)\n\t\t\n\t\tforeach($eps_closure as $c_eps_closure_state) // pro kazdy stav z uzaveru\n\t\t{\n\t\t\tforeach($rules as $c_rule) // projdu vsechna pravidla\n\t\t\t{\n\t\t\t\tif($c_eps_closure_state == $c_rule->from && $c_rule->symbol != \"eps\") // pokud se shoduje vychozi stav a zaroven se nejedna o epsilon prechod\n\t\t\t\t{\n\t\t\t\t\t//vytvorim nove pravidlo\n\t\t\t\t\t$n_rule = new rule();\n\t\t\t\t\t$n_rule->from = $c_state;\n\t\t\t\t\t$n_rule->symbol = $c_rule->symbol;\n\t\t\t\t\t$n_rule->to = $c_rule->to;\n\t\t\t\t\t\n\t\t\t\t\tadd_rule($n_rules,$n_rule); // pridam nove pravidlo\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tforeach($f_states as $c_f_state) // pridani novych konecnych stavu\n\t\t\t{\n\t\t\t\tif($c_eps_closure_state == $c_f_state)\n\t\t\t\t{\n\t\t\t\t\t\tadd_state($n_f_states,$c_f_state);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\t$rules = $n_rules; // nahradim stare stavy novymi\n\t$f_states = $n_f_states; // nahradim stare stavy novymi\n}", "function xlsBOF() {\r\n return pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \r\n \r\n}", "function e4fn( $x ) {\r\n #$con;\r\n #$com;\r\n $con = 1.0 + $x;\r\n $com = 1.0 - $x;\r\n return (sqrt( (pow( $con, $con )) * (pow( $com, $com )) ));\r\n}", "function hieu($p_tuso, $p_mauso)\n {\n $ps = new PHAN_SO();\n $ps->khoitao_ps($p_tuso, $p_mauso);\n $ps->tuso = ($this->tuso*$ps->mauso) - ($ps->tuso*$this->mauso);\n $ps->mauso = $this->mauso*$ps->mauso;\n // $ps->toigian_ps();\n return $ps;\n }", "public function ex4()\n {\n }", "function xlsBOF() {\r\n\techo pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\n\treturn;\r\n}", "function simpson1($x0,$xf){\n\t\t$i=0;\n\t\t$hh=0; $S=0; $xi=0;\n\t\tif (nsteps % 2 == 0 ){\n\t\t\t$hh=($xf-$x0)/nsteps;\n\t\t\t$S=integrand1($x0) + integrand1($xf);\n\t\t\t$i=1;\t\n\t\t\twhile ($i <= (nsteps-1)){\n\t\t\t\t$xi=$x0+$hh*$i;\n\t\t\t\tif($i%2 == 0){\n\t\t\t\t\t$S=$S+2*integrand1($xi);\n\t\t\t\t}else{\n\t\t\t\t\t$S=$S+4*integrand1($xi);\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\treturn $hh/3*$S;\n\t\t}\t\n\t}", "public function Emprunter()\n {\n // section -64--88-56-1-313d700b:16f04d7fd4a:-8000:00000000000009BA begin\n // section -64--88-56-1-313d700b:16f04d7fd4a:-8000:00000000000009BA end\n }", "function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}", "function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}", "function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}", "function toigian_ps()\n {\n $uscln = $this->USCLN($this->tuso, $this->mauso);\n $this->tuso = $this->tuso/$uscln;\n $this->mauso = $this->mauso/$uscln;\n }", "function yy_r74(){ $this->_retvalue = 'OUTER'; }", "function sigerrval($origerr,$numplaces){\n\n\t\t$x=round(2*$origerr*(pow(10,(($numplaces-1)-floor(log10(2*$origerr)))))) * pow(10,(floor(log10(2*$origerr)))-($numplaces-1));\n\t\t\n\t\treturn($x);\n\t}", "public function getXmp() {}", "public function getXmp() {}", "public function testBingEle() {\n\t\t$monte_bianco = array(45.832905,6.864688);\n\t\t// Monte Rosa ele 4634\n\t\t$monte_rosa = array(45.93689,7.86676);\n\t\t$points = array(\n\t\t\t$monte_bianco,\n\t\t\t$monte_rosa\n\t\t\t);\n\t\t$ele = WebmappUtils::getBingElevations($points);\n\t\t$this->assertEquals(4821,$ele[0]);\n\t\t$this->assertEquals(4465,$ele[1]);\n\t}", "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 }", "public function getEps_nombre(){\n return $this->eps_nombre;\n }", "public function attaquerAdversaire() {\n\n }", "function xlsBOF() { \necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \nreturn; \n}", "function _stepX()\n {\n return ($this->_maximumX - $this->_minimumX) / $this->_count();\n }", "function fix() ;", "function wtsCheckLine($ar=NULL){\n $p = new XParam($ar, array());\n $lineid = $p->get('lineid');\n $cards = $p->get('card');\n $chips = $p->get('CHIPID');\n $accs = $p->get('ACCNO');\n $crcs = $p->get('CRC');\n $cardlabels = $p->get('NEWCARDLabel');\n // lecture de l'offre\n $offresoid = $p->get('offreoid');\n $productsoid = $p->get('productoid');\n $otherproductsoid = $p->get('otherproducts');\n $validfroms = $p->get('validfrom');\n $validtills = $p->get('validtills');\n\n $linesid = array_keys($offresoid);\n \n $r = array('ok'=>false, 'mess'=>'', 'lineid'=>$lineid, 'unchanged'=>false, 'values'=>array());\n try{\n //if ($otherproductsoid[$lineid] == $productsoid[$lineid]){\n //throw new Exception('unchanged');\n //}\n $dp = $this->modcatalog->displayProduct(NULL, NULL, NULL, NULL, $otherproductsoid[$lineid]);\n if ($dp == NULL){\n\tthrow new Exception('wts_product_nonvendu');\n }\n $dpc = $this->modcatalog->getPrdConf($dp);\n $t = $this->modcatalog->getProductTariff($dp, $validfroms[$lineid]);\n $validtill = $this->getValidtill($validfroms[$lineid], $dp, $dpc);\n\n if ($t['tariff'] == 'NOT FOUND'){\n\tthrow new Exception('wts_product_nonvendu');\n }\n\n // assurance (son prix, son oid)\n $assur = $this->modcatalog->getProductAssurance($dp, $dpc);\n \n // les data pour affichage de la nouvelle ligne\n $r['values']['assur'] = $assur;\n $r['values']['price'] = $t['tariff'];\n $r['values']['validtill'] = $validtill;\n $r['values']['validfrom'] = $validfroms[$lineid];\n $r['values']['productoid'] = $otherproductsoid[$lineid];\n $r['ok'] = true;\n } catch(Exception $e){\n $mess = $e->getMessage();\n if ($mess == 'unchanged'){\n\t$r['ok'] = true;\n\t$r['unchanged'] = true;\n } else {\n\t$labels = new XLabels();\n\t$r['ok'] = false;\n\t$r['mess'] = $labels->get_label(array('variable'=>$mess, 'textonly'=>true));\n }\n }\n\n if ($ar['tplentry'] == TZR_RETURN_DATA){\n return $r;\n }\n\n die(json_encode($r));\n }", "function wtsProPaiement($ar){\n $p = new XParam($ar, array());\n $orderoid = $p->get('orderoid');\n // verification du client de la commande et du compte connecte\n list($okPaiement, $mess) = $this->paiementEnCompte($orderoid);\n if (!$okPaiement){\n XLogs::critical(get_class($this), 'paiement pro refusé '.$orderoid.' '.$mess);\n XShell::setNext($GLOBALS['TZR_SESSION_MANAGER']::complete_self(true, true).'&alias='.$this->aliasvente.'&moid='.$this->_moid.'&function=wtsLireOffres');\n return;\n }\n // traitement post commande std\n clearSessionVar('caddie');\n XLogs::critical(get_class($this), 'enregistrement paiement en compte '.$orderoid);\n // traitement standards après validation\n $this->postOrderActions($orderoid, true);\n\n // traitement post order - devrait être dans postOrderActions\n $this->proPostOrderActions($orderoid);\n\n // retour \n if (defined('EPL_ALIAS_PAIEMENT_ENCOMPTE')){\n XShell::setNext($GLOBALS['TZR_SESSION_MANAGER']::complete_self().'alias='.EPL_ALIAS_PAIEMENT_ENCOMPTE);} else {\n XShell::setNext($GLOBALS['TZR_SESSION_MANAGER']::complete_self(true, true).'&alias='.$this->aliasvente.'&moid='.$this->_moid.'&function=wtsLireOffres');\n }\n }", "function hitungDenda(){\n\n return 0;\n }", "public function traerCualquiera()\n {\n }", "abstract public function getPasiekimai();", "function upgrade_430()\n {\n }", "public function valordelospasajesplus();", "public function partirAuTravail(): void\n\t{\n\t}", "function obtnerUosEpsDetalleAdjudicado(){\n $this->procedimiento='adq.f_cotizacion_ime';\n $this->transaccion='ADQ_OBEPUO_IME';\n $this->tipo_procedimiento='IME';\n \n //Define los parametros para la funcion\n $this->setParametro('id_cotizacion','id_cotizacion','int4');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function sigorigval($origval,$origerr,$numplaces){\n\n\t\t//Math from Noah McLean at MIT\n\n\t\t$x=round($origval*pow(10,(($numplaces-1)-floor(log10(2*$origerr))))) * pow(10,((floor(log10(2*$origerr))))-($numplaces-1));\n\t\n\t\treturn($x);\n\n\t}", "public function getABdata($key) {\n $ans=\"\";\n #$table = \"{$this->getParms->dict}ab\";\n $table = $this->dal_ab->tabname;\n $result = $this->dal_ab->getgeneral($key,$table);\n $dbg=false;\n dbgprint($dbg,\"getABdata: length of result=\" . count($result) . \"\\n\");\n if (count($result) == 1) {\n list($key1,$data) = $result[0];\n if (preg_match('/<disp>(.*?)<\\/disp>/',$data,$matches)) {\n $ans = $matches[1];\n /* This taken from mw code; but is probably obsolete.\n It permitted <s>X</s> coding within the abbreviation expansion\n and conversion to the user's choice of 'filter'\n global $dispfilter;\n $temp = strtolower($dispfilter);\n $filterflag = (preg_match('/deva/',$temp) || preg_match('/roman/',$temp));\n if ($filterflag) {\n\t$ans = preg_replace('/<s>/','<SA>',$ans);\n\t$ans = preg_replace('/<\\/s>/','</SA>',$ans);\n }\n */\n }\n }\n return $ans;\n}", "public function ruta_absoluta()\n {\n throw new Exception( 'Definir.' );\n }", "function hitung_confidence1($supp_xuy, $min_support, $min_confidence, $atribut1, $atribut2, $atribut3, $id_process, $dataTransaksi, $jumlah_transaksi) {\n\n\t\t//hitung nilai support seperti itemset1\n\t\t$jml_itemset1=$this->jumlah_itemset1($dataTransaksi, $atribut1);\n\t\t$nilai_support_x=($jml_itemset1/$jumlah_transaksi) * 100;\n\n\t\t$kombinasi1=$atribut1;\n\t\t$kombinasi2=$atribut2.\" , \".$atribut3;\n\t\t$supp_x=$nilai_support_x; //$row4_['support'];\n\t\t$conf=($supp_xuy/$supp_x)*100;\n\t\t//lolos seleksi min confidence itemset3\n\t\t$lolos=($conf >=$min_confidence)? 1: 0;\n\n\t\t//hitung korelasi lift\n\t\t$jumlah_kemunculanAB=$this->jumlah_itemset3($dataTransaksi, $atribut1, $atribut2, $atribut3);\n\t\t$PAUB=$jumlah_kemunculanAB/$jumlah_transaksi;\n\n\t\t$jumlah_kemunculanA=$this->jumlah_itemset1($dataTransaksi, $atribut1);\n\t\t$jumlah_kemunculanB=$this->jumlah_itemset2($dataTransaksi, $atribut2, $atribut3);\n\n\t\t$nilai_uji_lift=$PAUB / (($jumlah_kemunculanA/$jumlah_transaksi) * ($jumlah_kemunculanB/$jumlah_transaksi));\n\t\t$korelasi_rule=($nilai_uji_lift<1)?\"korelasi negatif\": \"korelasi positif\";\n\n\t\tif($nilai_uji_lift==1) {\n\t\t\t$korelasi_rule=\"tidak ada korelasi\";\n\t\t}\n\n\n\t\t//masukkan ke table confidence\n\t\t$data=array(\"kombinasi1\"=> $kombinasi1,\n\t\t\t\"kombinasi2\"=> $kombinasi2,\n\t\t\t\"support_xUy\"=> $supp_xuy,\n\t\t\t\"support_x\"=> $supp_x,\n\t\t\t\"confidence\"=> $conf,\n\t\t\t\"lolos\"=> $lolos,\n\t\t\t\"min_support\"=> $min_support,\n\t\t\t\"min_confidence\"=> $min_confidence,\n\t\t\t\"nilai_uji_lift\"=> $nilai_uji_lift,\n\t\t\t\"korelasi_rule\"=> $korelasi_rule,\n\t\t\t\"id_process\"=> $id_process,\n\t\t\t\"jumlah_a\"=> $jumlah_kemunculanA,\n\t\t\t\"jumlah_b\"=> $jumlah_kemunculanB,\n\t\t\t\"jumlah_ab\"=> $jumlah_kemunculanAB,\n\t\t\t\"px\"=> ($jumlah_kemunculanA/$jumlah_transaksi),\n\t\t\t\"py\"=> ($jumlah_kemunculanB/$jumlah_transaksi),\n\t\t\t\"pxuy\"=> $PAUB,\n\t\t\t\"from_itemset\"=>3);\n\t\t$this->db->insert('confidence', $data);\n\t}", "public function constructAllUp(){\n $this->freeSeating = true;\n $this->notSquared = false;\n $this->nbRows = 0;\n $this->nbSeatsPerRow = 0;\n $this->rowLabel = 1;\n $this->seatLabel = 1;\n }", "abstract protected function getPhase(): string;", "function xlsBOF() \n{\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\nreturn;\n}", "public function serch()\n {\n }", "public function luas()\n {\n return $this->panjang * $this->lebar;\n }", "function __construct() \n\t{\n\t\t//Modificar aka segun la forma del papel del reporte \n\t\tparent::__construct('P','mm','A4'); \n\t\t//parent::__construct('P','mm','Letter'); \n\t}", "function wtsproadd2caddie($ar){\n $p = new XParam($ar, array());\n $prowtps = $p->get('prowtp');\n $offreoid = $p->get('prooffreoid');\n $validfrom = $p->get('provalidfrom');\n $card = 'WTPCARD'; // un rechargement\n $comParms = array('validfrom', 'offreoid', 'card');\n $shortwtps = array_values($prowtps);\n // lecture des cartes correspondandtes ... pour avoir le vrai numero\n // compte tenu du pro en cour\n $eplPro = getSessionVar('EPL_PRO');\n if (empty($eplPro))\n $groupoid = '';\n else\n $groupoid = $eplPro['progroup'];\n $wtpmap = selectQuery('select shortwtp, wtpcard from '.XModEPassLibre::$tableCARDSGROUP.' where lnkgroup=\"'.$groupoid.'\" and shortwtp in (\"'.implode('\",\"', $shortwtps).'\")')->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE);\n foreach($comParms as $pn){\n $ar[$pn] = array();\n }\n $ar['CHIPID'] = array();\n $ar['ACCNO'] = array();\n $ar['CRC'] = array();\n $ar['lineid'] = array();\n $ar['linesOptions'] = array();\n foreach($prowtps as $lineid=>$prowtp){\n if (empty($prowtp))\n continue;\n if (!isset($wtpmap[$prowtp]))\n continue;\n $ar['linesOptions'][$lineid] = array('shortwtp'=>$prowtp);\n $ar['lineid'][] = $lineid;\n list($ar['CHIPID'][$lineid], $ar['CRC'][$lineid], $ar['ACCNO'][$lineid]) = explode('-', $wtpmap[$prowtp]);\n foreach($comParms as $pn){\n $ar[$pn][$lineid] = $$pn;\n }\n \n }\n $r = $this->wtsadd2caddie($ar);\n return $r;\n }", "function SchedullerPO(){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Cek --> Update PO List, Update Quantity PO Open\n\t\t// echo \"hahah\";\t\t\n\t\trequire_once APPPATH.'third_party/sapclasses/sap.php';\n\t\t$sap = new SAPConnection();\n\t\t$sap->Connect(APPPATH.\"third_party/sapclasses/logon_dataDev.conf\");\n\t\tif ($sap->GetStatus() == SAPRFC_OK ) $sap->Open ();\n\t\tif ($sap->GetStatus() != SAPRFC_OK ) {\n\t\t\techo $sap->PrintStatus();\n\t\t\texit;\n\t\t}\n\n\t\t$fce = &$sap->NewFunction (\"Z_ZCMM_VMI_PO_DETAILC\");\n\t\t\n\t\tif ($fce == false) {\n\t\t\t$sap->PrintStatus();\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$start \t= date(\"20170101\");\t\t\t\t\t// Date start VMI apps\n\t\t$end \t= date(\"Ymd\");\t\t\t\t\t\t// Date Now\n\t\t$opco\t\t\t\t\t= '7000';\n\t\t$fce->COMPANY \t\t\t= \"$opco\";\t\t// BUKRS\n\t\t// $fce->PO_TYPE \t\t= 'ZK17';\n\t\t// $fce->VENDOR \t\t= ;\n\t\t$fce->DATE['SIGN'] \t= 'I';\n\t\t$fce->DATE['OPTION']\t= 'BT';\n\t\t$fce->DATE['LOW'] \t= $start;\n\t\t$fce->DATE['HIGH'] \t= $end;\n\t\t\n\t\t$fce->PO_TYPE->row['SIGN'] \t= 'I';\n\t\t$fce->PO_TYPE->row['OPTION'] \t= 'EQ';\n\t\t$fce->PO_TYPE->row['LOW'] \t= 'ZK10';\n\t\t$fce->PO_TYPE->row['HIGH'] \t= '';\n\t\t$fce->PO_TYPE->Append($fce->PO_TYPE->row);\n\t\t\n\t\t$fce->PO_TYPE->row['SIGN'] \t= 'I';\n\t\t$fce->PO_TYPE->row['OPTION'] \t= 'EQ';\n\t\t$fce->PO_TYPE->row['LOW'] \t= 'ZK17';\n\t\t$fce->PO_TYPE->row['HIGH'] \t= '';\n\t\t$fce->PO_TYPE->Append($fce->PO_TYPE->row);\n\t\t\t\n $fce->call();\n\n if ($fce->GetStatus() == SAPRFC_OK) {\n $fce->T_ITEM->Reset();\n $data=array();\n $empty=0;\n $tampildata=array();\n while ($fce->T_ITEM->Next()) {\n\t\t\t\t$matnr \t\t= $fce->T_ITEM->row[\"MATNR\"];\t// Kode Material\n\t\t\t\t$lifnr \t\t= $fce->T_ITEM->row[\"LIFNR\"];\t// Kode Vendor\n\t\t\t\t$ebeln \t\t= $fce->T_ITEM->row[\"EBELN\"];\t// No PO\n\t\t\t\t$menge \t\t= intval($fce->T_ITEM->row[\"MENGE\"]);\t// Quantity PO\n\t\t\t\t$sisaqty\t= intval($fce->T_ITEM->row[\"DELIV_QTY\"]);\t// Quantity PO Open\n\t\t\t\t$werks \t\t= $fce->T_ITEM->row[\"WERKS\"];\t// Plant\n\t\t\t\t$vendor\t\t= $fce->T_ITEM->row[\"VENDNAME\"];\t// Nama Vendor\n\t\t\t\t$material \t= $fce->T_ITEM->row[\"MAKTX\"];\t// Nama Material\n\t\t\t\t$potype \t= $fce->T_ITEM->row[\"BSART\"];\t// Type PO\n\t\t\t\t// $mins \t\t= $fce->T_ITEM->row[\"EISBE\"];\t// Safety Stock\n\t\t\t\t$mins \t\t= $fce->T_ITEM->row[\"MINBE\"];\t// Re Order Point\n\t\t\t\t$maxs \t\t= $fce->T_ITEM->row[\"MABST\"];\t// Max\n\t\t\t\t$statuspo\t= $fce->T_ITEM->row[\"ELIKZ\"];\t// Max\n\t\t\t\t$start \t\t= date_format(date_create($fce->T_ITEM->row[\"BEDAT\"]),'d M Y');\n\t\t\t\t$end \t\t= date_format(date_create($fce->T_ITEM->row[\"EINDT\"]),'d M Y');\n\t\t\t\t\n\t\t\t\tif($statuspo == 'X' || $statuspo == 'x')\n\t\t\t\t{\n\t\t\t\t\t$sts = 0;\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$sts = 1;\n\t\t\t\t}\n\t\t\t\t$sqlread= \"SELECT count(id_list) ADA\n\t\t\t\t\t\t\tFROM VMI_MASTER \n\t\t\t\t\t\t\twhere NO_PO = '$ebeln' and\n\t\t\t\t\t\t\tKODE_MATERIAL = '$matnr' and \n\t\t\t\t\t\t\tKODE_VENDOR = '$lifnr' and\n\t\t\t\t\t\t\tPLANT = '$werks' \n\t\t\t\t\t\t\t\";\n\t\t\t\t\t\t\t//and QUANTITY = '$menge'\n\t\t\t\t$jum \t= $this->db->query($sqlread)->row();\n\t\t\t\t$nilai \t= $jum->ADA;\n\t\t\t\t// echo $nilai.\"->\".$matnr.\" | \".$lifnr.\" | \".$ebeln.\" | \".$menge.\" | \".$werks.\" | \".$vendor.\" | \".$material.\" | \".$start.\" | \".$end.\" ==> \".$potype.\"<br/>\";\n\t\t\t\t// $ebeln == \"6310000038\" || $ebeln == \"6310000039\" || $ebeln == \"6310000040\" || $ebeln == \"6310000041\" || $ebeln == \"6310000042\" || $ebeln == \"6310000043\")\n\t\t\t\t\n\t\t\t\tif($nilai < 1){\n\t\t\t\t\tif($ebeln == \"6310000038\" || $ebeln == \"6310000039\" || $ebeln == \"6310000040\" || $ebeln == \"6310000041\" || $ebeln == \"6310000042\" || $ebeln == \"6310000043\"\n\t\t\t\t\t\t|| $lifnr == \"0000113004\" || $lifnr == \"0000110091\" || $lifnr == \"0000110253\" || $lifnr == \"0000110015\" || $lifnr == \"0000112369\" || $lifnr == \"0000110016\"){\t\t\t\t\t\t\n\t\t\t\t\t\t$sqlcount \t= \"SELECT max(ID_LIST) MAXX FROM VMI_MASTER\";\n\t\t\t\t\t\t$maxid \t\t= $this->db->query($sqlcount)->row();\t\t\n\t\t\t\t\t\t$max_list \t= $maxid->MAXX+1;\n\t\t\t\t\t\t$insert\t\t= \"insert into VMI_MASTER(ID_LIST,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tPLANT,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tKODE_MATERIAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNAMA_MATERIAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tUNIT,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tKODE_VENDOR,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNAMA_VENDOR,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNO_PO,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tPO_ITEM,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCONTRACT_ACTIVE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCONTRACT_END,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDOC_DATE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSLOC,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tMIN_STOCK,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tMAX_STOCK,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTOCK_AWAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTOCK_VMI,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tQUANTITY,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tID_COMPANY,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTATUS)\n\t\t\t\t\t\t\t\t\t\t\t\tvalues('$max_list',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$werks',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$matnr',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$material',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"MEINS\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$lifnr',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$vendor',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$ebeln',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"EBELP\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($start),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($end),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($start),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"LGORT\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"EISBE\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"MABST\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$sisaqty',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$opco',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$sts'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\";\n\t\t\t\t\t\t$save \t= $this->db->query($insert);\n\t\t\t\t\t\techo \"Baru ==> $ebeln | $material | $vendor | $opco | $werks | $potype<br/>\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"Skip ==> $ebeln | $material | $vendor | $opco | $werks | $potype<br/>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif($nilai >= 1){\n\t\t\t\t\t$sqlread1 = \"SELECT ID_LIST\n\t\t\t\t\t\t\tFROM VMI_MASTER \n\t\t\t\t\t\t\twhere NO_PO = '$ebeln' and\n\t\t\t\t\t\t\tKODE_MATERIAL = '$matnr' and \n\t\t\t\t\t\t\tKODE_VENDOR = '$lifnr' and\n\t\t\t\t\t\t\tPLANT = '$werks' \n\t\t\t\t\t\t\t\";\n\t\t\t\t\t\t\t//and QUANTITY = '$menge'\n\t\t\t\t\t$getlist= $this->db->query($sqlread1)->row();\n\t\t\t\t\t$idlist = $getlist->ID_LIST;\n\t\t\t\t\t$update\t\t= \"update VMI_MASTER set quantity = '$sisaqty',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmin_stock = '$mins',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmax_stock = '$maxs',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTATUS = '$sts'\n\t\t\t\t\t\t\t\t\t\t\t\t\twhere ID_LIST = '$idlist'\n\t\t\t\t\t\t\t\t\";\n\t\t\t\t\t$update_data\t= $this->db->query($update);\n\t\t\t\t\t\techo \"$update <br/>\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\techo \"Skip ==> $ebeln | $material | $vendor | $opco| $werks | $potype<br/>\";\n\t\t\t\t}\n\t\t\t\t// echo \"<hr/>\"; \n\t\t\t}\n\t\t// echo \"<pre>\";\n\t\t// print_r($fce);\n\t\t// echo \"hahaha\";\n $fce->Close();\n\t\t}\n }", "public function run()\n {//pilihan pulsa\n \t$id=1;\n\n $telkomsel_nominal=['3000','5000','10000','20000','250000','500000','70000','100000'];\n\t\t$indosat_nominal=['1000','2000','6000','9000','15000','25000','55000', '100000'];\n\t\t$XL_nominal=['10000','40000','70000','100000','150000','200000'];\n\t\t$axis_nominal=['6000', '10000', '13000'];\n\t\t$smart_nominal=['50000','100000'];\n\t\t$mobile8_nominal=['3000','8000'];\n\t\t$three_nominal=['3000','5000','10000','20000','250000','500000','70000','100000'];\n\n\n\t\t$three_price=['3200','5500','11000','22000','260000','505000','72100','102500'];\n $telkomsel_price=['3500','6000','12000','23000','250000','500000','70000','100000'];\n\t\t$indosat_price=['1500','2700','8000','10000','17000','25000','55000', '100000'];\n\t\t$axis_price=['7000', '12000', '15000'];\n\t\t$smart_price=['51000','120000'];\n\t\t$mobile8_price=['3500','9000'];\n\t\t$XL_price=['11000','44000','76000','100000','150000','200000'];\n\n\n\n\t\t$provider_name=[$XL_nominal, $axis_nominal, $indosat_nominal, $telkomsel_nominal, $three_nominal, $smart_nominal, $mobile8_nominal]; // 7 pieces\n\n\t\t//$id_provider=['XL','INDOSAT','SMART', 'AXIS' ,'THREE', 'TELKOMSEL', 'MOBILE8'];//6 \n\n\n\t\t//$flag=['Y','Y','N','Y','Y','N','N','Y','N'];\n\n\t\t\n\t\t$temp=\"\";\n\t\t$temp2=\"\";\n\n\t\tfor($i=0; $i<count($provider_name);$i++){\n\t\t\tfor($j=0; $j<count($provider_name[$i]); $j++){\t\n\t\t\t\tif($i==0){\n\t\t \t$temp = $XL_nominal[$j];\n\t\t \t$temp2 = $XL_price[$j];\n\t\t\t\t}else if($i==1){\n\t\t \t$temp = $axis_nominal[$j];\n\t\t \t$temp2 = $axis_price[$j];\n\t\t\t\t}else if($i==2){\n\t\t\t\t\t$temp = $indosat_nominal[$j];\n\t\t\t\t\t$temp2 = $indosat_price[$j];\n\t\t\t\t}else if($i==3){\n\t\t\t\t\t$temp = $telkomsel_nominal[$j];\n\t\t\t\t\t$temp2 = $telkomsel_price[$j];\n\t\t\t\t}else if($i==4){\n\t\t \t$temp = $three_nominal[$j];\n\t\t \t$temp2 = $three_price[$j];\n\t\t\t\t}else if($i==5){\n\t\t\t\t\t$temp = $smart_nominal[$j];\n\t\t\t\t\t$temp2 = $smart_price[$j];\n\t\t\t\t}else if($i==6){\n\t\t\t\t\t$temp = $mobile8_nominal[$j];\n\t\t\t\t\t$temp2 = $mobile8_price[$j];\n\t\t\t\t}\n\n\t\t\t\t$send=array(\n\n\t\t\t\t\t'pulsa_id' => $i+1,//provider name id\n\t\t\t\t\t'flag' => 'Y',\n\t\t\t\t\t'nominal'=>$temp,\n\t\t\t\t\t'harga'=>$temp2,\n\t\t\t\t\t\t\t'created_at' => DB::raw('NOW()'),\n\t\t\t\t\t\t\t'updated_at' => DB::raw('NOW()'),\n\t\t\t\t);\n\n\t\t\t\tDB::table('pulsa_providers')->insert($send);\n\t\t\t\t//end second loop\n\t\t\t\t}\n\t\t\t\t//end first loop\n\t\t\t}\n\n\n }", "function specialop() {\n\n\n\t}", "function ermittle_Pokalrunde_Hin_Rueck($spieltypnr)\n{\n $pokalrunde = 0;\n $hinspielkz = true;\n $anzahl = 0;\n //\n if ($spieltypnr == 101)\n {\n $pokalrunde = 1;\n $hinspielkz = true;\n $anzahl = 128;\n }\n if ($spieltypnr == 102)\n {\n $pokalrunde = 1;\n $hinspielkz = false;\n $anzahl = 128;\n }\n //\n if ($spieltypnr == 103)\n {\n $pokalrunde = 2;\n $hinspielkz = true;\n $anzahl = 64;\n }\n if ($spieltypnr == 104)\n {\n $pokalrunde = 2;\n $hinspielkz = false;\n $anzahl = 64;\n }\n //\n if ($spieltypnr == 105)\n {\n $pokalrunde = 3;\n $hinspielkz = true;\n $anzahl = 32;\n }\n if ($spieltypnr == 106)\n {\n $pokalrunde = 3;\n $hinspielkz = false;\n $anzahl = 32;\n }\n //\n if ($spieltypnr == 107)\n {\n $pokalrunde = 4;\n $hinspielkz = true;\n $anzahl = 16;\n }\n if ($spieltypnr == 108)\n {\n $pokalrunde = 4;\n $hinspielkz = false;\n $anzahl = 16;\n }\n //\n if ($spieltypnr == 109)\n {\n $pokalrunde = 5;\n $hinspielkz = true;\n $anzahl = 8;\n }\n if ($spieltypnr == 110)\n {\n $pokalrunde = 5;\n $hinspielkz = false;\n $anzahl = 8;\n }\n //\n if ($spieltypnr == 111)\n {\n $pokalrunde = 6;\n $hinspielkz = true;\n $anzahl = 4;\n }\n if ($spieltypnr == 112)\n {\n $pokalrunde = 6;\n $hinspielkz = false;\n $anzahl = 4;\n }\n //\n if ($spieltypnr == 113)\n {\n $pokalrunde = 7;\n $hinspielkz = true;\n $anzahl = 2;\n }\n if ($spieltypnr == 114)\n {\n $pokalrunde = 7;\n $hinspielkz = false;\n $anzahl = 2;\n }\n //\n if ($spieltypnr == 115)\n {\n $pokalrunde = 8;\n $hinspielkz = true;\n $anzahl = 1;\n }\n if ($spieltypnr == 116)\n {\n $pokalrunde = 8;\n $hinspielkz = false;\n $anzahl = 1;\n }\n if ($spieltypnr == 201)\n {\n $pokalrunde = 1;\n $hinspielkz = true;\n $anzahl = 8;\n }\n if ($spieltypnr == 202)\n {\n $pokalrunde = 1;\n $hinspielkz = false;\n $anzahl = 8;\n }\n if ($spieltypnr == 203)\n {\n $pokalrunde = 2;\n $hinspielkz = true;\n $anzahl = 4;\n }\n if ($spieltypnr == 204)\n {\n $pokalrunde = 2;\n $hinspielkz = false;\n $anzahl = 4;\n }\n if ($spieltypnr == 205)\n {\n $pokalrunde = 3;\n $hinspielkz = true;\n $anzahl = 2;\n }\n if ($spieltypnr == 206)\n {\n $pokalrunde = 3;\n $hinspielkz = false;\n $anzahl = 2;\n }\n if ($spieltypnr == 207)\n {\n $pokalrunde = 4;\n $hinspielkz = true;\n $anzahl = 1;\n }\n if ($spieltypnr == 208)\n {\n $pokalrunde = 4;\n $hinspielkz = false;\n $anzahl = 1;\n }\n return ([\n 'pokalrunde' => $pokalrunde,\n 'hinspielkz' => $hinspielkz,\n 'anzahl' => $anzahl,\n ]);\n}", "public function promotional();", "public function acp();", "public function obtenerViajesplusAbonados();", "public function setSw($x) { $this->sw = $x; }", "public function handelKupon()\n {\n }", "function formulaires_abosympa_verifier_dist(){\n\t$erreurs = array();\n\n\t// recuperation des valeurs du formulaire\n\t$nom = _request('nom');\n\t$email = _request('email');\n\t$listes = _request('listes', true);\n\t$abonnement = _request('abonnement');\n\t$desabonnement = _request('desabonnement');\n\n\t// Faire une fonction de verif sur le mail pour validite\n\n\tif($email == ''){\n\t\t$erreurs['erreur_email'] = _T(\"soapsympa:email_oublie\");\n\t}\n\telse{\n\t\tinclude_spip('inc/filtres'); # pour email_valide()\n\t\tif (!email_valide($email)){\n\t\t\t$erreurs['email'] = _T(\"form_email_non_valide\");\n\t\t}\n\t\telse{\n\t\t\tspip_log(\"Email = $email;\",\"soapsympa\");\n\t\t\t\n\t\t}\n\t}\n\n\tif(empty($listes)){\n\t\t$erreurs['listes'] = _T(\"soapsympa:choisir_liste\");\n\t}\n\n //message d'erreur generalise\n if (count($erreurs)) {\n $erreurs['message_erreur'] .= _T('soapsympa:verifier_formulaire');\n }\n\n return $erreurs; // si c'est vide, traiter sera appele, sinon le formulaire sera ressoumis\n}", "protected function parse_oneS_fun()\n {\n $this->check_param_num(1);\n\n $this->generate_instruction();\n\n $this->get_token();\n $result = $this->check_symb();\n $this->generate_symb($result, \"1\");\n\n $this->xml->endElement();\n }", "function s_z($ige) {\r\n $s_z = '';\r\n $veg1 = substr($ige,-1);\r\n if ($veg1 === 's') {\r\n $s_z = 's';\r\n }\r\n if ($veg1 === 'z') {\r\n $s_z = 'z';\r\n }\r\n return $s_z;\r\n }", "public function getXMin() {}", "public function getXMin() {}", "function gpl3(){\n\t$glp3= <<<INICIO\n<!--\n\t/**************************************************************************************************\n\t# Copyright (c) 2008, 2009, 2010, 2011, 2012 Fernando A. Rodriguez para SerInformaticos.es #\n\t# #\n\t# Este programa es software libre: usted puede redistribuirlo y / o modificarlo #\n\t# bajo los t&eacute;rminos de la GNU General Public License publicada por la #\n\t# la Free Software Foundation, bien de la versi&oacute;n 3 de la Licencia, o de #\n\t# la GPL2, o cualquier versi&oacute;n posterior. #\n\t# #\n\t# Este programa se distribuye con la esperanza de que sea &uacute;til, #\n\t# pero SIN NINGUNA GARANTÍA, incluso sin la garant&iacute;a impl&iacute;cita de #\n\t# COMERCIABILIDAD o IDONEIDAD PARA UN PROPÓSITO PARTICULAR. V&eacute;ase el #\n\t# GNU General Public License para m&aacute;s detalles. #\n\t# #\n\t# Usted deber&iacute;a haber recibido una copia de la Licencia P&uacute;blica General de GNU #\n\t# junto con este programa. Si no, visite <http://www.gnu.org/licenses/>. #\n\t# #\n\t# Puede descargar la version completa de la GPL3 en este enlace: #\n\t# \t< http://www.serinformaticos.es/index.php?file=kop804.php > #\n\t# #\n\t# Para mas información puede contactarnos : #\n\t# #\n\t# Teléfono (+34) 961 19 60 62 #\n\t# #\n\t# Email: [email protected] #\n\t# #\n\t# MSn: [email protected] #\n\t# #\n\t# Twitter: @SerInformaticos #\n\t# #\n\t# Web: www.SerInformaticos.es #\n\t# #\n\t**************************************************************************************************/\n-->\n\nINICIO;\n\treturn $gpl3;\n}", "function suppr_evenement($id_evenement, $id_agenda, $date_suppr=\"\")\r\n{\r\n\t////\tInit\r\n\tglobal $objet, $AGENDAS_AFFICHES;\r\n\t$evt_tmp = db_ligne(\"SELECT * FROM gt_agenda_evenement WHERE id_evenement='\".intval($id_evenement).\"'\");\r\n\t$droit_acces = droit_acces($objet[\"evenement\"],$id_evenement,false);\r\n\t$droit_acces_agenda = @$AGENDAS_AFFICHES[$id_agenda][\"droit\"];\r\n\t////\tSUPPR A UNE DATE (créé \"period_date_exception\") / SUPPR DANS TOUS LES AGENDAS / SUPPR DANS UN AGENDA\r\n\tif($id_agenda==\"tous\" && $droit_acces==3 && $date_suppr!=\"\")\t\t{ db_query(\"UPDATE gt_agenda_evenement SET period_date_exception='\".trim($evt_tmp[\"period_date_exception\"].\"@@\".$date_suppr,\"@@\").\"' WHERE id_evenement=\".db_format($id_evenement)); }\r\n\telseif($id_agenda==\"tous\" && $droit_acces==3)\t\t\t\t\t\t{ db_query(\"DELETE FROM gt_agenda_jointure_evenement WHERE id_evenement=\".db_format($id_evenement)); }\r\n\telseif($id_agenda>0 && ($droit_acces==3 || $droit_acces_agenda>=2))\t{ db_query(\"DELETE FROM gt_agenda_jointure_evenement WHERE id_evenement=\".db_format($id_evenement).\" AND id_agenda=\".db_format($id_agenda)); }\r\n\t////\tON SUPPRIME L'ÉVÉNEMENT S'IL N'EST AFFECTÉ À AUCUN AGENDA + FICHIERS JOINTS\r\n\tif(db_valeur(\"SELECT count(*) FROM gt_agenda_jointure_evenement WHERE id_evenement='\".intval($id_evenement).\"'\")==0){\r\n\t\tglobal $objet;\r\n\t\tsuppr_objet($objet[\"evenement\"], $id_evenement);\r\n\t}\r\n}", "public function demo()\n {\n // xu ly logic\n }", "function stan_lacznika($stan,$nr_rups)\n{\t\n\tif($stan==1 && $nr_rups==1) // zamkniety dla rups1\n\t{\n\t\t$wspolrzedna=230;\t\n\t}\n\telseif($stan==0 && $nr_rups==1) // otwarty dla rups1\n\t{\n\t\t$wspolrzedna=220;\n\t}\t\n\telseif($stan==1 && $nr_rups==2) // zamkniety dla rups2\n\t{\n\t\t$wspolrzedna=460;\t\n\t}\n\telseif($stan==0 && $nr_rups==2) // otwarty dla rups2\n\t{\n\t\t$wspolrzedna=450;\n\t}\t\n\telseif($stan==1 && $nr_rups==3.1) // zamkniety dla rups3\n\t{\n\t\t$wspolrzedna=690;\t\n\t}\n\telseif($stan==0 && $nr_rups==3.1) // otwarty dla rups3\n\t{\n\t\t$wspolrzedna=680;\n\t}\n\telseif($stan==1 && $nr_rups==3.2) // zamkniety dla rups3\n\t{\n\t\t$wspolrzedna=710;\t\n\t}\n\telseif($stan==0 && $nr_rups==3.2) // otwarty dla rups3\n\t{\n\t\t$wspolrzedna=700;\n\t}\n\telseif($stan==1 && $nr_rups==4) // zamkniety dla rups4\n\t{\n\t\t$wspolrzedna=940;\t\n\t}\n\telseif($stan==0 && $nr_rups==4) // otwarty dla rups4\n\t{\n\t\t$wspolrzedna=930;\n\t}\n\telseif($stan==1 && $nr_rups==8) // zamkniety dla rups8\n\t{\n\t\t$wspolrzedna=1170;\t\n\t}\n\telseif($stan==0 && $nr_rups==8) // otwarty dla rups8\n\t{\n\t\t$wspolrzedna=1160;\n\t}\t\n\telseif($stan==1 && $nr_rups==9.1) // zamkniety dla rups9.1\n\t{\n\t\t$wspolrzedna=1415;\t\n\t}\n\telseif($stan==0 && $nr_rups==9.1) // otwarty dla rups9.1\n\t{\n\t\t$wspolrzedna=1405;\n\t}\n\telseif($stan==1 && $nr_rups==9.2) // zamkniety dla rups9.2\n\t{\n\t\t$wspolrzedna=1435;\t\n\t}\n\telseif($stan==0 && $nr_rups==9.2) // otwarty dla rups9.2\n\t{\n\t\t$wspolrzedna=1425;\n\t}\t\t\n\telseif($stan==1 && $nr_rups==9.3) // zamkniety dla rups9.3\n\t{\n\t\t$wspolrzedna=1455;\t\n\t}\n\telseif($stan==0 && $nr_rups==9.3) // otwarty dla rups9.3\n\t{\n\t\t$wspolrzedna=1445;\n\t}\t\n\t\n\treturn $wspolrzedna;\n}", "public function pasaje_abonado();", "private static function e14($globals){\n\t\t$scanner = $globals->curr_pkg->scanner;\n\t\t$r = self::e15($globals);\n\t\twhile( $scanner->sym === Symbol::$sym_lshift\n\t\t|| $scanner->sym === Symbol::$sym_rshift ){\n\t\t\t$op = $scanner->sym;\n\t\t\t$scanner->readSym();\n\t\t\t$t = self::e15($globals);\n\t\t\tif( $op === Symbol::$sym_lshift ){\n\t\t\t\t$r = $r->leftShift($globals->logger, $scanner->here(), $t);\n\t\t\t} else {\n\t\t\t\t$r = $r->rightShift($globals->logger, $scanner->here(), $t);\n\t\t\t}\n\t\t}\n\t\treturn $r;\n\t}", "public function afficheToi()\r\n {\r\n\r\n echo ($this->x .'-'.$this->y);\r\n }", "public function plus_abonados();", "function _pointX($value)\n {\n $country = $value['X'];\n return $this->_plotLeft+$this->_mapPoints[$country]['X']*$this->_scale;\n }", "function convertir_pmg($u) {\n\n\tinclude_spip('inc/charsets');\n\tinclude_spip('inc/filtres');\n\n\t// debug xml\n\t$m['xml'] = \"<pre style='border:1px solid #cccccc; padding:5px;height:300px;overflow:auto'>\" . entites_html($u) . \"</pre>\" ;\n\n\t// passer en utf-8 en nettoyant les entites\n\t$u = unicode2charset(html2unicode($u)) ;\n\n\t// espaces utf-8 , inutile car on à l'option /u\n\t//$u = str_replace(\"\\xC2\\xA0\", \" \", $u);\n\n\t$u = trim($u);\n\n\t// id pdf <artikel-pdf>\n\t$m['id_artikel'] = trim(str_replace(\".pdf\",\"\", textebrut(extraire_balise($u, \"artikel_pdf\"))));\n\n\t// pages\n\t//\t<seite_start>\n\t//\t<seite_ende>\n\n\t$m['pages'] = trim(textebrut(extraire_balise($u, \"seite_start\")) . \" \" . textebrut(extraire_balise($u, \"seite_ende\")));\n\t$p = explode(\" \",$m['pages']) ;\n\tif($p[0] < 10 and !preg_match(\"/^0/\", $m['pages']))\n\t\t$m['pages'] = \"0\" . $m['pages'] ;\n\n\t// <datum>11012018</datum>\n\t$datum = textebrut(extraire_balise($u, \"datum\")) ;\n\t$m['date'] = substr($datum, 4 ,4) . \"-\" . substr($datum, 2 ,2) . \"-\" . substr($datum, 0 ,2) . \" 00:00:00\" ;\n\n\t// url <weblink>...</weblink>\n\t$m['url'] = textebrut(extraire_balise($u, \"weblink\")) ;\n\n\t// illustrations\n\t//<abbildung>\n\t//\t<foto>p846705.jpg</foto>\n\t//\t<fotograf>MAJDI MOHAMMED/ap</fotograf>\n\t//\t<beschriftung>Anti-Trump-Proteste in Nablus, 22. Dezember 2017</beschriftung>\n\t//</abbildung>\"\n\t//<abbildung>\n\t//<infografik>p846706.jpg</infografik>\n\t//</abbildung>\n\n\t/*\n\t<ins class='documents'>{\"id_document\":\"21703\",\"id_vignette\":\"0\",\"titre\":\"Qui reconna\\u00eet la Palestine ?\",\"descriptif\":\"\",\"fichier\":\"png\\/3b-reconnaissance.png\",\"taille\":\"90179\",\"date\":\"2018-01-23 12:05:39\",\"distant\":\"non\",\"extension\":\"png\",\"contenu\":\"\",\"extrait\":\"non\",\"id_source\":null,\"vieux_url\":\"\",\"statut\":\"prop\",\"date_publication\":\"0000-00-00 00:00:00\",\"brise\":\"0\",\"credits\":\"\",\"media\":\"image\",\"id_objet\":\"58351\",\"objet\":\"article\",\"vu\":\"non\",\"rang_lien\":\"0\"}</ins>\n\n// Si carte :\n<ins class='mots_cles'>04. type::carte ou graphique</ins>\n\n\t*/\n\n\t$illustrations = extraire_balises($u,\"abbildung\");\n\tforeach($illustrations as $i){\n\t\t$fichier = textebrut(extraire_balise($i,\"foto\"));\n\t\t$credit = textebrut(extraire_balise($i,\"fotograf\"));\n\t\t$legende = textebrut(extraire_balise($i,\"beschriftung\"));\n\t\t$infographie = textebrut(extraire_balise($i,\"infografik\"));\n\t\t$taille= \"1\" ;\n\n\t\tif($infographie)\n\t\t\t$m['infographie'] = \"oui\" ;\n\n\t\t$file = $infographie.$fichier ;\n\n\t\t$m['documents'] = \"{\\\"fichier\\\":\\\"$file\\\",\\\"taille\\\":\\\"$taille\\\",\\\"distant\\\":\\\"non\\\",\\\"extension\\\":\\\"jpg\\\",\\\"credits\\\":\\\"$credit\\\",\\\"descriptif\\\":\\\"$legende\\\"}\" ;\n\n\t\t$u = str_replace($i,\"\",$u);\n\t}\n\n\t// <titel>Die Wahhabiten</titel> <untertitel>Monarchie und Religion in Saudi-Arabien </untertitel>\n\n\t$m['titre'] = $datum = textebrut(extraire_balise($u, \"titel\")) ;\n\t$m['soustitre'] = $datum = textebrut(extraire_balise($u, \"untertitel\")) ;\n\n\t// <autor_name>\n\t$auteurs = extraire_balises($u, \"autor_name\") ;\n\tforeach($auteurs as &$a)\n\t\t$a = textebrut($a);\n\t$m['auteurs'] = implode(\"@@\",$auteurs) ;\n\n\t// recaler le traducteur\n\t// <absatz>Aus dem Französischen von Claudia Steinitz<i/></absatz>\n\tpreg_match('~<absatz>Aus de.*von.*</absatz>~Uu',$u,$trad);\n\t$u = str_replace($trad[0],\"\",$u);\n\t$m['traducteur'] = textebrut($trad[0]);\n\t//var_dump($trad);\n\n\t// recaler l'auteur au debut\n\t// <absatz>von <strong>Nabil Mouline</strong></absatz>\n\t$u = preg_replace('~<absatz>von <strong>(.*)</strong></absatz>~Uu',\"\",$u);\n\t// variante\n\t$u = preg_replace('~<absatz>\\R*\\s*<strong>von (.*)</strong>\\R*\\s*</absatz>~Uums',\"\",$u);\n\n\t// recaler la bio\n\tpreg_match('~<absatz>'.$auteurs[0].'.*</absatz>~Uu',$u,$bio);\n\t$u = str_replace($bio[0],\"\",$u);\n\t$m['signature'] = textebrut($bio[0]);\n\n\t// recaler les notes\n\t// <absatz><sup>1</sup> Siehe Nabil Mouline, „Traditionalismus und Herrschaft“, <i>Le Monde diplomatiqu</i>e, April 2015.</absatz>\n\t$u = preg_replace('~<sup>(\\d+)</sup>~Uu',\"(\\\\1)\",$u);\n\n\t// paragraphes\n\t$u = str_replace(\"<absatz>\",\"\",$u);\n\t$u = str_replace(\"</absatz>\",\"\\n\\n\",$u);\n\n\t// encadrés\n\t//<box>\n\t//\t<box-titel>Im Licht des Völkerrechts</box-titel>\n\t//\t<box-text>\n\t//\t</box-text>\n\t//</box>\n\n\t$encadres = extraire_balises($u,\"box\");\n\tforeach($encadres as $e){\n\t\t$titre_encadre = textebrut(extraire_balise($e,\"box_titel\"));\n\t\t$texte_encadre = trim(preg_replace(\",</?box_text>,\",\"\",extraire_balise($e,\"box_text\"))) . \"\\n\" ;\n\t\t$u = str_replace($e,\"\\n\\n<quote>\\n{{{$titre_encadre}}}\\n\\n$texte_encadre\\n</quote>\",$u);\n\t}\n\n\t// Inter\n\t// <zwischentitel>Symbolische Reförmchen stören die Ulemas nicht</zwischentitel>\n\t$u = str_replace(\"<zwischentitel>\",\"{{{\",$u);\n\t$u = str_replace(\"</zwischentitel>\",\"}}}\\n\\n\",$u);\n\n\t$m['texte'] = trim(preg_replace(\",</?text>,\",\"\",extraire_balise($u,\"text\"))) . \"\\n\" ;\n\n\tforeach($champs = array(\"texte\", \"chapo\", \"signature\", \"credit\") as $t){\n\t\t\t// texte spip\n\t\t\tif($m[$t]){\n\n\t\t\t\t// itals\n\t\t\t\t$m[$t] = str_replace(\"<i>\",\"{\",$m[$t]);\n\t\t\t\t$m[$t] = str_replace(\"</i>\",\"}\",$m[$t]);\n\n\t\t\t\t// gras\n\t\t\t\t$m[$t] = str_replace(\"<strong>\",\"{{\",$m[$t]);\n\t\t\t\t$m[$t] = str_replace(\"</strong>\",\"}}\",$m[$t]);\n\t\t\t\t// espaces en debut de lignes\n\t\t\t\t$m[$t] = preg_replace(\",^ +,im\", \"\", $m[$t]);\n\t\t\t}\n\t}\n\n\t// envoyer dans un pipeline pour traitements persos.\n\n\t// traitements persos en pipeline maison sur $c avant d'écrire le fichier converti\n\tif(find_in_path('convertisseur_perso.php'))\n\t\tinclude_spip(\"convertisseur_perso\");\n\tif (function_exists('nettoyer_conversion')){\n\t\t$m = nettoyer_conversion($m);\n\t}\n\n\treturn $m ;\n}", "public function getPO105(){\n\t\treturn $this->getPO1IndexOf(5);\n\t}", "function galaxy_spy($lines) {\n\tglobal $db, $user_data;\n\n\t$nb_spy_added = $phalanx = $gate = 0;\n\t$spy_added = array();\n\tfor ($i=0 ; $i<sizeof($lines) ; $i++) {\n\t\t$line = stripslashes($lines[$i]);\n\n\t\tif (preg_match(\"/Matières premières sur/\", $line)) {\n\t\t\t$phalanx = $gate = 0;\n\t\t\t$header = str_replace(\"Matières premières sur \", \"\", $line);\n\n\t\t\tlist($coordinates, $time) = explode(\"]\", $header);\n\t\t\tif (is_null($coordinates) || is_null($time)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$time = trim($time);\n\t\t\t$time = str_replace(\"le \", \"\", $time);\n\n\t\t\tlist($planet, $coordinates) = explode(\"[\", $coordinates);\n\t\t\tif (is_null($coordinates) || is_null($time)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$planet = trim($planet);\n\n\t\t\tlist($galaxy, $system, $row) = explode(\":\", $coordinates);\n\t\t\tif (intval($galaxy) < 1 || intval($galaxy) > 9 || intval($system) < 1 || intval($system) > 499 || intval($row) < 1 || intval($row) > 15) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tlist($day, $hour) = explode(\" \", $time);\n\t\t\tif (is_null($day) || is_null($hour)) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tlist($month, $day) = explode(\"-\", $day);\n\t\t\tif (intval($month) < 1 || intval($month) > 12 || intval($day) < 1 || intval($day) > 31) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!checkdate($month, $day, date(\"Y\"))) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tlist($hour, $minute, $seconde) = explode(\":\", $hour);\n\t\t\tif (intval($hour) < 0 || intval($hour) > 23 || intval($minute) < 0 || intval($minute) > 59 || intval($seconde) < 0 || intval($seconde) > 59) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$timestamp = mktime($hour, $minute, $seconde, $month, $day);\n\t\t\t$report = \"\";\n\t\t}\n\n\t\tif (preg_match(\"#Phalange de capteur\\s+(\\d)#\", $line, $arr)) {\n\t\t\t$phalanx = $arr[1];\n\t\t}\n\t\tif (preg_match(\"#Porte de saut spatial\\s+(\\d)#\", $line, $arr)) {\n\t\t\t$gate = 1;\n\t\t}\n\t\tif (isset($report)) {\n\t\t\t$checking = false;\n//\t\t\t$report .= $line;\n\t\t\t$report .= str_replace('.','',$line); // pour les . dans les RE http://www.ogsteam.fr/forums/viewtopic.php?pid=27659#p27659\n\t\t\tif (preg_match(\"/Probabilité de destruction de la flotte d'espionnage/\", $line)) {\n\t\t\t\t//Vérification de la validité des données\n\t\t\t\tif (!check_var($galaxy, \"Num\") || !check_var($system, \"Num\") || !check_var($row, \"Num\") || !check_var($planet, \"Galaxy\") ||\n\t\t\t\t!check_var($timestamp, \"Num\") || !check_var($phalanx, \"Num\") || !check_var($report, \"Spyreport\")) {\n\t\t\t\t\tredirection(\"index.php?action=message&id_message=errordata&info\");\n\t\t\t\t}\n\n\t\t\t\t$coordinates = $galaxy.\":\".$system.\":\".$row;\n\t\t\t\tif (galaxy_add_spy($galaxy, $system, $row, $planet, $timestamp, $report, $phalanx, $gate)) {\n\t\t\t\t\t$spy_added[] = array(1, $coordinates, $timestamp);\n\t\t\t\t\t$nb_spy_added++;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$spy_added[] = array(0, $coordinates, $timestamp);\n\t\t\t\t}\n\t\t\t\t$phalanx = $gate = 0;\n\t\t\t\tunset($report);\n\t\t\t}\n\t\t}\n\t}\n\tuser_set_stat(null, null, null, $nb_spy_added);\n\n\treturn $spy_added;\n}", "function hitung_confidence($supp_xuy, $min_support, $min_confidence, $atribut1, $atribut2, $atribut3, $id_process, $dataTransaksi, $jumlah_transaksi) {\n\n\t\t//hitung nilai support $nilai_support_x seperti di itemset2\n\t\t$jml_itemset2=$this->jumlah_itemset2($dataTransaksi, $atribut1, $atribut2);\n\t\t$nilai_support_x=($jml_itemset2/$jumlah_transaksi) * 100;\n\n\t\t$kombinasi1=$atribut1.\" , \".$atribut2;\n\t\t$kombinasi2=$atribut3;\n\t\t$supp_x=$nilai_support_x; //$row1_['support'];\n\t\t$conf=($supp_xuy/$supp_x)*100;\n\t\t//lolos seleksi min confidence itemset3\n\t\t$lolos=($conf >=$min_confidence)? 1: 0;\n\n\t\t//hitung korelasi lift\n\t\t$jumlah_kemunculanAB=$this->jumlah_itemset3($dataTransaksi, $atribut1, $atribut2, $atribut3);\n\t\t$PAUB=$jumlah_kemunculanAB/$jumlah_transaksi;\n\n\t\t$jumlah_kemunculanA=$this->jumlah_itemset2($dataTransaksi, $atribut1, $atribut2);\n\t\t$jumlah_kemunculanB=$this->jumlah_itemset1($dataTransaksi, $atribut3);\n\n\t\t//$nilai_uji_lift = $PAUB / $jumlah_kemunculanA * $jumlah_kemunculanB;\n\t\t$nilai_uji_lift=$PAUB / (($jumlah_kemunculanA/$jumlah_transaksi) * ($jumlah_kemunculanB/$jumlah_transaksi));\n\t\t$korelasi_rule=($nilai_uji_lift<1)?\"korelasi negatif\": \"korelasi positif\";\n\n\t\tif($nilai_uji_lift==1) {\n\t\t\t$korelasi_rule=\"tidak ada korelasi\";\n\t\t}\n\n\t\t//masukkan ke table confidence\n\t\t$data=array(\"kombinasi1\"=> $kombinasi1,\n\t\t\t\"kombinasi2\"=> $kombinasi2,\n\t\t\t\"support_xUy\"=> $supp_xuy,\n\t\t\t\"support_x\"=> $supp_x,\n\t\t\t\"confidence\"=> $conf,\n\t\t\t\"lolos\"=> $lolos,\n\t\t\t\"min_support\"=> $min_support,\n\t\t\t\"min_confidence\"=> $min_confidence,\n\t\t\t\"nilai_uji_lift\"=> $nilai_uji_lift,\n\t\t\t\"korelasi_rule\"=> $korelasi_rule,\n\t\t\t\"id_process\"=> $id_process,\n\t\t\t\"jumlah_a\"=> $jumlah_kemunculanA,\n\t\t\t\"jumlah_b\"=> $jumlah_kemunculanB,\n\t\t\t\"jumlah_ab\"=> $jumlah_kemunculanAB,\n\t\t\t\"px\"=> ($jumlah_kemunculanA/$jumlah_transaksi),\n\t\t\t\"py\"=> ($jumlah_kemunculanB/$jumlah_transaksi),\n\t\t\t\"pxuy\"=> $PAUB,\n\t\t\t\"from_itemset\"=>3);\n\t\t$this->db->insert('confidence', $data);\n\n\t}", "function ambil_soal() { \n $tampil = $this->db->query(\"SELECT * FROM IKD.IKD_D_SOAL_QUISIONER ORDER BY KD_SOAL ASC\")->result_array();\n\t\treturn $tampil;\n }" ]
[ "0.5573334", "0.51431936", "0.5116433", "0.50235045", "0.50072986", "0.49689907", "0.4965571", "0.4951736", "0.49300718", "0.4929089", "0.4915702", "0.488355", "0.48551887", "0.4835545", "0.4817069", "0.48159826", "0.47848994", "0.47732717", "0.47726303", "0.47489056", "0.47405702", "0.4735273", "0.4735273", "0.47195494", "0.47190243", "0.47166407", "0.47034693", "0.46786666", "0.46778196", "0.46754035", "0.4660181", "0.46420258", "0.46411955", "0.46408507", "0.46261743", "0.46257868", "0.46191338", "0.460107", "0.460107", "0.460107", "0.45951924", "0.45768982", "0.45699346", "0.45684668", "0.4567991", "0.45554382", "0.45486256", "0.4534362", "0.4530204", "0.45281592", "0.4518407", "0.45168146", "0.45152137", "0.45148185", "0.4514475", "0.45110795", "0.45007062", "0.4500557", "0.4477121", "0.44707316", "0.4466906", "0.44656143", "0.44632295", "0.446067", "0.4458592", "0.44554234", "0.44529197", "0.44476897", "0.44436693", "0.443528", "0.44337153", "0.4433679", "0.442803", "0.44262263", "0.44258654", "0.44253296", "0.44118348", "0.44066903", "0.44059533", "0.44030702", "0.4398925", "0.43962675", "0.4395489", "0.43949413", "0.4392719", "0.4392719", "0.43887883", "0.43884963", "0.4387992", "0.43845427", "0.43837732", "0.4379259", "0.4378956", "0.43782565", "0.43735212", "0.4371125", "0.43682653", "0.4362005", "0.43589604", "0.43518156" ]
0.49490154
8
$this>executeSql('SET foreign_key_checks = 0');
public function disableForeignKeyChecks($table) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function reset_foreignKeyChecks() {\r\n global $db;\r\n \r\n $query = \"SET FOREIGN_KEY_CHECKS=1\";\r\n\r\n $statement = $db->prepare($query);\r\n \r\n if ($statement == FALSE) {\r\n display_db_error($db->error);\r\n }\r\n \r\n $success = $statement->execute();\r\n\r\n if ($success) {\r\n $statement->close();\r\n } else {\r\n display_db_error($db->error);\r\n }\r\n }", "static function set_noForeignKeyChecks() {\r\n global $db;\r\n \r\n $query = \"SET FOREIGN_KEY_CHECKS=0\";\r\n\r\n $statement = $db->prepare($query);\r\n\r\n if ($statement == FALSE) {\r\n display_db_error($db->error);\r\n }\r\n \r\n $success = $statement->execute();\r\n\r\n if ($success) {\r\n $statement->close();\r\n } else {\r\n display_db_error($db->error);\r\n }\r\n }", "public function onSetUp(): void\n {\n $this->getConnection()->executeStatement('SET foreign_key_checks = 0');\n\n parent::onSetUp();\n\n $this->getConnection()->executeStatement('SET foreign_key_checks = 1');\n }", "public function disableFkCheck(): StatementInterface\n {\n return $this->query(\"SET FOREIGN_KEY_CHECKS=0;\");\n }", "public function enableFkCheck(): StatementInterface\n {\n return $this->query(\"SET FOREIGN_KEY_CHECKS=1;\");\n }", "public function getDownSQL()\n {\n return array(\n 'propel' => '\n SET FOREIGN_KEY_CHECKS = 1;\n ',\n );\n }", "function __destruct()\n\t{\n\t\t$query = \"set foreign_key_checks = 1\";\n\t\t$this->pdo_source->query($query);\t\t\n\t\t\n\t}", "protected function _checkForeignKeysReverseCascade() {}", "function db_trans_stop($dbh) {\ndb_query(\"COMMIT;\",$dbh,\"\",\"\",\"\",\"Committing transaction\");\ndb_query(\"SET autocommit=1;\",$dbh,\"\",\"\",\"\",\"Setting auto commit to 1\");\ndb_query(\"SET FOREIGN_KEY_CHECKS = 1;\",$dbh,\"\",\"\",\"\",\"Enabling foreign key checks\");\n}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nDROP TABLE IF EXISTS `movimiento`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "function toggleForeignKeys($enable)\n\t{\n\t\t$this->query(\"SET FOREIGN_KEY_CHECKS = \".($enable ? 1 : 0));\n\t}", "function db_trans_start($dbh) {\ndb_query(\"SET FOREIGN_KEY_CHECKS = 1;\",$dbh,\"\",\"\",\"\",\"Disabling foreign key checks\"); \ndb_query(\"SET autocommit=0;\",$dbh,\"\",\"\",\"\",\"Setting auto commit to 0\");\ndb_query(\"START TRANSACTION;\",$dbh,\"\",\"\",\"\",\"Starting transaction\");\n\n}", "public static function foreignChecks($bool = true)\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=' . (int)(!!$bool));\n }", "protected function _checkForeignKeysRestrict() {}", "public function testFkChecksOnOff()\n {\n $this->assertTrue($this->connection->areForeignKeyChecksOn());\n $this->connection->turnOffForeignKeyChecks();\n $this->assertFalse($this->connection->areForeignKeyChecksOn());\n $this->connection->turnOnForeignKeyChecks();\n $this->assertTrue($this->connection->areForeignKeyChecksOn());\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user`;\n\nDROP TABLE IF EXISTS `question`;\n\nDROP TABLE IF EXISTS `answer`;\n\nDROP TABLE IF EXISTS `image`;\n\nDROP TABLE IF EXISTS `vote`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "function drop_all_tables($db)\n{\n $db->query(\"SET foreign_key_checks = 0\");\n\n if ($result = $db->query(\"SHOW TABLES\")) {\n while ($row = $result->fetch_array(MYSQLI_NUM)) {\n $db->query(\"DROP TABLE IF EXISTS \" . $row[0]);\n }\n }\n\n $db->query(\"SET foreign_key_checks = 1\");\n}", "public function getUpSQL()\n {\n return array(\n 'propel' => '\n SET FOREIGN_KEY_CHECKS = 1;\n ',\n );\n }", "protected function _checkForeignKeysReverseRestrict() {}", "public function disableForeignKeyConstraints($connection);", "function __destructor() {\n /**\n * Re-enable foreign key checks \n */\n if ($this->disableForeignKeyChecks === true) {\n mysqli_query($this->conn, 'SET foreign_key_checks = 1');\n }\n }", "public function safeUp()\n\t{\n $sql = <<<SQL\n alter table r add R8 inte;\nSQL;\n\t\t//$this->execute($sql);\n $sql = <<<SQL\n ALTER TABLE r ADD constraint FK_r8_elgz1 FOREIGN KEY (r8) REFERENCES elgz (elgz1) ON DELETE SET DEFAULT ON UPDATE CASCADE;\nSQL;\n //$this->execute($sql);\n\t}", "public function dropForeignKeys()\n\t{\n\t\t$table = $this->getTableName();\n\n\t\t// Does the table exist?\n\t\tif (blx()->db->getSchema()->getTable('{{'.$table.'}}'))\n\t\t{\n\t\t\tforeach ($this->getBelongsToRelations() as $name => $config)\n\t\t\t{\n\t\t\t\t$otherModel = new $config[1];\n\t\t\t\t$otherTable = $otherModel->getTableName();\n\n\t\t\t\t// Does the other table exist?\n\t\t\t\tif (blx()->db->getSchema()->getTable('{{'.$otherTable.'}}'))\n\t\t\t\t{\n\t\t\t\t\t$fkName = \"{$table}_{$name}_fk\";\n\t\t\t\t\tblx()->db->createCommand()->dropForeignKey($fkName, $table);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function testSafeDropNonExistingFk()\n {\n $this->assertCount(2, $this->connection->getForeignKeyNames('writers'));\n $this->connection->dropForeignKey('writers', 'FK that does not exist');\n $this->assertCount(2, $this->connection->getForeignKeyNames('writers'));\n }", "public function getDownSQL()\n {\n return array(\n 'propel' => '\n SET FOREIGN_KEY_CHECKS = 0;\n SET FOREIGN_KEY_CHECKS = 1;\n ',\n 'blog' => '\n SET FOREIGN_KEY_CHECKS = 0;\n SET FOREIGN_KEY_CHECKS = 1;\n '\n );\n }", "public function disableForeignKeyConstraints()\n {\n return $this->getConnection()->statement(\n $this->grammar->compileDisableForeignKeyConstraints()\n );\n }", "protected function _disableForeignKeyChecks()\n\t{\n\t\treturn '';\n\t}", "public function enableForeignKeyConstraints($connection);", "static public function disableForeignKeyConstraints()\n {\n return self::call(__FUNCTION__ , func_get_args());\n }", "public function getDownSQL()\n\t{\n\t\treturn array (\n 'propel' => '\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\nALTER TABLE `command` CHANGE `std_out_file` `std_out_file` VARCHAR(50);\nALTER TABLE `command` CHANGE `std_err_file` `std_err_file` VARCHAR(50);\nALTER TABLE `command` CHANGE `exit_file` `exit_file` VARCHAR(50);\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n\t}", "private function warnForThroughRelations()\n {\n $this->warn(\"| Make sure that the \\\"{$this->parent}\\\" model has the foreign key \\\"\".Str::lower($this->farParent).\"_id\\\" and the \\\"{$this->throughChild}\\\" model has the foreign key \\\"\".Str::lower($this->parent).\"_id\\\"\\n\");\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` INTEGER NOT NULL AFTER `quality_tweet`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function run()\n {\n $_ = \\DB::statement('SELECT @@GLOBAL.foreign_key_checks');\n \\DB::statement('set foreign_key_checks = 0');\n \\Milestone\\Appframe\\Model\\ResourceDataScope::query()\n ->create([\t'id' => '50001', \t'resource_data' => '50004', \t'scope' => '50005', \t\t\t\t\t\t\t\t\t\t\t\t\t])\n ;\n \\DB::statement('set foreign_key_checks = ' . $_);\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user_login`;\n\nALTER TABLE `user` DROP `user_mname`;\n\nALTER TABLE `user` DROP `user_user`;\n\nALTER TABLE `user` DROP `user_password`;\n\nALTER TABLE `user` DROP `user_date_lastlogin`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "protected function _enableForeignKeyChecks()\n\t{\n\t\treturn '';\n\t}", "public function safeUp()\n\t{\n $this->dropForeignKey('client', Yii::app()->getModule('user')->tableUsersClients);\n $this->addForeignKey('client', Yii::app()->getModule('user')->tableUsersClients, 'clients_id', Yii::app()->getModule('user')->tableClients, 'id', 'SET NULL', 'SET NULL');\n\t}", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n DB::beginTransaction();\n// $this->seed();\n DB::commit();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function addForeignKeys()\n\t{\n\t\t$table = $this->getTableName();\n\n\t\tforeach ($this->getBelongsToRelations() as $name => $config)\n\t\t{\n\t\t\t$otherModel = new $config[1];\n\t\t\t$otherTable = $otherModel->getTableName();\n\t\t\t$fkName = \"{$table}_{$name}_fk\";\n\n\t\t\tif (isset($config['onDelete']))\n\t\t\t{\n\t\t\t\t$onDelete = $config['onDelete'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (empty($config['required']))\n\t\t\t\t{\n\t\t\t\t\t$onDelete = static::SET_NULL;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$onDelete = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tblx()->db->createCommand()->addForeignKey($fkName, $table, $config[2], $otherTable, 'id', $onDelete);\n\t\t}\n\t}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_inicio` `fecha_inicio` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_fin` `fecha_fin` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `descuento` `descuento` DECIMAL;\r\n\r\nALTER TABLE `promocion`\r\n ADD `descripcion` VARCHAR(70) AFTER `id`,\r\n ADD `estado` VARCHAR(11) AFTER `fecha_fin`,\r\n ADD `promocion_global` TINYINT(1) NOT NULL AFTER `descuento`;\r\n\r\nALTER TABLE `promocion` DROP `activo`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "protected function addForeignKeyConstraints()\n {\n \n \n }", "public function complete(){\n\n $flag = 0;\n \n $query = \"SET foreign_key_checks = 0\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n \n $query1 = \"DELETE FROM \" . $this->table_name . \"\n WHERE id_ordine=?\";\n $stmt1 = $this->conn->prepare($query1);\n $this->id_ordine=htmlspecialchars($this->id_ordine);\n $stmt1->bindParam(1, $this->id_ordine);\n $stmt1->execute();\n if($stmt1){\n $query2 = \"UPDATE articolo set id_ordine = NULL \n WHERE id_ordine=?\";\n\n $stmt2 = $this->conn->prepare($query2);\n $this->id_ordine=htmlspecialchars($this->id_ordine);\n $stmt2->bindParam(1, $this->id_ordine);\n $stmt2->execute();\n\n if($stmt2){\n\n $query3 = \"SET foreign_key_checks = 1\";\n $stmt3 = $this->conn->prepare($query3);\n $stmt3->execute();\n if($stmt3)\n return true;\n }\n }\n else\n return false;\n }", "public function setForeignKeyChecks($state);", "public function getDownSQL()\n\t{\n\t\treturn array (\n 'propel' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP INDEX `collector_U_1` ON `collector`;\nDROP INDEX `collector_U_2` ON `collector`;\nDROP INDEX `collector_U_3` ON `collector`;\nDROP INDEX `collector_U_4` ON `collector`;\nDROP INDEX `collector_U_5` ON `collector`;\nDROP INDEX `collector_U_6` ON `collector`;\n\nCREATE INDEX `facebook_id` ON `collector` (`facebook_id`);\nCREATE INDEX `collector_FI_1` ON `collector` (`session_id`);\nCREATE UNIQUE INDEX `collector_U_1` ON `collector` (`email`);\nCREATE UNIQUE INDEX `collector_U_2` ON `collector` (`graph_id`);\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n\t}", "function checkIntegrityDb()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function foreignConstraint();", "private function createRemainingForeignConstraints(): void\n\t{\n\t\tSchema::table('albums', function (Blueprint $table) {\n\t\t\t$table->foreign('cover_id')\n\t\t\t\t->references('id')->on('photos')\n\t\t\t\t->onUpdate('CASCADE')\n\t\t\t\t->onDelete('SET NULL');\n\t\t});\n\t}", "public function safeDown()\n\t{\n $sql=\" ALTER TABLE `tbl_venta` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n //quitando la columna pto_venta de tbl_empleado\n $sql=\" ALTER TABLE `tbl_empleado` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n\t}", "public function testFkExists()\n {\n $this->assertTrue($this->connection->foreignKeyExists('writers', 'writer_period'));\n $this->assertFalse($this->connection->foreignKeyExists('writers', 'unknown FK'));\n }", "private function cleanDatabase()\n {\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n foreach($this->tables as $table)\n {\n\n DB::table($table)->truncate();\n\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n\n\n }", "abstract protected function addForeignKeys(&$script);", "public function removeAll() {\n $sql = 'SET FOREIGN_KEY_CHECKS = 0; TRUNCATE TABLE course';\n \n $connection_manager = new connection_manager();\n $conn = $connection_manager->connect();\n \n $stmt = $conn->prepare($sql);\n \n $stmt->execute();\n $count = $stmt->rowCount();\n }", "function dropTables(Doctrine\\DBAL\\Connection $connection)\n{\n $connection->query('SET FOREIGN_KEY_CHECKS=0');\n foreach ($connection->getSchemaManager()->listTableNames() as $table) {\n $connection->getSchemaManager()->dropTable($table);\n }\n $connection->query('SET FOREIGN_KEY_CHECKS=1');\n}", "public function getUpSQL()\n {\n return array(\n 'propel' => '\n SET FOREIGN_KEY_CHECKS = 0;\n SET FOREIGN_KEY_CHECKS = 1;\n ',\n 'blog' => '\n SET FOREIGN_KEY_CHECKS = 0;\n SET FOREIGN_KEY_CHECKS = 1;\n '\n );\n }", "function link_storage(){\n\t\t\n\t\t$query =\n\t\t\t\"ALTER TABLE `$this->table_name`\" .\n\t\t\t\" ADD CONSTRAINT `{$this->table_name}_ibfk_1`\" .\n\t\t\t' FOREIGN KEY (`parent_node_id`)' .\n\t\t\t' REFERENCES `nodes` (`node_id`)' .\n\t\t\t' ON DELETE CASCADE' .\n\t\t\t';';\n\t\t$result = $this->database->execute($query);\n\t\t\n\t\treturn $result;\n\t}", "public function remove()\r\n\t{\r\n\t\t$mPrimaryKeyName = $this->_mPrimaryKeyName;\r\n\t\t$bInsertMode = false;\r\n\t\t\r\n\t\tif ($mPrimaryKeyName === false) {\r\n\t\t\r\n\t\t\tthrow new Exception('['.__FILE__.' (l.'.__LINE__.'] no primary key on this table!');\r\n\t\t}\r\n\t\telse if (is_string($mPrimaryKeyName)) {\r\n\t\t\r\n\t\t\t$sMethodPrimaryKey = 'get_'.$this->_mPrimaryKeyNameWithoutMapping;\r\n\t\t\t$aPrimaryKey = array($mPrimaryKeyName => $this->$sMethodPrimaryKey());\r\n\t\t}\r\n\t\telse {\r\n\t\t\r\n\t\t\t$aPrimaryKey = array();\r\n\t\t\r\n\t\t\tforeach($mPrimaryKeyName as $sKey => $sPrimaryKey) {\r\n\t\t\r\n\t\t\t\t$sMethodPrimaryKey = 'get_'.$this->_mPrimaryKeyNameWithoutMapping[$sKey];\r\n\t\t\t\t$aPrimaryKey[$sPrimaryKey] = $this->$sMethodPrimaryKey();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/**\r\n\t\t * check if the virtual foreign key in this model is respected\r\n\t\t */\r\n\t\tif (count($this->_aForeignKey) > 0) {\r\n\r\n\t\t foreach ($this->_aForeignKey as $sName => $aForeignKey) {\r\n\r\n\t\t if ($aForeignKey['has_one'] == 1 && isset($aForeignKey['foreign_key_options']['action'])\r\n\t\t && $aForeignKey['foreign_key_options']['action'] == self::CASCADE) {\r\n\t\t \r\n\t\t $sMethodPrimaryKey = 'get_'.$aForeignKey['foreign_key'];\r\n\t\t\t\t $mFIeld = $this->$sMethodPrimaryKey();\r\n\t\t\t\t \r\n\t\t\t\t if ($mFIeld) {\r\n\t\t\t\t \r\n\t\t\t\t $oOrm = new Orm;\r\n\t\t\t\t \t\r\n\t\t\t\t $iResults = $oOrm->select(array('*'))\r\n\t\t\t\t ->from($aForeignKey['entity_join_name']);\r\n\t\t\t\t \r\n\t\t\t\t $oWhere = new Where;\r\n\t\t\t\t \r\n\t\t\t\t $oWhere->whereEqual($aForeignKey['primary_key_name'], $mFIeld);\r\n\r\n\t\t\t\t $aResults = $oOrm->where($oWhere)\r\n\t\t\t\t ->load();\r\n\t\t\t\r\n\t\t\t if (count($aResults) > 0) {\r\n\t\t\t \t\r\n\t\t\t $oOrm = new Orm;\r\n\t\t\t\t \t\r\n \t\t\t\t $oOrm->delete($aForeignKey['entity_join_name'])\r\n\t\t\t ->where($oWhere)\r\n\t\t\t ->save();\r\n\t\t\t }\r\n\t\t\t\t }\r\n\t\t }\r\n \t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$oOrm = new Orm;\r\n\t\t\r\n\t\t$oOrm->delete(preg_replace('/^.*\\\\\\\\([a-zA-Z0-9_]+)$/', '$1', get_called_class()))\r\n\t\t\t ->where($aPrimaryKey)\r\n\t\t\t ->save();\r\n\r\n\t\treturn $this;\r\n\t}", "protected function nullifyInvalidForeignKeys()\n {\n $this->output(t('Fixing records with invalid foreign keys...'));\n // Fix orphans of Packages\n $this->nullifyInvalidForeignKey('AttributeSets', 'pkgID', 'Packages', 'pkgID');\n // Fix orphans of Files\n $this->nullifyInvalidForeignKey('atFile', 'fID', 'Files', 'fID');\n // Fix orphans of Users\n $this->nullifyInvalidForeignKey('Files', 'uID', 'Users', 'uID');\n // Fix orphans of AttributeKeyCategories\n $this->nullifyInvalidForeignKey('AttributeSets', 'akCategoryID', 'AttributeKeyCategories', 'akCategoryID');\n // Fix orphans of FileStorageLocations\n $this->nullifyInvalidForeignKey('Files', 'fslID', 'FileStorageLocations', 'fslID');\n }", "protected function constrain()\n {\n $other = $this->other_key();\n $foreign = $this->foreign_key();\n\n $this->set_select($foreign, $other)->set_join($other)->set_where($foreign);\n }", "public function onDeleteSetNull()\n {\n return $this->onDelete(ForeignKeyMode::SET_NULL);\n }", "public function run()\n {\n DB::statement('set foreign_key_checks = 0;');\n DB::table('administrador')->truncate();\n DB::statement('set foreign_key_checks = 1;');\n\n $admin= new administrador();\n $admin->username='admin';\n $admin->save();\n\n $admin= new administrador();\n $admin->username='robert';\n $admin->save();\n\n\n\n\n\n }", "public function down(): void\n {\n try {\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"DROP TABLE IF EXISTS prom2_pages\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }", "private function warnForSimpleRelations()\n {\n $this->warn(\"\\n| Eloquent determines the foreign key of the relationship based on the model name.\\n| In this case, the {$this->child} model is automatically assumed to have a \" . Str::lower($this->parent) . \"_id foreign key.\\n\");\n }", "static public function enableForeignKeyConstraints()\n {\n return self::call(__FUNCTION__ , func_get_args());\n }", "public function enableForeignKeyConstraints()\n {\n return $this->getConnection()->statement(\n $this->grammar->compileEnableForeignKeyConstraints()\n );\n }", "public function deleteCascade() {\n\t\tif (((int)$this->id)==0) {\n\t\t\trequire_once(\"CORE/Lucterios_Error.inc.php\");\n\t\t\tthrow new LucteriosException( IMPORTANT,\"Suppression impossible{[newline]}Enregistrement vide.\");\n\t\t}\n\t\trequire_once\"Lucterios_Error.inc.php\";\n\t\t$res=$this->canBeDelete();\n\t\tif ($res==1)\n\t\t\tthrow new LucteriosException(GRAVE,\"Suppression impossible: Des references existent\");\n\t\tif ($res==2)\n\t\t\tthrow new LucteriosException(GRAVE,\"Suppression impossible: Enregistrement protege\");\n\t\tglobal $connect;\n\t\t$connect->begin();\n\t\ttry {\n\t\t\tif(!$this->is_super) {\n\t\t\t\t$son = $this->getSon();\n\t\t\t\tif($son != null) {\n\t\t\t\t\treturn $son->deleteCascade();\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach($this->__DBMetaDataField as $fieldname=>$values) {\n\t\t\t\tif ($values['type']==9) {\n\t\t\t\t\t$children=$this->getField($fieldname);\n\t\t\t\t\twhile ($children->fetch())\n\t\t\t\t\t\t$children->deleteCascade();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($this->Heritage != \"\")\n\t\t\t\t$this->Super->deleteCascade();\n\t\t\t$this->delete();\n\t\t\t$connect->commit();\n\t\t} catch(Exception $e) {\n\t\t\t$connect->rollback();\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function down()\n {\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=0');\n\n $this->executeSQL('DROP TABLE link');\n $this->executeSQL('DROP TABLE link_category');\n\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=1');\n }", "public function getUpSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nCREATE TABLE `movimiento`\r\n(\r\n `id` INTEGER NOT NULL AUTO_INCREMENT,\r\n `proveedor_id` INTEGER,\r\n `cliente_id` INTEGER,\r\n `tipo_movimiento` VARCHAR(10),\r\n `producto_id` INTEGER,\r\n `cantidad` INTEGER,\r\n `fecha` VARCHAR(250),\r\n PRIMARY KEY (`id`),\r\n INDEX `movimiento_FI_1` (`proveedor_id`),\r\n INDEX `movimiento_FI_2` (`cliente_id`),\r\n INDEX `movimiento_FI_3` (`producto_id`),\r\n CONSTRAINT `movimiento_FK_1`\r\n FOREIGN KEY (`proveedor_id`)\r\n REFERENCES `proveedor` (`id`),\r\n CONSTRAINT `movimiento_FK_2`\r\n FOREIGN KEY (`cliente_id`)\r\n REFERENCES `cliente` (`id`),\r\n CONSTRAINT `movimiento_FK_3`\r\n FOREIGN KEY (`producto_id`)\r\n REFERENCES `producto` (`id`)\r\n) ENGINE=InnoDB;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "function uninstall() {\n $rec = SQLSELECT('Select distinct LINKED_OBJECT,LINKED_PROPERTY from myconditions');\n $total = count($rec);\n if ($total) {\n for($i=0;$i<$total;$i++) {\n removeLinkedProperty($rec[$i]['LINKED_OBJECT'], $rec[$i]['LINKED_PROPERTY'], 'myrules');\n }\n }\n SQLExec('DROP TABLE IF EXISTS myrules');\n SQLExec('DROP TABLE IF EXISTS myconditions');\n SQLExec('DROP TABLE IF EXISTS myactions');\n\n parent::uninstall();\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;'); // ignore foreign\n $this->categories();\n // $this->apps();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;'); // set foreign\n }", "function prot_setFKDefaults( $raFK = array() )\r\n /*********************************************\r\n With no args, this is the same as Clear()\r\n Args of \"table\"=>\"fk key\" cause those foreign keys to be set in the relation, and foreign data to be\r\n retrieved for non-base tables. This is especially useful for creating an \"empty\" row in a form that\r\n displays read-only data from a parent row.\r\n */\r\n {\r\n $this->Clear();\r\n\r\n // Leave _dbValSnap cleared because it's only used in updates to the base row, which is not set by this method.\r\n\r\n\r\n // N.B. only implemented for one level of indirection from the base table.\r\n // Traversal or really smart joins required to fetch data for a second-level row e.g. grandparent\r\n // We are assuming that the fk_* column name is not aliased (i.e. Field['col']==Field['alias']=='fk_'.$tableName\r\n foreach( $raFK as $tableName => $fkKey ) {\r\n $this->_values['fk_'.$tableName] = $fkKey;\r\n\r\n if( @$this->kfrdef['ver'] == 2 ) {\r\n if( ($a = $this->kfrel->raTableN2A[$tableName]) && ($t = $this->kfrdef['Tables'][$a]) ) {\r\n $raSelFields = array();\r\n foreach( $t['Fields'] as $f ) {\r\n $raSelFields[] = \"$a.{$f['col']} as {$f['alias']}\";\r\n }\r\n $ra = $this->kfrel->kfdb->QueryRA( \"SELECT \".implode(\",\",$raSelFields).\" FROM {$t['Table']} $a\"\r\n .\" WHERE $a._key='$fkKey'\" );\r\n // array_merge is easier, but KFDB returns duplicate entries in $ra[0],$ra[1],...\r\n foreach( $t['Fields'] as $f ) {\r\n $this->_values[$f['alias']] = $ra[$f['alias']];\r\n }\r\n }\r\n } else {\r\n foreach( $this->kfrel->kfrdef['Tables'] as $t ) {\r\n if( $t['Table'] != $tableName ) continue;\r\n $raSelFields = array();\r\n foreach( $t['Fields'] as $f ) {\r\n $raSelFields[] = $t['Alias'].\".\".$f['col'].\" as \".$f['alias'];\r\n }\r\n $ra = $this->kfrel->kfdb->QueryRA( \"SELECT \".implode(\",\",$raSelFields).\" FROM \".$t['Table'].\" \".$t['Alias'].\r\n \" WHERE \".$t['Alias'].\"._key=$fkKey\" );\r\n // array_merge is easier, but KFDB returns duplicate entries in $ra[0],$ra[1],...\r\n foreach( $t['Fields'] as $f ) {\r\n $this->_values[$f['alias']] = $ra[$f['alias']];\r\n }\r\n }\r\n }\r\n }\r\n }", "private function ensureDBConsistency(): void\n\t{\n\t\t$checkRelation = function (\n\t\t\tstring $modelName,\n\t\t\tstring $table,\n\t\t\tstring $column,\n\t\t\tstring $foreignModelName,\n\t\t\tstring $foreignTable,\n\t\t\tstring $fixMethod = '',\n\t\t): bool {\n\t\t\t$missing = DB::table($table)\n\t\t\t\t->whereNotIn($column, function (Builder $q) use ($foreignTable) {\n\t\t\t\t\t$q->from($foreignTable)->select('id');\n\t\t\t\t})\n\t\t\t\t->select('id', $column)\n\t\t\t\t->get();\n\n\t\t\tforeach ($missing as $m) {\n\t\t\t\t$msg = 'Found ' . $modelName .\n\t\t\t\t\t' with ID ' . $m->id .\n\t\t\t\t\t' which refers to non-existing ' . $foreignModelName .\n\t\t\t\t\t' with ID ' . $m->{$column};\n\t\t\t\tif (empty($fixMethod)) {\n\t\t\t\t\t$this->printError($msg);\n\t\t\t\t} else {\n\t\t\t\t\t$this->printWarning($msg);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($missing->isEmpty()) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t$fixQuery = DB::table($table)->whereIn('id', $missing->pluck('id'));\n\n\t\t\tswitch ($fixMethod) {\n\t\t\t\tcase 'nullify':\n\t\t\t\t\t$this->printInfo('Nullifying the affected relations from ' . $modelName . 's to ' . $foreignModelName . 's');\n\t\t\t\t\t$fixQuery->update([$column => null]);\n\n\t\t\t\t\treturn true;\n\t\t\t\tcase 'zeroize':\n\t\t\t\t\t$this->printInfo('Zeroizing the affected relations from ' . $modelName . 's to ' . $foreignModelName . 's');\n\t\t\t\t\t$fixQuery->update([$column => 0]);\n\n\t\t\t\t\treturn true;\n\t\t\t\tcase 'delete':\n\t\t\t\t\t$this->printInfo('Deleting the affected ' . $modelName . 's');\n\t\t\t\t\t$fixQuery->delete();\n\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->printInfo('Error is not automatically fixable');\n\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\n\t\t// If the owner of an album is missing, assign it to the admin user\n\t\t$isConsistent = $checkRelation('album', 'albums', 'owner_id', 'user', 'users', 'zeroize');\n\t\t// Move orphaned albums to the top-level\n\t\t$isConsistent &= $checkRelation('album', 'albums', 'parent_id', 'parent album', 'albums', 'nullify');\n\t\t// If the cover of an album is missing, unset the cover\n\t\t$isConsistent &= $checkRelation('album', 'albums', 'cover_id', 'cover photo', 'photos', 'nullify');\n\t\t// Delete orphaned shares\n\t\t$isConsistent &= $checkRelation('share', 'user_album', 'user_id', 'user', 'users', 'delete');\n\t\t$isConsistent &= $checkRelation('share', 'user_album', 'album_id', 'album', 'albums', 'delete');\n\t\t// If the owner of a photo is missing, assign it to the admin user\n\t\t$isConsistent &= $checkRelation('photo', 'photos', 'owner_id', 'user', 'users', 'zeroize');\n\t\t// If the album of a photo is missing, assign it to root (unsorted) album\n\t\t$isConsistent &= $checkRelation('photo', 'photos', 'album_id', 'album', 'albums', 'nullify');\n\t\t// Delete orphaned WebAuthn credentials\n\t\t$isConsistent &= $checkRelation('web authentication credential', 'web_authn_credentials', 'user_id', 'user', 'users', 'delete');\n\t\t// There is no obvious fix for orphaned page content\n\t\t$isConsistent &= $checkRelation('page content', 'page_contents', 'page_id', 'page', 'pages');\n\n\t\t// As we might have moved orphaned albums to the top,\n\t\t// we need to fix the tree.\n\t\t// Even if we did not move any album, fixing the tree before\n\t\t// the migration does not harm as users might have fiddled with their\n\t\t// DB without taking care of\n\t\t// `_lft` and `_rgt`\n\t\tRefactorAlbumModel_AlbumModel::query()->fixTree();\n\n\t\tif (!$isConsistent) {\n\t\t\t$this->printError('Your database is inconsistent and not fit for migration. Please fix your DB manually first.');\n\t\t\tthrow new \\RuntimeException('Inconsistent DB');\n\t\t}\n\t}", "public function getDownSQL()\n {\n return array (\n 'cungfoo' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `demande_identifiant_i18n`;\n\nDROP TABLE IF EXISTS `top_camping_i18n`;\n\nDROP TABLE IF EXISTS `demande_annulation_i18n`;\n\nALTER TABLE `activite_i18n` DROP `seo_title`;\n\nALTER TABLE `activite_i18n` DROP `seo_description`;\n\nALTER TABLE `activite_i18n` DROP `seo_h1`;\n\nALTER TABLE `activite_i18n` DROP `seo_keywords`;\n\nALTER TABLE `avantage_i18n` DROP `seo_title`;\n\nALTER TABLE `avantage_i18n` DROP `seo_description`;\n\nALTER TABLE `avantage_i18n` DROP `seo_h1`;\n\nALTER TABLE `avantage_i18n` DROP `seo_keywords`;\n\nALTER TABLE `baignade_i18n` DROP `seo_title`;\n\nALTER TABLE `baignade_i18n` DROP `seo_description`;\n\nALTER TABLE `baignade_i18n` DROP `seo_h1`;\n\nALTER TABLE `baignade_i18n` DROP `seo_keywords`;\n\nALTER TABLE `bon_plan_categorie_i18n` DROP `seo_title`;\n\nALTER TABLE `bon_plan_categorie_i18n` DROP `seo_description`;\n\nALTER TABLE `bon_plan_categorie_i18n` DROP `seo_h1`;\n\nALTER TABLE `bon_plan_categorie_i18n` DROP `seo_keywords`;\n\nALTER TABLE `bon_plan_i18n` DROP `seo_title`;\n\nALTER TABLE `bon_plan_i18n` DROP `seo_description`;\n\nALTER TABLE `bon_plan_i18n` DROP `seo_h1`;\n\nALTER TABLE `bon_plan_i18n` DROP `seo_keywords`;\n\nALTER TABLE `categorie_i18n` DROP `seo_title`;\n\nALTER TABLE `categorie_i18n` DROP `seo_description`;\n\nALTER TABLE `categorie_i18n` DROP `seo_h1`;\n\nALTER TABLE `categorie_i18n` DROP `seo_keywords`;\n\nALTER TABLE `category_type_hebergement_i18n` DROP `seo_title`;\n\nALTER TABLE `category_type_hebergement_i18n` DROP `seo_description`;\n\nALTER TABLE `category_type_hebergement_i18n` DROP `seo_h1`;\n\nALTER TABLE `category_type_hebergement_i18n` DROP `seo_keywords`;\n\nALTER TABLE `departement_i18n` DROP `seo_title`;\n\nALTER TABLE `departement_i18n` DROP `seo_description`;\n\nALTER TABLE `departement_i18n` DROP `seo_h1`;\n\nALTER TABLE `departement_i18n` DROP `seo_keywords`;\n\nALTER TABLE `edito_i18n` DROP `seo_title`;\n\nALTER TABLE `edito_i18n` DROP `seo_description`;\n\nALTER TABLE `edito_i18n` DROP `seo_h1`;\n\nALTER TABLE `edito_i18n` DROP `seo_keywords`;\n\nALTER TABLE `etablissement_i18n` DROP `seo_title`;\n\nALTER TABLE `etablissement_i18n` DROP `seo_description`;\n\nALTER TABLE `etablissement_i18n` DROP `seo_h1`;\n\nALTER TABLE `etablissement_i18n` DROP `seo_keywords`;\n\nALTER TABLE `event_i18n` DROP `seo_title`;\n\nALTER TABLE `event_i18n` DROP `seo_description`;\n\nALTER TABLE `event_i18n` DROP `seo_h1`;\n\nALTER TABLE `event_i18n` DROP `seo_keywords`;\n\nALTER TABLE `idee_weekend_i18n` DROP `seo_title`;\n\nALTER TABLE `idee_weekend_i18n` DROP `seo_description`;\n\nALTER TABLE `idee_weekend_i18n` DROP `seo_h1`;\n\nALTER TABLE `idee_weekend_i18n` DROP `seo_keywords`;\n\nALTER TABLE `mise_en_avant_i18n` DROP `seo_title`;\n\nALTER TABLE `mise_en_avant_i18n` DROP `seo_description`;\n\nALTER TABLE `mise_en_avant_i18n` DROP `seo_h1`;\n\nALTER TABLE `mise_en_avant_i18n` DROP `seo_keywords`;\n\nALTER TABLE `multimedia_etablissement_i18n` DROP `seo_title`;\n\nALTER TABLE `multimedia_etablissement_i18n` DROP `seo_description`;\n\nALTER TABLE `multimedia_etablissement_i18n` DROP `seo_h1`;\n\nALTER TABLE `multimedia_etablissement_i18n` DROP `seo_keywords`;\n\nALTER TABLE `multimedia_type_hebergement_i18n` DROP `seo_title`;\n\nALTER TABLE `multimedia_type_hebergement_i18n` DROP `seo_description`;\n\nALTER TABLE `multimedia_type_hebergement_i18n` DROP `seo_h1`;\n\nALTER TABLE `multimedia_type_hebergement_i18n` DROP `seo_keywords`;\n\nALTER TABLE `pays_i18n` DROP `seo_title`;\n\nALTER TABLE `pays_i18n` DROP `seo_description`;\n\nALTER TABLE `pays_i18n` DROP `seo_h1`;\n\nALTER TABLE `pays_i18n` DROP `seo_keywords`;\n\nALTER TABLE `personnage_i18n` DROP `seo_title`;\n\nALTER TABLE `personnage_i18n` DROP `seo_description`;\n\nALTER TABLE `personnage_i18n` DROP `seo_h1`;\n\nALTER TABLE `personnage_i18n` DROP `seo_keywords`;\n\nALTER TABLE `point_interet_i18n` DROP `seo_title`;\n\nALTER TABLE `point_interet_i18n` DROP `seo_description`;\n\nALTER TABLE `point_interet_i18n` DROP `seo_h1`;\n\nALTER TABLE `point_interet_i18n` DROP `seo_keywords`;\n\nALTER TABLE `region_i18n` DROP `seo_title`;\n\nALTER TABLE `region_i18n` DROP `seo_description`;\n\nALTER TABLE `region_i18n` DROP `seo_h1`;\n\nALTER TABLE `region_i18n` DROP `seo_keywords`;\n\nALTER TABLE `region_ref_i18n` DROP `seo_title`;\n\nALTER TABLE `region_ref_i18n` DROP `seo_description`;\n\nALTER TABLE `region_ref_i18n` DROP `seo_h1`;\n\nALTER TABLE `region_ref_i18n` DROP `seo_keywords`;\n\nALTER TABLE `service_complementaire_i18n` DROP `seo_title`;\n\nALTER TABLE `service_complementaire_i18n` DROP `seo_description`;\n\nALTER TABLE `service_complementaire_i18n` DROP `seo_h1`;\n\nALTER TABLE `service_complementaire_i18n` DROP `seo_keywords`;\n\nALTER TABLE `situation_geographique_i18n` DROP `seo_title`;\n\nALTER TABLE `situation_geographique_i18n` DROP `seo_description`;\n\nALTER TABLE `situation_geographique_i18n` DROP `seo_h1`;\n\nALTER TABLE `situation_geographique_i18n` DROP `seo_keywords`;\n\nALTER TABLE `tag_i18n` DROP `seo_title`;\n\nALTER TABLE `tag_i18n` DROP `seo_description`;\n\nALTER TABLE `tag_i18n` DROP `seo_h1`;\n\nALTER TABLE `tag_i18n` DROP `seo_keywords`;\n\nALTER TABLE `thematique_i18n` DROP `seo_title`;\n\nALTER TABLE `thematique_i18n` DROP `seo_description`;\n\nALTER TABLE `thematique_i18n` DROP `seo_h1`;\n\nALTER TABLE `thematique_i18n` DROP `seo_keywords`;\n\nALTER TABLE `theme_i18n` DROP `seo_title`;\n\nALTER TABLE `theme_i18n` DROP `seo_description`;\n\nALTER TABLE `theme_i18n` DROP `seo_h1`;\n\nALTER TABLE `theme_i18n` DROP `seo_keywords`;\n\nALTER TABLE `type_hebergement_capacite_i18n` DROP `seo_title`;\n\nALTER TABLE `type_hebergement_capacite_i18n` DROP `seo_description`;\n\nALTER TABLE `type_hebergement_capacite_i18n` DROP `seo_h1`;\n\nALTER TABLE `type_hebergement_capacite_i18n` DROP `seo_keywords`;\n\nALTER TABLE `type_hebergement_i18n` DROP `seo_title`;\n\nALTER TABLE `type_hebergement_i18n` DROP `seo_description`;\n\nALTER TABLE `type_hebergement_i18n` DROP `seo_h1`;\n\nALTER TABLE `type_hebergement_i18n` DROP `seo_keywords`;\n\nALTER TABLE `ville_i18n` DROP `seo_title`;\n\nALTER TABLE `ville_i18n` DROP `seo_description`;\n\nALTER TABLE `ville_i18n` DROP `seo_h1`;\n\nALTER TABLE `ville_i18n` DROP `seo_keywords`;\n\nALTER TABLE `vos_vacances_i18n` DROP `seo_title`;\n\nALTER TABLE `vos_vacances_i18n` DROP `seo_description`;\n\nALTER TABLE `vos_vacances_i18n` DROP `seo_h1`;\n\nALTER TABLE `vos_vacances_i18n` DROP `seo_keywords`;\n\nDROP TABLE IF EXISTS `seo`;\n\nDROP TABLE IF EXISTS `seo_i18n`;\n\nALTER TABLE `destination_i18n` CHANGE `seo_title` `seo_title` VARCHAR(255) DEFAULT \\'\\';\n\nALTER TABLE `destination_i18n` CHANGE `seo_h1` `seo_h1` VARCHAR(255) DEFAULT \\'\\';\n\nALTER TABLE `metadata_i18n` CHANGE `seo_title` `seo_title` VARCHAR(255) DEFAULT \\'\\';\n\nALTER TABLE `metadata_i18n` CHANGE `seo_h1` `seo_h1` VARCHAR(255) DEFAULT \\'\\';\n\nALTER TABLE `destination_i18n` DROP `seo_h1`;\n\nALTER TABLE `destination_i18n` DROP `seo_keywords`;\n\nALTER TABLE `metadata_i18n` DROP `seo_h1`;\n\nALTER TABLE `metadata_i18n` DROP `seo_keywords`;\n\nALTER TABLE `metadata_i18n` DROP `seo_title`;\n\nALTER TABLE `metadata_i18n` DROP `seo_description`;\n\nALTER TABLE `destination_i18n` DROP `seo_title`;\n\nALTER TABLE `destination_i18n` DROP `seo_description`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function cascadingDeletes() {\n\t\treturn false;\n\t}", "public function adjustingMmRelationWithTablesnameAndFieldnameFieldDoNotTouchOtherRelations() {}", "public function testForeignKeyWithOnUpdate()\n {\n $statement = (new CreateTable($this->mockConnection));\n $return = $statement->foreignKey('column', 'table', 'id', null, 'cascade');\n $array = $statement->toArray();\n\n $this->assertInstanceOf(CreateTable::class, $return);\n $this->assertEquals([\n 'constraints' => [\n [\n 'type' => 'foreignKey',\n 'name' => null,\n 'columns' => ['column'],\n 'referenceTable' => 'table',\n 'referenceColumns' => ['id'],\n 'onDelete' => null,\n 'onUpdate' => 'cascade',\n ]\n ],\n ], $array);\n }", "public function getDownSQL()\n\t{\n\t\treturn array (\n 'artistfan' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `broadcast_flows` DROP FOREIGN KEY `broadcast_flows_FK_1`;\n\nALTER TABLE `broadcast_flows` CHANGE `event_id` `event_id` INTEGER DEFAULT 0;\n\nALTER TABLE `broadcast_flows` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `broadcast_flows` CHANGE `pdate` `pdate` INTEGER DEFAULT 0;\n\nALTER TABLE `broadcast_flows` DROP `used`;\n\nALTER TABLE `broadcast_viewers` DROP FOREIGN KEY `broadcast_viewers_FK_1`;\n\nALTER TABLE `broadcast_viewers` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `broadcast_viewers` CHANGE `pdate` `pdate` INTEGER DEFAULT 0;\n\nALTER TABLE `broadcast_viewers` CHANGE `udate` `udate` INTEGER DEFAULT 0;\n\nALTER TABLE `countries` CHANGE `sortid` `sortid` INTEGER DEFAULT 0;\n\nALTER TABLE `event` DROP FOREIGN KEY `event_FK_1`;\n\nALTER TABLE `event` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `event` CHANGE `event_type` `event_type` INTEGER DEFAULT 0;\n\nALTER TABLE `event_attend` DROP FOREIGN KEY `event_attend_FK_1`;\n\nALTER TABLE `event_attend` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `event_attend` CHANGE `event_id` `event_id` INTEGER DEFAULT 0;\n\nALTER TABLE `event_attend` CHANGE `pdate` `pdate` INTEGER DEFAULT 0;\n\nALTER TABLE `event_purchase` DROP FOREIGN KEY `event_purchase_FK_1`;\n\nALTER TABLE `event_purchase` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `event_purchase` CHANGE `event_id` `event_id` INTEGER DEFAULT 0;\n\nALTER TABLE `event_purchase` CHANGE `pdate` `pdate` INTEGER DEFAULT 0;\n\nALTER TABLE `event_video` DROP FOREIGN KEY `event_video_FK_1`;\n\nALTER TABLE `event_video` DROP FOREIGN KEY `event_video_FK_2`;\n\nALTER TABLE `event_video` CHANGE `event_id` `event_id` INTEGER DEFAULT 0;\n\nALTER TABLE `event_video` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `event_video` CHANGE `pdate` `pdate` INTEGER DEFAULT 0;\n\nALTER TABLE `music` DROP FOREIGN KEY `music_FK_1`;\n\nALTER TABLE `music` DROP FOREIGN KEY `music_FK_2`;\n\nALTER TABLE `music` DROP FOREIGN KEY `music_FK_3`;\n\nALTER TABLE `music` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `music` CHANGE `album_id` `album_id` INTEGER DEFAULT 0;\n\nALTER TABLE `music` CHANGE `pdate` `pdate` INTEGER DEFAULT 0;\n\nALTER TABLE `music_album` DROP FOREIGN KEY `music_album_FK_1`;\n\nALTER TABLE `music_album` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `music_album` CHANGE `pdate` `pdate` INTEGER DEFAULT 0;\n\nALTER TABLE `music_purchase` DROP FOREIGN KEY `music_purchase_FK_1`;\n\nALTER TABLE `music_purchase` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `music_purchase` CHANGE `music_id` `music_id` INTEGER DEFAULT 0;\n\nALTER TABLE `music_purchase` CHANGE `pdate` `pdate` INTEGER DEFAULT 0;\n\nALTER TABLE `pages` CHANGE `sortid` `sortid` INTEGER DEFAULT 0;\n\nALTER TABLE `pages` CHANGE `pdate` `pdate` INTEGER DEFAULT 0;\n\nALTER TABLE `payment_info` DROP FOREIGN KEY `payment_info_FK_1`;\n\nALTER TABLE `payment_info` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `payment_info` CHANGE `pdate` `pdate` INTEGER DEFAULT 0;\n\nALTER TABLE `payout` DROP FOREIGN KEY `payout_FK_1`;\n\nALTER TABLE `payout` DROP FOREIGN KEY `payout_FK_2`;\n\nALTER TABLE `payout` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `payout` CHANGE `pdate` `pdate` INTEGER DEFAULT 0;\n\nALTER TABLE `payout` CHANGE `user_from` `user_from` INTEGER DEFAULT 0;\n\nALTER TABLE `payout` CHANGE `payment_info_id` `payment_info_id` INTEGER DEFAULT 0;\n\nALTER TABLE `photo` DROP FOREIGN KEY `photo_FK_1`;\n\nALTER TABLE `photo` DROP FOREIGN KEY `photo_FK_2`;\n\nALTER TABLE `photo` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `photo` CHANGE `album_id` `album_id` INTEGER DEFAULT 0;\n\nALTER TABLE `photo` CHANGE `pdate` `pdate` INTEGER DEFAULT 0;\n\nALTER TABLE `photo_album` DROP FOREIGN KEY `photo_album_FK_1`;\n\nALTER TABLE `photo_album` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `photo_album` CHANGE `pdate` `pdate` INTEGER DEFAULT 0;\n\nALTER TABLE `shopping_log` DROP FOREIGN KEY `shopping_log_FK_1`;\n\nALTER TABLE `shopping_log` CHANGE `wall_id` `wall_id` INTEGER DEFAULT 0;\n\nALTER TABLE `shopping_log` CHANGE `artist_id` `artist_id` INTEGER DEFAULT 0;\n\nALTER TABLE `shopping_log` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `shopping_log` CHANGE `album_id` `album_id` INTEGER DEFAULT 0;\n\nALTER TABLE `shopping_log` CHANGE `music_id` `music_id` INTEGER DEFAULT 0;\n\nALTER TABLE `shopping_log` CHANGE `video_id` `video_id` INTEGER DEFAULT 0;\n\nALTER TABLE `shopping_log` CHANGE `event_id` `event_id` INTEGER DEFAULT 0;\n\nALTER TABLE `shopping_log` CHANGE `pdate` `pdate` INTEGER DEFAULT 0;\n\nALTER TABLE `user` CHANGE `last_login` `last_login` INTEGER DEFAULT 0;\n\nALTER TABLE `user` CHANGE `last_reload` `last_reload` INTEGER DEFAULT 0;\n\nALTER TABLE `user` CHANGE `reg_date` `reg_date` INTEGER DEFAULT 0;\n\nALTER TABLE `user_follow` DROP FOREIGN KEY `user_follow_FK_1`;\n\nALTER TABLE `user_follow` DROP FOREIGN KEY `user_follow_FK_2`;\n\nALTER TABLE `user_follow` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `user_follow` CHANGE `user_id_follow` `user_id_follow` INTEGER DEFAULT 0;\n\nALTER TABLE `video` DROP FOREIGN KEY `video_FK_1`;\n\nALTER TABLE `video` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `video` CHANGE `pdate` `pdate` INTEGER DEFAULT 0;\n\nALTER TABLE `video_purchase` DROP FOREIGN KEY `video_purchase_FK_1`;\n\nALTER TABLE `video_purchase` DROP FOREIGN KEY `video_purchase_FK_2`;\n\nALTER TABLE `video_purchase` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `video_purchase` CHANGE `video_id` `video_id` INTEGER DEFAULT 0;\n\nALTER TABLE `video_purchase` CHANGE `pdate` `pdate` INTEGER DEFAULT 0;\n\nALTER TABLE `wall` DROP FOREIGN KEY `wall_FK_1`;\n\nALTER TABLE `wall` DROP FOREIGN KEY `wall_FK_2`;\n\nALTER TABLE `wall` CHANGE `user_id` `user_id` INTEGER DEFAULT 0;\n\nALTER TABLE `wall` CHANGE `user_id_from` `user_id_from` INTEGER DEFAULT 0;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n\t}", "public function beforeSave()\n {\n if ($this->parent_id == 0) {\n $this->parent_id = null;\n }\n }", "function isFK(){\n\t\treturn $this->remote_field != '' ;\n\t}", "public function clearAction()\n {\n $this->container->get('dbal_connection')->executeQuery('SET FOREIGN_KEY_CHECKS = 0');\n $this->container->get('dbal_connection')->executeQuery('TRUNCATE TABLE s_plugin_mailcatcher_attachments');\n $this->container->get('dbal_connection')->executeQuery('TRUNCATE TABLE s_plugin_mailcatcher');\n $this->container->get('dbal_connection')->executeQuery('SET FOREIGN_KEY_CHECKS = 1');\n }", "public function afterSave()\n {\n foreach ($this->relations as $rel) {\n if ($this->_settings[$rel['name']][0] === CActiveRecord::HAS_MANY ||\n $this->_settings[$rel['name']][0] === CActiveRecord::HAS_ONE\n ) {\n // If set delete option.\n if (array_key_exists('delete', $rel) && $rel['delete'] === true) {\n // Find all related models with null ID link.\n $deleteModels = call_user_func($this->_settings[$rel['name']][1] . '::model')->findAllByAttributes(array($this->_settings[$rel['name']][2] => null));\n foreach ($deleteModels as $m) {\n $m->delete();\n }\n }\n }\n }\n }", "function cleanOrphan()\n {\n\t parent::cleanOrphan($this->db->prefix(\"xf_forums\"), \"forum_id\");\n\t parent::cleanOrphan($this->db->prefix(\"xf_posts\"), \"topic_id\");\n\t \n\t return true;\n }", "public function testForeignKeyWithOnDelete()\n {\n $statement = (new CreateTable($this->mockConnection));\n $return = $statement->foreignKey('column', 'table', 'id', 'cascade');\n $array = $statement->toArray();\n\n $this->assertInstanceOf(CreateTable::class, $return);\n $this->assertEquals([\n 'constraints' => [\n [\n 'type' => 'foreignKey',\n 'name' => null,\n 'columns' => ['column'],\n 'referenceTable' => 'table',\n 'referenceColumns' => ['id'],\n 'onDelete' => 'cascade',\n 'onUpdate' => null,\n ]\n ],\n ], $array);\n }", "public function getUpSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `community_section`\n\n DROP `f_min_lot_size_front_entr`,\n\n DROP `f_min_lot_size_side_entry`,\n\n DROP `f_min_lot_size_rear_entry`,\n\n DROP `f_comments`,\n\n DROP `f_tfg_zoning_juris_dicti`,\n\n DROP `f_tfg_zoning_classifica`,\n\n DROP `f_tfg_front_yard_min`,\n\n DROP `f_tfg_side_yard_minimum`,\n\n DROP `f_tfg_combined_side_mini`,\n\n DROP `f_tfg_rear_yard_minimum`,\n\n DROP `f_tfg_sideon_corner_mini`,\n\n DROP `f_width_at_setback1`,\n\n DROP `f_width_at_setback2`,\n\n DROP `f_tfg_width_at_setback`,\n\n DROP `f_side_next_to_street1`,\n\n DROP `f_side_next_to_street2`,\n\n DROP `f_tfg_side_next_to_street`,\n\n DROP `f_min_sqft_per_lot`,\n\n DROP `f_min_sq_ft_ranch`,\n\n DROP `f_min_sq_ft2_story`,\n\n DROP `f_min_sq_ft2_story1_maste`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function testQuarantineUpsert()\n {\n\n }", "protected function constrain()\n {\n $this->table->where($this->foreign_key(), '=', $this->base->get_key());\n }", "public function ensureConsistency()\n {\n if ($this->aSociete !== null && $this->soc_id_fk !== $this->aSociete->getID()) {\n $this->aSociete = null;\n }\n if ($this->aMTransport !== null && $this->transport_fk !== $this->aMTransport->getMTransport()) {\n $this->aMTransport = null;\n }\n }", "function truncateData(){\n\t\t$userid=$GLOBALS['username'];\n mysql_query(\"SET FOREIGN_KEY_CHECKS=0;\");\n\t\t$truncateSource = mysql_query(\"TRUNCATE TABLE \".$userid.\"nertag\") or die(mysql_error());\n\t\t$truncateTarget = mysql_query(\"TRUNCATE TABLE \".$userid.\"sentences\") or die(mysql_error());\n mysql_query(\"SET FOREIGN_KEY_CHECKS=1;\");\n}", "public function wipeAll() {\n\t\tforeach($this->getTables() as $t) {\n\t\t\tforeach($this->getKeys($t) as $k) {\n\t\t\t\t$this->adapter->exec(\"ALTER TABLE \\\"{$k['FKTABLE_NAME']}\\\" DROP FOREIGN KEY \\\"{$k['FK_NAME']}\\\"\");\n\t\t\t}\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t\tforeach($this->getTables() as $t) {\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t}", "function doRealDelete()\n {\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n }", "public function cleanRoleAndPermissionTables() : void\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('roles')->truncate();\n DB::table('permissions')->truncate();\n DB::table('role_has_permissions')->truncate();\n DB::table('model_has_roles')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `community_section`\n\n ADD `f_min_lot_size_front_entr` INTEGER AFTER `section_name`,\n\n ADD `f_min_lot_size_side_entry` INTEGER AFTER `f_min_lot_size_front_entr`,\n\n ADD `f_min_lot_size_rear_entry` INTEGER AFTER `f_min_lot_size_side_entry`,\n\n ADD `f_comments` TEXT AFTER `f_min_lot_size_rear_entry`,\n\n ADD `f_tfg_zoning_juris_dicti` VARCHAR(51) AFTER `f_comments`,\n\n ADD `f_tfg_zoning_classifica` VARCHAR(21) AFTER `f_tfg_zoning_juris_dicti`,\n\n ADD `f_tfg_front_yard_min` VARCHAR(21) AFTER `f_tfg_zoning_classifica`,\n\n ADD `f_tfg_side_yard_minimum` VARCHAR(21) AFTER `f_tfg_front_yard_min`,\n\n ADD `f_tfg_combined_side_mini` VARCHAR(21) AFTER `f_tfg_side_yard_minimum`,\n\n ADD `f_tfg_rear_yard_minimum` VARCHAR(21) AFTER `f_tfg_combined_side_mini`,\n\n ADD `f_tfg_sideon_corner_mini` VARCHAR(21) AFTER `f_tfg_rear_yard_minimum`,\n\n ADD `f_width_at_setback1` VARCHAR(21) AFTER `f_tfg_sideon_corner_mini`,\n\n ADD `f_width_at_setback2` VARCHAR(21) AFTER `f_width_at_setback1`,\n\n ADD `f_tfg_width_at_setback` VARCHAR(21) AFTER `f_width_at_setback2`,\n\n ADD `f_side_next_to_street1` VARCHAR(21) AFTER `f_tfg_width_at_setback`,\n\n ADD `f_side_next_to_street2` VARCHAR(21) AFTER `f_side_next_to_street1`,\n\n ADD `f_tfg_side_next_to_street` VARCHAR(21) AFTER `f_side_next_to_street2`,\n\n ADD `f_min_sqft_per_lot` INTEGER AFTER `f_tfg_side_next_to_street`,\n\n ADD `f_min_sq_ft_ranch` INTEGER AFTER `f_min_sqft_per_lot`,\n\n ADD `f_min_sq_ft2_story` INTEGER AFTER `f_min_sq_ft_ranch`,\n\n ADD `f_min_sq_ft2_story1_maste` INTEGER AFTER `f_min_sq_ft2_story`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function afterDelete()\n {\n \\PProject::model()->updateAll([\n 'artist_id' => new \\CDbExpression('NULL')\n ], 'artist_id = :artist_id', [\n ':artist_id' => $this->id\n ]);\n }", "public function getForeignKeys(){\n \n }", "public function testDeleteCategory()\n {\n $category = new Category();\n\n Yii::$app->db->createCommand('set foreign_key_checks=0')->execute();\n $category->setAttributes(['name' => 'name','class' => 'active','featured_campaign_id' => 1]);\n $category->save(false);\n $this->tester->canSeeRecord('backend\\models\\Category',array('name' => 'name','class' => 'active','featured_campaign_id' => 1));\n $category->delete();\n $this->assertFalse($category == null);\n Yii::$app->db->createCommand('set foreign_key_checks=1')->execute();\n }", "function deletelinks($id_ex){\n $db = connect_start();\n\n $db->exec(\"DELETE FROM links WHERE id_exercice = '$id_ex'\");\n $db->exec(\"ALTER TABLE links AUTO_INCREMENT = 0\");\n}", "public function safeUp()\n\t{\n $this->execute(\"\n /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n /*!40101 SET NAMES utf8mb4 */;\n /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\n\n DROP TABLE IF EXISTS `Rating`;\n DROP TABLE IF EXISTS `RatingParams`;\n DROP TABLE IF EXISTS `RatingParamsValues`;\n\n /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;\n /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;\n /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n \");\n\t}", "public function testSaveCategory()\n {\n $category = new Category();\n\n Yii::$app->db->createCommand('set foreign_key_checks=0')->execute();\n $category->setAttributes(['name' => 'name','class' => 'active','featured_campaign_id' => 1]);\n $category->save(false);\n $this->tester->canSeeRecord('backend\\models\\Category',array('name' => 'name','class' => 'active','featured_campaign_id' => 1));\n Yii::$app->db->createCommand('set foreign_key_checks=1')->execute();\n }", "public function isForeignKey()\n {\n\treturn false;\n }", "public function beforeDelete(){\r\n //Ok he has the right to do that - remove all the ACL-objects associated with this object\r\n $class = Strategy::getClass('Aro');\r\n $aro = $class::model()->find('model = :model AND foreign_key = :key', array(':model' => get_class( $this), ':key' => $this->getPrimaryKey()));\r\n \r\n if(!$aro)\r\n throw new RuntimeException('No associated Aro-Collection!');\r\n \r\n $transaction = Yii::app()->db->beginTransaction();\r\n try{\r\n $suc =$aro->delete()&& parent::beforeDelete();\r\n $transaction->commit();\r\n return $suc;\r\n }\r\n catch(Exception $e){\r\n $transaction->rollback();\r\n throw $e;\r\n }\r\n }", "public function getUpSQL()\n\t{\n\t\treturn array (\n 'propel' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP INDEX `facebook_id` ON `collector`;\nDROP INDEX `collector_FI_1` ON `collector`;\nDROP INDEX `collector_U_1` ON `collector`;\nDROP INDEX `collector_U_2` ON `collector`;\n\nCREATE UNIQUE INDEX `collector_U_1` ON `collector` (`graph_id`);\nCREATE UNIQUE INDEX `collector_U_2` ON `collector` (`facebook_id`);\nCREATE UNIQUE INDEX `collector_U_3` ON `collector` (`username`);\nCREATE UNIQUE INDEX `collector_U_4` ON `collector` (`display_name`);\nCREATE UNIQUE INDEX `collector_U_5` ON `collector` (`slug`);\nCREATE UNIQUE INDEX `collector_U_6` ON `collector` (`email`);\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n\t}", "public function forceDelete()\n {\n //\n }" ]
[ "0.80160594", "0.7893242", "0.7484943", "0.74503255", "0.7053146", "0.69078195", "0.6838983", "0.68052393", "0.67678577", "0.6501624", "0.6485554", "0.64761555", "0.63847595", "0.6377485", "0.6322503", "0.6299462", "0.62988484", "0.6266875", "0.62115693", "0.61777693", "0.6123821", "0.61141664", "0.61005515", "0.6079841", "0.6020201", "0.6013016", "0.60076547", "0.59730506", "0.59574956", "0.5933535", "0.5898098", "0.58285236", "0.58241266", "0.58213586", "0.5808467", "0.58078283", "0.57991445", "0.5785963", "0.5740492", "0.56944454", "0.56904435", "0.5665304", "0.56483984", "0.5637652", "0.5626421", "0.56103", "0.5586545", "0.5579551", "0.5576341", "0.5568505", "0.55664444", "0.5565341", "0.5561175", "0.55580837", "0.55556035", "0.5545728", "0.55225277", "0.5521872", "0.5520347", "0.54922456", "0.5476708", "0.54717916", "0.5461871", "0.5438845", "0.5437021", "0.541805", "0.54144716", "0.54137003", "0.54021376", "0.5352758", "0.53422034", "0.53393096", "0.5338385", "0.53187203", "0.5307105", "0.5305982", "0.52873516", "0.5282671", "0.5281057", "0.52742887", "0.52686197", "0.52457047", "0.52453196", "0.5243669", "0.52411073", "0.5238895", "0.5237223", "0.52281505", "0.5219968", "0.5205183", "0.5201436", "0.5198138", "0.51946163", "0.518241", "0.51605964", "0.51532", "0.515021", "0.5143556", "0.5139388", "0.5134492" ]
0.59403026
29
Close file db connection
private function closeConnection(){ $this->file_db = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function close()\n {\n $this->db = null;\n }", "function closeDbConnection() {\n global $objDb;\n\n if (isset($objDb)) {\n @$objDb->Close();\n }\n }", "public function close(){\r\n\t\tself::$dbh = null;\r\n\t\tself::$db = null;\r\n\t}", "private function close() {\n if (!empty($this->_dbConn)) {\n pg_close($this->_dbConn);\n unset($this->_dbConn);\n }\n }", "public function close_connection()\n {\n $this->db = null;\n }", "public function CloseConnection()\n {\n $this->db = null;\n }", "private function closeConnection(){\n $this->db =null;\n }", "function DbClose() {\n mysqli_close($this->link);\n }", "public static function close()\n {\n static::$_db = null;\n }", "function close_db(){\n $this->_dbh = null;\n \n }", "function close_db(){\n $this->_dbh = null;\n \n }", "protected function closeConection()\n {\n $this->db->close();\n unset($this->db);\n unset($this->satz);\n }", "public function close()\n {\n $this->fclose();\n }", "public function closeDb(){\n $this->db->close();\n }", "public function close()\n {\n if (isset($this->handle)) {\n $this->stats->benchmark('bedrockWorkerManager.db.close', function () {\n $startTime = microtime(true);\n $this->handle->close();\n unset($this->handle);\n });\n }\n }", "function closeDB() {\r\n global $db;\r\n try {\r\n if(is_resource($db)) {\r\n $db->close();\r\n }\r\n } catch (Exception $e)\r\n {\r\n throw new Exception( 'Error closing database', 0, $e);\r\n }\r\n}", "public function close(){\n $this->db->close();\n }", "private function close_connection(){\n\t\t$this -> conn -> close();\n\t}", "function __destruct() {\n $this->db->close();\n }", "function __destruct() {\n $this->db->close();\n }", "function fvls_db_close(){\n\t\tglobal $FLVS_db_link;\n\t\t$return = $FLVS_db_link->close();\t// Close the connection and store success status (boolean response)\n\t\tif( $return )\n\t\t\t$FLVS_db_link = NULL;\t// Closing the connectino doesn't change the variable resource type - so we need to manually alter it\n\n\t\treturn $return;\t// Kick back out the boolean status\n\t}", "protected function _closeFile() {}", "protected function _closeFile() {}", "function closedbconnection() {\r\n\t\t\r\n\t\t\r\n #if ($this->dbconnection = TRUE) {\r\n mysql_close($this->dbconnection);\r\n #}\r\n \r\n }", "public function __destruct(){\n $this->db->close();\n }", "function close_db() {\n\t\tmysql_close($this -> dbc);\n\t}", "function __destruct() {\n $this->db->close();\n }", "public function close(){\n $this->database->close();\n $this->connected=false;\n }", "function db_close()\n{\n\tglobal $db;\n\t$db->close();\n}", "public function closeConnection()\n {\n foreach ($this->db as $item) {\n $item->closeConnection();\n }\n\n }", "function close()\n\t{\n\t\tmysql_close($this->db_server_link);\n\t}", "public function closeConnection() {\n if ($this->conn) {\n $this->log('Closing Connection');\n fclose(self::getInstance()->getConnection());\n $this->conn = null;\n exit();\n }\n }", "function close()\n\t{\n\t\t@mysqli_close($this->dbLink);\n\t}", "public function close()\n\t{\n\t\t\n\t\t//disconnect db\n\t\tmysql_close($this->link);\n\t\t\n\t}", "function close() {\n mysql_close($this->db);\n }", "static function close()\n\t{\n\t\tforeach (self::$dbConnections as $dbName => $db)\n\t\t{\n\t\t\t$db->close();\n\t\t\tunset(self::$dbConnections[$dbName]);\n\t\t}\n\n\t\tforeach(self::$extraConnections as $index => $db)\n\t\t{\n\t\t\t$db->close();\n\t\t\tunset(self::$extraConnections[$index]);\n\t\t}\n\t}", "protected function __destruct()\n {\n if (self::$db) self::$db->close();\n }", "protected function closeFile() {}", "public function close_db_connection(){\n\t\n\t\tif(!$this->persist_connection){\n\t\n\t\t\tif(!@mysql_close($this->connection)){\n\t\t\t\t\t\n\t\t\t\tthrow new Exception(\"Connection close failed &nbsp;: &nbsp \" . $this->server . \"\");\n\t\t\t\t\t\n\t\t\t}\n\t\n\t\t}else{\n\t\n\t\t\tthrow new Exception(\"Persistant connection can't be closed &nbsp;: &nbsp \" . $this->server . \" \");\n\t\t}\n\t}", "public function close()\n {\n $this->connection = null;\n }", "private function _closeConnection() {\n\t\tif (is_resource($this->connection)) {\n\t\t\t// close connection\n\t\t\t@odbc_close($this->connection);\n\t\t}\n\t}", "function closedb($sql)\r\n{\r\n if ($sql) {\r\n // Close resources\r\n $sql->Close();\r\n $sql->mode_id('r'); // switch to alternate mode, if any\r\n $sql->Close();\r\n }\r\n}", "function __destruct()\n\t{\n\t\t$this->db->close();\n\t}", "function __destruct()\n\t{\n\t\t$this->dblink->close();\n\t}", "private function CloseDbConnection()\n\t{\n\t\tmysqli_close($this->DB_CONN);\n\t}", "function end() {\n\t\t\t$this->db->close();\n\t\t}", "public function conn_close(){\n $this->conn = null;\n }", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "function database_close()\n {\n // DO DATABASE QUERY LOGGING\n if( $this->log_stats ) $this->database_log_stats();\n if( $this->log_stats ) $this->database_log_stats_cleanup();\n \n\t return mysql_close($this->database_connection);\n\t}", "public function db_close(){\n mysqli_close($this->mysql);\n }", "private function close_connection() {\n\t\t$this->conn->close();\n\t}", "protected function _close()\n\t{\n\t\t$this->connID->close();\n\t}", "private function close_connection() \n\t\t{\n\t\t\t$this->conn->close();\n\t\t}", "function DBClose(\\Simplon\\Mysql\\Mysql $dbh) {\n $dbh->close();\n}", "public function closeConnection ()\n {\n $this->_connection = null;\n }", "public function __destruct()\n {\n $this->db->close($this->conn);\n }", "public function __destruct()\n {\n parent::$db->closeConnection();\n }", "public function closeConnection()\n \t{\n \t\t$this->connection = null;\n \t}", "function db_disconnect()\n\t{\n\t\tpg_close($this->db_connection);\n\t}", "public function closeConn(){\n $this->conn->close();\n }", "function __destruct()\t{\n\t\t$this->db_conn->close();\n\t}", "function close() {\r\n\t\t\tif ( $this->_conn != null ) {\r\n\t\t\t\t$this->_conn = null;\r\n\t\t\t\t@OCILogoff( $this->_conn );\r\n\t\t\t}\r\n\t\t}", "function db_close()\n\n\t{\n\n\t\t$param_array = func_get_args();\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::db_close() - PARAMETER LIST : ', $param_array);\n\n\n\n\t\t$this->optimize_database();//12022007\n\n\t\tmysql_close($this->dbresource_id);\n\n\t\t\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::db_close() - Return Value : ', 'Closing Database Connection and Returning Void.', true);\n\n\t\t\n\n\t}", "function close() {\n // closing db connection\n mysql_close();\n }", "public function close()\n\t{\n\t\t$this->connection->close();\n\t}", "public function fclose(): void {\n fclose($this->file);\n }", "function ssDbClose($dbConnection) {\n mysql_close($dbConnection);\n}", "protected function __destruct() \r\n {\r\n $this->_database->close();\r\n }", "function closeDBConnection() {\n\t\tglobal $dbh;\n\t\tif($dbh) {\n\t\t\t/*if(mysqli_close($dbh)) {\n\t\t\t\tprint \"Close successfull else {\";\n\t\t\t} else {\n\t\t\t\tprint \"Cannot Close successfull else {\";\n\t\t\t}\t*/\n\t\t\tmysqli_close($dbh);\n\t\t\t$dbh = null;\n\t\t}\n\t}", "public function closeFile(){\n if(is_resource($this->_filePointer) === true){\n fclose($this->_filePointer);\n }\n }", "protected function closeConnection()\n\t{\n\t\t$this->connection->close();\n\t}", "function closedb(){\r\n\t\tif($this->socket)\r\n\t\t\t\r\n\t\t\tmysqli_close($this->socket);\r\n\t\t\t$this->connected = false;\r\n\t}", "public function __destruct()\n\t{\n\t\tif ($this->_connection)\n\t\t{\n\t\t\tfclose($this->_connection);\n\t\t}\n\t}", "function closeDbConnection() {\n //Close the connection by setting the DBH to null if it exists\n if(isset($DBH)){\n $DBH = null; \n }\n}", "public function closeDatabase(){\r\n\t\t\tmysqli_close($this->conn);\r\n\t\t}", "abstract public function close();", "abstract public function close();", "abstract public function close();", "abstract public function close();" ]
[ "0.74138427", "0.7256991", "0.7221398", "0.7221372", "0.71733254", "0.7165144", "0.7143436", "0.7102166", "0.7099516", "0.7094162", "0.7094162", "0.7090901", "0.70108014", "0.69957393", "0.6973319", "0.6968854", "0.6959267", "0.6924283", "0.6920764", "0.6920764", "0.6912208", "0.68997955", "0.68997955", "0.6872418", "0.68703765", "0.68650585", "0.6864749", "0.68629223", "0.6859705", "0.6850409", "0.6832434", "0.68295485", "0.68218917", "0.68215287", "0.6800334", "0.67838717", "0.6777943", "0.6767475", "0.67622", "0.6750661", "0.67481035", "0.6745362", "0.6739083", "0.6736522", "0.6735935", "0.67345023", "0.672743", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6710863", "0.6705908", "0.6704868", "0.6680565", "0.66681105", "0.6657058", "0.6644361", "0.6634111", "0.663404", "0.6630362", "0.6628406", "0.6612478", "0.6611996", "0.65977234", "0.6592268", "0.65921336", "0.65886945", "0.6588654", "0.6587968", "0.6586307", "0.6574936", "0.65726316", "0.6566669", "0.6554884", "0.6546168", "0.6543989", "0.65401804", "0.65393406", "0.6528952", "0.6528952", "0.6528952", "0.6528952" ]
0.84680706
0
Display a listing of the resource.
public function index(Product $product) { $prod_var = Productvariant::with('product', 'productmirrors')->where('product_id', $product->id)->get(); $data = compact('product', 'prod_var'); return view('backend.inc.products.indexproductvariant', $data); }
{ "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(Product $product) { $categories = Category::all(); $lenses = Lense::all(); $mirrors = Mirror::all(); $data = compact('categories', 'product', 'lenses', 'mirrors'); return view('backend.inc.products.productvariant', $data); }
{ "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 // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('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 //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\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(\"familiasPrograma.create\");\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\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 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 $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\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 create()\n {\n return view('student::students.student.create');\n }", "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}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Product $product, Request $request) { $this->validate($request, [ 'lense_id' => 'required', 'addmore.*.mirror_id' => 'required', 'addmore.*.price' => 'required' ]); $prod_var = Productvariant::create([ 'product_id' => $product->id, 'lense_id' => $request->lense_id, ]); foreach ($request->addmore as $key => $value) { Productmirrors::create([ 'prod_var' => $prod_var->id, 'mirror_id' => $value['mirror_id'], 'price' => $value['price'] ]); } return redirect(route('admin.productvariant.index', $product->id)); }
{ "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(Productvariant $id) { // }
{ "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(Product $product, $id) { $categories = Category::all(); $prod_var = Productvariant::find($id); $prod_mirror = Productmirrors::where('prod_var', $prod_var->id)->get(); $lenses = Lense::all(); $mirrors = Mirror::all(); $data = compact('categories', 'product', 'lenses', 'mirrors', 'prod_var', 'prod_mirror'); return view('backend.inc.products.productvariant', $data); }
{ "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, Product $product, $id) { $prod_var = Productvariant::find($id); $prod_mirror = Productmirrors::where('prod_var', $prod_var->id)->get(); $prod_var->fill([ 'product_id' => $product->id, 'lense_id' => $request->lense_id, ]); $prod_mirror->fill([ 'prod_var' => $prod_var->id, 'mirror_id' => $request->mirror_id, 'price' => $request->price ]); $prod_var->save(); $prod_mirror->save(); return redirect(route('admin.productvariant.index', $product->id)); }
{ "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(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(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(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);", "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 }", "public function update($request, $id);", "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 }", "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 }", "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 }", "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 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 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 abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "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($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "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() {\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 }", "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() {\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 //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(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 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 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, $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.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Product $product, $id) { $var_id = Productvariant::find($id); $var_id->delete(); return redirect(route('admin.productvariant.index', $product->id)); }
{ "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
Hexa to RGBA Convector
private function mombo_hex_2_rgba($color, $opacity = false) { $default = 'rgb(0,0,0)'; //Return default if no color provided if(empty($color)) return $default; //Sanitize $color if "#" is provided if ($color[0] == '#' ) { $color = substr( $color, 1 ); } //Check if color has 6 or 3 characters and get values if (strlen($color) == 6) { $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] ); } elseif ( strlen( $color ) == 3 ) { $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] ); } else { return $default; } //Convert hexadec to rgb $rgb = array_map('hexdec', $hex); //Check if opacity is set(rgba or rgb) if($opacity){ if(abs($opacity) > 1) $opacity = 1.0; $output = 'rgba('.implode(",",$rgb).','.$opacity.')'; } else { $output = 'rgb('.implode(",",$rgb).')'; } //Return rgb(a) color string return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hex2rgb($hex){\r\n //$hex = strtoupper($str_enc_hex);\r\n //echo $hex;\r\n $hex = str_replace('#', '', $hex);\r\n $red=-1;\r\n $green=-1;\r\n $blue=-1;\r\n if(strlen($hex)==3){\r\n $red=hexdec($hex[0].$hex[0]);\r\n $green=hexdec($hex[1].$hex[1]);\r\n $blue=hexdec($hex[2].$hex[2]);\r\n } else if(strlen($hex)==6){\r\n $red=hexdec($hex[0].$hex[1]);\r\n $green=hexdec($hex[2].$hex[3]);\r\n $blue=hexdec($hex[4].$hex[5]);\r\n }\r\n //print_r(array($red, $green, $blue));\r\n return array($red, $green, $blue);\r\n}", "public static function hexToRgb($hex) {}", "function HexToRGB($hex){\n\t$hex=str_replace('#','',$hex);\n\t$color=array();\n\tif(strlen($hex)==3){\n\t\t$color['r']=hexdec(substr($hex,0,1).substr($hex,0,1));\n\t\t$color['g']=hexdec(substr($hex,1,1).substr($hex,1,1));\n\t\t$color['b']=hexdec(substr($hex,2,1).substr($hex,2,1));\n\t}elseif(strlen($hex)==6){\n\t\t$color['r']=hexdec(substr($hex,0,2));\n\t\t$color['g']=hexdec(substr($hex,2,2));\n\t\t$color['b']=hexdec(substr($hex,4,2));\n\t}\n\treturn $color;\n}", "function HexToRGB($hex){\n\t$hex=str_replace('#','',$hex);\n\t$color=array();\n\tif(strlen($hex)==3){\n\t\t$color['r']=hexdec(substr($hex,0,1).substr($hex,0,1));\n\t\t$color['g']=hexdec(substr($hex,1,1).substr($hex,1,1));\n\t\t$color['b']=hexdec(substr($hex,2,1).substr($hex,2,1));\n\t}elseif(strlen($hex)==6){\n\t\t$color['r']=hexdec(substr($hex,0,2));\n\t\t$color['g']=hexdec(substr($hex,2,2));\n\t\t$color['b']=hexdec(substr($hex,4,2));\n\t}\n\treturn $color;\n}", "function ts_hex_to_rgb($hex,$transparency = '') {\r\n $hex = str_replace(\"#\", \"\", $hex);\r\n\r\n if(strlen($hex) == 3) {\r\n $r = hexdec(substr($hex,0,1).substr($hex,0,1));\r\n $g = hexdec(substr($hex,1,1).substr($hex,1,1));\r\n $b = hexdec(substr($hex,2,1).substr($hex,2,1));\r\n } else {\r\n $r = hexdec(substr($hex,0,2));\r\n $g = hexdec(substr($hex,2,2));\r\n $b = hexdec(substr($hex,4,2));\r\n }\r\n $rgb = array($r, $g, $b);\r\n return 'rgba('.implode(\",\", $rgb).(!empty($transparency) ? ', '.$transparency : '').')'; \r\n}", "function hex2rgb($hex) {\n\n if(strlen($hex) == 3) {\n $r = hexdec(substr($hex,0,1).substr($hex,0,1));\n $g = hexdec(substr($hex,1,1).substr($hex,1,1));\n $b = hexdec(substr($hex,2,1).substr($hex,2,1));\n } else {\n $r = hexdec(substr($hex,0,2));\n $g = hexdec(substr($hex,2,2));\n $b = hexdec(substr($hex,4,2));\n }\n $rgb = array($r, $g, $b);\n //return implode(\",\", $rgb); // returns the rgb values separated by commas\n return $rgb; // returns an array with the rgb values\n}", "function HexToRGB($hex) {\n $hex = ereg_replace(\"#\", \"\", $hex);\n $color = array();\n \n if(strlen($hex) == 3) {\n $color['r'] = hexdec(substr($hex, 0, 1) . $r);\n $color['g'] = hexdec(substr($hex, 1, 1) . $g);\n $color['b'] = hexdec(substr($hex, 2, 1) . $b);\n }\n else if(strlen($hex) == 6) {\n $color['r'] = hexdec(substr($hex, 0, 2));\n $color['g'] = hexdec(substr($hex, 2, 2));\n $color['b'] = hexdec(substr($hex, 4, 2));\n }\n \n return $color;\n }", "function colorFromHex($img, $hexColor)\r\n{\r\n while (strlen($hexColor) > 6) { $hexColor = substr($hexColor, 1); };\r\n sscanf($hexColor, \"%2x%2x%2x\", $red, $green, $blue);\r\n return ImageColorAllocate($img, $red, $green, $blue);\r\n}", "function uabb_parse_color_to_hex( $code = '' ) {\n\t$color = '';\n\t$hex = '';\n\tif( $code != '' ) {\n\t\tif ( strpos( $code, 'rgba' ) !== false ) {\n\t\t\t$code = ltrim( $code, 'rgba(' );\n\t\t\t$code = rtrim( $code, ')' );\n\t\t\t$rgb = explode( ',', $code );\n\t\t\t$hex .= str_pad(dechex($rgb[0]), 2, \"0\", STR_PAD_LEFT);\n\t\t\t$hex .= str_pad(dechex($rgb[1]), 2, \"0\", STR_PAD_LEFT);\n\t\t\t$hex .= str_pad(dechex($rgb[2]), 2, \"0\", STR_PAD_LEFT);\n\t\t\t$color = $hex;\n\t\t} else {\n\t\t\t$color = ltrim( $code, '#' );\n\t\t}\n\t}\n\t//var_dump($hex); die;\n\treturn $color;\n}", "function hex2rgb($hex) {\n\t\t $hex = str_replace('#', '', $hex);\n\t\t if (strlen($hex) === 3) {\n\t\t\t$r = substr($hex, 0, 1);\n\t\t\t$g = substr($hex, 1, 1);\n\t\t\t$b = substr($hex, 2, 1);\n\t\t\t$r = hexdec($r . $r);\n\t\t\t$g = hexdec($g . $g);\n\t\t\t$b = hexdec($b. $b);\n\t\t } else {\n\t\t\t$r = hexdec(substr($hex, 0, 2));\n\t\t\t$g = hexdec(substr($hex, 2, 2));\n\t\t\t$b = hexdec(substr($hex, 4, 2));\n\t\t }\n\t\t return implode(',', array($r, $g, $b));\n\t\t}", "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}", "function skudo_hex2rgb($hex = \"000000\") {\n\t\tif (is_array($hex)) $hex = \"000000\";\n\t\t$hex = str_replace(\"#\", \"\", $hex);\n\t\t\n\t\tif(strlen($hex) == 3) {\n\t\t\t$r = hexdec(substr($hex,0,1).substr($hex,0,1));\n\t\t\t$g = hexdec(substr($hex,1,1).substr($hex,1,1));\n\t\t\t$b = hexdec(substr($hex,2,1).substr($hex,2,1));\n\t\t} else {\n\t\t\t$r = hexdec(substr($hex,0,2));\n\t\t\t$g = hexdec(substr($hex,2,2));\n\t\t\t$b = hexdec(substr($hex,4,2));\n\t\t}\n\t\t$rgb = array($r, $g, $b);\n\t\t//return implode(\",\", $rgb); // returns the rgb values separated by commas\n\t\treturn $rgb; // returns an array with the rgb values\n\t}", "function astra_rgba2hex( $string, $include_alpha = false ) {\n\t_deprecated_function( __FUNCTION__, '3.6.2', 'astra_addon_rgba2hex()' );\n\treturn astra_addon_rgba2hex( $string, $include_alpha = false );\n}", "function hexcolor($image, $hex) {\n $i = hexdec($hex);\n return imagecolorallocate($image, 0xFF & ($i >> 0x10), 0xFF & ($i >> 0x8), 0xFF & ($i));\n}", "protected function hex2rgb()\n {\n $hex = str_replace('#', '', $this->fontColor);\n\n if (strlen($hex) == 3) {\n $r = hexdec(substr($hex, 0, 1).substr($hex, 0, 1));\n $g = hexdec(substr($hex, 1, 1).substr($hex, 1, 1));\n $b = hexdec(substr($hex, 2, 1).substr($hex, 2, 1));\n } else {\n $r = hexdec(substr($hex, 0, 2));\n $g = hexdec(substr($hex, 2, 2));\n $b = hexdec(substr($hex, 4, 2));\n }\n $rgb = [$r, $g, $b];\n //return implode(\",\", $rgb); // returns the rgb values separated by commas\n return $rgb; // returns an array with the rgb values\n }", "function hex2rgb($hex) {\n $hex = str_replace(\"#\", \"\", $hex);\n\n if(strlen($hex) == 3) {\n $r = hexdec(substr($hex,0,1).substr($hex,0,1));\n $g = hexdec(substr($hex,1,1).substr($hex,1,1));\n $b = hexdec(substr($hex,2,1).substr($hex,2,1));\n } else {\n $r = hexdec(substr($hex,0,2));\n $g = hexdec(substr($hex,2,2));\n $b = hexdec(substr($hex,4,2));\n }\n $rgb = array($r, $g, $b);\n return implode(\",\", $rgb); // returns the rgb values separated by commas\n // return $rgb; // returns an array with the rgb values\n}", "private function rgb_hex_to_dex($hex)\n {\n $hex = ltrim($hex, '#');\n\n // Convert 3-digits to 6\n if (strlen($hex) == 3) {\n $hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2];\n }\n return array(\n 'red' => hexdec(substr($hex, 0, 2)),\n 'green' => hexdec(substr($hex, 2, 2)),\n 'blue' => hexdec(substr($hex, 4, 2)),\n );\n }", "function hexrgb($hex){\n $hex = ($hex[0] == '#') ? substr($hex, 1) : $hex;\n\n if (strlen($hex) == 3){\n list($r, $g, $b) = array($hex[0].$hex[0], $hex[1].$hex[1], $hex[2].$hex[2]);\n } else if (strlen($hex) == 6){\n list($r, $g, $b) = array($hex[0].$hex[1], $hex[2].$hex[3], $hex[4].$hex[5]);\n }\n\n if (isset($r) && isset($g) && isset($b)){\n return array(hexdec($r), hexdec($g), hexdec($b));\n } else {\n return array(0, 0, 0);\n }\n}", "function hex2rgb($hex) {\n $hex = str_replace('#', '', $hex);\n\n if (strlen($hex) == 3) {\n $r = hexdec(substr($hex, 0, 1) . substr($hex, 0, 1));\n $g = hexdec(substr($hex, 1, 1) . substr($hex, 1, 1));\n $b = hexdec(substr($hex, 2, 1) . substr($hex, 2, 1));\n } else {\n $r = hexdec(substr($hex, 0, 2));\n $g = hexdec(substr($hex, 2, 2));\n $b = hexdec(substr($hex, 4, 2));\n }\n $rgb = array($r, $g, $b);\n \n return implode(', ', $rgb); // returns a string of the rgb values separated by commas\n // return $rgb; // returns an array with the rgb values\n}", "function HexToRgb($hex): array {\n\t\t$hex = str_replace('#', '', $hex);\n\t\tif (strlen($hex) == 3) {\n\t\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\t}\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\n\t\treturn array('r' => $r, 'g' => $g, 'b' => $b);\n\t}", "function hex_to_rgb($hex)\n{\n $hex = str_replace('#', '', $hex);\n if (strlen($hex) !== 6) {\n return;\n }\n $rgb = [];\n $rgb[] = hexdec(substr($hex, 0, 2));\n $rgb[] = hexdec(substr($hex, 2, 2));\n $rgb[] = hexdec(substr($hex, 4, 2));\n return implode(',', $rgb);\n}", "public function convert(string $hex) : string\n {\n list($r, $g, $b) = sscanf(ltrim($hex, '#'), \"%02x%02x%02x\");\n return \"rgb($r, $g, $b)\";\n }", "private function hex2rgb($hex)\n\t\t\t{\n\t\t\t\t$hex = str_replace(\"#\", \"\", $hex);\n\n\t\t\t\tif (strlen($hex) == 3):\n\t\t\t\t\t\t$r = hexdec(substr($hex, 0, 1).substr($hex, 0, 1));\n\t\t\t\t\t\t$g = hexdec(substr($hex, 1, 1).substr($hex, 1, 1));\n\t\t\t\t\t\t$b = hexdec(substr($hex, 2, 1).substr($hex, 2, 1));\n\t\t\t\t\telse:\n\t\t\t\t\t\t$r = hexdec(substr($hex, 0, 2));\n\t\t\t\t\t\t$g = hexdec(substr($hex, 2, 2));\n\t\t\t\t\t\t$b = hexdec(substr($hex, 4, 2));\n\t\t\t\tendif;\n\n\t\t\t\treturn array($r, $g, $b);\n\t\t\t}", "function hex2color($str) {\n $color = hex2bin(ltrim($str, '$'));\n return ($str[0] === '$' ? unpack('V', \"$color\\0\") : unpack('N', \"\\0$color\"))[1];\n}", "function xyz_rgb($x,$y,$z) {\n\t\n\t$x /= 100; //X = From 0 to ref_X\n\t$y /= 100; //Y = From 0 to ref_Y\n\t$z /= 100; //Z = From 0 to ref_Y\n\n\t$r = $x * 3.2406 + $y * -1.5372 + $z * -0.4986;\n\t$g = $x * -0.9689 + $y * 1.8758 + $z * 0.0415;\n\t$b = $x * 0.0557 + $y * -0.2040 + $z * 1.0570;\n\n\t$r=(( $r > 0.0031308 )?(1.055 * pow($r,1/2.4 ) - 0.055):($r*12.92))*255;\n\t$g=(( $g > 0.0031308 )?(1.055 * pow($g,1/2.4 ) - 0.055):($g*12.92))*255;\n\t$b=(( $b > 0.0031308 )?(1.055 * pow($b,1/2.4 ) - 0.055):($b*12.92))*255;\n\t\n\treturn array($r,$g,$b);\n}", "public static function hex_to_rgba( $hex ) {\n\t\t$hex = str_replace( '#', '', $hex );\n\t\t$hex = strlen( $hex ) > 6 ? $hex : $hex . 'FF';\n\n\t\t$int = hexdec( $hex );\n\t\t$red = ( $int >> 24 ) & 255;\n\t\t$green = ( $int >> 16 ) & 255;\n\t\t$blue = ( $int >> 8 ) & 255;\n\t\t$alpha = floatval( $int & 255 ) / 255;\n\n\t\treturn array(\n\t\t\t'red' => $red,\n\t\t\t'green' => $green,\n\t\t\t'blue' => $blue,\n\t\t\t'alpha' => $alpha,\n\t\t);\n\t}", "function hexToRgba($hex, $opacity = 0)\n {\n $hex = str_replace(\"#\", \"\", $hex);\n\n if (strlen($hex) == 3) {\n $r = hexdec(substr($hex, 0, 1).substr($hex, 0, 1));\n $g = hexdec(substr($hex, 1, 1).substr($hex, 1, 1));\n $b = hexdec(substr($hex, 2, 1).substr($hex, 2, 1));\n } else {\n $r = hexdec(substr($hex, 0, 2));\n $g = hexdec(substr($hex, 2, 2));\n $b = hexdec(substr($hex, 4, 2));\n }\n $rgb = array($r, $g, $b);\n $opacity = ($opacity >= 0 && $opacity <= 1 && $opacity != null) ? $opacity : 1 ;\n return \"rgba(\" . implode(\",\", $rgb) . \",\" .$opacity. \")\";\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}", "public function hexToRGB($hex, $alpha = false) {\n $hex = str_replace('#', '', $hex);\n $length = strlen($hex);\n\n $rgb['r'] = hexdec($length == 6 ? substr($hex, 0, 2) : ($length == 3 ? str_repeat(substr($hex, 0, 1), 2) : 0));\n $rgb['g'] = hexdec($length == 6 ? substr($hex, 2, 2) : ($length == 3 ? str_repeat(substr($hex, 1, 1), 2) : 0));\n $rgb['b'] = hexdec($length == 6 ? substr($hex, 4, 2) : ($length == 3 ? str_repeat(substr($hex, 2, 1), 2) : 0));\n\n if ($alpha) {\n $rgb['a'] = $alpha;\n }\n\n return $rgb;\n }", "function rest_parse_hex_color($color)\n {\n }", "function hex2rgb($color)\r\n{\r\n $color = str_replace('#', '', $color);\r\n $rgb = array();\r\n\r\n if (strlen($color) != 6)\r\n {\r\n $rgb= array(0,0,0);\r\n }\r\n\r\n for ($x=0;$x<3;$x++)\r\n {\r\n $rgb[$x] = hexdec(substr($color,(2*$x),2));\r\n }\r\n\r\n return $rgb;\r\n}", "public static function HexMe(array $rgb)\n {\n if(count($rgb) > 3)\n $rgb = array_slice($rgb,0,3);\n return implode('',array_map('ColorName::ColorDechex',$rgb));\n }", "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}", "public static function HexToRGB($hex) {\n\t $hex = str_replace(\"#\", \"\", $hex);\n\t \n\t if(strlen($hex) == 3) {\n\t\t $r = hexdec(substr($hex,0,1).substr($hex,0,1));\n\t\t $g = hexdec(substr($hex,1,1).substr($hex,1,1));\n\t\t $b = hexdec(substr($hex,2,1).substr($hex,2,1));\n\t } else {\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 }\n\t $rgb = array($r, $g, $b);\n\n\t return $rgb; // returns an array with the rgb values\n\t}", "function hex2rgba( $color, $opacity = false ) {\n\n $default = 'rgb(0,0,0)';\n\n //Return default if no color provided\n if ( empty( $color ) ) {\n return $default;\n }\n\n //Sanitize $color if \"#\" is provided\n if ( $color[0] == '#' ) {\n $color = substr( $color, 1 );\n }\n\n //Check if color has 6 or 3 characters and get values\n if ( strlen( $color ) == 6 ) {\n $hex = array(\n $color[0] . $color[1],\n $color[2] . $color[3],\n $color[4] . $color[5],\n );\n } elseif ( strlen( $color ) == 3 ) {\n $hex = array(\n $color[0] . $color[0],\n $color[1] . $color[1],\n $color[2] . $color[2],\n );\n } else {\n return $default;\n }\n\n //Convert hexadec to rgb\n $rgb = array_map( 'hexdec', $hex );\n\n //Check if opacity is set(rgba or rgb)\n if ( $opacity ) {\n if ( abs( $opacity ) > 1 ) {\n $opacity = 1.0;\n }\n $output = 'rgba(' . implode( \",\", $rgb ) . ',' . $opacity . ')';\n } else {\n $output = 'rgb(' . implode( \",\", $rgb ) . ')';\n }\n\n //Return rgb(a) color string\n return $output;\n}", "public static function hex2rgb( $hex, $opacity=1 ) {\n $hex = str_replace(\"#\", \"\", $hex);\n\n if(strlen($hex) == 3) {\n $r = hexdec(substr($hex,0,1).substr($hex,0,1));\n $g = hexdec(substr($hex,1,1).substr($hex,1,1));\n $b = hexdec(substr($hex,2,1).substr($hex,2,1));\n } else {\n $r = hexdec(substr($hex,0,2));\n $g = hexdec(substr($hex,2,2));\n $b = hexdec(substr($hex,4,2));\n }\n $rgb = array($r, $g, $b, $opacity);\n return 'rgba(' . (implode(\",\", $rgb)) . ')'; // returns the rgb values separated by commas\n //return $rgb; // returns an array with the rgb values\n }", "function hex2rgb($color){\r\n $color = str_replace('#', '', $color);\r\n if (strlen($color) != 6){ return array(0,0,0); }\r\n $rgb = array();\r\n for ($x=0; $x<3; $x++)\r\n {\r\n $rgb[$x] = hexdec(substr($color, (2 * $x), 2));\r\n }\r\n return $rgb;\r\n}", "private function hexToRGB($hex = false) {\n\t\tif($hex === false) {\n\t\t\treturn false;\n\t\t}\n\t\t$hex = (string) $hex;\n\n\t\t// Remove the #.\n\t\tif(substr($hex, 0, 1) === '#') {\n\t\t\t$hex = substr($hex, 1);\n\t\t}\n\n\t\t// Used a 3-character hex, so duplicate the value to make it a 2-character string.\n\t\tif(strlen($hex) === 3) {\n\t\t\t$hex = array(\n\t\t\t\t\tstr_repeat(substr($hex, 0, 1), 2),\n\t\t\t\t\tstr_repeat(substr($hex, 1, 1), 2),\n\t\t\t\t\tstr_repeat(substr($hex, 2, 1), 2)\n\t\t\t\t);\n\t\t// Full on 6-character, so just get each 2-character combo.\n\t\t} else if(strlen($hex) === 6) {\n\t\t\t$hex = array(\n\t\t\t\t\tsubstr($hex, 0, 2),\n\t\t\t\t\tsubstr($hex, 2, 2),\n\t\t\t\t\tsubstr($hex, 4, 2)\n\t\t\t\t);\n\t\t// If it is neither 3- nor 6-character, we can't figure it out.\n\t\t} else {\n\t\t\t$hex = false;\n\t\t}\n\n\t\t// Convert each value from hex to decimal.\n\t\tif($hex) {\n\t\t\tarray_walk(\n\t\t\t\t\t$hex,\n\t\t\t\t\tfunction(&$val) {\n\t\t\t\t\t\t$val = hexdec($val);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t}\n\t\treturn $hex;\n\t}", "function alaya_color_hex2rgba($color, $opacity = false) {\n\n\t$default = 'rgb(0,0,0)';\n\n\t//Return default if no color provided\n\tif(empty($color))\n return $default; \n\n\t//Sanitize $color if \"#\" is provided \n if ($color[0] == '#' ) {\n \t$color = substr( $color, 1 );\n }\n\n //Check if color has 6 or 3 characters and get values\n if (strlen($color) == 6) {\n $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );\n } elseif ( strlen( $color ) == 3 ) {\n $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );\n } else {\n return $default;\n }\n\n //Convert hexadec to rgb\n $rgb = array_map('hexdec', $hex);\n\n //Check if opacity is set(rgba or rgb)\n if($opacity){\n \tif(abs($opacity) > 1)\n \t\t$opacity = 1.0;\n \t$output = 'rgba('.implode(\",\",$rgb).','.$opacity.')';\n } else {\n \t$output = 'rgb('.implode(\",\",$rgb).')';\n }\n\n //Return rgb(a) color string\n\t\t$output = apply_filters('alaya_color_hex2rgba', $output);\n return $output;\n}", "function hex2rgb( $colour ) {\n if ( $colour[0] == '#' ) {\n $colour = substr( $colour, 1 );\n }\n if ( strlen( $colour ) == 6 ) {\n list( $r, $g, $b ) = array( $colour[0] . $colour[1], $colour[2] . $colour[3], $colour[4] . $colour[5] );\n } elseif ( strlen( $colour ) == 3 ) {\n list( $r, $g, $b ) = array( $colour[0] . $colour[0], $colour[1] . $colour[1], $colour[2] . $colour[2] );\n } else {\n return false;\n }\n $r = hexdec( $r );\n $g = hexdec( $g );\n $b = hexdec( $b );\n //return array( 'red' => $r, 'green' => $g, 'blue' => $b );\n return \"rgb($r,$g,$b)\";\n}", "private function hex2rgb($hex)\n {\n $hex = str_replace('#', '', $hex);\n\n if (strlen($hex) == 3) {\n $r = hexdec(substr($hex, 0, 1) . substr($hex, 0, 1));\n $g = hexdec(substr($hex, 1, 1) . substr($hex, 1, 1));\n $b = hexdec(substr($hex, 2, 1) . substr($hex, 2, 1));\n } else {\n $r = hexdec(substr($hex, 0, 2));\n $g = hexdec(substr($hex, 2, 2));\n $b = hexdec(substr($hex, 4, 2));\n }\n $rgb = array($r, $g, $b);\n\n return $rgb;\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}", "function Scaffold_rgbtohex($rgb) {\n\t$hex = \"\";\n\tfor($i=0; $i < 3; $i++) {\n\n\t\t// Convert the decimal digit to hex\n\t\t$hexDigit = dechex($rgb[$i]);\n\n\t\t// Add a leading zero if necessary\n\t\tif(strlen($hexDigit) == 1) {\n\t\t\t$hexDigit = \"0\" . $hexDigit;\n\t\t}\n\n\t\t// Append to the hex string\n\t\t$hex .= $hexDigit;\n\t}\n\t// Return the complete hex string\n\treturn '#'.$hex;\n}", "function hex2dec($couleur = \"#000000\"){\n $R = substr($couleur, 1, 2);\n $rouge = hexdec($R);\n $V = substr($couleur, 3, 2);\n $vert = hexdec($V);\n $B = substr($couleur, 5, 2);\n $bleu = hexdec($B);\n $tbl_couleur = array();\n $tbl_couleur['R']=$rouge;\n $tbl_couleur['V']=$vert;\n $tbl_couleur['B']=$bleu;\n return $tbl_couleur;\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 }", "function inversecouleur($color) {\n\n $C1 = dechex(255-hexdec(substr($color, 1, 2)));\n $C2 = dechex(255-hexdec(substr($color, 3, 2)));\n $C3 = dechex(255-hexdec(substr($color, 5, 2)));\n \n if (strlen($C1) == 1) {\n $C1 = '0'.$C1;\n \n }\n elseif (strlen($C2) == 1) {\n $C2 = '0'.$C2;\n \n }\n elseif (strlen($C3) == 1) {\n $C3 = '0'.$C3;\n \n }\n $color = strtoupper($C1) . strtoupper($C2) . strtoupper($C3);\n return '#'.$color;\n // On prend les caract�res de la couleur $color deux par deux et\n // on les mets dans des variables\n // On transforme les paires de 2 caract�res en d�cimal\n // On inverse chaque partie de la couleur en la soustrayant au maximum (255)\n // On remet chaque partie de la couleur en hexad�cimal\n // Si le nombre hexad�cimal ne prend qu'un caract�re (par exemple 'A') on le \n // transforme en '0A' car une couleur est toujours faite de 6 caract�res\n // On retourne l'inverse de la couleur fournie $color\n}", "public static function hex2rgba( $hex, $alpha = '' ) {\n\t\t\t$hex = str_replace( '#', '', $hex );\n\t\t\tif ( 3 === strlen( $hex ) ) {\n\t\t\t\t$r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) );\n\t\t\t\t$g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) );\n\t\t\t\t$b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) );\n\t\t\t} else {\n\t\t\t\t$r = hexdec( substr( $hex, 0, 2 ) );\n\t\t\t\t$g = hexdec( substr( $hex, 2, 2 ) );\n\t\t\t\t$b = hexdec( substr( $hex, 4, 2 ) );\n\t\t\t}\n\t\t\t$rgb = $r . ',' . $g . ',' . $b;\n\n\t\t\tif ( '' === $alpha ) {\n\t\t\t\treturn $rgb;\n\t\t\t} else {\n\t\t\t\t$alpha = floatval( $alpha );\n\n\t\t\t\treturn 'rgba(' . $rgb . ',' . $alpha . ')';\n\t\t\t}\n\t\t}", "function rgbhex($r, $g, $b){\n $r = intval($r);\n $g = intval($g);\n $b = intval($b);\n $r = dechex($r < 0 ? 0 : ($r > 255 ? 255 : $r));\n $g = dechex($g < 0 ? 0 : ($g > 255 ? 255 : $g));\n $b = dechex($b < 0 ? 0 : ($b > 255 ? 255 : $b));\n \n $hex = (strlen($r) < 2 ? '0' : '') . $r;\n $hex .= (strlen($g) < 2 ? '0' : '') . $g;\n $hex .= (strlen($b) < 2 ? '0' : '') . $b;\n\n return $hex;\n}", "public static function hex2rgba( $hex, $opacity ) {\n\t\t $hex = str_replace( '#', '', $hex );\n\n\t\tif ( strlen( $hex ) == 3 ) {\n\t\t\t$r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) );\n\t\t\t$g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) );\n\t\t\t$b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) );\n\t\t} else {\n\t\t\t$r = hexdec( substr( $hex, 0, 2 ) );\n\t\t\t$g = hexdec( substr( $hex, 2, 2 ) );\n\t\t\t$b = hexdec( substr( $hex, 4, 2 ) );\n\t\t}\n\t\t$rgba = array( $r, $g, $b, $opacity );\n\n\t\treturn 'rgba(' . implode( ', ', $rgba ) . ')';\n\t}", "public function getAlpha()\n {\n $alpha = 100;\n if (strlen($this->argb) >= 6) {\n $dec = hexdec(substr($this->argb, 0, 2));\n $alpha = number_format(($dec / 255) * 100, 2);\n }\n\n return $alpha;\n }", "public static function hex2rgb($hex) {\n\t\t$hex = str_replace('#', '', $hex);\n\t\t$color = array();\n\t\t\n\t\tif (strlen($hex) == 3) {\n\t\t\t$color['r'] = hexdec(substr($hex, 0, 1) . $rgb['r']);\n\t\t\t$color['g'] = hexdec(substr($hex, 1, 1) . $rgb['g']);\n\t\t\t$color['b'] = hexdec(substr($hex, 2, 1) . $rgb['b']);\n\t\t} else {\n\t\t\t$color['r'] = hexdec(substr($hex, 0, 2));\n\t\t\t$color['g'] = hexdec(substr($hex, 2, 2));\n\t\t\t$color['b'] = hexdec(substr($hex, 4, 2));\n\t\t}\n\t\t\n\t\treturn $color;\n\t}", "function ss_hex2rgba( $color, $opacity = false ) {\r\n\r\n\t$default = 'rgb(0,0,0)';\r\n\r\n\t//Return default if no color provided\r\n\tif ( empty( $color ) )\r\n\t\treturn $default;\r\n\r\n\t//Sanitize $color if \"#\" is provided\r\n\tif ( $color[0] == '#' ) {\r\n\t\t$color = substr( $color, 1 );\r\n\t}\r\n\r\n\t//Check if color has 6 or 3 characters and get values\r\n\tif ( strlen( $color ) == 6 ) {\r\n\t\t$hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );\r\n\t} elseif ( strlen( $colour ) == 3 ) {\r\n\t\t$hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );\r\n\t} else {\r\n\t\treturn $default;\r\n\t}\r\n\r\n\t//Convert hexadec to rgb\r\n\t$rgb = array_map( 'hexdec', $hex );\r\n\r\n\t//Check if opacity is set(rgba or rgb)\r\n\tif ( $opacity ) {\r\n\t\tif ( abs( $opacity ) > 1 )\r\n\t\t\t$opacity = 1.0;\r\n\t\t$output = 'rgba('.implode( \",\", $rgb ).','.$opacity.')';\r\n\t} else {\r\n\t\t$output = 'rgb('.implode( \",\", $rgb ).')';\r\n\t}\r\n\r\n\t//Return rgb(a) color string\r\n\treturn $output;\r\n}", "private function _hex2Rgb($hex)\n {\n $hex = str_replace(\"#\", \"\", $hex);\n\n $red = hexdec(substr($hex, 0, 2));\n $green = hexdec(substr($hex, 2, 2));\n $blue = hexdec(substr($hex, 4, 2));\n\n if (strlen($hex) == 3) {\n $red = hexdec(substr($hex, 0, 1).substr($hex, 0, 1));\n $green = hexdec(substr($hex, 1, 1).substr($hex, 1, 1));\n $blue = hexdec(substr($hex, 2, 1).substr($hex, 2, 1));\n }\n return array($red, $green, $blue);\n }", "public function toHex()\n\t{\n\t\treturn sprintf('#%s%s%s', Strings::padLeft(dechex($this->r), 2, '0'), Strings::padLeft(dechex($this->g), 2, '0'), Strings::padLeft(dechex($this->b), 2, '0'));\n\t}", "protected function create_hex_color($hex)\n {\n if ($hex == null) {\n $red = 0;\n $green = 0;\n $blue = 0;\n } else {\n // Check if theres a # in front\n if (substr($hex, 0, 1) == '#') {\n $hex = substr($hex, 1);\n }\n // Break apart the hex\n if (strlen($hex) == 6) {\n $red = hexdec(substr($hex, 0, 2));\n $green = hexdec(substr($hex, 2, 2));\n $blue = hexdec(substr($hex, 4, 2));\n } else {\n $red = hexdec(substr($hex, 0, 1).substr($hex, 0, 1));\n $green = hexdec(substr($hex, 1, 1).substr($hex, 1, 1));\n $blue = hexdec(substr($hex, 2, 1).substr($hex, 2, 1));\n }\n }\n\n return [\n 'red' => $red,\n 'green' => $green,\n 'blue' => $blue,\n ];\n }", "function zbx_colormix($image, $bgColor, $fgColor, $alpha) {\n\t$r = $bgColor[0] + ($fgColor[0] - $bgColor[0]) * $alpha;\n\t$g = $bgColor[1] + ($fgColor[1] - $bgColor[1]) * $alpha;\n\t$b = $bgColor[2] + ($fgColor[2] - $bgColor[2]) * $alpha;\n\n\treturn imagecolorresolvealpha($image, $r, $g, $b, 0);\n}", "public function getHexFromColorName($name)\n {\n $colors = [\n 'aliceblue' => 'F0F8FF',\n 'antiquewhite' => 'FAEBD7',\n 'aqua' => '00FFFF',\n 'aquamarine' => '7FFFD4',\n 'azure' => 'F0FFFF',\n 'beige' => 'F5F5DC',\n 'bisque' => 'FFE4C4',\n 'black' => '000000',\n 'blanchedalmond' => 'FFEBCD',\n 'blue' => '0000FF',\n 'blueviolet' => '8A2BE2',\n 'brown' => 'A52A2A',\n 'burlywood' => 'DEB887',\n 'cadetblue' => '5F9EA0',\n 'chartreuse' => '7FFF00',\n 'chocolate' => 'D2691E',\n 'coral' => 'FF7F50',\n 'cornflowerblue' => '6495ED',\n 'cornsilk' => 'FFF8DC',\n 'crimson' => 'DC143C',\n 'cyan' => '00FFFF',\n 'darkblue' => '00008B',\n 'darkcyan' => '008B8B',\n 'darkgoldenrod' => 'B8860B',\n 'darkgray' => 'A9A9A9',\n 'darkgreen' => '006400',\n 'darkkhaki' => 'BDB76B',\n 'darkmagenta' => '8B008B',\n 'darkolivegreen' => '556B2F',\n 'darkorange' => 'FF8C00',\n 'darkorchid' => '9932CC',\n 'darkred' => '8B0000',\n 'darksalmon' => 'E9967A',\n 'darkseagreen' => '8FBC8F',\n 'darkslateblue' => '483D8B',\n 'darkslategray' => '2F4F4F',\n 'darkturquoise' => '00CED1',\n 'darkviolet' => '9400D3',\n 'deeppink' => 'FF1493',\n 'deepskyblue' => '00BFFF',\n 'dimgray' => '696969',\n 'dodgerblue' => '1E90FF',\n 'firebrick' => 'B22222',\n 'floralwhite' => 'FFFAF0',\n 'forestgreen' => '228B22',\n 'fuchsia' => 'FF00FF',\n 'gainsboro' => 'DCDCDC',\n 'ghostwhite' => 'F8F8FF',\n 'gold' => 'FFD700',\n 'goldenrod' => 'DAA520',\n 'gray' => '808080',\n 'green' => '008000',\n 'greenyellow' => 'ADFF2F',\n 'honeydew' => 'F0FFF0',\n 'hotpink' => 'FF69B4',\n 'indianred' => 'CD5C5C',\n 'indigo' => '4B0082',\n 'ivory' => 'FFFFF0',\n 'khaki' => 'F0E68C',\n 'lavender' => 'E6E6FA',\n 'lavenderblush' => 'FFF0F5',\n 'lawngreen' => '7CFC00',\n 'lemonchiffon' => 'FFFACD',\n 'lightblue' => 'ADD8E6',\n 'lightcoral' => 'F08080',\n 'lightcyan' => 'E0FFFF',\n 'lightgoldenrodyellow' => 'FAFAD2',\n 'lightgray' => 'D3D3D3',\n 'lightgreen' => '90EE90',\n 'lightpink' => 'FFB6C1',\n 'lightsalmon' => 'FFA07A',\n 'lightseagreen' => '20B2AA',\n 'lightskyblue' => '87CEFA',\n 'lightslategray' => '778899',\n 'lightsteelblue' => 'B0C4DE',\n 'lightyellow' => 'FFFFE0',\n 'lime' => '00FF00',\n 'limegreen' => '32CD32',\n 'linen' => 'FAF0E6',\n 'magenta' => 'FF00FF',\n 'maroon' => '800000',\n 'mediumaquamarine' => '66CDAA',\n 'mediumblue' => '0000CD',\n 'mediumorchid' => 'BA55D3',\n 'mediumpurple' => '9370DB',\n 'mediumseagreen' => '3CB371',\n 'mediumslateblue' => '7B68EE',\n 'mediumspringgreen' => '00FA9A',\n 'mediumturquoise' => '48D1CC',\n 'mediumvioletred' => 'C71585',\n 'midnightblue' => '191970',\n 'mintcream' => 'F5FFFA',\n 'mistyrose' => 'FFE4E1',\n 'moccasin' => 'FFE4B5',\n 'navajowhite' => 'FFDEAD',\n 'navy' => '000080',\n 'oldlace' => 'FDF5E6',\n 'olive' => '808000',\n 'olivedrab' => '6B8E23',\n 'orange' => 'FFA500',\n 'orangered' => 'FF4500',\n 'orchid' => 'DA70D6',\n 'palegoldenrod' => 'EEE8AA',\n 'palegreen' => '98FB98',\n 'paleturquoise' => 'AFEEEE',\n 'palevioletred' => 'DB7093',\n 'papayawhip' => 'FFEFD5',\n 'peachpuff' => 'FFDAB9',\n 'peru' => 'CD853F',\n 'pink' => 'FFC0CB',\n 'plum' => 'DDA0DD',\n 'powderblue' => 'B0E0E6',\n 'purple' => '800080',\n 'rebeccapurple' => '663399',\n 'red' => 'FF0000',\n 'rosybrown' => 'BC8F8F',\n 'royalblue' => '4169E1',\n 'saddlebrown' => '8B4513',\n 'salmon' => 'FA8072',\n 'sandybrown' => 'F4A460',\n 'seagreen' => '2E8B57',\n 'seashell' => 'FFF5EE',\n 'sienna' => 'A0522D',\n 'silver' => 'C0C0C0',\n 'skyblue' => '87CEEB',\n 'slateblue' => '6A5ACD',\n 'slategray' => '708090',\n 'snow' => 'FFFAFA',\n 'springgreen' => '00FF7F',\n 'steelblue' => '4682B4',\n 'tan' => 'D2B48C',\n 'teal' => '008080',\n 'thistle' => 'D8BFD8',\n 'tomato' => 'FF6347',\n 'turquoise' => '40E0D0',\n 'violet' => 'EE82EE',\n 'wheat' => 'F5DEB3',\n 'white' => 'FFFFFF',\n 'whitesmoke' => 'F5F5F5',\n 'yellow' => 'FFFF00',\n 'yellowgreen' => '9ACD32',\n ];\n\n $name = strtolower($name);\n\n if (array_key_exists($name, $colors)) {\n return $colors[$name];\n }\n }", "public function toHex()\n {\n return $this->toRGB()->toHex();\n }", "private function int2rgba($int)\n\t\t{\n\t\t\t$a = ($int >> 24) & 0xFF;\n\t\t\t$r = ($int >> 16) & 0xFF;\n\t\t\t$g = ($int >> 8) & 0xFF;\n\t\t\t$b = $int & 0xFF;\n\t\t\treturn array(\n\t\t\t\t'r' => $r,\n\t\t\t\t'g' => $g,\n\t\t\t\t'b' => $b,\n\t\t\t\t'a' => $a\n\t\t\t);\n\t\t}", "public static function GetRgb($hex,$char_index = true)\n {\n $rgb_hex_array = str_split($hex,2);\n $rgb_dec_array = array_map('hexdec',$rgb_hex_array);\n\n if($char_index)\n return array('r' => $rgb_dec_array[0],'g' => $rgb_dec_array[1],'b' => $rgb_dec_array[2]);\n else\n return $rgb_dec_array;\n }", "function thrive_hex2rgba($color, $opacity = false) {\n\n\t$default = 'rgb(0,0,0)';\n\n\t//Return default if no color provided\n\tif(empty($color))\n return $default;\n\n\t//Sanitize $color if \"#\" is provided\n if ($color[0] == '#' ) {\n \t$color = substr( $color, 1 );\n }\n\n //Check if color has 6 or 3 characters and get values\n if (strlen($color) == 6) {\n $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );\n } elseif ( strlen( $color ) == 3 ) {\n $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );\n } else {\n return $default;\n }\n\n //Convert hexadec to rgb\n $rgb = array_map('hexdec', $hex);\n\n //Check if opacity is set(rgba or rgb)\n if($opacity){\n \tif(abs($opacity) > 1)\n \t\t$opacity = 1.0;\n \t$output = 'rgba('.implode(\",\",$rgb).','.$opacity.')';\n } else {\n \t$output = 'rgb('.implode(\",\",$rgb).')';\n }\n\n //Return rgb(a) color string\n return $output;\n}", "protected function hex2rgb(string $hex)\r\n {\r\n $hex = str_replace(\"#\", \"\", $hex);\r\n if (strlen($hex) == 6) {\r\n $r = hexdec(substr($hex, 0, 2));\r\n $g = hexdec(substr($hex, 2, 2));\r\n $b = hexdec(substr($hex, 4, 2));\r\n $a = 1;\r\n } else if (strlen($hex) == 8) {\r\n $r = hexdec(substr($hex, 2, 2));\r\n $g = hexdec(substr($hex, 4, 2));\r\n $b = hexdec(substr($hex, 6, 2));\r\n $a = hexdec(substr($hex, 0, 2));\r\n }\r\n\r\n $rgb = [$r, $g, $b];\r\n return ['rgb' => $rgb, 'a' => $a];\r\n }", "function sanitize_hex_color($color)\n {\n }", "private function hex2rgb($c){\n\t\tif(!$c) return false;\n\t\t$c = trim($c);\n\t\t$out = false;\n\t\t// Check for valid colour code\n\t\tif(preg_match(\"/^[0-9ABCDEFabcdef\\#]+$/i\", $c)){\n\t\t\t// Remove hash\n\t\t\t$c = str_replace('#','', $c);\n\t\t\t// Parse through short colour-code\n\t\t\t$l = strlen($c) == 3 ? 1 : (strlen($c) == 6 ? 2 : false);\n\t\t\tif($l){\n\t\t\t\t// Grab RGB components\n\t\t\t\tunset($out);\n\t\t\t\t$out[0] = $out['r'] = $out['red'] = hexdec(substr($c, 0,1*$l));\n\t\t\t\t$out[1] = $out['g'] = $out['green'] = hexdec(substr($c, 1*$l,1*$l));\n\t\t\t\t$out[2] = $out['b'] = $out['blue'] = hexdec(substr($c, 2*$l,1*$l));\n\t\t\t}else{\n\t\t\t\t$out = false;\n\t\t\t}\n\t\t}else{\n\t\t\t$out = false;\n\t\t}\n\t\treturn $out;\n\t}", "function carton_rgb_from_hex( $color ) {\n\t\t$color = str_replace( '#', '', $color );\n\t\t// Convert shorthand colors to full format, e.g. \"FFF\" -> \"FFFFFF\"\n\t\t$color = preg_replace( '~^(.)(.)(.)$~', '$1$1$2$2$3$3', $color );\n\n\t\t$rgb['R'] = hexdec( $color{0}.$color{1} );\n\t\t$rgb['G'] = hexdec( $color{2}.$color{3} );\n\t\t$rgb['B'] = hexdec( $color{4}.$color{5} );\n\t\treturn $rgb;\n\t}", "private function hex2rgb($string){\n\t\t\t$resp = preg_split('/#([0-9A-F]{1,2})([0-9A-F]{1,2})([0-9A-F]{1,2})/',$string,-1,PREG_SPLIT_DELIM_CAPTURE);\n\t\t\treturn array('r'=> hexdec($resp[1]),'g'=>hexdec($resp[2]),'b'=>hexdec($resp[3]));\n\t\t}", "function ndotone_hex2rgb( $color ) {\n $color = trim( $color, '#' );\n\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 if ( strlen( $color ) === 6 ) {\n $r = hexdec( substr( $color, 0, 2 ) );\n $g = hexdec( substr( $color, 2, 2 ) );\n $b = hexdec( substr( $color, 4, 2 ) );\n } else {\n return array();\n }\n\n return array( 'red' => $r, 'green' => $g, 'blue' => $b );\n}", "public function HextoRGB($hexColor)\n {\n $len = strlen($hexColor);\n\n if ($len == 3 || $len == 4) {\n list($r, $g, $b) = sscanf($hexColor, \"#%1x%1x%1x\");\n } elseif (in_array($len, [6, 7])) {\n\n list($r, $g, $b) = sscanf($hexColor, \"#%02x%02x%02x\");\n } else {\n die(\"error HextoRGB: $hexColor\" );\n }\n return [$r, $g, $b];\n }", "static function rgb2hex($rgb) {\n $rgb = Util::eliminarEspacios($rgb);\n if (is_string($rgb)) {\n if (strpos($rgb, \"rgb\") !== false) {\n $rgb = str_replace(\"rgb(\", \"\", str_replace(\")\", \"\", $rgb));\n }\n $rgb = explode(\",\", $rgb);\n }\n\n $hex = \"#\";\n $hex .= str_pad(dechex($rgb[0]), 2, \"0\", STR_PAD_LEFT);\n $hex .= str_pad(dechex($rgb[1]), 2, \"0\", STR_PAD_LEFT);\n $hex .= str_pad(dechex($rgb[2]), 2, \"0\", STR_PAD_LEFT);\n\n return $hex; // returns the hex value including the number sign (#)\n }", "function hex2rgba($color, $opacity = false) {\n\n\t\t$default = 'rgb(0,0,0)';\n\n\t\t//Return default if no color provided\n\t\tif(empty($color))\n\t return $default; \n\n\t\t//Sanitize $color if \"#\" is provided \n\t if ($color[0] == '#' ) {\n\t \t$color = substr( $color, 1 );\n\t }\n\n\t //Check if color has 6 or 3 characters and get values\n\t if (strlen($color) == 6) {\n\t $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );\n\t } elseif ( strlen( $color ) == 3 ) {\n\t $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );\n\t } else {\n\t return $default;\n\t }\n\n\t //Convert hexadec to rgb\n\t $rgb = array_map('hexdec', $hex);\n\n\t //Check if opacity is set(rgba or rgb)\n\t if($opacity){\n\t \tif(abs($opacity) > 1)\n\t \t\t$opacity = 1.0;\n\t \t$output = 'rgba('.implode(\",\",$rgb).','.$opacity.')';\n\t } else {\n\t \t$output = 'rgb('.implode(\",\",$rgb).')';\n\t }\n\n\t //Return rgb(a) color string\n\t return $output;\n\t}", "function hex2RGB($hexStr, $returnAsString = false, $seperator = ',') {\n $hexStr = preg_replace(\"/[^0-9A-Fa-f]/\", '', $hexStr); // Gets a proper hex string\n $rgbArray = array();\n if (strlen($hexStr) == 6) { //If a proper hex code, convert using bitwise operation. No overhead... faster\n $colorVal = hexdec($hexStr);\n $rgbArray['red'] = 0xFF & ($colorVal >> 0x10);\n $rgbArray['green'] = 0xFF & ($colorVal >> 0x8);\n $rgbArray['blue'] = 0xFF & $colorVal;\n } elseif (strlen($hexStr) == 3) { //if shorthand notation, need some string manipulations\n $rgbArray['red'] = hexdec(str_repeat(substr($hexStr, 0, 1), 2));\n $rgbArray['green'] = hexdec(str_repeat(substr($hexStr, 1, 1), 2));\n $rgbArray['blue'] = hexdec(str_repeat(substr($hexStr, 2, 1), 2));\n } else {\n return false; //Invalid hex color code\n }\n return $returnAsString ? implode($seperator, $rgbArray) : $rgbArray; // returns the rgb string or the associative array\n}", "public function getHex($index) {\n\t\t$palette = $this->getFullPalette();\n\t\tif(isset($palette[$index])) {\n\t\t\treturn $palette[$index];\n\t\t} else {\n\t\t\treturn $palette['PaletteColour1'];\n\t\t}\n\t}", "function toColor($n){\n\t\t\treturn(\"#\".substr(\"000000\".dechex($n),-6));\n\t\t}", "private function _getBrightness($hex) {\n \n // strip off any leading #\n $hex = str_replace('#', '', $hex);\n \n $c_r = hexdec(substr($hex, 0, 2));\n $c_g = hexdec(substr($hex, 2, 2));\n $c_b = hexdec(substr($hex, 4, 2));\n \n return (($c_r * 299) + ($c_g * 587) + ($c_b * 114)) / 1000;\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}", "public function convertToColor($css, &$res)\n {\n // prepare the value\n $css = trim($css);\n $res = true;\n\n // if transparent => return null\n if (strtolower($css)=='transparent') return array(null, null, null);\n\n // HTML color\n if (isset($this->_htmlColor[strtolower($css)])) {\n $css = $this->_htmlColor[strtolower($css)];\n $r = floatVal(hexdec(substr($css, 0, 2)));\n $v = floatVal(hexdec(substr($css, 2, 2)));\n $b = floatVal(hexdec(substr($css, 4, 2)));\n return array($r, $v, $b);\n }\n\n // like #FFFFFF\n if (preg_match('/^#[0-9A-Fa-f]{6}$/isU', $css)) {\n $r = floatVal(hexdec(substr($css, 1, 2)));\n $v = floatVal(hexdec(substr($css, 3, 2)));\n $b = floatVal(hexdec(substr($css, 5, 2)));\n return array($r, $v, $b);\n }\n\n // like #FFF\n if (preg_match('/^#[0-9A-F]{3}$/isU', $css)) {\n $r = floatVal(hexdec(substr($css, 1, 1).substr($css, 1, 1)));\n $v = floatVal(hexdec(substr($css, 2, 1).substr($css, 2, 1)));\n $b = floatVal(hexdec(substr($css, 3, 1).substr($css, 3, 1)));\n return array($r, $v, $b);\n }\n\n // like rgb(100, 100, 100)\n if (preg_match('/rgb\\([\\s]*([0-9%\\.]+)[\\s]*,[\\s]*([0-9%\\.]+)[\\s]*,[\\s]*([0-9%\\.]+)[\\s]*\\)/isU', $css, $match)) {\n $r = $this->_convertSubColor($match[1]);\n $v = $this->_convertSubColor($match[2]);\n $b = $this->_convertSubColor($match[3]);\n return array($r*255., $v*255., $b*255.);\n }\n\n // like cmyk(100, 100, 100, 100)\n if (preg_match('/cmyk\\([\\s]*([0-9%\\.]+)[\\s]*,[\\s]*([0-9%\\.]+)[\\s]*,[\\s]*([0-9%\\.]+)[\\s]*,[\\s]*([0-9%\\.]+)[\\s]*\\)/isU', $css, $match)) {\n $c = $this->_convertSubColor($match[1]);\n $m = $this->_convertSubColor($match[2]);\n $y = $this->_convertSubColor($match[3]);\n $k = $this->_convertSubColor($match[4]);\n return array($c*100., $m*100., $y*100., $k*100.);\n }\n\n $res = false;\n return array(0., 0., 0.);\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 }", "private function rgb_dec_to_hex($rgb)\n {\n return strtoupper(\n str_pad(dechex($rgb['red']), 2, '0', STR_PAD_LEFT).\n str_pad(dechex($rgb['green']), 2, '0', STR_PAD_LEFT).\n str_pad(dechex($rgb['blue']), 2, '0', STR_PAD_LEFT)\n );\n }", "public function toHex()\n {\n return new Hex($this->getRed() << 16 | $this->getGreen() << 8 | $this->getBlue());\n }", "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 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}", "protected function convertHexColor(string $color): array\n {\n $rgb = [];\n\n // Try to convert using bitwise operation\n if (\\strlen($color) == 6)\n {\n $dec = hexdec($color);\n $rgb['red'] = 0xFF & ($dec >> 0x10);\n $rgb['green'] = 0xFF & ($dec >> 0x8);\n $rgb['blue'] = 0xFF & $dec;\n }\n\n // Shorthand notation\n elseif (\\strlen($color) == 3)\n {\n $rgb['red'] = hexdec(str_repeat(substr($color, 0, 1), 2));\n $rgb['green'] = hexdec(str_repeat(substr($color, 1, 1), 2));\n $rgb['blue'] = hexdec(str_repeat(substr($color, 2, 1), 2));\n }\n\n return $rgb;\n }", "public function hex2rgba($color, $opacity = false) {\n\t\t\t$default = 'rgb(0,0,0)';\n\n\t\t\t//Return default if no color provided\n\t\t\tif(empty($color))\n \treturn $default; \n\n\t\t\t//Sanitize $color if \"#\" is provided \n \tif ($color[0] == '#' ) {\n \t\t$color = substr( $color, 1 );\n \t}\n\n \t//Check if color has 6 or 3 characters and get values\n \tif (strlen($color) == 6) {\n $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );\n \t} elseif ( strlen( $color ) == 3 ) {\n $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );\n \t} else {\n return $default;\n \t}\n\n \t//Convert hexadec to rgb\n \t$rgb = array_map('hexdec', $hex);\n\n \t//Check if opacity is set(rgba or rgb)\n \tif($opacity){\n \t\tif(abs($opacity) > 1) {\n \t\t\t$opacity = 1.0;\n\t\t\t\t}\n \t\t$output = 'rgba('.implode(\",\",$rgb).','.$opacity.')';\n \t} else {\n \t\t$output = 'rgb('.implode(\",\",$rgb).')';\n \t}\n\n \t//Return rgb(a) color string\n \treturn $output;\n\t\t}", "public function getColor3()\n {\n $sql = \"SELECT color_hex\n FROM site_color where site_color_id = 3\";\n\n $statement = $this->_dbh->prepare($sql);\n\n// $statement->bindParam(':color3', $color3);\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\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 stringrgb($arr){\r\n\treturn \"RGB(\".$arr[0].\",\".$arr[1].\",\".$arr[2].\")\";\r\n}", "function RGBToHex($r, $g, $b) {\n $hex = \"#\";\n $hex.= str_pad(dechex($r), 2, \"0\", STR_PAD_LEFT);\n $hex.= str_pad(dechex($g), 2, \"0\", STR_PAD_LEFT);\n $hex.= str_pad(dechex($b), 2, \"0\", STR_PAD_LEFT);\n \n return $hex;\n }", "function image_hex_color($color)\n{\n $c = strtoupper($color);\n if (strpos($c, '#') !== 0) {\n $c = '#'.$c;\n }\n if (!preg_match('/^#([A-F0-9]{3}){1,2}$/', $c)) {\n err('invalid hex color '.$color);\n }\n return $c;\n\n}", "function hex2rgb($color) {\n\tif ( $color[0] == '#' ) {\n\t\t$color = substr($color, 1);\n\t}\n\tif ( strlen($color) == 6 ) {\n\t\tlist($r, $g, $b) = array($color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5]);\n\t} elseif ( strlen($color) == 3 ) {\n\t\tlist($r, $g, $b) = array($color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2]);\n\t} else {\n\t\treturn false;\n\t}\n\t$r = hexdec($r);\n\t$g = hexdec($g);\n\t$b = hexdec($b);\n\treturn array('r' => $r, 'g' => $g, 'b' => $b);\n}", "public function toRGB()\n {\n return $this->toCMY()->toRGB();\n }", "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 maybe_hash_hex_color($color)\n {\n }", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColor();" ]
[ "0.66850686", "0.65061605", "0.63369465", "0.63369465", "0.63305384", "0.6323536", "0.63030005", "0.6285287", "0.6281137", "0.62720853", "0.6258914", "0.62466025", "0.6218696", "0.6212062", "0.62082523", "0.61886936", "0.6145379", "0.6144343", "0.6068081", "0.6023239", "0.60098875", "0.5966431", "0.5918708", "0.5907223", "0.5906886", "0.58848643", "0.585124", "0.584811", "0.58368254", "0.5826602", "0.5822572", "0.5818432", "0.5818428", "0.58177364", "0.58138734", "0.5799381", "0.5782569", "0.5777118", "0.5764653", "0.5763032", "0.57553524", "0.57344097", "0.5732056", "0.57255435", "0.5720795", "0.57139987", "0.5712503", "0.5694517", "0.5681647", "0.5656988", "0.5648263", "0.56401104", "0.563333", "0.56313896", "0.561786", "0.5616958", "0.5611771", "0.5604194", "0.5598992", "0.5596441", "0.55890334", "0.55739707", "0.55710584", "0.5566001", "0.5547009", "0.5532636", "0.55282146", "0.55140215", "0.5510609", "0.5489545", "0.54663163", "0.542654", "0.5424842", "0.5422995", "0.53968275", "0.5378376", "0.536925", "0.5362545", "0.53608125", "0.53524137", "0.534191", "0.5309965", "0.5302214", "0.5298153", "0.52915126", "0.5289549", "0.52825934", "0.5282237", "0.528132", "0.5274794", "0.5266954", "0.5248073", "0.5233564", "0.5233539", "0.5233539", "0.5233539", "0.5233539", "0.5233539", "0.5233539", "0.5223671" ]
0.56277114
54
end mombo_color function Title Color
public function mombo_main_headings_color() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function color()\n {\n }", "function header_textcolor()\n {\n }", "public function colour();", "public static function title_style() {\n\t\techo self::get_title_style();\n\t}", "function wpvideocoach_get_introduction_title_color()\r\n{\r\n\tglobal $wpvideocoach_introduction_title_color;\r\n\tif(empty($wpvideocoach_introduction_title_color)){\r\n\t\t$wpvideocoach_introduction_title_color = '#000';\r\n\t}\r\n\treturn $wpvideocoach_introduction_title_color;\r\n}", "public function getColor();", "public function getColor();", "public function getColor();", "public function getColor();", "public function getColor()\n {\n return\"Yellow\";\n }", "public function getColor() {}", "public function getColor() {}", "public function getColor() {\n\t}", "public function getColor()\n {\n }", "function get_header_textcolor()\n {\n }", "function pl_text_color(){\n\t\t\n\t$color = ( pl_check_color_hash( ploption( 'text_primary' ) ) ) ? pl_hash_strip( ploption( 'text_primary' ) ) : '000000';\n\n\treturn $color;\n}", "function pl_header_color(){\n\t\n\t$color = ( pl_check_color_hash( ploption( 'headercolor' ) ) ) ? pl_hash_strip( ploption( 'headercolor' ) ) : '000000';\n\t\n\treturn $color;\t\n}", "function getCaptionFontColor() {\n\t//Return a hex color code without #\n\t//FFC30C - Yellow Color\n return \"666666\";\n}", "public function getColor(): string;", "public function getTextColor() {}", "public function getTextColor() {}", "function pl_link_color(){\n\t\n\t$color = ( pl_check_color_hash( ploption( 'linkcolor' ) ) ) ? pl_hash_strip( ploption( 'linkcolor' ) ) : '225E9B';\n\t\n\treturn $color;\t\n}", "function setTitleStyle($font = '', $size = 15, $col = 0x000000)\n {\n $size = intval($size);\n if ($size < 0) {\n $size = 0;\n }\n\n $this->title_font = $font;\n $this->title_font_size = $size;\n $this->title_col = $this->hexcol($col);\n }", "function setTitleStyle($font = '', $size = 15, $col = 0x000000)\n {\n $size = intval($size);\n if ($size < 0) {\n $size = 0;\n }\n\n $this->title_font = $font;\n $this->title_font_size = $size;\n $this->title_col = $this->hexcol($col);\n }", "public function getColor(): string\n {\n }", "public function howToColor($color)\n {\n }", "function boja($color)\n{\n $text = 'Neki tekst';\n echo \"<p style='color:$color'>$text</p>\";\n \n}", "function setColor($color_coche, $nombre_coche){\r\n\t\t\t$this->color=$color_coche;\r\n\t\t\techo \"El color del \" . $nombre_coche . \" es: \" . $this->color . \"<br/>\";\r\n\t\t}", "function callback_color($args)\n {\n }", "public static function color()\n {\n return null;\n }", "public static function color()\n {\n return null;\n }", "function establece_color ($color_camion, $nombre_camion) {\n\n $this -> color = $color_camion;\n\n echo \"El color del camion es \" . $this -> color . \"<br>\";\n\n }", "static function colorize() {\n\t\tself::$colorize = true;\n\t}", "function background_color()\n {\n }", "function pl_bg_color(){\n\t\n\tif( pl_check_color_hash( get_set_color( 'the_bg' ) ) )\n\t\treturn get_set_color( 'the_bg' );\n\telse \n\t\treturn 'FFFFFF';\t\n}", "function getColor() { return $this->_color; }", "function getColor() { return $this->_color; }", "public function setTextTitleColor($arrColor)\r\n\t{\r\n\t\t$this->textTitleColor = $arrColor;\r\n\t}", "function color( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_COLOR,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_STRING\n );\n\t}", "function _h_jetpack_share_add_color($title, $share) {\n $slug = $share->shortname;\n\n if ($slug === 'jetpack-whatsapp') {\n $slug = 'whatsapp';\n }\n\n if ($slug === 'print') {\n return $title;\n }\n\n $social = H::get_social_icon($slug);\n $color = $social['color'];\n\n return \"$title\\\" style=\\\"--color: $color;\";\n}", "function getColor() { return $this->_color; }", "function color($args) {\r\n\t\t\t$args = $this->apply_name_fix($this->apply_default_args($args)) ;\r\n\r\n\t\t\techo \"<div class='inline-rel'>\";\r\n\t\t\techo \"<span style='background:\" . (!empty($args['value']) ? $args['value'] : \"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QzIwM0UzNzZEODc2MTFFMDgyM0RFQUJEOEU1NEI2NjkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QzIwM0UzNzdEODc2MTFFMDgyM0RFQUJEOEU1NEI2NjkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDMjAzRTM3NEQ4NzYxMUUwODIzREVBQkQ4RTU0QjY2OSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDMjAzRTM3NUQ4NzYxMUUwODIzREVBQkQ4RTU0QjY2OSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Ps3q5KgAAAKOSURBVHjaXJRZTypBEIWZYVPgKsgeSAgQCUvgBeP//wGQyBaBRCFACKIgO7L7zdS94439MFTXqa5zqroapVqtXi6XdDpts9leXl4+Pz8jkUg4HN7tds/Pz4qiZLNZq9Xa6/XG47HX643H4wJZWIfDwWQyEcT3dDqxPZ/PJn0dj0dFX9g4f0FQKsvlEtf7+/t+vw8EAna7Hc9sNsPw+/3EQcixu7u76+vrr6+vj48PgUiqulyum5ubxWIxmUyurq7Y4sVerVZ/9DWfz9miEZtjBqRFkhgB0KIZTFVVDLZms5kuwGxAJCWSggVia+l2u0QUi0WONZtN9CcSiVgshtRyuUzE4+Mj306nMxgMQqHQ/f29QFrD0Ew+lJCP9G63m9D1ek1Lbm9vsYHISyQQhAZEvKYE5kqlgrdQKFDJaDR6fX2lqnw+D/T09ESfUqkUPaP+RqNhQBbqodskhvakL7zYeLBJjQEhMRJpQNoF1+t1IqhTJoHcwWCQO6Mx1ElEMpkEGg6H0+kU5dFoVCBkW7bbrVCxoRObzYYt0WTEplrujy+c1IVgA4Jf4dJlA8wY0CEkyX2wJZFApMADRP0CaUPCuPp8PlKgmcQIxouNSJ++uLx+vy9T5XA4DIiDP8xcgNPpRCEGtaCKrUAQQgWhiBdIGxJuhYiHhweO8VbgoUP0jxSlUun/IYGf18aQCPQzJOQjMYVxmVInzQOSITHry+Px0C0D+jskiOHqkZrJZCibIaEwhOVyOdBarUaTkEORvLZ2uy0QHKo8Zklh+rewZfIEEvsXpKGtVosfBgMZNA9VTAKqKOzt7Q2IOmkH/zC8czjhFwiniloO4GWq8RIBGzbt3ehLIAiBaLsBcfBbgAEArCsu6B0YK4AAAAAASUVORK5CYII=);\") .\"' class='swatch'></span><input id='$id' class=\\\"picker\\\" type='text' data-tooltip='\" .$args['tooltip'] . \"' size='57'\" . $this->placeholder('None') . \"' name='\" . $args['formname'] . \"' value='\" . $args['value'] . \"'/>\";\t\t\t\t\r\n\t\t\techo \"<div id='\" . $id . \"_picker' class='picker' style=''></div>\";\r\n\t\t\t$this->description($args['description']); // print a description if there is one\r\n\t\t\techo \"</div>\";\r\n\t\t}", "public function blue($text): string;", "public function getColorName()\n {\n return $this->color_name;\n }", "function button_text_hover_color() {\n\t\t\t$link_hover_color = astra_get_option( 'link-h-color' );\n\t\t\t$color = astra_get_option( 'button-h-color' );\n\t\t\tif ( empty( $color ) ) {\n\t\t\t\t$color = astra_get_foreground_color( $link_hover_color );\n\t\t\t}\n\n\t\t\treturn $color;\n\t\t}", "function GetContentColor()\n\t{\n\t\tif(isset($_GET[\"c\"]) && !empty($_GET[\"c\"]))\n\t\t{\n\t\t\tswitch($_GET[\"c\"])\n\t\t\t{\n\t\t\t case 1:\n\t\t\t\treturn \"black\";\n\t\t\tcase 2:\n\t\t\t\treturn \"red\";\n\t\t\tcase 3:\n\t\t\t\treturn \"green\";\n\t\t\tcase 4:\n\t\t\t\treturn \"yellow\";\n\t\t\tcase 5:\n\t\t\t\treturn \"blue\";\n\t\t\tcase 6:\n\t\t\t\treturn \"notimplemented\";\n\t\t\tdefault:\n\t\t\t\treturn \"white\";\n\t\t\t}\n\t\t}\n\n\t\treturn \"white\";\n\t}", "public function Colorcase(){\n\t\t$this->__construct();\n\t}", "public function getAppearanceTextColor() {}", "public function getColor($hColor, $type) {\n// const INDEX_TABLE_HEADER_TXT = 3;\n// \n// const SHOW_NOTE_HEADING_BG = 2;\n// const SHOW_NOTE_HEADING_TXT = 4;\n \n switch($hColor) {\n case \"primary\": {\n if($type == 1) return \"#337ab7\";\n if($type == 2) return \"#337ab7\";\n if($type == 3) return \"#ddd\";\n if($type == 4) return \"#ddd\";\n if($type == 5) return \"#337ab7\";\n \n }\n case \"success\": {\n if($type == 1) return \"#5CB85C\";\n if($type == 2) return \"#5Cdd5C\";\n if($type == 3) return \"#eee\";\n if($type == 4) return \"#fff\";\n \n }\n case \"info\": {\n if($type == 1) return \"#5BC0DE\";\n if($type == 2) return \"#5BC0DE\";\n if($type == 3) return \"#eee\";\n if($type == 4) return \"#fff\";\n \n }\n case \"warning\": {\n if($type == 1) return \"#EC971F\";\n if($type == 2) return \"#EC971F\";\n if($type == 3) return \"#fff\";\n if($type == 4) return \"#fff\";\n \n }\n case \"danger\": {\n if($type == 1) return \"#C9302C\";\n if($type == 2) return \"#C9302C\";\n if($type == 3) return \"#fff\";\n if($type == 4) return \"#fff\";\n \n }\n default: return $hColor;\n }\n }", "static function red($text) {\n\t\techo (self::$colorize) ? \"\\033[31m\".$text.\"\\033[0m\" : $text;\n\t}", "public function colorList() {}", "public static function title();", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "function getColor(){\n\t\treturn $this->color_ficha;\n\t}", "public function backgroundColor()\n {\n return '#dddddd';\n }", "public function getColor()\n {\n // Busca en esta clase la propiedad X\n return $this->color;\n }", "function bgColor() {\n\t$color = dechex(rand(0x000000, 0xDDDDDD));\n\treturn \"#{$color}\";\n}", "public function title();", "public function title();", "public static function get_title_style() {\n\t\t$post_id = wpv_get_the_ID();\n\n\t\tif(!current_theme_supports('wpv-page-title-style') || is_null($post_id))\n\t\t\treturn;\n\n\t\t$bgcolor = wpv_sanitize_accent(wpv_post_meta($post_id, 'local-title-background-color', true));\n\t\t$bgimage = wpv_post_meta($post_id, 'local-title-background-image', true);\n\t\t$bgrepeat = wpv_post_meta($post_id, 'local-title-background-repeat', true);\n\t\t$bgsize = wpv_post_meta($post_id, 'local-title-background-size', true);\n\t\t$bgattachment = wpv_post_meta($post_id, 'local-title-background-attachment', true);\n\t\t$bgposition = wpv_post_meta($post_id, 'local-title-background-position', true);\n\n\t\t$style = '';\n\t\tif(!empty($bgcolor))\n\t\t\t$style .= \"background-color:$bgcolor;\";\n\t\tif(!empty($bgimage)) {\n\t\t\t$style .= \"background-image:url('$bgimage');\";\n\t\t\tif(!empty($bgrepeat))\n\t\t\t\t$style .= \"background-repeat:$bgrepeat;\";\n\t\t\tif(!empty($bgsize))\n\t\t\t\t$style .= \"background-size:$bgsize;\";\n\t\t}\n\n\t\treturn $style;\n\t}", "function wpvideocoach_get_introduction_text_color()\r\n{\r\n\tglobal $wpvideocoach_introduction_text_color;\r\n\tif(empty($wpvideocoach_introduction_text_color)){\r\n\t\t$wpvideocoach_introduction_text_color = '#000';\r\n\t}\r\n\treturn $wpvideocoach_introduction_text_color;\r\n}", "function render_HTML_title($title_orig, $mise_en_page, $bg_color, $titre_position, $titre_style) {\n\n \n $title_br = implode(\"<br>\", explode('§', $title_orig));\n \n // on split le titre en 2 si besoin (trop long ou présence d'un '§')\n $title1 = $title_orig; $title2 = $title_orig;\n if ((strlen($title_orig) > 6 && $mise_en_page != 'texte-centre') || strpos($title_orig, '§') !== false) {\n if (strpos($title_orig, ' ') !== false || strpos($title_orig, '§') !== false) {\n $arr = explode('§', $title_orig);\n if (count($arr) < 2) $arr = explode(' ', $title_orig);\n $title1 = implode(' ', array_slice($arr, 0, count($arr)-1)); $title2 = $arr[count($arr)-1];\n } \n }\n\n $title_black = ($bg_color == 'blanc') ? ' has-text-color has-noir-color' : '';\n\n // render title\n $ifmtauto = ($mise_en_page == 'texte-centre') ? ' mt-auto' : 'col-md-4' ;\n $title_align = ($titre_position == 'titre-centre') ? 'text-center' : 'text-left';\n $title_align = ($titre_position == 'titre-droite') ? 'text-right': $title_align;\n $html_title = '<div class=\"col-sm-12 double_title '.$ifmtauto.'\">\n <h2 class=\"w-100 '.$title_align.' point '.$title_black.'\">' . $title1 . '</h2>\n <h2 class=\"w-100 '.$title_align.' point hollow '.$title_black.'\">' . $title2 . '</h2>\n </div>';\n if ($titre_style == 'titre-simple' || $mise_en_page == \"texte-centre\" && strpos($title_orig, '§') !== false) $html_title = '<h2 class=\"w-100 col-lg-12 '.$title_align.' mt-auto\">' . $title_br . '</h2>';\n if ($title_orig == '') $html_title = \"\";\n\n return $html_title;\n}", "function pl_footer_color(){\n\t\n\t$color = ( pl_check_color_hash( ploption( 'footer_text' ) ) ) ? pl_hash_strip( ploption( 'footer_text' ) ) : '999999';\n\t\n\treturn $color;\n}", "private function setRedTopBorder(){\n\t\techo \"decor| TopBorder RED \\n\";\n\t}", "function red($text){\r\n return \"<b><font color=red>\".$text.\"</font></b>\";\r\n}", "function get_background_color()\n {\n }", "public function colorize()\n\t {\n\t\t $div = array();\n\t\t if($this->_divSurround !== null)\n\t\t {\n\t\t\t $div = $this->makeDivSurround();\n\t\t } \n\t\t \n\t\t for($i=0;$i<count($this->_aCodeFragments);$i++)\n\t\t {\n\t\t\t $this->_aCodeColorizedFragments[$i] = \"<h2>\".$this->_aCodeTitles[$i].\"</h2>\";\n\t\t\t if($this->_divSurround[\"EVERY\"] === true)\n\t\t\t {\t\t\t\t\n\t\t\t\t$this->_aCodeColorizedFragments[$i] .= $div[\"OPENTAG\"].highlight_string($this->_aCodeFragments[$i], true).$div[\"CLOSETAG\"];\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t $this->_aCodeColorizedFragments[$i] .= highlight_string($this->_aCodeFragments[$i], true);\n\t\t\t }\t\t\t \n\t\t }\t\t \t\t\n\t }", "public function Black()\r\n {return new CmykColor(1, 1, 1, 1);}", "public function getInteriorColor() {}", "public function getInteriorColor() {}", "public function getInteriorColor() {}", "function SetTextColor($r,$g=-1,$b=-1)\n\t\t{\n\t\t\tif(($r==0 and $g==0 and $b==0) or $g==-1)\t\n\t\t\t\t$this->TextColor=sprintf('%.3f g',$r/255);\n\t\t\telse \n\t\t\t\t$this->TextColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);\n\t\t\t$this->ColorFlag = ($this->FillColor != $this->TextColor);\n\t\t}", "function get_column_header_colour() {\n return array(\n 129, 245, 173);\n }", "public function getColor()\n{\nreturn $this->color;\n}", "public function setColor() {\n\t\t$cnt = func_num_args();\n\t\tif ($cnt == 0) {\n\t\t\t$this->Color = new TColor(255,100,255);\n\t\t}\telse\n\t\tif ($cnt == 1) {\n\t\t\tlist ($sender) = func_get_args();\n\t\t\tif ($sender instanceof TColor) {\n\t\t\t\t$this->Color = new TColor(\n\t\t\t\t$sender->getRed (),\n\t\t\t\t$sender->getGreen(),\n\t\t\t\t$sender->getBlue ());\n\t\t\t}\telse\n\t\t\tif (is_string($sender)) {\n\t\t\t\t// todo: string\n\t\t\t}\n\t\t}\telse\n\t\tif ($cnt == 3) {\n\t\t\tlist($a1,$a2,$a3) = func_get_args();\n\t\t\t$this->Color = new TColor($a1,$a2,$a3);\n\t\t}\n\t}", "public function colorImage() {}", "public static function color(string $text, string $color = null, int $decoration = 0, string $bgColor = null) {}", "function getColor() {return $this->readColor();}", "function establece_color ($colordelcoche, $nombre_coche) {\n\n $this -> color = $colordelcoche; // Estamos asignando el valor del parametro a la propiedad color DE LA CLASE.\n \n echo \"El color de \" . $nombre_coche . \" es: \" . $this -> color;\n\n }", "public function red($text): string;", "public function getColor() {\n //Busca en esta clase la propiedad x\n return $this->color;\n }", "public function protected_title_format()\n {\n }", "public function protected_title_format()\n {\n }", "public function protected_title_format()\n {\n }", "function getTitle() ;", "public function drawTitle() {\n\t\t\treturn $this->title;\n\t\t}", "public function get_color()\n\t{\n\t\treturn $this->color;\n\t}", "function Header() {\n if(empty($this->title) || $this->PageNo() == 1) return;\n $oldColor = $this->TextColor;\n $this->SetTextColor(PDF_HEADER_COLOR['red'],\n PDF_HEADER_COLOR['green'],\n PDF_HEADER_COLOR['blue']);\n $x = $this->GetX();\n $y = $this->GetY();\n $this->SetY(10, false);\n $this->SetFont('', 'B');\n $this->Cell(0, 10, $this->title);\n $this->SetFont('', '');\n $this->SetXY($x, $y);\n $this->TextColor = $oldColor;\n }", "function block_core_home_link_build_css_colors($context)\n {\n }", "function wp_head() {\n\n\t\tif ( ! is_singular() ) return;\n\n\t\t// bail if no colors to show\n\t\t$pairs = get_option( 'color_style_options', false );\n\t\tif ( ! $pairs ) return;\n\n\t\techo \"<style>\\n\";\n\t\tforeach( $pairs as $id => $pair ) {\n\t\t\tlist( $name, $style ) = $pair;\n\t\t\t$color = get_post_meta( get_the_ID(), \"cso_$id\", true );\n\t\t\tif ( empty( $color ) ) continue;\n\t\t\techo str_replace( '%color%', $color, $style ) . \"\\n\";\n\t\t}\n\t\techo \"</style>\\n\";\n\n\t}", "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 _getColorTable() {}", "public function setTextColor($color) {}", "public function White()\r\n {return new CmykColor(0, 0, 0, 0);}" ]
[ "0.7096249", "0.70107734", "0.6979684", "0.66814655", "0.6673122", "0.65584165", "0.65584165", "0.65584165", "0.65584165", "0.6505964", "0.6499117", "0.6499117", "0.64491725", "0.642134", "0.6413471", "0.6411118", "0.6364862", "0.63640344", "0.63510656", "0.61426854", "0.61417747", "0.6124327", "0.6108577", "0.6108577", "0.61054474", "0.6070421", "0.6033516", "0.6015154", "0.59908944", "0.59874576", "0.59874576", "0.59751916", "0.59697986", "0.59648657", "0.5924047", "0.5923727", "0.5923727", "0.5905132", "0.5905003", "0.5901774", "0.58975095", "0.58403605", "0.5835982", "0.5806353", "0.57962126", "0.5768848", "0.57530695", "0.5747873", "0.5734798", "0.5723555", "0.5713633", "0.5709645", "0.5698578", "0.5698566", "0.5698566", "0.5698566", "0.5698566", "0.5698566", "0.5698566", "0.5696359", "0.56940526", "0.5693667", "0.5688657", "0.5660876", "0.5660876", "0.5656527", "0.5650283", "0.56411755", "0.5612631", "0.56117857", "0.56032807", "0.5592069", "0.55827415", "0.5581721", "0.5580272", "0.55795753", "0.55795753", "0.55734956", "0.5568143", "0.55573833", "0.55478024", "0.55458057", "0.55456793", "0.5538768", "0.55268204", "0.551926", "0.5517318", "0.55113584", "0.55113584", "0.55113584", "0.5508203", "0.549752", "0.5495243", "0.54908556", "0.5478305", "0.5478292", "0.5460459", "0.5431595", "0.5429681", "0.54260147" ]
0.7443092
0
/ =========================================================================== = Script : EGAT eLearning = Author : S.Kongdej
function getStartDate($courseid,$parent,$lessonid) { global $config,$start; // หาวันเปิดเรียนของ $scheduleid $sql = "SELECT LessonID, Length, LessonParentID FROM $config[tablelesson]"; $sql .= " WHERE CourseID='$courseid' AND LessonParentID='$parent' ORDER BY LessonParentID,Ordering"; $result=db_select($sql); for($i=0;list($id,$length,$parent) = mysql_fetch_row($result);$i++) { if ($id != $lessonid) { $start=dateAdd($start,$length+1); if (getStartDate($courseid,$id,$lessonid) == false) { break; } } else { return false; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function gagnerExperience()\n {\n }", "public function getDescent();", "public function getDescent() {}", "public function getDescent() {}", "public function getDescent() {}", "public function getDescent() {}", "public function getDescent() {}", "public function run()\n {\n _Log::system(_Log::$INFO, 'seeding educations');\n $ed1 = new Education(['name'=>'TK']);$ed1->save();\n $ed2 = new Education(['name'=>'SD']);$ed2->save();\n $ed3 = new Education(['name'=>'SMP']);$ed3->save();\n $ed4 = new Education(['name'=>'SMU']);$ed4->save();\n $ed5 = new Education(['name'=>'Diploma']);$ed5->save();\n $ed6 = new Education(['name'=>'Sarjana']);$ed6->save();\n $ed7 = new Education(['name'=>'Magister']);$ed7->save();\n $ed8 = new Education(['name'=>'Doktor']);$ed8->save();\n $ed9 = new Education(['name'=>'Tidak Ada']);$ed9->save();\n _Log::system(_Log::$SUCCESS, 'seeding educations success');\n }", "function ee() {\n\t\techo \"<pre>\";\n\t\t$args = func_get_args();\n\n\t\tforeach ( $args as $arg ) {\n\t\t\tprint_r( $arg );\n\t\t}\n\n\t\texit();\n\t}", "public function prog(){\n\n $this->capture('init;');\n\n try {\n // runtime/Php/test/Antlr/Tests/grammers/t026actions.g\n // runtime/Php/test/Antlr/Tests/grammers/t026actions.g\n {\n $this->match($this->input,$this->getToken('IDENTIFIER'),self::$FOLLOW_IDENTIFIER_in_prog48); \n $this->match($this->input,$this->getToken('EOF'),self::$FOLLOW_EOF_in_prog50); \n\n }\n\n\n $this->capture('after;');\n\n }\n catch ( RecognitionException $exc ) {\n\n $this->capture('catch;');\n throw $exc;\n \n }\n catch(Exception $e) {\n\n $this->capture('finally;');\n \n throw $e;\n }\n\n $this->capture('finally;');\n \n\n return ;\n }", "private function ESEseq_processing() {\n $this->record_progress(\"Step 8: ESEseq analysis\");\n\n $path_spliceman = $this->path_spliceman;\n $path_ESEseq_final = $this->path_ESEseq_final;\n\n exec(\"perl\\\n /var/www/html/spliceman_beta/scripts/spliceman_2_ESEseq.pl\\\n /var/www/html/spliceman_beta/genome_data/ESEseq_table.csv\\\n '$path_spliceman'\\\n > '$path_ESEseq_final'\", \n $ESEseq_array, \n $return);\n\n if ($return) {\n $this->pipeline_error(\n \"Error in pipeline, please contact administrator and\n provide step 8\");\n }\n }", "public function run()\n {\n $policies = array(\n '1' => '1.\tImprove access & equity in higher education',\n '2' => '2.\tImprove internal efficiency in higher education',\n '3' => '3.\tImprove quality & relevance of higher education',\n '4' => '4.\tImprove gender diversity in higher education',\n '5' => '5.\tImprove internationalization',\n '6' => '6.\tImprove capacity and resources mobilization',\n );\n\n $descriptions = array(\n '1.1' => '1.1\tIncrease capacity to enroll new students',\n '1.2' => '1.2\tIncrease enrollment in STEM study fields',\n '1.3' => '1.3\tIncrease participation of female students',\n '1.4' => '1.4\tIncrease participation of female students in STEM subjects',\n '1.5' => '1.5\tIncrease participation of persons with disabilities',\n '1.6' => '1.6\tIncrease participation of students from emerging regions',\n '1.7' => '1.7\tIncrease participation of students from economically poor households',\n\n '2.1' => '2.1\tReduce dropout rate of male and female students',\n '2.2' => '2.2\tReduce dropout rate of female students',\n '2.3' => '2.3\tReduce academic dismissal rate of male and female students',\n '2.4' => '2.4\tReduce academic dismissal rate of female students',\n '2.5' => '2.5\tIncrease graduation rate of male and female students',\n '2.6' => '2.6\tIncrease graduation rate of female students',\n '2.7' => '2.7\tIncrease graduation rate of students with disabilities',\n '2.8' => '2.8\tIncrease graduation rate of students from emerging regions',\n '2.9' => '2.9\tIncrease graduation rate of students from economically poor households',\n\n '3.1' => '3.1\tImprove quality of instruction in HEIs',\n '3.2' => '3.2\tImprove performance of students in exit examinations',\n '3.3' => '3.3\tImprove employability of students in HEIs',\n '3.4' => '3.4\tImprove quality, relevance and accessibility of higher education research and research outputs',\n\n '4.1' => '4.1\t Improve gender diversity of academic staff',\n '4.2' => '4.2\t Improve gender diversity of technical support staff',\n '4.3' => '4.3\t Improve gender diversity of professional staff in teaching hospitals',\n '4.4' => '4.4\t Improve gender diversity of administrative support staff',\n '4.5' => '4.5\t Improve gender diversity of staff appointed at senior management positions',\n '4.6' => '4.6\t Improve gender diversity of staff appointed at middle management positions',\n '4.7' => '4.7\t Improve gender diversity of staff appointed at lower management positions',\n\n '5.1' => '5.1\tIncrease the contribution of Ethiopian diaspora in academic activities',\n '5.2' => '5.2\tIncrease student exchange between Ethiopian and foreign universities',\n\n '6.1' => '6.1\tIncrease funds for research and development',\n '6.2' => '6.2\tIncrease resources mobilized from sources other than the government subsidy budget',\n '6.3' => '6.3\tIncrease efficiency in utilizing funds',\n '6.4' => '6.4\tDecrease dependency on expatriate academic staff',\n '6.5' => '6.5\tReduce staff attrition rate',\n );\n\n $kpis = InstitutionReportCard::getEnum('kpi');\n\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.1', '1.1.1');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.1', '1.1.2');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.1', '1.1.3');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.1', '1.1.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.2', '1.2.1');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.2', '1.2.2');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.2', '1.2.3');\n\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.3', '1.3.1');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.3', '1.3.2');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.3', '1.3.3');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.3', '1.3.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.4', '1.4.1');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.4', '1.4.2');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.4', '1.4.3');\n\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.5', '1.5.1');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.5', '1.5.2');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.5', '1.5.3');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.5', '1.5.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.6', '1.6.1');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.6', '1.6.2');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.6', '1.6.3');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.6', '1.6.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.7', '1.7.1');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.7', '1.7.2');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.7', '1.7.3');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.7', '1.7.4');\n\n // break\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.1', '2.1.1', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.1', '2.1.2', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.1', '2.1.3', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.1', '2.1.4', true);\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.2', '2.2.1', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.2', '2.2.2', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.2', '2.2.3', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.2', '2.2.4', true);\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.3', '2.3.1', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.3', '2.3.2', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.3', '2.3.3', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.3', '2.3.4', true);\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.4', '2.4.1', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.4', '2.4.2', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.4', '2.4.3', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.4', '2.4.4', true);\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.5', '2.5.1');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.5', '2.5.2');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.5', '2.5.3');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.5', '2.5.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.6', '2.6.1');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.6', '2.6.2');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.6', '2.6.3');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.6', '2.6.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.7', '2.7.1');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.7', '2.7.2');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.7', '2.7.3');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.7', '2.7.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.8', '2.8.1');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.8', '2.8.2');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.8', '2.8.3');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.8', '2.8.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.9', '2.9.1');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.9', '2.9.2');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.9', '2.9.3');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.9', '2.9.4');\n\n // break\n\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.1', '3.1.1');\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.1', '3.1.2', true);\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.1', '3.1.3');\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.1', '3.1.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.2', '3.2.1');\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.3', '3.3.1');\n\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.4', '3.4.1');\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.4', '3.4.2');\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.4', '3.4.3');\n\n // break\n\n $this->saveKpi($policies, $descriptions, $kpis, '4', '4.1', '4.1.1');\n $this->saveKpi($policies, $descriptions, $kpis, '4', '4.2', '4.2.1');\n $this->saveKpi($policies, $descriptions, $kpis, '4', '4.3', '4.3.1');\n $this->saveKpi($policies, $descriptions, $kpis, '4', '4.4', '4.4.1');\n $this->saveKpi($policies, $descriptions, $kpis, '4', '4.5', '4.5.1');\n $this->saveKpi($policies, $descriptions, $kpis, '4', '4.6', '4.6.1');\n $this->saveKpi($policies, $descriptions, $kpis, '4', '4.7', '4.7.1');\n\n // break\n\n $this->saveKpi($policies, $descriptions, $kpis, '5', '5.1', '5.1.1');\n\n $this->saveKpi($policies, $descriptions, $kpis, '5', '5.2', '5.2.1');\n $this->saveKpi($policies, $descriptions, $kpis, '5', '5.2', '5.2.2');\n\n // break\n\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.1', '6.1.1');\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.2', '6.2.1');\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.3', '6.3.1', true);\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.4', '6.4.1', true);\n\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.5', '6.5.1', true);\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.5', '6.5.2', true);\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.5', '6.5.3', true);\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.5', '6.5.4', true);\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.5', '6.5.5', true);\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.5', '6.5.6', true);\n }", "function geneshop_gene() {\n module_load_include('inc', 'tripal_feature', 'tripal_feature.api');\n $sql = '\n SELECT G.gene_id as feature_id, F.feature_id as parent_id, FLOC.featureloc_id \n FROM {gene} G\n INNER JOIN {featureloc} FLOC ON FLOC.feature_id = G.gene_id\n INNER JOIN {feature} F ON F.feature_id = FLOC.srcfeature_id\n INNER JOIN {chado_feature} CHF ON CHF.feature_id = gene_id\n WHERE chf.nid = :nid\n ';\n $data = '';\n foreach ($_SESSION['basket']['items'] as $nid => $value) {\n $args = array(':nid' => $nid);\n $result = db_query($sql, $args)->fetchObject();\n $feature_id = $result->feature_id;\n $parent_id = $result->parent_id;\n $featureloc_id = $result->featureloc_id;\n $sequence = array();\n $sequence = tripal_get_feature_sequences(\n array(\n 'feature_id' => $feature_id,\n ),\n array(\n 'is_html' => 0\n )\n );\n if (count($sequence)>0) {\n if ($sequence[0]['residues']) { //if there are sequences in residues\n $sequence[0]['residues'] = strtoupper($sequence[0]['residues']);\n $data .= \">\".$sequence[0]['defline'].\"\\n\".$sequence[0]['residues'].\"\\n\";\n }\n else {\n $alignment = array();\n $alignment = geneshop_sequences_from_parent($feature_id, $parent_id, $featureloc_id);\n $data .= \">\".$alignment[0]['defline'].\"\\n\".$alignment[0]['residues'].\"\\n\";\n }\n }\n }\n drupal_add_http_header('Content-Type: text/plain');\n print $data;\n drupal_exit();\n}", "function geneshop_phylo() {\n/*\n * For testing function, required more than one sequence.\n * $mRNA_id = array(3,20,37,53,68);\n * $data = '';\n * foreach ($mRNA_id as $feature_id) {\n */\n module_load_include('inc', 'tripal_feature', 'tripal_feature.api');\n module_load_include('inc', 'clustalo', 'clustalo.restclient');\n $sql = '\n SELECT FRM.subject_id as feature_id\n FROM {gene} G\n INNER JOIN {feature_relationship} FRM ON FRM.object_id = G.gene_id\n INNER JOIN {chado_feature} CHF ON CHF.feature_id = gene_id\n WHERE chf.nid = :nid\n ';\n $data = '';\n foreach ($_SESSION['basket']['items'] as $nid => $value) {\n $args = array(':nid' => $nid);\n $result = db_query($sql, $args)->fetchObject();\n $feature_id = $result->feature_id;\n $sequence = array();\n $sequence = tripal_get_feature_sequences(\n array(\n 'feature_id' => $feature_id,\n ),\n array(\n 'relationship_type' => 'derives_from',\n 'relationship_part' => 'object',\n 'is_html' => 0\n )\n );\n if (count($sequence)>0) {\n $data .= \">\".$sequence[0][defline].\"\\n\";\n if ($sequence[0]['residues']) { //if there are sequences in residues\n $sequence[0]['residues'] = strtoupper($sequence[0]['residues']);\n $data .= $sequence[0]['residues'].\"\\n\";\n }\n }\n }\n\n// set parameter and send to ClustalO service.\n $parameters = array(\n 'sequence' => $data,\n );\n $phylo = clustalo_submit_job($parameters, true);\n\n// send phylogenetic tree in newick form to draw a tree in python script.\n $enphy = urlencode($phylo);\n $command = drupal_get_path(\"module\", \"geneshop\").\"/cgi_ete.py .$enphy\";\n system(\"python2.6 \".$command);\n}", "public function main()\r\n {\r\n \r\n }", "function geneshop_mrna() {\n module_load_include('inc', 'tripal_feature', 'tripal_feature.api');\n $sql = '\n SELECT FR.subject_id as feature_id, FLOC.srcfeature_id as parent_id, FLOC.featureloc_id \n FROM {gene} G\n INNER JOIN {feature_relationship} FR ON FR.object_id = G.gene_id\n INNER JOIN {featureloc} FLOC ON FLOC.feature_id = FR.subject_id\n INNER JOIN {chado_feature} CHF ON CHF.feature_id = gene_id\n WHERE chf.nid = :nid\n ';\n $data = '';\n foreach ($_SESSION['basket']['items'] as $nid => $value) {\n $args = array(':nid' => $nid);\n $result = db_query($sql, $args)->fetchObject();\n $feature_id = $result->feature_id;\n $parent_id = $result->parent_id;\n $featureloc_id = $result->featureloc_id;\n $sequence = array();\n $sequence = tripal_get_feature_sequences(\n array(\n 'feature_id' => $feature_id,\n ),\n array(\n 'is_html' => 0\n )\n );\n if (count($sequence)>0) {\n if ($sequence[0]['residues']) { //if there are sequences in residues\n $sequence[0]['residues'] = strtoupper($sequence[0]['residues']);\n $data .= \">\".$sequence[0][defline].\"\\n\".$sequence[0]['residues'].\"\\n\";\n }\n else {\n $alignment = array();\n $alignment = geneshop_sequences_from_parent($feature_id, $parent_id, $featureloc_id);\n $data .= \">\".$alignment[0]['defline'].\"\\n\".$alignment[0]['residues'].\"\\n\";\n }\n }\n drupal_add_http_header('Content-Type: text/plain');\n print $data;\n drupal_exit();\n }\n}", "public function run()\n {\n $modules = [\n 'Computer Science',\n 'Information Systems',\n 'Computer Engineering',\n 'Business Analytics',\n 'Information Security',\n 'Algorithms & Theory',\n 'Artificial Intelligence',\n 'Computer Graphics and Games',\n 'Computer Security',\n 'Database Systems',\n 'Multimedia Information Retrieval',\n 'Networking and Distributed Systems',\n 'Parallel Computing',\n 'Programming Languages',\n 'Software Engineering',\n 'Interactive Media',\n 'Visual Computing',\n 'CS1010 Programming Methodology',\n 'CS1020 Data Structures and Algorithms I',\n 'CS2010 Data Structures and Algorithms II',\n 'CS1231 Discrete Structures',\n 'CS2100 Computer Organisation',\n 'CS2103T Software Engineering',\n 'CS2105 Introduction to Computer Networks',\n 'CS2106 Introduction to Operating Systems',\n 'CS3230 Design and Analysis of Algorithms',\n 'CS3201 Software Engineering Project',\n 'CS3202 Software Engineering Project II',\n 'CS3216 Software Product Engineering for Digital Markets',\n 'CS3217 Software Engineering on Modern Application Platforms',\n 'CS3281 Thematic Systems Project I',\n 'CS3282 Thematic Systems Project II',\n 'CS3283 Media Technology Project I',\n 'CS3284 Media Technology Project II',\n 'IS1103/FC/X Computing and Society',\n 'CS2101 Effective Communication for Computing Professionals',\n 'ES2660 Communicating in the Information Age',\n 'MA1301/FC/X Introductory Mathematics',\n 'MA1521 Calculus for Computing',\n 'MA1101R Linear Algebra I',\n 'ST2334 Probability and Statistics',\n 'ST2131 Probability',\n 'ST2132 Mathematical Statistics',\n 'PC1221/FC/X Fundamental of Physics I',\n 'PC1222/X Fundamentals of Physics II',\n 'CS1101S Programming Methodology',\n 'CS2020 Data Structures and Algorithms Accelerated',\n 'CM1121 ORGANIC CHEMISTRY 1',\n 'CM1131 PHYSICAL CHEMISTRY 1',\n 'CM1417 FUNDAMENTALS OF CHEMISTRY',\n 'LSM1301 GENERAL BIOLOGY',\n 'LSM1302 GENES AND SOCIETY',\n 'PC1141 PHYSICS I',\n 'PC1142 PHYSICS II',\n 'PC1143 PHYSICS III',\n 'PC1144 PHYSICS IV',\n 'PC1221 FUNDAMENTALS OF PHYSICS I ',\n 'PC1222 FUNDAMENTALS OF PHYSICS II PC1432 PHYSICS IIE',\n 'MA2213 NUMERICAL ANALYSIS I',\n 'MA2214 COMBINATORICS AND GRAPHS I',\n 'CM1101 PRINCIPLES OF MODERN CHEMISTRY ',\n 'CM1111 INORGANIC CHEMISTRY 1',\n 'CM1161 PRINCIPLESOF CHEMICAL PROCESS I ',\n 'CM1191 EXPERIMENTS IN CHEMISTRY 1 ',\n 'CM1401 CHEMISTRY FOR LIFE SCIENCES',\n 'CM1402 GENERAL CHEMISTRY',\n 'CM1501 ORGANIC CHEMISTRY FOR ENGINEERS',\n 'CM1502 GENERAL AND PHYSICAL CHEMISTRY FOR ENGINEERS ',\n 'LSM1303 ANIMAL BEHAVIOUR',\n 'PC1421 PHYSICS FOR LIFE SCIENCES',\n 'PC1431 PHYSICS IE',\n 'PC1433 MECHANICS AND WAVES',\n 'MA1104 MULTIVARIABLE CALCULUS',\n 'MA2101 LINEAR ALGEBRA II',\n 'MA2108 MATHEMATICAL ANALYSIS I',\n 'MA2501 DIFFERENTIAL EQUATIONS AND SYSTEMS',\n 'ST2132 MATHEMATICAL STATISTICS',\n 'ST2137 COMPUTER AIDED DATA ANALYSIS',\n 'CS3230 Design and Analysis of Algorithms (CFM)',\n 'CS3236 Introduction to Information Theory',\n 'CS4231 Parallel and Distributed Algorithms',\n 'CS4232 Theory of Computation',\n 'CS4234 Optimisation Algorithms',\n 'CS3233 Competitive Programming',\n 'CS5230 Computational Complexity',\n 'CS5234 Combinatorial and Graph Algorithms',\n 'CS5237 Computational Geometry and Applications',\n 'CS5238 Advanced Combinatorial Methods in Bioinformatics',\n 'CS3243 Introduction to Artificial Intelligence',\n 'CS3244 Machine Learning',\n 'CS4244 Knowledge-Based Systems',\n 'CS4246 AI Planning and Decision Making',\n 'CS4216 Constraint Logic Programming',\n 'CS4220 Knowledge Discovery Methods in Bioinformatics',\n 'CS4248 Natural Language Processing',\n 'CS5209 Foundation in Logic & AI',\n 'CS5215 Constrained Programming',\n 'CS5228 Knowledge Discovery and Data Mining',\n 'CS5247 Motion Planning and Applications',\n 'CS5340 Uncertainty Modelling in AI',\n 'CS3241 Computer Graphics',\n 'CS3242 3D Modelling and Animation',\n 'CS3247 Game Development',\n 'CS4247 Graphics Rendering Techniques',\n 'CS4350 Game Development Project',\n 'CS3218 Multimodal Processing in Mobile Platforms',\n 'CS3240 Interaction Design',\n 'CS3249 User Interface Development',\n 'CS3343 Digital Media Production',\n 'CS4243 Computer Vision and Pattern Recognition',\n 'CS4249 Phenomena and Theories of HCI',\n 'CS4340 Digital Special Effects',\n 'CS4344 Network and Mobile Gaming',\n 'CS4345 General-Purpose Computation on GPU',\n 'CS5240 Theoretical Foundation of Multimedia',\n 'CS2107 Introduction to Information Security',\n 'CS3235 Computer Security',\n 'CS4236 Cryptography Theory and Practice',\n 'CS4238 Computer Security Practices',\n 'CS3221 Operating Systems Design and Pragmatics',\n 'CS4239 Software Security',\n 'CS5231 Systems Security',\n 'CS5321 Network Security',\n 'CS5322 Database Security',\n 'CS5331 Web Security',\n 'IFS4101 Legal Aspects of Information Security',\n 'IS3230 Principles of Information Security',\n 'IS4231 Information Security Management',\n 'IS4232 Topics in Information Security',\n 'CS2102 Database Systems',\n 'CS3223 Database Systems Implementation',\n 'CS4221 Database Applications Design and Tuning',\n 'CS4224 Distributed Databases',\n 'CS4225 Massive Data Processing Techniques in Data Science',\n 'CS5226 Database Tuning',\n 'CS2108 Introduction to Media Computing&',\n 'CS3245 Information Retrieval',\n 'CS4242 Social Media Computing',\n 'CS4347 Sound and Music Computing',\n 'CS5246 Text Processing on the Web',\n 'CS5241 Speech Processing',\n 'CS6242 Digital Libraries',\n 'CS5342 Multimedia Computing and Applications',\n 'CS3103 Computer Networks Practice',\n 'CS4222 Wireless Computing',\n 'CS4226 Internet Architecture',\n 'CS4274 Mobile and Multimedia Networking',\n 'CS4344 Networked and Mobile Gaming',\n 'CS5223 Distributed Systems',\n 'CS5229 Advanced Computer Networks',\n 'CS5248 Systems Support for Continuous Media',\n 'CS3210 Parallel Computing',\n 'CS3211 Parallel and Concurrent Programming',\n 'CS4223 Multi-core Architecture',\n 'CS4237 Systems Modelling and Simulation',\n 'CS4271 Critical Systems and Their Verification',\n 'CS5207 Foundation in Operating Systems',\n 'CS5222 Advanced Computer Architectures',\n 'CS5239 Computer System Performance Analysis',\n 'CS2104 Programming Language Concepts',\n 'CS4215 Programming Language Implementation',\n 'CS4212 Compiler Design',\n 'CS3234 Logic and Formal Systems',\n 'CS5205 Foundation in Programming Languages',\n 'CS5232 Formal Specification & Design Techniques',\n 'CS5214 Design of Optimising Compilers',\n 'CS5218 Principles of Program Analysis',\n 'CS2103 Software Engineering',\n 'CS3213 Software Systems Design',\n 'CS3219 Software Engineering Principles and Patterns',\n 'CS4211 Formal Methods for Software Engineering',\n 'CS4218 Software Testing',\n 'CS3216 Software Development on Evolving Platforms',\n 'CS3226 Web Programming and Applications',\n 'CS3882 Breakthrough Ideas for Digital Markets',\n 'CS4217 Software Development Technologies',\n 'CS5219 Automatic Software Validation',\n 'CS5272 Embedded Software Design',\n 'IS2102 Requirements Analysis and Design',\n 'IS2104 Software Team Dynamics',\n 'CS3242 3D Modeling and Animation',\n 'CS6243 Computational Photography',\n 'CS1010J Programming Methodology',\n 'IS1103/FC Computing and Society',\n 'IS1105 Strategic IT Applications',\n 'IS2101 Business and Technical Communication',\n 'IS2103 Enterprise Systems Development Concepts',\n 'IS3101 Management of Information Systems',\n 'IS3102 Enterprise Systems Development Project',\n 'IS4100 IT Project Management',\n 'ACC1002X Financial Accounting',\n 'MA1301 Introductory Mathematics',\n 'MA1312 Calculus with Applications',\n 'CP4101 B.Comp. Dissertation',\n 'CS2106 Introduction to Operating Systems ',\n 'CS3235 Introduction to Computer Security',\n 'IS3220 Service Science ',\n 'IS3221 Enterprise Resource Planning Systems',\n 'IS3222 IT and Customer Relationship Management ',\n 'IS3223 IT and Supply Chain Management ',\n 'IS3240 Economics of E-Business',\n 'IS3241 Enterprise Social Systems',\n 'IS3242 Software Quality Management',\n 'IS3243 Technology Strategy and Management',\n 'IS3250 Health Informatics',\n 'IS3251 Principles of Technology Entrepreneurship',\n 'IS3260 Gamification for Organisations and Individuals',\n 'IS3261 Mobile Apps Development',\n 'CS4880 Digital Entrepreneurship',\n 'IS4202 Global Virtual Project',\n 'IS4203 IT Adoption and Change Management',\n 'IS4204 IT Governance',\n 'IS4224 Service Systems ',\n 'IS4225 Strategic IS Planning ',\n 'IS4226 IT Outsourcing and Offshoring Management ',\n 'IS4227 Enterprise Service-Oriented Architecture ',\n 'IS4228 Information Technologies in Financial Services',\n 'IS4232 Topics in Information Security Management',\n 'IS4233 Legal Aspects of Information Technology',\n 'IS4234 Control and Audit of Information Systems',\n 'IS4240 Business Intelligence Systems',\n 'IS4241 Social Media Network Analysis',\n 'IS4243 Information Systems Consulting',\n 'IS4250 Healthcare Analytics',\n 'IS3150 Digital and New Media Marketing',\n 'IS4150 Mobile and Ubiquitous Commerce',\n 'IS4260 E-Commerce Business Models',\n 'IS3222 IT and Customer Relationship Management',\n 'IS3261 Mobile Apps Development for Enterprise',\n 'IS4225 Strategic IS Planning',\n 'IS4010 Industry Internship Programme',\n 'BT1101 Introduction to Business Analytics',\n 'CS1010S Programming Methodology',\n 'EC1301 Principles of Economics',\n 'IS1103 Computing and Society',\n 'MA1311 Matrix Algebra and Applications',\n 'MA1101R Linear Algebra I2',\n 'MA1102R Calculus2',\n 'MKT1003X Marketing',\n 'BT2101 IT and Decision Making',\n 'BT2102 Data Management and Visualisation',\n 'IE2110 Operations Research I3',\n 'DSC3214 Introduction To Optimisation',\n 'IS2101 Business and Technical Communication4',\n 'BT3101 Business Analytics Capstone Project',\n 'BT3102 Computational Methods for Business Analytics',\n 'BT3103 Application Systems Development for Business Analytics',\n 'ST3131 Regression Analysis',\n 'BT4101 B.Sc. Dissertation',\n 'DSC3224 Dynamic Pricing and Revenue Management',\n 'IE3120 Manufacturing Logistics',\n 'BT4211 Data-Driven Marketing',\n 'BT4212 Search Engine Optimization and Analytics',\n 'DSC4213 Analytical Tools for Consulting',\n 'MKT4415C Seminars in Marketing: Applied Market Research',\n 'DSC3216 Forecasting for Managerial Decisions',\n 'BSP4513 Econometrics: Theory & Practical Business Application',\n 'BT4221 Big Data Techniques and Technologies',\n 'BT4222 Mining Web Data for Business Insights',\n 'IE4210 Operations Research II',\n 'ST4240 Data Mining',\n 'ST4245 Statistical Methods for Finance',\n\n ];\n\n foreach ($modules as $module) {\n \\App\\Topic::create([\n 'name' => $module,\n ], 1);\n }\n }", "public function main()\n\t{\n\t}", "public function run()\n {\n // Names (30 of each)\n $firstnames_female = [\n 'Elisabeth', 'Leela', 'Tess', 'Marlene', 'Amiyah',\n 'Emeline', 'Maureen', 'Ellie', 'Danielle', 'Kacie',\n 'Dale', 'Loren', 'Lilly', 'Kelly', 'Mila',\n 'Jeane', 'Eliane', 'Marie', 'Kim', 'Caroline', 'Julie',\n 'Sylvie', 'Fanny', 'Caroline', 'Dorianne', 'Camille',\n 'Louise', 'Anna', 'Delphine', 'Jeanine', 'Amanda',\n ];\n $firstnames_male = [\n 'John', 'Sergiy', 'Célien', 'Hubert', 'David',\n 'Yoan', 'Simon', 'Célestin', 'Guillaume', 'Adrien',\n 'Louis', 'Maxime', 'Julien', 'Jules', 'Fabien',\n 'Kevin', 'Noah', 'Ludovic', 'Alexandre', 'Jordy',\n 'Félix', 'Erwan', 'Etienne', 'Kim', 'Quentin', 'Malik',\n 'Damian', 'Paul', 'Farid', 'Lucas', 'Bastien',\n ];\n $lastnames = [\n 'Graells', 'Donzé', 'Goloviatinski', 'Droz', 'Grünenwald',\n 'Blanc', 'Droz', 'Wermeille', 'Salomon', 'Perrelet',\n 'Wohlfahrt', 'Biloni', 'Herbelin', 'Abdalla', 'Bütikofer', 'Chacun',\n 'Bueche', 'Hüssler', 'Vorpe', 'Grava', 'Feuillade',\n 'Fleury', 'Mottier', 'Petroff', 'Dias', 'Gros',\n 'Arfa', 'Jeanneret', 'Rizzoti', 'Prêtre', 'Bianchi',\n ];\n\n // family antecedents (30)\n $family_antecedents = [\n 'Is it free?',\n 'Don\\'t step on the broken glass.',\n 'Malls are great places to shop; I can find everything I need under one roof.',\n 'He said he was not there yesterday; however, many people saw him there.',\n 'There was no ice cream in the freezer, nor did they have money to go to the store.',\n 'The river stole the gods.',\n 'Lets all be unique together until we realise we are all the same.',\n 'I am counting my calories, yet I really want dessert.',\n 'Let me help you with your baggage.',\n 'The shooter says goodbye to his love.',\n 'The lake is a long way from here.',\n 'The clock within this blog and the clock on my laptop are 1 hour different from each other.',\n 'Last Friday in three week’s time I saw a spotted striped blue worm shake hands with a legless lizard.',\n 'He didn’t want to go to the dentist, yet he went anyway.',\n 'She works two jobs to make ends meet; at least, that was her reason for not having time to join us.',\n 'How was the math test?',\n 'If the Easter Bunny and the Tooth Fairy had babies would they take your teeth and leave chocolate for you?',\n 'The book is in front of the table.',\n 'He told us a very exciting adventure story.',\n 'I will never be this young again. Ever. Oh damn… I just got older.',\n 'She did not cheat on the test, for it was not the right thing to do.',\n 'We need to rent a room for our party.',\n 'If I don’t like something, I’ll stay away from it.',\n 'I am never at home on Sundays.',\n 'The old apple revels in its authority.',\n 'Cats are good pets, for they are clean and are not noisy.',\n 'Joe made the sugar cookies; Susan decorated them.',\n 'I think I will buy the red car, or I will lease the blue one.',\n 'I am happy to take your donation; any amount will be greatly appreciated.',\n 'Please wait outside of the house.',\n ];\n\n // medical antecedents (30)\n $medical_antecedents = [\n 'She works two jobs to make ends meet; at least, that was her reason for not having time to join us.',\n 'Someone I know recently combined Maple Syrup & buttered Popcorn thinking it would taste like caramel popcorn. It didn’t and they don’t recommend anyone else do it either.',\n 'The old apple revels in its authority.',\n 'If you like tuna and tomato sauce- try combining the two. It’s really not as bad as it sounds.',\n 'The mysterious diary records the voice.',\n 'Yeah, I think it\\'s a good environment for learning English.',\n 'I want to buy a onesie… but know it won’t suit me.',\n 'We have a lot of rain in June.',\n 'When I was little I had a car door slammed shut on my hand. I still remember it quite vividly.',\n 'Sixty-Four comes asking for bread.',\n 'Two seats were vacant.',\n 'Malls are great places to shop; I can find everything I need under one roof.',\n 'We have never been to Asia, nor have we visited Africa.',\n 'The waves were crashing on the shore; it was a lovely sight.',\n 'Joe made the sugar cookies; Susan decorated them.',\n 'Let me help you with your baggage.',\n 'The lake is a long way from here.',\n 'Last Friday in three week’s time I saw a spotted striped blue worm shake hands with a legless lizard.',\n 'I am never at home on Sundays.',\n 'Where do random thoughts come from?',\n 'Italy is my favorite country; in fact, I plan to spend two weeks there next year.',\n 'The book is in front of the table.',\n 'Rock music approaches at high velocity.',\n 'She folded her handkerchief neatly.',\n 'Writing a list of random sentences is harder than I initially thought it would be.',\n 'He said he was not there yesterday; however, many people saw him there.',\n 'I checked to make sure that he was still alive.',\n 'The clock within this blog and the clock on my laptop are 1 hour different from each other.',\n 'Christmas is coming.',\n 'The river stole the gods.',\n ];\n\n // Egg Donor\n for ($i = 0; $i < 30; $i++) {\n $fn = $firstnames_female[rand(0, 29)];\n $ln = $lastnames[rand(0, 29)];\n \n $dateint = mt_rand(strtotime('1980-01-01'), strtotime('2000-12-31'));\n $date = date(\"Y-m-d\", $dateint);\n\n try {\n $id = DB::table('users')->insertGetId([\n 'user_type_id' => 1,\n 'name' => $fn . ' ' . $ln,\n 'email' => $fn . '.' . $ln . '@egg.ch',\n 'password' => bcrypt('123456'),\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n ]);\n\n DB::table('donors')->insert([\n 'user_id' => $id,\n 'sex' => 1,\n 'birth_date' => $date,\n 'eye_color' => rand(1, 3),\n 'hair_color' => rand(1, 3),\n 'ethnicity' => rand(1, 3),\n 'family_antecedents' => $family_antecedents[rand(0, 29)],\n 'medical_antecedents' => $medical_antecedents[rand(0, 29)],\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n ]);\n } catch (Exception $e) {\n $i--;\n }\n }\n\n // Sperm Donor\n for ($i = 0; $i < 30; $i++) {\n $fn = $firstnames_male[rand(0, 29)];\n $ln = $lastnames[rand(0, 29)];\n\n $dateint = mt_rand(strtotime('1980-01-01'), strtotime('2000-12-31'));\n $date = date(\"Y-m-d\", $dateint);\n\n try {\n $id = DB::table('users')->insertGetId([\n 'user_type_id' => 1,\n 'name' => $fn . ' ' . $ln,\n 'email' => $fn . '.' . $ln . '@sperm.ch',\n 'password' => bcrypt('123456'),\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n ]);\n\n DB::table('donors')->insert([\n 'user_id' => $id,\n 'sex' => 0,\n 'birth_date' => $date,\n 'eye_color' => rand(1, 3),\n 'hair_color' => rand(1, 3),\n 'ethnicity' => rand(1, 3),\n 'family_antecedents' => $family_antecedents[rand(0, 29)],\n 'medical_antecedents' => $medical_antecedents[rand(0, 29)],\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n ]);\n } catch (Exception $e) {\n $i--;\n }\n }\n }", "function geneshop_polypeptides() {\n module_load_include('inc', 'tripal_feature', 'tripal_feature.api');\n $sql = '\n SELECT FRM.subject_id as feature_id\n FROM {gene} G\n INNER JOIN {feature_relationship} FRM ON FRM.object_id = G.gene_id\n INNER JOIN {chado_feature} CHF ON CHF.feature_id = gene_id\n WHERE chf.nid = :nid\n ';\n $data = '';\n foreach ($_SESSION['basket']['items'] as $nid => $value) {\n $args = array(':nid' => $nid);\n $result = db_query($sql, $args)->fetchObject();\n $feature_id = $result->feature_id;\n $sequence = array();\n $sequence = tripal_get_feature_sequences(\n array(\n 'feature_id' => $feature_id,\n ),\n array(\n 'aggregate' => 1,\n 'relationship_type' => 'derives_from',\n 'relationship_part' => 'object',\n 'is_html' => 0\n )\n );\n if (count($sequence)>0) {\n $data .= \">\".$sequence[0][defline].\"\\n\";\n if ($sequence[0]['residues']) { //if there are sequences in residues\n $sequence[0]['residues'] = strtoupper($sequence[0]['residues']);\n $data .= $sequence[0]['residues'].\"\\n\";\n }\n }\n }\n drupal_add_http_header('Content-Type: text/plain');\n print $data;\n drupal_exit();\n}", "public function run()\n {\n $sherlock = array(\n 'A Study in Pink',\n 'The Blind Banker',\n 'The Great Game',\n 'A Scandal in Belgravia',\n 'The Hounds of Baskerville',\n 'The Reichenbach Fall',\n 'The Empty Hearse',\n 'The Sign of Three',\n 'His Last Vow',\n 'The Six Thatchers',\n 'The Lying Detective',\n 'The Final Problem',\n );\n\n for($i=0;$i<count($sherlock);$i++){\n $ep = new Episode();\n $ep->movie_id = 1;\n $ep->episode = $i+1;\n $ep->title = $sherlock[$i];\n $ep->save();\n }\n\n\n $kimetsu = array('Cruelty',\n 'Trainer Sakonji Urokodaki', \n 'Sabito and Makomo', \n 'Final Selection', \n 'My Own Steel', \n 'Swordsman Accompanying a Demon', \n 'Muzan Kibutsuji', \n 'The Smell of Enchanting Blood', \n 'Temari Demon and Arrow Demon', \n 'Together Forever', \n 'Tsuzumi Mansion',\n 'The Boar Bares Its Fangs, Zenitsu Sleeps',\n 'Something More Important Than Life',\n 'The House with the Wisteria Family Crest',\n 'Mount Natagumo',\n 'Letting Someone Else Go First',\n 'You Must Master a Single Thing',\n 'A Forged Bond', \n 'Hinokami',\n 'Pretend Family',\n 'Against Corps Rules',\n 'Master of the Mansion',\n 'Hashira Meeting',\n 'Rehabilitation Training',\n 'Tsuguko, Kanao Tsuyuri',\n 'New Mission');\n \n for($i=0;$i<count($kimetsu);$i++){\n $ep = new Episode();\n $ep->movie_id = 9;\n $ep->episode = $i+1;\n $ep->title = $kimetsu[$i];\n $ep->save();\n }\n }", "public function recommendation()\n {\n }", "function editSeq2($num, $post = false)\n{\n $hp = new Http();\n\n\n for ($id = 10417; $id <= 10616; $id++) {\n\n $r = intval(rand(-80, 80));\n while ($r == 0) {\n $r = intval(rand(-80, 80));\n }\n $b = intval(rand(-80, 80));\n $p = intval(rand(1, 4));\n\n $m = intval(rand(1, 5));\n\n $title = '';\n for ($i = 0; $i < 7; $i++) {\n //An = Rn^p + B, 填中间\n// if($i == $m){\n// $title = $title . \",?\";\n// continue;\n// }\n\n $data = $r * pow($i, $p) + $b;\n if ($i == 0) {\n $title = $title . \"$data\";\n } else {\n $title = $title . \",$data\";\n }\n }\n\n// An = Rn^p + B, 填末尾\n $title = $title . \",?\";\n $res = $r * pow(7, $p) + $b;\n //An = Rn^p + B, 填中间\n// $res = $r* pow($m,$p) + $b;\n\n $ar = [$res, $res + intval(rand(-5, -3)), $res + intval(rand(-2, -1)), $res + intval(rand(1, 4))];\n shuffle($ar);\n $optionAr = [\n 'a' => $ar[0],\n 'b' => $ar[1],\n 'c' => $ar[2],\n 'd' => $ar[3],\n ];\n //find correct answer\n for ($i = 0; $i < 4; $i++) {\n if ($ar[$i] == $res) {\n break;\n }\n }\n\n $ks = ['a', 'b', 'c', 'd'];\n $answers = [$ks[$i]];\n $language = 'en';\n $classification = 'sequence';\n $pro_type = 'exclusive choice';\n $pro_source = 'new-train-seq';\n if ($b == 0) {\n $hint = \"A[n]=$r*n^$p\";\n } else if ($b > 0) {\n $hint = \"A[n]=$r*n^$p+$b\";\n } else {\n $hint = \"A[n]=$r*n^$p$b\";\n\n }\n $problem_info = compact('title', 'optionAr', 'answers', 'language', 'classification', 'pro_type', 'pro_source', 'hint');\n\n echo 'id' . $id;\n echo PHP_EOL;\n echo json_encode($problem_info);//insert\n echo PHP_EOL;\n\n if ($post) {\n $hp->post('http://exp.szer.me/parry/testlib/problem/' . $id, $problem_info, false);\n } else {\n echo \"no post\";\n echo PHP_EOL;\n }\n }\n\n curl_close($hp->ch);\n\n\n}", "function train(){\n\t\t$sql = \"SELECT bow.idWord,COUNT(bow.idWord) as total from bow,sample WHERE bow.idTuit = sample.idTuit and sample.trainingSet = 1 and sample.class = 0 GROUP BY idWord\";\n\t\t$result = mysql_query($sql) or die(\"Classifier->train: error en consulta\".mysql_error().\"SQL: \".$sql);\n\t\t\n\t\twhile ($row = mysql_fetch_array($result, MYSQL_NUM)) {\n \t\t$idWord = $row[0]; \n\t\t\t$count = $row[1]; \n\t\t\t$sql = \"UPDATE dictionary SET n_nondoc = $count WHERE idWord = $idWord\";\n\t\t\tmysql_query($sql) or die(\"Classifier->train_2: error en consulta\".mysql_error().\"SQL: \".$sql);\n\t\t}\n\t\t\n\t\t//luego los no documentales\n\t\t$sql = \"SELECT bow.idWord,COUNT(bow.idWord) as total from bow,sample WHERE bow.idTuit = sample.idTuit and sample.trainingSet = 1 and sample.class = 1 GROUP BY idWord\";\n\t\t$result = mysql_query($sql) or die(\"Classifier->train_3: error en consulta\".mysql_error().\"SQL: \".$sql);\n\t\t\n\t\twhile ($row = mysql_fetch_array($result, MYSQL_NUM)) {\n \t\t$idWord = $row[0]; \n\t\t\t$count = $row[1]; \n\t\t\t$sql = \"UPDATE dictionary SET n_doc = $count WHERE idWord = $idWord\";\n\t\t\tmysql_query($sql) or die(\"Classifier->train_4: error en consulta\".mysql_error().\"SQL: \".$sql);\n\t\t}\n\t\n\t}", "public function elso()\n {\n }", "public function run()\n {\n $nomes_jogos =['Diablo 3', 'Dishonored', 'Far Cry 3', 'Mortal Kombat', 'Resident Evil 6', 'Skyrim', 'Tomb Raider'];\n\n $desenvolvedor=['Blizzard', 'Arkane Studios', 'Ubisoft Montreal', 'Netherrealm Studios e ANDYN', 'Capcom', 'Bethesda Game Studios', 'Core Design e Crystal Dynamics'];\n\n $plataformas=['PC', 'PC, Xbox 360 e Playstation 3', 'PC, Xbox 360 e Playstation 3', 'Xbox 360, PlayStation 3, PlayStation Vita ,Microsoft Windows', 'PlayStation 3, Xbox 360, Microsoft Windows', 'PC, Xbox 360 e Playstation 3', 'PlayStation 3, Xbox 360, Microsoft Windows'];\n\n $lancamento=['15 de maio de 2012', '12 de outubro de 2012', '30 de novembro de 2012', '28 de Abril de 2011', '2 de outubro de 2012', '11 de novembro de 2011', ' Lançamento do primeiro Tomb Raider foi em 1996'];\n\n $genero=['RPG', 'Stealth, ação-aventura, tiro em primeira pessoa', 'Tiro em primeira pessoa, \"mundo aberto\"', 'Luta', 'Horror dramático, survival horror, tiro na terceira pessoa', 'RPG', 'Terror Ação, Aventura, tiro na terceira pessoa'];\n\n $modo_de_jogo=['Single player/Multiplayer', 'Single player', 'Single player/Multiplayer', 'Single player/Multiplayer', 'Single player/Multiplayer', 'Single player', 'Single player'];\n\n $classificacao=['+16', '+18', '+18', '+18', '+18', '+18', '+18'];\n\n $descricao=[\n \t'Diablo III segue a história de seu predecessor, Diablo II: Lord of Destruction, que superou expectativas. A história do novo jogo passa-se depois de vinte anos dos acontecimentos que marcaram o fim de Diablo II. Os demônios Diablo, Mephisto e Baal foram derrotados, mas quando um cometa cai na Terra exatamente no lugar onde Diablo foi confinado, os guerreiros são novamente convocados para defender a humanidade contra as chamas do Inferno. O estilo do jogo continua o mesmo, mas desta vez utilizando os recursos das novas tecnologias reproduzindo um mundo totalmente em 3D e interativo, podendo até destruir cenários. Os jogadores poderão escolher entre cinco classes disponíveis e se aventurar num mundo mágico e ameaçador que Diablo III proporciona, porém desta vez, com novas habilidades e equipamentos e com um nível de personalização de personagem mais apurado.',\n \t 'És o antigo guarda-costas de confiança da Imperatriz. Injustamente culpado pelo seu assassinato, e movido pela vingança, terás de te tornar um infame assassino, conhecido apenas pela perturbadora máscara que se tornou o teu cartão-de-visita. À medida que vagueias por um mundo destroçado pela peste e oprimido por um governo armado com estranhas tecnologias, a verdade por detrás da tua traição é tão obscura como as águas que rodeiam a cidade. As tuas escolhas determinarão o destino do mundo, mas, o que quer que aconteça, a tua antiga vida desapareceu para sempre.',\n \t '\"Para além dos limites da civilização encontra-se uma ilha, um lugar sem lei governado por pirataria e miséria humana, onde os escapes são apenas as drogas ou o cano de uma arma. Este é o lugar onde você se encontra, preso num lugar que esqueceu o certo do errado, um lugar que vive pelos princípios da violência. Descubra os segredos sangrentos da ilha e leva a luta ao inimigo; improvise e use o ambiente para sobreviver. Cuidado com a beleza e o mistério deste paraíso inexplorado e vive para superar os seus personagens cruéis e desesperados. Irá precisar de mais do que sorte para sobreviver\". ',\n \t 'O jogo retorna as suas raízes, com lutas com movimentação completamente 2D, mas gráficos em 3D, onde não há mais possibilidade de se esquivar dos golpes andando para os lados e é o jogo mais rápido da série. Ao invés do clássico controle com Soco e Chute, Alto e Baixo, terá um botão pra cada membro sendo Braço e Perna, Esquerda e Direita.\n\n\t\t\t\tO jogo conta com vários modos de jogo. O principal é o Kombate, onde permite lutas um contra um ou em duplas, permitindo até 4 jogadores lutarem na mesma partida. Outro modo de jogo é a Torre dos Desafios, que consiste em uma grande torre dividida em 300 partes, onde cada parte contém um desafio a ser completado com um personagem especifico. Alguns dos desafios que compões a torre são os Minigames Teste sua Força, em que o jogador deve apertar freneticamente os botões do controle com o objetivo de acumular força para quebrar certos objetos; o Teste seu Golpe, onde o jogador deve acumular uma quantidade muito precisa de força para quebrar somente o objeto que está em uma pilha; o Teste sua Sorte, onde uma roleta sorteia várias condições especiais para a luta; e o Teste sua Percepção, onde um objeto é escondido em um dos vários copos/crânios e são embaralhados e cabe ao jogador descobrir onde estão.\n\n\t\t\t\tDurante as lutas foram adicionados vários novos sistemas e alguns reformulados, como os combos, onde pode-se ligar quase todos os golpes tendo poucos golpes que não tem ligação ou combos já programados e alguns personagens podem usar armas durante eles. Além disso os combos podem ser ligados com o parceiro no modo Tag-Team, assim criando sequencias únicas com dois personagens. Ao jogo também foi adicionada uma barra, que é usada para fazer movimentos especiais. Ela dividida em 3 níveis que podem respectivamente tornar os golpes especiais mais fortes, revidar um golpe e o Movimento de Raio-X, um combo mostrando os danos causados pelos golpes diretamente nos ossos e órgãos dos adversários, podendo retirar até 50% da vida do oponente dependendo do personagem. E por fim também há os Golpes Finais, um movimento em que se faz uma sequência de botões para finalizar o oponente de uma forma violenta, além dos movimentos finais de cada personagem, há o Fatality de Arena ou Stage Fatality, agora inovado, ao invés de simplesmente desferir um uppercut no oponente, o jogador executa um movimento que o leva a uma morte consequente (Ex: Na floresta viva, ao invés de dar um gancho no oponente, o personagem o agarra pelo ombro e o braço e o arremessa na boca de uma árvore que mastiga até que as pernas quebrem e se desprendam do corpo). Há também a inclusão do famoso Babality, em que o oponente volta a ser um bebê chorão. (Ex: Reptile, quando é pego por um, torna-se um ovo de réptil e eclode, tornando-se um \"bebê-réptil\", começando a chorar e cuspir ácido).',\n \t\t\t\t'Resident Evil 6 (バイオハザード 6, título japonês: Biohazard 6), é um jogo de vídeo do género horror dramático/de sobrevivência jogado na terceira pessoa desenvolvido e publicado pela Capcom. Foi apresentado durante uma campanha de divulgação viral na página NoHopeLeft.com. Apesar do nome é o nono jogo da série principal Resident Evil e foi lançado em 2 de outubro de 2012 para PlayStation 3 e Xbox 360. A versão para Microsoft Windows foi lançada no dia 22 de março de 2013.\n\n\t\t\t\tA história é contada a partir das perspectivas de Chris Redfield, membro e fundador da BSAA traumatizado por ter falhado uma missão; Leon S. Kennedy, um sobrevivente de Raccoon City e agente especial do governo; Jake Muller, filho ilegítimo de Albert Wesker e associado de Sherry Birkin; e Ada Wong, uma agente solitária com ligações aos ataques bio-terroristas pela Neo-Umbrella.\n\n\t\t\t\tO conceito do jogo começou em 2009, mas começou a ser produzido no ano seguinte sobre a supervisão de Hiroyuki Kobayashi, que já tinha produzido Resident Evil 4. A equipa de produção acabou por crescer e tornou-se na maior de sempre a trabalhar num jogo da série Resident Evil.\n\n\t\t\t\tResident Evil 6 recebeu reacções negativas aquando do lançamento da demo devido aos problemas nos controlos e criticas muito diversas devido à mudança drástica da jogabilidade encontrada na versão final do jogo, sendo um ponto de elogio e também de critica nas diferentes análises.\n\n\t\t\t\tApesar de não ter sido bem recebido tanto pela imprensa especializada como pelos jogadores, a Capcom editou mais de 4,5 milhões de cópias e Resident Evil 6 tornou-se o jogo da série que mais vendeu inicialmente.',\n\n\t\t\t\t'Os acontecimentos deste jogo passam-se duzentos anos depois da, já quase esquecida, crise de Oblivion, no ano 201 da quarta era (4E 201) na província de Skyrim, no norte de Tamriel, e 30 anos após a mais recente Grande Guerra, onde Thalmors e Humanos lutaram arduamente, mas que quase extinguiu os humanos de Tamriel, e para evitar tal derrota, acordaram com os Thalmors, rendendo duas forças e sujeitando-se as suas exigências.\n\t\t\t\tSkyrim é a terra natal de um povo bravo chamados de Nords (nórdicos), onde além da Grande Guerra, irrompeu uma guerra civil após o assassinato do Alto Rei de Skyrim, Torygg. E diante de todas estas guerras e problemas, a província se encontra dividida: de um lado se quer a separação do Império que agora está em ruínas, e do outro lado se quer permanecer leal.', \n\t\t\t\t'Tomb Raider é uma série de jogos, histórias em quadrinhos e filmes tendo como protagonista a personagem Lara Croft. Desde o lançamento do primeiro Tomb Raider, em 1996, as séries tiveram um grande lucro e Lara transformou-se num dos principal ícone da indústria de video-jogos/vídeo games. O Guiness Book reconheceu Lara Croft como \"a heroína de video-jogo/vídeo game mais bem sucedida\" em 2006.\n\n\t\t\t\tSeis jogos da série foram desenvolvidos pela Core Design, e os três últimos pela Crystal Dynamics. Todos os jogos foram publicados pela Eidos Interactive, que mantém os direitos dos personagens e a marca registrada de Tomb Raider. Para o cinema, Lara Croft: Tomb Raider e Lara Croft Tomb Raider: The Cradle of Life foram produzidos, estrelando a atriz americana Angelina Jolie como Lara Croft. Todos os jogos Tomb Raider venderam mais de 30 milhões de unidades, fazendo uma das séries de video jogos mais vendidas de todos os tempos.'];\n\n\t\t\t\tfor ($i=0; $i < count($nomes_jogos); $i++) { \n\n\t\t\t\t\t$dados = [\n\t\t\t\t\t\t'nome_jogo' => $nomes_jogos[$i],\n\t\t\t\t\t\t'desenvolvedor' => $desenvolvedor[$i],\n\t\t\t\t\t\t'plataformas' => $plataformas[$i],\n\t\t\t\t\t\t'lancamento' => $lancamento[$i],\n\t\t\t\t\t\t'genero' => $genero[$i],\n\t\t\t\t\t\t'modo_de_jogo' => $modo_de_jogo[$i],\n\t\t\t\t\t\t'classificacao' => $classificacao[$i],\n\t\t\t\t\t\t'descricao' => $descricao[$i]\n\t\t\t\t\t];\n\n\t\t\t\t\tDB::table('ficha_tecnica')->insert($dados);\n\n\t\t\t\t}\n\n }", "public function dataprovider_learningobjectives() {\n // Array for storing our runs.\n $runs = array();\n\n // Records that we will be re-using.\n $sufficientgraderecord = array(\n 'classid' => 100,\n 'grade' => 100,\n 'completestatusid' => STUSTATUS_NOTCOMPLETE,\n 'locked' => 0\n );\n $sufficientgraderecordcompleted = array(\n 'classid' => 100,\n 'grade' => 100,\n 'completestatusid' => STUSTATUS_PASSED,\n 'locked' => 1\n );\n $insufficientgraderecord = array(\n 'classid' => 100,\n 'grade' => 0,\n 'completestatusid' => STUSTATUS_NOTCOMPLETE,\n 'locked' => 0\n );\n\n $sufficientlograderecord = array(\n 'completionid' => 1,\n 'classid' => 100,\n 'grade' => 100,\n 'locked' => 0\n );\n $insufficientlograderecord = array(\n 'completionid' => 1,\n 'classid' => 100,\n 'grade' => 0,\n 'locked' => 0\n );\n\n // Arrays specifying user ids.\n $firstuser = array('userid' => 103);\n $seconduser = array('userid' => 104);\n\n /*\n * run with sufficient enrolment grade but insufficient required LO grade\n */\n\n // Each user has an enrolment record with a sufficient grade.\n $enrolments = array();\n $enrolments[] = array_merge($sufficientgraderecord, $firstuser);\n $enrolments[] = array_merge($sufficientgraderecord, $seconduser);\n\n // Each user has an LO grade record with an insufficient grade.\n $logrades = array();\n $logrades[] = array_merge($insufficientlograderecord, $firstuser);\n $logrades[] = array_merge($insufficientlograderecord, $seconduser);\n\n // Each user has a matching in progress and unlocked record.\n $expectedenrolments = array();\n $expectedenrolments[] = array_merge($sufficientgraderecord, $firstuser);\n $expectedenrolments[] = array_merge($sufficientgraderecord, $seconduser);\n $runs[] = array($enrolments, $logrades, $expectedenrolments, 100);\n\n /*\n * run with insufficient enrolment grade but sufficient required LO grade\n */\n\n // Each user has an enrolment record with an insufficient grade.\n $enrolments = array();\n $enrolments[] = array_merge($insufficientgraderecord, $firstuser);\n $enrolments[] = array_merge($insufficientgraderecord, $seconduser);\n\n // Each user has an LO grade record with a sufficient grade.\n $logrades = array();\n $logrades[] = array_merge($sufficientlograderecord, $firstuser);\n $logrades[] = array_merge($sufficientlograderecord, $seconduser);\n\n // Each user has a matching in progress and unlocked record.\n $expectedenrolments = array();\n $expectedenrolments[] = array_merge($insufficientgraderecord, $firstuser);\n $expectedenrolments[] = array_merge($insufficientgraderecord, $seconduser);\n\n $runs[] = array($enrolments, $logrades, $expectedenrolments, 100);\n\n /*\n * run with sufficient enrolment grade and sufficient required LO grade\n */\n\n // Each user has an enrolment record with a sufficient grade.\n $enrolments = array();\n $enrolments[] = array_merge($sufficientgraderecord, $firstuser);\n $enrolments[] = array_merge($sufficientgraderecord, $seconduser);\n\n // Each user has an LO grade record with a sufficient grade.\n $logrades = array();\n $logrades[] = array_merge($sufficientlograderecord, $firstuser);\n $logrades[] = array_merge($sufficientlograderecord, $seconduser);\n\n // Each user has a matching passed and locked record.\n $expectedenrolments = array();\n $expectedenrolments[] = array_merge($sufficientgraderecordcompleted, $firstuser);\n $expectedenrolments[] = array_merge($sufficientgraderecordcompleted, $seconduser);\n\n $runs[] = array($enrolments, $logrades, $expectedenrolments, 100);\n\n // Return all data.\n return $runs;\n }", "function __construct(){\n\t\t$edges = array(26,NULL);\n\t\t$pred = NULL;\n\t\t$endOfWord = false;\n\t\t$visited = false;\n\t}", "public function getExampleEans();", "public function run()\n {\n $opt3 = ['Dry or rough', 'Oily all over', 'Excess oil on t-zone', 'Uneven tone', 'Lines and creases', 'All is well'];\n $opt4 = ['Rarely see a spot', 'Few times a month', 'Seems forever', 'All clear here'];\n $face_result = ['Dry', 'Dry', 'Sensitive & acne', 'Dry', 'Oily', 'Acne', 'Acne', 'Oily', 'Oily', 'Acne', 'Acne', 'Oily', 'Unbright', 'Unbright', 'Super black spot & acne', 'Unbright', 'Wrinkle', 'Wrinkle', 'Sensitive wrinkle & acne', 'Wrinkle', 'Normal', 'Normal', 'Acne', 'Normal'];\n $face_title = [\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!',\n 'Your acne was very terrible!'\n ];\n $face_desc = [\n 'Dry skin can be itchy, and it may look flaky and bumpy or have red patches. Dehydrated skin lacks water and appears dull or rough.\n It’s better to use moisturizers in the sheet mask. Our formula can lock the hydration to prevent you from dryness.',\n 'Dry skin can be itchy, and it may look flaky and bumpy or have red patches. Dehydrated skin lacks water and appears dull or rough.\n It’s better to use moisturizers in the sheet mask. Our formula can lock the hydration to prevent you from dryness.',\n 'Dry skin can be itchy, and it may look flaky and bumpy or have red patches. Dehydrated skin lacks water and appears dull or rough.\n But sometimes your skin was very sensitive that causing acne or some inflammatory. Try the super moisturizer & the pure pitera water, a technology from Japan! All packed in your sheet mask.',\n 'Dry skin can be itchy, and it may look flaky and bumpy or have red patches. Dehydrated skin lacks water and appears dull or rough.\n It’s better to use moisturizers in the sheet mask. Our formula can lock the hydration to prevent you from dryness.',\n \"Too much sebum, however, may lead to oily skin, which can lead to clogged pores and acne. Genetics, hormone changes, or even stress may increase sebum production. You have very high sensitive skin to acne, let's to prevent it before late!\",\n 'Too much sebum, however, may lead to oily skin, which can lead to clogged pores and acne. Genetics, hormone changes, or even stress may increase sebum production. You have very high sensitive skin to acne. Try to remove the acne & its black spot with our sheet mask!',\n 'Too much sebum, however, may lead to oily skin, which can lead to clogged pores and acne. Genetics, hormone changes, or even stress may increase sebum production. You have very high sensitive skin to acne. Try to remove the acne & its black spot with our sheet mask!',\n \"Too much sebum, however, may lead to oily skin, which can lead to clogged pores and acne. Genetics, hormone changes, or even stress may increase sebum production. You have very high sensitive skin to acne, let's to prevent it before late!\",\n \"Too much sebum, however, may lead to oily skin, which can lead to clogged pores and acne. Genetics, hormone changes, or even stress may increase sebum production. You have very high sensitive skin to acne, let's to prevent it before late!\",\n \"Too much sebum, however, may lead to oily skin, which can lead to clogged pores and acne. Genetics, hormone changes, or even stress may increase sebum production. You have very high sensitive skin to acne. Try to remove the acne & its black spot with our sheet mask!\",\n \"Too much sebum, however, may lead to oily skin, which can lead to clogged pores and acne. Genetics, hormone changes, or even stress may increase sebum production. You have very high sensitive skin to acne. Try to remove the acne & its black spot with our sheet mask!\",\n \"Too much sebum, however, may lead to oily skin, which can lead to clogged pores and acne. Genetics, hormone changes, or even stress may increase sebum production. You have very high sensitive skin to acne, let's to prevent it before late!\",\n \"The trouble begins when your uneven skin tone begins presenting itself in blotchy patches or dark spots known. You might have highly UV exposure & unhydrate skin. Let's splash your face using Pitera pure water from Japan!\",\n \"The trouble begins when your uneven skin tone begins presenting itself in blotchy patches or dark spots known. You might have highly UV exposure & unhydrate skin. Let's splash your face using Pitera pure water from Japan!\",\n \"Too much sebum, however, may lead to oily skin, which can lead to clogged pores and acne. Genetics, hormone changes, or even stress may increase sebum production. You have very high sensitive skin to acne. Try to remove the acne & its black spot with our sheet mask!\",\n \"The trouble begins when your uneven skin tone begins presenting itself in blotchy patches or dark spots known. You might have highly UV exposure & unhydrate skin. Let's splash your face using Pitera pure water from Japan!\",\n \"Sun damage, smoking, dehydration, some medications, and environmental and genetic factors affect when and where people will develop wrinkles. Remove every wrinkle lines by using our Pitera pure water which squeezed in sheet mask!\",\n \"Sun damage, smoking, dehydration, some medications, and environmental and genetic factors affect when and where people will develop wrinkles. Remove every wrinkle lines by using our Pitera pure water which squeezed in sheet mask!\",\n \"Sun damage, smoking, dehydration, some medications, and environmental and genetic factors affect when and where people will develop wrinkles. Also, your acne add the skin complexity. Remove every wrinkle lines by using our Pitera pure water and remove all acne just in a week!\",\n \"Sun damage, smoking, dehydration, some medications, and environmental and genetic factors affect when and where people will develop wrinkles. Remove every wrinkle lines by using our Pitera pure water which squeezed in sheet mask!\",\n \"As a person with normal skin ages, their skin can become dryer. You can't let the pollution, stress, or other external factors damage your face. Keep locking your beautiful face using moisturizer!\",\n \"As a person with normal skin ages, their skin can become dryer. You can't let the pollution, stress, or other external factors damage your face. Keep locking your beautiful face using moisturizer and bump it with our snail extract!\",\n \"Too much sebum, however, may lead to oily skin, which can lead to clogged pores and acne. Genetics, hormone changes, or even stress may increase sebum production. You have very high sensitive skin to acne. Try to remove the acne & its black spot with our sheet mask!\",\n \"As a person with normal skin ages, their skin can become dryer. You can't let the pollution, stress, or other external factors damage your face. Keep locking your beautiful face using moisturizer!\"\n ];\n $special = ['Super moisturizer', 'Super moisturizer', 'Super moisturizer & pitera', 'Super moisturizer', 'Salicylic acid & snail extract', 'Salicylic acid & snail extract', 'Salicylic acid & snail extract', 'Salicylic acid & snail extract', 'Salicylic acid & snail extract', 'Salicylic acid & snail extract', 'Salicylic acid & snail extract', 'Salicylic acid & snail extract', 'Pitera & super whitening extract', 'Pitera & super whitening extract', 'Salicylic acid & snail extract', 'Pitera & super whitening extract', 'Pitera', 'Pitera', 'Pitera & salicylic acid', 'Pitera', 'Super moisturizer', 'Moisturizer & snail extract', 'Salicylic acid & snail extract', 'Super moisturizer'];\n $formula = ['1100', '1100', '1200', '1100', '3400', '3400', '3400', '3400', '3400', '3400', '3400', '3400', '2600', '2600', '3400', '2600', '2200', '2200', '2300', '2200', '1100', '1300', '3400', '1100'];\n $face_icon = ['skin_redness.png', 'skin_redness.png', 'skin_redness.png', 'skin_redness.png', 'skin_oily.png', 'skin_acne.png', 'skin_acne.png', 'skin_oily.png', 'skin_oily.png', 'skin_acne.png', 'skin_acne.png', 'skin_oily.png', 'skin_pigment spots.png', 'skin_pigment spots.png', 'skin_pigment spots.png', 'skin_pigment spots.png', 'skin_wrinkles.png', 'skin_wrinkles.png', 'skin_wrinkles.png', 'skin_wrinkles.png', 'skin_normal.png', 'skin_normal.png', 'skin_acne.png', 'skin_normal.png'];\n\n $row = 0;\n foreach ($opt3 as $key => $value) {\n foreach ($opt4 as $key_2 => $value_2) {\n Logic::insert([\n 'option_3' => $value,\n 'option_4' => $value_2,\n 'face_result' => $face_result[$row],\n 'face_title' => $face_title[$row],\n 'face_description' => $face_desc[$row],\n 'special_ingredients' => $special[$row],\n 'no_formula' => $formula[$row],\n 'face_icon' => $face_icon[$row]\n ]);\n $row += 1;\n }\n }\n }", "private function createExperiment()\n {\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "public function run()\n {\n $courses = [\n ['Math', '11', 'Magni Lindsey', '/img/Math11.jpg', 'Welcome to Math 11. This course will equip you with fundemental knowledage of basic mathematic operation and quadratic function. They are very important for all future science course.', '40$/hour', 'http://www.bcmath.ca/PC11/PC11main.htm'],\n ['Physics', '11', 'Virgee Harris', '/img/Physics11.jpg', 'Welcome to Physics 11. This course will teach you the basic concepts of motion, force and energy so that you will be clear about how the fundemental law of physiscs works around us.', '40$/hour', 'https://yungmingliu.wikispaces.com/BC+Physics+11'],\n ['Chemistry', '11', 'Virgil\tBarrett', '/img/Chemistry11.jpg','Welcome to Chemsitry 11. This course covers basic calculations in chemistry including mole concept, concentration, stoichiometry, classification of matter and periodic table.', '45$/hour', 'https://noteshelp.wordpress.com/chemistry-11/'],\n ['Math', '12', 'Eloise Page', '/img/Math12.jpg', 'Welcome to Math 12. This course is a good preparation course for future calculus. In this course, you will learn exponential and logarithmic functions, and various trigonometric identities.', '45$/hour', 'https://noteshelp.wordpress.com/math-12/'],\n ['Physics', '12', 'Adrienne\tBarber', '/img/Physics12.jpg', 'Welcome to Physics 12. This course will introduce you to more complex natural physical behaviors, such as momentum and impulse, circular motion and gravitation and electrical forces.', '50$/hour', 'https://noteshelp.wordpress.com/physics-12/'],\n ['Chemistry', '12', 'Peggy Olson', '/img/Chemistry12.jpg', 'Welcome to Chemsitry 12. Chemistry 12 will advance your knowledage of chemistry to multiple new areas. You will start to understand reaction kinetics, solubility equilibrium.', '45$/hour', 'https://noteshelp.wordpress.com/chemistry-12/'],\n ['Biology', '11', 'Ellary Anderson', '/img/Biology11.jpg', 'Welcome to Biology 11. This course will greatly expand your knowledage of living creature around us. You will learn protists, mycology, plant biology and animal biology.', '45$/hour', 'https://noteshelp.wordpress.com/biology-11/'],\n ['Biology', '12', 'Katey Sampertin', '/img/Biology12.jpg', 'Welcome to Biology 12. This course provide you much profound knowledage about DNA and RNA stucture and function. You will also start to understand how gene express themselves.', '50$/hour', 'https://noteshelp.wordpress.com/biology-12/']\n\n ];\n\n \n foreach ($courses as $key => $course) {\n Course::insert([\n 'created_at' => Carbon\\Carbon::now(),\n 'updated_at' => Carbon\\Carbon::now(),\n 'name' => $course[0],\n 'level' => $course[1],\n 'instructor' => $course[2],\n 'image' => $course[3],\n 'description' => $course[4],\n 'price' => $course[5],\n 'link'=>$course[6]\n ]);\n }\n }", "public function intro() {\n\n\t}", "public function Run()\n {\n $model = new GModel(\"Run\", false);\n echo \"Sample Data Generated\";\n exit();\n }", "function main(){\r\n\t$url = \"http://data.bmkg.go.id/autogempa.xml\";\r\n\t$get = file_get_contents($url, False);\r\n\t$data = simplexml_load_string($get) or die(\"Error: Cannot create object\");\r\n\tprint \" Tanggal : \".$data->gempa->Tanggal.\"\\n\";\r\n\tprint \" Jam : \".$data->gempa->Jam.\"\\n\";\r\n\tprint \"\\n\";\r\n\tprint \"\\033[0;36m\"; // Cyan\r\n\tprint \" Lintang : \".$data->gempa->Lintang.\"\\n\";\r\n\tprint \" Bujur : \".$data->gempa->Bujur.\"\\n\";\r\n\tprint \" Magnitude : \".$data->gempa->Magnitude.\"\\n\";\r\n\tprint \" Kedalaman : \".$data->gempa->Kedalaman.\"\\n\";\r\n\tprint \"\\n\";\r\n\tprint \"\\033[0;32m\"; // Hijau\r\n\tprint \" Wilayah : \".$data->gempa->Wilayah1.\"\\n\";\r\n\tprint \" Potensi : \".$data->gempa->Potensi.\"\\n\";\r\n\tprint \"\\033[0m\"; // Normal\r\n}", "public function testCreateExperiment()\n {\n echo \"\\nTesting Experiment creation...\";\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments?owner=wawong\";\n //echo \"\\n-------------------------\";\n //echo \"\\nURL:\".$url;\n //echo \"\\n-------------------------\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\n-----Create Experiment Response:\".$response;\n \n $result = json_decode($response);\n \n $this->assertTrue(!$result->success);\n \n }", "public function engToGeDescription ( $eng = NULL ) {\n if ( !$eng ) return false;\n\n $dict = array();\n\n $dict['Chance of rain'] = 'მოსალოდნელია წვიმა';\n $dict['Chance of rain or sleet'] = 'მოსალოდნელია წვიმა ან სველი თოვლი';\n $dict['Chance of sleet or snow'] = 'მოსალოდნელია თოვლჭყაპი ან თოვლი';\n $dict['Chance of snow'] = 'უღრუბლო ამინდი';\n $dict['Clear weather'] = 'უღრუბლო ამინდი';\n $dict['Cloudy skies'] = 'ღრუბლიანი ცა';\n $dict['Few clouds'] = 'მცირედი ღრუბელი';\n $dict['Heavy rain'] = 'ძლიერი წვიმა';\n $dict['Heavy rain or sleet'] = 'ძლიერი წვიმა ან თოვლჭყაპი';\n $dict['Heavy sleet or snow'] = 'ძლიერი თოვლჭყაპი ან თოვლი';\n $dict['Light rain'] = 'მცირედი წვიმა';\n $dict['Light rain or sleet'] = 'მცირედი წვიმა ან თოვლჭყაპი';\n $dict['Light sleet or snow'] = 'მცირედი თოვლჭყაპი ან თოვლი';\n $dict['Light snow'] = 'მცირედი თოვლი';\n $dict['Partly cloudy skies'] = 'ნაწილობრივ ღრუბლიანი ცა';\n $dict['Rain'] = 'წვიმა';\n $dict['Rain and possible heavy thunderstorm'] = 'წვიმა, მოსალოდნელია ძლიერი ჭექა-ქუხილი';\n $dict['Rain and possible thunder'] = 'წვიდა და ჭექა-ქუხილი';\n $dict['Rain or sleet'] = 'წვიმა ან თოვლჭყაპი';\n $dict['Rain or sleet and possible heavy thunder'] = 'წვიმა ან თოვლჭყაპი და შესაძლებელია ჭექა-ქუხილი';\n $dict['Sleet or snow'] = 'თოვლჭყაპი ან თოვლი';\n $dict['Snow'] = 'თოვლი';\n\n\n return $dict[trim($eng)];\n }", "public static function main(){\n\t\t\t\n\t\t}", "function addPrediction(){\n\t\n\t}", "public function actionTest()\n {\n try {\n dump(TestClient::getInstance()->predict(39.9223757639, 116.4221191406));\n } catch (\\Exception $e) {\n dump($e->getMessage());\n }\n }", "public function run()\n {\n \\App\\TexBlob::create([\n \t'id' => 1,\n\t\t\t'tex' => 'Soit $x \\\\in \\\\mathbb{R}$'\n ]);\n\t\t\t\n \\App\\TexBlob::create([\n \t'id' => 2,\n\t\t\t'tex' => 'Soit $n \\\\in \\\\mathbb{N}$'\n ]);\n\t\t\t\n \\App\\TexBlob::create([\n \t'id' => 3,\n\t\t\t'tex' => 'Supposons que $f$ est une fonction complexe'\n ]);\n\t\t\n }", "public function run()\n {\n Symptom::unguard();\n\n $this->insert(267036007, 'Dyspnea', 'Atemnot');\n $this->insert(418290006, 'Itching', 'Juckreiz');\n $this->insert(422400008, 'Vomiting', 'Erbrechen');\n $this->insert(65124004, 'Swelling', 'Schwellung');\n $this->insert(3424008, 'Tachycardia', 'Tachykardie');\n $this->insert(45007003, 'Low blood pressure', 'Tiefer Blutdruck'); \n $this->insert(418107008, 'Unconscious', 'Bewusstlosigkeit');\n $this->insert(39579001,\t'Anaphylaxis', 'Anaphylaxie');\n $this->insert(74776002,\t'Itching of eye\tJuckreiz', 'Augen');\n $this->insert(68235000,\t'Nasal congestion', 'Verstopfte Nase');\n $this->insert(62315008,\t'Diarrhea', 'Durchfall');\n $this->insert(25064002,\t'Headache', 'Kopfschmerzen');\n $this->insert(61582004,\t'Allergic rhinitis', 'Allergische Rhinitis');\n $this->insert(418363000, 'Itching of skin', 'Juckende Haut');\n $this->insert(49727002,\t'Cough', 'Husten');\n $this->insert(703630003, 'Red eye', 'Rote Augen');\n $this->insert(247472004, 'Urticarial rash', 'Nesselsucht');\n $this->insert(699376002, 'Lip Swelling', 'Geschwollene Lippen');\n $this->insert(130987000, 'Acute confusion', 'Verwirrung');\n $this->insert(76067001,\t'Sneezing', 'Niesen');\n \n }", "function geneshop_sequences_alignment() {\n/*\n * For testing function, required more than one sequence.\n * $mRNA_id = array(3,20,37,53,68);\n * $data = '';\n * foreach ($mRNA_id as $feature_id) {\n */\n module_load_include('inc', 'tripal_feature', 'tripal_feature.api');\n module_load_include('inc', 'clustalo', 'clustalo.restclient');\n $sql = '\n SELECT FRM.subject_id as feature_id\n FROM {gene} G\n INNER JOIN {feature_relationship} FRM ON FRM.object_id = G.gene_id\n INNER JOIN {chado_feature} CHF ON CHF.feature_id = gene_id\n WHERE chf.nid = :nid\n ';\n $data = '';\n foreach ($_SESSION['basket']['items'] as $nid => $value) {\n $args = array(':nid' => $nid);\n $result = db_query($sql, $args)->fetchObject();\n $feature_id = $result->feature_id;\n $sequence = array();\n $sequence = tripal_get_feature_sequences(\n array(\n 'feature_id' => $feature_id,\n ),\n array(\n 'relationship_type' => 'derives_from',\n 'relationship_part' => 'object',\n 'is_html' => 0\n )\n );\n if (count($sequence)>0) {\n $data .= \">\".$sequence[0][defline].\"\\n\";\n if ($sequence[0]['residues']) { //if there are sequences in residues\n $sequence[0]['residues'] = strtoupper($sequence[0]['residues']);\n $data .= $sequence[0]['residues'].\"\\n\";\n }\n }\n }\n\n// set parameter and send to ClustalO service.\n $parameters = array(\n 'sequence' => $data,\n );\n $msa = clustalo_submit_job($parameters, $phylo = false);\n drupal_add_http_header('Content-Type: text/plain');\n print $msa;\n drupal_exit();\n}", "public function mainAction($params)\n\t{\n\t\t// initialize parent task\n\t\t// with reading from files etc.\n\t\tparent::initialize($params);\n\t\t$this->runtime();\n\t\tOutput::stdOutGreen(\"Greedy algorithm\");\n\n\t\t$selectedExperts = array();\n\t\tforeach ($this->couldSolve as $direction) {\n\t\t\t$selectedExpert = $this->findBestExpertOnCurrentStep($direction, $selectedExperts);\n\t\t\tif ($selectedExpert != -1) {\n\t\t\t\t$selectedExperts[] = $selectedExpert;\n\t\t\t}\n\t\t\tprint_r($selectedExperts);\n\n\t\t\tif ($this->isExpertsSolvesTheTask($selectedExperts)) {\n\t\t\t\tOutput::stdOutGreen(\"Task SOLVED!\");\n\t\t\t\tOutput::stdout(\"Total cost: \" . $this->countTotalSum($selectedExperts));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\techo \"Виконано за: \".$this->runtime().\"\\n\";\n\n//\t\techo $this->countTotalSum(array(0, 3, 5)) . \"\\n\";\n//\t\techo $this->isExpertAllowed(5, 2) . \"\\n\";\n//\t\tprint_r($this->getExpertsDirections(0));\n//\t\t$this->isExpertsSolvesTheTask(array(0,1,2,3,4,5));\n\t}", "function DictionaryWhatMeans(){\n\t\n\tglobal $db_dictionary;\n\tglobal $eden_cfg;\n\t\n\t$res = mysql_query(\"SELECT dictionary_id FROM $db_dictionary WHERE dictionary_parent_id=0 AND dictionary_allow=1\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$words = Array();\n\twhile ($ar = mysql_fetch_array($res)){\n\t\t$words[] .= $ar['dictionary_id'];\n\t}\n\t$num = count($words) - 1; // -1 je prevence proti zobrazeni cisla minus rozsah pole\n\t$random_num = rand (0,$num);\n\t$random_word = $words[$random_num];\n\t$res_word = mysql_query(\"SELECT dictionary_word, dictionary_word_description FROM $db_dictionary WHERE dictionary_id=\".(integer)$random_word) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$ar_word = mysql_fetch_array($res_word);\n\techo \"<span class=\\\"h2\\\">\".$ar_word['dictionary_word'].\"</span><br>\".$ar_word['dictionary_word_description'];\n}", "public function run()\n {\n $subject_area_seeder = [\n\t\t['title' =>'Accounting'],\n\t\t['title' =>'Acoustics'],\n\t\t['title' =>'Aeronautical engineering'],\n\t\t['title' =>'Aging - Molecular'],\n\t\t['title' =>'Agricultural economics'],\n\t\t['title' =>'Agricultural science'],\n\t\t['title' =>'Algebra'],\n\t\t['title' =>'Analytical chemistry'],\n\t\t['title' =>'Anatomy'],\n\t\t['title' =>'Anesthesiology'],\n\t\t['title' =>'Animal genealogy'],\n\t\t['title' =>'Animal genetics'],\n\t\t['title' =>'Annual reports and quarterly reports'],\n\t\t['title' =>'Anthropology'],\n\t\t['title' =>'Applied psychology'],\n\t\t['title' =>'Applied chemistry'],\n\t\t['title' =>'Applied mathematics'],\n\t\t['title' =>'Applied physics'],\n\t\t['title' =>'Archaeology'],\n\t\t['title' =>'Art history'],\n\t\t['title' =>'Artificial intelligence'],\n\t\t['title' =>'Astrophysics'],\n\t\t['title' =>'Atmospheric optics'],\n\t\t['title' =>'Atmospheric chemistry'],\n\t\t['title' =>'Atmospheric science'],\n\t\t['title' =>'Atomic/Molecular physics'],\n\t\t['title' =>'Atomic and molecular physics'],\n\t\t['title' =>'Autobiography/Biography'],\n\t\t['title' =>'Automobile engineering'],\n\t\t['title' =>'Banking'],\n\t\t['title' =>'Basic English learning content'],\n\t\t['title' =>'Behavioral economics'],\n\t\t['title' =>'Behavioral medicine'],\n\t\t['title' =>'Biochemistry'],\n\t\t['title' =>'Biofuels'],\n\t\t['title' =>'Bioinformatics and computational biology'],\n\t\t['title' =>'Biomaterials'],\n\t\t['title' =>'Biomedical engineering'],\n\t\t['title' =>'Biophysics'],\n\t\t['title' =>'Biostatistics'],\n\t\t['title' =>'Book reviews'],\n\t\t['title' =>'Botany'],\n\t\t['title' =>'Business analysis'],\n\t\t['title' =>'Business administration'],\n\t\t['title' =>'Calculus'],\n\t\t['title' =>'Cancer research'],\n\t\t['title' =>'Cancer research - Chemoradiotherapy'],\n\t\t['title' =>'Cancer research - Clinical molecular studies'],\n\t\t['title' =>'Cardiology'],\n\t\t['title' =>'Catalysis'],\n\t\t['title' =>'Cell biology'],\n\t\t['title' =>'Composite materials'],\n\t\t['title' =>'Chemical engineering'],\n\t\t['title' =>'Chiropractics'],\n\t\t['title' =>'Civics'],\n\t\t['title' =>'Civil engineering'],\n\t\t['title' =>'Climate science'],\n\t\t['title' =>'Clinical psychiatry'],\n\t\t['title' =>'Clinical psychology'],\n\t\t['title' =>'Psychotherapy'],\n\t\t['title' =>'Cloud physics'],\n\t\t['title' =>'Cognitive neuroscience'],\n\t\t['title' =>'Cognitive psychology'],\n\t\t['title' =>'Coherence and statistical optics'],\n\t\t['title' =>'Surface chemistry'],\n\t\t['title' =>'Communication studies'],\n\t\t['title' =>'Comparative psychology'],\n\t\t['title' =>'Complementary and alternative medicine'],\n\t\t['title' =>'Computational chemistry'],\n\t\t['title' =>'Computational neuroscience'],\n\t\t['title' =>'Computer software'],\n\t\t['title' =>'Computer graphics'],\n\t\t['title' =>'Computer hardware'],\n\t\t['title' =>'Computer science'],\n\t\t['title' =>'Computer security'],\n\t\t['title' =>'Computer vision'],\n\t\t['title' =>'Condensed matter physics'],\n\t\t['title' =>'Consumer behavior'],\n\t\t['title' =>'Consumer studies'],\n\t\t['title' =>'Control engineering'],\n\t\t['title' =>'Convective systems'],\n\t\t['title' =>'Criminology'],\n\t\t['title' =>'Cultural studies'],\n\t\t['title' =>'Curriculum development'],\n\t\t['title' =>'Curriculum studies'],\n\t\t['title' =>'Database systems'],\n\t\t['title' =>'Decision sciences'],\n\t\t['title' =>'Demography'],\n\t\t['title' =>'Dentistry'],\n\t\t['title' =>'Dermatology'],\n\t\t['title' =>'Descriptive linguistics'],\n\t\t['title' =>'Landscape aesthetics'],\n\t\t['title' =>'Detectors'],\n\t\t['title' =>'Development economics'],\n\t\t['title' =>'Developmental psychology'],\n\t\t['title' =>'Developmental neuroscience'],\n\t\t['title' =>'Diabetes research'],\n\t\t['title' =>'Dialogue'],\n\t\t['title' =>'Diffraction'],\n\t\t['title' =>'Disaster management'],\n\t\t['title' =>'Disaster medicine'],\n\t\t['title' =>'Drug discovery'],\n\t\t['title' =>'Ecology'],\n\t\t['title' =>'Econometrics'],\n\t\t['title' =>'Economic history'],\n\t\t['title' =>'Economic modeling'],\n\t\t['title' =>'Economic policy'],\n\t\t['title' =>'Economic theory'],\n\t\t['title' =>'Educational administration'],\n\t\t['title' =>'Educational assessment'],\n\t\t['title' =>'Educational methods'],\n\t\t['title' =>'Elder care'],\n\t\t['title' =>'Electric circuits'],\n\t\t['title' =>'Electrochemistry'],\n\t\t['title' =>'Electronic materials'],\n\t\t['title' =>'Electronics engineering'],\n\t\t['title' =>'ELT/TESL/TESOL/TEFL'],\n\t\t['title' =>'Embryology'],\n\t\t['title' =>'Emergency medicine'],\n\t\t['title' =>'Endocrinology'],\n\t\t['title' =>'Energy'],\n\t\t['title' =>'ENT (Otolaryngology)'],\n\t\t['title' =>'Entomology'],\n\t\t['title' =>'Environmental and energy policies'],\n\t\t['title' =>'Environmental science'],\n\t\t['title' =>'Ecotoxicology'],\n\t\t['title' =>'Enzymology'],\n\t\t['title' =>'Epidemiology'],\n\t\t['title' =>'ESL/EFL/ESOL/EAL'],\n\t\t['title' =>'ESP'],\n\t\t['title' =>'Ethics'],\n\t\t['title' =>'Ethology (Animal behavior)'],\n\t\t['title' =>'Evolutionary biology'],\n\t\t['title' =>'Evolutionary genetics'],\n\t\t['title' =>'Experimental psychology'],\n\t\t['title' =>'Fiber optics'],\n\t\t['title' =>'Ceramics'],\n\t\t['title' =>'Fiction writing'],\n\t\t['title' =>'Fine arts'],\n\t\t['title' =>'Fishery sciences'],\n\t\t['title' =>'Fluid dynamics'],\n\t\t['title' =>'Food chemistry'],\n\t\t['title' =>'Food science'],\n\t\t['title' =>'Forensic medicine'],\n\t\t['title' =>'Forensic science'],\n\t\t['title' =>'Forestry'],\n\t\t['title' =>'Fourier optics'],\n\t\t['title' =>'Gastroenterology'],\n\t\t['title' =>'Gender studies'],\n\t\t['title' =>'General education'],\n\t\t['title' =>'General linguistics'],\n\t\t['title' =>'General optics'],\n\t\t['title' =>'General psychology'],\n\t\t['title' =>'Human classical genetics'],\n\t\t['title' =>'Geodesy'],\n\t\t['title' =>'Environmental studies'],\n\t\t['title' =>'Geology'],\n\t\t['title' =>'Geometric optics'],\n\t\t['title' =>'Geometry'],\n\t\t['title' =>'Geophysics'],\n\t\t['title' =>'Geopolitics'],\n\t\t['title' =>'Geriatric medicine'],\n\t\t['title' =>'Health education'],\n\t\t['title' =>'Social healthcare'],\n\t\t['title' =>'Hematology'],\n\t\t['title' =>'High-energy and particle physics'],\n\t\t['title' =>'History'],\n\t\t['title' =>'History of Africa'],\n\t\t['title' =>'History of Asia'],\n\t\t['title' =>'History of Central Asia'],\n\t\t['title' =>'History of East Asia'],\n\t\t['title' =>'History of Europe'],\n\t\t['title' =>'History of the Americas'],\n\t\t['title' =>'History of the Middle East'],\n\t\t['title' =>'Holography'],\n\t\t['title' =>'Horticulture'],\n\t\t['title' =>'Human resource management'],\n\t\t['title' =>'Human-Computer interaction'],\n\t\t['title' =>'Hydrology'],\n\t\t['title' =>'Digital image processing'],\n\t\t['title' =>'Optical image processing'],\n\t\t['title' =>'Imaging systems'],\n\t\t['title' =>'Immunology'],\n\t\t['title' =>'Individual/Organization profile'],\n\t\t['title' =>'Industrial engineering'],\n\t\t['title' =>'Infectious diseases'],\n\t\t['title' =>'Information studies'],\n\t\t['title' =>'Information systems'],\n\t\t['title' =>'Inorganic chemistry'],\n\t\t['title' =>'Instruction manual/Guidelines'],\n\t\t['title' =>'Optical instrumentation'],\n\t\t['title' =>'Integrated optics'],\n\t\t['title' =>'Internal medicine'],\n\t\t['title' =>'International relations'],\n\t\t['title' =>'Internet'],\n\t\t['title' =>'Irrigation'],\n\t\t['title' =>'Labor economics'],\n\t\t['title' =>'Language acquisition'],\n\t\t['title' =>'Language assessment/Language testing'],\n\t\t['title' =>'Lasers'],\n\t\t['title' =>'Lasers and laser optics'],\n\t\t['title' =>'Law'],\n\t\t['title' =>'Linear physics'],\n\t\t['title' =>'Literary criticism'],\n\t\t['title' =>'Literary forms'],\n\t\t['title' =>'Literary history'],\n\t\t['title' =>'Literary nonfiction'],\n\t\t['title' =>'Literary theory'],\n\t\t['title' =>'Literary translation'],\n\t\t['title' =>'Literature'],\n\t\t['title' =>'Literature by era'],\n\t\t['title' =>'Machine learning'],\n\t\t['title' =>'Machine vision'],\n\t\t['title' =>'Macromolecular chemistry'],\n\t\t['title' =>'Magnetism'],\n\t\t['title' =>'Management consulting'],\n\t\t['title' =>'Manufacturing'],\n\t\t['title' =>'Marine biology'],\n\t\t['title' =>'Marine engineering'],\n\t\t['title' =>'Marketing'],\n\t\t['title' =>'Materials processing'],\n\t\t['title' =>'Materials'],\n\t\t['title' =>'Materials engineering'],\n\t\t['title' =>'Materials physics'],\n\t\t['title' =>'Materials science'],\n\t\t['title' =>'Mathematical modeling'],\n\t\t['title' =>'Mathematics'],\n\t\t['title' =>'Mechanical engineering'],\n\t\t['title' =>'Media'],\n\t\t['title' =>'Biomedical devices - Clinical applications'],\n\t\t['title' =>'Medical laboratory technology'],\n\t\t['title' =>'Medical optics'],\n\t\t['title' =>'Medical physics'],\n\t\t['title' =>'Metallurgy'],\n\t\t['title' =>'Meteorology'],\n\t\t['title' =>'Microbial biotechnology'],\n\t\t['title' =>'Microbiology'],\n\t\t['title' =>'Microscopy'],\n\t\t['title' =>'Petrology and mineralogy'],\n\t\t['title' =>'Mobile computing'],\n\t\t['title' =>'Molecular biology'],\n\t\t['title' =>'Molecular medicine'],\n\t\t['title' =>'Molecular oncology'],\n\t\t['title' =>'Monetary economics'],\n\t\t['title' =>'Morphology'],\n\t\t['title' =>'Music'],\n\t\t['title' =>'Mutagenesis'],\n\t\t['title' =>'Nanobiotechnology'],\n\t\t['title' =>'Nanochemistry'],\n\t\t['title' =>'Nanotechnology'],\n\t\t['title' =>'National literature'],\n\t\t['title' =>'Nature and landscape conservation'],\n\t\t['title' =>'Nephrology'],\n\t\t['title' =>'Networks'],\n\t\t['title' =>'Neural networks'],\n\t\t['title' =>'Neuroanatomy'],\n\t\t['title' =>'Neuroimaging'],\n\t\t['title' =>'Neuropathology'],\n\t\t['title' =>'Cellular neuroscience'],\n\t\t['title' =>'Neuroscience'],\n\t\t['title' =>'Neurosurgery'],\n\t\t['title' =>'News/Magazine reports or articles'],\n\t\t['title' =>'Nonlinear optics'],\n\t\t['title' =>'Nonlinear physics'],\n\t\t['title' =>'Nuclear chemistry'],\n\t\t['title' =>'Nuclear physics'],\n\t\t['title' =>'Numerical weather prediction'],\n\t\t['title' =>'Nursing policy'],\n\t\t['title' =>'Nursing medicine'],\n\t\t['title' =>'Nutrition'],\n\t\t['title' =>'Obstetrics'],\n\t\t['title' =>'Occupational health'],\n\t\t['title' =>'Oceanography'],\n\t\t['title' =>'Oncogenetics'],\n\t\t['title' =>'Operating systems'],\n\t\t['title' =>'Ophthalmology'],\n\t\t['title' =>'Opinion articles'],\n\t\t['title' =>'Optical data storage'],\n\t\t['title' =>'Optical design and fabrication'],\n\t\t['title' =>'Optical devices'],\n\t\t['title' =>'Optics'],\n\t\t['title' =>'Optics at surfaces'],\n\t\t['title' =>'Optics in computing'],\n\t\t['title' =>'Optoelectronics'],\n\t\t['title' =>'Optometry'],\n\t\t['title' =>'Organic chemistry'],\n\t\t['title' =>'Organizational behavior'],\n\t\t['title' =>'Ornithology'],\n\t\t['title' =>'Orthopedics'],\n\t\t['title' =>'Chemistry'],\n\t\t['title' =>'Economics'],\n\t\t['title' =>'Education'],\n\t\t['title' =>'Engineering and technology'],\n\t\t['title' =>'Medicine'],\n\t\t['title' =>'Pharmaceutical sciences'],\n\t\t['title' =>'Physics'],\n\t\t['title' =>'Other areas of optics'],\n\t\t['title' =>'Parallel systems'],\n\t\t['title' =>'Clinical diagnostics'],\n\t\t['title' =>'Pedagogy'],\n\t\t['title' =>'Pediatrics'],\n\t\t['title' =>'Performing arts'],\n\t\t['title' =>'Personal communication'],\n\t\t['title' =>'Pharmaceutical chemistry'],\n\t\t['title' =>'Pharmacogenomics'],\n\t\t['title' =>'Pharmacognosy'],\n\t\t['title' =>'Pharmacology'],\n\t\t['title' =>'Philosophy'],\n\t\t['title' =>'Phonology'],\n\t\t['title' =>'Photochemistry'],\n\t\t['title' =>'Physical chemistry'],\n\t\t['title' =>'Physical therapy'],\n\t\t['title' =>'Physical optics'],\n\t\t['title' =>'Molecular physiology'],\n\t\t['title' =>'Plant biotechnology'],\n\t\t['title' =>'Plant biochemistry'],\n\t\t['title' =>'Plant genealogy'],\n\t\t['title' =>'Plant genetics'],\n\t\t['title' =>'Plasma'],\n\t\t['title' =>'Plastic surgery'],\n\t\t['title' =>'Policy planning'],\n\t\t['title' =>'Political science'],\n\t\t['title' =>'Pollution'],\n\t\t['title' =>'Polymer chemistry'],\n\t\t['title' =>'Population genetics'],\n\t\t['title' =>'Pragmatics'],\n\t\t['title' =>'Computer programming'],\n\t\t['title' =>'Project/Program description'],\n\t\t['title' =>'Promotional content'],\n\t\t['title' =>'Public administration'],\n\t\t['title' =>'Public economics'],\n\t\t['title' =>'Public health'],\n\t\t['title' =>'Quantum optics'],\n\t\t['title' =>'Quantum physics'],\n\t\t['title' =>'Race'],\n\t\t['title' =>'Radiation'],\n\t\t['title' =>'Radiology'],\n\t\t['title' =>'Radiotherapy planning'],\n\t\t['title' =>'Recommendation letter'],\n\t\t['title' =>'Records management'],\n\t\t['title' =>'Religious studies'],\n\t\t['title' =>'Remote sensing'],\n\t\t['title' =>'Remote sensing and sensor optics'],\n\t\t['title' =>'Renewable energy'],\n\t\t['title' =>'Reproductive biology'],\n\t\t['title' =>'Reproductive medicine'],\n\t\t['title' =>'Respiratory care'],\n\t\t['title' =>'Resumes'],\n\t\t['title' =>'Rheumatology'],\n\t\t['title' =>'Robotics'],\n\t\t['title' =>'Rural sociology'],\n\t\t['title' =>'Scattering'],\n\t\t['title' =>'School/University/Job application'],\n\t\t['title' =>'Seismology and tectonics'],\n\t\t['title' =>'Semantics'],\n\t\t['title' =>'Electronic sensors'],\n\t\t['title' =>'Sensory systems'],\n\t\t['title' =>'Sexual health'],\n\t\t['title' =>'Signal processing'],\n\t\t['title' =>'Social psychology'],\n\t\t['title' =>'Sociology'],\n\t\t['title' =>'Software engineering'],\n\t\t['title' =>'Soil science'],\n\t\t['title' =>'Solid-state physics'],\n\t\t['title' =>'Space and planetary science'],\n\t\t['title' =>'Spatial economics'],\n\t\t['title' =>'Specialist studies in education'],\n\t\t['title' =>'Spectroscopy'],\n\t\t['title' =>'Sports'],\n\t\t['title' =>'Sports medicine'],\n\t\t['title' =>'Statistics'],\n\t\t['title' =>'Stem cell research'],\n\t\t['title' =>'Operations management'],\n\t\t['title' =>'Structural biology'],\n\t\t['title' =>'Structural chemistry'],\n\t\t['title' =>'Creative arts'],\n\t\t['title' =>'Supply chain management'],\n\t\t['title' =>'Supramolecular chemistry'],\n\t\t['title' =>'Head and neck surgery'],\n\t\t['title' =>'Surgery - Cardiac and cardiothoracic'],\n\t\t['title' =>'Sustainable development'],\n\t\t['title' =>'Synoptic meteorology'],\n\t\t['title' =>'Syntax'],\n\t\t['title' =>'Systems biology'],\n\t\t['title' =>'Taxonomy'],\n\t\t['title' =>'Telecommunications'],\n\t\t['title' =>'Theoretical chemistry'],\n\t\t['title' =>'Theoretical physics'],\n\t\t['title' =>'Thin films'],\n\t\t['title' =>'Tourism economics'],\n\t\t['title' =>'Tourism studies'],\n\t\t['title' =>'Hospitality management'],\n\t\t['title' =>'Transplantation - Surgery'],\n\t\t['title' =>'Transplantation immunology'],\n\t\t['title' =>'Transport economics'],\n\t\t['title' =>'Ultrafast optics'],\n\t\t['title' =>'Urban sociology'],\n\t\t['title' =>'Urology'],\n\t\t['title' =>'Veterinary sciences'],\n\t\t['title' =>'Virology'],\n\t\t['title' =>'Visual optics'],\n\t\t['title' =>'Visual arts'],\n\t\t['title' =>'Waste management'],\n\t\t['title' =>'Wireless communication'],\n\t\t['title' =>'X-ray optics'],\n\t\t['title' =>'Zoology'],\n\t\t['title' =>'Mycology'],\n\t\t['title' =>'Toxicology'],\n\t\t['title' =>'Financial economics'],\n\t\t['title' =>'Industrial organization'],\n\t\t['title' =>'Phylogenetics'],\n\t\t['title' =>'Actuarial science'],\n\t\t['title' =>'Game theory'],\n\t\t['title' =>'Marginalization'],\n\t\t['title' =>'Sociological theory'],\n\t\t['title' =>'Sociology of health'],\n\t\t['title' =>'Sociology of immigration'],\n\t\t['title' =>'Social conflict'],\n\t\t['title' =>'Sociology of the family'],\n\t\t['title' =>'Remedial education'],\n\t\t['title' =>'Materials chemistry'],\n\t\t['title' =>'Colloids'],\n\t\t['title' =>'Natural product chemistry'],\n\t\t['title' =>'Photonics'],\n\t\t['title' =>'Environmental economics'],\n\t\t['title' =>'Health economics'],\n\t\t['title' =>'Neuroendocrinology'],\n\t\t['title' =>'Neuropharmacology'],\n\t\t['title' =>'Neurophysiology'],\n\t\t['title' =>'Sleep disorders'],\n\t\t['title' =>'Stroke - Neurology'],\n\t\t['title' =>'Allergies - Clinical'],\n\t\t['title' =>'Metal implants'],\n\t\t['title' =>'Structural materials'],\n\t\t['title' =>'Fibers'],\n\t\t['title' =>'Eating behaviors'],\n\t\t['title' =>'Patient education'],\n\t\t['title' =>'Financial risk management'],\n\t\t['title' =>'Questionnaires/Surveys'],\n\t\t['title' =>'Bioremediation'],\n\t\t['title' =>'Aerosol science'],\n\t\t['title' =>'Indoor air quality'],\n\t\t['title' =>'Environmental engineering'],\n\t\t['title' =>'Life cycle assessment'],\n\t\t['title' =>'Energy conservation'],\n\t\t['title' =>'Energy in buildings'],\n\t\t['title' =>'Energy resource technologies'],\n\t\t['title' =>'Nuclear energy'],\n\t\t['title' =>'Electronic component fabrication'],\n\t\t['title' =>'Biodiversity'],\n\t\t['title' =>'Wildlife conservation'],\n\t\t['title' =>'Engineering geology'],\n\t\t['title' =>'Geochemistry'],\n\t\t['title' =>'Stratigraphy'],\n\t\t['title' =>'Volcanology'],\n\t\t['title' =>'Architectural aesthetics'],\n\t\t['title' =>'Fashion design'],\n\t\t['title' =>'Product aesthetics'],\n\t\t['title' =>'Memory disorders'],\n\t\t['title' =>'Lab on a chip'],\n\t\t['title' =>'Organic pollutant removal'],\n\t\t['title' =>'Stroke - Cardiology'],\n\t\t['title' =>'Business policy'],\n\t\t['title' =>'Corporate governance'],\n\t\t['title' =>'Corporate social responsibility'],\n\t\t['title' =>'Entrepreneurship'],\n\t\t['title' =>'Mergers and acquisitions'],\n\t\t['title' =>'Technology management'],\n\t\t['title' =>'Biosensors'],\n\t\t['title' =>'Curatorial studies'],\n\t\t['title' =>'Imaging physics'],\n\t\t['title' =>'Photovoltaics'],\n\t\t['title' =>'Spintronics'],\n\t\t['title' =>'Farmland ecology'],\n\t\t['title' =>'Livestock science'],\n\t\t['title' =>'Pest management'],\n\t\t['title' =>'Weed management'],\n\t\t['title' =>'African music'],\n\t\t['title' =>'African-American music'],\n\t\t['title' =>'American drama'],\n\t\t['title' =>'American music'],\n\t\t['title' =>'Antiques'],\n\t\t['title' =>'Antiquities'],\n\t\t['title' =>'Art collecting'],\n\t\t['title' =>'Art criticism'],\n\t\t['title' =>'Arts'],\n\t\t['title' =>'Arts education'],\n\t\t['title' =>'Bands'],\n\t\t['title' =>'British drama'],\n\t\t['title' =>'Choral music'],\n\t\t['title' =>'Classical music'],\n\t\t['title' =>'Community music'],\n\t\t['title' =>'Crafts'],\n\t\t['title' =>'Dance'],\n\t\t['title' =>'Digital music'],\n\t\t['title' =>'Disc jockeying'],\n\t\t['title' =>'Drama'],\n\t\t['title' =>'Early music'],\n\t\t['title' =>'Electronic music'],\n\t\t['title' =>'Experimental music'],\n\t\t['title' =>'Folk dance'],\n\t\t['title' =>'Folk music'],\n\t\t['title' =>'Jazz'],\n\t\t['title' =>'Keyboard instruments'],\n\t\t['title' =>'Liberal arts education'],\n\t\t['title' =>'Museum management'],\n\t\t['title' =>'Music collecting'],\n\t\t['title' =>'Music composition'],\n\t\t['title' =>'Music education'],\n\t\t['title' =>'Music theory'],\n\t\t['title' =>'Musicology'],\n\t\t['title' =>'Opera'],\n\t\t['title' =>'Photography'],\n\t\t['title' =>'Popular music'],\n\t\t['title' =>'Sound recording preservation'],\n\t\t['title' =>'Stage production'],\n\t\t['title' =>'Textile arts'],\n\t\t['title' =>'Theater history'],\n\t\t['title' =>'Visual arts education'],\n\t\t['title' =>'World music'],\n\t\t['title' =>'Pottery design'],\n\t\t['title' =>'Decorative arts'],\n\t\t['title' =>'Gardens'],\n\t\t['title' =>'Graphic arts'],\n\t\t['title' =>'Home and lifestyle'],\n\t\t['title' =>'Home decor'],\n\t\t['title' =>'Interior design'],\n\t\t['title' =>'Water gardens'],\n\t\t['title' =>'Academic analytics'],\n\t\t['title' =>'Biography'],\n\t\t['title' =>'Paranormal phenomena'],\n\t\t['title' =>'Public speaking'],\n\t\t['title' =>'Speech communication'],\n\t\t['title' =>'Athletic training'],\n\t\t['title' =>'Books'],\n\t\t['title' =>'Celebrities'],\n\t\t['title' =>'Communication theory'],\n\t\t['title' =>'Electronic publishing'],\n\t\t['title' =>'Fashion'],\n\t\t['title' =>'Film studies'],\n\t\t['title' =>'Film criticism'],\n\t\t['title' =>'Film history'],\n\t\t['title' =>'Film music'],\n\t\t['title' =>'Food'],\n\t\t['title' =>'Humor'],\n\t\t['title' =>'Internet research'],\n\t\t['title' =>'Investigative journalism'],\n\t\t['title' =>'Journalism'],\n\t\t['title' =>'Martial arts'],\n\t\t['title' =>'Media literacy'],\n\t\t['title' =>'Media studies'],\n\t\t['title' =>'News'],\n\t\t['title' =>'Outdoor recreation'],\n\t\t['title' =>'Periodical publishing industry'],\n\t\t['title' =>'Publishing industry'],\n\t\t['title' =>'Soccer'],\n\t\t['title' =>'Social networks'],\n\t\t['title' =>'Technical communication'],\n\t\t['title' =>'Television studies'],\n\t\t['title' =>'Visual communication'],\n\t\t['title' =>'Wine and wineries'],\n\t\t['title' =>'Amino acids'],\n\t\t['title' =>'Biomolecules'],\n\t\t['title' =>'Carbohydrates'],\n\t\t['title' =>'Clinical biochemistry'],\n\t\t['title' =>'Enzymes'],\n\t\t['title' =>'Glycobiology'],\n\t\t['title' =>'Lipids'],\n\t\t['title' =>'Metabolism'],\n\t\t['title' =>'Nucleic acids'],\n\t\t['title' =>'Proteins and peptides'],\n\t\t['title' =>'Proteomics'],\n\t\t['title' =>'Cytogenetics'],\n\t\t['title' =>'Genomics'],\n\t\t['title' =>'Immunogenetics'],\n\t\t['title' =>'Molecular genetics'],\n\t\t['title' =>'Antigens'],\n\t\t['title' =>'Bacteriophage'],\n\t\t['title' =>'Clinical immunology'],\n\t\t['title' =>'Clinical microbiology'],\n\t\t['title' =>'Immunoassay'],\n\t\t['title' =>'Immunochemistry'],\n\t\t['title' =>'Molecular virology'],\n\t\t['title' =>'Retrovirology'],\n\t\t['title' =>'Antioxidants and oxidative stress'],\n\t\t['title' =>'Biological markers'],\n\t\t['title' =>'Cell aging'],\n\t\t['title' =>'Chronobiology'],\n\t\t['title' =>'Cryobiology'],\n\t\t['title' =>'Enology'],\n\t\t['title' =>'Liposomes'],\n\t\t['title' =>'Molecular evolution'],\n\t\t['title' =>'Xenobiology'],\n\t\t['title' =>'Biological systems engineering'],\n\t\t['title' =>'Agribusiness'],\n\t\t['title' =>'Airport management'],\n\t\t['title' =>'Arms and defense'],\n\t\t['title' =>'Business/personal communication'],\n\t\t['title' =>'Business competition'],\n\t\t['title' =>'Business education'],\n\t\t['title' =>'Business ethics'],\n\t\t['title' =>'Business history'],\n\t\t['title' =>'Business intelligence'],\n\t\t['title' =>'Case management'],\n\t\t['title' =>'Casino and gaming management'],\n\t\t['title' =>'Commercial law'],\n\t\t['title' =>'Construction and building'],\n\t\t['title' =>'Consumer goods industry'],\n\t\t['title' =>'Consumer protection and product reviews'],\n\t\t['title' =>'Cooperative organizations'],\n\t\t['title' =>'Corporate law'],\n\t\t['title' =>'Crisis management'],\n\t\t['title' =>'Customer service'],\n\t\t['title' =>'Distribution'],\n\t\t['title' =>'Employee benefits'],\n\t\t['title' =>'Employee performance evaluation'],\n\t\t['title' =>'Employee selection'],\n\t\t['title' =>'Event planning'],\n\t\t['title' =>'Exports and imports'],\n\t\t['title' =>'Farm management'],\n\t\t['title' =>'Financial crisis management'],\n\t\t['title' =>'Franchise law'],\n\t\t['title' =>'Hospitality industry'],\n\t\t['title' =>'Industrial research'],\n\t\t['title' =>'Innovation management'],\n\t\t['title' =>'International business'],\n\t\t['title' =>'Inventory management and control'],\n\t\t['title' =>'Knowledge management'],\n\t\t['title' =>'Leadership'],\n\t\t['title' =>'Nonprofit organization administration'],\n\t\t['title' =>'Operations research'],\n\t\t['title' =>'Outsourcing and offshoring'],\n\t\t['title' =>'Production management'],\n\t\t['title' =>'Public relations'],\n\t\t['title' =>'Quality management'],\n\t\t['title' =>'Small business'],\n\t\t['title' =>'Sports marketing'],\n\t\t['title' =>'Strategic management'],\n\t\t['title' =>'Sustainable business'],\n\t\t['title' =>'Banking law'],\n\t\t['title' =>'Investing'],\n\t\t['title' =>'Bankruptcy law'],\n\t\t['title' =>'Casualty insurance'],\n\t\t['title' =>'Central banking'],\n\t\t['title' =>'Estate planning'],\n\t\t['title' =>'Financial advising'],\n\t\t['title' =>'Financial markets'],\n\t\t['title' =>'Financial mathematics'],\n\t\t['title' =>'Financial regulation'],\n\t\t['title' =>'Financial technology'],\n\t\t['title' =>'Humanitarian funding'],\n\t\t['title' =>'Humanitarian relief'],\n\t\t['title' =>'Insurance law'],\n\t\t['title' =>'National health insurance'],\n\t\t['title' =>'Personal finance'],\n\t\t['title' =>'Philanthropy'],\n\t\t['title' =>'Property tax'],\n\t\t['title' =>'Public finance'],\n\t\t['title' =>'Securities'],\n\t\t['title' =>'Tax law'],\n\t\t['title' =>'Calorimetry'],\n\t\t['title' =>'Chromatography'],\n\t\t['title' =>'Mass spectrometry'],\n\t\t['title' =>'Combustion'],\n\t\t['title' =>'Cosmetics chemistry'],\n\t\t['title' =>'Petrochemistry'],\n\t\t['title' =>'Separation and purification techniques'],\n\t\t['title' =>'Green chemistry'],\n\t\t['title' =>'Heterocyclic chemistry'],\n\t\t['title' =>'Organometallic chemistry'],\n\t\t['title' =>'Adsorption'],\n\t\t['title' =>'Astrochemistry'],\n\t\t['title' =>'Chemical kinetics'],\n\t\t['title' =>'Cheminformatics'],\n\t\t['title' =>'Cosmochemistry'],\n\t\t['title' =>'Dispersion chemistry'],\n\t\t['title' =>'Electrophoresis'],\n\t\t['title' =>'Femtochemistry'],\n\t\t['title' =>'Isotopes'],\n\t\t['title' =>'Mechanochemistry'],\n\t\t['title' =>'Molecular mechanics'],\n\t\t['title' =>'Sonochemistry'],\n\t\t['title' =>'Systems chemistry'],\n\t\t['title' =>'Thermochemistry'],\n\t\t['title' =>'Automated reasoning'],\n\t\t['title' =>'Cellular automata'],\n\t\t['title' =>'Chaos theory'],\n\t\t['title' =>'Dynamic programming'],\n\t\t['title' =>'Finite element analysis'],\n\t\t['title' =>'Fractals'],\n\t\t['title' =>'Linear programming'],\n\t\t['title' =>'Coding theory'],\n\t\t['title' =>'Compilers'],\n\t\t['title' =>'Computational complexity theory'],\n\t\t['title' =>'Concurrent programming'],\n\t\t['title' =>'Fault-tolerant computing'],\n\t\t['title' =>'Formal verification'],\n\t\t['title' =>'Functional programming'],\n\t\t['title' =>'Imperative programming'],\n\t\t['title' =>'Logic programming'],\n\t\t['title' =>'Object-oriented programming'],\n\t\t['title' =>'Ontology'],\n\t\t['title' =>'Program semantics'],\n\t\t['title' =>'Supercomputing'],\n\t\t['title' =>'Natural computation'],\n\t\t['title' =>'Virtual reality'],\n\t\t['title' =>'Discrete mathematics'],\n\t\t['title' =>'Graph theory'],\n\t\t['title' =>'Group theory'],\n\t\t['title' =>'Knot theory'],\n\t\t['title' =>'Mathematical logic'],\n\t\t['title' =>'Mathematical wavelets'],\n\t\t['title' =>'Model theory'],\n\t\t['title' =>'Proof theory'],\n\t\t['title' =>'Recursion theory'],\n\t\t['title' =>'Sampling theory'],\n\t\t['title' =>'Set theory'],\n\t\t['title' =>'Symbolic logic'],\n\t\t['title' =>'Type theory'],\n\t\t['title' =>'Multimedia and hypermedia'],\n\t\t['title' =>'Climate change'],\n\t\t['title' =>'Gemology'],\n\t\t['title' =>'Geomorphology'],\n\t\t['title' =>'Glaciology'],\n\t\t['title' =>'Hydrogeology'],\n\t\t['title' =>'Palynology'],\n\t\t['title' =>'Sedimentology'],\n\t\t['title' =>'Speleology'],\n\t\t['title' =>'Land surveying'],\n\t\t['title' =>'Navigation'],\n\t\t['title' =>'Meteoroids'],\n\t\t['title' =>'Capitalism'],\n\t\t['title' =>'Electric power'],\n\t\t['title' =>'Household economics'],\n\t\t['title' =>'Human services'],\n\t\t['title' =>'Poverty'],\n\t\t['title' =>'Public-Private partnership'],\n\t\t['title' =>'Resource economics'],\n\t\t['title' =>'Welfare economics'],\n\t\t['title' =>'Emissions trading'],\n\t\t['title' =>'Social choice theory'],\n\t\t['title' =>'Academic testing'],\n\t\t['title' =>'Adult education'],\n\t\t['title' =>'Career guidance'],\n\t\t['title' =>'Comparative education'],\n\t\t['title' =>'Computer-assisted instruction'],\n\t\t['title' =>'Distance education'],\n\t\t['title' =>'Early childhood education'],\n\t\t['title' =>'Education history'],\n\t\t['title' =>'Education law'],\n\t\t['title' =>'Education policy'],\n\t\t['title' =>'Education reform'],\n\t\t['title' =>'Educational effectiveness'],\n\t\t['title' =>'Educational facilities'],\n\t\t['title' =>'Educational innovation'],\n\t\t['title' =>'Educational technology'],\n\t\t['title' =>'Elementary education'],\n\t\t['title' =>'Ethics education'],\n\t\t['title' =>'Experiential education'],\n\t\t['title' =>'Higher education'],\n\t\t['title' =>'Inclusive education'],\n\t\t['title' =>'International education'],\n\t\t['title' =>'Learning'],\n\t\t['title' =>'Literacy'],\n\t\t['title' =>'Middle school education'],\n\t\t['title' =>'Rural education'],\n\t\t['title' =>'Secondary education'],\n\t\t['title' =>'Teacher education'],\n\t\t['title' =>'Teaching'],\n\t\t['title' =>'Urban education'],\n\t\t['title' =>'Foreign language learning'],\n\t\t['title' =>'Electronic packaging'],\n\t\t['title' =>'Integrated circuits'],\n\t\t['title' =>'Liquid crystal electronics'],\n\t\t['title' =>'Power electronics'],\n\t\t['title' =>'Power engineering'],\n\t\t['title' =>'Semiconductors'],\n\t\t['title' =>'Sound equipment'],\n\t\t['title' =>'VLSI design'],\n\t\t['title' =>'Satellite communication'],\n\t\t['title' =>'Television broadcasting'],\n\t\t['title' =>'Bridge construction'],\n\t\t['title' =>'Earthquake engineering'],\n\t\t['title' =>'Ecological engineering'],\n\t\t['title' =>'Heating, ventilation, and air conditioning'],\n\t\t['title' =>'Mining engineering'],\n\t\t['title' =>'Road construction'],\n\t\t['title' =>'Space frame structures'],\n\t\t['title' =>'Traffic engineering'],\n\t\t['title' =>'Electromechanics'],\n\t\t['title' =>'Hydraulic engineering'],\n\t\t['title' =>'Instrumentation engineering'],\n\t\t['title' =>'Pneumatics'],\n\t\t['title' =>'Astronautics engineering'],\n\t\t['title' =>'Continuum mechanics'],\n\t\t['title' =>'Fluid mechanics'],\n\t\t['title' =>'Fracture mechanics'],\n\t\t['title' =>'Heat and mass transport'],\n\t\t['title' =>'Laboratory automation'],\n\t\t['title' =>'Mechatronics'],\n\t\t['title' =>'Weapons systems'],\n\t\t['title' =>'Biomass energy'],\n\t\t['title' =>'Distributed power generation'],\n\t\t['title' =>'Coastal management'],\n\t\t['title' =>'Environmental technology'],\n\t\t['title' =>'Land management'],\n\t\t['title' =>'Natural resource management'],\n\t\t['title' =>'Recreation ecology'],\n\t\t['title' =>'Industrial archaeology'],\n\t\t['title' =>'Paleobiology'],\n\t\t['title' =>'Paleontology'],\n\t\t['title' =>'African history'],\n\t\t['title' =>'African-American history'],\n\t\t['title' =>'American Civil War'],\n\t\t['title' =>'Ancient history'],\n\t\t['title' =>'Asian history'],\n\t\t['title' =>'British history'],\n\t\t['title' =>'Canadian history'],\n\t\t['title' =>'Central European history'],\n\t\t['title' =>'Cultural heritage'],\n\t\t['title' =>'Early modern history'],\n\t\t['title' =>'Egyptology'],\n\t\t['title' =>'Eighteenth-century history'],\n\t\t['title' =>'European history'],\n\t\t['title' =>'French history'],\n\t\t['title' =>'German history'],\n\t\t['title' =>'Historic preservation'],\n\t\t['title' =>'Historical consciousness'],\n\t\t['title' =>'Holocaust studies'],\n\t\t['title' =>'Israeli history'],\n\t\t['title' =>'Japanese history'],\n\t\t['title' =>'Latin American history'],\n\t\t['title' =>'Local history'],\n\t\t['title' =>'Middle Ages'],\n\t\t['title' =>'Modern history'],\n\t\t['title' =>'Nineteenth-century history'],\n\t\t['title' =>'Prehistory'],\n\t\t['title' =>'Renaissance history'],\n\t\t['title' =>'Russian history'],\n\t\t['title' =>'Scandinavian history'],\n\t\t['title' =>'Social history'],\n\t\t['title' =>'South American history'],\n\t\t['title' =>'Twentieth-century history'],\n\t\t['title' =>'United States history'],\n\t\t['title' =>'Victorian Era'],\n\t\t['title' =>'Women\\'s history'],\n\t\t['title' =>'World War II'],\n\t\t['title' =>'Administrative law'],\n\t\t['title' =>'Agricultural law'],\n\t\t['title' =>'Antitrust law'],\n\t\t['title' =>'Appellate law'],\n\t\t['title' =>'Arbitration'],\n\t\t['title' =>'Heritage law'],\n\t\t['title' =>'Civil law'],\n\t\t['title' =>'Common law'],\n\t\t['title' =>'Community development law'],\n\t\t['title' =>'Comparative law'],\n\t\t['title' =>'Constitutional law'],\n\t\t['title' =>'Consumer rights law'],\n\t\t['title' =>'Contracts'],\n\t\t['title' =>'Courts'],\n\t\t['title' =>'Criminal law'],\n\t\t['title' =>'Cyber law'],\n\t\t['title' =>'Discrimination law'],\n\t\t['title' =>'Employment law'],\n\t\t['title' =>'Energy law'],\n\t\t['title' =>'Entertainment law'],\n\t\t['title' =>'Environmental law'],\n\t\t['title' =>'Equal opportunity law'],\n\t\t['title' =>'European law'],\n\t\t['title' =>'Evidence law'],\n\t\t['title' =>'Family court'],\n\t\t['title' =>'Family law'],\n\t\t['title' =>'Human rights law'],\n\t\t['title' =>'Intellectual property law'],\n\t\t['title' =>'Islamic law'],\n\t\t['title' =>'Jurisprudence'],\n\t\t['title' =>'Juvenile corrections'],\n\t\t['title' =>'Law enforcement'],\n\t\t['title' =>'Legal history'],\n\t\t['title' =>'Maritime law'],\n\t\t['title' =>'Natural law'],\n\t\t['title' =>'Property law'],\n\t\t['title' =>'Public interest law'],\n\t\t['title' =>'Sports law'],\n\t\t['title' =>'State courts'],\n\t\t['title' =>'American philosophy'],\n\t\t['title' =>'Analytic philosophy'],\n\t\t['title' =>'Ancient philosophy'],\n\t\t['title' =>'Bioethics'],\n\t\t['title' =>'Chinese philosophy'],\n\t\t['title' =>'Consciousness'],\n\t\t['title' =>'Critical theory'],\n\t\t['title' =>'Existentialism'],\n\t\t['title' =>'German philosophy'],\n\t\t['title' =>'Hermeneutics'],\n\t\t['title' =>'Humanism'],\n\t\t['title' =>'Metaphysics'],\n\t\t['title' =>'Modern philosophy'],\n\t\t['title' =>'Natural philosophy'],\n\t\t['title' =>'Phenomenology'],\n\t\t['title' =>'Philosophy history'],\n\t\t['title' =>'Religious freedom'],\n\t\t['title' =>'Russian philosophy'],\n\t\t['title' =>'Skepticism'],\n\t\t['title' =>'Social ethics'],\n\t\t['title' =>'Universalism'],\n\t\t['title' =>'African-American studies'],\n\t\t['title' =>'Agrarianism'],\n\t\t['title' =>'American studies'],\n\t\t['title' =>'Asian studies'],\n\t\t['title' =>'Asian-American studies'],\n\t\t['title' =>'Chinese studies'],\n\t\t['title' =>'Civil wars'],\n\t\t['title' =>'Cold War'],\n\t\t['title' =>'Communism'],\n\t\t['title' =>'Conservatism'],\n\t\t['title' =>'Constructivism'],\n\t\t['title' =>'Democracy'],\n\t\t['title' =>'Former Soviet Republics'],\n\t\t['title' =>'Interfaith relations'],\n\t\t['title' =>'Israeli-Palestinian conflict'],\n\t\t['title' =>'Japanese studies'],\n\t\t['title' =>'Korean studies'],\n\t\t['title' =>'Libertarianism'],\n\t\t['title' =>'Local politics'],\n\t\t['title' =>'Military history'],\n\t\t['title' =>'Military policy'],\n\t\t['title' =>'Nationalism'],\n\t\t['title' =>'Naval history'],\n\t\t['title' =>'Northeast Asia studies'],\n\t\t['title' =>'Nuclear weapons'],\n\t\t['title' =>'Organized labor'],\n\t\t['title' =>'Peace studies'],\n\t\t['title' =>'Political anthropology'],\n\t\t['title' =>'Political campaigns'],\n\t\t['title' =>'Political commentary'],\n\t\t['title' =>'Political economy'],\n\t\t['title' =>'Political psychology'],\n\t\t['title' =>'Political sociology'],\n\t\t['title' =>'Politics'],\n\t\t['title' =>'Elections'],\n\t\t['title' =>'Presidential studies'],\n\t\t['title' =>'Public opinion'],\n\t\t['title' =>'Terrorism'],\n\t\t['title' =>'Totalitarianism'],\n\t\t['title' =>'United States Congress'],\n\t\t['title' =>'United States politics'],\n\t\t['title' =>'War'],\n\t\t['title' =>'State policy'],\n\t\t['title' =>'Adventism'],\n\t\t['title' =>'Anglicanism'],\n\t\t['title' =>'Baptist Church'],\n\t\t['title' =>'Buddhism'],\n\t\t['title' =>'Catholic education'],\n\t\t['title' =>'Catholicism'],\n\t\t['title' =>'Christian ethics'],\n\t\t['title' =>'Christian evangelism'],\n\t\t['title' =>'Christian ministry'],\n\t\t['title' =>'Christian preaching'],\n\t\t['title' =>'Christian studies'],\n\t\t['title' =>'Christianity'],\n\t\t['title' =>'Congregationalism'],\n\t\t['title' =>'Franciscanism'],\n\t\t['title' =>'Hinduism'],\n\t\t['title' =>'History of Christianity'],\n\t\t['title' =>'History of Judaism'],\n\t\t['title' =>'History of religions'],\n\t\t['title' =>'Islam'],\n\t\t['title' =>'Judaism'],\n\t\t['title' =>'Lutheran Church'],\n\t\t['title' =>'Methodist Church'],\n\t\t['title' =>'Monasticism'],\n\t\t['title' =>'Mormonism'],\n\t\t['title' =>'Mysticism'],\n\t\t['title' =>'Mythology'],\n\t\t['title' =>'New Testament studies'],\n\t\t['title' =>'Old Testament studies'],\n\t\t['title' =>'Orthodox Christianity'],\n\t\t['title' =>'Paganism'],\n\t\t['title' =>'Patristics'],\n\t\t['title' =>'Pentecostalism'],\n\t\t['title' =>'Presbyterianism'],\n\t\t['title' =>'Protestant Reformation'],\n\t\t['title' =>'Protestantism'],\n\t\t['title' =>'Religious psychology'],\n\t\t['title' =>'Sikhism'],\n\t\t['title' =>'Indigenous languages'],\n\t\t['title' =>'Language translation'],\n\t\t['title' =>'Medieval language'],\n\t\t['title' =>'Multilingual education'],\n\t\t['title' =>'Multilingualism'],\n\t\t['title' =>'Semiotics'],\n\t\t['title' =>'African literature'],\n\t\t['title' =>'African-American literature'],\n\t\t['title' =>'American literature'],\n\t\t['title' =>'British literature'],\n\t\t['title' =>'Canadian literature'],\n\t\t['title' =>'Children\\'s literature'],\n\t\t['title' =>'Dialogism'],\n\t];\n\tDB::table('subjectarea')->insert($subject_area_seeder);\n }", "public function run()\n {\n $sampleArticle = new SampleArticle();\n $sampleArticle->user_id = '1';\n $sampleArticle->reference = '5866';\n $sampleArticle->description = 'Meia de trail';\n $sampleArticle->image_url = 'meia_trai.jpg';\n $sampleArticle->sample_article_status_id = '1';\n $sampleArticle->tamanho1 = '35/38';\n $sampleArticle->pe1 = '33';\n $sampleArticle->perna1 = '40';\n $sampleArticle->punho1 = '9,5';\n $sampleArticle->malha1 = '23';\n $sampleArticle->maq1 = '156';\n $sampleArticle->forma1 = '10,5';\n $sampleArticle->tamanho2 = '39/42';\n $sampleArticle->pe2 = '33';\n $sampleArticle->perna2 = '40';\n $sampleArticle->punho2 = '9,5';\n $sampleArticle->malha2 = '23';\n $sampleArticle->maq2 = '156';\n $sampleArticle->forma2 = '10,5';\n $sampleArticle->tamanho3 = '43/46';\n $sampleArticle->pe3 = '33';\n $sampleArticle->perna3 = '40';\n $sampleArticle->punho3 = '9,5';\n $sampleArticle->malha3 = '23';\n $sampleArticle->maq3 = '156';\n $sampleArticle->forma3 = '10,5';\n $sampleArticle->tamanho4 = '47/50';\n $sampleArticle->pe4 = '33';\n $sampleArticle->perna4 = '40';\n $sampleArticle->punho4 = '9,5';\n $sampleArticle->malha4 = '23';\n $sampleArticle->maq4 = '156';\n $sampleArticle->forma4 = '10,5';\n $sampleArticle->cost1 = '9,5';\n $sampleArticle->cost2 = '23';\n $sampleArticle->cost3 = '156';\n $sampleArticle->cost4 = '10,5';\n $sampleArticle->save();\n }", "public function intro() {\n\n }", "public function run()\n {\n\t\t$training = App\\Training::find(1);\n\t\t$training->Trainee()->attach(1);\n\t\t$training->Trainee()->attach(2);\n\n\t\t$training = App\\Training::find(2);\n\t\t$training->Trainee()->attach(1);\n\t\t$training->Trainee()->attach(2);\n }", "public function ogs()\r\n {\r\n }", "public function main()\n {\n\n }", "function fann_train($ann, $input, $desired_output)\n{\n}", "public function run()\n {\n $faker = Faker::create('id_ID');\n for ($i=0; $i < 10; $i++) { \n \t$alternative = Alternative::create([\n \t\t'name' => $faker->name,\n \t\t'phone_number' => $faker->e164PhoneNumber,\n \t\t'address' => $faker->address,\n \t]);\n\n for ($x=1; $x <= count(Criteria::all()) ; $x++) { \n $alternative->scores()->create([\n 'criteria_id' => $x,\n 'score' => $faker->numberBetween(1,5),\n ]);\n }\n }\n }", "public function run()\n {\n $trainer1 = Trainer::find(1);\n $trainer2 = Trainer::find(2);\n\n $edu1 = new Education();\n $edu1->school = 'Saint Louis University';\n $edu1->year_graduated = 2017;\n $edu1->trainer()->associate($trainer1)->save();\n \n $edu1 = new Education();\n $edu1->school = 'University of the Philippines';\n $edu1->year_graduated = 2018;\n $edu1->trainer()->associate($trainer1)->save();\n \n $edu2 = new Education();\n $edu2->school = 'University of Baguio';\n $edu2->year_graduated = 2018;\n $edu2->trainer()->associate($trainer2)->save();\n }", "function ucsc_getListGenePrediction($orgv,&$predictions){\n checkConfig(); global $annot_file;\n $lines=file($annot_file);\n foreach($lines as $line){\n list($orgg,$org,$version,$data)=explode(\",\",$line);\n if(strtoupper($orgv)==strtoupper($version)){\n $annots=split(\":\",$data);\n foreach($annots as $annot)\n $predictions[]=array('prediction'=>array('name'=>$annot,'id'=>$annot));\n break;\n }\n }\n}", "static function main()\n {\n self::primeAnagrams(self::prime1000());\n }", "public function biography();", "public function run()\n {\n $surgery_names = array(\n 'Genital',\n 'Female',\n\n 'Cervicectomy',\n 'Clitoridectomy ',\n 'Hysterectomy',\n 'Myomectomy',\n 'Oophorectomy',\n 'Salpingectomy',\n 'Salpingoophorectomy',\n 'Vaginectomy ',\n 'Vulvectomy',\n\n 'Male',\n\n 'Gonadectomy',\n 'Orchiectomy ',\n 'Penectomy',\n 'Posthectomy ',\n 'Prostatectomy',\n 'Varicocelectomy ',\n 'Vasectomy',\n\n 'Musculoskeletal ',\n\n 'Bursectomy',\n\n 'Amputation ',\n\n 'Hemicorporectomy',\n 'Hemipelvectomy ',\n\n 'Nervous system',\n 'CNS ',\n\n 'Decompressive craniectomy',\n 'Hemispherectomy ',\n 'Anterior temporal lobectomy',\n 'Hypophysectomy ',\n 'Amygdalohippocampectomy',\n 'Laminectomy ',\n 'Corpectomy',\n 'Facetectomy ',\n\n 'PNS',\n\n 'Ganglionectomy ',\n 'Sympathectomy / Endoscopic thoracic sympathectomy',\n 'Neurectomy ',\n 'Nerve transfer',\n\n 'Ear ',\n\n 'Stapedectomy',\n 'Mastoidectomy ',\n\n 'Eye',\n\n 'Photorefractive keratectomy ',\n 'Trabeculectomy',\n 'Iridectomy ',\n 'Vitrectomy',\n\n 'Gastrointestinal ',\n\n 'Glossectomy',\n 'Esophagectomy ',\n 'Gastrectomy',\n 'Appendectomy ',\n 'Proctocolectomy',\n 'Colectomy ',\n 'Hepatectomy',\n 'Cholecystectomy ',\n 'Pancreatectomy / Pancreaticoduodenectomy',\n\n 'Respiratory ',\n\n 'Rhinectomy',\n 'Laryngectomy ',\n 'Pneumonectomy',\n\n 'Endocrine ',\n\n 'Hypophysectomy',\n 'Thyroidectomy ',\n 'Parathyroidectomy',\n 'Adrenalectomy ',\n 'Pinealectomy',\n\n 'Renal ',\n\n 'Nephrectomy',\n 'Cystectomy ',\n\n 'Lymphatic',\n\n 'Tonsillectomy ',\n 'Adenoidectomy',\n 'Thymectomy',\n 'Splenectomy',\n 'Lymphadenectomy ',\n 'Adenectomy',\n\n 'Breast ',\n\n 'Lumpectomy',\n 'Mastectomy ',\n\n 'Bone / joint',\n\n 'Coccygectomy ',\n 'Ostectomy',\n 'Femoral head ostectomy ',\n 'Astragalectomy',\n 'Discectomy ',\n 'Synovectomy',\n\n 'Ungrouped ',\n\n 'Embolectomy',\n 'Endarterectomy ',\n 'Frenectomy',\n 'Ganglionectomy ',\n 'Gingivectomy',\n 'Lobectomy ',\n 'Myomectomy',\n 'Panniculectomy ',\n 'Pericardiectomy',\n\n 'Ostomy ',\n 'Gastrointestinal',\n\n 'Gastrostomy ',\n 'Percutaneous endoscopic gastrostomy',\n 'Gastroduodenostomy ',\n 'Gastroenterostomy',\n 'Ileostomy ',\n 'Jejunostomy',\n 'Colostomy ',\n 'Cholecystostomy',\n 'Hepatoportoenterostomy ',\n\n 'Urogenital',\n\n 'Nephrostomy ',\n 'Ureterostomy',\n 'Cystostomy ',\n 'Suprapubic cystostomy',\n 'Urostomy ',\n\n 'Nervous system',\n\n 'Ventriculostomy ',\n\n 'Eye',\n\n 'Dacryocystorhinostomy ',\n\n 'Otomy',\n 'Urogenital ',\n\n 'Amniotomy',\n 'Clitoridotomy ',\n 'Hysterotomy',\n 'Hymenotomy',\n 'Episiotomy',\n 'Meatotomy',\n 'Nephrotomy',\n\n 'Nervous system',\n 'CNS',\n\n 'Craniotomy',\n 'Pallidotomy',\n 'Thalamotomy',\n 'Lobotomy',\n 'Bilateral cingulotomy',\n 'Cordotomy',\n 'Rhizotomy',\n 'Laminotomy',\n 'Foraminotomy',\n\n 'PNS',\n\n 'Axotomy',\n 'Vagotomy',\n\n 'Ear',\n\n 'Myringotomy',\n\n 'Eye',\n\n 'Radial keratotomy',\n\n 'Musculoskeletal',\n\n 'Myotomy',\n 'Tenotomy',\n 'Fasciotomy',\n 'Escharotomy',\n 'Osteotomy',\n 'Arthrotomy',\n 'Tendon transfer',\n\n 'Gastrointestinal',\n\n 'Myotomy',\n 'Heller myotomy',\n 'Pyloromyotomy',\n 'Anal sphincterotomy',\n 'Lateral internal sphincterotomy',\n\n 'Respiratory',\n\n 'Sinusotomy',\n 'Cricothyrotomy',\n 'Bronchotomy',\n 'Thoracotomy',\n 'Thyrotomy',\n 'Tracheotomy',\n\n 'Cardiovascular',\n\n 'Cardiotomy',\n 'Phlebotomy',\n 'Arteriotomy',\n 'Venotomy',\n\n 'Ungrouped',\n\n 'Laparotomy',\n );\n\n foreach ($surgery_names as $key => $value) {\n if (App\\SurgeryName::where('surgery_name', trim($value))->count() == 0) {\n DB::table('surgery_names')->insert([\n 'surgery_name' => trim($value),\n 'created_at' => now(),\n ]);\n }\n }\n }", "public function run()\n {\n $reasons = [ \n \"Annual Physical\",\n \"General Consultation\",\n \"Illness\",\n \"Infection Consultation\",\n \"New Patient Visit\",\n \"Acid Reflux / Heartburn\",\n \"Anemia\",\n \"Back Problems\",\n \"Bleeding Disorder\",\n \"Blood Pressure Testing\",\n \"Blood Work\",\n \"Bronchitis\",\n \"COVID-19 Antibody Test\",\n \"Chlamydia\",\n \"Cholesterol / Lipids Checkup\",\n \"Cholesterol Management\",\n \"Chronic Cough\",\n \"Chronic Illness\",\n \"Cold\",\n \"Cold Sores / Herpes Labialis\",\n \"Constipation\",\n \"Cough\",\n \"Diabetes Consultation\",\n \"ECG / EKG\",\n \"Ear Infection\",\n \"Electrocardiogram\",\n \"Elevated PSA\",\n \"Enlarged Lymph Nodes\",\n \"Erectile Dysfunction / Impotence / Male Sexual Dysfunction\",\n \"Eye Infection\",\n \"Fainting / Syncope\",\n \"Fatty Liver Disease\",\n \"Flu\",\n \"Frequent Urination\",\n \"General Follow Up\",\n \"Headache\",\n \"High Blood Pressure / Hypertension\",\n \"High Blood Sugar / Hyperglycemia\",\n \"High Cholesterol / Lipid Problem\",\n \"Hospital Discharge/Follow Up\",\n \"Hyperlipidemia\",\n \"Hyperthyroidism / Overactive Thyroid\",\n \"Hypogonadism\",\n \"Hypothyroidism / Underactive Thyroid\",\n \"Immigration Medical Examination\",\n \"Immunization\",\n \"Immunodeficiency\",\n \"Infection Follow Up\",\n \"Insomnia\",\n \"Iron Deficiency\",\n \"Kidney Stones\",\n \"Medication Review\",\n \"Migraine\",\n \"Nasal Congestion\",\n \"Pre-Surgery Checkup / Pre-Surgical Clearance\",\n \"Prescription / Refill\",\n \"Preventive Medicine Consultation\",\n \"Sexually Transmitted Disease (STD)\",\n \"Sleep Disorder\",\n \"Sore Throat\",\n \"Swelling in Neck\",\n \"Thyroid Evaluation\",\n \"Tiredness / Fatigue\",\n \"Type 2 Diabetes\",\n \"Urinary Urgency / Urge Incontinence\",\n ];\n \n \n foreach ($reasons as $reason) {\n DB::table('reasons')->insert([\n 'name' => $reason,\n 'created_at'=>date('Y-m-d H:i:s'),\n 'updated_at'=>date('Y-m-d H:i:s'), \n ]); \n }\n }", "public function run()\n {\n $about = [\n \"Housing Support Inc. was incorporated in 1990 as a vehicle to purchase a shelter for women and their children located in Amesbury Ma. In 1994, the bylaws were changed to broaden the scope of the agency and to add community leaders to the board.\",\n\n \"Since then the corporation has developed an additional eight properties in the communities of Haverhill, Lawrence, and Amesbury, which offer sober housing, supportive housing to homeless and/or disabled individuals and veterans. The projects were successfully completed despite challenges presented by difficult areas for the development and complex methods of competitive financing and public grant awards.\",\n\n \"These projects testify to a strong record by HSI in its ability to acquire property and develop it into affordable housing through public grants, public equity financing, market financing, and private donations. HSI has worked with The MA Land Bank, Community Economic Development and Assistance Corporation, Federal HOME Loan Bank, DHCD, DPH, DMH, DSS, MA Housing Finance Agency, Municipal Community Development Offices, MA Housing, North Shore HOME Consortium, Department of Housing and Urban Development and numerous local and regional housing authorities.\",\n\n \"HSI has received national recognition for its work when the “Elms” was selected by the Fannie Mae Foundation to receive one of only eighteen awards given nationwide for Excellence.\",\n\n \"Financial Partners include the Department of Housing and Urban Development, DHCD, Newburyport Bank, Pentucket Bank, CEDAC, Mass Housing, Mass Development North Shore HOME Consortium, and the Federal HOME Loan Bank.\"\n ];\n\n $a = New About();\n $a->firstp = $about[0];\n $a->secondp = $about[1];\n $a->thirdp = $about[2];\n $a->fourthp = $about[3];\n $a->fifthp = $about[4];\n $a->save();\n }", "public function run()\n {\n //\n\n $adv = new Entity;\n $adv->id_entity = 1;\n $adv->name = \"PIM\";\n $adv->path = \"pim3uyLRGnw6cxutO3p\";\n $adv->save();\n\n $adv = new Entity;\n $adv->id_entity = 10;\n $adv->name = \"DGX\";\n $adv->path = \"dgxS9qLNIUHql0jMHSE\";\n $adv->save();\n\n $adv = new Entity;\n $adv->id_entity = 11;\n $adv->name = \"WD\";\n $adv->path = \"wdmRVzLWPgEU1Xrydfu\";\n $adv->save();\n\n $adv = new Entity;\n $adv->id_entity = 12;\n $adv->name = \"EDB\";\n $adv->path = \"edbWspBfn1D27nGrgZm\";\n $adv->save();\n\n }", "public static function doYouMean() {\r\n\t\t$aranan_kelime = 'ph'; //Bu değerin veritabanından geldiğini varsayalım\r\n\t\t$diziler = array('php', 'asp', '.net', 'jsp', 'java', 'javascript', 'html', 'c', 'css', 'xml');\r\n\t\t//$diziler dizisi, veritabanından çekilen birçok veri dizisi olduğu varsayalım\r\n\t\t$uzunluk = -1;\r\n\t\t\r\n\t\tforeach($diziler as $dizi) {\r\n\t\t\t$benzerlik = levenshtein($aranan_kelime, $dizi);\r\n\t\t\tif($benzerlik == 0) {\r\n\t\t\t\t$yakinlik = $dizi;\r\n\t\t\t\t$uzunluk = 0;\r\n\t\t\t}\r\n\t\t\tif(($benzerlik <= $uzunluk) || ($uzunluk < 0)) {\r\n\t\t\t\t$yakinlik = $dizi;\r\n\t\t\t\t$uzunluk = $benzerlik;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$op = \"Aranan Kelime: \".$aranan_kelime;\r\n\t\tif($uzunluk == 0) {\r\n\t\t\t$op .= $yakinlik.\" için herhangi bir sonuç bulunamadı!\";\r\n\t\t} else {\r\n\t\t\t$op .= \"Bunu mu demek istediniz? \".$yakinlik;\r\n\t\t}\r\n\t\treturn $op;\r\n\t}", "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}", "public function test_scenario5() {\n\n $data = array(array('filename' => 'data/iris.csv', 'expected_file' => 'data/model/predictions_distribution_iris.txt'),\n array('filename' => 'data/iris_sp_chars.csv', 'expected_file' => 'data/model/predictions_distribution_iris_sp_chars.txt'),\n array('filename' => 'data/spam.csv', 'expected_file' => 'data/model/predictions_distribution_spam.txt'),\n array('filename' => 'data/grades.csv', 'expected_file' => 'data/model/predictions_distribution_grades.txt'),\n array('filename' => 'data/diabetes.csv', 'expected_file' => 'data/model/predictions_distribution_diabetes.txt'),\n array('filename' => 'data/iris_missing2.csv', 'expected_file' => 'data/model/predictions_distribution_iris_missing2.txt'),\n array('filename' => 'data/tiny_kdd.csv', 'expected_file' => 'data/model/predictions_distribution_tiny_kdd.txt')\n );\n\n foreach($data as $item) {\n print \"\\n Successfully creating a model and check its predictions distribution\\n\";\n\n print \"Given I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source', 'project'=> self::$project->resource));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"And I wait until the source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"And I wait until the dataset is ready\\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create model\\n\";\n $model = self::$api->create_model($dataset->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model->code);\n\n print \"And I wait until the model is ready \". $model->resource . \"\\n\";\n $resource = self::$api->_check_resource($model->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create a local model\\n\";\n $local_model = new Model($model->resource, self::$api);\n print \"Then I check the predictions distribution with \". $item[\"expected_file\"] . \" file\\n\";\n\n $file_distribution = file_get_contents($item[\"expected_file\"]);\n $distribution = $local_model->get_prediction_distribution();\n $distribution_str='';\n\n foreach($distribution as $key => $value) {\n $distribution_str= $distribution_str . \"[\" . $key . \",\" . $value . \"]\\n\";\n }\n\n $this->assertEquals(trim($distribution_str), trim($file_distribution));\n\n }\n }", "public function gagnerExperience()\n {\n $this->_experience++;\n }", "function State_36($parameters) \n\t{\n\t\trequire_once(CUSTOMER_LIB.\"/arrangements_dfa.php\");\n\t\t\n\t\tif (!isset($dfas['arrangements'])) \n\t\t{\n\t\t\t$dfa = new Arrangement_DFA($this->server);\n\t\t\t$dfa->SetLog($parameters->log);\n\t\t\t$dfas['arrangements'] = $dfa;\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$dfa = $dfas['arrangements'];\n\t\t}\n\n\t\treturn $dfa->run($parameters);\n\t}", "function Generate()\n \t{\n \t\t\n \t}", "public function academicRelief() {\n\t\t$pageTitle = 'Academic Relief';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/academic-relief.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n \n ExerciseStep::create([\n 'description' => \"Posizionare il bilanciere sulla rastrelliera ad un altezza di circa dieci centimetri più bassa rispetto alle spalle.\",\n 'exercise_id' => 1\n ]);\n ExerciseStep::create([\n 'description' => \"afferrare l'asta con una presa leggermente più ampia rispetto alle spalle e con i palmi delle mani rivolti in avanti\",\n 'exercise_id' => 1\n ]);\n ExerciseStep::create([\n 'description' => \"passare con la testa sotto la sbarra e portare le spalle a contatto con l'asta (parte centrale del trapezio), le scapole vanno mantenute addotte (stringere leggermente le spalle)\",\n 'exercise_id' => 1\n ]);\n ExerciseStep::create([\n 'description' => \"controllare con l'ausilio dello specchio che il centro del bilanciere sia posizionato alla stessa distanza dalle due spalle\",\n 'exercise_id' => 1\n ]);\n ExerciseStep::create([\n 'description' => \"contrarre gli addominali e spingere con le gambe verso l'alto in modo da staccare il bilanciere dai supporti\",\n 'exercise_id' => 1\n ]);\n\n ExerciseStep::create([\n 'description' => \"lentamente fare un passo all'indietro avvicinandosi ai dispositivi di sicurezza (se presenti)\n \",\n 'exercise_id' => 1\n ]);\n ExerciseStep::create([\n 'description' => \"posizionare i talloni ad una larghezza leggermente superiore a quella delle spalle, avendo cura di ruotare le punte dei piedi verso l'esterno di circa 30°\n \",\n 'exercise_id' => 1\n ]);\n ExerciseStep::create([\n 'description' => \"spostare leggermente indietro il bacino mettendo in tensione i muscoli femorali; lentamente piegare le gambe scendendo verso il basso, senza lasciarsi cadere ma mantenendo i muscoli in tensione ed evitando movimenti laterali delle ginocchia\n \",\n 'exercise_id' => 1\n ]);\n ExerciseStep::create([\n 'description' => \"scendere fino a quando le cosce sono parallele al terreno o, se preferite, fino a quando l'articolazione dell'anca si trova alla stessa altezza di quella del ginocchio\",\n 'exercise_id' => 1\n ]);\n ExerciseStep::create([\n 'description' => \"se i vostri talloni si staccano dal terreno durante la discesa o avvertite seri problemi di equilibrio risalite nella posizione iniziale e riponete il bilanciere: non siete ancora pronti per eseguire l'esercizio\",\n 'exercise_id' => 1\n ]);\n ExerciseStep::create([\n 'description' => \"durante il movimento la schiena andrà mantenuta quanto più diritta possibile, evitando di inarcarla ma facendo attenzione a non sbilanciarsi all'indietro\",\n 'exercise_id' => 1\n ]);\n ExerciseStep::create([\n 'description' => \"poco prima di raggiungere la posizione di massima flessione iniziate a frenare maggiormente il movimento preparandovi per la risalita\",\n 'exercise_id' => 1\n ]);\n ExerciseStep::create([\n 'description' => \"raggiunta questa posizione spingere con forza sui talloni raddrizzando le gambe ma senza estendere completamente le ginocchia\",\n 'exercise_id' => 1\n ]);\n ExerciseStep::create([\n 'description' => \"durante la risalita la muscolatura delle cosce va contratta attivamente in modo che gli arti inferiori non compiano pericolosi movimenti oscillatori.\",\n 'exercise_id' => 1\n ]);\n ExerciseStep::create([\n 'description' => \"Stendersi in posizione supina sulla panca piana.\",\n 'exercise_id' => 2\n ]);\n ExerciseStep::create([\n 'description' => \"I piedi devono essere appoggio per terra con tibia perpendicolare al suolo.\",\n 'exercise_id' => 2\n ]);\n ExerciseStep::create([\n 'description' => \"Impugnare il bilanciere con i palmi delle mani rivolti in avanti, e una larghezza lievemente maggiore rispetto alle spalle.\",\n 'exercise_id' => 2\n ]);\n ExerciseStep::create([\n 'description' => \"Da questa posizione effettuare delle distensioni verso l'alto del bilanciere, senza raggiungere il blocco articolare nel corso dell'estensione delle braccia.\",\n 'exercise_id' => 2\n ]);\n ExerciseStep::create([\n 'description' => \"Tornare fluidamente in prossimità del medio inferiore dello sterno durante la fase eccentrica verificando che gli avambracci siano perpendicolari col terreno.\",\n 'exercise_id' => 2\n ]);\n ExerciseStep::create([\n 'description' => \"Effettuare l'espirazione nel corso della distensione, inspirare durante la fase discendente del bilanciere (fase eccentrica).\",\n 'exercise_id' => 2\n ]);\n ExerciseStep::create([\n 'description' => \"Posizionare i dischi sul bilanciere in modo che permettano a quest'ultimo di essere a circa 23cm da terra.\",\n 'exercise_id' => 3\n ]);\n ExerciseStep::create([\n 'description' => \"I piedi sono posizionati alla larghezza delle spalle (o leggermente maggiore).\",\n 'exercise_id' => 3\n ]);\n ExerciseStep::create([\n 'description' => \"Le mani sono posizionate alla larghezza delle spalle e le braccia tese. La presa può essere supina, prona o mista.\",\n 'exercise_id' => 3\n ]);\n ExerciseStep::create([\n 'description' => \"Inspirare, riempendo la pancia d’aria, e accosciarsi, a un'altezza minore di quella di uno squat. La schiena mantiene le sue curve fisologiche. Il petto è in fuori.\",\n 'exercise_id' => 3\n ]);\n ExerciseStep::create([\n 'description' => \"Mantenere lo sguardo in avanti e leggermente verso il basso.\",\n 'exercise_id' => 3\n ]);\n ExerciseStep::create([\n 'description' => \"Staccare il bilanciere, tenendolo il più aderente possibile alle gambe e spingendo i talloni contro il terreno.\",\n 'exercise_id' => 3\n ]);\n ExerciseStep::create([\n 'description' => \"Portare il bilanciere alla posizione finale, facendo salire il sedere e le spalle contemporaneamente.\",\n 'exercise_id' => 3\n ]);\n ExerciseStep::create([\n 'description' => \"Effettuare la fase di discesa, tenendo sempre la schiena iperestesa.\",\n 'exercise_id' => 3\n ]);\n ExerciseStep::create([\n 'description' => \"Porsi in posizione eretta e le ginocchia leggermente flesse. I piedi sono alla larghezza delle spalle e le braccia lungo i fianchi.\",\n 'exercise_id' => 4\n ]);\n ExerciseStep::create([\n 'description' => \"Impugnare il bilanciere con i palmi verso l'esterno.\",\n 'exercise_id' => 4\n ]);\n ExerciseStep::create([\n 'description' => \"Flettere l'avambraccio verso la spalla e portare il bilanciere fino al punto di massima contrazione.\",\n 'exercise_id' => 4\n ]);\n ExerciseStep::create([\n 'description' => \"Riportare il bilanciere alla posizione di partenza e ripetere il movimento.\",\n 'exercise_id' => 4\n ]);\n ExerciseStep::create([\n 'description' => \"Porsi in posizione eretta e le ginocchia leggermente flesse, leggermente staccati dalla poliercolina.\",\n 'exercise_id' => 5\n ]);\n ExerciseStep::create([\n 'description' => \"Impugnare la barra e, tenendo il braccio fermo, spingere verso il basso estendendo l'avambraccio.\",\n 'exercise_id' => 5\n ]);\n ExerciseStep::create([\n 'description' => \"Riportare la barra in posizione di partenza, fino ad arrivare alla parte superiore degli addominali.\",\n 'exercise_id' => 5\n ]);\n ExerciseStep::create([\n 'description' => \"Sedersi su una panca leggermente inclinata.\",\n 'exercise_id' => 6\n ]);\n ExerciseStep::create([\n 'description' => \"Afferrare i manubri e portarli ai lati della testa (all'altezza delle orecchie).\",\n 'exercise_id' => 6\n ]);\n ExerciseStep::create([\n 'description' => \"Spingere i manubri verso l'alto senza distendere completamente i gomiti.\",\n 'exercise_id' => 6\n ]);\n ExerciseStep::create([\n 'description' => \"Riportare i manubri in posizione iniziale e ripetere il movimento.\",\n 'exercise_id' => 6\n ]);\n }", "public function Eat();", "function perhitungan(){\n\n\t\tglobal $LR;\n\t\tglobal $HLIn;\n\t\tglobal $HLOut;\n\t\tglobal $numHL;\n\t\tglobal $initHL;\n\n\t\tglobal $ruanNorm;\n\t\tglobal $testNorm;\n\t\tglobal $targetNorm;\n\n\t\tglobal $mseOut;\n\t\tglobal $mseIn;\n\t\tglobal $mse;\n\t\tglobal $dy1;\n\t\tglobal $dy2;\n\t\tglobal $dz;\n\t\tglobal $dbias2;\n\t\t// $person = 0;\n\n\t\t//////////////////////////\n\t\t// $HLIn[$x][0] = uan\n\t\t// $HLIn[$x][1] = test\n\t\t// $HLIn[$x][2] = bias\n\t\t// $HLIn[$x][3] = z_in\n\t\t// $HLIn[$x][4] = z\n\t\t//////////////////////////\n\n\t\t//////////////////////////\n\t\t// $HLOut[$x][0] = z1\n\t\t// $HLOut[$x][1] = z2\n\t\t// $HLOut[$x][2] = bias2\n\t\t// $HLOut[$x][3] = y_in\n\t\t// $HLOut[$x][4] = y\n\t\t//////////////////////////\n\n\t\tfor ($person=0; $person < count($testNorm); $person++) { \n\t\t\t\n\t\t\t// $no = $person + 1;\n\t\t\t// echo \"</br>person\".$no.\"</br>\";\n\n\t\t\tif ($initHL == 1) {\n\t\t\t\tfor ($x = 0; $x < $numHL; $x++){\n\n\t\t\t\t\tfor ($y = 0; $y < 3 ; $y++) { \n\t\t\t\t\t\t\n\t\t\t\t\t\t$HLIn[$x][$y] = rand(1, 10)/10;\n\t\t\t\t\t\t$HLOut[$x][$y] = rand(1, 10)/10; //sekalian y\n\n\t\t\t\t\t\t// echo \"hlin $x \".$HLIn[$x][$y];\n\t\t\t\t\t\t// echo \"hlout $x\".$HLOut[$x][$y].\"</br>\";\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$HLIn[$x][3] = $HLIn[$x][2]+($HLIn[$x][0]*$ruanNorm[$person]+$HLIn[$x][1]*$testNorm[$person]); // z_in\n\n\t\t\t\t\t$HLIn[$x][4] = 1/(1+exp(-$HLIn[$x][3]));\n\n\t\t\t\t\t// echo $HLIn[$x][3].\"</br>\";\n\t\t\t\t\t// echo $HLIn[$x][4].\"</br>\";\n\n\t\t\t\t}\n\n\t\t\t\tfor ($x = 0; $x < $numHL; $x++){\n\n\t\t\t\t\t$HLOut[$x][3] = $HLOut[$x][2]+($HLOut[$x][0]*$HLIn[0][4])+($HLOut[$x][1]*$HLIn[1][4]); // y_in\n\t\t\t\t\t\n\t\t\t\t\t$HLOut[$x][4] = 1/(1+exp(-$HLOut[$x][3])); // y\n\n\t\t\t\t\t// echo \"hl out yin \".$HLOut[$x][3].\"</br>\";\n\t\t\t\t\t// echo \"hl out y \".$HLOut[$x][4].\"</br>\"; \n\n\t\t\t\t\t$mseOut[$x] = ($targetNorm[$person][$x]-$HLOut[$x][4])*((1/(1+exp(-$HLOut[$x][3])))*(1-1/(1+exp(-$HLOut[$x][3]))));\n\n\t\t\t\t\t// echo \"mseOut \".$mseOut[$x].\"</br>\";\n\n\t\t\t\t\t$dy1[$x] = $LR * $HLOut[$x][0] * $mseOut[$x];\n\n\t\t\t\t\t$dy2[$x] = $LR * $HLOut[$x][0] * $dy1[$x];\n\n\t\t\t\t\t$dbias2[$x] = $LR * $mseOut[$x];\n\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor ($x=0; $x < 2 ; $x++) { \n\n\t\t\t\t\t$mseIn[$x] = ($mseOut[0]*$HLOut[0][$x])+($mseOut[1]*$HLOut[1][$x]);\n\t\t\t\t\t$mse[$x] = $mseIn[$x] * ((1/(1+exp(-$HLIn[$x][3])))*(1-1/1+exp(-$HLIn[$x][3])));\n\n\t\t\t\t\tfor ($y = 0; $y < 3; $y++) { \n\t\t\t\t\t\t\n\t\t\t\t\t\t$dz[$x][$y] = $mse[$x] * $HLIn[$x][$y];\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\t$initHL = 0;\n\n\t\t\t//////////////////////////\n\t\t\t// kedua dan seterusnya\n\t\t\t//////////////////////////\n\n\t\t\t} else {\n\n\t\t\t\tfor ($x = 0; $x < $numHL; $x++){\n\n\t\t\t\t\tfor ($y = 0; $y < 3 ; $y++) { \n\t\t\t\t\t\t\n\t\t\t\t\t\t$HLIn[$x][$y] = $HLIn[$x][$y] + $dz[$x][$y];\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$HLOut[$x][0] = $HLOut[$x][0] + $dy1[$x];\n\t\t\t\t\t$HLOut[$x][1] = $HLOut[$x][1] + $dy2[$x];\n\t\t\t\t\t$HLOut[$x][2] = $HLOut[$x][2] + $dbias2[$x];\n\n\t\t\t\t\t$HLIn[$x][3] = $HLIn[$x][2]+($HLIn[$x][0]*$ruanNorm[$person]+$HLIn[$x][1]*$testNorm[$person]); // z_in\n\n\t\t\t\t\t$HLIn[$x][4] = 1/(1+exp(-$HLIn[$x][3]));\n\n\n\t\t\t\t\t// echo $HLIn[$x][3];\n\t\t\t\t\t// echo $HLIn[$x][4];\n\n\n\t\t\t\t}\n\n\t\t\t\tfor ($x = 0; $x < $numHL; $x++){\n\n\t\t\t\t\t$HLOut[$x][3] = $HLOut[$x][2]+($HLOut[$x][0]*$HLIn[0][4])+($HLOut[$x][1]*$HLIn[1][4]); // y_in\n\t\t\t\t\t\n\t\t\t\t\t$HLOut[$x][4] = 1/(1+exp(-$HLOut[$x][3])); // y\n\n\t\t\t\t\t// echo \"hl out yin \".$HLOut[$x][3].\"</br>\";\n\t\t\t\t\t// echo \"hl out y \".$HLOut[$x][4].\"</br>\"; \n\n\t\t\t\t\t$mseOut[$x] = ($targetNorm[$person][$x]-$HLOut[$x][4])*((1/(1+exp(-$HLOut[$x][3])))*(1-1/(1+exp(-$HLOut[$x][3]))));\n\n\t\t\t\t\t// echo \"mseOut\".$mseOut[$x].\"</BR>\";\n\n\t\t\t\t\t$dy1[$x] = $LR * $HLOut[$x][0] * $mseOut[$x];\n\n\t\t\t\t\t$dy2[$x] = $LR * $HLOut[$x][0] * $dy1[$x];\n\n\t\t\t\t\t$dbias2[$x]= $LR * $mseOut[$x];\n\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor ($x=0; $x < 2 ; $x++) { \n\n\t\t\t\t\t$mseIn[$x] = ($mseOut[0]*$HLOut[0][$x])+($mseOut[1]*$HLOut[1][$x]);\n\t\t\t\t\t$mse[$x] = $mseIn[$x] * ((1/(1+exp(-$HLIn[$x][3])))*(1-1/1+exp(-$HLIn[$x][3])));\n\n\t\t\t\t\t// echo $mseIn[$x];\n\t\t\t\t\t// echo $mse[$x].\"</br>\";\n\n\t\t\t\t\tfor ($y = 0; $y < 3; $y++) { \n\t\t\t\t\t\t\n\t\t\t\t\t\t$dz[$x][$y] = $mse[$x] * $HLIn[$x][$y];\n\n\t\t\t\t\t\t// echo \"delta z \".$dz[$x][$y].\"</br>\";\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t}\n\t\t\t\n\n\n\t\t}\n\t}", "public static function main()\n\t{\n\t\trequire_once \"PHPUnit/TextUI/TestRunner.php\";\n\n\t\t$suite = new PHPUnit_Framework_TestSuite(\"EssentialsTest\");\n\t\t$result = PHPUnit_TextUI_TestRunner::run($suite);\n\t}", "function import_STE()\n{\n}", "function trigramme ()\n{\n\n}", "function predict($classifier, $text) {\n\t\t$language = $classifier->predict($text);\n\t\techo \"{$language} = '{$text}'\\n\";\n\t}", "public function nadar()\n {\n }", "function ee( $function_call ) // remember to include brackets on the end if no parameters\n{\n\tglobal $title_CRLF ;\n\n\t$result ;\n\n\t\n\teval( \"\\$result = $function_call ;\" ) ;\n\n\n\treturn \"$title_CRLF$function_call$title_CRLF$title_CRLF$result$title_CRLF\" ;\n\n}", "function fnClassifyGeneModel($sBlastRet, $arrEvidenceProtLength) {\tglobal $nMinBlastPIdentity;\r\n\t$sWD = dirname($sBlastRet);\r\n\t$sCoordTab = \"$sWD/_coord.tab\";\r\n\t$sClusterTab = \"$sWD/_clusters.tab\";\r\n\t$sClusterMedTab = \"$sWD/_cluster_median.tab\";\r\n\r\n\t$hCoordTab = fopen($sCoordTab, \"w\");\r\n\t$hBlastRet = fopen($sBlastRet , \"r\");\r\n\t$arrBlastRet = array(); //key is protein evidence ID, value is array of hits\r\n\twhile(false !== ($sLn = fgets($hBlastRet) )) {\r\n\t\t$sLn = trim($sLn);\r\n\t\tif ($sLn == '') continue;\r\n\t\tif ($sLn[0] == '#') continue;\r\n\t\t$arrF = explode(\"\\t\" , $sLn);\r\n\t\tif (count($arrF) != 13) continue;\r\n\r\n\t\t$sQuery = $arrF[0];\r\n\t\t$nQStart = $arrF[2];\r\n\t\t$nQEnd = $arrF[3];\r\n\t\t$nHStart = $arrF[4];\r\n\t\t$nHEnd = $arrF[5];\r\n\t\t$nPercIden = $arrF[9];\r\n\t\tif ($nQStart > $nQEnd || $nHStart > $nHEnd ) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif ($nPercIden < $nMinBlastPIdentity) continue;\r\n\r\n\t\tif (!array_key_exists($sQuery , $arrBlastRet)) {\r\n\t\t\t$arrBlastRet[$sQuery] = array();\r\n\t\t}\r\n\r\n\t\t$arrBlastRet[$sQuery][$nHStart] = array('qstart' => $nQStart, 'qend' =>$nQEnd, 'hstart' => $nHStart, 'hend' => $nHEnd, 'percid' => $nPercIden);\r\n\t}\r\n\r\n\tif (count($arrBlastRet) == 0) { //no blast hits\r\n\t\treturn false;\r\n\t}\r\n\r\n\t//print_r($arrBlastRet);\r\n\r\n\t$arrHitPoints = array();\r\n\r\n\r\n\t$arrHitStartEnd = array();\r\n\t$arrBlastRetRange = array(); //within each query, contains the min and max hit coordinates\r\n\r\n\tfwrite($hCoordTab , \"Start\\tEnd\\tID\\n\");\r\n\tforeach($arrBlastRet as $sQuery => &$arrBlastRecord) {\r\n\t\tksort($arrBlastRecord ,SORT_NUMERIC);\r\n\t\t$nMinStart = -1;\r\n\t\t$nMaxEnd = -1;\r\n\t\t$arrBlastRetRange[$sQuery] = array(0,0);\r\n\r\n\t\tforeach($arrBlastRecord as $nHStart => $arrInfo) {\r\n\t\t\tif ($nMinStart == -1) {\r\n\t\t\t\t$nMinStart = $nHStart ; //the first one is the smallest\r\n\t\t\t\t$arrBlastRetRange[$sQuery][0] = $nHStart ;\r\n\t\t\t}\r\n\t\t\tif ($nMaxEnd == -1) {\r\n\t\t\t\t$nMaxEnd = $arrInfo['hend'];\r\n\t\t\t\t$arrBlastRetRange[$sQuery][1] = $arrInfo['hend'];\r\n\t\t\t} else if ($nMaxEnd < $arrInfo['hend']) {\r\n\t\t\t\t$nMaxEnd = $arrInfo['hend'];\r\n\t\t\t\t$arrBlastRetRange[$sQuery][1] = $arrInfo['hend'];\r\n\t\t\t}\r\n\t\t} \r\n\r\n\t\t$arrHitStartEnd[] = array($nMinStart, $nMaxEnd);\r\n\t\tfwrite($hCoordTab , \"$nMinStart\\t$nMaxEnd\\t$sQuery\\n\");\r\n\r\n\t}\r\n\r\n\tfclose($hCoordTab);\r\n\r\n\texec(\"Rscript coordcluster.R $sCoordTab $sClusterTab $sClusterMedTab\");\r\n\r\n\t$hClusterTab = fopen($sClusterTab , 'r');\r\n\t$hClusterMedTab = fopen($sClusterMedTab , 'r'); //calculated median start and end positions of the cluster\r\n\r\n\t$arrClusters = array();\r\n\t$arrPartitionedGeneID = array();\r\n\t$arrHitStartEnd = array();\r\n\r\n\twhile( false !== ($sLn = fgets($hClusterMedTab) ) ) {\r\n\t\t$sLn = trim($sLn);\r\n\t\tif ($sLn == '') continue;\r\n\t\t$arrF = explode(\"\\t\" , $sLn);\r\n\t\tif ($arrF[0] == 'clu') continue;\r\n\t\t$arrClusters[$arrF[0]] = array($arrF[1], $arrF[2]);\r\n\t\t$arrPartitionedGeneID[$arrF[1]] = array();\r\n\t\t$arrHitStartEnd[$arrF[1]] = $arrF[2];\r\n\t}\r\n\r\n\t$nSubFragments = count($arrClusters);\r\n\r\n\t$bFused = ($nSubFragments > 1);\r\n\r\n\twhile( false !== ($sLn = fgets($hClusterTab) ) ) {\r\n\t\t$sLn = trim($sLn);\r\n\t\tif ($sLn == '') continue;\r\n\t\t$arrF = explode(\"\\t\" , $sLn);\r\n\t\tif ($arrF[0] == 'Start') continue;\r\n\t\tif ($arrF[4] != 1) continue ; //doesn't have the \"keep\" flag\r\n\t\t$nClusterStart = $arrClusters[$arrF[3]][0];\r\n\t\t$arrPartitionedGeneID[$nClusterStart][] = $arrF[2];\r\n\t}\r\n/*\r\n\tfnMergeOverlap($arrHitStartEnd , -10);\r\n\t//print_r($arrHitStartEnd);\r\n\r\n\t$bFused = false;\r\n\t$nSubFragments = count($arrHitStartEnd);\r\n\r\n\tif ($nSubFragments > 1 ) {\r\n\t\t$bFused = true;\r\n\t}\r\n\r\n\t//calculate the proteins belonging to each sub fragment\r\n\r\n\t$arrPartitionedGeneID = array();\r\n\r\n\tforeach($arrHitStartEnd as $nStart => $nEnd) {\r\n\t\t$arrPartitionedGeneID[$nStart] = array();\r\n\t\tforeach($arrBlastRetRange as $sQuery => $arrRange) {\r\n\t\t\tif ($arrRange[0] >= $nStart && $arrRange[1] <= $nEnd ) {\r\n\t\t\t\t$arrPartitionedGeneID[$nStart][] = $sQuery;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n*/\r\n\r\n\treturn array('isfused' => $bFused , 'pieces'=> $nSubFragments, 'breaks' => $arrHitStartEnd, 'partitioned_proteins' => $arrPartitionedGeneID);\r\n\t\r\n}", "function generate() ;", "public function haz_eff_hea(){\n $this->search_list();\n\t}", "public function run()\n {\n $data = [\n 'ArdL' => ['Cuero Endurecido (TA9; TA10; TA11)', ' Cuero Blando (TA5; TA6; TA7)', ],\n 'ArdM' => ['Cota de Mallas (TA13; TA14; TA15; TA16)', ],\n 'ArdP' => ['Coraza (TA17; TA18; TA19; TA20)', ],\n 'Arm2M' => [],\n 'ArmAj' => [],\n 'ArmAt' => [],\n 'ArmC' => [],\n 'ArmAs' => [],\n 'ArmF' => [],\n 'ArmPr' => [],\n 'ArtA' => ['Actuar', ' Bailar', ' Cantar', ' Imitar Sonidos', ' Improvisación Poética', ' Mímica', ' Narrar Historias', ' Tocar Instrumento', ' Ventriloquia', ],\n 'ArtP' => ['Escultura', ' Música', ' Pintura', ' Poesía', ],\n 'AmB' => ['Barridos de Artes Marciales', ' Blocar', ' Lucha Libre', ' Inmovilizar', ],\n 'AmG' => ['Boxeo', ' Placaje', ' Golpes de Artes Marciales', ],\n 'AmMC' => ['Esquiva Adrenal', ' Evasión Adrenal', ],\n 'AtaEsp' => ['Desarmar Enemigo (Armado)', ' Desarmar Enemigo (Desarmado)', ' Fintar (Armado)', ' Fintar (Desarmado)', ' Justar', ' Pelea', ],\n 'AtlG' => ['Juegos Atléticos (Gimnasia)', ' Acrobacias', ' Caer', ' Contorsionismo', ' Malabarismos', ' Trepar', ' Volar/Planear', ' Volteretas', ' Caminar con Zancos', ' Caminar por la Cuerda Floja', ' Esquiar', ' Hacer Surf', ' Patinar', ' Rappelling', ' Salto con Pértiga', ],\n 'AtlP' => ['Juegos Atléticos (Potencia)', ' Levantar Pesos', ' Saltar', ' Golpe Poderoso', ' Lanzamiento Poderoso', ],\n 'AtlR' => ['Juegos Atléticos (Resistencia)', ' Carrera de Fondo', ' Escalar', ' Esprintar', ' Nadar', ' Remar', ],\n 'Autoc' => ['Frenesí', ' Meditación', ' Mnemotecnia', ' Superar Aturdimiento', ' Caída Adrenal', ' Concentración Adrenal', ' Control de la Licantropía (R)', ' Desenvainar Adrenal', ' Equilibrio Adrenal', ' Estabilización Adrenal (R)', ' Fuerza Adrenal', ' Maniobrar Aturdido', ' Salto Adrenal', ' Trance Adormecedor', ' Trance de la Muerte (R)', ' Trance Purificador (R)', ' Trance Sanador', ' Velocidad Adrenal', ],\n 'CienB' => ['Documentación', ' Matemáticas Básicas', ],\n 'CienE' => ['Alquimia', ' Antropología', ' Matemáticas Avanzadas', ' Astronomía', ' Bioquímica', ' Psicología', ' Anatomía', ],\n 'Comun' => ['Leer los Labios', ' Señales', ],\n 'ConGen' => ['Conocimiento de la Fauna', ' Conocimiento de la Flora', ' Conocimiento Cultural', ' Conocimiento Regional', ' Heráldica', ' Historia', ' Religión', ' Conocimiento de Estilos Marciales', ' Conocimiento de Estilos de Armas', ],\n 'ConMag' => ['Conocimiento de los Artefactos', ' Conocimiento de los Hechizos', ' Conocimiento de los No-Muertos', ' Conocimiento de las Protecciones', ' Conocimiento de los Planos', ' Conocimiento de los Símbolos', ],\n 'ConOsc' => ['Conocimiento de las Hadas', ' Conocimiento de los Dragones', ' Demonología', ' Xeno-Conocimientos*', ],\n 'ConTec' => ['Conocimiento de la Piedra', ' Conocimiento de las Cerraduras', ' Conocimiento de las Hierbas', ' Conocimiento de los Metales', ' Conocimiento de los Venenos', ' Conocimiento del Comercio', ],\n 'DefEsp' => ['Aguante Adrenal', ' Defensa Adrenal', ' Resistencia Adrenal', ],\n 'DesPP' => ['Desarrollo de Puntos de Poder', ],\n 'DesFis' => ['Desarrollo Físico', ],\n 'ExtAni' => ['Conducir', ' Domar', ' Maestría de Animales (R)', ' Manejo de los Animales', ' Montar', ' Montar: Lobos', ' Montar: Caballos', ' Montar: Osos', ' Montar: Camellos', ' Montar: Elefantes*', ' Curación de Animales (R)', ' Pastoreo', ],\n 'ExtEnt' => ['Cazar', ' Espeleología', ' Forrajear', ' Orientación Celeste', ' Predicción del Clima', ' Supervivencia', ' Supervivencia (Montañas)', ' Supervivencia (Bosques)', ' Supervivencia (Desiertos)', ' Supervivencia (Llanuras)', ' Supervivencia (Subterráneos)', ' Supervivencia (Ártico)', ],\n 'HecDir' => ['Relámpago', 'Rayo de agua', 'Rayo de luz', 'Rayo de fuego', 'Rayo de hielo'],\n 'ListBas' => [],\n 'ListAb' => [],\n 'ListCerr' => [],\n 'ListBasOt' => [],\n 'ListAbOt' => [],\n 'ListCerrOt' => [],\n 'ListBasOtR' => [],\n 'ListAbArc' => [],\n 'ListAd' => [],\n 'ListAdOtR' => [],\n 'ListTri' => [],\n 'ListElCom' => [],\n 'Infl' => ['Comerciar', ' Diplomacia', ' Embaucar', ' Interrogar', ' Liderazgo', ' Oratoria', ' Seducción', ' Sobornar', ' Rumorear', ],\n 'ManCom' => ['Combate con 2 Armas', ' Combate Montado', ' Desenvainar', ' Florituras', ' Ataque de Revés', ' Esquiva Acrobática (R)', ' Estilo de Arma (Básico)', ' Estilo de Arma (Avanzado)', ' Subyugar', ],\n 'ManPod' => ['Canalización', ' Maestría de los Hechizos', ' Maestría de los Hechizos: Control del Aire', ' Maestría de los Hechizos: Ley de la Luz', ' Maestría de los Hechizos: Maestría de los Espiritus', ' Ritual Mágico', ' Ocultación de Hechizos', ],\n 'Ofi' => ['Cocinar', ' Manejo de Cuerdas', ' Trabajar el Cuero', ' Trabajar el Metal', ' Trabajar la Madera', ' Trabajar la Piedra', ' Coser/Tejer', ' Dibujar', ' Escribir', ' Hacer Flechas', ' Horticultura', ' Peletería', ' Servicio', ' Trampero', ],\n 'PerBus' => ['Buscar', ' Detectar Mentiras', ' Detectar Trampas', ' Detectar Venenos', ' Leer Huellas', ' Observación', ' Rastrear', ],\n 'PerPers' => ['Alerta', ' Detectar Emboscadas', ],\n 'PerSen' => ['Percepción del Entorno: Ciudades', ' Percepción del Entorno: Combate', ' Percepción del Entorno: Durmiendo', ' Percepción del Entorno: Exploración', ' Sentido de la Dirección', ' Sentido del Espacio (R)', ' Sentido del Tiempo', ' Vista', ' Olfato', ' Gusto', ' Oído', ' Tacto', ' Sentido de la Realidad (R)', ' Vigilancia', ],\n 'PerPod' => ['Leer Runas', ' Sintonización', ' Adivinación', ' Percepción del Poder (R)', ],\n 'SubAta' => ['Ataque Silencioso', ' Emboscar', ],\n 'SubMec' => ['Abrir Cerraduras', ' Camuflaje', ' Desactivar Trampas', ' Disfrazarse', ' Construir Trampas', ' Preparar Trampas', ' Usa/Curar Venenos', ' Falsificación', ' Imitación', ' Ocultar Objetos', ],\n 'SubSig' => ['Acechar', ' Esconderse', ' Juegos de Manos', ' Robar Bolsillos', ],\n 'TecGen' => ['Dibujar Mapas', ' Juego', ' Juegos de Estrategia', ' Maquinaria', ' Mendigar', ' Navegar', ' Orientación', ' Primeros Auxilios', ' Usar Hierbas', ],\n 'TecPro' => ['Cuidados Médicos', ' Diagnosis', ' Ingeniería', ' Mecánica', ' Minería', ' Adormecerse', ' Arquitectura', ' Cirugía', ' Organización Militar', ' Propaganda', ' Zahorí', ' Investigación', ],\n 'TecVoc' => ['Administración', ' Manejo de Botes', ' Evaluar Arma', ' Evaluar Armadura', ' Evaluar Metal', ' Evaluar Piedra', ' Navegación', ' Táctica', ' Tasar', ' Artimañas', ' Cartografía', ' Ingeniería de Asedio', ' Partería', ' Preparar Hierbas', ' Preparar Venenos', ],\n 'Urb' => ['Agenciar', ' Callejeo', ' Disimulo', ' Instinto Urbano', ],\n ];\n\n foreach ($data as $category => $names) {\n foreach ($names as $name) {\n DB::table('skills')->insert([\n 'skill_category_id' => $category,\n 'name' => trim($name),\n 'code' => Str::slug(trim($name),'_'),\n 'description' => ''\n ]);\n }\n }\n\n }", "public static function test(){\n\t\t//It takes in no arguments and doesn't return anything.\n\t\t//It prints out a bunch of permutations.\n\t\t$testArray = explode(' ', Adams::getTestString());\n\t\t$testArray = Adams::raiseAll($testArray);\n\t\t$permutations = Adams::getPermutations($testArray);\t\n\t\t//print_r($permutations);\n\t\tforeach($permutations as $permutation){\n\t\t\t$outputString .= implode(' ',$permutation).\"\\n\";\t\n\t\t}\n\t\tprint $outputString;\n\t}", "public function run()\n {\n $faker = Faker::create();\n for ($i = 1; $i < 15; $i++) {\n $exam = new Exam;\n $exam->title = $faker->word;\n\n $exam->save();\n }\n }", "function runEMANRefine2d() {\n\t$expId=$_GET['expId'];\n\t$runname=$_POST['runname'];\n\t$outdir=$_POST['outdir'];\n\t$stackval=$_POST['stackval'];\n\t$highpass=$_POST['highpass'];\n\t$lowpass=$_POST['lowpass'];\n\t$numpart=$_POST['numpart'];\n\t$numclass = $_POST['numclass'];\n\t$numiter=$_POST['numiter'];\n\t$bin=$_POST['bin'];\n\t$description=$_POST['description'];\n\t$commit = ($_POST['commit']==\"on\") ? true : false;\n\n\t// get stack id, apix, & box size from input\n\tlist($stackid,$apix,$boxsz) = preg_split('%\\|--\\|%',$stackval);\n\t//make sure a session was selected\n\n\t/* *******************\n\tPART 2: Check for conflicts, if there is an error display the form again\n\t******************** */\n\tif (!$description)\n\t\tcreateEMANRefine2dForm(\"<B>ERROR:</B> Enter a brief description of the particles to be aligned\");\n\n\t//make sure a stack was selected\n\tif (!$stackid)\n\t\tcreateEMANRefine2dForm(\"<B>ERROR:</B> No stack selected\");\n\n\t// classification\n\tif ($numpart < 10)\n\t\tcreateEMANRefine2dForm(\"<B>ERROR:</B> Must have more than 10 particles\");\n\n\t// check num of particles\n\t$particle = new particledata();\n\t$totprtls=$particle->getNumStackParticles($stackid);\n\tif ($numpart > $totprtls)\n\t\tcreateEMANRefine2dForm(\"<B>ERROR:</B> Number of particles to align ($numpart)\"\n\t\t\t.\" must be less than the number of particles in the stack ($totprtls)\");\n\n\t// make sure outdir ends with '/' and append run name\n\tif (substr($outdir,-1,1)!='/') $outdir.='/';\n\t$rundir = $outdir.$runname;\n\n\t/* *******************\n\tPART 3: Create program command\n\t******************** */\n\t// setup command\n\t$command =\"emanRefine2d.py \";\n\t$command.=\"--projectid=\".getProjectId().\" \";\n\t$command.=\"--rundir=$rundir \";\n\t$command.=\"--description=\\\"$description\\\" \";\n\t$command.=\"--runname=$runname \";\n\t$command.=\"--stack=$stackid \";\n\tif ($lowpass != '') $command.=\"--lowpass=$lowpass \";\n\tif ($highpass != '') $command.=\"--highpass=$highpass \";\n\t$command.=\"--num-part=$numpart \";\n\t$command.=\"--num-class=$numclass \";\n\t$command.=\"--bin=$bin \";\n\t$command.=\"--num-iter=$numiter \";\n\tif ($commit)\n\t\t$command.=\"--commit \";\n\telse\n\t\t$command.=\"--no-commit \";\n\n\t/* *******************\n\tPART 4: Create header info, i.e., references\n\t******************** */\n\t$headinfo .= emanRef();\n\t\n\t/* *******************\n\tPART 5: Show or Run Command\n\t******************** */\n\t// submit command\n\t$errors = showOrSubmitCommand($command, $headinfo, 'partalign', $nproc);\n\n\t// if error display them\n\tif ($errors)\n\t\tcreateEMANRefine2dForm(\"<b>ERROR:</b> $errors\");\n\t\t\n}", "public function run()\n {\n \t$elective_data=<<<EOL\n{\n \"00313ce2729650a1de52913d0558272007e4fdef13421ef52aab9f826e5f6a00\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAITEJA R\",\n \"rollnum\" : 160116733105,\n \"sent\" : true,\n \"year\" : 2\n },\n \"006b590362ea0c3ba7e2d755b574dd8b0e829c65eaaad87aa550d0c3415483b0\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KUNTI VAMSHIKRISHNA\",\n \"rollnum\" : 160114733059,\n \"sent\" : true,\n \"year\" : 4\n },\n \"00d8cd286679f726e1603395c4d11178dbba30a343014a7100a6e80f5b284551\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"JOOPAKA VAMSHI KRISHNA\",\n \"rollnum\" : 160114733117,\n \"sent\" : true,\n \"year\" : 4\n },\n \"02e0c95f04a2c76127234d4bb8f67817b9c09a57006bb33ae986c350654b5329\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ANIRUDH REDDY G\",\n \"rollnum\" : 160116733023,\n \"sent\" : true,\n \"year\" : 2\n },\n \"02ef03b098d45e94c97207dc645939d7efbe0c1402ec1d0d127cec759c3b8754\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS484\",\n \"group\" : \"5\",\n \"title\" : \"Business Intelligence\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"\",\n \"rollnum\" : 160114733184,\n \"sent\" : true,\n \"year\" : 4\n },\n \"032cde9909ca61ef3975e270d8cdb1d7d7676a1edc79fa9cc02ab58fd529d487\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SUBHASRI R\",\n \"rollnum\" : 160116733147,\n \"sent\" : true,\n \"year\" : 2\n },\n \"0332aa7617d59d425e13819d61505e138ad958313b26d6a63429e834510aac26\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SINDHUJA CHIRUMAMILLA\",\n \"rollnum\" : 160114733080,\n \"sent\" : true,\n \"year\" : 4\n },\n \"0480b455fb886d84dd8dabbaed4fb48677565cb8fd666b9a62a34da743e7c08b\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GUJJALA ALEKYA\",\n \"rollnum\" : 160115733121,\n \"sent\" : true,\n \"year\" : 3\n },\n \"04c4b022343bf600f029ec547d79d90e488bb2cf0f6ab4af4181ed217700e767\" : {\n \"email\" : \"\",\n \"name\" : \"DUBBA KARAN KUMAR REDDY\",\n \"rollnum\" : 160115733033,\n \"sent\" : false,\n \"year\" : 3\n },\n \"0537dda5255128257602b6b70863fe1cae2995e12ec0175096c367e0ae817625\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PRASHANTH S\",\n \"rollnum\" : 160116733044,\n \"sent\" : true,\n \"year\" : 2\n },\n \"053e15bb2839befebb3768909b0b55326e21588432bcf091a4d26d94162b03b9\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"NEHA KOMURAVELLY\",\n \"rollnum\" : 160115733007,\n \"sent\" : true,\n \"year\" : 3\n },\n \"055e169837df6a4aaad20fcf82c238e8e7d8d406328a4ae1bf752b6088c5dc5c\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PRATHYUSHA K\",\n \"rollnum\" : 160116733135,\n \"sent\" : true,\n \"year\" : 2\n },\n \"06129259c611ca0586e9c7d389de6f4bddc72a3560ad17c954b6ee39e9da3d60\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MOHAMMED AQIB MUQTADAR\",\n \"rollnum\" : 160116733160,\n \"sent\" : true,\n \"year\" : 2\n },\n \"06d4e72ac28833004de5d216463478d4ea2995e1d01caf0503b6b0bd2d618b4a\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KALURI ANIRUDH\",\n \"rollnum\" : 160115733022,\n \"sent\" : true,\n \"year\" : 3\n },\n \"06df9cedfcaca3398e7c51cfec6342824ea81b997f47794b891009ddecf70a9c\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ADARSH AGARWAL\",\n \"rollnum\" : 160114733027,\n \"sent\" : true,\n \"year\" : 3\n },\n \"06fae9812428efcb46b8456f88c5b78f5d95364c0c0d5fb3552f24eb2f66be92\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MANDALOJU RAMU\",\n \"rollnum\" : 160114733108,\n \"sent\" : true,\n \"year\" : 4\n },\n \"07d41edf833de4c5ef9f26f78560a87802048a8325951eb872f2811abc4fc807\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KARINGLA KAVYA SREE\",\n \"rollnum\" : 160115733335,\n \"sent\" : true,\n \"year\" : 3\n },\n \"0b1b70e075320f87c82aa820ff21ae47051d7649505c36e5312691dfc6372544\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ALEKHYA LINGUTLA\",\n \"rollnum\" : 160114733121,\n \"sent\" : true,\n \"year\" : 4\n },\n \"0baf26a967d122c7964f0ce6071d16560b7103560980c50444d77f56376d54b8\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VENKATA SAIMEGHANA S\",\n \"rollnum\" : 160116733076,\n \"sent\" : true,\n \"year\" : 2\n },\n \"0c35effdd50699ac4f0500d80f7ef17fd2256999065083ebedb42c5fc43bf4f0\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"K PRANAV CHANDRA\",\n \"rollnum\" : 160115733098,\n \"sent\" : true,\n \"year\" : 3\n },\n \"0c4cfffc9853890e6bd914c47ed24f7b2b57d747f5e3417feb8a9d37780bfbf0\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NALLABOTHULA SWETHA\",\n \"rollnum\" : 160116733306,\n \"sent\" : true,\n \"year\" : 2\n },\n \"0c9aa9e8e2c1e934988a8c0e4a97e489c86de189c0c23b3f798066591d50a3ea\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"AMMAR MOHAMMED SHAREEF\",\n \"rollnum\" : 160116733082,\n \"sent\" : true,\n \"year\" : 2\n },\n \"0caa6be5e1128a054968f6619bc9350a331e917b5832d693a890ca4aeceb6098\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SURYA S\",\n \"rollnum\" : 160116733111,\n \"sent\" : true,\n \"year\" : 2\n },\n \"0cf346b73dc2179788651653df109fe382608a6b0588797aa894b939b0dd83da\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KANDHIMALLA LEHYA REDDY\",\n \"rollnum\" : 160115733129,\n \"sent\" : true,\n \"year\" : 3\n },\n \"0d910d40c2c0f54f626d0d7323c7b5b3cab0408f1037b2f76b23d0f7ea5174f1\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"YOGESH L\",\n \"rollnum\" : 160116733060,\n \"sent\" : true,\n \"year\" : 2\n },\n \"0dcad05ea5197ebf6dfd5d1220a35081acf65054f193276337f92af999f19191\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"C JAYA CHANDRA KANTH REDDY\",\n \"rollnum\" : 160116733315,\n \"sent\" : true,\n \"year\" : 2\n },\n \"0dfda9955cdc98cca2af6e79d6f824088e586c197937103134d0149a93992afb\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"RAYUDU ROHIT SRIKAR\",\n \"rollnum\" : 160116733187,\n \"sent\" : true,\n \"year\" : 2\n },\n \"0ed5d0046aa0997b22e5c6e3c80848f417603b97dc1a4f389e2c3c1a39508b7b\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HARSHA ANIRUDH G S\",\n \"rollnum\" : 160114733095,\n \"sent\" : true,\n \"year\" : 4\n },\n \"0f6d294f937621839236a82ed4ca45290ee1a9ff874b7773c9e8cd4c34005144\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHAIK NEHA FARHEEN\",\n \"rollnum\" : 160115733132,\n \"sent\" : true,\n \"year\" : 3\n },\n \"0fa76f786eee7239aacba796033b6dca73bf0685611ae5cc4f3f84144f341d59\" : {\n \"email\" : \"\",\n \"name\" : \"CHILUKURI AKHIL CHOWDRY\",\n \"rollnum\" : 160115733083,\n \"sent\" : false,\n \"year\" : 3\n },\n \"106f247e1356d22d2786bf0695ef9a1766656df55d71491438254a0db9625ca9\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VASKA AKHIL\",\n \"rollnum\" : 160115733021,\n \"sent\" : true,\n \"year\" : 3\n },\n \"1070760b44c0bdd4404e04f57c21f75bce068920c165f3dc9a9939114551dc94\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VELDANDA GAUTAM ADITYA\",\n \"rollnum\" : 160114733034,\n \"sent\" : true,\n \"year\" : 4\n },\n \"1112e0ffac9c7b2ffcb185500bdf6306876450b663539434d38f95189af595f0\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NAGU RAHUL CHANDRA\",\n \"rollnum\" : 160115733043,\n \"sent\" : true,\n \"year\" : 3\n },\n \"11a7b1c21dace389bd511e73d9f7860051119a996a86609811b59727ba2efc25\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"P UDAY KUMAR\",\n \"rollnum\" : 160116733313,\n \"sent\" : true,\n \"year\" : 2\n },\n \"11ea841761ecedac279cf53197c9a1f337b4bbb0842502143dedbcbf14c2fe7f\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KARTHIK GOUD B\",\n \"rollnum\" : 160116733032,\n \"sent\" : true,\n \"year\" : 2\n },\n \"142b9ef9d82fc009b53e21a22c97c5e6eec751745af4254fc655ebb46fe0ab76\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PATLOLLA ALEKYA\",\n \"rollnum\" : 160114733063,\n \"sent\" : true,\n \"year\" : 4\n },\n \"14c42a4c649109809de4d14cf413e7d76c4daf8f3548b14b964f91ca121d076a\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SURAM SAIHITH REDDY\",\n \"rollnum\" : 160116733185,\n \"sent\" : true,\n \"year\" : 2\n },\n \"15153ce89c476a32cf590fbd40aa57da9edbce5a13c872025a06dbd1f77360a4\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"S SANJANA\",\n \"rollnum\" : 160115733143,\n \"sent\" : true,\n \"year\" : 3\n },\n \"15530d4ee086f256bb939b4f61f544656aa2937ea01a3a05902bdc2113b40970\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GANJI PAVAN SAI\",\n \"rollnum\" : 160115733040,\n \"sent\" : true,\n \"year\" : 3\n },\n \"15a8540f13d99f949a51ba95edcb9be610e9afae1f70ff8a43596e4a1bab0a32\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"B DIVYA\",\n \"rollnum\" : 160115733068,\n \"sent\" : true,\n \"year\" : 3\n },\n \"15a85ed66c9fa885980e4ac6b436f529767ccf2dd60c23b3aa863c0445e5cdc8\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"MKDV SHAMBHAVI\",\n \"rollnum\" : 160115733014,\n \"sent\" : true,\n \"year\" : 3\n },\n \"17b494cca52aa3ee3dcd11f1ca85b925b5bba2bfc7e118de0e6313bec548e8fe\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHIVAM GUPTA\",\n \"rollnum\" : 160116733109,\n \"sent\" : true,\n \"year\" : 2\n },\n \"183013615fbb6bdbe0de60013729785753de7515c54a086715098a1de53e15ee\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MEDAM ANIL KUMAR\",\n \"rollnum\" : 160116733320,\n \"sent\" : true,\n \"year\" : 2\n },\n \"18cfd57ae29550fbbea9e27346453065acc967ed4c3734550f1ab9161c29c27d\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"C SRAVYA\",\n \"rollnum\" : 160115733146,\n \"sent\" : true,\n \"year\" : 3\n },\n \"18f507828a496c1f9098800be2ee627e8b0a33d7c389778fdad614b7d10c241d\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"MD AZAM\",\n \"rollnum\" : 160114733326,\n \"sent\" : true,\n \"year\" : 4\n },\n \"191373e1c843557be101a2335191cc6d4750496a34ec3b94781f0a5ae630134a\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"THUMMALA MANOJ KUMAR\",\n \"rollnum\" : 160115733035,\n \"sent\" : true,\n \"year\" : 3\n },\n \"19d75c9afad85a21c550ed08859257c2a091cfec35ae637b5f1cb37f4be0ed50\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"G MANISH\",\n \"rollnum\" : 160114733099,\n \"sent\" : true,\n \"year\" : 4\n },\n \"1a02e3e8647911ad3b26c017b82fecd384b6c2f1d3b643c270d6355e69be75a3\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"TALLURI SRI ATHULYA\",\n \"rollnum\" : 160114733145,\n \"sent\" : true,\n \"year\" : 4\n },\n \"1a279ac755ca2d82eddd87b35ee45562c8fee201b5fca83822d4174fcd19ced2\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MUDIAM DASARADA RAMI REDDY\",\n \"rollnum\" : 160114733092,\n \"sent\" : true,\n \"year\" : 4\n },\n \"1a5792bcc212e61213a0cc8d461146cd4c40b4f0b73a07e7150db1f8c1347e65\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAI CHANDANA G\",\n \"rollnum\" : 160116733079,\n \"sent\" : true,\n \"year\" : 2\n },\n \"1a5fc88fda2b83015b28abb4b6a11cd4888a68182c699d85e6e5a9d6a2bb8b2a\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KONAKALLA SAI BHARATH KUMAR\",\n \"rollnum\" : 160114733109,\n \"sent\" : true,\n \"year\" : 4\n },\n \"1b238c775722aebfc0b851b7f7555e07b7c75fb9b40b67b2fd3c972c9d5aca8e\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MUDEDLA AKANKSHA\",\n \"rollnum\" : 160114733309,\n \"sent\" : true,\n \"year\" : 4\n },\n \"1b78f11452efbc0de7cd929899e19be270ddaa79d72a6777b17510dd7b097f5d\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAI KIRAN CH\",\n \"rollnum\" : 160116733166,\n \"sent\" : true,\n \"year\" : 2\n },\n \"1bbec317572ade045cceb0e511f4e00c364094815560380f39f2ac85cd2c251a\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS475\",\n \"group\" : \"4\",\n \"title\" : \"Human Machine Interaction\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BANOTH KOTESH NAYAK\",\n \"rollnum\" : 160114733041,\n \"sent\" : true,\n \"year\" : 4\n },\n \"1c58bcf4b341889b976c075c576c39787efa82928d675e9786503e2b4b4a102b\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VUJJINI RANA TEJA\",\n \"rollnum\" : 160114733048,\n \"sent\" : true,\n \"year\" : 3\n },\n \"1c6ea8200a47f7e797bf50bcf47983c771a006bf34823f3dc0ee0c09f49d367b\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"HARSHAVARDHAN CH\",\n \"rollnum\" : 160116733030,\n \"sent\" : true,\n \"year\" : 2\n },\n \"1cbec6af87424ece3ddac402d5ae3cb6fb1b15f50dba4568006977a81c821f70\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"K AMULYA\",\n \"rollnum\" : 160115733063,\n \"sent\" : true,\n \"year\" : 3\n },\n \"1cd39dcdb3e265ad9d0fc33328f96c080411e1ef7e40ec5348a6c10f14ef2dd3\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"SIREESHA J\",\n \"rollnum\" : 160116733016,\n \"sent\" : true,\n \"year\" : 2\n },\n \"1dc06c6a4c206447b8cb228c5a69e9904d0fb94ea527cb02faec852f0270c6d2\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PATAKULA NAGENDRABABU\",\n \"rollnum\" : 160115733097,\n \"sent\" : true,\n \"year\" : 3\n },\n \"1df9c08b5b86767a4493021a8a6fbeb6d7c7b35d9ccaf9b4f185977c5e9bb5ec\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KANCHARAKUNTLA SANTHOSH REDDY\",\n \"rollnum\" : 160114733303,\n \"sent\" : true,\n \"year\" : 4\n },\n \"1e4adcce9c961941c536ea10594c693628657735592f032c6b2389883c3c4ca7\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"FARAAZ AHMED\",\n \"rollnum\" : 160115733155,\n \"sent\" : true,\n \"year\" : 3\n },\n \"1eb085ef4b5789714dad23414d10d3ed186b074dd9a32df098c7072709ae00b2\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"B SONU\",\n \"rollnum\" : 160115733055,\n \"sent\" : true,\n \"year\" : 3\n },\n \"1f1fc96e309417bcaf4ad5e8e8dd93b40e35886334f32e70a9c296c0c4a5103d\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BOJJA SRINIVAS\",\n \"rollnum\" : 160115733304,\n \"sent\" : true,\n \"year\" : 3\n },\n \"1f48333e5f763e5bbb99ff92c765b2cc6445996bf18139a9a79349f06a719c0d\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE02\",\n \"group\" : \"2\",\n \"title\" : \"Principle of Programming Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MAMIDALA SRIKANTH\",\n \"rollnum\" : 160116733312,\n \"sent\" : true,\n \"year\" : 2\n },\n \"2038868e4c89448e35c6ba9746e990811ddaf31f969723e3f4c6da931fb970df\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SOMEPALLI KRISHNA SRI\",\n \"rollnum\" : 160115733128,\n \"sent\" : true,\n \"year\" : 3\n },\n \"20f5ee4077279d44f65785dbc8d69011ba92d73c26f04813fe5e0ebe11e1bd1e\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BUCHANNOLLA SWIMITHA REDDY\",\n \"rollnum\" : 160115733019,\n \"sent\" : true,\n \"year\" : 3\n },\n \"2189fde3a7f15304cea0661f593280af8c3c9e8b130eac233600840cf374b71f\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAIDAPURAM SAI KUMAR\",\n \"rollnum\" : 160116733309,\n \"sent\" : true,\n \"year\" : 2\n },\n \"221d459564b6fe11c867d6ef3a2b942007c4bc84ecf49e0bbabd1f5f26da144f\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS484\",\n \"group\" : \"5\",\n \"title\" : \"Business Intelligence\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PARUCHURI SUMANTH\",\n \"rollnum\" : 160114733115,\n \"sent\" : true,\n \"year\" : 4\n },\n \"2225ec511255b90188d4fbb286e977111c5e2912b0ef3346e56b340219d2be52\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHAIK REHANA\",\n \"rollnum\" : 160114733140,\n \"sent\" : true,\n \"year\" : 4\n },\n \"23098de01303add1a47a63cf72f208086e87ca382f36c3de619ed660ca37d00e\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ALLALA SAI KRISHNA REDDY\",\n \"rollnum\" : 160115733049,\n \"sent\" : true,\n \"year\" : 3\n },\n \"238b4e1d3695fc79a98de5355b3985eb25db51aedc5ab0b021711a551818138a\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GUGULOTHU ANITHA\",\n \"rollnum\" : 160113733064,\n \"sent\" : true,\n \"year\" : 3\n },\n \"23f34f0c91982fe661df5946d0ed1ef4ad4badb9cc9e1d683ed895d5b1697f30\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"AKHILA THALLAPALLY\",\n \"rollnum\" : 160114733001,\n \"sent\" : true,\n \"year\" : 4\n },\n \"2404e3a9b817d9a8cab538d31e1bbbed601bbeb1f8c7c354f19c332d936399e3\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"AYYAPPA REDDY K\",\n \"rollnum\" : 160116733084,\n \"sent\" : true,\n \"year\" : 2\n },\n \"242069ae4ffdd5b62279576ab67869220500f60ab1db79c98812d395b27d101a\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ANURAG SINGH TULJARAM\",\n \"rollnum\" : 160114733149,\n \"sent\" : true,\n \"year\" : 4\n },\n \"243cefd667ee70a681598bfc3d2db4a462427bdae2e72485415b979ee2f5a3b2\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS481\",\n \"group\" : \"5\",\n \"title\" : \"Pattern Recognition\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MOHAMMED ABDUL HAMEED\",\n \"rollnum\" : 160114733334,\n \"sent\" : true,\n \"year\" : 4\n },\n \"25107e0f4ac71ad98a095b74f73261537a66886fd52ac43a87bab5ceb661ae10\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VANAMALA NAVEEN KUMAR\",\n \"rollnum\" : 160115733301,\n \"sent\" : true,\n \"year\" : 3\n },\n \"2588c0d7b7571feab93e4dc6defa6bde0bd36da48cfd86b60d6cef25e2d81843\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KALLU SRAVANI\",\n \"rollnum\" : 160114733142,\n \"sent\" : true,\n \"year\" : 4\n },\n \"26c0cfa9601e25a0648400a1cf3536b46bffdae5b3ec2f5b904a8faaa066156a\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GUNDU VAMSHI KRISHNA\",\n \"rollnum\" : 160114733116,\n \"sent\" : true,\n \"year\" : 4\n },\n \"275c0edd67e89df36f99c164eb10fc96707bc30f64f681547cde1da63fe78d10\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MOUNIKA B\",\n \"rollnum\" : 160115733181,\n \"sent\" : true,\n \"year\" : 3\n },\n \"27c741532f830a006bf73abaf5cb6b095bdc9c0f8182be98f44d0713a32c00aa\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ABDUL WAHED\",\n \"rollnum\" : 160115733079,\n \"sent\" : true,\n \"year\" : 3\n },\n \"289f50cfb6d72bb4e9c5c1e6c2f3a19eac975605843a58f215e5178e687cd5d2\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"K DIVYARSHA\",\n \"rollnum\" : 160115733069,\n \"sent\" : true,\n \"year\" : 3\n },\n \"297567af0ae68a365f035e6ac3a4eff525f1f0421959488489ec4c5240608c5b\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KAREDLA ANANTHA SASHI SEKHAR\",\n \"rollnum\" : 160114733091,\n \"sent\" : true,\n \"year\" : 4\n },\n \"297ae99d28cb9b3f2fbd6789b8cbba7b21c76dc2139c6348469bb442dab3cfad\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KUNDA RAMA KRISHNA\",\n \"rollnum\" : 160115733162,\n \"sent\" : true,\n \"year\" : 3\n },\n \"29993ed6f2cd26c6d2de8f82bd54037b6ffb97f92895ea4235a1eef6cf9bc583\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HARSHA N\",\n \"rollnum\" : 160116733092,\n \"sent\" : true,\n \"year\" : 2\n },\n \"29a5e88258a9cb9d872519832540f1a635dafbf7a709ccebc31cddf77256893b\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DEVARA MOSES\",\n \"rollnum\" : 160115733323,\n \"sent\" : true,\n \"year\" : 3\n },\n \"2a01e85e2bb1fa405624da383cd96313f47c2199582a64610b54c14c3e086711\" : {\n \"email\" : \"\",\n \"name\" : \"KASULA SHRAVAN KUMAR GOUD\",\n \"rollnum\" : 160115733054,\n \"sent\" : false,\n \"year\" : 3\n },\n \"2a4bfa048fe456e83623826344f9860eb08227b719f052ff277899595ea0d7c0\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MANEESHA REDDY G\",\n \"rollnum\" : 160116733007,\n \"sent\" : true,\n \"year\" : 2\n },\n \"2ae91a910ff7754059cc0ddf7db96b1491fdbfdf6e405f005f72436d67ec8ac3\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GODAVARTHI REJVI RUSHIKA\",\n \"rollnum\" : 160114733073,\n \"sent\" : true,\n \"year\" : 4\n },\n \"2bdbf51c4a6c4268fe75ecd67905a94d83f00cfdee4c900ee49643b0c78d28a5\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DUTA SURYAPRAKASH\",\n \"rollnum\" : 160115733332,\n \"sent\" : true,\n \"year\" : 3\n },\n \"2c3c9b754c2a8bc6f539654c2dbac13122b8e82f09d23ae11770e908d86a4059\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE02\",\n \"group\" : \"2\",\n \"title\" : \"Principle of Programming Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MATAM VINITHA\",\n \"rollnum\" : 160116733324,\n \"sent\" : true,\n \"year\" : 2\n },\n \"2cba349663741369838a493c2e9e1b26f5d6d327383a4c12c4b628c56d9c1be3\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"K SIDDHARTH GUPTA\",\n \"rollnum\" : 160115733173,\n \"sent\" : true,\n \"year\" : 3\n },\n \"2ccc5db715383c665c845dc9532925249062427a3a406fb89b6f15ef4e6f5b70\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KATRAVATH MANISHA\",\n \"rollnum\" : 160115733005,\n \"sent\" : true,\n \"year\" : 3\n },\n \"2d3bd47ce2a61c8cff7dd5d23827d1092b1a82779e84a94294353a1c4a738ff3\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HARSHINI\",\n \"rollnum\" : 160114733067,\n \"sent\" : true,\n \"year\" : 4\n },\n \"2d9817db9ef2ac9fd4b9dd87a7a12beeffcfa778ca92da4bd399799f0178f14b\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHAMMI AKHIL L\",\n \"rollnum\" : 160114733112,\n \"sent\" : true,\n \"year\" : 4\n },\n \"2e92fa60a4785a42bc2bdaa5bbbee45f97d6f7e1ade70e1c89f48a19c39ad4c2\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MANIKANTH REDDY M\",\n \"rollnum\" : 160116733095,\n \"sent\" : true,\n \"year\" : 2\n },\n \"2ebd72af33e32d649100bd2e75e59557f4762e76b241f9ac313f79520eb1e9aa\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAI MANIDEEP S\",\n \"rollnum\" : 160116733104,\n \"sent\" : true,\n \"year\" : 2\n },\n \"2ee9e1a0303649045f7b9d0259c9490410391ae1598d4d6e63c758e925851bfe\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KONDURU VISHNU SANKETH REDDY\",\n \"rollnum\" : 160114733060,\n \"sent\" : true,\n \"year\" : 4\n },\n \"2f41ce24649f7bc0f8e245b79d634a204d6a208135a670de18613a10e822d36d\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SWATHI M\",\n \"rollnum\" : 160116733075,\n \"sent\" : true,\n \"year\" : 2\n },\n \"2fabf6c55f154767c265dbe37d5071d433f7471a8a90b06eca50806fd0909142\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"\",\n \"rollnum\" : 160114733183,\n \"sent\" : true,\n \"year\" : 4\n },\n \"2fe303f504470e2d86776961ae3191ef9bb21cee69626e62c88c95946e406ea7\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NEELA VANI\",\n \"rollnum\" : 160114733025,\n \"sent\" : true,\n \"year\" : 4\n },\n \"2ff390b68468bf9a86087f362d5b52ef2acac34bccc9cdeb05d5bc8c61723be9\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GAYAM NIKHIL CHANDRA REDDY\",\n \"rollnum\" : 160115733038,\n \"sent\" : true,\n \"year\" : 3\n },\n \"3003d157297172f0ae8a974a9d8fc9ae1d804084adfd984703ddae2c50bbbc87\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"DEVARAJ N\",\n \"rollnum\" : 160116733026,\n \"sent\" : true,\n \"year\" : 2\n },\n \"306ac98c9cc4acdf28b954683b78928b4ff1059c20f6d327ad6a7b38bd398a82\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"CHIKULA SAI KUMAR\",\n \"rollnum\" : 160115733107,\n \"sent\" : true,\n \"year\" : 3\n },\n \"31068862a3a9ede9c37d8faae5a6315a5eddd445ad96cd1a964b5f21b81bfbd0\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"AKSHAY\",\n \"rollnum\" : 160114733089,\n \"sent\" : true,\n \"year\" : 4\n },\n \"312c16cc74c5760f1043dcafa4606c5ce36c64548db5ed851bdc45b59a50baf3\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"THATIKONDA PRANAY\",\n \"rollnum\" : 160114733162,\n \"sent\" : true,\n \"year\" : 4\n },\n \"3154c9dc1070d11f676b8cff4d195ae4861963a93f24e756bc62b9dd52093264\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MALDANNA K\",\n \"rollnum\" : 160116733034,\n \"sent\" : true,\n \"year\" : 2\n },\n \"316337f45f1d9b827fc4595cc464cbb2b284b10df7278344243ffe692b5cfa53\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"RAVURI MANOJ KUMAR\",\n \"rollnum\" : 160114733157,\n \"sent\" : true,\n \"year\" : 4\n },\n \"324e4a45299c99376c9d350bb1c03ef3a8e1388daf40336e4a77f336213a0b7b\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"CHILUKA RACHANA\",\n \"rollnum\" : 160114733323,\n \"sent\" : true,\n \"year\" : 4\n },\n \"327c0421db1ea6a022143c08c4cd85913ab612c88abcae753284a6eb70996ac8\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE02\",\n \"group\" : \"2\",\n \"title\" : \"Principle of Programming Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"LAVANYA K\",\n \"rollnum\" : 160116733005,\n \"sent\" : true,\n \"year\" : 2\n },\n \"32ec7dc6c6b4f65d7cde89acf74306fc59316dfa1614254062fd5dc539408f86\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PRADEEP P\",\n \"rollnum\" : 160116733041,\n \"sent\" : true,\n \"year\" : 2\n },\n \"332c768eb8390198cb972afeb90b85672d09a1245ac422cb99128c97b59556f5\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DAVULURI SAI KIRAN\",\n \"rollnum\" : 160114733110,\n \"sent\" : true,\n \"year\" : 4\n },\n \"337e1f8ce3aa74fb4a9459342685117d8ba667a65eee664a0a0164a001498c3f\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PALREDDY DHARANISH REDDY\",\n \"rollnum\" : 160116733182,\n \"sent\" : true,\n \"year\" : 2\n },\n \"33d0ba9742e306cd443243775bf79f65e904e238de604ca533c1e5ad677cf0b2\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAI TEJASWI MUTTAVARAPU\",\n \"rollnum\" : 160115733142,\n \"sent\" : true,\n \"year\" : 3\n },\n \"3411bef682440cda4d344873c9a1f01a1c882879498780e3d319b2ce8c4a056c\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GANDLA JEEVAN\",\n \"rollnum\" : 160114733313,\n \"sent\" : true,\n \"year\" : 4\n },\n \"346592e118bd2d1688f3a0c41b839614a4c6eb01bc971d237a322f0a48cb1b48\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GOLI SAI KEERTHANA\",\n \"rollnum\" : 160114733138,\n \"sent\" : true,\n \"year\" : 4\n },\n \"35567cff338fc5fbcb7f5d7951983e922de9c7313892978252fc21032bb6f5a3\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GUNDALA PRANAYA\",\n \"rollnum\" : 160114733320,\n \"sent\" : true,\n \"year\" : 4\n },\n \"3597281bd2f1c0b2c7b2acab4ad840cc62c0bf24c1d50b6b92d2ff412c999696\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"SHAIK SHAILY\",\n \"rollnum\" : 160114733015,\n \"sent\" : true,\n \"year\" : 4\n },\n \"35d0a395cb75cc97c7f09977e40a26921859d6566be9a553020f7b2361d871b1\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MADDIKUNTLA SAHITHI\",\n \"rollnum\" : 160115733010,\n \"sent\" : true,\n \"year\" : 3\n },\n \"3709ec3aa9d95db452d11629c32483418d9b60abbb9a85299580057dc39facdc\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"LAVANYA K\",\n \"rollnum\" : 160116733131,\n \"sent\" : true,\n \"year\" : 2\n },\n \"379541af0cea6b86055ba29e7444df64530103b34b0c22831eaa8c6eb1fbc0b4\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"YAKKALURI AKHIL REDDY\",\n \"rollnum\" : 160114733148,\n \"sent\" : true,\n \"year\" : 4\n },\n \"39ad7a287d2674fb9782d177f12066c7e706ffb14b8e620917db5d14ab36bd68\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"SAI YATHIN REDDY S\",\n \"rollnum\" : 160116733169,\n \"sent\" : true,\n \"year\" : 2\n },\n \"3a60bae195c810717730fd37700c1a11bbdd06c04afb9dde4011535c86073abc\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHRUTHI BARPUTE\",\n \"rollnum\" : 160114733079,\n \"sent\" : true,\n \"year\" : 4\n },\n \"3aaa344ca11b598cd350afba0ade4ac9c275a8d9abc9e5adeb01cf6195c1cb55\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BATTU AKHIL\",\n \"rollnum\" : 160114733147,\n \"sent\" : true,\n \"year\" : 4\n },\n \"3abb46112c091fe7c1928c789d50e2f81407958e951412b1373f00cabdd991b9\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"ESAMPALLY SWETHA\",\n \"rollnum\" : 160116733323,\n \"sent\" : true,\n \"year\" : 2\n },\n \"3b1b5a29eb4279d3ebb4b1c56da08de4e9d5749bc67f4ef8abb2ebf3e37ba9ae\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GAINI PRANEETH RAHEE\",\n \"rollnum\" : 160114733046,\n \"sent\" : true,\n \"year\" : 4\n },\n \"3cd5490f974a0ae23e63a25cd41f7e0b9be68baaaef897babfb5c0c1975b7322\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HARINI RAO A\",\n \"rollnum\" : 160116733127,\n \"sent\" : true,\n \"year\" : 2\n },\n \"3cffbfddb0e718ff63726746209fd80dc45b9b506ecbf012d56c03ca9a85c361\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MADHURIMA YELLA\",\n \"rollnum\" : 160115733131,\n \"sent\" : true,\n \"year\" : 3\n },\n \"3d2914a366e8df056dc584e45c70eb0cfdc66d6c18d23eaec9ec6de54d69b3ba\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE03\",\n \"group\" : \"2\",\n \"title\" : \"Shell Scripting\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GAURAV CHOWDARY P\",\n \"rollnum\" : 160116733027,\n \"sent\" : true,\n \"year\" : 2\n },\n \"3d4ef52e0b1400ce64d4c6bacc0773e944a360e0c9987ca1ece077004ac4a02a\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MANISH BHUSHAN P\",\n \"rollnum\" : 160116733158,\n \"sent\" : true,\n \"year\" : 2\n },\n \"3d752323997580a2f3c4ae6b523500b618a693f17017e8a5834ee77fdf9948eb\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"AZMEERA PRIYANKA\",\n \"rollnum\" : 160114733136,\n \"sent\" : true,\n \"year\" : 4\n },\n \"3e1abda838970eab2bd28dc60431b521328ba16e0ff07e8c4ea73264174c001b\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS484\",\n \"group\" : \"5\",\n \"title\" : \"Business Intelligence\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MADARI UDAY KIRAN\",\n \"rollnum\" : 160114733315,\n \"sent\" : true,\n \"year\" : 4\n },\n \"3e78555361365da88154c1dee39f5fe153162315a86bc0b110eff3c46744b694\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MATHA DILEEP\",\n \"rollnum\" : 160115733153,\n \"sent\" : true,\n \"year\" : 3\n },\n \"3e91e19ea17553637c77d4fd821015efe2414e487fcde16e82cea6b8fe4eec20\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"SHANTAN T\",\n \"rollnum\" : 160116733171,\n \"sent\" : true,\n \"year\" : 2\n },\n \"3efc3cb71bbeaae7f1e06a5b6d431e4528790e411c2bcc9411d41024ca0b7b03\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ANISH REDDY THUMMALA\",\n \"rollnum\" : 160115733085,\n \"sent\" : true,\n \"year\" : 3\n },\n \"3f35c381e0cf3c44feaa8544598eefe8f39b72212cfbd549a3fe6916ae3ebfaf\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAI KRISHNA ANUDEEP A\",\n \"rollnum\" : 160116733050,\n \"sent\" : true,\n \"year\" : 2\n },\n \"3f427793f4700c3fcdc3b1ba48ecd468ce80eaa7de1f278db96ed8630e6731a5\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PATWARI REVATHI RAO\",\n \"rollnum\" : 160115733009,\n \"sent\" : true,\n \"year\" : 3\n },\n \"3f5a042f22329275e1d1e968c324940ddbb161aaa076c836b30c407e257316e8\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"RAHUL M\",\n \"rollnum\" : 160116733045,\n \"sent\" : true,\n \"year\" : 2\n },\n \"3fa189998536e6b38b12a2877140388da10c4067a5a7b7b6dc79dcbb775279e5\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KORRA VASANTHA\",\n \"rollnum\" : 160114733321,\n \"sent\" : true,\n \"year\" : 4\n },\n \"406d3baf974211ce6310942c4ad413e7d43aa52f849bce0ce15013d27a04eb6a\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"\",\n \"rollnum\" : 160114733185,\n \"sent\" : true,\n \"year\" : 4\n },\n \"40819c7c85f045491ab4498175d6fcf839004556b32aaa5fbe4d3c2a957f2e60\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"P SAI THARUN REDDY\",\n \"rollnum\" : 160115733112,\n \"sent\" : true,\n \"year\" : 3\n },\n \"41bd1ec3e6543355a58a26dd3da0fae076ebfc3816d0cb44c9b01421c5276e12\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PAMARA BRIJESH RAO\",\n \"rollnum\" : 160114733032,\n \"sent\" : true,\n \"year\" : 4\n },\n \"41c5a5ac573bab145f5cd822beefc981e38cf24ee7cf5b4b5ea0cd636e86265e\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"CHOPPARI PRANISHA\",\n \"rollnum\" : 160114733329,\n \"sent\" : true,\n \"year\" : 4\n },\n \"41f47e47ea0f2d3dab8194f9fd6be84677c19ae9fece901ca5a0d0981e1221e7\" : {\n \"email\" : \"\",\n \"name\" : \"GARUDADRI LAKSHMI SAI NITYA\",\n \"rollnum\" : 160115733012,\n \"sent\" : false,\n \"year\" : 3\n },\n \"41f6c1233b6ee2ba28c273cba85e00194331e3f6f4927848c870bb2d62025f97\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GOUTHAM A\",\n \"rollnum\" : 160116733028,\n \"sent\" : true,\n \"year\" : 2\n },\n \"4319a8d23f83ff985836749c5ad591ee39ae3d9de3d6c1d1674c8b49b3283093\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ANTHARVEDI NAVEENKUMAR\",\n \"rollnum\" : 160116733308,\n \"sent\" : true,\n \"year\" : 2\n },\n \"43c523c643ff9856ace011cb330d21cc817757e18abb8e26266a66b17df9b2b5\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"G SAMBA RAJU\",\n \"rollnum\" : 160115733315,\n \"sent\" : true,\n \"year\" : 3\n },\n \"43dbbe7021e999bcf797fe6c25c8e099607fa14174a8eb6262c93062ac5390cf\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ANJANI VADEPALLY\",\n \"rollnum\" : 160115733064,\n \"sent\" : true,\n \"year\" : 3\n },\n \"43ea8ac2c544d004d0c7bfc6d6a362ab60d476a722217bd500248bc28150e2fa\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"AGURLA RAVI KUMAR\",\n \"rollnum\" : 160114733049,\n \"sent\" : true,\n \"year\" : 4\n },\n \"441e2f49dfb13c2c94fd9b44fd1fa0eca6147b310c0b0f2887536e620df15245\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BANDARU ROHITH REDDY\",\n \"rollnum\" : 160115733103,\n \"sent\" : true,\n \"year\" : 3\n },\n \"44449298aa9f61aaea2f7dc4f47416ef0d824e95be242507235bf2a1ea3d9822\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"HEMANTH REDDY S\",\n \"rollnum\" : 160116733157,\n \"sent\" : true,\n \"year\" : 2\n },\n \"445c059766bafcaf515d226cf533064bd5340bf136888a66b0d6da23492c012b\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"C HARI SAMANTH\",\n \"rollnum\" : 160115733029,\n \"sent\" : true,\n \"year\" : 3\n },\n \"448388b726b1f8aed72fecea9ce064a6896acfcc73b2f72b0ea99aba5fe1f321\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BOKKALA NIKHIL REDDY\",\n \"rollnum\" : 160114733104,\n \"sent\" : true,\n \"year\" : 4\n },\n \"44d17a6953f427c0971e362e46fc66ffcbdc0e4e1c82188a0a6f90161ad4d589\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SOMARAPU ARAVIND BABU\",\n \"rollnum\" : 160115733023,\n \"sent\" : true,\n \"year\" : 3\n },\n \"4503f5675d08035212bbe3a8d598b1931378c1be7a4721add80f21c749f309c6\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"HARIHARAN SAI G\",\n \"rollnum\" : 160116733091,\n \"sent\" : true,\n \"year\" : 2\n },\n \"45e4e1bd6cf030861953c88ea05f20ee6bf52f0f3676dfeb336a5b55a68df976\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KARRE SRIKANTH\",\n \"rollnum\" : 160115733314,\n \"sent\" : true,\n \"year\" : 3\n },\n \"46416ede719cc0b99b39395f62e49ddbc1ddd245e17583989f7778ea6dd317aa\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS484\",\n \"group\" : \"5\",\n \"title\" : \"Business Intelligence\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MALLINENI SAI SRUTHI\",\n \"rollnum\" : 160114733139,\n \"sent\" : true,\n \"year\" : 4\n },\n \"464a1f25fe900c519bbdf755c632e5438b3322ee9336f780a4743940ee0c6e34\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ENJALA SPANDANA\",\n \"rollnum\" : 160115733017,\n \"sent\" : true,\n \"year\" : 3\n },\n \"4696a107534ade8ad9c28a3b95fffce5ca325a9dc260d61d8061cfd32b2448f9\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NUKALA JYOTHI\",\n \"rollnum\" : 160115733126,\n \"sent\" : true,\n \"year\" : 3\n },\n \"46a47609b9dc0606e71a06700ad81fb14f5d2af2315c4cd9afb84136c9622420\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PADALA SOUMYA\",\n \"rollnum\" : 160115733145,\n \"sent\" : true,\n \"year\" : 3\n },\n \"46dbe453ed9f4aed05a166a4be3b9d47dcf9843e9ec6eb227c602a456bf0cd44\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE03\",\n \"group\" : \"2\",\n \"title\" : \"Shell Scripting\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHIVANI V\",\n \"rollnum\" : 160116733141,\n \"sent\" : true,\n \"year\" : 2\n },\n \"4701e56384d0f654c493d023cddb04e4db9a9f9d8319bfbee40d763a3fea652d\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE02\",\n \"group\" : \"2\",\n \"title\" : \"Principle of Programming Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SUCHANDRANATH B\",\n \"rollnum\" : 160116733058,\n \"sent\" : true,\n \"year\" : 2\n },\n \"472e542e0ba3ea413ddf396a6a26e2a9a034ad72e24f027cf1c2d7e5ac263417\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MD MUJTABAUDDIN FURQAN\",\n \"rollnum\" : 160114733158,\n \"sent\" : true,\n \"year\" : 4\n },\n \"4744837b84a8ff9d3a0a84a79871b8b7f11b087cf7e8854086454eb0f676a777\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MANISHA RAO LOYAPALLY\",\n \"rollnum\" : 160114733129,\n \"sent\" : true,\n \"year\" : 4\n },\n \"47afabe3e0fd5e6be40dcde0f61f4d040b7c98024b291af27b5866a46acb4468\" : {\n \"email\" : \"\",\n \"name\" : \"LINGAM RAAGAMAYEE\",\n \"rollnum\" : 160115733135,\n \"sent\" : false,\n \"year\" : 2\n },\n \"47c9e57cd502841a521b732229cfef848a116e99b817e6a3fe5a6535eab4e305\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VANAPARTHI MOHANTH\",\n \"rollnum\" : 160114733316,\n \"sent\" : true,\n \"year\" : 4\n },\n \"4818752cf1c6ea55019402c2aaf4d1ef1069b5223fb2f2f07cf3cfd8c0c123b1\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SNIGDHA PRIYA T\",\n \"rollnum\" : 160116733143,\n \"sent\" : true,\n \"year\" : 2\n },\n \"48240682845bdc435792ff21d93e3997b0e485795fe66785ca8cafa8fd5fbe6c\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ADLURI HARSHITHA\",\n \"rollnum\" : 160115733003,\n \"sent\" : true,\n \"year\" : 3\n },\n \"49e2c35d3bd0f84212a719aa9a3d9cfdae62258b6d0288748076120bfaf8a095\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ABHIJNA D\",\n \"rollnum\" : 160116733121,\n \"sent\" : true,\n \"year\" : 2\n },\n \"49f75fb8dabcb8af6ed4c7e612404f9ed3dac935835749a67adf2d14a02ab510\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BILLAKANTI AKHILA\",\n \"rollnum\" : 160115733062,\n \"sent\" : true,\n \"year\" : 3\n },\n \"4a085c501165c1fe8a66d1254d999b60d3434504efda19f3c009753c41ae71bd\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"MANASA SUSIRLA MANONMAYI\",\n \"rollnum\" : 160114733130,\n \"sent\" : true,\n \"year\" : 4\n },\n \"4ab28dc7352245c5533ac1b804a703f115e8bea57fd3ad3eb6ecc0113e77832d\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BANDARU SHIRISHA\",\n \"rollnum\" : 160115733015,\n \"sent\" : true,\n \"year\" : 3\n },\n \"4abbbc363ee808ca20312c1b350cd83b9b47e18afd7f6e1c54178a2ca6f4aa17\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"NADIPALLY SAI ASHRITH\",\n \"rollnum\" : 160115733106,\n \"sent\" : true,\n \"year\" : 3\n },\n \"4b6caf4882b5e2c37ca2496d916571a467827c9d1ec57a12c7a531cbb847dc78\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SRIPRIYA S\",\n \"rollnum\" : 160116733018,\n \"sent\" : true,\n \"year\" : 2\n },\n \"4b7ef3d62d349205ee83eb53d8abe5af31c5e58a44521d4110f91f88177a17b1\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"TAMEEMA FARHEEN\",\n \"rollnum\" : 160116733148,\n \"sent\" : true,\n \"year\" : 2\n },\n \"4b8a61287071c835e454667a7e85f1ee3e641140ed0d768fbd81c8ae017324f1\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"CHANAKYA PHANINDRA G\",\n \"rollnum\" : 160116733085,\n \"sent\" : true,\n \"year\" : 2\n },\n \"4c976f508b2a55fca4961fc3d231bce4b18a8099d742bdcdcfac59570b967770\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"NIHARIKA NISANGI\",\n \"rollnum\" : 160114733133,\n \"sent\" : true,\n \"year\" : 4\n },\n \"4cc65036ed526629dc2c2821a0f46d25b4a48bd8c9082897ff3ed6edf5d69d43\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MONIKA POTHIREDDY\",\n \"rollnum\" : 160115733072,\n \"sent\" : true,\n \"year\" : 3\n },\n \"4ce0147f99c223da2dd240b7f75ef26c529fac122880710adf68c6ece5c84717\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHIVA RITHIK REDDY Y\",\n \"rollnum\" : 160116733108,\n \"sent\" : true,\n \"year\" : 2\n },\n \"4d305b253de0c9266ad8e4f3a289944e1389d92f3bd4ec19ae601764c11a3966\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SINGIREDDY ROHITH REDDY\",\n \"rollnum\" : 160115733104,\n \"sent\" : true,\n \"year\" : 3\n },\n \"4d41db614b91f40fec933bb0646d4cc61ba7fa7a77dc8811bd5c25c62314abc6\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"RAMAVATH MOONA\",\n \"rollnum\" : 160115733336,\n \"sent\" : true,\n \"year\" : 3\n },\n \"4d69a38dab37e5e901f8e7f20a1b39d1e23f7eb8df7ad82ed796f939e6affbea\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"PRADEEP KUMAR T\",\n \"rollnum\" : 160116733040,\n \"sent\" : true,\n \"year\" : 2\n },\n \"4d7d473dc265d9ed87e3431232e0e3ed8d161679a7578fd5ea56e4a1711ce330\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KRISHNA SAI VAMSI CHINTALA\",\n \"rollnum\" : 160115733091,\n \"sent\" : true,\n \"year\" : 3\n },\n \"4e181a5efd17005816ed8262fc2b7982dfcd060699a1927dfd39181a3095e055\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHAIK AAQIL\",\n \"rollnum\" : 160115733170,\n \"sent\" : true,\n \"year\" : 3\n },\n \"4e756a78cafa970da7034c93fc1b75b08d96d5de25048d3cd5b0b3757f9e9c72\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"Y MANISHA\",\n \"rollnum\" : 160114733010,\n \"sent\" : true,\n \"year\" : 4\n },\n \"4eb069c1c28191b753e612756f3eadfc1722a448b473dc9a3a3fe2766fb57ec5\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"\",\n \"rollnum\" : 160114733186,\n \"sent\" : true,\n \"year\" : 4\n },\n \"4f62297eb1176afa2b6e7d9eb1261fe8b95bdbd1372f2706e5d77ae46bd162cf\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"YASHWANTH REDDY K\",\n \"rollnum\" : 160116733120,\n \"sent\" : true,\n \"year\" : 2\n },\n \"507007389d0e0c3255e0639ff2b381dc3d7f2f66ba31d76ebc5beb3c175dbc3a\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DARSHANA BOMMIREDDY REDDY\",\n \"rollnum\" : 160114733065,\n \"sent\" : true,\n \"year\" : 4\n },\n \"509f5a3240f428d96985acdc654f97806e4d736daa13223518e8528c3cbafaf9\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"DATTARAJ G\",\n \"rollnum\" : 160114733150,\n \"sent\" : true,\n \"year\" : 4\n },\n \"5112c5ab1c81d5764dcb8e5f3f463aa2938655bbd32e6ea9f65696004d658e20\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MUKKA KARTHIK\",\n \"rollnum\" : 160114733097,\n \"sent\" : true,\n \"year\" : 4\n },\n \"51226fa685fbf589a963f20ca20fe3337890d5852d8c128dc78b5e31edd447b9\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ESHWAR HARSHA VARDHAN JALLEDA\",\n \"rollnum\" : 160114733093,\n \"sent\" : true,\n \"year\" : 4\n },\n \"51250d8193d7f135778886d8a25a7e61796d3e710e8e88922c703fd4695e2e5b\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KANUKUNTLA SHYAMALA\",\n \"rollnum\" : 160115733330,\n \"sent\" : true,\n \"year\" : 3\n },\n \"516308d40ec0a0ec8ee5ea4ab225821af388ba65bb10ddd3d72d5d22e2c57bef\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KOORAKULA MAHESH\",\n \"rollnum\" : 160114733155,\n \"sent\" : true,\n \"year\" : 4\n },\n \"51c37823e0133fca1c07f6c06d043b0f5c97038b3f981d28df15ff4131a220ed\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GUDURU BHAVYA\",\n \"rollnum\" : 160115733066,\n \"sent\" : true,\n \"year\" : 3\n },\n \"51f4647d97f6994358a3be85887ac308d65dac6d8fb6b363226a980166fbdc47\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"LINGAMPALLI PRAVALIKA\",\n \"rollnum\" : 160115733306,\n \"sent\" : true,\n \"year\" : 3\n },\n \"52006174d368050ca1237bea6d23a771685df6178e05b1778e02f27c9e5e2067\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SADULA SAI ANURAG\",\n \"rollnum\" : 160115733164,\n \"sent\" : true,\n \"year\" : 3\n },\n \"5270c27cb1ae827e30e83e46887f4b030a669481d41089177c02d9469f383c60\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"YADUGIRI SAI RAJA\",\n \"rollnum\" : 160115733109,\n \"sent\" : true,\n \"year\" : 3\n },\n \"53d46dce704da3c721d35d072a82d5881e53a5c6f586e9b180595114c74ffbc7\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"OMAR AHMED\",\n \"rollnum\" : 160116733162,\n \"sent\" : true,\n \"year\" : 2\n },\n \"53dbaed286bb006f3d63dfb20edcd7cd307e366729ee1a288b84a5ff1a24cf7f\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GONTHINA SAI RAGHA MOUNIKA\",\n \"rollnum\" : 160114733074,\n \"sent\" : true,\n \"year\" : 4\n },\n \"53f75f61efbd7e2188db28f5ed229c57db9fcc2b7b230bd7f7eb53f55c9c7fcf\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"RUCHITHA CHINTHALA\",\n \"rollnum\" : 160114733014,\n \"sent\" : true,\n \"year\" : 4\n },\n \"54a4d7a284c01f0812b65d7e502804b9afddc28c981ab38e5889b82fde6d7706\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BHONGIRI TEJASWI\",\n \"rollnum\" : 160115733312,\n \"sent\" : true,\n \"year\" : 3\n },\n \"5505808d8d98331f19c7e39e532e2b02c03ef830d40edac9566ae086c86edaae\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GOVINDU VENKATA SHIVA KRISHNA\",\n \"rollnum\" : 160114733307,\n \"sent\" : true,\n \"year\" : 4\n },\n \"555ecd1019828a94656938821bb8f15eb40e9e1aebc8c61c5bec317e0a9ed1f1\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE02\",\n \"group\" : \"2\",\n \"title\" : \"Principle of Programming Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"UPPALA VEDA PRIYA\",\n \"rollnum\" : 160116733184,\n \"sent\" : true,\n \"year\" : 2\n },\n \"556deb402f29d572fc6b48d94494cd1dbde7115140b35e86498db0cac0fa0cc7\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ANURAG D\",\n \"rollnum\" : 160116733151,\n \"sent\" : true,\n \"year\" : 2\n },\n \"557298037ec6e268823573419729656bee1d8423eff8a3349a1a7c38355b700f\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS473\",\n \"group\" : \"4\",\n \"title\" : \"Semantic Web & Social Networks\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VAKULA NAGA SARITHA KARRI\",\n \"rollnum\" : 160114733084,\n \"sent\" : true,\n \"year\" : 4\n },\n \"55a5add94cea79cf12ae2b98dddd6c6166b5e5bb1cc7519d64f567f7d9da5ed5\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE03\",\n \"group\" : \"2\",\n \"title\" : \"Shell Scripting\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BHAVYA K\",\n \"rollnum\" : 160116733123,\n \"sent\" : true,\n \"year\" : 2\n },\n \"55ef7a37ce0bccdf2520e11361b5a2875aa672e1fd0e1d49ce78e68780a02ddd\" : {\n \"email\" : \"\",\n \"name\" : \"CHINTALA RAGHAVENDRA\",\n \"rollnum\" : 160115733100,\n \"sent\" : false,\n \"year\" : 3\n },\n \"5697414c490dd4c515fd692194a78a1b1e584ccb0eefb02470be448ab71d40e1\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"CHETANA REDDY Y\",\n \"rollnum\" : 160116733064,\n \"sent\" : true,\n \"year\" : 2\n },\n \"56ebd025db18464497d83715e45aa799037839a55f6dfe20142bdd023456a178\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KUNAL T\",\n \"rollnum\" : 160114733042,\n \"sent\" : true,\n \"year\" : 4\n },\n \"57043a14eed01476d8c40e11201d5b65e93d6e066455443e68f241615f9b5c37\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"THUPAKULA SAI SREESHMA\",\n \"rollnum\" : 160115733140,\n \"sent\" : true,\n \"year\" : 3\n },\n \"571a8f3f3e9a476641e48055e0e87828f3d8e848412cc8dc64897bd1e3c05b5b\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ASFAN SAJID\",\n \"rollnum\" : 160114733030,\n \"sent\" : true,\n \"year\" : 4\n },\n \"576b9e5ffc3118efb7af14a51a8306916ec66ab76d06ff1fc4bbca7c20bd5c0f\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MUPPANENI ITHESH\",\n \"rollnum\" : 160115733032,\n \"sent\" : true,\n \"year\" : 3\n },\n \"581c7f1e03f01e50568ceeca2cddad1d82926967ccc4372adbb4922a9613cef4\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KAVUKUNTLA RACHANA\",\n \"rollnum\" : 160115733134,\n \"sent\" : true,\n \"year\" : 3\n },\n \"584f1e6f12f80d1d834fdac33c758d1d35371a84c58b8f7a2cd3de2f08e99e3f\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BOGIREDDY SAI MOUNA\",\n \"rollnum\" : 160115733139,\n \"sent\" : true,\n \"year\" : 3\n },\n \"58516a0f5ad6b1bd157ec6fdb9d3ef4105e871996797d984ab5a850f5c73bddd\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHIVANI C\",\n \"rollnum\" : 160116733014,\n \"sent\" : true,\n \"year\" : 2\n },\n \"5854e98d067b7649f19a4f874455c4746ce903c5a3b6b6fbefaa35626f9c53d5\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NEHA AFROSE\",\n \"rollnum\" : 160116733134,\n \"sent\" : true,\n \"year\" : 2\n },\n \"591a2b891fc5810be3341f3a1b3de4ab26a9facdb9d96d205df07adda06f9a0d\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KATNAPALLI SRICHANDANA\",\n \"rollnum\" : 160115733018,\n \"sent\" : true,\n \"year\" : 3\n },\n \"59adb2af82131d07ee3a1455ee49654920ecd18e84f95c8b4f52fc27b9214dc6\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"SANDHYA K\",\n \"rollnum\" : 160116733138,\n \"sent\" : true,\n \"year\" : 2\n },\n \"5a44c0739f1b0e7e1e2dc8e208eac94017df15ed6241f0fe0f99d708f5684221\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHASHI KUMAR GUNDALA\",\n \"rollnum\" : 160116733333,\n \"sent\" : true,\n \"year\" : 2\n },\n \"5a807f0779a42f1b82e66b257d350dbde83ada7b60e303302a4a5a702716d97c\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BRUNDA DEVI A\",\n \"rollnum\" : 160114733123,\n \"sent\" : true,\n \"year\" : 4\n },\n \"5a9a4488b0d2b4611d26486303362b6df9f94b4fe7bc477e42ffcca15074a5be\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHAIK HAJIRAH TABASSUM\",\n \"rollnum\" : 160115733144,\n \"sent\" : true,\n \"year\" : 3\n },\n \"5b07a6786f10a490cf70395a17091006bd1b34489ff62504ef4fd6de22c97067\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"G SHASHI KUMAR\",\n \"rollnum\" : 160114733054,\n \"sent\" : true,\n \"year\" : 4\n },\n \"5b383b3bcc39ab218d621afcc5ef88d3588adae53a7d44d3acc8e6be82d4a0f7\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE02\",\n \"group\" : \"2\",\n \"title\" : \"Principle of Programming Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PRASHANTI K\",\n \"rollnum\" : 160116733010,\n \"sent\" : true,\n \"year\" : 2\n },\n \"5c17fa69be38cea331a1f2149fbb6d1254804eb669f38396345b81bf1a694b10\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"B NIKHIL KUMAR\",\n \"rollnum\" : 160115733039,\n \"sent\" : true,\n \"year\" : 3\n },\n \"5cfa78097ce469e9e6ce50f3c5ac8313bf4dc7225afe7020dcef59a8cbf022c4\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE02\",\n \"group\" : \"2\",\n \"title\" : \"Principle of Programming Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHERU VINOD KUMAR\",\n \"rollnum\" : 160116733305,\n \"sent\" : true,\n \"year\" : 2\n },\n \"5d6ef1499956f7576a6199bc44f6175b97dd2531585255e1179af3d9a8eefda7\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"THUMMA PRUDHVI\",\n \"rollnum\" : 160114733163,\n \"sent\" : true,\n \"year\" : 4\n },\n \"5dc176843630f53454558195b363402f6eece132a28f754cedb10f3d96c0b5f6\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MEGHANA REDDY CH\",\n \"rollnum\" : 160116733008,\n \"sent\" : true,\n \"year\" : 2\n },\n \"5e5220044d9a020bfae30c45bc85ca3167ee51ea668a0e40bd057a2b1b492512\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NIDHI VRAJ SADHUVALA\",\n \"rollnum\" : 160116733070,\n \"sent\" : true,\n \"year\" : 2\n },\n \"5ee61d89a7165f256847f8c4c930e7ac396c33995375aac8b9ed50bd6badda32\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE03\",\n \"group\" : \"2\",\n \"title\" : \"Shell Scripting\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"JEEVANA D\",\n \"rollnum\" : 160116733003,\n \"sent\" : true,\n \"year\" : 2\n },\n \"5f50d6ba7ee1cfd650e3deb54699a89bd01e32cb8018d5b15bb4bc90b0649f85\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"A.SAI SREE LASYA\",\n \"rollnum\" : 160116733319,\n \"sent\" : true,\n \"year\" : 2\n },\n \"5f57c977410b24f377bac3a083672877d592876297afd88064bc402738baa16e\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DOODGAON ABHISHEK\",\n \"rollnum\" : 160114733085,\n \"sent\" : true,\n \"year\" : 4\n },\n \"5f5f8ce4fcb60d5eb46a5e03310e43c401e21973d139dbafdeee9d0f581f0096\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS354\",\n \"group\" : \"3\",\n \"title\" : \"Simulation and Modeling\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VENKATA SRIVATSA GRANDHI\",\n \"rollnum\" : 160115733059,\n \"sent\" : true,\n \"year\" : 3\n },\n \"5fb8d43a64c34779418b72a7185bec57e5f1881e9f47193b62e42d5fdf6b7d96\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"AMIREDDY LAKSHMAN\",\n \"rollnum\" : 160115733158,\n \"sent\" : true,\n \"year\" : 3\n },\n \"607d4f0b17481151e0218cb9a27f158e776d809633dec5c5c53e564f1b7bad6b\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"POKURI NIRANJAN\",\n \"rollnum\" : 160114733043,\n \"sent\" : true,\n \"year\" : 4\n },\n \"608bd97393bd3728c7bdca947a03748833bd1b84526527fd30d14542d24a5e5b\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SREERAM KAVYA SRI\",\n \"rollnum\" : 160115733325,\n \"sent\" : true,\n \"year\" : 3\n },\n \"609e89a8fee1cf9e558abba006ae1c958262cdd5d4fdd5d3aea49a57c0e3ca60\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KOTHA SRUJANVESH GOUD\",\n \"rollnum\" : 160115733057,\n \"sent\" : true,\n \"year\" : 3\n },\n \"60fd81a670097cf019539e191acc3d37e52991e1165e95de3713a3d1c72e5ebb\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"ANURAG M\",\n \"rollnum\" : 160116733152,\n \"sent\" : true,\n \"year\" : 2\n },\n \"6117f52480a6f31eaa571b6458fc7319ebe0d5efaaf7e90612a92879a230b7f7\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"\",\n \"rollnum\" : 160113733081,\n \"sent\" : true,\n \"year\" : 4\n },\n \"61d6bcf56c4331c2ecb2b63ff99ffb89f16c867383cbd33938be4375f4c3b69f\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"TADAKA SHIVATEJA\",\n \"rollnum\" : 160114733314,\n \"sent\" : true,\n \"year\" : 4\n },\n \"626038e6e13bc687556ebf31d19ae0b81c6012db984e79c9d1428ccabd6e0858\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS484\",\n \"group\" : \"5\",\n \"title\" : \"Business Intelligence\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HRUDHAY PASUPULETI\",\n \"rollnum\" : 160114733038,\n \"sent\" : true,\n \"year\" : 4\n },\n \"62720794ab8296e975d56a335dee934bf6f893de8fe241c891e432abaccf7e35\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"SINGIRIKONDA ROHITH KUMAR\",\n \"rollnum\" : 160116733326,\n \"sent\" : true,\n \"year\" : 2\n },\n \"628b321e9c0c3ac4ddbfe1a91f83a8fc00e969487cd0532c48b7e2e826edac64\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"ME472\",\n \"group\" : \"5\",\n \"title\" : \"Intellectual Property Rights\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BIRAM NITHIN KUMAR\",\n \"rollnum\" : 160114733105,\n \"sent\" : true,\n \"year\" : 4\n },\n \"628fd6d30211ac3a0798874b109a06744cdd6342446efd2eaf0e2411b215461e\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MUSUKU HEMANTH REDDY\",\n \"rollnum\" : 160115733031,\n \"sent\" : true,\n \"year\" : 3\n },\n \"62f1ee51d93cbcaf70b1b7bdd96b66424999f685b099d2f4a57df05b3477cd33\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAAKSHI GUPTA\",\n \"rollnum\" : 160116733072,\n \"sent\" : true,\n \"year\" : 2\n },\n \"63c54ac8f574d77ac93e24580e1837410e2546659393f0fb34e24adaff2a81a9\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"KONDAPALLI SAI TEJA\",\n \"rollnum\" : 160114733167,\n \"sent\" : true,\n \"year\" : 4\n },\n \"63c921e801273a2db4b8bf7549c3fc4312c62ef348f2bdbf1cb9094c28b85dea\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"R PRANITH KUMAR\",\n \"rollnum\" : 160114733106,\n \"sent\" : true,\n \"year\" : 4\n },\n \"640ad399d89e1dea08151eebc387f679961a68a32d7ae135d2357106bb0db231\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"D.VINAY SAGAR\",\n \"rollnum\" : 160115733321,\n \"sent\" : true,\n \"year\" : 3\n },\n \"65203faf92130e21ee0a99b5209607750287647aa7711bd5a3b2c33ada9017e9\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"RAMARAJU BALA LAKSHMI SAI SWETA SAHITHI\",\n \"rollnum\" : 160115733123,\n \"sent\" : true,\n \"year\" : 3\n },\n \"6574de7c443e9550ecb216ca89c05dbc0ebaf73719eeb79a78ec2142a8630705\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"THOTA SRAVANI\",\n \"rollnum\" : 160115733322,\n \"sent\" : true,\n \"year\" : 3\n },\n \"65e7946faa759907e372e97ea550fc5d403bb6479cc02915b5745009b00c21f1\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MONIKA P\",\n \"rollnum\" : 160116733069,\n \"sent\" : true,\n \"year\" : 2\n },\n \"66426c86bf14cc2fc94c96f3d71d6af438013150dec42d6f803b9ed0f03ace72\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KATAMONI SREERUPA GOUD\",\n \"rollnum\" : 160115733310,\n \"sent\" : true,\n \"year\" : 3\n },\n \"666a01ce2281cacc0ba3ae8c8ce9fbce1f9e775617eabcbc76646e4d5ad08068\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"MOHD ABDUL SAMAD\",\n \"rollnum\" : 160115733309,\n \"sent\" : true,\n \"year\" : 3\n },\n \"667242cc1ac2a3719fc96e751d0af2edd617acdfcf520b8a6617353e9308568f\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VEDALA SAI REVANNTH\",\n \"rollnum\" : 160115733050,\n \"sent\" : true,\n \"year\" : 3\n },\n \"6691a49b501f4a30fee2998eb945aedd90a1b828ca45d982e09bb2eef234b98f\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"B SREE HARI PRIYA\",\n \"rollnum\" : 160115733147,\n \"sent\" : true,\n \"year\" : 3\n },\n \"6708c4b817319cdf140c5397ff85dc48b34c0667f7b529e1111e3ccc60e750a3\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HARIS OMER HABEEB\",\n \"rollnum\" : 160114733322,\n \"sent\" : true,\n \"year\" : 4\n },\n \"6744f140af48318339656519a2896b55294888d5f4f8d2c73ed905da61f993ad\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SATYA PARIMALA R\",\n \"rollnum\" : 160116733012,\n \"sent\" : true,\n \"year\" : 2\n },\n \"6757373fc26f5c234604314fd14a2ce0c5942a4d85096ad67fb93c8b77ef6ed1\" : {\n \"email\" : \"\",\n \"name\" : \"DEEPAK S\",\n \"rollnum\" : 160116733088,\n \"sent\" : false,\n \"year\" : \"2\"\n },\n \"6784d22be5f2d94cc42ffeb98338e7892d7da65af27b56ff86fdc095fda6e276\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"S PRANEETH KUMAR\",\n \"rollnum\" : 160115733099,\n \"sent\" : true,\n \"year\" : 3\n },\n \"67e0d72265e7c5c32abc1ed29698e48eb5a32fe7726a70a0fb4bcfdb457c6106\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GURRAM NAGARJUN REDDY\",\n \"rollnum\" : 160115733037,\n \"sent\" : true,\n \"year\" : 3\n },\n \"68154beaef6c591c3ab719846e574cdc96d02c11003fd6f451985be9c52fb28c\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE03\",\n \"group\" : \"2\",\n \"title\" : \"Shell Scripting\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KADARI ROHITH\",\n \"rollnum\" : 160116733307,\n \"sent\" : true,\n \"year\" : 2\n },\n \"685ad53b74201d0a7463849a57b6ae0b294e5ef7e3500d00367a7aeb0ee6e7af\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MRUDULA U\",\n \"rollnum\" : 160116733133,\n \"sent\" : true,\n \"year\" : 2\n },\n \"6874139badb6960590b39453945cf9271928845298504aa189908be7d37ce95c\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ALEKHYA RAO V\",\n \"rollnum\" : 160116733122,\n \"sent\" : true,\n \"year\" : 2\n },\n \"69135fd675fded2eb9f2011481b8c1a98e33b263b5e9e581a2f70f4059aa3701\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MOHAMMAD MAHABOOB ALI ASHRAF\",\n \"rollnum\" : 160116733036,\n \"sent\" : true,\n \"year\" : 2\n },\n \"6943c168e3b08bcce41ae0c50f1b24e8b09124f57aed677d241fe92d9f32cbe3\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HIMANSHU KETAN KAPASHI\",\n \"rollnum\" : 160115733157,\n \"sent\" : true,\n \"year\" : 3\n },\n \"69a597886de239c2481dcf4b9d5c19cd13b65baf5c2ba951ec5c5f30278664d7\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"SRI NARASIMHA NIHANTH V\",\n \"rollnum\" : 160116733055,\n \"sent\" : true,\n \"year\" : 2\n },\n \"69c7dd5a17a3b55f25118a082e7ab249be29c7287df2be17cf0c9afa2435728f\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NAGA RAMA BHADRA KUMAR MALLADI\",\n \"rollnum\" : 160115733036,\n \"sent\" : true,\n \"year\" : 3\n },\n \"69e2373c1f4977e1906b783a9784e018237cd6c26e4f836ed0d8f7591bcf06fc\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"JAGATH DEEPTHI B\",\n \"rollnum\" : 160116733067,\n \"sent\" : true,\n \"year\" : 2\n },\n \"69f219945626fde5edeb6a741a88cc8bf76365544eb01406028c962dea9a7373\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"THERUPALLY SHREYA\",\n \"rollnum\" : 160115733016,\n \"sent\" : true,\n \"year\" : 3\n },\n \"6a951e32af1be3178c8783dad5b0cefe9edba1bdd4070fb093c00d026c42b4a9\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"KAPIL REDDY\",\n \"rollnum\" : 160114733154,\n \"sent\" : true,\n \"year\" : 4\n },\n \"6ac35b59ae73edf37bfcd02e90e9fe0e2fe23c5510a47e2ee7077916f023ba44\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KANDRAJU NAVEEN KUMAR\",\n \"rollnum\" : 160115733329,\n \"sent\" : true,\n \"year\" : 3\n },\n \"6b0bf353ddc9083fb87f076115da0c77316e73d6ffcf9fe46b3ad6375b8b9e2c\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MUDAVATH RUPESH\",\n \"rollnum\" : 160115733105,\n \"sent\" : true,\n \"year\" : 3\n },\n \"6b0c5808d8adac10cabd2fdb3aca9f98e70eafce9a25b8a4505b61a2e0bb8c24\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MUNGELKAR SUPRIYA\",\n \"rollnum\" : 160114733324,\n \"sent\" : true,\n \"year\" : 4\n },\n \"6b787aeed62b38a419d2a2f83f75bfffd9c447c907957c236a93b4bf3459028a\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NALLALA SANDEEP KUMAR\",\n \"rollnum\" : 160115733169,\n \"sent\" : true,\n \"year\" : 3\n },\n \"6baded8d3b2da99f0c2c36fb89ee52216c7a00568b7fab4739421f94beb0d8af\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DEEPIKA M\",\n \"rollnum\" : 160116733065,\n \"sent\" : true,\n \"year\" : 2\n },\n \"6bc9ca7c7ea5758fc81e8290fe2eeb0d66c82e45338c2f041ce61592706360aa\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HARSHITHA PATEL V\",\n \"rollnum\" : 160116733129,\n \"sent\" : true,\n \"year\" : 2\n },\n \"6d250599f408025e73bebabbcc6ada00f43408606448d20dd0e844c70898c633\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"NAVNEETH NAIK R\",\n \"rollnum\" : 160116733098,\n \"sent\" : true,\n \"year\" : 2\n },\n \"6dd4e35810d27183c9d8e248cfd87d10d457a3d7a18891659249042ea5737ceb\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"ME472\",\n \"group\" : \"5\",\n \"title\" : \"Intellectual Property Rights\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VALLABHANENI NANDINI\",\n \"rollnum\" : 160114733012,\n \"sent\" : true,\n \"year\" : 4\n },\n \"6e085345e821378221efedeee86dba03cb1e8885088444886692d2bc54911b59\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MEGHANA REDDY BILLA\",\n \"rollnum\" : 160114733071,\n \"sent\" : true,\n \"year\" : 4\n },\n \"6ecc4406eb39ec3ad47696179bbba399e16b131aeb052485618e428af9ffa94b\" : {\n \"email\" : \"[email protected] \",\n \"name\" : \"PRASHANTH KUMAR K\",\n \"rollnum\" : 160116733165,\n \"sent\" : true,\n \"year\" : 2\n },\n \"6edb32f346fa293efce074f4bec8288963db7b48b8d7e5e62b981a18adfad07a\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KASHYAP VARUN\",\n \"rollnum\" : 160115733090,\n \"sent\" : true,\n \"year\" : 3\n },\n \"6f2bdb2e2206e2ad3fc2370c814da61bb397a3b5aed9f74d53645c3d99ed1d1b\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"RATHOD RAJU\",\n \"rollnum\" : 160114733165,\n \"sent\" : true,\n \"year\" : 4\n },\n \"6f47cdf5215004754fab99063c119ece401cc18d2cf7d21566df08b2af56ffae\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BUKKA SPANDANA\",\n \"rollnum\" : 160114733081,\n \"sent\" : true,\n \"year\" : 4\n },\n \"6f4db4f7bd30f41f742ef1ad03bd8c6d8c2328c5e242af186e8aec71eb31976e\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ROSHINI REDDY M\",\n \"rollnum\" : 160116733071,\n \"sent\" : true,\n \"year\" : 2\n },\n \"6f6d96eeed6519f40daa0ffc1e9ea7cb82c4397359039f905db2644a1a165d43\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"T V ABHISHEK\",\n \"rollnum\" : 160115733081,\n \"sent\" : true,\n \"year\" : 3\n },\n \"6fb553886b7cbb0b827c4f58594bdc794410afbfdd785d969c8cceadbca61044\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"DASARI SHEETAL\",\n \"rollnum\" : 160114733330,\n \"sent\" : true,\n \"year\" : 4\n },\n \"6fee37a82fade805d354465cef4710919ad5814fb49d7e996f1b8223739547ff\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHEELA LAXMAN\",\n \"rollnum\" : 160116733327,\n \"sent\" : true,\n \"year\" : 2\n },\n \"702d85aa4074c076946a7e0c5eb8d234d8c260f66912992611a26d9a544b13a0\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VISHESH REDDY SRIPATI\",\n \"rollnum\" : 160114733120,\n \"sent\" : true,\n \"year\" : 4\n },\n \"703ea6da5ae394a79cde5e87cee0d7d802df7e93405d536bf887f8839795382a\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"CHINTHA SAI SOWMITH REDDY\",\n \"rollnum\" : 160115733111,\n \"sent\" : true,\n \"year\" : 3\n },\n \"70e5d608061bc2fc2729b5a8b2cb7d892c04e20fc2f8244447128819b3a4028d\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS354\",\n \"group\" : \"3\",\n \"title\" : \"Simulation and Modeling\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ROHITH CHANDRA CHEEPURI\",\n \"rollnum\" : 160115733046,\n \"sent\" : true,\n \"year\" : 3\n },\n \"71871121c5420ca08356fc384162e5c11f4ca1fc881367800df86c02ab26a2b6\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"AMITH KUMAR TUMU\",\n \"rollnum\" : 160114733029,\n \"sent\" : true,\n \"year\" : 4\n },\n \"71ec549bfd532ac8124ba0d79f4c58e3df4a36424808e82c6f579176918e5396\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KASIREDDY MEGHANA\",\n \"rollnum\" : 160115733327,\n \"sent\" : true,\n \"year\" : 3\n },\n \"71f1636b92c7487b60cc34c6631a54fe20667e322305150125866d4dc557dd54\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SANKRANTHI TEJADITYA\",\n \"rollnum\" : 160114733058,\n \"sent\" : true,\n \"year\" : 4\n },\n \"723cc6cb3b7ffee384e561aca3e337181f174d113aac136b81f2eaff352293a6\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PALLIPAT SAI TEJA\",\n \"rollnum\" : 160115733051,\n \"sent\" : true,\n \"year\" : 3\n },\n \"72a55c0e7a810bc53fcc173cff7e469fc7777e099ac543914827439b9418ae10\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"FARAH UZMA\",\n \"rollnum\" : 160114733127,\n \"sent\" : true,\n \"year\" : 4\n },\n \"72fbf54b1c8aabddb2acebd30a4bb0012a150b726a949dc4072ce605b0f571e7\" : {\n \"email\" : \"\",\n \"name\" : \"MOHAMMED ANAS ASHFAQ\",\n \"rollnum\" : 160115733095,\n \"sent\" : false,\n \"year\" : 3\n },\n \"7342e0d6e60ae6f946ad735fbe26b14349332c3efe35c320e50e147e7ba7b5a7\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"CHELAMELA SAI VIKHYATH\",\n \"rollnum\" : 160115733052,\n \"sent\" : true,\n \"year\" : 3\n },\n \"73913c7204eec8815e53b0df0303fa1c3949d8a0a6b800f5352d717644d65ecd\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"AKASH S\",\n \"rollnum\" : 160116733022,\n \"sent\" : true,\n \"year\" : 2\n },\n \"73cbd1b76323c99b487e66ce4d7c3fd5574039bd1630fad27a3edf8cf0c9586a\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BANOTHU SOUNDARYA\",\n \"rollnum\" : 160114733318,\n \"sent\" : true,\n \"year\" : 4\n },\n \"744d7b5c1ffd3b8f03d66d89c366c7a27ede4f15deb8c8eab16988c51b319ad3\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DATTA SAI TANUJ V\",\n \"rollnum\" : 160116733086,\n \"sent\" : true,\n \"year\" : 2\n },\n \"74e4fd9dcb7f817153e69b55aa47bff97634f286b966c6eddb0d66731af35f2f\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"VOGIREDDY SAI LAKSHMI KEERTHANA\",\n \"rollnum\" : 160115733011,\n \"sent\" : true,\n \"year\" : 3\n },\n \"7552796ecc1d9106dd495808bc64adb59886fb6258d81727894d62269c735768\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"REDDY SHETTY REKHA\",\n \"rollnum\" : 160114733013,\n \"sent\" : true,\n \"year\" : 4\n },\n \"7557bdc84128bc5afd70caa1c0ae4a1aa224a42aea4ffd7965a1caa0973da293\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE02\",\n \"group\" : \"2\",\n \"title\" : \"Principle of Programming Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"USHA RANI B\",\n \"rollnum\" : 160116733020,\n \"sent\" : true,\n \"year\" : 2\n },\n \"75aeedcaa3437483a961e69906edddc749242c25336942e9979b26ab183f1b50\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PRANAV D\",\n \"rollnum\" : 160116733042,\n \"sent\" : true,\n \"year\" : 2\n },\n \"76890f38a558160de91f7d4ff351a57f3fda9a72cea83e77c9de0ff8544e3eff\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"AKHIL KRISHNA CH\",\n \"rollnum\" : 160116733081,\n \"sent\" : true,\n \"year\" : 2\n },\n \"7719cb1ba0b398185d3a71b5183aee1b4807609d9b866240a018fdf822a095b3\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KUMBHAM SAI CHARAN\",\n \"rollnum\" : 160115733165,\n \"sent\" : true,\n \"year\" : 3\n },\n \"771c12e250a67c0fc74abeffdd4bc90e43bdf297e1b8357954ad655bcd8b5836\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAI VEERA VENKATA ABHIRAM S\",\n \"rollnum\" : 160116733168,\n \"sent\" : true,\n \"year\" : 2\n },\n \"776bb657d713aa84036086f5f12b6bef3776ef98e9b588d380a05427047afbc4\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NEHITH YADAV B\",\n \"rollnum\" : 160116733099,\n \"sent\" : true,\n \"year\" : 2\n },\n \"77c6506fe971fa024cd25a93c80c3852f4f58e0e68aa34197e22bbf57647b1cc\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DASOJU BHARATH\",\n \"rollnum\" : 160114733327,\n \"sent\" : true,\n \"year\" : 4\n },\n \"782275f9705f036f674f675091cfb5884af27330d57938ebfc73a020a4490d0d\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"prabhandha1998 @gmail.com \",\n \"name\" : \"MANKALI PRABHANDHA\",\n \"rollnum\" : 160116733334,\n \"sent\" : true,\n \"year\" : 2\n },\n \"7848d4628f445f0c4bf1778d564341d7749955b71a0cc0e150809ea78f5088ff\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SATVIK KALYAN G\",\n \"rollnum\" : 160116733106,\n \"sent\" : true,\n \"year\" : 2\n },\n \"791ec90712cbea2ba1b08a87ee2fc793c6514c106a0cf859c435d933839f749a\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"AMIT SARMA\",\n \"rollnum\" : 160114733090,\n \"sent\" : true,\n \"year\" : 4\n },\n \"7932606e25b55a00adb7159f6f35a2574a61bb99fa383b4b9e5ccd92fa1c344a\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"TAJ TANVEER RAZA\",\n \"rollnum\" : 160114733171,\n \"sent\" : true,\n \"year\" : 4\n },\n \"79be9779024117e32d53f09e9bf2f89e24b3aa3a449b5a2ece73523498f8eed7\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SANKE KEERTHI\",\n \"rollnum\" : 160115733004,\n \"sent\" : true,\n \"year\" : 3\n },\n \"79df103183a560393c630c989f46137fb19211a66f6cdebd943003f602f1a11f\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ACHANTA CHANDANA\",\n \"rollnum\" : 160114733064,\n \"sent\" : true,\n \"year\" : 4\n },\n \"7a7faba4b418cb55cf5c82417e82be8edf04120f082bfd0637e04c74c5a92fb3\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PALAVARAPU DEEPAK\",\n \"rollnum\" : 160115733152,\n \"sent\" : true,\n \"year\" : 3\n },\n \"7b235933ef7882392f82d7e8533ad6ece3fdd3b7cb9d6a6e4c40c9a55884abdd\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PRANAY M\",\n \"rollnum\" : 160116733163,\n \"sent\" : true,\n \"year\" : 2\n },\n \"7b49ed9544dee54b80d7767d4271076b14b5c1c744830f9dcffb748d095f6232\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VINEETH REDDY PATI\",\n \"rollnum\" : 160115733060,\n \"sent\" : true,\n \"year\" : 3\n },\n \"7b53bfb9d13cdd0aa31f99c1513b1eddbd59b04f7a7cefe37b24de96865863b7\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BADALGAMA MANOJ KUMAR\",\n \"rollnum\" : 160115733093,\n \"sent\" : true,\n \"year\" : 3\n },\n \"7b6b111eac937983bacae3d93e988605536e520149ee5d86e607d47161be4215\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PURANIK KOMAL\",\n \"rollnum\" : 160115733127,\n \"sent\" : true,\n \"year\" : 3\n },\n \"7beb16d2a8052ccce221db781519a97ad2950ca2039fb5681e43c07521d93452\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GANESH A\",\n \"rollnum\" : 160116733156,\n \"sent\" : true,\n \"year\" : 2\n },\n \"7c119ae2d9ebfff5f96f3cc5cecb7aefd82e124cfe5af696fa2b8c290d1fdbce\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KANAPARTHI VINEETH RAO\",\n \"rollnum\" : 160115733119,\n \"sent\" : true,\n \"year\" : 3\n },\n \"7c1a312bed2c172545d3e8a4af8ef1181d2502f54f0ba8843bc053682158c403\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MADHU BAJAJ\",\n \"rollnum\" : 160114733008,\n \"sent\" : true,\n \"year\" : 4\n },\n \"7c5fb89aaf75a90f7ffbb58c6d2806206a946099ffb84db57bcf16d304431879\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"SAI HARIKA B\",\n \"rollnum\" : 160116733137,\n \"sent\" : true,\n \"year\" : 2\n },\n \"7c7f87061f584f7f118c3144b3dd1c1bdab36a9cd75a6bb788d545aed6335de4\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MUTHYARAGALLA KRISHNAVENI\",\n \"rollnum\" : 160114733069,\n \"sent\" : true,\n \"year\" : 3\n },\n \"7c8e46c9abd234a23d1e445da7cba0f326ab1d847dde63d5e205effda56c7935\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SRIKRISHNA PRADEEP J\",\n \"rollnum\" : 160116733173,\n \"sent\" : true,\n \"year\" : 2\n },\n \"7c8e918e2f41005a45efe43f4b04048cd86bef61d8522294da3db65990e82a90\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BURRU MEHER HARSHINI\",\n \"rollnum\" : 160114733310,\n \"sent\" : true,\n \"year\" : 4\n },\n \"7cb70d16f9a791e9a4ae87bab4afa035802e284d4160c68cdcdb90f16129dd6c\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"N HIRAN MAI\",\n \"rollnum\" : 160114733128,\n \"sent\" : true,\n \"year\" : 4\n },\n \"7ce2dbfdea1156adb2fccfbac2fc79fa7f9fa822a8724367223f4d90bd1be12c\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NAVYA G\",\n \"rollnum\" : 160116733009,\n \"sent\" : true,\n \"year\" : 2\n },\n \"7dfdd0518c8b77b043f89c95a6db58ee9e4b8e45b49ea2ae22e26a0c80d8924f\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BIJJA RAMYA\",\n \"rollnum\" : 160115733136,\n \"sent\" : true,\n \"year\" : 3\n },\n \"7ecb31f8871b93d8ff7a4692ab519098bb4b0e2c540fee3d3d235384a9ad183a\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"DUDLA SRAVANI NIHARIKA\",\n \"rollnum\" : 160114733143,\n \"sent\" : true,\n \"year\" : 4\n },\n \"7f29c8e2b9a55bffca2a3a3b3822ffcd1f4012328f5e35f850d1e6a3f304103b\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"LEKKALA RAHUL BABU\",\n \"rollnum\" : 160114733047,\n \"sent\" : true,\n \"year\" : 4\n },\n \"7f4992bb1c2851ed91f8a717200bb1902e5ea030b1b96637ffcd077822a9e8e0\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"D DEVENDRANATH\",\n \"rollnum\" : 160115733028,\n \"sent\" : true,\n \"year\" : 3\n },\n \"7fa269aecaa3e49d24fcb0fd4863724a2f0911d8312fda6973dd08a0d2e29ebd\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"RAMESH M\",\n \"rollnum\" : 160116733101,\n \"sent\" : true,\n \"year\" : 2\n },\n \"80382199f9ad8c6ee2342b8b72297e84af7c6b8517ccadc7c308a24041929399\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HARIKA B\",\n \"rollnum\" : 160116733066,\n \"sent\" : true,\n \"year\" : 2\n },\n \"8050ac86516ade98f7a72162f5ff42432f882ab529694d0f5939473cd27209e3\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"VAISHNAVI P\",\n \"rollnum\" : 160116733150,\n \"sent\" : true,\n \"year\" : 2\n },\n \"805d9071d93ffd14b7730216fff55caa1e13c2e100eb6182586b29edd5f82235\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KAITHA ABHINAY REDDY\",\n \"rollnum\" : 160114733026,\n \"sent\" : true,\n \"year\" : 4\n },\n \"80724155d98b66d50d6ce032510aa403b7fad70b427972632914bae1319e1e3a\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ABHISHEK JAISWAL C\",\n \"rollnum\" : 160116733094,\n \"sent\" : true,\n \"year\" : 2\n },\n \"80e6b52c0131bfe8e4e65d2627948699e38cb45786cff2a99009c5c6b115481b\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"POTLAPALLY ACHYUTH\",\n \"rollnum\" : 160115733151,\n \"sent\" : true,\n \"year\" : 3\n },\n \"83149f643631b06d8cf8fb45ae2c64bdb27df58566b0ab399cba818a050d8ed1\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS484\",\n \"group\" : \"5\",\n \"title\" : \"Business Intelligence\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NAYANA PRAVALIKA\",\n \"rollnum\" : 160114733135,\n \"sent\" : true,\n \"year\" : 4\n },\n \"835bf7c1009760bb67e2e2645cd1d3a1bc974545131e58c02c628100cfb896ec\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"UPPALA SHRAVYA\",\n \"rollnum\" : 160114733077,\n \"sent\" : true,\n \"year\" : 3\n },\n \"839f07f45a8148bbebe5aa6d2e61ae3310652fa57545f9393cef6da6df64fc93\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KAMATALA SHRAVANI\",\n \"rollnum\" : 160115733302,\n \"sent\" : true,\n \"year\" : 3\n },\n \"844544d3cdc785dc419f2fceeec45edb2b275a384e9a10bdf4f6f3508aba8d29\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MOHAMMED AIJAAZ\",\n \"rollnum\" : 160114733159,\n \"sent\" : true,\n \"year\" : 4\n },\n \"84809a4cca35bb04c1c8a48e258d1d88564c09409b3235cb5889558b6708ef90\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ANEES FATIMA KHAN\",\n \"rollnum\" : 160116733061,\n \"sent\" : true,\n \"year\" : 2\n },\n \"84b4925c9bc8194af2a5f96c3a9a424a44d5d5798d97cf2b73ba5e235e5d824c\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KAVUTURU HARSHA VARDHAN\",\n \"rollnum\" : 160115733156,\n \"sent\" : true,\n \"year\" : 3\n },\n \"85b41a08ccb349790a5b20be2e49983d69e16d31da1fc6cff3d5beba4e1f0bf3\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"CHANDRAMOULI P\",\n \"rollnum\" : 160116733025,\n \"sent\" : true,\n \"year\" : 2\n },\n \"86600903d174b6d1faa1e3af95e8c441728f7495c92441230cba15cdeae8ca27\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"EPURI HARI CHANDANA\",\n \"rollnum\" : 160114733006,\n \"sent\" : true,\n \"year\" : 4\n },\n \"86687dccbaecd7f0f4f22473b1c60e0725bf7e7cc632fb38f3bda956a3a9d51c\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"CHINTHA UDAYKUMAR\",\n \"rollnum\" : 160114733332,\n \"sent\" : true,\n \"year\" : 4\n },\n \"869cc3f4026a106d8a799c6fe82882487cd2a28fea246cc5f7fea77930376f8c\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"LEKKALA SHASHIKANTH REDDY\",\n \"rollnum\" : 160115733172,\n \"sent\" : true,\n \"year\" : 3\n },\n \"86e01514e786d7880e00d44d2ea8d00892d66b1066d2ee99c65eef46d6257646\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KOMARAVELLY RAHUL\",\n \"rollnum\" : 160115733044,\n \"sent\" : true,\n \"year\" : 3\n },\n \"87476dd894769d24ec9fb8b02959b69b0e5ab7b80033fd83bf0dad0a45f0349b\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"BHANU TEJA K\",\n \"rollnum\" : 160116733154,\n \"sent\" : true,\n \"year\" : 2\n },\n \"87590e57754b1a6346e4440d77fe4a81ffe1106935e3ebdb03243aa2d250a712\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KOMMU SRIAKHIL\",\n \"rollnum\" : 160115733174,\n \"sent\" : true,\n \"year\" : 3\n },\n \"8767c40ebee079be2339c7c61d87188de3f98927f09b616684fbbb8622af9568\" : {\n \"email\" : \"\",\n \"name\" : \"KONDA NIKHIL AASHRAY REDDY\",\n \"rollnum\" : 160114733161,\n \"sent\" : false,\n \"year\" : 3\n },\n \"87a7da1cb227db679c30ac7e34bc658ccaa3bb05cd66e0cb1368d322d2f02495\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"RAVIKANTI DEEPTHI\",\n \"rollnum\" : 160114733125,\n \"sent\" : true,\n \"year\" : 4\n },\n \"87b8ed059f7491dfe3128dac2c7186a8c232771fc0876352d303b2f52ff1b451\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE02\",\n \"group\" : \"2\",\n \"title\" : \"Principle of Programming Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HAMSA RAJ T\",\n \"rollnum\" : 160116733090,\n \"sent\" : true,\n \"year\" : 2\n },\n \"8873a9065161fdcb74fa5ecd190019e0f717d21a93c86a7ab5341e30f8a82865\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DEEPIKA DAMISETTY\",\n \"rollnum\" : 160114733003,\n \"sent\" : true,\n \"year\" : 4\n },\n \"88c77d39eb1daedb64b2edc939e4891bb87831d7eb91b6ac226fb2ba45a30387\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BINGI SAMRAT\",\n \"rollnum\" : 160115733168,\n \"sent\" : true,\n \"year\" : 3\n },\n \"88d421f5f2c851d201a37d9a6030876d9f69746d14e0a58e09986096093d25f7\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"RAMAVATH SAI KUMAR\",\n \"rollnum\" : 160115733166,\n \"sent\" : true,\n \"year\" : 3\n },\n \"89003b32a28b53b19455f3f117e52651bdbd96cf8374866d53ee42667f493263\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ALLEGALA VISHAL YADAV\",\n \"rollnum\" : 160114733308,\n \"sent\" : true,\n \"year\" : 4\n },\n \"89104f7c46e1476cce6fe45e7de1a1c95a48f6ee3c9cd6b9a08d15a21177cb03\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MADHURI G\",\n \"rollnum\" : 160116733006,\n \"sent\" : true,\n \"year\" : 2\n },\n \"899478c515b7a0e25f84203a6eb0e5a773684a3b3f388f356eb223831c16a4c1\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VUPPALA MANISH\",\n \"rollnum\" : 160114733100,\n \"sent\" : true,\n \"year\" : 4\n },\n \"899c4d40e3c1d0cfbad75daba1dff69a2db08a315970fe5a83a536818f7ed828\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GANGAM SIRI CHANDANA\",\n \"rollnum\" : 160114733017,\n \"sent\" : true,\n \"year\" : 4\n },\n \"89cb3f332812e4d2c24c9406c97dfc5c80749a6b2b8f6ac6d19ef0811be9a1fd\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"ANIL KUMAR K\",\n \"rollnum\" : 160116733083,\n \"sent\" : true,\n \"year\" : 2\n },\n \"8a945c58ade19e92e9ddeb3fa8519e1dea4ee7d8a8b1b29db96e3d909342c9c2\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DOMAKONDA MADHUKAR\",\n \"rollnum\" : 160115733159,\n \"sent\" : true,\n \"year\" : 3\n },\n \"8ba63f8ec8f0d72bb2bc313869d400e90c0693ca85a27df79fef163599ab404f\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHALINI K\",\n \"rollnum\" : 160116733013,\n \"sent\" : true,\n \"year\" : 2\n },\n \"8cd32048da496a047221d41dd06dac29a4dc40ecceeda9dd9486d30f6720f9ba\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"KASAM VINAY\",\n \"rollnum\" : 160114733178,\n \"sent\" : true,\n \"year\" : 4\n },\n \"8d19d2aa0b4c52c3c72a05016ffb04b90b0ce4630e7d4f2fe75bb5d342fd2baf\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ARPITHA T\",\n \"rollnum\" : 160114733002,\n \"sent\" : true,\n \"year\" : 4\n },\n \"8d230b7f0a7b32760bb3add5a21e35e02f87b01318a1fd40ab6af8a03c289054\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SURAJ KUMAR J\",\n \"rollnum\" : 160116733175,\n \"sent\" : true,\n \"year\" : 2\n },\n \"8da7046ed621d054980ece846d87896dee285f367351138925cd032d44afeb32\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHEFALI SHIREEN\",\n \"rollnum\" : 160115733075,\n \"sent\" : true,\n \"year\" : 3\n },\n \"8db8a82004cea044ba99de333e3ca1ff6069e45d33e0064b8f23a00d526745d1\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VINEETH REDDY S\",\n \"rollnum\" : 160116733117,\n \"sent\" : true,\n \"year\" : 2\n },\n \"8e18f8fb62278b9017f7d4dc30c4ca05c540a59272d66f4b15945fbea2b379af\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"CHINTHAMALLA PRANEETH\",\n \"rollnum\" : 160114733045,\n \"sent\" : true,\n \"year\" : 4\n },\n \"8e2a3eef27ca759895a0d372054a37815da46da65abf309d6220601383affa25\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ARUTLA DEVAK SAI\",\n \"rollnum\" : 160115733027,\n \"sent\" : true,\n \"year\" : 3\n },\n \"8e84193ff4fd34b58ebbf4d11b956a5c0493f8d571068457f4c0a4efee63e14f\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BHAMIDIPATI PAVAN MANOJ BHARGAV\",\n \"rollnum\" : 160114733044,\n \"sent\" : true,\n \"year\" : 4\n },\n \"8ff79c283fcced6fc6acb4cd80da53982a7e3d925c4b07e54c63b038ff7fb6d8\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HARIKA SANTHOSHI P\",\n \"rollnum\" : 160116733126,\n \"sent\" : true,\n \"year\" : 2\n },\n \"90305f7ca52c040778bd752a0efe6c7eef5642ec99f3a02e534cc7134ecab73d\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VINNAKOTI AAKANKSHA\",\n \"rollnum\" : 160115733061,\n \"sent\" : true,\n \"year\" : 3\n },\n \"90aaaa5b53f9f18ab682a91abf330d1bb82a1f1d3c939cf86a62db38c8f8ddac\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"EDLA SOUMITH REDDY\",\n \"rollnum\" : 160115733113,\n \"sent\" : true,\n \"year\" : 3\n },\n \"90c313deb5662a64f5a5d1ca3759aa14c9146f42b23ec9627173469fee6eb372\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SATYASRILAKSHMI V\",\n \"rollnum\" : 160116733074,\n \"sent\" : true,\n \"year\" : 2\n },\n \"90d2abde20d372bd11ef11401f6e5b7ef031b81e7a1ef33ee54a0188bf9cea36\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GONURU SAI KUMAR\",\n \"rollnum\" : 160114733302,\n \"sent\" : true,\n \"year\" : 4\n },\n \"90eaa652f9d2de777fb981c9c0ce11c4343126dc981ee6adb664db22b06b536d\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MOVVA HEMANTH\",\n \"rollnum\" : 160114733037,\n \"sent\" : true,\n \"year\" : 4\n },\n \"924cc9f6ba64cc114bd3d9d56234d1d370506fe895d49bfede4d8a56bf43848d\" : {\n \"email\" : \"\",\n \"name\" : \"J ADARSH\",\n \"rollnum\" : 160114733028,\n \"sent\" : false,\n \"year\" : 3\n },\n \"92622a343e2bab27e27d1fa7f998d3ebcf3e987eb2bd408a56be2b1872f5cd13\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ESLAVATH NAGALAXMI\",\n \"rollnum\" : 160116733311,\n \"sent\" : true,\n \"year\" : 2\n },\n \"92c53d0805c35607469028dbd3ad9069fdf846b9206a4b61ced7ae4ddfbf78dd\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KOTHA RAGHAVENDRA RAO\",\n \"rollnum\" : 160115733042,\n \"sent\" : true,\n \"year\" : 3\n },\n \"93dc0a389094f56c5a3dca645d15bb28086fe9c0adea930f961bb93114f0be93\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MORAMPUDI MANISH CHANDRA\",\n \"rollnum\" : 160116733322,\n \"sent\" : true,\n \"year\" : 2\n },\n \"948129c73e41202ac0f5eb8f31adfdd37e260842ae1884986626b5ba45c08b19\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GAREPALLI NIKHIL KUMAR\",\n \"rollnum\" : 160116733186,\n \"sent\" : true,\n \"year\" : 2\n },\n \"94df7bba3c381c50da33bd2cd4914a9ccf1ac494129de6a85dcff020f3066b4c\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"JANAGAMA SHRAVANI\",\n \"rollnum\" : 160115733317,\n \"sent\" : true,\n \"year\" : 3\n },\n \"9533ee3a6ce1b797f2342177cbad16c01127a8eb208d432cdfa581527f1c908a\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE02\",\n \"group\" : \"2\",\n \"title\" : \"Principle of Programming Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAI KRISHNA CH\",\n \"rollnum\" : 160116733051,\n \"sent\" : true,\n \"year\" : 2\n },\n \"956dfe4f5abe06e270b121f2808ecc7448011496277d89e8b7179898e24db555\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"D AVANTHIKA SHREE\",\n \"rollnum\" : 160115733065,\n \"sent\" : true,\n \"year\" : 3\n },\n \"95df16d90d50289a44cf1e3bffdaaf3fedefea7b6697d7a4ef3878f56a1b3d42\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NIKITH R\",\n \"rollnum\" : 160116733038,\n \"sent\" : true,\n \"year\" : 2\n },\n \"962c96f3363f0d66599450231b5dfbf288d15c37e27ce5e395467ebe99872c67\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"CHINTHALAPUDI SAI ANISH\",\n \"rollnum\" : 160115733047,\n \"sent\" : true,\n \"year\" : 3\n },\n \"96ef254597b791aa6d9a1e38290485e2214719c6164bda4162b31da88c07b356\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS475\",\n \"group\" : \"4\",\n \"title\" : \"Human Machine Interaction\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PALETI BHAGEERADH\",\n \"rollnum\" : 160114733031,\n \"sent\" : true,\n \"year\" : 4\n },\n \"970d7aa2c2ffed24d52506d9d8058ec10f5244a2d7be9d5b7a18328f2f088496\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ASRA NASEEM\",\n \"rollnum\" : 160115733002,\n \"sent\" : true,\n \"year\" : 3\n },\n \"971e7e1e2f239467f7568cbc01744b591ab93f94a2dcd0e7d33cec7a0066fe8f\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"G GREESHMA\",\n \"rollnum\" : 160114733005,\n \"sent\" : true,\n \"year\" : 4\n },\n \"97ad54bc81f39daf3df47995077b4e31270aa07376e55c4e19f144b86bb8589e\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HARIPRIYA R\",\n \"rollnum\" : 160116733128,\n \"sent\" : true,\n \"year\" : 2\n },\n \"97d3036ca0e3fc1bcee07f45751b253bf0fc650f5c1a756a12a3117bf7143c1a\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"K MONICA\",\n \"rollnum\" : 160115733006,\n \"sent\" : true,\n \"year\" : 3\n },\n \"97f8297e6a9c355987660cf9dcc676bb09aee3a952dbdccde3d12a175743e2b3\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NEELAALA HARIKRISHNA\",\n \"rollnum\" : 160114733331,\n \"sent\" : true,\n \"year\" : 4\n },\n \"982a55beb650547ab2353e9baab6c84045a22bbe0e4860bc3e39a386808e6b15\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"SAINATH REDDY\",\n \"rollnum\" : 160114733168,\n \"sent\" : true,\n \"year\" : 4\n },\n \"98c27242e49078cdfe0ef494e4aeb9e521f95bd2e1c395ae047338c1dc90b6f4\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE03\",\n \"group\" : \"2\",\n \"title\" : \"Shell Scripting\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SIDDHARTHA A\",\n \"rollnum\" : 160116733054,\n \"sent\" : true,\n \"year\" : 2\n },\n \"997a0fab6924c48fbda7e2e77583ff9d7a5b59b0ce62bcd741f6d7e4546b99df\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VANGARI PALLAVI\",\n \"rollnum\" : 160115733133,\n \"sent\" : true,\n \"year\" : 3\n },\n \"998c568b8eedb7eb76ebdf457f865ec9147dd5d6a03442017105efc9abdade92\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GURRAM NITHIN\",\n \"rollnum\" : 160115733318,\n \"sent\" : true,\n \"year\" : 3\n },\n \"99a0341674ac5dbda681ef26a53ce9397c8c46c01f63caee88ac38129948a32f\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"JACOB ABHISHEK T\",\n \"rollnum\" : 160116733093,\n \"sent\" : true,\n \"year\" : 2\n },\n \"99de2184bf187db07f73542ed6f89cc21a2f067dfba19a98489b13f1fe6cb6a4\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MYLARAPU ASHVIK\",\n \"rollnum\" : 160115733086,\n \"sent\" : true,\n \"year\" : 3\n },\n \"9a087a29f71843ac9602768229ee6a246c7fd67b0ab0b6386ffd6ee6313ba56f\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"A VINEELA\",\n \"rollnum\" : 160114733146,\n \"sent\" : true,\n \"year\" : 4\n },\n \"9a169b577839ac64c223f7589da98f98fe4219e343a0785665a0ad98f995d187\" : {\n \"email\" : \"\",\n \"name\" : \"K BHARATH\",\n \"rollnum\" : 160115733025,\n \"sent\" : false,\n \"year\" : 3\n },\n \"9aad0d64765e9c8ce334e445f04c41c5ca7d05ec990c605e689ac597c77d2a7e\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MOHAMMED EHTESHAMUDDIN\",\n \"rollnum\" : 160116733317,\n \"sent\" : true,\n \"year\" : 2\n },\n \"9ac86ac32002582f8707a5c8268da58eeb7e28f4e9dddb1ad8def2129df15fcb\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NIKITHA KRISHNA VEMULAPALLI\",\n \"rollnum\" : 160115733073,\n \"sent\" : true,\n \"year\" : 3\n },\n \"9b40b38cbd8372c624881a9164cfc6a7ce59df4902ac3f31fcf6b547f369fe31\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS481\",\n \"group\" : \"5\",\n \"title\" : \"Pattern Recognition\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"K AJIT SAI\",\n \"rollnum\" : 160114733086,\n \"sent\" : true,\n \"year\" : 4\n },\n \"9b437e215b1145de7411d1f6122d1c0c8af60b18eb430871ff6b36fd8d897e39\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MEKALA SHIVCHETAN\",\n \"rollnum\" : 160114733114,\n \"sent\" : true,\n \"year\" : 4\n },\n \"9b6c62cd3696897bc035755023fcd6ee5e1c02f7dd26f3aa8d30a64b207a0ca5\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MOHAMMED SYED AKBAR HASHMI\",\n \"rollnum\" : 160116733096,\n \"sent\" : true,\n \"year\" : 2\n },\n \"9b7eabdf146c0ee4779945a92182cd782adc40ba994f8fe26c38498ce0e12e04\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SREEVANI D\",\n \"rollnum\" : 160116733145,\n \"sent\" : true,\n \"year\" : 2\n },\n \"9b9425a75f53a33a335779a35dbf70147068369f15670c84e85ae87e7bcd3f7e\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MOHAMMED SARFRAZ KHAN PATTAN\",\n \"rollnum\" : 160115733096,\n \"sent\" : true,\n \"year\" : 3\n },\n \"9bddd4ec220f7db3938e49d5c36ec22213d9d9bab6bc19f143f5c5c3700a4c56\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VENKATA VAMSHI KRISHNA\",\n \"rollnum\" : 160114733119,\n \"sent\" : true,\n \"year\" : 4\n },\n \"9c1a9bf75037683196bd96823be575a14155f9b79c53832d998fe905c7689dac\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SOUNDARYA TEKKALAKOTA\",\n \"rollnum\" : 160114733019,\n \"sent\" : true,\n \"year\" : 4\n },\n \"9ca2a4d9e4f42a65e2e06b05ac9663df75e552d08202d47df4fb9fedc0b8eb4b\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MAMIDI SACHETH REDDY\",\n \"rollnum\" : 160115733163,\n \"sent\" : true,\n \"year\" : 2\n },\n \"9d583beee09acad367b706a5e5ef985d4efaba555cdf4849bf68f2bb61a05db4\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VELPULA SRAVIKA\",\n \"rollnum\" : 160114733335,\n \"sent\" : true,\n \"year\" : 4\n },\n \"9dd10d1691ad76a7186f972a4787523d5e097e6f4bec2798fee6ce714c9ccfc4\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"VISHAL V\",\n \"rollnum\" : 160116733118,\n \"sent\" : true,\n \"year\" : 2\n },\n \"9e86ea44ef91d4c4b90200f28e0e54a50c977736132d0621384122a0b99ff448\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SUSHANTH KUMAR P\",\n \"rollnum\" : 160116733112,\n \"sent\" : true,\n \"year\" : 2\n },\n \"9e8aba98aa3bd83cd761e9bfec40f52f227031e7271cfb1b4b2eb96e6b58a706\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HARSH M\",\n \"rollnum\" : 160115733182,\n \"sent\" : true,\n \"year\" : 3\n },\n \"9f1dbb66f6973a1c62c92adc7df85ce9763d37fb014d47ff7a0de3acea25b16d\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ARKIT SAHITHI REDDY\",\n \"rollnum\" : 160115733138,\n \"sent\" : true,\n \"year\" : 3\n },\n \"9f80bc7aaa25185732438464f00d156650de71ee3576b93e3a83572ba6c8bb04\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"AMGOTH RAJU\",\n \"rollnum\" : 160116733321,\n \"sent\" : true,\n \"year\" : 2\n },\n \"9f87521d51d47bddf31ae8d188a75f76e40ac92f187787836d1b21e837798156\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"S MANISH KUMAR\",\n \"rollnum\" : 160115733092,\n \"sent\" : true,\n \"year\" : 3\n },\n \"a148ac5d3bc47a07e871b3c9f2f0d33c8df83b10e133b535cc58520878c710b8\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS355\",\n \"group\" : \"3\",\n \"title\" : \"Realtime Systems\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"D PRASANNA\",\n \"rollnum\" : 160115733308,\n \"sent\" : true,\n \"year\" : 3\n },\n \"a199b3a45c04b9464b2e2a14b727f5ddd55082458a4931e27b2b04c72c187e80\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BUTHARAJU SRAVYA\",\n \"rollnum\" : 160115733076,\n \"sent\" : true,\n \"year\" : 3\n },\n \"a2df657fc6bfc07e21223bd7ac1f0f4367db70b9d223b5cd7bde4be55e45a8d8\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"JELLA NIKHIL BABU\",\n \"rollnum\" : 160115733160,\n \"sent\" : true,\n \"year\" : 3\n },\n \"a2eca3a3be7de1c7c0a3983266fdd7e2872e55830d400a602b87b7c164ad9427\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE03\",\n \"group\" : \"2\",\n \"title\" : \"Shell Scripting\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DEEKSHITH RAO V\",\n \"rollnum\" : 160116733087,\n \"sent\" : true,\n \"year\" : 2\n },\n \"a3a70ce0f3fe53987fc328be6ee4817aebbbd9553c013e204d1ba4a9140e7fd4\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HEMANTH SURYA THEJA CH\",\n \"rollnum\" : 160114733311,\n \"sent\" : true,\n \"year\" : 3\n },\n \"a3cce1a486b94e74a2b006f9835637d6de5c1f1848acfbe7c9e923c98ee7052c\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SRIRAMOJI NIKHITHA\",\n \"rollnum\" : 160114733134,\n \"sent\" : true,\n \"year\" : 4\n },\n \"a4225d02a6b86d939fa60b7451d877d993e572b8139e323edd137b43c5c793c6\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"TAMIZ B\",\n \"rollnum\" : 160116733177,\n \"sent\" : true,\n \"year\" : 2\n },\n \"a455f0269510ec3679e3b346c22a6b83c2387054a6d76817d72eb08c2cb0fa5c\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DUTA SRIRAMULU\",\n \"rollnum\" : 160115733320,\n \"sent\" : true,\n \"year\" : 3\n },\n \"a4987ef253c510eb07b9843dbb771f6f36c7e66175e4991f99de4fe21d04763e\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GUNDAPU GOUTHAM\",\n \"rollnum\" : 160114733035,\n \"sent\" : true,\n \"year\" : 4\n },\n \"a524be5921ce9b1fb363cf540bae77dc45cfbc124961e269f58b8924b615dcff\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"RAVI THEJA M\",\n \"rollnum\" : 160116733102,\n \"sent\" : true,\n \"year\" : 2\n },\n \"a5399efbd0a8bad08879ecbac46bdcf21d00d7bc832e55901c48dab07deb1a81\" : {\n \"email\" : \"\",\n \"name\" : \"SAIF ABDUL SUBOOR\",\n \"rollnum\" : 160115733334,\n \"sent\" : false,\n \"year\" : 3\n },\n \"a576d7cc1ac178eb35cf5f55e566683defa287979a02748094729e05426b2360\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SUJITH MANCHALA\",\n \"rollnum\" : 160114733336,\n \"sent\" : true,\n \"year\" : 4\n },\n \"a58d71413b0fa9ac9885e9b02e0dcc91eeb1b8740d5072774e3fdd378b98caaf\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"ESHWAR CHAITANYA G\",\n \"rollnum\" : 160116733089,\n \"sent\" : true,\n \"year\" : 2\n },\n \"a6413f85cfd227054af33e29de0aad48984c26d8a6966868f26b8d44adbb948e\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BANDARI MANOJ KUMAR\",\n \"rollnum\" : 160114733156,\n \"sent\" : true,\n \"year\" : 4\n },\n \"a64e66eec6c79583cbb379e46009f9ed31091343af5153cf440854bc7653b9a7\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SYED NAYAZ MOINUDDIN\",\n \"rollnum\" : 160116733059,\n \"sent\" : true,\n \"year\" : 2\n },\n \"a65d136713d433af33a42717a7620934e3214864f57ca7eddc69b3f865ddc8d4\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DAROOR SHARATH KUMAR\",\n \"rollnum\" : 160116733316,\n \"sent\" : true,\n \"year\" : 2\n },\n \"a77a2bf92cd3009999eac1aff7bd311ab26f857b5c4fbf48dbf8cd2f4c6af7fd\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"AISHWARYA ARE\",\n \"rollnum\" : 160114733062,\n \"sent\" : true,\n \"year\" : 4\n },\n \"a79dc9fdd0200a4568a85d4fb0fd96177f322a6a923d2880abc2f95051cffc2e\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE03\",\n \"group\" : \"2\",\n \"title\" : \"Shell Scripting\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MINI DEVAYANI D\",\n \"rollnum\" : 160116733132,\n \"sent\" : true,\n \"year\" : 2\n },\n \"a7ac39f4b842d543f7accd43b65eca4d00e05a604bac43b7125452f11971b359\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DEVIKA M\",\n \"rollnum\" : 160116733125,\n \"sent\" : true,\n \"year\" : 2\n },\n \"a9474dc9457eed0ad3cd449c2ed6e053f3f12319d7355903686574aebe9685ec\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KRISHNAVENI R\",\n \"rollnum\" : 160116733004,\n \"sent\" : true,\n \"year\" : 2\n },\n \"a94f69bd3c21313e7a31ae656028b304587714317d62e3acd08306b2ffcd52b5\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GANDAMALLA SONIYA\",\n \"rollnum\" : 160114733018,\n \"sent\" : true,\n \"year\" : 4\n },\n \"a9bcf6163328ad02443a0da59cc8179ae58eda796afe85a8aca462ad2d2a9f1e\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"YASHWANTH E\",\n \"rollnum\" : 160116733179,\n \"sent\" : true,\n \"year\" : 2\n },\n \"a9c2416ec9648f7efff6296bc6c71e5ef57f387fb56df02d95ae641d82dbdb31\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"SAI SREERAM POPURI\",\n \"rollnum\" : 160114733052,\n \"sent\" : true,\n \"year\" : 4\n },\n \"aa8dfab6bd6903f79eaf9c3b331dd69003f17f4739aa71f0326f9e08577b514b\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"YEDULA SUMEET\",\n \"rollnum\" : 160114733057,\n \"sent\" : true,\n \"year\" : 4\n },\n \"aaefd4ff5307cdfd67056e0ee2afb9a5521e3c0684930dd10a47bc0f83a6ac4b\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BHAVYA P\",\n \"rollnum\" : 160116733063,\n \"sent\" : true,\n \"year\" : 2\n },\n \"ab86c297be4a239ba249c4f571cdb2a6b14609aa08ff3f82e59a2cd117a8c4de\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NARAYANABHATLA VENKATA SAI DHEERAJ\",\n \"rollnum\" : 160115733117,\n \"sent\" : true,\n \"year\" : 3\n },\n \"ab995d17d35885120ba5a2d6b6292f54ce606b91a32b719f8ae512997643720b\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KYATHAM VISHNUVARDHAN\",\n \"rollnum\" : 160115733179,\n \"sent\" : true,\n \"year\" : 3\n },\n \"ac4dcc77bea9d7af0b7dc8e35b684b304e38e1e1311843eaa673400b5baa5285\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"LIKHITHA CH\",\n \"rollnum\" : 160116733068,\n \"sent\" : true,\n \"year\" : 2\n },\n \"aced89886bc51d1f4400e57aa288dda7d17ca3e53be153ee5544593f35c8927c\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"SHIVANI N\",\n \"rollnum\" : 160116733140,\n \"sent\" : true,\n \"year\" : 2\n },\n \"ada1e8d6180c6951c78d1ca453920e9aa7a15439931860353a20dcfc5473fad5\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"HARSHITH M\",\n \"rollnum\" : 160116733031,\n \"sent\" : true,\n \"year\" : 2\n },\n \"adb82399efd08981cc4d174c17f003308a20f85feb7fe3e97952b79f4c7f09bb\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NAGA OMKAR P\",\n \"rollnum\" : 160116733097,\n \"sent\" : true,\n \"year\" : 2\n },\n \"adefbfd7e1c7efa4cf1e062b5fc51db64fea2673c00d3a169062cb2dc067c68f\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"AVINASH L\",\n \"rollnum\" : 160116733153,\n \"sent\" : true,\n \"year\" : 2\n },\n \"ae2cbeca78412d63a0414204b0bfacf0b4724dc0b5e040c39c3f39b9e91a9da3\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"NITTURI SWASTHIK\",\n \"rollnum\" : 160116733332,\n \"sent\" : true,\n \"year\" : 2\n },\n \"ae5c1bded0d12ccbd8b6ac7ead22678549fc2bc39488c6bd754076d1bc9a30ca\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"CHINTAPALLI ANIL KRISHNA\",\n \"rollnum\" : 160115733084,\n \"sent\" : true,\n \"year\" : 3\n },\n \"aeb10e69348642082ff2a89d257f5624d2f231ca9ebd8b314039bc2f763fa9ea\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"SHAIK JUNAID MOHAMMAD\",\n \"rollnum\" : 160116733053,\n \"sent\" : true,\n \"year\" : 2\n },\n \"aecc773afe1e44df1cdb450f1ade725fcba793b5f4e401e0351cd4149c94333f\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VINUTHNA REDDY M\",\n \"rollnum\" : 160116733077,\n \"sent\" : true,\n \"year\" : 2\n },\n \"af01b260a11d8b7407c00b4f0948085db8443552ace6c870a6c0962dfcae6db5\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"PRANEETH N\",\n \"rollnum\" : 160116733164,\n \"sent\" : true,\n \"year\" : 2\n },\n \"af0e3fe398b2bccf1bdb597632c87c7b800cee1c58d023e1b89641da0bf01b7e\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NIDHI PUROHITH\",\n \"rollnum\" : 160114733132,\n \"sent\" : true,\n \"year\" : 4\n },\n \"af39aca86524dd826d85d4fec9fdf496fe245b7b5b1fe00805c2f5444c11175a\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"G LOHITH NURANI\",\n \"rollnum\" : 160116733183,\n \"sent\" : true,\n \"year\" : 2\n },\n \"afe014a6a837dc430c79bc593fc84d0b55f38585e873b79bdb7a9544ea7670a1\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAMHITA ALLA\",\n \"rollnum\" : 160115733013,\n \"sent\" : true,\n \"year\" : 3\n },\n \"b036b0e42cb460031f94cd85b5e272ac629a3be62678bcf4a46c10c4262d2d8c\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"P ANKITHA\",\n \"rollnum\" : 160115733122,\n \"sent\" : true,\n \"year\" : 3\n },\n \"b0adec8efee52f998bdab693a54dea636697c4f96087fc72ae9c87b9ccb9c378\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KONDURU DIVYA\",\n \"rollnum\" : 160114733004,\n \"sent\" : true,\n \"year\" : 4\n },\n \"b0e45b6a49ac93335d3a318c41008e279a071d985a56d8e065b646014f7f3048\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ELLABOINA VENKATESH\",\n \"rollnum\" : 160115733118,\n \"sent\" : true,\n \"year\" : 3\n },\n \"b1123c92bd1004de5d31df57031912b076b7e0cc87e1167690599bd5046bb2e9\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KUPPA VENKATA ADITYA\",\n \"rollnum\" : 160115733116,\n \"sent\" : true,\n \"year\" : 3\n },\n \"b13e1954f8e44825a7e80a5c41b3f6b6805d600a52d6ca4b1277bd1e2e745e0b\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VAMSHIKA GUTHULA\",\n \"rollnum\" : 160114733024,\n \"sent\" : true,\n \"year\" : 4\n },\n \"b16f8f869221f3a561ecc7bac7ec3d92937072e02a97e28898b35ce629654482\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SRUJITH RAO A\",\n \"rollnum\" : 160116733110,\n \"sent\" : true,\n \"year\" : 2\n },\n \"b178147d68016d4bf611130ac82e2afe7fb525647d45ebadbbbd7478edbd0f48\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"JATOTH SRINIVAS\",\n \"rollnum\" : 160114733333,\n \"sent\" : true,\n \"year\" : 4\n },\n \"b1819d714c62c7d5612ebe88e4fcf6d514edc89ce4616e6b0c9f6f361a16a828\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"TOUSEEF AHMED\",\n \"rollnum\" : 160114733175,\n \"sent\" : true,\n \"year\" : 4\n },\n \"b1beb4de45e48ec1ef4be393e423beb418c7ca997f67a6c3024236c57876def2\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VINEEL CH\",\n \"rollnum\" : 160116733115,\n \"sent\" : true,\n \"year\" : 2\n },\n \"b222fc5926dc42793b987db5034d1ab758f710540ce49c3ebf342280867c28fb\" : {\n \"email\" : \"\",\n \"name\" : \"GOLI LOKESH\",\n \"rollnum\" : 160114733098,\n \"sent\" : false,\n \"year\" : \"4\"\n },\n \"b24a4569fe2e2da50f05ffb2e849e70ebdc71dd72c610b275b4a5f4988b957b6\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"YESHWANTH RAO B\",\n \"rollnum\" : 160116733180,\n \"sent\" : true,\n \"year\" : 2\n },\n \"b48892a9ffc32e67216f7a7dcf748c0014a323981b336d1494deefb0fa9cf0b5\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GUMMADILA SAI KRISHNA\",\n \"rollnum\" : 160115733303,\n \"sent\" : true,\n \"year\" : 3\n },\n \"b49d9e5b5b1b4e936e8f23b4c301080ba361ca97c6d2d10d7dad3e051f1f42c0\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SEPURI KRANTHI KUMARI\",\n \"rollnum\" : 160114733007,\n \"sent\" : true,\n \"year\" : 4\n },\n \"b519581c067cfb2f10450fc1a5405db6864239921d088473bca195c61bd8ef34\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VENKATA RAHUL G\",\n \"rollnum\" : 160116733178,\n \"sent\" : true,\n \"year\" : 2\n },\n \"b519f8ce60ff7631143f6830a942084dbc1786676c898ed89b75cfe3fb9f4995\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SIRIKONDA AKHILA\",\n \"rollnum\" : 160115733001,\n \"sent\" : true,\n \"year\" : 3\n },\n \"b58c8e24b59e8651859560903e365d224316b4b30762754fc1c36cb51245539b\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SUSHMITHA JOGULA\",\n \"rollnum\" : 160114733022,\n \"sent\" : true,\n \"year\" : 4\n },\n \"b5c4e9d09e60009e2369b4fef7ab19b8796f4397ca71c79012fa5ef820dd8a26\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NAAREDDY SUJAY REDDY\",\n \"rollnum\" : 160114733174,\n \"sent\" : true,\n \"year\" : 4\n },\n \"b61762ff2e024239faf89be6043bb5ffc52d4beea165dc18a30d74405fe8e2d2\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HARSH RATHI\",\n \"rollnum\" : 160115733030,\n \"sent\" : true,\n \"year\" : 3\n },\n \"b68103211176894503c9676178e26cc798487f9235bdf61cc5e7ab747fb3932f\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VENKATSAI K\",\n \"rollnum\" : 160116733114,\n \"sent\" : true,\n \"year\" : 2\n },\n \"b684873c84cbc9320da72788b690b19071e88e8739f8fb678c16224cfbbdd1c8\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PREETHI K\",\n \"rollnum\" : 160116733011,\n \"sent\" : true,\n \"year\" : 2\n },\n \"b68f6b01e73249a8c42e74df794e7cc5d13d6e5f3b8abcca0c277376dbab7891\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"SANGEETH R\",\n \"rollnum\" : 160116733170,\n \"sent\" : true,\n \"year\" : 2\n },\n \"b6ca364bdec3aef311ce54201f243da456135023f2645d1baa07ec511fe1c8ca\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"SPANDANA K\",\n \"rollnum\" : 160116733017,\n \"sent\" : true,\n \"year\" : 2\n },\n \"b7231460f1eae4ff3b694207a6d272d21bfa790eca1570c8dc0f59f6c93540bb\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GUDA SUCHITRA REDDY\",\n \"rollnum\" : 160114733020,\n \"sent\" : true,\n \"year\" : 4\n },\n \"b763c0703168e87272419eb7dd428d64d26862bad2b871a0513f6c8418300050\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PENDYALA GOPI CHAND\",\n \"rollnum\" : 160114733152,\n \"sent\" : true,\n \"year\" : 4\n },\n \"b87d9fea062268b85a46fd06b2e49279b673c6f14a886a24fa082e63ff420ff1\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"TANGALLAPALLY SRINATH\",\n \"rollnum\" : 160115733056,\n \"sent\" : true,\n \"year\" : 3\n },\n \"b898b1dd5b5defb86c7a793245d34f55248ccb5b18ecfb13a0f2d4f7aca7eb1b\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"MALOTH SURYA CHARAN\",\n \"rollnum\" : 160115733114,\n \"sent\" : true,\n \"year\" : 3\n },\n \"b999cc11cb779567400d77ffadf238e4ce2f55774f4fd29fc0f62dc862031c8d\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VUNDHYALA AASHISH REDDY\",\n \"rollnum\" : 160115733150,\n \"sent\" : true,\n \"year\" : 3\n },\n \"b99b6e500657a820fabec7c4b9e303719d9800e978a22606ba1e4f06bf337a6c\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KURAMA VIHAR\",\n \"rollnum\" : 160115733178,\n \"sent\" : true,\n \"year\" : 3\n },\n \"ba8b4c2983de6545b6cbc9b7d0c3a3d7666fc416dee3d9774326f978d521af46\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"SAI AJAY KUMAR V\",\n \"rollnum\" : 160116733047,\n \"sent\" : true,\n \"year\" : 2\n },\n \"baa7d6d683c13f7a459760ce705bccc6c58e4d3db74dce46b36563a97c45b382\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VENNU MADHURI\",\n \"rollnum\" : 160115733130,\n \"sent\" : true,\n \"year\" : 3\n },\n \"babe6d1371e41f4a0bc8c19351eaf118f01aded05cbd9cae24a213cb4d762cb2\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KANDI NYMISHA\",\n \"rollnum\" : 160114733072,\n \"sent\" : true,\n \"year\" : 4\n },\n \"baef4025ebf56e70885608c398b93e608d9b1b2fd0a240f91edff1f9605729b9\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"CHANDANALA NISHANTH\",\n \"rollnum\" : 160116733304,\n \"sent\" : true,\n \"year\" : 2\n },\n \"bbb290a14cf56ea2e4adbad79f88f05839ba2c77fb336116467b2d5ee524aff7\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SUKKA PRASHANTH\",\n \"rollnum\" : 160116733302,\n \"sent\" : true,\n \"year\" : 2\n },\n \"bc0c161087ed2057eca2240b3762873c2e44608126e7b523496a4bb7659810d3\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE02\",\n \"group\" : \"2\",\n \"title\" : \"Principle of Programming Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SRI TEJA E\",\n \"rollnum\" : 160116733056,\n \"sent\" : true,\n \"year\" : 2\n },\n \"bc18fde753ff854a5641cf2ae4bdc21a93f8f0f7249129222abb3a010f689456\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ADITHI LOKA\",\n \"rollnum\" : 160114733061,\n \"sent\" : true,\n \"year\" : 4\n },\n \"bc708b73315fbce68fed12b09c1a2c74efddf90288d8a70e1b743b8ba4629f0c\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS354\",\n \"group\" : \"3\",\n \"title\" : \"Simulation and Modeling\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"G BHARGAV\",\n \"rollnum\" : 160115733026,\n \"sent\" : true,\n \"year\" : 3\n },\n \"bce1d0d2b4f1e497d7f7280deaa95ca3e2476f9ff1c8037307df60c9042f0042\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"AMPILI KEERTHI\",\n \"rollnum\" : 160114733068,\n \"sent\" : true,\n \"year\" : 4\n },\n \"bd55b96d34198b62e0f682fec424a41685387d7dd68b8c644830199868f89f27\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"JAAHNAVI GOLI\",\n \"rollnum\" : 160116733181,\n \"sent\" : true,\n \"year\" : 2\n },\n \"bd9a36bc6ebe8593a10fff4526afdf2c30920c11fd4ff2fe3840d06604c2350c\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MANDHAPALLI JITHIN\",\n \"rollnum\" : 160114733039,\n \"sent\" : true,\n \"year\" : 4\n },\n \"bdcef6bc248ab97c3a406dadc0a97b67a074aa777f4aaa76b4f3301181f6ca84\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"A SAI CHANDER\",\n \"rollnum\" : 160116733314,\n \"sent\" : true,\n \"year\" : 2\n },\n \"be25f06dfbe8d2776fddc5f79a1d823f2fb45b00ab30fefa16dc6828d652c7bc\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"NITHISH REDDY A\",\n \"rollnum\" : 160116733161,\n \"sent\" : true,\n \"year\" : 2\n },\n \"be38de1de5ca32080ec92f77d4c90a8fd6e5fcc2789d13eb9c2a686f94937fc9\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MORA RAJU\",\n \"rollnum\" : 160114733305,\n \"sent\" : true,\n \"year\" : 4\n },\n \"beacc01b71324ebbaeb954ae85f1636541aa18cf43daf6286c14a1031bc33255\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ROHITH VADDAVALLI\",\n \"rollnum\" : 160114733050,\n \"sent\" : true,\n \"year\" : 4\n },\n \"bf2cbe0a737229857ff0ae3f15aac01c62ded8ed990af385070c301ad58d55c6\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SOMA MANISH RAM GOUD\",\n \"rollnum\" : 160115733034,\n \"sent\" : true,\n \"year\" : 3\n },\n \"c01e3cade44e9d38abfba4fd0e29e262eeeb3d81e8626a4c3fc627e8bdcc14cf\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ABRAR ATHAR HASHMI\",\n \"rollnum\" : 160115733082,\n \"sent\" : true,\n \"year\" : 3\n },\n \"c0655ffe50566ac979800706ec5d8be0e5305e69813f7bb05f81beec8f4e2a1e\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KOTI MAHITHA\",\n \"rollnum\" : 160115733333,\n \"sent\" : true,\n \"year\" : 3\n },\n \"c0b75b30e8f11e2e28bdbce248685449025d9a57fc19af0d3aa6eeaa497f5115\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SUBHASH V V S S\",\n \"rollnum\" : 160116733057,\n \"sent\" : true,\n \"year\" : 2\n },\n \"c13bcae406a25ff340e1d1055992f68f847e5a563d1e12f6e93081f756a13d79\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DILEEP B\",\n \"rollnum\" : 160116733155,\n \"sent\" : true,\n \"year\" : 2\n },\n \"c15349d0fa15557722b943e8b4b5c1afb30aad14fac5a121c66778e2fbb4d638\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KONDA DIVYA\",\n \"rollnum\" : 160115733313,\n \"sent\" : true,\n \"year\" : 3\n },\n \"c16d62b459d7f560e0049ded4c8cfc312eac3e908fcb9ad6908072ccb6857b02\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"G SHRIYA\",\n \"rollnum\" : 160114733078,\n \"sent\" : true,\n \"year\" : 4\n },\n \"c1d67e85817972b2a9ab72a42b1212df63c0599f6626bd6cdf3e81a210ebbb79\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GIDDE GOUTHAMI REDDY\",\n \"rollnum\" : 160115733305,\n \"sent\" : true,\n \"year\" : 3\n },\n \"c2722b86e32460e92db237e187f88857f010bfd776bdb466a79cdf299927eed1\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SARAMPATI SAI KUMAR\",\n \"rollnum\" : 160115733108,\n \"sent\" : true,\n \"year\" : 3\n },\n \"c29820bb91e02bc897e0a77d8fb943b823cbcbd9ddd8452e116a1894ea03ec04\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SOHAIL QURESHI\",\n \"rollnum\" : 160116733172,\n \"sent\" : true,\n \"year\" : 2\n },\n \"c2a07a541f98909cc0185e76bde6f269d6f6075c417211e93702657b4ba52cc8\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE03\",\n \"group\" : \"2\",\n \"title\" : \"Shell Scripting\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DAMERA LAXMAN RAJ\",\n \"rollnum\" : 160116733325,\n \"sent\" : true,\n \"year\" : 2\n },\n \"c358e253855f071591e47c3be074e864ccdcbd4964d168a5efa59716ec6491ae\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"SANGEM NANDHA KISHORE\",\n \"rollnum\" : 160114733160,\n \"sent\" : true,\n \"year\" : 4\n },\n \"c3741739051e6210ba713c469b9ea6a6ca43f1a55f5bd9d5b325d616f590181d\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GOWTHAM REDDY A\",\n \"rollnum\" : 160116733029,\n \"sent\" : true,\n \"year\" : 2\n },\n \"c387ceb6af5522568ef4ea7a3a703f15dd2bcad6fe68366c5acc3e8676ab1488\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MARK\",\n \"rollnum\" : 160114733101,\n \"sent\" : true,\n \"year\" : 4\n },\n \"c42c1ce2bd96e04abdf5f13bcd68637d3d4e34be951cf7bc694ec053e64ed22d\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PRASAD SAKHAMURU K\",\n \"rollnum\" : 160116733043,\n \"sent\" : true,\n \"year\" : 2\n },\n \"c5c5005a284c9b5a62929e78792cf215b30867d2bfcfdc1dfb4f2d416cf1669f\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"JOSYULA SAI SUSHMA MADHAVI\",\n \"rollnum\" : 160115733141,\n \"sent\" : true,\n \"year\" : 3\n },\n \"c5fd36022eaab652768b61732141e79dd732e642a97cb489067af82d6e7a9126\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"SHUAIB ABDUL HAI\",\n \"rollnum\" : 160114733172,\n \"sent\" : true,\n \"year\" : 4\n },\n \"c617261804be37730cf904ce59534fbafab6c4348aecab9d4824f68fe6fd59db\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"THAMADA KALYAN KUMAR\",\n \"rollnum\" : 160114733040,\n \"sent\" : true,\n \"year\" : 4\n },\n \"c674c6a5cd7720eb77014d182a81b0ac6f209c218f846c0fced4af1586a9ccd2\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GURINDAPALLI SUPRIYA\",\n \"rollnum\" : 160115733148,\n \"sent\" : true,\n \"year\" : 3\n },\n \"c67627449d56a5594a5d0c5876b4fcbdf77090ea0632a482142f91faa52be5d1\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHARATH CHANDRA B\",\n \"rollnum\" : 160116733107,\n \"sent\" : true,\n \"year\" : 2\n },\n \"c6b1a1dc61e34fdd5179f3640f0bb714acf0889405ec29ece47c34948574212b\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NAGA SAI SHASHANK\",\n \"rollnum\" : 160114733103,\n \"sent\" : true,\n \"year\" : 4\n },\n \"c770805db823670a4e32bf6b05aa8a6e4507cc2a237d609f1afbb60eb3d46630\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MEGHANA CHUNDURU\",\n \"rollnum\" : 160114733070,\n \"sent\" : true,\n \"year\" : 4\n },\n \"c81a43fe5c14cc9a89ed5cc333b614c28c4fba77bd26dea81beb011a18fe542e\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAMALA SUSHANTH\",\n \"rollnum\" : 160115733115,\n \"sent\" : true,\n \"year\" : 3\n },\n \"c820077c280424f74186e964540a6b1c8b3c5cab1f8e9f1ab1c699208e48ac28\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GUJJULA BHANODAYA TILAK\",\n \"rollnum\" : 160115733024,\n \"sent\" : true,\n \"year\" : 3\n },\n \"c8798cf2500f1cfefbe7e227cfaa1fbb1c609518c7832479c7658cef623d1587\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DARANA ABHISHEK\",\n \"rollnum\" : 160115733080,\n \"sent\" : true,\n \"year\" : 3\n },\n \"c8a4f889c755fb579081638ca89c3c0d1a5feee4e7320c1cf5ad09c110d7a59c\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BEULAH K\",\n \"rollnum\" : 160116733001,\n \"sent\" : true,\n \"year\" : 2\n },\n \"c968723581777615ca569ce363fd3d3aca7e1de701acfdb1a1ff673e55acd3f1\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NAMPELLY SRICHARAN\",\n \"rollnum\" : 160114733056,\n \"sent\" : true,\n \"year\" : 4\n },\n \"ca29e47c444f12415139d02006a26c31f6a0643bfed2337b3f92e7647ecd298e\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HARSHITHA REDDY T\",\n \"rollnum\" : 160116733130,\n \"sent\" : true,\n \"year\" : 2\n },\n \"ca31518f7e2351047c9e467579ceb286db2d0127e93736e73c6e69b2974088ce\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SYED TAUSEEF AHMED\",\n \"rollnum\" : 160113733123,\n \"sent\" : true,\n \"year\" : 3\n },\n \"ca9c72561fc3bfdc40104687f7bb9bc3c90344d6f068f2358635565d267b0603\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KOKA ESHWAR\",\n \"rollnum\" : 160114733094,\n \"sent\" : true,\n \"year\" : 4\n },\n \"cb086f11f69f1905b159c382c715bb6a5f096c2b57f1792f5f65547393715bae\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MADURI MANJARI\",\n \"rollnum\" : 160114733009,\n \"sent\" : true,\n \"year\" : 4\n },\n \"cc0aa4c0a1fdad675382535e0820a950ec30701b18a92abb8bb9ac0f9d4b9445\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GANNAMARAJU RAVI TEJA\",\n \"rollnum\" : 160115733045,\n \"sent\" : true,\n \"year\" : 3\n },\n \"ccc20171dcdf1ed528b7f9922ad817fec085c165f0c588c6ed350130c9652f0f\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MALEGAMA SHIVASHARAN\",\n \"rollnum\" : 160114733328,\n \"sent\" : true,\n \"year\" : 4\n },\n \"cd098241a6d951b14a8c0d3ae0acb32414db7580bae75ddd5908b0c71d94f581\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GUNNALA SRINATH\",\n \"rollnum\" : 160116733318,\n \"sent\" : true,\n \"year\" : 2\n },\n \"cd9303eddfdfdb5598931ef31e2056ab94d0c9bf0b9a5a559f17b286a290e4ab\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAI RUCHIEATHA MAANVI\",\n \"rollnum\" : 160114733075,\n \"sent\" : true,\n \"year\" : 4\n },\n \"cdd34a44f36805ef2034054fb3cf8e342cb151425786f977a16c66167ec6f601\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"PENTHALA SRAVAN KUMAR\",\n \"rollnum\" : 160116733330,\n \"sent\" : true,\n \"year\" : 2\n },\n \"cf2738461e5c4bcaccb0e23a2b7fa2c5b3ce26c2b279f211d4771ac77ec17937\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"USEM VARSHITA\",\n \"rollnum\" : 160115733078,\n \"sent\" : true,\n \"year\" : 3\n },\n \"cf4437cf3e7ac63acc5ab6ba8ca434bf474e85330ab922d9e5fac4a611ac7f2f\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NALIN RAJ G\",\n \"rollnum\" : 160116733037,\n \"sent\" : true,\n \"year\" : 2\n },\n \"cf57b5ecd24fe551122135fed1d3c9712a8800a46006ebb158d9f288618a4020\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PENDYALA NAVYA SREE\",\n \"rollnum\" : 160116733336,\n \"sent\" : true,\n \"year\" : 2\n },\n \"cfd7fca59e99a8595c00bb4d4f2220830700a7e4821a67f345f8ff61f9a1c15d\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"BOLAMALLA THRIVIKRAMA RAO\",\n \"rollnum\" : 160115733176,\n \"sent\" : true,\n \"year\" : 3\n },\n \"d03e1e49704843d608cb0997e3761c3c7f25ca7a4e9ba3bbe3798c7d320fa079\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BYAGARI PALLAVI\",\n \"rollnum\" : 160115733008,\n \"sent\" : true,\n \"year\" : 3\n },\n \"d07bbbe4b01f61e559f17d089a1b8a54425dbff46b2dfe2abb1335a6d105918e\" : {\n \"email\" : \"\",\n \"name\" : \"avaneesh\",\n \"rollnum\" : 160116733024,\n \"sent\" : false,\n \"year\" : 2\n },\n \"d124f2b4f170689aa4e4c02a6b81cf394660dbebbc5982b518f26e1c3d40d3b3\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SATYA VINAYA LIKHITESH\",\n \"rollnum\" : 160114733111,\n \"sent\" : true,\n \"year\" : 4\n },\n \"d2244a6b714aa8def261593e29040c715027d4c36d29c1a080e0bf02607932f8\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"RICHA KULKARNI\",\n \"rollnum\" : 160115733137,\n \"sent\" : true,\n \"year\" : 3\n },\n \"d2398fc6b77ac8273d82aec69401ff3006b24a1c10aaf0b03fb75f2b89bdbf48\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SURIGI SADHANA\",\n \"rollnum\" : 160116733335,\n \"sent\" : true,\n \"year\" : 2\n },\n \"d2b34ad1cca436cc5ba76cd4f291d0ccede14c61c410553792684967a9c1854e\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"TAMMADAVENI AISHWARYA\",\n \"rollnum\" : 160115733331,\n \"sent\" : true,\n \"year\" : 3\n },\n \"d3d6bbbdd9eb90c6888a4ec9dae9bfa26a10657123f18b0a8a1d455692a0f249\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BOMMAKANTI SAI AVINASH\",\n \"rollnum\" : 160115733048,\n \"sent\" : true,\n \"year\" : 3\n },\n \"d4ae6cd510ba2a468594c0aa737046573965894ddcca9d0c1d8e44eb6384ca83\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"BANDI NEWVEELA\",\n \"rollnum\" : 160116733329,\n \"sent\" : true,\n \"year\" : 2\n },\n \"d504715880747945de7bf3f57f52c2d5031b99ede338235dcc722d85d0f7856a\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"PAVAN KUMAR REDDY K\",\n \"rollnum\" : 160116733039,\n \"sent\" : true,\n \"year\" : 2\n },\n \"d566bd15b6b31702418cd3de42f48b0e881721658890bfe3a7934f3412528af9\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"GOGINENI DINESH CHOWDARY\",\n \"rollnum\" : 160115733154,\n \"sent\" : true,\n \"year\" : 3\n },\n \"d60aa2a7f2c28dbc8bf21b79564424c3b69b5a6e59bae3d52e982ff347535939\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"N DAKSHATHA\",\n \"rollnum\" : 160114733124,\n \"sent\" : true,\n \"year\" : 4\n },\n \"d68a982a9ad6cc49e882d4b41be417f767aae43f3a2e9e5cec9d308b74b924f1\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"HARIHARAN REDDY ADMALA\",\n \"rollnum\" : 160114733153,\n \"sent\" : true,\n \"year\" : 4\n },\n \"d6c6af25e98b16157548ffa05b249f2536cb0ee55d113b1d588de69c6752ecf2\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NALMAS AKHIL\",\n \"rollnum\" : 160114733087,\n \"sent\" : true,\n \"year\" : 4\n },\n \"d6edb9accf4c52204b4eca2e7c030ffb862fb756d50e344669c40cb75f048341\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"GUJJARI VAMSHI KRISHNA\",\n \"rollnum\" : 160114733176,\n \"sent\" : true,\n \"year\" : 4\n },\n \"d79d7488029c9f19c8620c97b721d321fabc938713518be4c36560a0e0459363\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"GAINI PRANAY\",\n \"rollnum\" : 160115733161,\n \"sent\" : true,\n \"year\" : 3\n },\n \"d82929f43fcd04574e6dcebd5982c08cefa2229f401e3d489966599418e38a89\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BANDI RISHITHA\",\n \"rollnum\" : 160115733074,\n \"sent\" : true,\n \"year\" : 3\n },\n \"d84eff909f52ae1c3d4b19324117705b5c263bda00f14f3b8622de4f7701d645\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAI GNANA GUNA SAGAR J\",\n \"rollnum\" : 160116733048,\n \"sent\" : true,\n \"year\" : 2\n },\n \"d8aa6291fa1481a906af3ae2018bc0d3dcf3eab7a45d68d4055914c7042336ad\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAHAS REDDY M\",\n \"rollnum\" : 160116733046,\n \"sent\" : true,\n \"year\" : 2\n },\n \"d90f8fb35beb64eaea6c987337b6f10c01cdced52f0f320bdc2f334ebaa9d632\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MD ASIF ALI\",\n \"rollnum\" : 160115733094,\n \"sent\" : true,\n \"year\" : 3\n },\n \"d97764a3055538ba2ef1286c5aa122e6d2d21bcac3354921d3642833760e5595\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NADIMIDODDI RAHUL\",\n \"rollnum\" : 160114733164,\n \"sent\" : true,\n \"year\" : 4\n },\n \"da1fd841114c59ad268e49367f0629c713db01178a31380c0936a9ab81ce8702\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BHUKYA SANDHYA RANI\",\n \"rollnum\" : 160114733076,\n \"sent\" : true,\n \"year\" : 4\n },\n \"da6a1e90f31a5a0884eaa69226979a0d909535d1d961246e22d372a7b4649314\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VINEETH KUMAR A\",\n \"rollnum\" : 160116733116,\n \"sent\" : true,\n \"year\" : 2\n },\n \"dc85cca4d7175102dfc2909cc6b5837e2282608add27daf3e71234f4a8c7b659\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MUDU JHANSIBAI\",\n \"rollnum\" : 160115733307,\n \"sent\" : true,\n \"year\" : 3\n },\n \"dca0ec2704d9eff8b34bc442d271f7a138874c83dfa2a22d3bb6d6027a1eb040\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ARABATI TEJASWI ROOPINI\",\n \"rollnum\" : 160115733077,\n \"sent\" : true,\n \"year\" : 3\n },\n \"dcb47dc5352b69002132aef772bb79613aba979818c0ce3ba18e40cf4ccecb70\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KALLEM RAVI CHANDRAN REDDY\",\n \"rollnum\" : 160115733102,\n \"sent\" : true,\n \"year\" : 3\n },\n \"dcdb75a7a5688be1cc284e6ffcd6d01db0d2c0c8d3f482b6cb1bc7ab3fb4e323\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DHEERAJ REDDY\",\n \"rollnum\" : 160114733151,\n \"sent\" : true,\n \"year\" : 4\n },\n \"dd5147fcc07cd05cc1a3ffd549549d8f33961aac3bc471c7845154b7d3fe0abc\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MALLELA VINAY KUMAR REDDY\",\n \"rollnum\" : 160114733179,\n \"sent\" : true,\n \"year\" : 4\n },\n \"de3d1e7fa2ad6ff60e9a03b2d35d94377b86f84a151cbb0bc8b68c538dc8cf7a\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS475\",\n \"group\" : \"4\",\n \"title\" : \"Human Machine Interaction\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PATNALA SAI SANTHOSH\",\n \"rollnum\" : 160114733051,\n \"sent\" : true,\n \"year\" : 4\n },\n \"dee35bbcd573386c93172edaaaa9f3387fc08066ac7c5732b496ca5483d2ec66\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"TEJASVI A\",\n \"rollnum\" : 160116733149,\n \"sent\" : true,\n \"year\" : 2\n },\n \"df4f146269de20040e4309e0a2df52ec6f7a306b69fd588ee88d1c8238d745f7\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DANDEVENA SRIKANTH\",\n \"rollnum\" : 160115733175,\n \"sent\" : true,\n \"year\" : 3\n },\n \"e05ba82ba2dc93f3a47a0804bcf9331182e5161253289691a0667cea6c7dea76\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"SHARVANI M\",\n \"rollnum\" : 160116733139,\n \"sent\" : true,\n \"year\" : 2\n },\n \"e1d5b7787cb2327d5a24a1f29abb51e30dc17a93747fb64e4599d6daa8b75efc\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NANNUTA SHIVASRI\",\n \"rollnum\" : 160114733306,\n \"sent\" : true,\n \"year\" : 4\n },\n \"e2166b17200558eb376a9e9d36799b6801805c8a64797695eb07e0254aa973a9\" : {\n \"email\" : \"[email protected] \",\n \"name\" : \"SRINIVAS M\",\n \"rollnum\" : 160116733174,\n \"sent\" : true,\n \"year\" : 2\n },\n \"e23b422bfe93d1ba98465ac457897862d57a4bebb3aebcdda33aae0f9ca49aea\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NAYINI RAMYAKEERTHI\",\n \"rollnum\" : 160115733316,\n \"sent\" : true,\n \"year\" : 3\n },\n \"e26ed9f3f6ba5d6166a47df42a29e94f2f704310e90b24869441c32a5e70dd9f\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"THOTA JYOTHI\",\n \"rollnum\" : 160115733070,\n \"sent\" : true,\n \"year\" : 3\n },\n \"e2d080c8e8274d848f42017238de3288542f3df0dfb82bff8a9b9d5e4e1be0c7\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DOOLAM RAMYA\",\n \"rollnum\" : 160114733317,\n \"sent\" : true,\n \"year\" : 4\n },\n \"e34ecf7554256d53fd8f9b7d125d6f9f501a8482cdbcf4b80f3753ad2f76e27c\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BINGI SUSMITHA\",\n \"rollnum\" : 160114733083,\n \"sent\" : true,\n \"year\" : 4\n },\n \"e35d42cad9be657046fdbd4ebde0d9a67c13ee45d911f8b4e0b88812259073b7\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DHADIGE SUSMITHA\",\n \"rollnum\" : 160115733149,\n \"sent\" : true,\n \"year\" : 3\n },\n \"e360c8f739429d982fdea7279bfaa323409ff117fddbe0005fe3f070ca96decd\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SRAVYA JASTI\",\n \"rollnum\" : 160114733144,\n \"sent\" : true,\n \"year\" : 4\n },\n \"e4d8854b7b9db1dbe4b1822128e99d98e6864972a6535c6f6aea9962e0ca176e\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE02\",\n \"group\" : \"2\",\n \"title\" : \"Principle of Programming Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MAHITHA R\",\n \"rollnum\" : 160116733021,\n \"sent\" : true,\n \"year\" : 2\n },\n \"e4da0731f844dcb70470390019a2c74212c2add2a1fcff7b64c6e0c872684383\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BILLA MOWLANICA\",\n \"rollnum\" : 160114733011,\n \"sent\" : true,\n \"year\" : 4\n },\n \"e506c8918947f8ff2b92794a39861f9aa8111de27f79cdf89559ae1778c1d55f\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SUSHMA REDDY KASARLA\",\n \"rollnum\" : 160114733021,\n \"sent\" : true,\n \"year\" : 4\n },\n \"e51c2eb23c9a28ee7713f30dbecd6c7d3496d14d650781bbc45871cd565ba953\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"CHINTA PREETHAM\",\n \"rollnum\" : 160115733041,\n \"sent\" : true,\n \"year\" : 3\n },\n \"e60f76b6b59b99581bb3ba0038d710d954edffba5e0c8e39c580298d4ba80b4d\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAI SAHITI CH\",\n \"rollnum\" : 160116733073,\n \"sent\" : true,\n \"year\" : 2\n },\n \"e6969095a5132e55d922f28658a86253c193822c6361447dd54221ffb7aacc3f\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KOLAN HARIKA\",\n \"rollnum\" : 160114733066,\n \"sent\" : true,\n \"year\" : 4\n },\n \"e6a1106ae34845b94ca86c978013d6121854535a468fd8b384690c4a87e5c526\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"YASHWANTH G\",\n \"rollnum\" : 160116733119,\n \"sent\" : true,\n \"year\" : 2\n },\n \"e6ec700ff36a75f7b66969c3e01a9db95c045ef9a50cdbf07e37d96cabc7e478\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ADITHYA K N G\",\n \"rollnum\" : 160116733103,\n \"sent\" : true,\n \"year\" : 2\n },\n \"e70a962e8ad0fe32ee78713f50ed9e0bf620a995ba8b8b001f1c8c153e9f6c2b\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"P RISHITA REDDY\",\n \"rollnum\" : 160114733137,\n \"sent\" : true,\n \"year\" : 4\n },\n \"e732dfdfe926d3ce1dc9e74361b85b9bbe73f94e2bf0d58fc4b749908acbb69d\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ALEKHYA MALYALA\",\n \"rollnum\" : 160114733122,\n \"sent\" : true,\n \"year\" : 4\n },\n \"e75244db11b5a152187c742f969f7c88d32e20fa7df626d327c63db9961e7674\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BEVARA JAHNAVI\",\n \"rollnum\" : 160115733125,\n \"sent\" : true,\n \"year\" : 3\n },\n \"e784398c1cecd2c9a8de07647b41ba15676bbe21189659663d0b4982826183d8\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE02\",\n \"group\" : \"2\",\n \"title\" : \"Principle of Programming Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SUMANJALI CHAKRAVARTHI N\",\n \"rollnum\" : 160116733019,\n \"sent\" : true,\n \"year\" : 2\n },\n \"e7d8f6fbb309db992a8bafc2df9c14c24a855db0a8ef885d33f46c02d7dfe99d\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BANDARI SAITEJA\",\n \"rollnum\" : 160115733319,\n \"sent\" : true,\n \"year\" : 3\n },\n \"e8088103381c82a921f9cf02953f83c2bba6d10bee9bafdd1d9e27ee6bcda917\" : {\n \"email\" : \"\",\n \"name\" : \"POTTALA BHARATHI\",\n \"rollnum\" : 160116733310,\n \"sent\" : false,\n \"year\" : 2\n },\n \"e88640539945f5291fd3a91ce079bf1e0a0fca93cde77942f1e1e0d72b1030fa\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"K SAI SUDHEEP REDDY\",\n \"rollnum\" : 160114733053,\n \"sent\" : true,\n \"year\" : 4\n },\n \"e888ef1fb04f702e7e89fb493969c9ae1f0f6dfde3693073783c7561e249c2f4\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHREYA RAJ K\",\n \"rollnum\" : 160116733142,\n \"sent\" : true,\n \"year\" : 2\n },\n \"ea6984d9f3b6624f5fed46f9f9842453a67391dd147c4080eba2de95a8fd670c\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAI SAURABH KAUSHIK\",\n \"rollnum\" : 160115733110,\n \"sent\" : true,\n \"year\" : 3\n },\n \"ea7c26ede0b08fdf72926b5d6041f3835c129164578d5fcfbbb969c0ba1a943a\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAICHARAN V\",\n \"rollnum\" : 160116733052,\n \"sent\" : true,\n \"year\" : 2\n },\n \"ea9cc42d0a81b92a6a44f8709cfe90bb3bda9e3f929b38ccec0a6e083a9dcf9d\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KALLA SOUNDARYA\",\n \"rollnum\" : 160115733311,\n \"sent\" : true,\n \"year\" : 3\n },\n \"eac6fc74a3d73634d675e221ef9ce65c030a05fbfac109d2299d185a737a5baa\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SIRI CHANDANA SUREDDI\",\n \"rollnum\" : 160114733141,\n \"sent\" : true,\n \"year\" : 4\n },\n \"eb54cb86f2a6c7685e3bce2b2859b4f24f67dcf70bc390bd3d00ae878f5d488c\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BAVYA SRI J\",\n \"rollnum\" : 160116733062,\n \"sent\" : true,\n \"year\" : 2\n },\n \"ebad2a3a7070d9f6fa01ba086648001cb4bf20df2aae8b95135d1e8dc18696a5\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"RAJULA NAGARAJU\",\n \"rollnum\" : 160114733319,\n \"sent\" : true,\n \"year\" : 4\n },\n \"ec0664062dd1e4784836910d10add6ce6b60c8966cc347b632e3225a8f8cfc93\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VINESH REDDY NAGA\",\n \"rollnum\" : 160114733180,\n \"sent\" : true,\n \"year\" : 4\n },\n \"ec3a52d04a18803ec1aad8961680e6fa78529dde15b80892ad52690fa30b1001\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SYED SHAKEEB ASSIL\",\n \"rollnum\" : 160116733176,\n \"sent\" : true,\n \"year\" : 2\n },\n \"ed96f08d0d16940e6f6e122e304ddf5f27a2a8ef0afaddcfade68749374513e4\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KOSURI GOWTHAM VARMA\",\n \"rollnum\" : 160114733036,\n \"sent\" : true,\n \"year\" : 3\n },\n \"edd20d263638c64445e4b78a9620a18305a40323568aa8b73c76058bd30d7217\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"B AKHILESH DATTA\",\n \"rollnum\" : 160114733088,\n \"sent\" : true,\n \"year\" : 4\n },\n \"ee4ee937a01f423184d30d877bf417e3909ca5da03f1a8c6ed2766aa6e309e25\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VEERAPAGA BUCHAIAH\",\n \"rollnum\" : 160114733312,\n \"sent\" : true,\n \"year\" : 4\n },\n \"eed7a196b28223e420db9f605fd72b2f55dcd3e81ed074419fc9187726bbb1af\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MOHAMMED BIN SAYEED BASULEMAN\",\n \"rollnum\" : 160114733325,\n \"sent\" : true,\n \"year\" : 4\n },\n \"ef313d26254774e63139ef514974827407a2bd84f9bffc8780b7fe7dfd7208be\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"TAWADA GAYATRI\",\n \"rollnum\" : 160115733124,\n \"sent\" : true,\n \"year\" : 3\n },\n \"efda0c3fa0e34be0a061b0b88f6c737ee60796761a6d1806abc375ae4d62a085\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DESINEEDI UMA MAHESHWARA SWAMY\",\n \"rollnum\" : 160115733177,\n \"sent\" : true,\n \"year\" : 3\n },\n \"f02ea23db401045211d65796d50da3c9c19b0e86b041090ed44fecca8aa63050\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"CHARITA DONTIREDDY\",\n \"rollnum\" : 160115733067,\n \"sent\" : true,\n \"year\" : 3\n },\n \"f057708689d93ef07ad72f57a4ec82eb5cc002016faaa6ae9ad494d1ecb9b8f6\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KUDALA SUMEERAJA\",\n \"rollnum\" : 160116733301,\n \"sent\" : true,\n \"year\" : 2\n },\n \"f0e938a3a17d5e63ea7963c79abe54f9c4c25bc92ddb2d89a6d258b4ba07e7ec\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ZAIN UR RAHMAN MOHAMMED\",\n \"rollnum\" : 160115733120,\n \"sent\" : true,\n \"year\" : 3\n },\n \"f14f79548b8c40a50104b9df70af1c1892b1e5df6aa8d53a494445e1a0886a83\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE03\",\n \"group\" : \"2\",\n \"title\" : \"Shell Scripting\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ADEEL AHMED AKHEEL\",\n \"rollnum\" : 160116733033,\n \"sent\" : true,\n \"year\" : 2\n },\n \"f1b25161389b96c1e0c985eb9eaaefeddd098bada22a32b625e35eb01dbf0297\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KEDAM KARTHIK\",\n \"rollnum\" : 160115733089,\n \"sent\" : true,\n \"year\" : 3\n },\n \"f1ebea52533d7f560673af4f7711409a748ebf2fbafb18c01dc4d1c319d79adc\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MOHAMMED MEHRAJ\",\n \"rollnum\" : 160115733328,\n \"sent\" : true,\n \"year\" : 3\n },\n \"f23527dd6e485484c0fcb380f936eafad2776c7601d0985034103b7e925ef34b\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAGI SAI NITHISH VARMA\",\n \"rollnum\" : 160115733167,\n \"sent\" : true,\n \"year\" : 3\n },\n \"f28a74eb367754b2c9e2507c5ae6e61019f6875168061c5c71015f29ad63efc6\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BOOSA KEERTHANA\",\n \"rollnum\" : 160116733331,\n \"sent\" : true,\n \"year\" : 2\n },\n \"f32c201754eb16d0c4306f3d63c026efe14cc11aeb332ea6295e332a925880c4\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"SRISAIBHAVYA REDDY G\",\n \"rollnum\" : 160116733146,\n \"sent\" : true,\n \"year\" : 2\n },\n \"f34fcd48c32de6fd2eb830769940d94d4d9e694ac34acdc96f1548cc9b12cfe3\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"ADITYA K\",\n \"rollnum\" : 160116733080,\n \"sent\" : true,\n \"year\" : 2\n },\n \"f3744521ce637b1b3c880a8fb64adde570f6477b6c12ec3cf77efdb11162fcaf\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HARISH KUMAR K\",\n \"rollnum\" : 160115733087,\n \"sent\" : true,\n \"year\" : 3\n },\n \"f3d08d6114e3c0fa7e41f27ebcdff6a97376aec32a9d69e6f1f017cdd406e861\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KANNURI AJAY\",\n \"rollnum\" : 160115733020,\n \"sent\" : true,\n \"year\" : 3\n },\n \"f3d3b520fa34d4cd57821f43e17bfe900a9fd57faeab0ccbbf8d7899592ab11c\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS472\",\n \"group\" : \"4\",\n \"title\" : \"Cloud Computing\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"MD SAMYA SULTHANA\",\n \"rollnum\" : 160114733304,\n \"sent\" : true,\n \"year\" : 4\n },\n \"f40722063e0a12d9966938803423a9b50af49234d046f451aaf3e4a00fd4eceb\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"PRIYANKA GANDHI P\",\n \"rollnum\" : 160116733136,\n \"sent\" : true,\n \"year\" : 2\n },\n \"f41e2b6c3499c3d7eabcfbdb8c2911445216cd55c12e267be12f6e18d8720f52\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"DEEKSHITHA G\",\n \"rollnum\" : 160116733124,\n \"sent\" : true,\n \"year\" : 2\n },\n \"f44e366cd7b10d16bb695c2ccec812ad474c5f072006886f7bb012b8460e8c43\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PAPIGARI SHIVA\",\n \"rollnum\" : 160114733113,\n \"sent\" : true,\n \"year\" : 4\n },\n \"f4a9127053875686341ea4d9e8c9e9ad2a6ac8d119bf2af4f6f573c5111e8374\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"NARSIDANI SHENAZ\",\n \"rollnum\" : 160114733016,\n \"sent\" : true,\n \"year\" : 4\n },\n \"f744772a128319c94f658d8b28ed034cce7af0dc313780c04279d11fd31f76cc\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SANKINENI HARSHA VARDHAN RAO\",\n \"rollnum\" : 160115733326,\n \"sent\" : true,\n \"year\" : 3\n },\n \"f7bba5138f0a817104b8e3073440cd66dd1da21f195b61d08b22d48dec7b1f9c\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"AJMEERA RANJITH KUMAR\",\n \"rollnum\" : 160115733101,\n \"sent\" : true,\n \"year\" : 3\n },\n \"f8e253855687564fa34aef9e3eddd2fea178c859a7a6c1ea224ce364311b2961\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"PRATHI JITENDRA KALYAN\",\n \"rollnum\" : 160114733096,\n \"sent\" : true,\n \"year\" : 4\n },\n \"f9bbacdd129c7126198c41fb2e9296281e4f8d766f20b45e721f4c5c834cf68f\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE03\",\n \"group\" : \"2\",\n \"title\" : \"Shell Scripting\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KOLIPAKA SAGAR\",\n \"rollnum\" : 160116733303,\n \"sent\" : true,\n \"year\" : 2\n },\n \"fa1e98df343ebb91684d289ecf84d78c885e7237a442690e148b111b1a92a289\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS476\",\n \"group\" : \"4\",\n \"title\" : \"Software Reuse Techniques\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VELIGETI MANOJ\",\n \"rollnum\" : 160114733301,\n \"sent\" : true,\n \"year\" : 4\n },\n \"fa83f167cd8eec4e5b6ed3ccd33c6d3d9b56039ac5cb90c03d6852fd245177bb\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE03\",\n \"group\" : \"2\",\n \"title\" : \"Shell Scripting\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SHIVANI D\",\n \"rollnum\" : 160116733015,\n \"sent\" : true,\n \"year\" : 2\n },\n \"faad6564fd56f947ca0e88dbdb6c276111e929962b6f2a7c97ec781d1ee726fd\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"Y NANDINI\",\n \"rollnum\" : 160114733131,\n \"sent\" : true,\n \"year\" : 4\n },\n \"fb8dcb6e48438f84f710cf8215dd897ae443cb26a7e848779d5feb5c16ae3909\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE03\",\n \"group\" : \"2\",\n \"title\" : \"Shell Scripting\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"DAMERA RAM RAJ\",\n \"rollnum\" : 160116733328,\n \"sent\" : true,\n \"year\" : 2\n },\n \"fbc026f9f084d86463d632d94c3d7ba3e11f10e1c4c6a4aedc457324bf6fa534\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS351\",\n \"group\" : \"3\",\n \"title\" : \"Information Storage Management\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"THATI KAVYA\",\n \"rollnum\" : 160115733071,\n \"sent\" : true,\n \"year\" : 3\n },\n \"fc18ba4890aab3977c3efe7e1fe464610e3416d2db9ea7cc070f3375871fd439\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS474\",\n \"group\" : \"4\",\n \"title\" : \"Cyber Forensics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KOPPULA RAJENDER\",\n \"rollnum\" : 160114733107,\n \"sent\" : true,\n \"year\" : 4\n },\n \"fc544c3bc90deb1c073ebb241c9026ad3f871ba227c28046c4667c74d3d9f9e5\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VENKATA ASHOK REDDY K\",\n \"rollnum\" : 160116733113,\n \"sent\" : true,\n \"year\" : 2\n },\n \"fc641b167c3f795f47660260a3d8b7497c60ce6847eb492fc09aad4e9fc1f9b5\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS356\",\n \"group\" : \"3\",\n \"title\" : \"Soft Computing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"VIDIYALA SHASHANK\",\n \"rollnum\" : 160115733053,\n \"sent\" : true,\n \"year\" : 3\n },\n \"fc82e45dea1c90f5638284fea3cb7afc18481eab4ae2b000d60a82cce9a6ba64\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"BODDU VENU KARTHIK\",\n \"rollnum\" : 160114733177,\n \"sent\" : true,\n \"year\" : 4\n },\n \"fc8bf74251465f1fa53e3ee1a6794939f9228becfddf15e4898ee6dab3ac0aba\" : {\n \"email\" : \"[email protected]\",\n \"name\" : \"VEMULA SRINIVASA NIKHIL\",\n \"rollnum\" : 160114733173,\n \"sent\" : true,\n \"year\" : 4\n },\n \"fcadf5847462967192f4a29aff17d91df844064f41b8cd9860f2f747f618f0fc\" : {\n \"elective\" : {\n \"3\" : {\n \"code\" : \"CS352\",\n \"group\" : \"3\",\n \"title\" : \"Image Processing\",\n \"year\" : \"3\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KONUDULA VENKATARAMI REDDY\",\n \"rollnum\" : 160115733058,\n \"sent\" : true,\n \"year\" : 3\n },\n \"fcc2653d524f7378c400fd62a5bbfffd0ca64b9bfe4dd621148c3dd0e1aad100\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SRAVANTHI A\",\n \"rollnum\" : 160116733144,\n \"sent\" : true,\n \"year\" : 2\n },\n \"fcdb09bb5a20da5af2550f3da660f156aae4681cff29126234e720c5623e5cf8\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CS483\",\n \"group\" : \"5\",\n \"title\" : \"Machine Learning\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"RAJURI SUSMITHA\",\n \"rollnum\" : 160114733023,\n \"sent\" : true,\n \"year\" : 4\n },\n \"fd59601e3a23f1afb80907b0c006b59d11bfeaa91c2d39868e9767958aa52b30\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected] \",\n \"name\" : \"MOHAMEMD HASIBUDDIN\",\n \"rollnum\" : 160116733159,\n \"sent\" : true,\n \"year\" : 2\n },\n \"fe087449bca458250b9d7f295380c5949b8311101b3823214b8cece1f57145b3\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"HEPHZIBAH S\",\n \"rollnum\" : 160116733002,\n \"sent\" : true,\n \"year\" : 2\n },\n \"fe66c177a64783b16da608c7d98cd51bed6e401c1bf48c4d4fe1aa8cb4628188\" : {\n \"elective\" : {\n \"4\" : {\n \"code\" : \"CS471\",\n \"group\" : \"4\",\n \"title\" : \"Data science and big data analytics\",\n \"year\" : \"4\"\n },\n \"5\" : {\n \"code\" : \"CE422\",\n \"group\" : \"5\",\n \"title\" : \"Disaster Mitigation and Management\",\n \"year\" : \"4\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"KATTA DHEERA SAMEERA\",\n \"rollnum\" : 160114733126,\n \"sent\" : true,\n \"year\" : 4\n },\n \"ff45e7bef5c9eddebfdfca677ace8fde4a011ea7124f681576b11ddb947132d0\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"SAI KOUSHIK G\",\n \"rollnum\" : 160116733167,\n \"sent\" : true,\n \"year\" : 2\n },\n \"ff8b35415cf157ddd788f2bee613c23d7ce8b45610a0a34437b3372bbf0b0cb7\" : {\n \"elective\" : {\n \"2\" : {\n \"code\" : \"16CSE01\",\n \"group\" : \"2\",\n \"title\" : \"Linux Programming and Scripting Languages\",\n \"year\" : \"2\"\n }\n },\n \"email\" : \"[email protected]\",\n \"name\" : \"LALITHA T\",\n \"rollnum\" : 160116733078,\n \"sent\" : true,\n \"year\" : 2\n }\n}\nEOL;\n\t\t$elective_data = json_decode($elective_data);\n\n//\t\tforeach (\\App\\Student::all() as $student){\n//\t\t\t$student->email = '';\n//\t\t\t$student->save();\n//\t\t}\n\n \tforeach ($elective_data as $elective_datum){\n\n \t\t$student = Student::where('rollnum', $elective_datum->rollnum)->first();\n\n \t\tif( ! empty( $student) ){\n \t\t\t$student->email = $elective_datum->email;\n \t\t\t$student->user->email = $elective_datum->email;\n \t\t\t$student->user->save();\n \t\t\t$student->save();\n\t\t }\n\t }\n }", "function performPageFunctionality() {\n\t\t$GLOBALS['alphabet'] = array(\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \n\t\t\"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\");\n\t\t$difficulty = $_POST['difficulty'];\n\t\t$url = $this->createURL($difficulty, \"https://wordsapiv1.p.mashape.com/words?random=true&\");\n\t\t$randomWord = $this->retrieveRandomWord($url);\n\t\t$this->setSessionVariables($randomWord);\n\t}", "public function run()\n {\n $instructor = new instructor();\n $instructor->firstname = \"kamal\";\n $instructor->lastname = \"perera\";\n $instructor->email = \"[email protected]\";\n $instructor->category_id = 1;\n $instructor->module_id = 1;\n $instructor->save();\n\n $instructor = new instructor();\n $instructor->firstname = \"amal\";\n $instructor->lastname = \"wasantha\";\n $instructor->email = \"[email protected]\";\n $instructor->category_id = 1;\n $instructor->module_id = 2;\n $instructor->save();\n\n $instructor = new instructor();\n $instructor->firstname = \"nimal\";\n $instructor->lastname = \"hettiarachchi\";\n $instructor->email = \"[email protected]\";\n $instructor->category_id = 2;\n $instructor->module_id = 1;\n $instructor->save();\n\n $instructor = new instructor();\n $instructor->firstname = \"shehan\";\n $instructor->lastname = \"devinda\";\n $instructor->email = \"[email protected]\";\n $instructor->category_id = 2;\n $instructor->module_id = 2;\n $instructor->save();\n }", "function getAdjective() {\n\t\n\t\taddToDebugLog(\"getAdjective(), Function Entry - No parameters, INFO\");\n\t\n\t\t// Determine the consonant to use for the name\n\t\t$consonants = array(\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"y\", \"z\");\n\t\t$consonant = $consonants[rand(0, 20)];\n\t\n\t\t// Choose the title based on the consonant\n\t\t$filepath = \"lists/adjectives/\" . $consonant . \".txt\";\n\t\t$titles = file($filepath); // reads contents of select file into the array\n\t\t$titles_length = count($titles);\n\t\t$title = \"\";\n\t\twhile ($title == \"\") {\n\t\t\tsrand(make_seed());\n\t\t\t$title = $titles[rand(0, $titles_length)];\n\t\t}\n\t\n\t\taddToDebugLog(\"getAdjective(), Adjective: \" . $title . \", INFO\");\n\t\n\t\treturn $title;\n\t\n\t}", "public function demo()\n {\n // xu ly logic\n }", "public function vistorEyes(eyes $eyes)\n {\n echo 'This '.$eyes->getName().\"</br>\";\n }", "protected function getEgn()\n\t{\n\t\treturn $this->egn;\n\t}", "public function getEx5() {\n $books = \\App\\Book::all();\n $this->printBooks($books);\n }", "public function run()\n {\n $Locations = [\n [\"Sol\", 1, 1, 1, 1, 1],\n [\"Earth\", 2, 1, 2, 1, 1],\n [\"Luna\", 3, 1, 3, 1, 1],\n [\"Mercury\", 4, 1, 2, 1, 1],\n [\"Venus\", 5, 1, 2, 1, 1],\n [\"Mars\", 6, 1, 2, 1, 1],\n [\"Herschel Belt\", 7, 1, 7, 1, 1],\n [\"Jupiter\", 8, 1, 2, 1, 1],\n [\"Saturn\", 9, 1, 2, 1, 1],\n [\"Uranus\", 10, 1, 2, 1, 1],\n [\"Sol - Davien\", 11, 1, 6, 1, 1],\n [\"Neptune\", 12, 1, 2, 1, 1],\n [\"Pluto\", 13, 1, 4, 1, 1],\n [\"Sol - Croshaw\", 14, 1, 6, 1, 1],\n [\"Kuiper Belt\", 15, 1, 7, 1, 1],\n [\"TDD Kesner\", 16, 1, 5, 1, 1],\n [\"Phobos\", 17, 1, 3, 1, 1],\n [\"Deimos\", 18, 1, 3, 1, 1],\n [\"IMS Bolliver\", 19, 1, 5, 1, 2],\n [\"Ganymede\", 20, 1, 3, 1, 1],\n [\"Europa\", 21, 1, 3, 1, 1],\n [\"Io\", 22, 1, 3, 1, 1],\n [\"Callisto\", 23, 1, 3, 1, 1],\n [\"Tethys\", 24, 1, 3, 1, 1],\n [\"Rhea\", 25, 1, 3, 1, 1],\n [\"Iapetus\", 26, 1, 3, 1, 1],\n [\"Titan\", 27, 1, 3, 1, 1],\n [\"Dione\", 28, 1, 3, 1, 1],\n [\"INS Dunleavy\", 29, 1, 5, 1, 3],\n [\"Miranda\", 30, 1, 3, 1, 1],\n [\"Ariel\", 31, 1, 3, 1, 1],\n [\"Oberon\", 32, 1, 3, 1, 1],\n [\"Titania\", 33, 1, 3, 1, 1],\n [\"Umbriel\", 34, 1, 3, 1, 1],\n [\"Charon\", 35, 1, 3, 1, 1],\n [\"Pyro\", 36, 6, 1, 5, 4],\n [\"Pyro - Cano\", 37, 6, 6, 5, 4],\n [\"Pyro 1\", 38, 6, 2, 5, 4],\n [\"Akrio Cluster\", 39, 6, 7, 5, 4],\n [\"Pyro 2\", 40, 6, 2, 5, 4],\n [\"Pyro 3\", 41, 6, 2, 5, 4],\n [\"Pyro - Tera\", 42, 6, 6, 5, 4],\n [\"Pyro 4\", 43, 6, 2, 5, 4],\n [\"Pyro - Nyx\", 44, 6, 6, 5, 4],\n [\"Pyro 5\", 45, 6, 2, 5, 4],\n [\"Pyro - Stanton\", 46, 6, 6, 5, 4],\n [\"Pyro - Castra\", 47, 6, 6, 5, 4],\n [\"Pyro - Oso\", 48, 6, 6, 5, 4],\n [\"Pyro - Hadrian\", 49, 6, 6, 5, 4],\n [\"Pyro 6\", 50, 6, 6, 5, 4],\n [\"Tayac\", 51, 54, 1, 1, 1],\n [\"Tayac 1\", 52, 54, 2, 1, 1],\n [\"The Ark\", 53, 54, 5, 1, 1],\n [\"Tayac - Baker\", 54, 54, 6, 1, 1],\n [\"Tayac - Terra\", 55, 54, 6, 1, 1],\n [\"Tayac 2\", 56, 54, 2, 1, 1],\n [\"Tayac - Goss\", 57, 54, 6, 1, 1],\n [\"Shepherd\", 58, 54, 4, 1, 1],\n [\"Terra Nova\", 59, 68, 1, 1, 1],\n [\"Aero\", 60, 68, 2, 1, 1],\n [\"Pike\", 61, 68, 2, 1, 1],\n [\"Terra\", 62, 68, 2, 1, 1],\n [\"Gen\", 63, 68, 2, 1, 1],\n [\"Terra - Taranis\", 64, 68, 6, 1, 1],\n [\"Terra - Goss\", 65, 68, 6, 1, 1],\n [\"Terra - Stanton\", 66, 68, 6, 1, 1],\n [\"Terra - Pyro\", 67, 68, 6, 1, 1],\n [\"Terra - Magnus\", 68, 68, 6, 1, 1],\n [\"Terra - Hadrian\", 69, 68, 6, 1, 1],\n [\"Marisol Belt\", 70, 68, 7, 1, 1],\n [\"Henge Cluster\", 71, 68, 7, 1, 1],\n [\"IAS Hammett\", 72, 68, 5, 1, 1],\n [\"ICS Evolen\", 73, 68, 5, 1, 1],\n [\"INS Reilly\", 74, 68, 5, 1, 1],\n [\"Terra - Tayac\", 75, 68, 6, 1, 1],\n [\"Stanton\", 77, 49, 1, 1, 1],\n [\"Hurston\", 78, 49, 2, 1, 6],\n [\"Arccorp\", 79, 49, 2, 1, 7],\n [\"Crusader\", 80, 49, 2, 1, 8],\n [\"Covalex Hub Gundo\", 81, 49, 5, 1, 10],\n [\"Cry-Astro Service\", 82, 49, 5, 1, 11],\n [\"Commarray SCC\", 83, 49, 5, 1, 12],\n [\"ICC Scanhub Stanton\", 84, 49, 5, 1, 1],\n [\"Port Olisar\", 85, 49, 5, 1, 8],\n [\"Security Post Kareah\", 86, 49, 5, 1, 9],\n [\"Yela\", 87, 49, 3, 1, 1],\n [\"Daymar\", 88, 49, 3, 1, 1],\n [\"Cellin\", 89, 49, 3, 1, 1],\n [\"Ruin Station\", 90, 6, 5, 5, 5]\n ];\n\n foreach ($Locations as $LocationDatum) {\n Location::create([\n 'name' => $LocationDatum[0],\n 'system_id' => $LocationDatum[2],\n 'celestial_type_id' => $LocationDatum[3],\n 'allegiance_id' => $LocationDatum[4],\n 'affiliation_id' => $LocationDatum[5]\n ]);\n }\n }", "public function run()\n {\n $faker = Faker::create();\n $json_path = base_path('docs/realData/instructors.json');\n $handle = file_get_contents($json_path, \"r\");\n $zjson = json_decode($handle);\n // $pass = $faker->randomLetter.$faker->randomLetter.$faker->randomLetter.$faker->randomLetter.$faker->randomDigit.$faker->randomDigit; \n $c = Collect([]);\n $i=2;\n foreach($zjson->instructors as $j){\n $a = explode(\" \", $j->FullName);\n $un = $a[0].$a[1][0];\n if ($c->contains($un)) {\n $un = $un.$i;\n $c->push($un);\n $i++;\n }else{\n $c->push($un);\n }\n $e = App\\Models\\Employee::where(['id_number'=>$un])->first();\n $r = App\\Models\\Role::where(['name'=>$j->Rank])->first();\n $r2 = App\\Models\\Role::where(['code'=>'P_INS'])->first();\n $d = Modules\\Org\\Entities\\Department::where(['name'=>$j->DepartmentName])->first();\n App\\Models\\AssignedRole::create([\n \t'role_id' => $r->id,\n \t'roletaker_id' => $e->id,\n \t'roletaker_type' => 'employee',\n \t'rolegiver_id' => $d->id,\n \t'rolegiver_type' => 'Org\\\\Department'\n ]);\n App\\Models\\AssignedRole::create([\n \t'role_id' => $r2->id,\n \t'roletaker_id' => $e->id,\n \t'roletaker_type' => 'employee',\n \t'rolegiver_id' => $d->id,\n \t'rolegiver_type' => 'Org\\\\Department'\n ]);\n }\n }", "public function getE() {}", "public function run()\n {\n\t\tTactic::insert([['name'=>'Back Spread w/Calls'],\n\t\t\t\t\t ['name'=>'Back Spread w/Puts'],\n\t\t\t\t\t ['name'=>'Cash-Secured Put'],\n\t\t\t\t\t ['name'=>'Christmas Tree Butterfly w/Calls'],\n\t\t\t\t\t ['name'=>'Christmas Tree Butterfly w/Puts'],\n\t\t\t\t\t ['name'=>'Collar'],\n\t\t\t\t\t ['name'=>'Covered Call'],\n\t\t\t\t\t ['name'=>'Diagonal Spread w/Calls'],\n\t\t\t\t\t ['name'=>'Diagonal Spread w/Puts'],\n\t\t\t\t\t ['name'=>'Double Diagonal'],\n\t\t\t\t\t ['name'=>'Fig Leaf'],\n\t\t\t\t\t ['name'=>'Front Spread w/Calls'],\n\t\t\t\t\t ['name'=>'Front Spread w/Puts'],\n\t\t\t\t\t ['name'=>'Inverse Skip Strike Butterfly w/Calls'],\n\t\t\t\t\t ['name'=>'Inverse Skip Strike Butterfly w/Puts'],\n\t\t\t\t\t ['name'=>'Iron Butterfly'],\n\t\t\t\t\t ['name'=>'Iron Condor'],\n\t\t\t\t\t ['name'=>'Long Butterfly Spread w/Calls'],\n\t\t\t\t\t ['name'=>'Long Butterfly Spread w/Puts'],\n\t\t\t\t\t ['name'=>'Long Calendar Spread w/Calls'],\n\t\t\t\t\t ['name'=>'Long Calendar Spread w/Puts'],\n\t\t\t\t\t ['name'=>'Long Call'],\n\t\t\t\t\t ['name'=>'Long Call Spread'],\n\t\t\t\t\t ['name'=>'Long Combination'],\n\t\t\t\t\t ['name'=>'Long Condor Spread w/Calls'],\n\t\t\t\t\t ['name'=>'Long Condor Spread w/Puts'],\n\t\t\t\t\t ['name'=>'Long Put'],\n\t\t\t\t\t ['name'=>'Long Put Spread'],\n\t\t\t\t\t ['name'=>'Long Straddle'],\n\t\t\t\t\t ['name'=>'Long Strangle'],\n\t\t\t\t\t ['name'=>'Protective Put'],\n\t\t\t\t\t ['name'=>'Short Call'],\n\t\t\t\t\t ['name'=>'Short Call Spread'],\n\t\t\t\t\t ['name'=>'Short Combination'],\n\t\t\t\t\t ['name'=>'Short Put'],\n\t\t\t\t\t ['name'=>'Short Put Spread'],\n\t\t\t\t\t ['name'=>'Short Straddle'],\n\t\t\t\t\t ['name'=>'Short Strangle'],\n\t\t\t\t\t ['name'=>'Skip Strike Butterfly w/Calls'],\n\t\t\t\t\t ['name'=>'Skip Strike Butterfly w/Puts'],\n\t\t\t\t \t ['name'=>'Long Underlying'],\n\t\t\t\t\t ['name'=>'Short Underlying'],\n\t\t\t\t\t\t ]\n\t\t\t);\n }", "public function main() {\n\t\t$this->updatingDceInstancesWithoutRelation();\n\n\t\treturn $this->getOutput();\n\t}", "public function getExample() {\n return $this->program->getExample();\n }", "function run () {\n\t\tforeach ( $this->genes AS $gene ) {\n\t\t\t$this->createOrAmendGeneItem ( $gene ) ;\n\t\t}\n\t}", "public function test_scenario5() {\n\n $data = array(array('filename' => 'data/tiny_kdd.csv', \n 'local_file' => 'tmp/batch_predictions.csv', \n 'predictions_file' => 'data/batch_predictions_a.csv'));\n\n foreach($data as $item) {\n print \"I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source'));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"check local source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"check the dataset is ready \" . $dataset->resource . \" \\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 20000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"Then I create an anomaly detector from a dataset\\n\";\n $anomaly = self::$api->create_anomaly($dataset->resource);\n\n print \"I wait until the anomaly detector is ready\\n\";\n $resource = self::$api->_check_resource($anomaly->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"I create a batch anomaly score\\n\";\n $batch_prediction=self::$api->create_batch_anomaly_score($anomaly, $dataset);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $batch_prediction->code);\n\n print \"check a batch_predicion is ready\\n\";\n $resource = self::$api->_check_resource($batch_prediction, null, 50000, 50);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"download batch predictions file\\n\";\n $filename = self::$api->download_batch_anomaly_score($batch_prediction, $item[\"local_file\"]);\n $this->assertNotNull($filename);\n\n print \"i compare the prediction file is correct\\n\";\n $this->assertTrue(compareFiles($item[\"local_file\"], $item[\"predictions_file\"]));\n\n }\n }", "public function abono();" ]
[ "0.5639499", "0.56358", "0.55534256", "0.55534256", "0.5551649", "0.5551649", "0.5551649", "0.5527118", "0.54495835", "0.52223825", "0.52087295", "0.52068096", "0.5183525", "0.5149822", "0.51317835", "0.5123924", "0.51058584", "0.5081229", "0.50551164", "0.50381887", "0.50264555", "0.50241643", "0.50225747", "0.500423", "0.49931347", "0.49846384", "0.49658257", "0.49492386", "0.4947904", "0.4946067", "0.49321944", "0.49299952", "0.49136096", "0.48894382", "0.48670334", "0.48612967", "0.48470497", "0.48434204", "0.48412365", "0.48321018", "0.48258322", "0.48186713", "0.48016727", "0.4791251", "0.47895417", "0.47755164", "0.4774458", "0.47725216", "0.47694066", "0.47557557", "0.4751227", "0.47495842", "0.47456154", "0.47434402", "0.474024", "0.47247088", "0.47229576", "0.47118098", "0.4709484", "0.47063792", "0.47049835", "0.46924835", "0.4692269", "0.4685422", "0.4685204", "0.4684452", "0.46808025", "0.46793056", "0.46791393", "0.4673907", "0.46710098", "0.46674985", "0.46665266", "0.46554768", "0.4651688", "0.4649003", "0.46450278", "0.46341118", "0.46279505", "0.4626569", "0.4619808", "0.46158117", "0.46148187", "0.461083", "0.46105793", "0.46088266", "0.46088156", "0.46081755", "0.45939463", "0.45935878", "0.45901993", "0.4581293", "0.45765924", "0.45736077", "0.45673683", "0.45657453", "0.45634216", "0.45627862", "0.45609888", "0.4560801", "0.45607233" ]
0.0
-1
Create a new instance and fill it from a JSON object.
public function __construct(int $statusCode, Data $data) { parent::__construct($statusCode, $data); $this->setDataReleaseId($data->dataReleaseID) ->setStations($data->stations); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct($json) {\n if (is_null($json)) {\n $json = new \\stdClass();\n }\n\n $this->json = $json;\n }", "public static function from_json($json)\n\t\t{\n\t\t\t$model = get_called_class();\n\t\t\treturn new $model(\\System\\Json::decode($json));\n\t\t}", "public function __construct($json) {\n $this->json = $json;\n }", "public function __construct($json)\n\t{\n\t\t$this->json = $json;\n\t\t$values = json_decode($json, true);\n\n\t\t$this->count = count($values);\n\n\t\tforeach ($values as $key => $value)\n\t\t{\n\t\t\t$this->$key = $value;\n\t\t}\n\t}", "function __construct($obj){\n parent::__construct($obj);\n $this->parseJSON($obj);\n }", "static function from_json($data)\r\n {\r\n $decoded = json_decode($data, true);\r\n $decoded[\"admission_date\"] .= \" \" . $decoded[\"admission_time\"];\r\n $person = new Person();\r\n $person->from_array($decoded);\r\n if ((isset($decoded[\"id\"])) && (!empty($decoded[\"id\"]))){\r\n $person->id = $decoded[\"id\"];\r\n }\r\n return $person;\r\n }", "public static function createFromJson($json);", "public static function fromJson(string $json): self\n {\n $instance = new self(self::TYPE_JSON);\n $instance->setJson($json);\n\n return $instance;\n }", "public function fromJSON($jsonObjectAsString)\n {\n // when the person was saved as JSON.\n $this->personState = json_decode($jsonObjectAsString, true);\n return $this;\n }", "public function __construct($jsonData) {\n return parent::assignValues($this, $jsonData);\n }", "public static function createFromJson(string $json): self\n {\n $data = json_decode($json, true);\n\n return new self((bool) $data['status'], $data['returnData']);\n }", "public function __construct( $json = null )\n {\n if( $json )\n {\n $this->decodeJSONableArray($json);\n }\n else\n {\n $this->setTimestamp();\n //$this->setID();\n }\n }", "public static function load($json)\n {\n return self::create(json_decode($json));\n }", "static public function fromJson($asJson) {\n\t\treturn static::fromArray(json_decode($asJson,true));\n\t}", "abstract public static function fromJson(string|Type\\AbstractObject $json, array $options = []): Entity;", "private function construct() {\n\n\t\t$this->is_json_valid = [\n\t\t\t'amp' => true,\n\t\t\t'nonamp' => true,\n\t\t];\n\n\t\t$this->init();\n\t}", "public function fromJSON($jsonData) {\n $this->reset();\n $this->_values = json_decode($jsonData);\n return $this;\n }", "public static function createFromJson($json)\n {\n $obj = json_decode($json);\n if ($obj && self::validate($obj)) {\n $product = new Product();\n $product->name = $obj->name;\n $product->description = $obj->description;\n $product->brand_id = $obj->brand;\n $product->barcode = $obj->barcode;\n return $product;\n }\n throw new \\Exception(\"Invalid JSON\");\n }", "public static function fromJson(string $json): self\n {\n $array = json_decode($json, true);\n return static::fromArray($array);\n }", "static function fromJson($json) {\n $obj = json_decode($json); // of stdClass\n $strategy = $obj->{'strategy'};\n $board = $obj->{'board'};\n $game = new Game();\n $game->board = Board::fromJson($board);\n $name = $strategy->{'name'};\n $game->strategy = $name::fromJson($strategy);\n $game->strategy->board = $game->board;\n return $game;\n }", "protected function createObject($jsonObject) {\n }", "public static function fromJSON(string $json): self\n {\n $jsonArray = json_decode($json, true);\n return self::fromArray($jsonArray);\n }", "function __construct($data) {\n\t\t$this->data = json_decode($data, true);\n\t}", "public function initialise($json, $smsObject)\n {\n// $this->smsObject = $smsObject;\n// $person = json_decode($json);\n// $this->consciousness = $person->consciousness;\n// $this->alive = $person->alive;\n// $this->id = $person->_id;\n }", "public function __construct(?string $json = null)\n {\n parent::__construct();\n\n if ($json) {\n $this->fillFromJson($json);\n }\n }", "public function setJson($json): static\n {\n $this->data = $json;\n\n return $this->update();\n }", "public function fromJson(string $json){\n $this->content = json_decode($json);\n if(array_key_exists($this->idField, $this->content)){//verifica se possui id se sim seta o id; mesmo comportamento de formArray;\n $this->{$this->idField} = $this->content[$this->idField];\n }\n }", "public function __construct()\n\t {\n\t \t $data = SkrillPsp_Json::getPaySafeCardPAJson();\n\t \t $this->json = $this->decode($data, true);\n\t \t $this->json['id'] = $this->setId();\n\t }", "public static function createFromJson(string $json): self\n {\n $data = json_decode($json, true, 512, JSON_THROW_ON_ERROR);\n if (! is_array($data)) {\n throw new InvalidArgumentException('Invalid argument.');\n }\n\n return new self($data);\n }", "public function __construct($value = null)\n {\n if ($value) {\n $data = json_decode($value);\n foreach ($data as $key => $val) {\n if (property_exists($this, $key))\n $this->$key = $val;\n }\n }\n }", "public static function create()\n {\n return new JsonBuilder(array());\n }", "public static function createFromJson($json, $options = 0, $depth = 512)\n {\n return new static(json_decode($json, true, $depth, $options));\n }", "public function __construct()\n \t {\n \t \t parent::__construct();\n \t \t $data = SkrillPsp_Json::getQIWIJson();\n \t \t $this->json = $this->decode($data, true);\n \t \t $this->json['id'] = $this->setId();\n \t \t $this->json['method'] = $this->method;\n \t }", "public static function fromJson(string $json_data): CacheItem\n {\n $json_data = json_decode($json_data, true);\n return new self(\n $json_data['filename'],\n $json_data['render_time'],\n $json_data['expiry_date'],\n $json_data['popularity'],\n $json_data['tags']\n );\n }", "public static function fromJson(&$json, string $className)\n {\n $data = array();\n\n foreach ($json as $key => $value) {\n $varType = $className::getType($key);\n\n if ($varType == Schema::PRIMITIF_TYPE) {\n $data[$key] = $value;\n } elseif (substr($varType,0,5) == \"array\"){\n $class = substr($varType,5);\n $list= array();\n foreach ($value as $subValue){\n array_push($list, self::fromJson($subValue, $class));\n }\n $data[$key] = $list;\n\n }\n else {\n $data[$key] = self::fromJson($value, $varType);\n }\n }\n\n return new $className($data);\n }", "public function __construct( JSONRequest $req, $mixed = null );", "function fill($json_array) {\n if ($json_array === null) throw new Exception('no Activity data provided');\n // verify that certain required properties are set\n $valid = self::validateActivity($json_array);\n if ($valid === false) throw new Exception('invalid Activity data');\n\n // loads the array into the object, isn't this nice\n $this->activity_array = $json_array;\n $this->new = false;\n if (!isset($this->activity_array['id'])) $this->activity_array['id'] = \"https://\". $_SERVER['HTTP_HOST'] .\"/ap/actor/\". uniqid(); // need a proper path later\n\n // Should probably do something with the @context array to identify unrecognized properties and decide how to handle them\n // but that can wait until later, when the capability for handling a variety of things Actually Exists\n unset($this->activity_array['@context']);\n if (!isset($this->activity_array['object'])) $this->activity_array['object'] = null;\n\n // assign public values to appropriate variables\n $this->actor = &$this->activity_array['actor'];\n $this->type = &$this->activity_array['type'];\n $this->obj = &$this->activity_array['object'];\n $this->address = [];\n if (isset($this->activity_array['to'])) $this->address['to'] = &$this->activity_array['to'];\n if (isset($this->activity_array['cc'])) $this->address['cc'] = &$this->activity_array['cc'];\n if (isset($this->activity_array['bcc'])) $this->address['bcc'] = &$this->activity_array['bcc'];\n }", "private function _JsonData() \n {\n $raw = file_get_contents('php://input', true);\n $body = json_decode($raw);\n \n $this->__new((array) $body);\n }", "function __construct($fromJSON, $src, $con) {\n $this->con = $con;\n if($fromJSON) {\n $this->constructFromJSON($src);\n }\n else {\n $this->loadFromDatabase($src);\n }\n }", "public function fromJson($str_json_file)\n {\n if(!file_exists($str_json_file)) {\n throw new \\Exception(\"Could not find file: {$str_json_file}\");\n }\n $obj_json = json_decode(file_get_contents($str_json_file));\n if(!$obj_json) {\n throw new \\Exception(\"Unable to load JSON from file: {$str_json_file}\");\n }\n return $this->build($obj_json);\n }", "public function __construct(\\OpenCloud\\Service $service, $json=NULL) {\n\t\tif (!$json)\n\t\t\treturn;\n\t\t$obj = json_decode($json);\n\t\tif ($this->CheckJsonError())\n\t\t\treturn;\n\t\tparent::__construct($service, $obj);\n\t}", "public function init_from_json($json, $from = Bean::SOURCE_STRING)\n {\n if($from == Bean::SOURCE_STRING)\n {\n $array = @json_decode($json,true);\n }\n\n if($from == Bean::SOURCE_FILE || Bean::SOURCE_URL)\n {\n $js_array = @file_get_contents($json);\n $array = @json_decode($js_array,true);\n }\n\n if(isset($value[0]) && count($value[0])) \n {\n foreach($value[0] as $key => $val)\n {\n $this->set($key,$val); \n }\n } \n }", "public static function fromJson(string $json): static\n {\n $dataArray = json_decode($json, true);\n\n $message = self::checkAndGetKey($dataArray, self::KEY_MESSAGE, self::DEFAULT_MESSAGE);\n $code = self::checkAndGetKey($dataArray, self::KEY_CODE, self:: DEFAULT_CODE);\n\n $dto = new BaseApiDTO();\n $dto->setMessage($message);\n $dto->setCode($code);\n\n return $dto;\n }", "function __construct($json)\n {\n // Remove problematic characters for JSON parsing\r\n $json = str_replace(array(\"\\\\'\", '\\\\\"'), array(\"'\", \"''\"), $json);\r\n $this->jsonList = json_decode($json);\r\n pm_logDebug(3, $this->jsonList);\n }", "protected function instantiateJsonResource($payload)\n {\n return new JsonResource($payload);\n }", "public static function newFromJson( array $json ): self {\n\t\treturn new self(\n\t\t\t$json['lat'],\n\t\t\t$json['lon'],\n\t\t\t$json['globe'],\n\t\t\t$json\n\t\t);\n\t}", "public function jsonToObject($json){\n \n $this->nombre = $json->nombreDepartamento;\n return $this;\n }", "public static function fromJson($data, $depth = 0)\n {\n// 18.02.2015 - php 5.2\n// return JsonHalFactory::fromJson(new static(), $data, $depth);\n\n $class = get_class(new FikenHal());\n return JsonHalFactory::fromJson(new $class(), $data, $depth);\n }", "public function __construct() {\n try {\n $sampleData = \\Helper::loadJSONData();\n $this->user = $sampleData['Users'];\n $this->roles = $sampleData['Roles'];\n $this->permissionsData = $sampleData['Permissions'];\n } catch (\\Exception $e) {\n return response()->json(['status' => 'error', 'message' => $e->getMessage()], 401);\n }\n }", "public static function fromJson($json, $group = NULL, $object = NULL)\n\t{\n\t\tif (is_array($json)) {\n\t\t\t// ok, nothing to do here\n\t\t} elseif (is_string($json)) {\n\t\t\t$decoded = json_decode($json, true);\n\t\t\tif ($decoded === null && $json !== '' && strcasecmp($json, 'null')) {\n\t\t\t\tthrow new \\InvalidArgumentException('Could not decode given JSON: ' . $json . '.');\n\t\t\t}\n\t\t\t$json = $decoded;\n\t\t} else {\n\t\t\tthrow new \\InvalidArgumentException('Expected array, or string, ' . gettype($json) . ' given.');\n\t\t}\n\n\t\treturn self::fromObject($json, 'json:' . $group, $object);\n\t}", "public function __construct()\n\t {\n\t \t parent::__construct();\n\t \t $data = SkrillPsp_Json::getPaySafeCardCreateDispositionJson();\n\t \t $this->json = $this->decode($data, true);\n\t \t $this->json['id'] = $this->setId();\n\t }", "public function __construct(stdClass $data_obj) {\n\t\t$this->init_from_data($data_obj);\n\t}", "public function __construct()\n\t{\n\t\t$this->data = \\json_decode(\\file_get_contents('php://input'), true);\n\t}", "static function fromJson($json){\n $obj = json_decode($json);\n $width = $obj['width'];\n $height = $obj['height'];\n $places = $obj;\n }", "private function init(): void {\n\t\t$this->required = $this->json['required'] ?? array();\n\t\t$this->additional_properties = $this->json['additionalProperties'] ?? false;\n\t\t$this->required = $this->json['required'] ?? array();\n\n\t\t$properties = $this->json['properties'] ?? array();\n\t\t$definitions = $this->json['definitions'] ?? array();\n\t\t$all_of = $this->json['allOf'] ?? array();\n\n\t\tforeach ( $definitions as $key => $definition ) {\n\t\t\t$this->definitions[ $key ] = self::from_json( $this->get_name() . '/definitions/' . $key, array( 'properties' => $definition ) );\n\t\t}\n\n\t\tforeach ( $properties as $key => $property ) {\n\t\t\t// If object, create a new schema.\n\t\t\tif ( 'object' === ( $property['type'] ?? '' ) ) {\n\t\t\t\t$this->properties[ $key ] = self::from_json( $this->get_name() . '/properties/' . $key, $property );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( self::REF__KEY === $key ) {\n\t\t\t\t$this->properties[ $key ] = $this->get_reference( $property );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->properties[ $key ] = Property::from_json( $this, $key, $property );\n\t\t}\n\n\t\tforeach ( $all_of as $one_key => $one_value ) {\n\t\t\t$key = array_key_first( $one_value );\n\t\t\t$value = $one_value[ $key ];\n\n\t\t\tswitch ( $key ) {\n\t\t\t\tcase self::REF__KEY:\n\t\t\t\t\t$reference = $this->get_reference( $value );\n\t\t\t\t\t$this->properties = array_merge( $this->properties, $reference->get_properties() );\n\t\t\t\t\t$this->required = array_merge( $this->required, $reference->get_required() );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'properties':\n\t\t\t\t\t$one_prop = self::from_json( $this->get_name() . '/oneof/' . $one_key, $one_value );\n\t\t\t\t\t$this->properties = array_merge( $this->properties, $one_prop->get_properties() );\n\t\t\t\t\t$this->required = array_merge( $this->required, $one_prop->get_required() );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function __construct($json)\n {\n if (array_key_exists('hash', $json)) {\n $this->hash = $json['hash'];\n }\n if (array_key_exists('ver', $json)) {\n $this->version = $json['ver'];\n }\n if (array_key_exists('prev_block', $json)) {\n $this->previous_block = $json['prev_block'];\n }\n if (array_key_exists('mrkl_root', $json)) {\n $this->merkle_root = $json['mrkl_root'];\n }\n if (array_key_exists('time', $json)) {\n $this->time = $json['time'];\n }\n if (array_key_exists('bits', $json)) {\n $this->bits = $json['bits'];\n }\n if (array_key_exists('fee', $json)) {\n $this->fee = Conversion::btcInt2Str($json['fee']);\n }\n if (array_key_exists('nonce', $json)) {\n $this->nonce = $json['nonce'];\n }\n if (array_key_exists('n_tx', $json)) {\n $this->n_tx = $json['n_tx'];\n }\n if (array_key_exists('size', $json)) {\n $this->size = $json['size'];\n }\n if (array_key_exists('block_index', $json)) {\n $this->block_index = $json['block_index'];\n }\n if (array_key_exists('main_chain', $json)) {\n $this->main_chain = $json['main_chain'];\n }\n if (array_key_exists('height', $json)) {\n $this->height = $json['height'];\n }\n if (array_key_exists('received_time', $json)) {\n $this->received_time = $json['received_time'];\n }\n if (array_key_exists('relayed_by', $json)) {\n $this->relayed_by = $json['relayed_by'];\n }\n if (array_key_exists('tx', $json)) {\n foreach ($json['tx'] as $tx) {\n $this->transactions[] = new Transaction($tx);\n }\n }\n }", "public function __construct( $raw_response_json ) {\n\n\t\t$this->raw_response_json = $raw_response_json;\n\n\t\t$this->response_data = json_decode( $raw_response_json );\n\t}", "protected function setUp()\n {\n parent::setUp();\n\n $json = '{\"title\": \"Example\", \"link\": \"http://example.com\", \"snippet\": \"Snippet\", \"htmlSnippet\": \"<strong>htmlSnippent</strong>\"}';\n $serializer = SerializerBuilder::create()->build();\n $this->item = $serializer->deserialize($json, Item::class, 'json');\n }", "public static function fromJson($json) {\r\n\t\treturn \\json_decode($json, true);\r\n\t}", "public static function buildFromJSON($json)\r\n\t{\r\n\t\t$json = json_decode($json);\r\n\t\t\r\n\t\t$builder = new PersonObjectBuilder();\r\n\t\t$builder->objectID($json->objectID)\r\n\t\t\t\t->globalID($json->globalID)\r\n\t\t\t\t->displayName($json->displayName);\r\n\t\t\t\t\r\n\t\tif(property_exists($json, 'profilePicture'))\r\n\t\t\t$builder->profilePicture($json->profilePicture);\r\n\t\t\t\r\n\t\tif(property_exists($json, 'profilePictureThumbnail'))\r\n\t\t\t$builder->profilePictureThumbnail($json->profilePictureThumbnail);\r\n\t\t\r\n\t\tif(property_exists($json, 'language'))\r\n\t\t\t$builder->language($json->language);\r\n\t\t\r\n\t\treturn $builder->build();\r\n\t}", "public function __construct($environment) {\n\t\t$this->_environment = $environment;\n\t\t$this->_jsonStructure = new \\stdClass();\n\t}", "public function jsonToObject(): ?ViaCepApi {\n if ($this->responseType == \"json\" && $this->response != \"[]\") {\n $this->responseType = \"object\";\n $this->response = (object) json_decode($this->response);\n }\n \n return $this; \n }", "public static function fromJson($json) {\n $jsonObj = json_decode($json);\n $newProject = new Project();\n $newProject->setId($jsonObj->{'id'});\n $newProject->setTitle($jsonObj->{'title'});\n $newProject->setDescription($jsonObj->{'description'});\n $newProject->setStartDate($jsonObj->{'start_date'});\n $newProject->setDuration($jsonObj->{'duration'});\n $newProject->setKeyWords($jsonObj->{'key_words'});\n $newProject->setCategories($jsonObj->{'categories'});\n $newProject->setFundingSought($jsonObj->{'funding_sought'});\n $newProject->setFundingNow($jsonObj->{'funding_now'});\n $newProject->setOwnerAccount($jsonObj->{'owner_account'});\n return $newProject;\n }", "public function __construct($referenceId = null)\n\t {\n\t \t $data = SkrillPsp_Json::getReversalJson();\n\t \t $this->json = $this->decode($data, true);\n\t \t \n\t \t $this->json['id'] = $this->setId();\n\t \t $this->referenceId = $referenceId;\n\t \t \n\t \t if(!empty($this->referenceId)) {\n\t \t \t$this->json['params']['identification']['referenceid'] = $this->referenceId;\n\t \t }\n\t }", "public function withJsonType(string $type): self\n {\n $input = clone $this;\n $input->jsonTypes[] = $type;\n\n return $input;\n }", "public function testFromJSON()\n {\n $patch = new Patch();\n $patch->addOperation(new Operation\\Add('/foo', 'bar'));\n $patch->addOperation(new Operation\\Copy('/foo', '/bar'));\n $patch->addOperation(new Operation\\Move('/foo', '/bar'));\n $patch->addOperation(new Operation\\Remove('/foo'));\n $patch->addOperation(new Operation\\Replace('/foo', 'bar'));\n $patch->addOperation(new Operation\\Test('/foo', 'bar'));\n\n $this->assertEquals($patch, Patch::fromJSON($patch));\n }", "public function updateFromJson($json)\n {\n $obj = json_decode($json);\n if ($obj && self::validate($obj, false)) {\n $this->name = $obj->name;\n $this->description = $obj->description;\n $this->brand_id = $obj->brand;\n } else {\n throw new \\Exception(\"Bad format exception\");\n }\n }", "public function fromJson($json){\n\t\t// FIXME: right now this only supports the official PHP JSON extension,\n\t\t// which is officially part of the language as of 5.2, and exists\n\t\t// as a PECL extension prior to that. It might be good to update\n\t\t// this to support PEAR JSON, Zend_Json, etc...\n\t\treturn json_decode($json);\n\t}", "public function __construct($data)\n {\n $this->hydrate($data);\n }", "public function testSerializationDeserialization()\n {\n $obj = new LookupDataEntry(self::getJson());\n $this->assertNotNull($obj);\n $this->assertNotNull($obj->getKey());\n $this->assertNotNull($obj->getValue());\n $this->assertEquals(self::getJson(), $obj->toJson());\n return $obj;\n }", "public static function from_json( Schema $parent, string $id, array $property ): Property {\n\t\t$that = self::get_instance( $parent->get_id() . '-' . $id );\n\n\t\tif ( ! $that->schema ) {\n\t\t\t$that->schema = $parent;\n\t\t\t$that->property = $property;\n\t\t\t$that->init();\n\t\t}\n\n\t\treturn $that;\n\t}", "public static function fromJson($data)\n {\n return json_decode($data, true);\n }", "public static function fromJson($obj) {\n if ($obj === null) {\n return null;\n }\n\n $result = new Contact(array(\n \"id\" => isset($obj->id) ? $obj->id : null,\n \"addresses\" => isset($obj->addresses) ? Json::unpackArray(\"Address\", $obj->addresses) : null,\n \"appnotifications\" => isset($obj->appnotifications) ? $obj->appnotifications : null,\n \"apponboardingstatus\" => isset($obj->apponboardingstatus) ? $obj->apponboardingstatus : null,\n \"appoptin\" => isset($obj->appoptin) ? Appoptin::fromJson($obj->appoptin) : null,\n \"appphone\" => isset($obj->appphone) ? $obj->appphone : null,\n \"apptoken\" => isset($obj->apptoken) ? $obj->apptoken : null,\n \"birthdate\" => isset($obj->birthdate) ? Json::unpackTimestamp($obj->birthdate) : null,\n \"company\" => isset($obj->company) ? $obj->company : null,\n \"customertitleid\" => isset($obj->customertitleid) ? $obj->customertitleid : null,\n \"email\" => isset($obj->email) ? $obj->email : null,\n \"firstname\" => isset($obj->firstname) ? $obj->firstname : null,\n \"image\" => isset($obj->image) ? $obj->image : null,\n \"languagecode\" => isset($obj->languagecode) ? $obj->languagecode : null,\n \"lastname\" => isset($obj->lastname) ? $obj->lastname : null,\n \"lookup\" => isset($obj->lookup) ? $obj->lookup : null,\n \"middlename\" => isset($obj->middlename) ? $obj->middlename : null,\n \"optins\" => isset($obj->optins) ? Json::unpackArray(\"ContactOptIn\", $obj->optins) : null,\n \"organizationfunction\" => isset($obj->organizationfunction) ? $obj->organizationfunction : null,\n \"phonenumbers\" => isset($obj->phonenumbers) ? Json::unpackArray(\"Phonenumber\", $obj->phonenumbers) : null,\n \"relationships\" => isset($obj->relationships) ? Json::unpackArray(\"ContactRelationship\", $obj->relationships) : null,\n \"relationtypes\" => isset($obj->relationtypes) ? $obj->relationtypes : null,\n \"sendmail\" => isset($obj->sendmail) ? $obj->sendmail : null,\n \"sex\" => isset($obj->sex) ? $obj->sex : null,\n \"status\" => isset($obj->status) ? $obj->status : null,\n \"subscribed\" => isset($obj->subscribed) ? $obj->subscribed : null,\n \"vatnumber\" => isset($obj->vatnumber) ? $obj->vatnumber : null,\n \"isdeleted\" => isset($obj->isdeleted) ? $obj->isdeleted : null,\n \"createdts\" => isset($obj->createdts) ? Json::unpackTimestamp($obj->createdts) : null,\n \"lastupdatets\" => isset($obj->lastupdatets) ? Json::unpackTimestamp($obj->lastupdatets) : null,\n ));\n\n $result->custom_fields = array();\n foreach ($obj as $key => $value) {\n if (substr($key, 0, 2) === \"c_\") {\n $key = substr($key, 2);\n $result->custom_fields[$key] = $value;\n }\n }\n\n return $result;\n }", "public static function deserialize() {\r\n return new Location(json_decode($json, true));\r\n }", "public function jsonToObject($json){\n \n $this->nombre = $json->nombreGrupo;\n return $this;\n }", "public function loadInfoJson(?string $loadInfoJson): self\n {\n $new = clone $this;\n $new->loadInfoJson = $loadInfoJson;\n\n return $new;\n }", "public function createFromResponse(): Article\n {\n return new Article((array) $this);\n }", "public function __construct($jsonFile)\n {\n $this->file = $jsonFile;\n $this->isValidJson();\n }", "static public function fromObj($anObj) {\n\t\t$theClassName = get_called_class();\n\t\t$o = new $theClassName();\n\t\treturn $o->setDataFrom($anObj);\n\t}", "public static function fromJSON(\\stdClass $json)\n {\n return new Station(\n $json->id,\n $json->code_name,\n $json->full_name,\n\n $json->x,\n $json->y, // Not an error\n\n $json->is_visible,\n $json->is_safe,\n $json->is_portal,\n $json->is_intersection\n );\n }", "public function importJson($json)\n {\n $data = @ (array) json_decode($json, true);\n\n $id = isset($data['id']) ? $data['id'] : '';\n $group = isset($data['group']) ? $data['group'] : '';\n $email = isset($data['email']) ? $data['email'] : '';\n $firstName = isset($data['first_name']) ? $data['first_name'] : '';\n $lastName = isset($data['last_name']) ? $data['last_name'] : '';\n $billingStreet = isset($data['billing_street']) ? $data['billing_street'] : '';\n $billingCity = isset($data['billing_city']) ? $data['billing_city'] : '';\n $billingState = isset($data['billing_state']) ? $data['billing_state'] : '';\n $billingZipcode = isset($data['billing_zipcode']) ? $data['billing_zipcode'] : '';\n $isShippingSame = isset($data['is_shipping_same']) ? $data['is_shipping_same'] : '';\n $shippingStreet = isset($data['shipping_street']) ? $data['shipping_street'] : '';\n $shippingCity = isset($data['shipping_city']) ? $data['shipping_city'] : '';\n $shippingState = isset($data['shipping_state']) ? $data['shipping_state'] : '';\n $shippingZipcode = isset($data['shipping_zipcode']) ? $data['shipping_zipcode'] : '';\n\n $this->setId($id)\n ->setGroup($group)\n ->setEmail($email)\n ->setFirstName($firstName)\n ->setLastName($lastName)\n ->setBillingStreet($billingStreet)\n ->setBillingCity($billingCity)\n ->setBillingState($billingState)\n ->setBillingZipcode($billingZipcode)\n ->setIsShippingSame($isShippingSame)\n ->setShippingStreet($shippingStreet)\n ->setShippingCity($shippingCity)\n ->setShippingState($shippingState)\n ->setShippingZipcode($shippingZipcode)\n ;\n\n return $this;\n }", "public function createJsonParser(): JsonParser\n {\n return new JsonParser();\n }", "public function __construct($data)\n {\n // notice it's not included in the \"toArray\" method.\n $this->instance = $data['instance'];\n $this->id = $data['id'];\n $this->dom = $data['dom'];\n $this->data = $data['data'];\n $this->name = $data['name'];\n $this->checksum = $data['checksum'];\n $this->children = $data['children'];\n $this->events = $data['events'];\n }", "public static function fromJson($json)\n {\n $response = new Response();\n $response->job_id = $json->job_id;\n $response->status = $json->status;\n if ($response->msgs){\n $response->msgs = $json->msgs;\n }\n $response->data = $json->data;\n\n return $response;\n }", "protected function _initObject($component, array $args = array())\n {\n $object = new $component['class']();\n foreach ($args as $key => $value) {\n $method = 'set' . $this->_normalizeKey($key);\n $object->$method($value);\n }\n\n return $object;\n }", "public function __construct($searchString){\n if(is_null(static::$searchGenerator))\n static::$searchGenerator = new SearchGenerator();\n\n $this->json = static::$searchGenerator->Generate($searchString);\n }", "public function __construct($jsonFile = null)\n {\n $path = pathinfo($jsonFile);\n\n if (!isset($path['extension']) && !is_null($jsonFile)) {\n parent::__construct($jsonFile);\n }\n\n if (!is_null($jsonFile) && isset($path['extension'])) {\n $this->import($jsonFile);\n $this->_file = $this->_path;\n }\n }", "public function newInstance(): object;", "public function testCreatingObjectShouldHydrateProps()\n {\n $url = new ShortenedUrlDto(\n 'id',\n 'redirect',\n 'uri',\n 3\n );\n\n $this->assertEquals('id', $url->getId());\n $this->assertEquals('redirect', $url->getRedirectUrl());\n $this->assertEquals('uri', $url->getUri());\n $this->assertEquals(3, $url->getCount());\n }", "public static function obtainFromJSON($json) {\n $msgJSONDecode = json_decode( stripslashes($json) );\n \n $issue = $msgJSONDecode->issue;\n $message = $msgJSONDecode->message;\n $email = $msgJSONDecode->email;\n \n return new Message($issue, $message, $email); \n }", "function fill($json_array, $wrapped=true) {\n // true means that it does, false means that it does not\n if ($wrapped) parent::fill($json_array);\n\n // if $wrapped is false, $json_array is an AP Object which needs to be wrapped in a Create activity\n else { // verify valid ActivityPub object\n if ($json_array === null) throw new Exception('cannot create null Activity');\n $valid = self::validateObject($json_array);\n if ($valid === false) throw new Exception('invalid Create Object data');\n\n // initialize activity_array and start filling with the Activity properties\n $this->activity_array = [];\n $this->new = false;\n $this->activity_array['object'] = $json_array;\n $this->activity_array['type'] = \"Create\";\n // need proper generated IDs later\n unset($this->activity_array['object']['@context']);\n $this->activity_array['id'] = \"https://\". $_SERVER['HTTP_HOST'] .\"/ap/actor/\". uniqid(); // fix this URI generation\n $this->activity_array['object']['id'] = \"https://\". $_SERVER['HTTP_HOST'] .\"/posts/actor/\". uniqid(); // this one too\n\n $this->activity_array['actor'] = $this->activity_array['object']['attributedTo'];\n\n // assign the newly-applied Activity properties to the relevant variables\n $this->actor = &$this->activity_array['actor'];\n $this->type = &$this->activity_array['type'];\n $this->obj = &$this->activity_array['object'];\n $this->address = [];\n if (isset($this->activity_array['cc'])) $this->address['cc'] = &$this->activity_array['cc'];\n if (isset($this->activity_array['bcc'])) $this->address['bcc'] = &$this->activity_array['bcc'];\n\n if (isset($this->activity_array['object']['published'])) {\n $this->activity_array['published'] = $this->activity_array['object']['published'];\n }\n if (isset($this->activity_array['object']['to'])) {\n $this->activity_array['to'] = $this->activity_array['object']['to'];\n $this->address['to'] = &$this->activity_array['to'];\n }\n if (isset($this->activity_array['object']['cc'])) {\n $this->activity_array['cc'] = $this->activity_array['object']['cc'];\n $this->address['cc'] = &$this->activity_array['cc'];\n }\n if (isset($this->activity_array['object']['bcc'])) {\n $this->activity_array['bcc'] = $this->activity_array['object']['bcc'];\n $this->address['bcc'] = &$this->activity_array['bcc'];\n }\n }\n }", "public function create(){}", "public function mapJsonToEntity($json, $responseEntity)\n {\n\n $item = new $responseEntity($this);\n\n $item->mapValuesFromJson($json);\n\n return $item;\n\n }", "private static function init() \n {\n $object = Item::getObjectById($this->id);\n\n $this->name = $object['name'];\n $this->status = $object['status'];\n }", "public function constructionWithObject()\n {\n $equalValidator = new stubEqualValidator(new stdClass());\n }", "public static function fromJson($obj) {\n if ($obj === null) {\n return null;\n }\n\n $result = new DeliveryScenario(array(\n \"id\" => isset($obj->id) ? $obj->id : null,\n \"typeid\" => isset($obj->typeid) ? $obj->typeid : null,\n \"name\" => isset($obj->name) ? $obj->name : null,\n \"allowetickets\" => isset($obj->allowetickets) ? $obj->allowetickets : null,\n \"availability\" => isset($obj->availability) ? DeliveryscenarioAvailability::fromJson($obj->availability) : null,\n \"deliverystatusaftertrigger\" => isset($obj->deliverystatusaftertrigger) ? $obj->deliverystatusaftertrigger : null,\n \"feedescription\" => isset($obj->feedescription) ? $obj->feedescription : null,\n \"internalremark\" => isset($obj->internalremark) ? $obj->internalremark : null,\n \"logo\" => isset($obj->logo) ? $obj->logo : null,\n \"mailorganization\" => isset($obj->mailorganization) ? $obj->mailorganization : null,\n \"needsaddress\" => isset($obj->needsaddress) ? $obj->needsaddress : null,\n \"ordermailtemplateid_delivery\" => isset($obj->ordermailtemplateid_delivery) ? $obj->ordermailtemplateid_delivery : null,\n \"ordermailtemplateid_deliverystarted\" => isset($obj->ordermailtemplateid_deliverystarted) ? $obj->ordermailtemplateid_deliverystarted : null,\n \"shortdescription\" => isset($obj->shortdescription) ? $obj->shortdescription : null,\n \"visibility\" => isset($obj->visibility) ? $obj->visibility : null,\n \"isarchived\" => isset($obj->isarchived) ? $obj->isarchived : null,\n \"createdts\" => isset($obj->createdts) ? Json::unpackTimestamp($obj->createdts) : null,\n \"lastupdatets\" => isset($obj->lastupdatets) ? Json::unpackTimestamp($obj->lastupdatets) : null,\n ));\n\n $result->custom_fields = array();\n foreach ($obj as $key => $value) {\n if (substr($key, 0, 2) === \"c_\") {\n $key = substr($key, 2);\n $result->custom_fields[$key] = $value;\n }\n }\n\n return $result;\n }", "public static function obj($json)\n {\n return self::decode($json);\n }", "public function construct()\n {\n return $this->object;\n }", "public function initWithContentsOfURL($url)\n {\n $this->array = json_decode(file_get_contents($url), true);\n return $this;\n }", "private function impJson($json, $class) {\r\n\t\t$arr = json_decode($json, true);\r\n\t\tif (is_array($arr)) {\r\n\t\t\tforeach ($arr as $key => $attr) {\r\n\t\t\t\t$this->$key = $this->impJson_parse($attr, $class);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function __construct($storage) {\n\n $this->storage = $storage;\n\n if(file_exists($register = $this->storage.'/register.json'))\n $this->register = json_decode(file_get_contents($register), true);\n\n }" ]
[ "0.7090455", "0.7052225", "0.6754275", "0.6572496", "0.65650016", "0.65176064", "0.64424086", "0.63882995", "0.6360605", "0.63558507", "0.63549674", "0.63487065", "0.6340798", "0.62967", "0.6289467", "0.62889075", "0.6286377", "0.6283649", "0.626902", "0.62569606", "0.6229649", "0.6153328", "0.6136739", "0.61339974", "0.61125433", "0.6063196", "0.59948003", "0.5970757", "0.59638757", "0.59365535", "0.59193504", "0.59099597", "0.590397", "0.58869755", "0.5876185", "0.586918", "0.5798441", "0.5790759", "0.5777485", "0.5775191", "0.5770179", "0.5684041", "0.56676304", "0.5664604", "0.56590194", "0.56298125", "0.5625582", "0.5623204", "0.56164783", "0.5616366", "0.5591674", "0.5590991", "0.5586072", "0.5556591", "0.5521458", "0.5508156", "0.55078906", "0.5506669", "0.55025333", "0.5491035", "0.5489518", "0.54867256", "0.5446941", "0.5439064", "0.5435263", "0.54320645", "0.54307896", "0.54231656", "0.54190886", "0.541705", "0.5414728", "0.54007196", "0.5398186", "0.5391899", "0.53912985", "0.53877777", "0.53492725", "0.5349247", "0.53418773", "0.53328484", "0.5324411", "0.53241265", "0.5323169", "0.5304465", "0.5303649", "0.52921337", "0.52902764", "0.5287026", "0.52778935", "0.52746135", "0.5260412", "0.5246811", "0.5243341", "0.5241609", "0.5233928", "0.5231397", "0.523097", "0.5226895", "0.5222191", "0.52181125", "0.5214547" ]
0.0
-1
Get data release id.
public function getDataReleaseId(): string { return $this->dataReleaseId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getReleaseId()\n {\n return $this->releaseId;\n }", "public function getReleaseId()\n {\n return $this->releaseId;\n }", "public function getOpenLibraryId()\n\t\t{\n\t\t\tif(is_null($this->data))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\treturn $this->data['id'];\n\t\t}", "function getID() {\n\t\treturn $this->data_array['artifact_id'];\n\t}", "function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "public function getID() {\n return array_key_exists($this->_key_field, $this->_data) ? $this->_data[$this->_key_field] : null;\n }", "public function getId() {\n if (array_key_exists(\"ID_VENDOR\", $this->vendorData)) {\n return ($this->vendorData[\"ID_VENDOR\"] > 0 ? (int)$this->vendorData[\"ID_VENDOR\"] : null);\n } else {\n return null;\n }\n }", "protected function _getVersionId()\n\t{\n\t\tif (!isset($this->_versionId))\n\t\t{\n\t\t\t$versionId = $this->_publication->version->id;\n\t\t\t$this->_versionId = $this->_db->quote($versionId);\n\t\t}\n\n\t\treturn $this->_versionId;\n\t}", "function getID() {\n\t\treturn $this->data_array['id'];\n\t}", "public function getRelease() {}", "public function id()\n {\n return $this->read($this->metadata['pk']->name);\n }", "static function getId()\n {\n return isset(self::$_data[self::KEY_ID]) ? self::$_data[self::KEY_ID] : 0;\n }", "public function getVersionID()\n {\n return $this->versionID;\n }", "private function _getReleasedStatusId() {\n try {\n $status = new Status();\n return $status->getIdForStatus(Status::$RELEASED);\n } catch (Exception $ex) {\n \t$error = $ex->getMessage().PHP_EOL.$ex->getTraceAsString().PHP_EOL;\n \tZend_Registry::get('logger')->warn(PHP_EOL.\"CLASS\\t: \".__CLASS__.PHP_EOL.\"METHOD\\t: \".__METHOD__.PHP_EOL.\"Error\\t: \".$error.PHP_EOL);\n return 4;\n }\n }", "public function getPrimaryKey()\n {\n return $this->getProdId();\n }", "public function getVersionId()\n {\n return $this->version_id;\n }", "public function getVersionId()\n {\n return $this->version_id;\n }", "public function getVersiondId() {}", "public static function getID()\n {\n return self::getInstance()->_getID();\n }", "protected function getId() {\n // Since initializePurgersService() autogenerates the IDs, ours is known.\n return 'id0';\n }", "public function getID()\n {\n return $this->formattedData['id'];\n }", "public function getId() {\r\n\t\treturn $this->data['id'];\r\n\t}", "public function getId()\n {\n return (substr($this->_id, 0, 12));\n }", "public function getVersionId() {\n\t\treturn $this->versionId;\n\t}", "public function getSerialId()\n {\n return $this->get(self::_SERIAL_ID);\n }", "public function getId()\n {\n return substr($this->_id, 0, 12);\n }", "public function getId() {\n\t\treturn $this -> data['id'];\n\t}", "public function getDocid(): string\n {\n return $this->docid;\n }", "public function getOpenLibraryId()\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('openlibrary', $this->data['identifiers']))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\treturn $this->data['identifiers']['openlibrary'][0];\n\t\t}", "public function id() : ?string\n {\n return (isset($this->data['id'])) ? $this->data['id'] : null;\n }", "public function getPurchase_Id() {\n return $this->purchase_Id;\n }", "function getId() {\n\t\treturn $this->getData('id');\n\t}", "function getId() {\n\t\treturn $this->getData('id');\n\t}", "public function getId() : string\n {\n $rtn = $this->data['id'];\n\n return $rtn;\n }", "function get_keytagid_data($data)\n\t {\n\t return $this->Tag_process->get_id_by_text($data);\n\t }", "static function id()\n\t{\n\t\treturn self::data('id');\n\t}", "public function getRevisionId() {\n return $this->revisionId;\n }", "function getPressId() {\n\t\treturn $this->pressId;\n\t}", "protected function get_pressrelease_term_id() {\n\t\tglobal $wpdb;\n\t\t$term_slug = ( 'en' === $this->lang ) ? 'pressrelease' : 'pressreleaser';\n\n\t\t$sql = \"SELECT t.term_id FROM $wpdb->terms as t LEFT JOIN $wpdb->term_taxonomy as tt ON t.term_id = tt.term_id WHERE t.name = %s AND tt.taxonomy = 'category'\";\n\n\t\t$term_id = $wpdb->get_var( $wpdb->prepare( $sql, $term_slug ) );\n\n\t\treturn ( $term_id ) ? (int) $term_id : false;\n\t}", "public function getProductID()\n {\n }", "public function getRevisionID()\n {\n return $this->revisionid;\n }", "public function getDataRevision() {\n return (int)trim(str_replace('$', ' ', substr($this->tree->getDataRevision(), 6)));\n }", "public static function getIdentifier(): ?string\n\t{\n\t\tself::detect();\n\t\treturn self::$version;\n\t}", "public function getVersionId();", "public function _getDistributionId() {\n\t\treturn $this->_distributionId;\n\t}", "public function getId()\n {\n $rtn = $this->data['id'];\n\n return $rtn;\n }", "function getStringID() {\n\t\treturn '[#'.$this->data_array['artifact_id'].']';\n\t}", "function tidy_get_release() {}", "public function getId()\n {\n return $this->getData(self::ID);\n }", "public function getIdentifier()\n {\n return $this->id;\n }", "public function getEventID() {\n return \"dataevent-\".$this->getID();\n }", "protected function getID() {\n return $this->id;\n }", "public function getID();", "public function getID();", "public function getID();", "private function GetID()\n\t\t{\n\t\t\treturn $this->id;\n\t\t}", "public function get_id();", "public function get_id();", "public function getId() {\n\t\tif (isset($this->_data['id'])) {\n\t\t\treturn intval($this->_data['id']);\n\t\t}\n\t\treturn null;\n\t}", "public function identifier()\n {\n return $this->id;\n }", "public function getId()\n {\n return $this->product->{$this->params['productFieldId']};\n }", "public function getID()\n {\n return $this->billingId;\n }", "public function getId() {\n\t\treturn $this->getData(static::$_primaryKey);\n\t}", "protected static function release($id){\n\t\t\tif(!is_string($id) && !is_int($id)){\n\t\t\t\tLogger::warning(MessageUtility::UNEXPECTED_ARGUMENT_WARNING, \"QuarterMaster release expects string argument, \".gettype($id).\" given.\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(array_key_exists($id, self::$cache)){\n\t\t\t\treturn self::$cache[$id];\n\t\t\t}else{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}", "protected function getProductLoadId()\n {\n $product = $this->locator->getProduct();\n if (method_exists($product, 'getData')) {\n return $product->getData($this->getProductLinkField());\n }\n }", "public function getid()\n {\n return $this->id;\n }", "public function getid()\n {\n return $this->id;\n }", "public function getId() {\n return ($this->isInit()) ? $this->id : null;\n }", "public function getID()\n {\n return $this->getKey();\n }", "public function getId() : string\n {\n return $this->get('id', 'products');\n }", "public function getIdentifier(): ?string\n {\n return $this->data->identifier;\n }", "public function getId()\n {\n return $this->product->{$this->params['productFieldId']};\n }", "public function getId()\n {\n return $this->identifier;\n }", "public function getPubId()\n {\n return $this->pub_id;\n }", "function getID(){ return (int)$this->productInfo['products_id']; }", "public function getVendorId() {}", "function getpurchaseuuid()\n {\n return $this->purchase_uuid;\n }", "public function GetID () \r\n\t{\r\n\t\treturn ($ID);\r\n\t}", "public function se_get_id() {\n\t\treturn version_compare( WC_VERSION, '3.0', '>=' ) ? $this->get_id() : $this->id;\n\t}", "public function se_get_id() {\n\t\treturn version_compare( WC_VERSION, '3.0', '>=' ) ? $this->get_id() : $this->id;\n\t}", "public function getProductIdentifier()\n {\n $value = $this->_config->get('dataprocessing/products/identifier');\n\n if ($value === null) {\n $value = 'sku';\n }\n\n return $value;\n }", "function getId()\n\t{\n\t\t$id=(int)$_GET['prodid'];\n\t\tif(is_int($id))\n\t\t{\n\t\t\treturn $id;\n\t\t}\n\t}", "public function get_id () {\r\n\t\treturn $this->id;\r\n\t}", "public function getBuyableIdentifier()\n {\n return method_exists($this, 'getKey') ? $this->getKey() : $this->id;\n }", "public function getProductid() {\n\t\treturn $this->productid;\n\t}", "public function getUniquekeyid()\n {\n return $this->uniquekeyid;\n }", "public function get_productRelease(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration == 0) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::PRODUCTRELEASE_INVALID;\n }\n }\n $res = $this->_productRelease;\n return $res;\n }", "public function getid() {\n\t\treturn $this->id;\n\t}", "protected function _getPublicationId()\n\t{\n\t\tif (!isset($this->_publicationId))\n\t\t{\n\t\t\t$publicationId = $this->_publication->id;\n\t\t\t$this->_publicationId = $this->_db->quote($publicationId);\n\t\t}\n\n\t\treturn $this->_publicationId;\n\t}", "public function id()\n {\n return $this->_getAuthId();\n }", "public function getID(): string {\n\t\treturn $this->appName;\n\t}", "public function getVolId() {\n\t\treturn ($this->volId);\n\t}", "public function getProductID()\n {\n return $this->productID;\n }", "public function getProductID()\n {\n return $this->productID;\n }", "public function getProductID()\n {\n return $this->productID;\n }", "public function get_productId(): int\n {\n // $res is a int;\n // $dev is a YDevice;\n if ($this->_cacheExpiration == 0) {\n $dev = $this->_getDev();\n if (!($dev == null)) {\n return $dev->getProductId();\n }\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::PRODUCTID_INVALID;\n }\n }\n $res = $this->_productId;\n return $res;\n }", "public function getID()\n {\n return $this->iD;\n }", "public function getID()\n {\n return $this->iD;\n }", "public function getID()\n {\n return $this->iD;\n }", "public function getID()\n {\n return $this->iD;\n }" ]
[ "0.7695248", "0.7695248", "0.64955163", "0.6300455", "0.62680334", "0.61314946", "0.60505235", "0.60342413", "0.6019357", "0.60134554", "0.6009943", "0.6007542", "0.59380174", "0.59291166", "0.59287125", "0.591493", "0.591493", "0.5857901", "0.5844902", "0.58355254", "0.5835482", "0.582749", "0.58207446", "0.58174926", "0.58000857", "0.57933915", "0.5792096", "0.5770247", "0.57651657", "0.57584643", "0.5756458", "0.57555443", "0.57555443", "0.57305866", "0.57296807", "0.5720933", "0.57202727", "0.57164377", "0.5707944", "0.56997454", "0.56991", "0.5690852", "0.56900495", "0.5689838", "0.56814474", "0.565809", "0.5637528", "0.56321985", "0.5627958", "0.56232715", "0.5619378", "0.56121826", "0.56106514", "0.56106514", "0.56106514", "0.5597697", "0.5595668", "0.5595668", "0.5591837", "0.5589815", "0.55884606", "0.55884516", "0.55864865", "0.5586097", "0.5584438", "0.5582964", "0.5582964", "0.55816466", "0.55758667", "0.5570651", "0.55647576", "0.55600494", "0.5555693", "0.5553539", "0.55531025", "0.55508673", "0.55473214", "0.55456364", "0.5545506", "0.5545506", "0.55453795", "0.5542956", "0.55399257", "0.5538932", "0.55383885", "0.55376786", "0.5532907", "0.55304056", "0.5524246", "0.55194557", "0.55142957", "0.551289", "0.55082005", "0.55082005", "0.55082005", "0.5496774", "0.5496062", "0.5496062", "0.5496062", "0.5496062" ]
0.8414799
0
Set data release id.
protected function setDataReleaseId(string $dataReleaseId): self { $this->dataReleaseId = $dataReleaseId; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setRelease($value)\n {\n $this->setItemValue('release', ['id' => (int)$value]);\n }", "public function getDataReleaseId(): string\n {\n return $this->dataReleaseId;\n }", "public function setId($data)\n {\n $this->_Id=$data;\n return $this;\n }", "public function setId($data)\n {\n $this->_Id=$data;\n return $this;\n }", "abstract public function set($id, $namespace = self::DEFAULT_NAMESPACE, $data);", "function setId($package_id)\r\n\t{\r\n\t\t$this->_package_id\t\t= $package_id;\r\n\t\t$this->_data\t\t\t= null;\r\n\t\t$this->_hotels\t\t\t= null;\r\n\t}", "function setId($id) {\n\t\t$this->setData('id', $id);\n\t}", "public function setId($id) {\n $this->vendorData[\"ID_VENDOR\"] = (int)$id;\n }", "function setId($id) {\n // Set id and wipe data\n $this->_id = $id;\n //die($id);\n $this->_data = null;\n }", "public function set_id($setid){\n $this->id = $setid;\n }", "function SetId($value) { $this->id=$value; }", "function setId($id)\r\n {\r\n $this->_id = $id;\r\n $this->_data = null;\r\n }", "function setId($id) {\r\n\t\t// Set id and wipe data\r\n\t\t$this->_id = $id;\r\n\t}", "public function setId($id){\n $this->_id = $id;\n }", "function setId($id)\n\t{\n\t\t// Set id and wipe data\n\t\t$this->_id\t\t= $id;\n\t\t//$this->_data\t= null;\n\t}", "public function setPosteId($data)\n {\n\n if ($this->_posteId != $data) {\n $this->_logChange('posteId');\n }\n\n if ($data instanceof \\Zend_Db_Expr) {\n $this->_posteId = $data;\n } else if (!is_null($data)) {\n $this->_posteId = (int) $data;\n } else {\n $this->_posteId = $data;\n }\n return $this;\n }", "public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }", "function setId($id) {\r\n $this->_id = $id;\r\n }", "function setId($value) {\n $this->_id = intval($value);\n }", "function setId($id) {\r\n // Set id and wipe data\r\n $this->_id = $id;\r\n $this->_data = null;\r\n }", "function setId($id) {\n\t\t$this->_id = $id;\n\t}", "function setIdentifier($val) {\n $this->identifier = $this->updateDB('identifier', $val);\n }", "public function setIdVit($id){\n\t\t$this->id = $id;\n\t}", "protected function setProduct_id($value)\n\t{\n\t\tif (isInt($value) || is_null($value)) { $this->product_id = $value; }\n\t}", "public function setID($id) {\n $this->id = $id; \n }", "function setId($id)\n\t{\n\t\t// Set id and wipe data\n\t\t$this->_id\t\t= $id;\n\t\t$this->_data\t= null;\n\t}", "public function setID($id){\n $this->id = $id;\n }", "function setDevId($value)\n {\n $this->_props['DevId'] = $value;\n }", "private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}", "public function setId($data)\n {\n\n if ($this->_id != $data) {\n $this->_logChange('id');\n }\n\n if ($data instanceof \\Zend_Db_Expr) {\n $this->_id = $data;\n\n } else if (!is_null($data)) {\n $this->_id = (int) $data;\n\n } else {\n $this->_id = $data;\n }\n return $this;\n }", "public function setId($data)\n {\n\n if ($this->_id != $data) {\n $this->_logChange('id');\n }\n\n if ($data instanceof \\Zend_Db_Expr) {\n $this->_id = $data;\n\n } else if (!is_null($data)) {\n $this->_id = (int) $data;\n\n } else {\n $this->_id = $data;\n }\n return $this;\n }", "protected function setData($data)\n {\n $this->sha1 = null;\n $this->data = $data;\n }", "function set_id( $id ){\n\t\t$this->id = $id;\n\t\t// this is add request. so number is 0\n\t\tif( $this->id == $this->id_base ){\n\t\t\t$this->number = 0;\n\t\t\t$this->is_new = true;\n\t\t}\n\t\t// parse number\n\t\telse{\n\t\t\t$this->number = str_replace($this->id_base.'-', '', $this->id);\n\n\t\t\t// load instance data\n\t\t\t$this->instance = jcf_field_settings_get( $this->id );\n\t\t\tif( !empty($this->instance) ){\n\t\t\t\t$this->slug = $this->instance['slug'];\n\t\t\t}\n\t\t}\n\t}", "public function set($new_id);", "public function getReleaseId()\n {\n return $this->releaseId;\n }", "public function getReleaseId()\n {\n return $this->releaseId;\n }", "public function setId($id) {\r\n $this->_id = $id;\r\n }", "function setId($id){\n\t\t$this->id = $id;\n\t}", "function set_id($id) {\n\t\t$this->id = $id;\n\t}", "protected function setData(string $data):void {\n $this->data = $data;\n }", "function setId($id){\r\n\t\t$this->id = $id;\r\n\t}", "public function setData( $data )\n {\n $this->data = $data;\n }", "public function set_data($data)\n {\n $this->data = $data;\n }", "public function setID($_id) \n \t{\n \t\t$this->_id = $_id;\n \t}", "function setId($id) {\n $this->id = $id;\n }", "function setId($id) {\n $this->id = $id;\n }", "public function setID($id){\n $this->id=$id;\n }", "public function setId($id) { $this->id = $id; }", "public function setId($id){\n\t\t$this->id = $id;\n\t}", "public function set_id($id){\n $this->id = $id;\n }", "public function updateStockId();", "function set_id($id)\n {\n $this->id = $id;\n }", "public function setId()\n {\n $apiKey = new ApiKey;\n $apiKey->setId();\n $this->id = $apiKey->getId();\n }", "public function setID($id){\n $this->ID = $id;\n }", "public function setID($id);", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setID($_id) \n\t{\n\t\t$this->_id = $_id;\n\t}", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n\n \n }", "function setId($id)\n {\n $this->id = $id;\n }", "public function setData($data)\n {\n $this->_data = $data;\n }", "public function setId($id){\n\t\t\t$this->id = $id;\n\t\t}", "public function setId($id)\n {\n $this->_id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId( $id ) {\n\t\t$this->id = $id;\n\t}", "public function setId( $id ) {\n\t\t$this->id = $id;\n\t}", "public function setId($x) { $this->id = $x; }", "final public function setData($data) {\n $this->data = $data;\n }", "public function setId($id)\r\n\t\t{\r\n\t\t\t$this->_id = $id;\r\n\t\t}", "public function setId($id) {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "public function setId($id) \n {\n $this->id = $id;\n }", "public function setId($id) {\r\n $this->id = $id;\r\n }", "public function setId($id) {\r\n $this->id = $id;\r\n }", "public function set_data($data)\n {\n }", "public function set_data($data)\n {\n }", "public function setId( $id )\n {\n $this->id = $id;\n }", "public function setData($data)\n {\n $this->data = $data;\n }", "public function setData($data)\n {\n $this->data = $data;\n }", "public function setVideoId()\n {\n $this->video_id = (int) substr(parse_url($this->url, PHP_URL_PATH), 1);\n }", "public function setID($id) {\n\t\t$this->id = $id;\n\t}", "function setData($data)\n {\n $this->data = $data;\n }", "public function setData($data): void\n {\n $this->data = $data;\n }", "public function setId($id){\n $this->id = (string) $id;\n }", "private function SetID($value)\n\t\t{\n\t\t\t$this->id = $value;\n\t\t}", "public function setData($data) {\n $this->data = $data;\n }", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "private function setData($data)\n {\n \t$this->data = $data;\n }", "public function setId($_id);", "public function setId($id)\r\n {\r\n $this->data['itemid'] = (int) $id;\r\n }", "public function set_id( $id ) {\n\t\t\t$this->id = $id;\n\t\t}", "public function SetId ($id);", "private function setId($id)\n {\n $this->id = $id;\n }" ]
[ "0.67902726", "0.624353", "0.61390096", "0.61390096", "0.5980777", "0.59107894", "0.58449024", "0.58192074", "0.5810818", "0.58065796", "0.5798259", "0.5743553", "0.5732892", "0.5725409", "0.5722967", "0.57227546", "0.57194066", "0.5715638", "0.57135105", "0.57041436", "0.57007253", "0.5697673", "0.5682875", "0.56627524", "0.5653479", "0.5643388", "0.5622442", "0.56208485", "0.5617027", "0.56156397", "0.56156397", "0.5612949", "0.5608902", "0.5607737", "0.5597547", "0.5597547", "0.55860174", "0.55851555", "0.5584963", "0.5584196", "0.5580084", "0.55671746", "0.55613124", "0.5546676", "0.5546252", "0.5546252", "0.5529871", "0.5524952", "0.5520591", "0.5514512", "0.5510814", "0.55099106", "0.55092967", "0.55087173", "0.5504901", "0.55039924", "0.55039924", "0.55039924", "0.550199", "0.54984236", "0.54983044", "0.54974866", "0.5495692", "0.5493937", "0.5482582", "0.5479116", "0.54782146", "0.54782146", "0.54771775", "0.5470469", "0.54697895", "0.5458985", "0.54560626", "0.54529417", "0.54518795", "0.54496837", "0.54496837", "0.5447917", "0.54472965", "0.5444353", "0.544127", "0.544127", "0.5440567", "0.54400444", "0.54389054", "0.5438253", "0.5432229", "0.54280025", "0.5427295", "0.5424918", "0.5424918", "0.5424918", "0.5424918", "0.5424918", "0.54241335", "0.5422263", "0.5419324", "0.54190177", "0.54126555", "0.54120797" ]
0.66559243
1
Assigns the arguments to instance variables to be used by the render() method.
public function __construct(\Twig_Environment $tplEngine, $route, PostMapper $postMapper) { $this->tplEngine = $tplEngine; $this->route = $route; $this->postMapper = $postMapper; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function initializeArgumentsAndRender() {}", "public function initializeArgumentsAndRender() {}", "private function registerRenderMethodArguments() {}", "public function __construct()\n {\n $this->arguments = func_get_args();\n }", "private function setArgs(){\n\t\t$this->args = array(\n\t\t\t'label' => $this->label,\n\t\t\t'labels' => $this->labels,\n\t\t\t'description' => $this->description,\n\t\t\t'public' => $this->public,\n\t\t\t'exclude_from_search' => $this->excludeSearch,\n\t\t\t'publicly_queryable' => $this->publiclyQueryable,\n\t\t\t'show_ui' => $this->show_ui ,\n\t\t\t'show_in_nav_menus' => $this->showInNavMenus,\n\t\t\t'show_in_menu' => $this->showInMenu,\n\t\t\t'show_in_admin_bar' => $this->showInAdminBar,\n\t\t\t'menu_position' => $this->menuPosition,\n\t\t\t'menu_icon' => $this->menuIcon,\n\t\t\t'capability_type' => $this->capabilityType,\n\t\t\t'map_meta_cap' => $this->mapMetaCap,\n\t\t\t'hierarchical' => $this->hierarchical,\n\t\t\t'supports' => $this->supports,\n\t\t\t'register_meta_box_cb' => $this->registerMetaBoxCb,\n\t\t\t'taxonomies' => $this->taxonomies,\n\t\t\t'has_archive' => $this->hasArchive,\n\t\t\t'permalink_epmask' => $this->permalinkEpmask,\n\t\t\t'rewrite' => $this->rewrite,\n\t\t\t'query_var' => $this->queryVar,\n\t\t\t'can_export' => $this->canExport,\n\t\t\t'_builtin' => $this->builtin\n\t\t);\n\t}", "public function initializeArguments()\n {\n parent::initializeArguments();\n $this->registerArgument('section', 'string', 'Section to render - combine with partial to render section in partial', false, null);\n $this->registerArgument('partial', 'string', 'Partial to render, with or without section', false, null);\n $this->registerArgument('arguments', 'array', 'Array of variables to be transferred. Use {_all} for all variables', false, []);\n $this->registerArgument('optional', 'boolean', 'If TRUE, considers the *section* optional. Partial never is.', false, false);\n $this->registerArgument('default', 'mixed', 'Value (usually string) to be displayed if the section or partial does not exist', false, null);\n $this->registerArgument('contentAs', 'string', 'If used, renders the child content and adds it as a template variable with this name for use in the partial/section', false, null);\n }", "public function setViewHelperDefaulArgumentsToAdditionalArguments() {}", "public function initializeArguments() {}", "public function initializeArguments() {}", "public function initializeArguments() {}", "public function initializeArguments() {}", "public function initialize()\n {\n if (isset($this->arguments['form'])) {\n $this->arguments = array_replace(\n $this->arguments,\n $this->arguments['form']->vars\n );\n }\n parent::initialize();\n }", "public function __construct()\n {\n if (3 == func_num_args()) {\n $this->width = func_get_arg(0);\n $this->height = func_get_arg(1);\n $this->length = func_get_arg(2);\n }\n }", "function render($args = array())\n {\n }", "abstract public function render($data, $args = array());", "public function render() {\n $templates = func_get_args();\n $reserved = array('templates', 'template', 'this', 'key', 'value', 'reserved');\n \n // Give access to the set variables\n if (!empty($this->vars)) {\n foreach ($this->vars as $key => $value) {\n if (!in_array($key, $reserved)) {\n $$key = $value;\n }\n }\n }\n \n // Load the templates\n foreach ($templates as $template) {\n include $this->getThemedFile(\"{$template}.template.php\");\n }\n }", "public function __construct(){\n\t\tglobal $GLANG;\n\t\t$this->arguments = func_get_args();\n\t\t$this->lang = $GLANG;\n\t\t}", "public function prepareArguments() {}", "protected function initializeActionMethodArguments() {}", "public function set_vars($args)\n\t{\n\t\tforeach ($args as $key => $value) {\n\t\t\t$key = lc(str_replace(\"post_\", \"\", trim($key)));\n\t\t\t$this->$key = $value;\n\t\t}\n\t\t\n\t\t$this->category = element(\"name\", $this->_cat->get_cat($this->category));\n\t}", "public function initCallArguments() {\n\t\t$request = GeneralUtility::_GP('request');\n\t\tif ($request) {\n\t\t\t$this->setRequestArgumentsFromJSON($request);\n\t\t} else {\n\t\t\t$this->setRequestArgumentsFromGetPost();\n\t\t}\n\t\treturn $this->setVendorName($this->requestArguments['vendorName'])\n\t\t\t->setExtensionName($this->requestArguments['extensionName'])\n\t\t\t->setPluginName($this->requestArguments['pluginName'])\n\t\t\t->setControllerName($this->requestArguments['controllerName'])\n\t\t\t->setActionName($this->requestArguments['actionName'])\n\t\t\t->setFormatName($this->requestArguments['formatName'])\n\t\t\t->setArguments($this->requestArguments['arguments']);\n\t}", "public function set_props($args)\n {\n }", "function setContext( )\n\t{\n\t\t$args = new safe_args();\n\t\t$args->set('name', \tREQUIRED, 'string');\n\t\t$args->set('value', REQUIRED, 'any');\t\t\n\t\t$args = $args->get(func_get_args());\n\t\t\t\n\t\t$this->context[$args['name']] = $args['value'];\n\t}", "protected function getArguments()\n {\n\n }", "private function setArguments()\n {\n return array(\n 'labels' => $this->labels,\n 'public' => $this->public,\n 'menuIcon' => $this->menuIcon,\n 'capabilities' => $this->capabilities,\n 'supports' => $this->supports,\n );\n }", "public function __construct()\n {\n if (3 == func_num_args()) {\n $this->dialogs = func_get_arg(0);\n $this->language = func_get_arg(1);\n $this->styling = func_get_arg(2);\n }\n }", "protected function variablesAssign()\n {\n $app = $this->app;\n $this->request = $app['request'];\n $this->session = $app['session'];\n $this->template = $app['template'];\n $this->theme = $app['theme'];\n\n // Set Request Format\n switch ($this->request->getRequestFormat()) {\n case 'json':\n $this->format = 'json';\n break;\n\n case 'xml':\n $this->format = 'xml';\n break;\n\n case 'csv':\n $this->format = 'csv';\n break;\n\n case 'html':\n default:\n $this->format = 'html';\n break;\n }\n }", "public function setArguments(array $arguments);", "public function prepareVars()\n {\n $this->vars['posts'] = $this->prepareHtml();\n $this->vars['model'] = $this->model;\n }", "public function render(...$arguments): \\Maleficarum\\Response\\AbstractResponse {\n // forward render action to the handler\n call_user_func_array([$this->handler, 'handle'], $arguments);\n\n return $this;\n }", "private function __construct() {\n $args = func_get_args();\n $this->name = $args[0];\n $this->title = $args[1];\n $this->email = $args[2];\n $this->valediction = $args[3];\n }", "public function __construct()\n {\n if (5 == func_num_args()) {\n $this->url = func_get_arg(0);\n $this->method = func_get_arg(1);\n $this->encoding = func_get_arg(2);\n $this->events = func_get_arg(3);\n $this->template = func_get_arg(4);\n }\n }", "public function setArguments($args) {\n $this->args= $args;\n }", "public function setArguments($arguments)\n {\n $this->arguments = $arguments;\n }", "public function render()\n {\n $name = $this->arguments['name'];\n $value = $this->arguments['value'];\n\n if (null === $value) {\n $value = $this->renderChildren();\n }\n if (false === strpos($name, '.')) {\n if (true === $this->templateVariableContainer->exists($name)) {\n $this->templateVariableContainer->remove($name);\n }\n $this->templateVariableContainer->add($name, $value);\n } elseif (1 === substr_count($name, '.')) {\n $parts = explode('.', $name);\n $objectName = array_shift($parts);\n $path = implode('.', $parts);\n if (false === $this->templateVariableContainer->exists($objectName)) {\n return;\n }\n $object = $this->templateVariableContainer->get($objectName);\n try {\n ObjectAccess::setProperty($object, $path, $value);\n // Note: re-insert the variable to ensure unreferenced values like arrays also get updated\n $this->templateVariableContainer->remove($objectName);\n $this->templateVariableContainer->add($objectName, $object);\n } catch (\\Exception $error) {\n return;\n }\n }\n }", "public function __construct()\n {\n if (4 == func_num_args()) {\n $this->email = func_get_arg(0);\n $this->iconUrl = func_get_arg(1);\n $this->isYou = func_get_arg(2);\n $this->name = func_get_arg(3);\n }\n }", "private function extractArguments(array $arguments)\n {\n $this->namespace = Arr::get($arguments, 0);\n $this->entity = Arr::get($arguments, 1);\n $this->view = Arr::get($arguments, 2);\n $this->name = Arr::get($arguments, 3);\n }", "protected function initializeCommandMethodArguments() {}", "public function setArguments(array $args);", "public function __construct()\n {\n if (6 == func_num_args()) {\n $this->shippingAssignments = func_get_arg(0);\n $this->giftMessage = func_get_arg(1);\n $this->amazonOrderReferenceId = func_get_arg(2);\n $this->appliedTaxes = func_get_arg(3);\n $this->itemAppliedTaxes = func_get_arg(4);\n $this->convertingFromQuote = func_get_arg(5);\n }\n }", "protected function prepareRendering() {}", "public function setAttributes()\n\t{\n\t\t$this->title \t\t= Input::get( 'title' );\n\t\t$this->description \t= Input::get( 'description' );\n\t\t$this->color \t\t= Input::get( 'color' );\n\t\t$this->type \t\t= Input::get( 'type' );\n\t\t$this->canvas_id\t= Input::get( 'canvas_id', Input::get( 'canvasId' ) );\n\t}", "public function setArguments(...$arguments) {\n $this->arguments = $arguments;\n return $this;\n }", "public function __construct()\n {\n if (3 == func_num_args()) {\n $this->command = func_get_arg(0);\n $this->environment = func_get_arg(1);\n $this->image = func_get_arg(2);\n }\n }", "function __construct($arguments){\n\t\t}", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->name = func_get_arg(0);\n $this->values = func_get_arg(1);\n }\n }", "function __construct()\n\t\t{\t\n\t\t\t$this->render();\n\t\t}", "function __construct()\n\t\t{\t\n\t\t\t$this->render();\n\t\t}", "function __construct()\n\t\t{\t\n\t\t\t$this->render();\n\t\t}", "private function readEngineArguments() {\n // TODO: Clean this up and move it into LandEngines.\n\n $onto = $this->getEngineOnto();\n $remote = $this->getEngineRemote();\n\n // This just overwrites work we did earlier, but it has to be up in this\n // class for now because other parts of the workflow still depend on it.\n $this->onto = $onto;\n $this->remote = $remote;\n $this->ontoRemoteBranch = $this->remote.'/'.$onto;\n }", "protected static function buildRenderingContext($arguments) {\n\t\t$objectManager = Tx_SavLibraryKickstarter_Compatibility_TemplateParserBuilder::getObjectManager(); \n\t\t\n\t\t// Builds the variable container\n $variableContainer = $objectManager->get('Tx_Fluid_Core_ViewHelper_TemplateVariableContainer', $arguments);\n\n\t\t// Builds the view helper variable container\n\t\t$viewHelperVariableContainer = $objectManager->get('Tx_Fluid_Core_ViewHelper_ViewHelperVariableContainer');\t\t\n\t\t\n // Builds the rendering context \n\t\t$renderingContext = $objectManager->get('Tx_Fluid_Core_Rendering_RenderingContext');\n\n // Adds the controller context\n \tif (self::$controllerContext !== NULL) {\n \t\t$renderingContext->setControllerContext(self::$controllerContext);\n \t}\n\t\t\n\t\t//Injects the variable and view helper variable containers\n\t\t$renderingContext->injectTemplateVariableContainer($variableContainer);\n\t\t$renderingContext->injectViewHelperVariableContainer($viewHelperVariableContainer);\n\t\t\t\n\t\treturn $renderingContext;\n\t}", "public function __construct() {\n $this->items = func_get_args();\n }", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->events = func_get_arg(0);\n $this->attributes = func_get_arg(1);\n }\n }", "public function prepare_attributes_for_render($attributes)\n {\n }", "public function __construct()\n {\n if (8 == func_num_args()) {\n $this->title = func_get_arg(0);\n $this->sortOrder = func_get_arg(1);\n $this->sampleType = func_get_arg(2);\n $this->id = func_get_arg(3);\n $this->sampleFile = func_get_arg(4);\n $this->sampleFileContent = func_get_arg(5);\n $this->sampleUrl = func_get_arg(6);\n $this->extensionAttributes = func_get_arg(7);\n }\n }", "function __construct()\r\n {\r\n $this->field_names = func_get_args();\r\n }", "public function addVars(array $args)\n {\n foreach ($args as $key => $value) {\n $this->$key = $value;\n }\n }", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->assetId = func_get_arg(0);\n $this->accounts = func_get_arg(1);\n }\n }", "protected function _toHtml()\n{\n// use arguments like $this->getMyParam1() , $this->getAnotherParam()\n \nreturn $html;\n}", "public function __construct()\n {\n if (11 == func_num_args()) {\n $this->id = func_get_arg(0);\n $this->owner = func_get_arg(1);\n $this->applicationId = func_get_arg(2);\n $this->time = func_get_arg(3);\n $this->segmentCount = func_get_arg(4);\n $this->direction = func_get_arg(5);\n $this->to = func_get_arg(6);\n $this->from = func_get_arg(7);\n $this->media = func_get_arg(8);\n $this->text = func_get_arg(9);\n $this->tag = func_get_arg(10);\n }\n }", "protected function setTemplateVariables() {}", "protected function _construct($arguments){\n\t\treturn parent::_construct($arguments);\n\t}", "public function viewData(array $arguments = []);", "public function __construct()\n {\n $this->templater = new StringTemplate();\n $this->addAdditionalAllowedAttributes();\n $this->addAdditionalAllowedAttributesValues();\n }", "protected function setArgument()\n {\n $this->set('primary_key', false);\n $this->set('length', $this->argument);\n $this->set('autoincrement', false);\n $this->set('unsigned', false);\n $this->set('not_null', false);\n }", "public function __construct($args = []) {\n $bodymass = $_POST['bodymass'] ?? 0;\n $this->set_bodymass($bodymass);\n $bodylength = $_POST['bodylength'] ?? 1;\n $this->set_bodylength($bodylength);\n // $this->welcome();\n }", "public function setArguments($args)\n {\n $this->arguments = $args;\n }", "public function __construct()\n {\n if (5 == func_num_args()) {\n $this->totalRecords = func_get_arg(0);\n $this->totalPages = func_get_arg(1);\n $this->pageNumber = func_get_arg(2);\n $this->numberOfRecordsPerPage = func_get_arg(3);\n $this->applications = func_get_arg(4);\n }\n }", "public function __construct()\n {\n if (9 == func_num_args()) {\n $this->id = func_get_arg(0);\n $this->amount = func_get_arg(1);\n $this->postedDate = func_get_arg(2);\n $this->description = func_get_arg(3);\n $this->memo = func_get_arg(4);\n $this->normalizedPayee = func_get_arg(5);\n $this->institutionTransactionId = func_get_arg(6);\n $this->category = func_get_arg(7);\n $this->type = func_get_arg(8);\n }\n }", "public function setValues(){\n if($this->getType() == \"var\"){\n $this->setValue($this->getArg());\n }else if($this->getType() == \"int\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"bool\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"string\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"nil\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"label\"){\n $this->setValue($this->getArg());\n }else if($this->getType() == \"type\"){\n $this->setValue($this->getArg());\n }else{\n $this->setValue(\"CHYBA\");\n }\n }", "function __construct()\n {\n parent::__construct();\n $this->getvars = array();\n $this->postvars = array();\n }", "public function __construct($args = [])\n {\n parent::__construct($args);\n\n // Add common data needed all pages\n $this->setBase();\n }", "function readParameters(&$render, &$params)\n {\n $varInfo = get_class_vars(get_class($this));\n\n // Iterate through all params: place known params in member variables and the rest in the attributes set\n foreach ($params as $name => $value)\n {\n if (array_key_exists($name, $varInfo)) {\n $this->$name = $value;\n } else {\n $this->attributes[$name] = $value;\n }\n }\n }", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->text = func_get_arg(0);\n $this->channel = func_get_arg(1);\n }\n }", "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 }", "protected function renderData()\n {\n $this->view->baseUrl = $this->_baseUrl;\n $this->view->staticUrl = Zend_Registry::get('static');\n $this->view->version = Zend_Registry::get('version');\n $this->view->hostUrl = Zend_Registry::get('host');\n $this->view->photoUrl = Zend_Registry::get('photo');\n $this->view->adminUser = $this->_user;\n\n $this->view->isSuperUser = $this->_isSuperUser;\n $this->view->isViewer = $this->_isViewer;\n $this->view->isWatcher = $this->_isWatcher;\n $this->view->isEditor = $this->_isEditor;\n }", "private function setArguments()\n {\n $args = $this->data;\n $match = explode(\"/\", $this->routeMatch);\n\n // remove the domain part.\n foreach ($this->domains as $value) {\n // search for domain on url array.\n // array_search(needle, haystack)\n $index = array_search($value, $args);\n unset($args[$index]);\n\n // search for domain on matched route.\n $index = array_search($value, $match);\n unset($match[$index]);\n }\n\n // find the action part in url data and the matched route string.\n // preg_grep(pattern, input)\n $this->action = preg_grep(\"/^{$this->wildcards[':action']}$/\", $args);\n $matchAction = preg_grep(\"/^{$this->wildcards[':action']}$/\", $match);\n if ( !empty($this->action) )\n {\n // convert action from array to string.\n // find action in url data.\n // remove from url data.\n $this->action = array_shift($this->action);\n $index = array_search($this->action, $args);\n unset($args[$index]);\n\n $matchAction = array_shift($matchAction);\n $index = array_search($matchAction, $match);\n unset($match[$index]);\n }\n\n // get the arguments from url data\n // get the key from the wildcard. :id, :yyyy, :dd, etc.\n foreach ($args as $arg) {\n $key = $this->matchWildcard($match, $arg);\n $this->arguments[$key] = $arg;\n }\n }", "public function __construct()\r\n {\r\n $this->view = new stdClass;\r\n $this->view->placeHolder = $this->placeHolder;\r\n $this->view->settingOptionName = $this->settingOptionName;\r\n }", "abstract protected function get_args();", "public function __construct(){\n\t\t\t$this->should_render();\n\n\t\t\t//$this->init();\n\t\t}", "public function __construct()\n {\n if (4 == func_num_args()) {\n $this->method = func_get_arg(0);\n $this->poNumber = func_get_arg(1);\n $this->additionalData = func_get_arg(2);\n $this->extensionAttributes = func_get_arg(3);\n }\n }", "public function withArguments(array $args);", "public function __construct(array $arguments = array()) {\n\n\t}", "public function render()\n {\n $object = $this->arguments['object'] ?? null;\n $nameSpace = $this->arguments['nameSpace'] ?? '';\n $argumentStringArray = $this->getArgumentArray($this->arguments['arguments']);\n $argumentArray = [];\n \n foreach ($argumentStringArray as $key => $value) {\n if ($object !== null && $value === false) {\n $value = $this->getObjectValue($object, $key);\n }\n \n if (!$nameSpace) {\n $argumentArray = array_merge_recursive($argumentArray, $this->buildObjectValueArray($object, $key, $value));\n } else {\n $argumentArray = array_merge_recursive($argumentArray, $this->buildNamespaceValueArray($nameSpace, $key, $value));\n }\n }\n\n $this->sessionPersistenceManagerBuilder->getInstance()->addSessionRelatedArguments($argumentArray);\n\n return $argumentArray;\n }", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->imageChangeParams = func_get_arg(0);\n $this->type = func_get_arg(1);\n }\n }", "public function __construct(...$arguments)\n {\n $this->arguments = $arguments;\n $this->argumentsCount = count($arguments);\n $this->index = [];\n $this->callables = [];\n }", "public function __construct()\n {\n if (6 == func_num_args()) {\n $this->shippingAddress = func_get_arg(0);\n $this->shippingMethodCode = func_get_arg(1);\n $this->shippingCarrierCode = func_get_arg(2);\n $this->billingAddress = func_get_arg(3);\n $this->extensionAttributes = func_get_arg(4);\n $this->customAttributes = func_get_arg(5);\n }\n }", "public function prepareVars()\n {\n $this->vars['value'] = $this->getKeyValue();\n $this->vars['field'] = $this->formField;\n $this->vars['nameValue'] = $this->getNameValue();\n $this->vars['descriptionValue'] = $this->getDescriptionValue();\n $this->vars['addresses'] = $this->getAddresses();\n $this->vars['listWidget'] = $this->listWidget;\n $this->vars['searchWidget'] = $this->searchWidget;\n\n $this->vars['title'] = $this->title;\n $this->vars['prompt'] = str_replace('%s', '<i class=\"icon-th-list\"></i>', e(trans($this->prompt)));\n\n }", "public function __construct()\n{\n\t// Use POST and GET if there are any\n\tif (!empty($_GET) || !empty($_POST))\n\t{\n\t\t// GET POST and GET values\n\t\t$values = array_merge($_POST, $_GET);\n\n\t\t// Trim values\n\t\t$trim_func = function (&$item, $key) {\n\t\t\t$item = trim($item);\n\t\t};\n\t\tarray_walk_recursive($values, $trim_func);\n\n\t\t// Store values\n\t\t$this->assign($values);\n\t}\n\n\t// If command line, then also parse arguments\n\tif (PHP_SAPI == 'cli')\n\t{\n\t\t$values = $_SERVER['argv'];\n\t\tarray_shift($values);\n\t\tforeach ($values as $arg)\n\t\t{\n\t\t\tparse_str($arg, $params);\n\t\t\tif (!empty($params))\n\t\t\t{\n\t\t\t\t$this->assign($params);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set NULL to be returned for undefined values\n\t$this->setUndefinedValue(null);\n}", "public function __construct()\r\n {\r\n if(13 == func_num_args())\r\n {\r\n $this->id = func_get_arg(0);\r\n $this->userPhotoAlbumId = func_get_arg(1);\r\n $this->filename = func_get_arg(2);\r\n $this->originalFilename = func_get_arg(3);\r\n $this->text = func_get_arg(4);\r\n $this->displayFormat = func_get_arg(5);\r\n $this->counter = func_get_arg(6);\r\n $this->doNotFeature = func_get_arg(7);\r\n $this->approved = func_get_arg(8);\r\n $this->categoryMask = func_get_arg(9);\r\n $this->blessedId = func_get_arg(10);\r\n $this->hash = func_get_arg(11);\r\n $this->albumId = func_get_arg(12);\r\n }\r\n }", "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 __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 }", "private function _setArgsRegister( $args )\n\t{\t\t\n\t\t$this->argsRegister\t= $args;\t\t\n\t}", "public function __construct()\n {\n foreach($_REQUEST as $key => $value) {\n $t_key = $key;\n $t_value = $value;\n\n $this->$t_key = htmlspecialchars($t_value);\n }\n }", "public function __construct()\n {\n if (5 == func_num_args()) {\n $this->capacity = func_get_arg(0);\n $this->description = func_get_arg(1);\n $this->gender = func_get_arg(2);\n $this->name = func_get_arg(3);\n $this->thingTypeId = func_get_arg(4);\n }\n }", "public function assignVars(array $args)\n {\n $this->vars = array_merge( $this->vars , $args );\n }", "public function __construct()\n {\n $args = func_get_args ();\n if (empty ( $args [0] )) {\n $args [0] = array ();\n }\n $this->_data = $args [0];\n }", "public function __construct()\n {\n if(7 == func_num_args())\n {\n $this->request = func_get_arg(0);\n $this->response = func_get_arg(1);\n $this->sessionToken = func_get_arg(2);\n $this->tags = func_get_arg(3);\n $this->userId = func_get_arg(4);\n $this->companyId = func_get_arg(5);\n $this->metadata = func_get_arg(6);\n }\n }", "public function __construct()\n {\n if (7 == func_num_args()) {\n $this->id = func_get_arg(0);\n $this->abbrvName = func_get_arg(1);\n $this->logoUrl = func_get_arg(2);\n $this->decryptionKeyActivated = func_get_arg(3);\n $this->createdDate = func_get_arg(4);\n $this->lastModifiedDate = func_get_arg(5);\n $this->status = func_get_arg(6);\n }\n }", "abstract protected function prepareRenderParams(array $options, Transform $transform, ?FontRegistry $fontRegistry);", "protected function initVars() {\n\n\t\t}" ]
[ "0.7951505", "0.7950352", "0.6755027", "0.63289315", "0.63146675", "0.6292237", "0.6169728", "0.6106866", "0.6105751", "0.6105751", "0.6105751", "0.6077628", "0.6051013", "0.60274774", "0.596285", "0.5952601", "0.5796338", "0.57780474", "0.5775523", "0.57522184", "0.5720121", "0.5717512", "0.5670531", "0.56654215", "0.56634766", "0.56503105", "0.5647798", "0.56469953", "0.56406033", "0.5629883", "0.562606", "0.56218636", "0.5606337", "0.5593835", "0.5585341", "0.5580352", "0.55563843", "0.55545884", "0.5522096", "0.55159754", "0.5508119", "0.54703546", "0.54669994", "0.5465759", "0.5461548", "0.5456538", "0.5451091", "0.5451091", "0.5451091", "0.54496205", "0.54442966", "0.54301727", "0.5429805", "0.5423185", "0.54228914", "0.54152566", "0.5404442", "0.540074", "0.53829366", "0.5381623", "0.5367544", "0.536717", "0.5355995", "0.5352683", "0.5344644", "0.5343656", "0.53336877", "0.53261715", "0.53248864", "0.5321898", "0.53214264", "0.53145975", "0.53081375", "0.53076607", "0.53050333", "0.5304152", "0.5302626", "0.5302004", "0.52892697", "0.52855754", "0.5278627", "0.527543", "0.5273035", "0.52692086", "0.5264782", "0.5255838", "0.5255168", "0.52484417", "0.5248416", "0.52454317", "0.52427924", "0.5237732", "0.52368736", "0.523628", "0.52251524", "0.52210563", "0.52168196", "0.5216248", "0.5201822", "0.5199317", "0.5190485" ]
0.0
-1
Contains all of the binding logic in order to render the admin.tpl file.
public function render(array $globalBindings = []) { $route = strpos($this->route, '/') !== false ? explode('/', $this->route)[0] : $this->route; if (isset($_GET['postID'])) $post = $this->postMapper->getPostByID($_GET['postID'], false); else $post = ''; $tpl = $this->tplEngine->loadTemplate("{$route}.tpl"); $bindings = [ 'loggedIn' => $_SESSION['user']['user_id'], 'pLevel' => $_SESSION['user']['pLevel'], 'post' => $post ]; return $tpl->render(array_merge($bindings, $globalBindings)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function render_admin_page () {\n\t\tif (!Upfront_Permissions::current(Upfront_Permissions::BOOT)) wp_die(\"Nope.\");\n\n\t\tif (!class_exists('Thx_Sanitize')) require_once (dirname(__FILE__) . '/class_thx_sanitize.php');\n\t\tif (!class_exists('Thx_Template')) require_once (dirname(__FILE__) . '/class_thx_template.php');\n\n\t\tload_template(Thx_Template::plugin()->path('create_edit'));\n\t}", "public function render()\n {\n $sondages = $this->model->getSondages();\n $questions = $this->model->getQuestions();\n $reponses = $this->model->getReponses();\n\n require ROOT . \"/App/view/admin/admin.php\";\n }", "public function adminHead ()\r\n {\r\n \tif ($GLOBALS['editing']) {\r\n \t\t$this->printScripts();\r\n \t}\r\n }", "public function render_admin() {\n\t\t$route_id = !empty( $_GET[ 'route' ] ) ? sanitize_text_field( $_GET[ 'route' ] ) : false;\n\t\t?>\n\t\t\t<main class=\"wrap\">\n\t\t\t\t<h1><?= $this->title; ?></h1>\n\t\t\t\t<hr>\n\t\t\t\t<form method=\"post\" action=\"options.php\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( $route_id ) {\n\t\t\t\t\t\t\tinclude 'views/route.php';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinclude 'views/dashboard.php';\n\t\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</form>\n\t\t\t</main>\n\t\t<?php\n\t}", "public function render_admin_page() {\n $option_name = $this->name; \n include_once( dirname( __FILE__ ) . '/views/admin-page.php' );\n }", "public function startup() {\n\t\tA('AdminInterface')->bind('GatherAdminPages', array(\n\t\t\t'Core Settings' => array(\n\t\t\t\t'config' => $this->config,\n\t\t\t\t'fields' => array(\n\t\t\t\t\tSETTING_DEFAULT_BASE_PATH => array( \n\t\t\t\t\t\t'title' => 'Base Path',\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'value' => $this->config->getConfigValue(SETTING_DEFAULT_BASE_PATH)),\n\t\t\t\t\tSETTING_SITE_URL => array(\n\t\t\t\t\t\t'title' => 'Base URL',\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'value' => $this->config->getConfigValue(SETTING_SITE_URL, '')),\t\n\t\t\t\t\tSETTING_ENVIRONMENT => array(\n\t\t\t\t\t\t'title' => 'Environment',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'values' => array(\"Development\" => ENV_DEVELOPMENT, \"Test\" => ENV_TEST, \"Production\" => ENV_PRODUCTION),\n\t\t\t\t\t\t'selected' => $this->config->getConfigValue(SETTING_ENVIRONMENT)),\n\t\t\t\t),\n\t\t\t)\n\t\t));\n\t}", "function pnAddressBook_admin_main() {\r\n\r\n $output = new pnHTML();\r\n\t$output->SetInputMode(_PNH_VERBATIMINPUT);\r\n\t$output->Text(pnAddressBook_themetable('start'));\r\n\r\n // Security check\r\n if (!pnSecAuthAction(0, 'pnAddressBook::', '::', ACCESS_ADMIN)) {\r\n $output->Text(pnVarPrepHTMLDisplay(_PNADDRESSBOOK_NOAUTH));\r\n $output->Text(pnAddressBook_themetable('end'));\r\n\t\treturn $output->GetOutput();\r\n }\r\n\r\n // Add menu to output - it helps if all of the module pages have a standard\r\n // menu at their head to aid in navigation\r\n\r\n $output->Text(pnAddressBook_admin_menu());\r\n\t$output->Text(pnAddressBook_themetable('end'));\r\n\t$msg = pnVarCleanFromInput('msg');\r\n\t$output->Linebreak(1);\r\n\t$output->Title($msg);\r\n\r\n // Return the output that has been generated by this function\r\n $output->SetInputMode(_PNH_PARSEINPUT);\r\n\treturn $output->GetOutput();\r\n}", "function editAdminHandler() {\n global $inputs;\n\n updateDb('admin',[\n 'name' => $inputs['admin_username'],\n 'password' => $inputs['admin_password'],\n ], [\n 'id' => $inputs['id']\n ]);\n\n updateDb('admin_building',[\n 'building_id' => $inputs['admin_building'],\n ], [\n 'admin_id' => $inputs['id']\n ]);\n\n formatOutput(true, 'update success');\n}", "function pnAddressBook_admin_menu() {\r\n\r\n \t$settingsURL\t= pnModURL(__PNADDRESSBOOK__,'admin','modifyconfig');\r\n\t$categoryURL\t= pnModURL(__PNADDRESSBOOK__,'admin','categories');\r\n\t$labelURL\t\t= pnModURL(__PNADDRESSBOOK__,'admin','labels');\r\n\t$prefixURL\t\t= pnModURL(__PNADDRESSBOOK__,'admin','prefixes');\r\n\t$customURL\t\t= pnModURL(__PNADDRESSBOOK__,'admin','customfields');\r\n//START - gehunter\r\n\t$exportURL\t\t= pnModURL(__PNADDRESSBOOK__,'user','export');\r\n//END - gehunter\r\n\r\n\t$settingsTXT\t=pnVarPrepHTMLDisplay(_pnAB_EDIT_CONFIG);\r\n\t$categoryTXT\t=pnVarPrepHTMLDisplay(_pnAB_EDIT_pnAB_CATEGORY);\r\n\t$labelTXT\t\t=pnVarPrepHTMLDisplay(_pnAB_EDIT_LABEL);\r\n\t$prefixTXT\t\t=pnVarPrepHTMLDisplay(_pnAB_EDIT_PREFIX);\r\n\t$customTXT\t\t=pnVarPrepHTMLDisplay(_pnAB_EDIT_CUSTOM);\r\n//START - gehunter\r\n\t$exportTXT\t\t=pnVarPrepHTMLDisplay(_pnAB_ADMIN_EXPORT);\r\n//END - gehunter\r\n\r\n\t$output = new pnHTML();\r\n\t$output->SetInputMode(_PNH_VERBATIMINPUT);\r\n\t$output->Title(pnVarPrepHTMLDisplay(_PNADDRESSBOOK));\r\n\t$output->Text('<div align=\"center\">');\r\n\t$output->Text(pnAddressBook_themetable('start',2));\r\n\t$output->Text('<div align=\"center\">');\r\n\t$output->URL($settingsURL,$settingsTXT);\r\n\t$output->Text(' | ');\r\n $output->URL($categoryURL,$categoryTXT);\r\n\t$output->Text(' | ');\r\n\t$output->URL($labelURL,$labelTXT);\r\n\t$output->Text(' | ');\r\n\t$output->URL($prefixURL,$prefixTXT);\r\n\t$output->Text(' | ');\r\n\t$output->URL($customURL,$customTXT);\r\n\t$output->Text(' | ');\r\n\t$output->URL($exportURL,$exportTXT);\r\n\t$output->Text('</div>');\r\n\t$output->Text(pnAddressBook_themetable('end',2));\r\n\t$output->Text('</div>');\r\n\t$output->Linebreak(1);\r\n\r\n // Return the output that has been generated by this function\r\n return $output->GetOutput();\r\n}", "public function renderAdminShortcuts() {\n\t\n\t\t$user = $this->wire('user');\n\t\t$config = $this->wire('config');\n\t\t\n\t\tif($user->isGuest() || !$user->hasPermission('page-edit')) return '';\n\t\n\t\t$language = $user->language && $user->language->id && !$user->language->isDefault() ? $user->language : null;\n\t\t$url = $config->urls->admin . 'page/add/';\n\t\t$out = '';\n\t\n\t\tforeach(wire('templates') as $template) {\n\t\t\t$parent = $template->getParentPage(true); \n\t\t\tif(!$parent) continue; \n\t\t\tif($parent->id) {\n\t\t\t\t// one parent possible\t\n\t\t\t\t$qs = \"?parent_id=$parent->id\";\n\t\t\t} else {\n\t\t\t\t// multiple parents possible\n\t\t\t\t$qs = \"?template_id=$template->id\";\n\t\t\t}\n\t\t\t$label = $template->label;\n\t\t\tif($language) $label = $template->get(\"label$language\");\n\t\t\tif(empty($label)) $label = $template->name; \n\t\t\t$out .= \"<li><a href='$url$qs'>$label</a></li>\";\n\t\t}\n\t\n\t\tif(empty($out)) return '';\n\t\n\t\t$label = $this->_('Add New'); \n\t\n\t\t$out =\t\"<div id='head_button'>\" . \t\n\t\t\t\"<button class='ui-button dropdown-toggle'><i class='fa fa-angle-down'></i> $label</button>\" . \n\t\t\t\"<ul class='dropdown-menu shortcuts'>$out</ul>\" . \n\t\t\t\"</div>\";\n\t\n\t\treturn $out; \n\t}", "private function dld_define_admin_hooks()\n {\n\n $this->dld_admin_settings();\n }", "function admin_configuration()\n{\n global $app;\n\n $app->render('admin_configuration.html', [\n 'page' => mkPage(getMessageString('admin'), 0, 2),\n 'mailers' => mkMailers(),\n 'ttss' => mkTitleTimeSortOptions(),\n 'isadmin' => is_admin()]);\n}", "public function displayAdminPanel() {}", "function adminSpecial() {\n\t\t$this->adminDefault();\n\t\t$this->baseLink = CMS_WWW_URI.'admin/special.php?module=picture_gallery';\n\t\t$this->setView('admin_list');\n\t}", "function bindObjects()\r\n\t{\r\n\t $this->bindEventObject();\r\n\t $this->bindRecurringObject();\r\n\t $this->bindSeriesObject();\r\n\t $this->bindVenueObject();\r\n\t\t$this->image_src = $this->getImage('src');\r\n\t\t$this->link_view = 'index.php?option=com_calendar&view=events&task=view&id=' . $this->event_id . '&instance_id=' . $this->eventinstance_id;\r\n\t\t$this->bindPrimaryCategoryObject();\r\n\t\t$this->bindActionButtonObject();\r\n\t}", "public function initializeAdminPanel() {}", "public static function render_manage()\n\t{\n\t// eventually - get it basically looking right first\n\t\n\t\tif (!current_user_can('edit_pages'))\n\t\t\twp_die( __('You do not have sufficient permissions to access this page.') );\n\t\t\t\n\t\t//$list = new JHDataTablesList();\n\t\t//$list->prepare_items();\n\t\t\n\t\t?><div class=\"wrap\">\n\t\t\n<h2><?php print __( 'Manage Tables', 'jh-resource-collection' ); ?></h2>\n\n<form name=\"JHResourceCollectionAdmin\" method=\"post\" action=\"\">\n<input type=\"hidden\" name=\"<?php echo $hidden_field_name; ?>\" value=\"Y\">\n<input type=\"hidden\" name=\"page\" value=\"<?php echo $_REQUEST['page'] ?>\">\n\n<?php //$list->display() ?>\n\n<!--<p class=\"submit\">\n<input type=\"submit\" name=\"Submit\" class=\"button-primary\" value=\"<?php esc_attr_e('Save Changes') ?>\" />\n</p>-->\n\n</form>\n</div><?php\n\t}", "function output_bindings ()\n {\n $this->output_js_endpoint_once();\n printf(\n \"<script>window.%s = new Endpoint('%s', '%s');</script>\\n\",\n $this->slug, $this->slug,\n wp_create_nonce($this->nonce_name()));\n }", "function page_admincontrol() {\r\n\t\tglobal $admin_lang;\r\n\t\t//\r\n\t\t// get the coutnt of all pages\r\n\t\t//\r\n\t\t$sitedata_result = db_result(\"SELECT page_id FROM \" . DB_PREFIX . \"pages_content\");\r\n\t\t$page_count = mysql_num_rows($sitedata_result);\r\n\t\t//\r\n\t\t// get the count of all registered users\r\n\t\t//\r\n\t\t$users_result = db_result(\"SELECT user_id FROM \" . DB_PREFIX . \"users\");\r\n\t\t$users_count = mysql_num_rows($users_result);\r\n\t\t//\r\n\t\t// get the size of all tables with the prefix DB_PREFIX\r\n\t\t//\r\n\t\t$table_infos_result = db_result(\"SHOW TABLE STATUS\");\r\n\t\t$data_size = 0;\r\n\t\twhile($table_infos = mysql_fetch_object($table_infos_result)) {\r\n\t\t\tif(substr($table_infos->Name, 0, strlen(DB_PREFIX)) == DB_PREFIX)\r\n\t\t\t\t$data_size += $table_infos->Data_length + $table_infos->Index_length;\r\n\t\t}\r\n\t\r\n\t\t$out = \"<h3>AdminControl</h3><hr />\r\n\t<table>\r\n\t\t<tr><td>\" . $admin_lang['online since'] . \"</td><td>#DATUM</td></tr>\r\n\t\t<tr><td>\" . $admin_lang['registered users'] . \"</td><td>\" . $users_count . \"</td></tr>\r\n\t\t<tr><td>\" . $admin_lang['created pages'] . \"</td><td>\" . $page_count . \"</td></tr>\r\n\t\t<tr><td>\" . $admin_lang['database size'] . \"</td><td>\" . kbormb($data_size) . \"</td></tr>\r\n\t</table>\r\n\t\r\n\t<h3>Aktuelle Besucher</h3><hr />\r\n\t<table>\r\n\t\t<tr>\r\n\t\t\t<td>\".$admin_lang['name'].\"</td>\r\n\t\t\t<td>\".$admin_lang['page'].\"</td>\r\n\t\t\t<td>\".$admin_lang['last action'].\"</td>\r\n\t\t\t<td>\".$admin_lang['language'].\"</td>\r\n\t\t\t<td>\".$admin_lang['ip'].\"</td>\r\n\t\t\t<td>\".$admin_lang['host'].\"</td>\r\n\t\t</tr>\";\r\n\t\t\t//output all visitors surfing on the site\r\n\t\t\t$users_online_result = db_result(\"SELECT userid, page, lastaction, lang, ip, host FROM \" . DB_PREFIX . \"online\");\r\n\t\t\twhile($users_online = mysql_fetch_object($users_online_result)) {\r\n\t\t\t\tif($users_online->userid == 0)\r\n\t\t\t\t\t$username = $admin_lang['not registered'];\r\n\t\t\t\telse\r\n\t\t\t\t\t$username = getUserById($users_online->userid);\r\n\t\t\t\t//\r\n\t\t\t\t// FIXME: gethostbyaddr needes to much time if there are many users online\r\n\t\t\t\t//\r\n\t\t\t\t$out .= \"\\t\\t\\t<tr>\r\n\t\t\t<td>\".$username.\"</td>\r\n\t\t\t<td><a href=\\\"index.php?page=\".$users_online->page.\"\\\">\".$users_online->page.\"</a></td>\r\n\t\t\t<td>\" . date(\"d.m.Y H:i:s\", $users_online->lastaction).\"</td>\r\n\t\t\t<td>\" . $admin_lang[$users_online->lang] . \"</td>\r\n\t\t\t<td>\" . $users_online->ip . \"</td>\r\n\t\t\t<td>\" . $users_online->host . \"</td>\r\n\t\t</tr>\\r\\n\";\r\n\t\t\t}\r\n\r\n\t\t$out .= \"</table>\";\r\n\t\r\n\t\treturn $out;\r\n\t}", "public function admin_load()\n {\n }", "public function admin_init() {}", "public function render_graphiql_admin_page()\n {\n }", "function xanthia_admin_main()\n{\n\t/** Security check - important to do this as early as possible to avoid\n\t* potential security holes or just too much wasted processing. For the\n\t* main function we want to check that the user has at least edit privilege\n\t* for some item within this component, or else they won't be able to do\n\t* anything and so we refuse access altogether. The lowest level of access\n\t* for administration depends on the particular module, but it is generally\n\t* either 'edit' or 'delete'\n\t*/\n if (!pnSecAuthAction(0, 'Xanthia::', '::', ACCESS_EDIT)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n }\n // Load user API\n\tif (!pnModAPILoad('Xanthia','user')) {\t \n pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay(_XA_APILOADFAILED));\n pnRedirect(pnModURL('Xanthia', 'admin', 'view'));\n return true;\n\t}\n // Return the Admin View Function\n\t//return xanthia_adminmenu();\n\treturn xanthia_admin_view();\n}", "public function InitializeAdmin()\n\t{\n\t\t//$this->CreateParameter('notification', '', $this->Lang('help_param_notification'));\t\n\t\t//$this->CreateParameter('var_*', '', $this->Lang('help_param_var_'));\t\n\t}", "public function admin_setup()\n\t{\n\t\t\n\t}", "public function init_admin_page() {\n\t\t$this->print_header();\n\t\t$this->load_template( WPEXPANSE_Blog_Styles_Pro::$plugin_data[\"this-dir\"].'templates/admin-area' );\n\t}", "public static function _options_page(){\n\t\tif( isset($_POST['urls']) ){\n\t\t\tself::updateUrls($_POST['urls']);\n\t\t}\n\t\t\n\t\t$vars = (object) array();\n\t\t$vars->messages = implode( \"\\n\", self::$messages );\n\t\t$vars->path = self::$path;\n\t\t$vars->urls = self::getUrls();\n\t\tself::render( 'admin', $vars );\n\t}", "function network_admin_html()\n {\n }", "public function admin()\n {\n $this->template_admin->displayad('admin');\n }", "function load_sailthru_admin_display() {\n\n\t\t$active_tab = empty( $this->views[ current_filter() ] ) ? '' : $this->views[ current_filter() ];\n\t\t// display html\n\t\tinclude SAILTHRU_PLUGIN_PATH . 'views/admin.php';\n\n\t}", "function pnAddressBook_admin_updateconfig() {\r\n\r\n $output = new pnHTML();\r\n\t$output->SetInputMode(_PNH_VERBATIMINPUT);\r\n\t$output->Text(pnAddressBook_themetable('start'));\r\n\r\n // Security check\r\n if (!pnSecAuthAction(0, 'pnAddressBook::', '::', ACCESS_ADMIN)) {\r\n $output->Text(pnVarPrepHTMLDisplay(_PNADDRESSBOOK_NOAUTH));\r\n $output->Text(pnAddressBook_themetable('end'));\r\n\t\treturn $output->GetOutput();\r\n }\r\n\r\n $output->Text(pnAddressBook_admin_menu());\r\n\t$output->Text(pnAddressBook_themetable('end'));\r\n\t$output->Linebreak(1);\r\n\r\n // Confirm authorisation code.\r\n if (!pnSecConfirmAuthKey()) {\r\n pnSessionSetVar('errormsg', _BADAUTHKEY);\r\n return false;\r\n }\r\n\r\n // Get parameters from whatever input we need.\r\n $guestmode_1 = pnVarCleanFromInput('guestmode_1');\r\n\t$guestmode_2 = pnVarCleanFromInput('guestmode_2');\r\n\t$guestmode_3 = pnVarCleanFromInput('guestmode_3');\r\n\t$usermode_1 = pnVarCleanFromInput('usermode_1');\r\n\t$usermode_2 = pnVarCleanFromInput('usermode_2');\r\n\t$usermode_3 = pnVarCleanFromInput('usermode_3');\r\n\t$globalprotect = pnVarCleanFromInput('globalprotect');\r\n\t$menu_off = pnVarCleanFromInput('menu_off');\r\n\t$zipbeforecity = pnVarCleanFromInput('zipbeforecity');\r\n\t$abtitle = pnVarCleanFromInput('abtitle');\r\n\t$custom_tab = pnVarCleanFromInput('custom_tab');\r\n\t$itemsperpage = pnVarCleanFromInput('itemsperpage');\r\n\t$hidecopyright = pnVarCleanFromInput('hidecopyright');\r\n\t$use_prefix = pnVarCleanFromInput('use_prefix');\r\n\t$use_img = pnVarCleanFromInput('use_img');\r\n\t$textareawidth = pnVarCleanFromInput('textareawidth');\r\n\t$dateformat = pnVarCleanFromInput('dateformat');\r\n\t$numformat = pnVarCleanFromInput('numformat');\r\n\t$sortdata_1 = pnVarCleanFromInput('sortdata_1');\r\n\t$sortdata_2 = pnVarCleanFromInput('sortdata_2');\r\n\t$sortdata_3 = pnVarCleanFromInput('sortdata_3');\r\n\t$sortdata_4 = pnVarCleanFromInput('sortdata_4');\r\n\t$menu_semi = pnVarCleanFromInput('menu_semi');\r\n\t$name_order = pnVarCleanFromInput('name_order');\r\n\t$special_chars_1 = pnVarCleanFromInput('special_chars_1');\r\n\t$special_chars_2 = pnVarCleanFromInput('special_chars_2');\r\n\r\n // Update module variables.\r\n if (!isset($abtitle)) {\r\n $abtitle = '';\r\n }\r\n\tif (!isset($globalprotect)) {\r\n $globalprotect = 0;\r\n }\r\n\tif (!isset($hidecopyright)) {\r\n $hidecopyright = 0;\r\n }\r\n\tif (!isset($use_prefix)) {\r\n $use_prefix = 0;\r\n }\r\n\tif (!isset($use_img)) {\r\n $use_img = 0;\r\n }\r\n\tif (!isset($menu_off)) {\r\n $menu_off = 0;\r\n }\r\n\tif (!isset($menu_semi)) {\r\n $menu_semi = 0;\r\n }\r\n\tif (!isset($name_order)) {\r\n $name_order = 0;\r\n }\r\n\tif (!isset($zipbeforecity)) {\r\n $zipbeforecity = 0;\r\n }\r\n\tif (!isset($itemsperpage)) {\r\n $itemsperpage = 30;\r\n }\r\n\tif (!isset($custom_tab)) {\r\n $custom_tab = '';\r\n }\r\n\tif (!isset($special_chars_1)) {\r\n $special_chars_1 = '';\r\n }\r\n\tif (!isset($special_chars_2)) {\r\n $special_chars_2 = '';\r\n }\r\n\tif (!isset($textareawidth)) {\r\n $textareawidth = 60;\r\n }\r\n\tif (!isset($dateformat)) {\r\n $dateformat = 0;\r\n }\r\n\tif (!isset($numformat)) {\r\n $numformat = '9,999.99';\r\n }\r\n\t$guestmode = 0;\r\n\tif (isset($guestmode_1)) {\r\n\t\t$guestmode += 4;\r\n\t}\r\n\tif (isset($guestmode_2)) {\r\n\t\t$guestmode += 2;\r\n\t}\r\n\tif (isset($guestmode_3)) {\r\n\t\t$guestmode += 1;\r\n\t}\r\n\r\n\t$usermode = 0;\r\n\tif (isset($usermode_1)) {\r\n\t\t$usermode += 4;\r\n\t}\r\n\tif (isset($usermode_2)) {\r\n\t\t$usermode += 2;\r\n\t}\r\n\tif (isset($usermode_3)) {\r\n\t\t$usermode += 1;\r\n\t}\r\n\tif ($globalprotect == 1) {\r\n\t\tif (($guestmode != 0) || ($usermode != 7)) {\r\n\t\t\t$guestmode = 0;\r\n\t\t\t$usermode = 7;\r\n\t\t\t$error = pnVarPrepHTMLDisplay(_pnAB_GLOBALPROTECTERROR);\r\n\t\t}\r\n\t}\r\n\tif ($guestmode > $usermode) {\r\n\t\t$usermode = $guestmode;\r\n\t\t$error = pnVarPrepHTMLDisplay(_pnAB_GRANTERROR);\r\n\t}\r\n\r\n\tpnModSetVar(__PNADDRESSBOOK__, 'globalprotect', $globalprotect);\r\n\tpnModSetVar(__PNADDRESSBOOK__, 'menu_off', $menu_off);\r\n pnModSetVar(__PNADDRESSBOOK__, 'itemsperpage', $itemsperpage);\r\n\tpnModSetVar(__PNADDRESSBOOK__, 'guestmode', $guestmode);\r\n\tpnModSetVar(__PNADDRESSBOOK__, 'usermode', $usermode);\r\n\tpnModSetVar(__PNADDRESSBOOK__, 'custom_tab', $custom_tab);\r\n\tpnModSetVar(__PNADDRESSBOOK__, 'zipbeforecity', $zipbeforecity);\r\n\tpnModSetVar(__PNADDRESSBOOK__, 'abtitle', $abtitle);\r\n\tpnModSetVar(__PNADDRESSBOOK__, 'hidecopyright', $hidecopyright);\r\n\tpnModSetVar(__PNADDRESSBOOK__, 'use_prefix', $use_prefix);\r\n\tpnModSetVar(__PNADDRESSBOOK__, 'use_img', $use_img);\r\n\tpnModSetVar(__PNADDRESSBOOK__, 'textareawidth', $textareawidth);\r\n\tpnModSetVar(__PNADDRESSBOOK__, 'dateformat', $dateformat);\r\n\tpnModSetVar(__PNADDRESSBOOK__, 'numformat', $numformat);\r\n\tpnModSetVar(__PNADDRESSBOOK__, 'menu_semi', $menu_semi);\r\n\tpnModSetVar(__PNADDRESSBOOK__, 'name_order', $name_order);\r\n\r\n\tif ($sortdata_1 == $sortdata_2) {\r\n\t\tif ($error) {\r\n\t\t\t$error .= '<br>'.pnVarPrepHTMLDisplay(_pnAB_SORTERROR_1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$error = pnVarPrepHTMLDisplay(_pnAB_SORTERROR_1);\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\t$s_1 = $sortdata_1.','.$sortdata_2;\r\n\t\tpnModSetVar(__PNADDRESSBOOK__, 'sortorder_1', $s_1);\r\n\t}\r\n\tif ($sortdata_3 == $sortdata_4) {\r\n\t\tif ($error) {\r\n\t\t\t$error .= '<br>'.pnVarPrepHTMLDisplay(_pnAB_SORTERROR_2);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$error = pnVarPrepHTMLDisplay(_pnAB_SORTERROR_2);\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\t$s_2 = $sortdata_3.','.$sortdata_4;\r\n\t\tpnModSetVar(__PNADDRESSBOOK__, 'sortorder_2', $s_2);\r\n\t}\r\n\r\n\tif (strlen($special_chars_1) != strlen($special_chars_2)) {\r\n\t\t$error .= '<br>'.pnVarPrepHTMLDisplay(_pnAB_SPECIAL_CHARS_ERROR);\r\n\t}\r\n\telse {\r\n\t\tpnModSetVar(__PNADDRESSBOOK__, 'special_chars_1', $special_chars_1);\r\n\t\tpnModSetVar(__PNADDRESSBOOK__, 'special_chars_2', $special_chars_2);\r\n\t}\r\n\t$msg = pnVarPrepHTMLDisplay(_pnAB_CONF_pnAB_SUCCESS);\r\n\tif (isset($error)) { $msg .= ' - '.$error; }\r\n\r\n\t$args=array('msg'=>$msg);\r\n\r\n // This function generated no output, and so now it is complete we redirect\r\n // the user to an appropriate page for them to carry on their work\r\n pnRedirect(pnModURL(__PNADDRESSBOOK__, 'admin', 'main',$args));\r\n\r\n // Return\r\n return true;\r\n}", "private function _bindFrontEndEvents() {\n\n if(AstuteoToolkit::$plugin->getSettings()->includeFeEdit) {\n Event::on(\n View::class,\n View::EVENT_END_BODY,\n function (Event $e)\n {\n $element = Craft::$app->getUrlManager()->getMatchedElement();\n if (!$element) return;\n\n if (\n $this->_shouldLoadAssets()\n ) {\n echo '<a\n href=\"' . $element->cpEditUrl . '\"\n class=\"astuteo-edit-entry\"\n target=\"_blank\"\n rel=\"noopener\"\n >Edit Entry</a>';\n }\n }\n );\n }\n if ($this->_shouldLoadAssets() && !Craft::$app->request->getIsAjax() && !Craft::$app->request->getIsConsoleRequest()) {\n Craft::$app->getView()->registerAssetBundle(AstuteoToolkitAsset::class);\n }\n }", "function printAdminPage() {\n require ('adminPage.php');\n adminPage($this);\n }", "public function admin_index() {\n\n\t\t\t/*get all data from table \"modules\"*/\n\t\t\t$modules=$this->Module->find(\"all\");\n\n\t\t\t/*set variables of page*/\n\t\t\t$this->set(\"title\", \"Gestion\");\n\t\t\t$this->set(\"legend\", \"Modules manager\");\n\t\t\t$this->set(\"modules\", $modules);\n\t\t\t}", "private function define_admin_hooks() {\n\n\t\t//$theme_admin = new Wpt_Custom_Theme_Admin( $this->get_theme_name(), $this->get_version() );\n\n\t\t//$this->loader->add_action( 'admin_enqueue_scripts', $theme_admin, 'enqueue_styles' );\n\n\t}", "public function render_control_templates()\n {\n }", "function admin()\n{\n global $app;\n\n $app->render('admin.html', [\n 'page' => mkPage(getMessageString('admin'), 0, 1),\n 'isadmin' => is_admin()]);\n}", "function bit_admin_page() {\n\t//Creates admin page\n}", "public function adminUi()\n\t{\n\t\tif(empty($_GET['post_type'])) return;\n\n\t\t$this->postType = esc_attr($_GET['post_type']);\n\t\t$this->tax = (isset($_GET['reorder_tax']) ? esc_attr($_GET['reorder_tax']) : false);\n\t\t$this->term = (isset($_GET['reorder_term']) ? esc_attr($_GET['reorder_term']) : false);\n\n\t\t$typeObj = get_post_type_object($this->postType);\n\t\t$title = $typeObj->labels->name;\n\n\t\t$this->getOptions();\n\n\t\trequire_once( $this->viewDir . '/list.php' );\n\t}", "public function adminPanel() {\n $posts = $this->postManager->getPosts();\n $comments = $this->commentManager->getFlaggedComments();\n $view = new View(\"Administration\");\n $view->generate(array('posts' => $posts, 'comments' => $comments));\n }", "private function admin_hooks() {\n\t\t\n\t\t// Actions\n\t\t// Load Nav injection\n\t\t$this->add_action ('admin_menu', $this->nav, 'plugin_menu' );\n\t\t\n\t\t// Load Dashboard widget\n\t\t$this->add_action ('wp_dashboard_setup', $this->admin, 'dashboard');\n\t\t\n\t\t// Load Edit Post additions\n\t\t// $this->add_action ('add_meta_boxes', $this->admin, 'post_edit' );\n\n\t\t// Load social toggles on submitbox, if the setting is available\n\t\t// if (get_option('smmp_view_submitbox'))\n\t\t//\t$this->add_action ('post_submitbox_misc_actions', $this->admin, 'admin_post_submitbox' );\n\t\t\n\t\t// On post update/save\n\t\t// $this->add_action ('save_post', $this->admin, 'admin_post_submitbox_submit');\n\t\t\n\t\t\n\t\t// Load Expired Account notice\n\t\t/*try {$this->admin->validate_accounts (); }\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$this->add_action ('admin_notices', $this->admin, 'notice_accounts' );\n\t\t}*/\n\t\t\n\t\t// Filters\n\t\t// Prevent inner links for flow-drive images\n\t\t$this->add_action ('image_downsize', $this->admin, 'filter_image_downsize', 10, 3);\n\t}", "function adminOptions() {\r\n\t\t\tTrackTheBookView::render('admin-options');\r\n\t\t}", "protected function bind_action_buttons() {\n\t\t\t?>\n\t\t\t<script type='text/javascript'>\n\t\t\t\tjQuery(document).ready(function () {\n\t\t\t\t\tjQuery(\"#doaction\").click(function () {\n\t\t\t\t\t\treturn wpda_action_button();\n\t\t\t\t\t});\n\t\t\t\t\tjQuery(\"#doaction2\").click(function () {\n\t\t\t\t\t\treturn wpda_action_button();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t</script>\n\t\t\t<?php\n\t\t}", "abstract public function bindForm();", "abstract public function bindForm();", "function xanthia_admin_config()\n{\n\n\t/** Security check - important to do this as early as possible to avoid\n\t * potential security holes or just too much wasted processing. For the\n\t * main function we want to check that the user has at least edit privilege\n\t * for some item within this component, or else they won't be able to do\n\t * anything and so we refuse access altogether. The lowest level of access\n\t * for administration depends on the particular module, but it is generally\n\t * either 'edit' or 'delete'\n\t */\n\tif (!pnSecAuthAction(0, 'Xanthia::', '::', ACCESS_EDIT)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n \t}\n\n\t// Load user API\n\tif (!pnModAPILoad('Xanthia','user')) {\n pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay(_XA_APILOADFAILED));\n pnRedirect(pnModURL('Xanthia', 'admin', 'view'));\n return true;\n\t}\n\n // Load admin API\n\tif (!pnModAPILoad('Xanthia', 'admin')) {\n pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay(_XA_APILOADFAILED));\n pnRedirect(pnModURL('Xanthia', 'admin', 'view'));\n return true;\n\t}\n\n\t// Create output object - this object will store all of our output so that\n\t// we can return it easily when required\n\t$pnRender =& new pnRender('Xanthia');\n\n\t// As Admin output changes often, we do not want caching.\n\t$pnRender->caching = false;\n\n // Visual Block Editor\n $pnRender->assign('vba', pnModGetVar('Xanthia', 'vba'));\n \n if (file_exists(\".htaccess\")){ \n\t $pnRender->assign('htaccess', 1); \n } else {\n \t$pnRender->assign('htaccess', 0); \n } \n\n\t// Short urls\n $pnRender->assign('shorturls', pnModGetVar('Xanthia', 'shorturls'));\n\n\t// Short urls\n $pnRender->assign('shorturlsextension', pnModGetVar('Xanthia', 'shorturlsextension'));\n\n // Enable Cache\n $pnRender->assign('enablecache', pnModGetVar('Xanthia', 'enablecache'));\n\n\t// modules not to cache for\n\t$pnRender->assign('modulesnocache', pnModGetVar('Xanthia', 'modulesnocache'));\n\n // Cache templates to Database\n $pnRender->assign('db_cache', pnModGetVar('Xanthia', 'db_cache'));\n \n // Compile Templates to Database (not active yet)\n $pnRender->assign('db_compile', pnModGetVar('Xanthia', 'db_compile'));\n\n // Check for new version of template\n $pnRender->assign('compile_check', pnModGetVar('Xanthia', 'compile_check'));\n\n // Force Check for new version of template\n $pnRender->assign('force_compile', pnModGetVar('Xanthia', 'force_compile'));\n \n // Cache Time\n $pnRender->assign('cache_lifetime', pnModGetVar('Xanthia', 'cache_lifetime'));\n\n // Base Caching on Database Updates\n $pnRender->assign('use_db', pnModGetVar('Xanthia', 'use_db'));\n\n // Use Database for Templates\n $pnRender->assign('db_templates', pnModGetVar('Xanthia', 'db_templates'));\n\n // use of whitespace output filter\n\t$pnRender->assign('trimwhitespace', pnModGetVar('Xanthia', 'trimwhitespace'));\n\n // Return the output that has been generated by this function\n if (ereg('0.8', _PN_VERSION_NUM)) {\n return $pnRender->fetch('xanthiaadminconfig.htm');\n\t} else {\n return $pnRender->fetch('xanthiaadmin726config.htm');\n\t}\n}", "public function bindFields()\n {\n // TODO: Implement bindFields() method.\n }", "function Ephemerids_admin_main()\n{\n // Security check - important to do this as early as possible to avoid\n // potential security holes or just too much wasted processing. For the\n // main function we want to check that the user has at least edit privilege\n // for some item within this component, or else they won't be able to do\n // anything and so we refuse access altogether. The lowest level of access\n // for administration depends on the particular module, but it is generally\n // either 'edit' or 'delete'\n if (!pnSecAuthAction(0, 'Ephemerids::', '::', ACCESS_EDIT)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n }\n\n // Create output object - this object will store all of our output so that\n // we can return it easily when required\n\t$pnRender =& new pnRender('Ephemerids');\n\n\t// As Admin output changes often, we do not want caching.\n\t$pnRender->caching = false;\n\n // Return the output that has been generated by this function\n return $pnRender->fetch('ephemerids_admin_main.htm');\n}", "function _wp_admin_html_begin()\n {\n }", "public function admin_init() {\n $this->add_actions();\n $this->apply_editor_wrap();\n $this->activate_builder_callbacks();\n }", "public function admincp_index() {\n $toolBar = array('addNew', 'delete');\n getToolbar($this->module, $toolBar);\n\n $default_func = 'updated';\n $default_sort = 'DESC';\n $data = array(\n 'module' => $this->module,\n 'default_func' => $default_func,\n 'default_sort' => $default_sort\n );\n $this->template->write_view('content', 'BACKEND/index', $data);\n $this->template->render();\n }", "function sMain ()\n\t{\n\t\tglobal $ttH;\n\t\t\n\t\t$ttH->func->load_language_admin($this->modules);\n\t\t$ttH->temp_act = new XTemplate($ttH->path_html.$this->modules.DS.$this->action.\".tpl\");\n\t\t$ttH->temp_act->assign('LANG', $ttH->lang);\n\t\t$ttH->temp_act->assign('DIR_IMAGE', $ttH->dir_images);\n\t\t\n\t\t$fun = (isset($ttH->post['f'])) ? $ttH->post['f'] : '';\n\n\t\tflush();\n\t\tswitch ($fun) {\n\t\t\tcase \"list_widget\":\n\t\t\t\techo $this->do_list_widget();\n\t\t\t\texit;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\techo '';\n\t\t\t\texit;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\texit;\n\t}", "public function admin()\n {\n $this->view->books = $this->help->getBookList();\n $this->view->title = $this->lang->help->common;\n $this->display();\n }", "function admin_html()\n {\n }", "function admin_init()\n {\n }", "public function admin_page()\n {\n }", "public function admin_page()\n {\n }", "public function render_control_template_scripts()\n {\n }", "public function render_control_template_scripts()\n {\n }", "public function render_control_template_scripts()\n {\n }", "public function render_control_template_scripts()\n {\n }", "public function render_control_template_scripts()\n {\n }", "function ParmsView() { \n $render = new AdminModel(); \n echo '<div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-md-1\"></div>\n <div class=\"col-md-4\">\n <h2>Administrators:\n <a href=\"'.DIR.'index.php?page=adminView&action=insertNewAdmin\"><i class=\"fa fa-plus-square\"></a></i>\n </h2><br>';\n \n $displayAdmins = $render->getAdmins();\n foreach ($displayAdmins as $admin) {\n echo '<div class=\"box\"><a href=\"'.DIR.'index.php/?page=adminView&action=adminDetails&id='.$admin['adminId'].'\">' .$admin['adminName'].'</a>, </br>'.\n '<img src=\"'.DIR.'upload/'.$admin['adminImage'].'\"/>'. $admin['adminPhone'] . '</br>'. $admin['adminRole'] . '</br>'. $admin['adminEmail'] .'</div></br>';\n };\n\n\t\techo '</div>\n <div class=\"col-md-5\">';\n }", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}", "function admin_load()\n {\n }", "private function define_admin_hooks()\n {\n\n $plugin_admin = new myFOSSIL_Resources_Admin( $this->get_plugin_name(),\n $this->get_version() );\n\n $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin,\n 'enqueue_styles' );\n $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin,\n 'enqueue_scripts' );\n\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'register_menus' );\n\n /* Custom Post Types */\n $this->loader->add_action( 'init', $plugin_admin, 'create_events' );\n\n /* AJAX */\n $this->loader->add_action( 'wp_ajax_myfossil_resources_load_data', $plugin_admin,\n 'ajax_handler' );\n\n /* Advanced Custom Fields */\n\t\t$this->loader->add_filter( 'acf/settings/path', $plugin_admin, 'acf_settings_path' );\n\t\t$this->loader->add_filter( 'acf/settings/dir', $plugin_admin, 'acf_settings_dir' );\n add_filter('acf/settings/show_admin', '__return_false');\n }", "public function beforeRender(){\n\n //render edit form with actual values from database\n $component_iterator = $this->getComponent(\"editForm\")->getComponents();\n $componenty = iterator_to_array($component_iterator);\n\n if ($this->actualListingValues != null){\n \n $optArray = $this->postageOptions;\n $postageCounter = $priceCounter = 0;\n \n foreach ($componenty as $comp){\n switch($comp->name){\n \n case 'product_name':\n $comp->setValue($this->actualListingValues['product_name']);\n break;\n case 'product_desc':\n $comp->setValue($this->actualListingValues['product_desc']);\n break;\n case 'price':\n $comp->setValue($this->actualListingValues['price']);\n break;\n case 'ships_from':\n $comp->setValue($this->actualListingValues['ships_from']);\n break;\n case 'ships_to';\n $comp->setValue($this->actualListingValues['ships_to']);\n break;\n case 'product_type':\n $comp->setValue($this->actualListingValues['ships_to']);\n break;\n case (strpos($comp->name, \"postage\")):\n //render all postage options into correct textboxes\n if (array_key_exists($postageCounter, $optArray)){\n $comp->setValue($optArray[$postageCounter]['option']);\n $postageCounter++;\n }\n break; \n case (strpos($comp->name, \"pprice\")):\n //render postage prices into correct textboxes\n if (array_key_exists($priceCounter, $optArray)){\n $comp->setValue($optArray[$priceCounter]['price']);\n $priceCounter++; \n } \n break; \n }\n }\n }\n \n $urlPath = $this->URL->path;\n \n //template variables shared between templates\n if ( strpos($urlPath, \"edit\" )|| strpos($urlPath, \"view\") \n || strpos($urlPath, \"buy\")){\n \n $lst = $this->hlp->sess(\"listing\");\n $imgs = $this->hlp->sess(\"images\");\n $this->template->listingDetails = $lst->listingDetails;\n $this->template->listingImages = $imgs->listingImages;\n }\n }", "public function pageAdmin()\r\n\t{\r\n\t\t// Donnees\r\n\t\t$eventId = Bn::getValue('event_id');\r\n\t\t$oEvent = new Oevent($eventId);\r\n\t\t$oExtras = new Oeventextra($eventId);\r\n\r\n\t\t// Controle de l'autorisation\r\n\t\tif ( $oEvent->getVal('ownerid') != Bn::getValue('user_id') && !Oaccount::isLoginAdmin() ) return false;\r\n\r\n\t\t// Preparer les champs de saisie\r\n\t\t$body = new Body();\r\n\r\n\t\t// Titres\r\n\t\t$t = $body->addP('', '', 'bn-title-2');\r\n\t\t$t->addBalise('span', '', LOC_ITEM_GENERAL);\r\n\r\n\t\t// Infos generales\r\n\t\t$form = $body->addForm('frmAdmin', BPREF_UPDATE_ADMIN, 'targetDlg');\r\n\t\t$form->getForm()->addMetadata('success', \"updated\");\r\n\t\t$form->getForm()->addMetadata('dataType', \"'json'\");\r\n\r\n\t\t$div = $form->addDiv('', 'bn-div-left');\r\n\t\t$edt = $div->addEdit('nameevent', LOC_LABEL_EVENT_NAME, $oEvent->getVal('name'), 255);\r\n\t\t$edt->tooltip(LOC_TOOLTIP_EVENT_NAME);\r\n\r\n\t\t$edt = $div->addEdit('place', LOC_LABEL_EVENT_PLACE, $oEvent->getVal('place'), 25);\r\n\t\t$edt->tooltip(LOC_TOOLTIP_EVENT_PLACE);\r\n\r\n\t\t$edt = $div->addEdit('dateevent', LOC_LABEL_EVENT_DATE, $oEvent->getVal('date'), 25);\r\n\t\t$edt->tooltip(LOC_TOOLTIP_EVENT_DATE);\r\n\r\n\t\t$edt = $div->addEdit('numauto', LOC_LABEL_EVENT_NUMAUTO, $oEvent->getVal('numauto'), 50);\r\n\r\n\t\t$edt = $div->addEdit('organizer', LOC_LABEL_EVENT_ORGANIZER, $oEvent->getVal('organizer'), 75);\r\n\t\t$edt->noMandatory();\r\n\t\t//$edt->tooltip(LOC_TOOLTIP_EVENT_ORGANIZER);\r\n\r\n\t\t/* Region */\r\n\t\t$cbo = $div->addSelect('regionid', LOC_LABEL_EVENT_REGION);\r\n\t\t//$cbo->tooltip(LOC_TOOLTIP_EVENT_REGION);\r\n\t\t$regs = Ogeo::getRegions(-1, LOC_LABEL_SELECT_REGION);\r\n\t\t$cbo->addOptions($regs, $oExtras->getVal('regionid'));\r\n\r\n\t\t/* Departement */\r\n\t\t$cbo = $div->addSelect('deptid', LOC_LABEL_EVENT_DPT);\r\n\t\t//$cbo->tooltip(LOC_TOOLTIP_EVENT_DPT);\r\n\t\t$codeps = Ogeo::getDepts(-1, LOC_LABEL_SELECT_DPT);\r\n\t\t$cbo->addOptions($codeps, $oExtras->getVal('deptid'));\r\n\r\n\t\t$d = $div->addDiv('', 'bn-div-line');\r\n\t\t$edt = $d->addEditDate('firstday', LOC_LABEL_EVENT_FIRSTDAY, Bn::date($oEvent->getVal('firstday'), 'd-m-Y'));\r\n\t\t$edt->addOption('onSelect', 'selectFirstDay');\r\n\t\t$edt->addOption('maxDate', 'new Date(' . Bn::date($oEvent->getVal('lastday'), 'Y,m-1,d') .')');\r\n\t\t$edt = $d->addEditDate('lastday', LOC_LABEL_EVENT_LASTDAY, Bn::date($oEvent->getVal('lastday'), 'd-m-Y'));\r\n\t\t$edt->addOption('onSelect', 'selectLastDay');\r\n\t\t$edt->addOption('minDate', 'new Date(' . Bn::date($oEvent->getVal('firstday'), 'Y,m-1,d') .')');\r\n\r\n\t\t$d->addBreak();\r\n\r\n\t\t$d = $form->addDiv('', 'bn-div-btn');\r\n\t\t$d->addButtonValid('', LOC_BTN_UPDATE);\r\n\r\n\t\t// Envoi au navigateur\r\n\t\t$body->display();\r\n\t\treturn false;\r\n\t}", "public function output_widget_control_templates()\n {\n }", "public function admin_render()\n {\n $output = $this->admin_form_before();\n $output .= $this->admin_form_start();\n $output .= $this->default_fields();\n $widget_saved_values = $this->get_settings();\n\n $output .= $this->admin_language_tab(); //have to start language tab from here on\n $output .= $this->admin_language_tab_start();\n\n $all_languages = LanguageHelper::all_languages();\n foreach ($all_languages as $key => $lang) {\n $output .= $this->admin_language_tab_content_start([\n 'class' => $key == 0 ? 'tab-pane fade show active' : 'tab-pane fade',\n 'id' => \"nav-home-\" . $lang->slug\n ]);\n $output .= Text::get([\n 'name' => 'title_'.$lang->slug,\n 'label' => __('Title'),\n 'value' => $widget_saved_values['title_' . $lang->slug] ?? null,\n ]);\n $output .= $this->admin_language_tab_content_end();\n }\n\n $output .= $this->admin_language_tab_end(); //have to end language tab\n\n $output .= Text::get([\n 'name' => 'location',\n 'label' => __('Location'),\n 'value' => $widget_saved_values['location'] ?? null,\n ]);\n $output .= Select::get([\n 'name' => 'custom_form_id',\n 'label' => __('Custom Form'),\n 'placeholder' => __('Select form'),\n 'options' => FormBuilder::all()->pluck('title','id')->toArray(),\n 'value' => $widget_saved_values['custom_form_id'] ?? []\n ]);\n $output .= Slider::get([\n 'name' => 'padding_top',\n 'label' => __('Padding Top'),\n 'value' => $widget_saved_values['padding_top'] ?? 50,\n 'max' => 200,\n ]);\n $output .= Slider::get([\n 'name' => 'padding_bottom',\n 'label' => __('Padding Bottom'),\n 'value' => $widget_saved_values['padding_bottom'] ?? 50,\n 'max' => 200,\n ]);\n $output .= $this->admin_form_submit_button();\n $output .= $this->admin_form_end();\n $output .= $this->admin_form_after();\n\n return $output;\n }", "public function admin_init(){\n\n\t}", "function print_admin() {\r\n\t\t\t\t\t$options = $this->get_options();\t\t\t\t\r\n\t\t\t\t\tif (isset($_POST['update_dropcaps'])) { \r\n\t\t\t\t\t\t$options['plugin_css'] = (isset($_POST['dropcaps_css']))?true:false;\r\n\t\t\t\t\t\t$options['the_content'] = (isset($_POST['dropcaps_content']))?true:false;\r\n\t\t\t\t\t\t$options['the_excerpt'] = (isset($_POST['dropcaps_excerpt']))?true:false;\r\n\t\t\t\t\t\t$options['the_comment'] = (isset($_POST['dropcaps_comment']))?true:false;\r\n\t\t\t\t\t\t$options['home'] = (isset($_POST['dropcaps_home']))?true:false;\r\n\t\t\t\t\t\t$options['single'] = (isset($_POST['dropcaps_single']))?true:false;\r\n\t\t\t\t\t\t$options['page'] = (isset($_POST['dropcaps_page']))?true:false;\r\n\t\t\t\t\t\t$options['archive'] = (isset($_POST['dropcaps_archive']))?true:false;\r\n\t\t\t\t\t\t$options['search'] = (isset($_POST['dropcaps_search']))?true:false;\r\n\t\t\t\t\t\t$options['feed'] = (isset($_POST['dropcaps_feed']))?true:false;\r\n\t\t\t\t\t\t$options['attachment'] = (isset($_POST['dropcaps_attachment']))?true:false;\r\n\t\t\t\t\t\t$options['tag'] = (isset($_POST['dropcaps_tag']))?true:false;\r\n\t\t\t\t\t\t$options['category'] = (isset($_POST['dropcaps_category']))?true:false;\r\n\t\t\t\t\t\t$options['date'] = (isset($_POST['dropcaps_date']))?true:false;\r\n\t\t\t\t\t\t$options['author'] = (isset($_POST['dropcaps_author']))?true:false;\r\n\t\t\t\t\t\t$options['excluded_ids']=(isset($_POST['dropcaps_excluded_ids']))? explode(',',$_POST['dropcaps_excluded_ids']):array();\r\n\t\t\t\t\t\t$options['excluded_cats']=(isset($_POST['dropcaps_excluded_cats']))? explode(',',$_POST['dropcaps_excluded_cats']):array();\r\n\t\t\t\t\t\tupdate_option($this->options_name, $options);\r\n\t\t\t\t\t\t?>\r\n<div class=\"updated\"><p><strong><?php _e(\"Settings Updated.\", \"dropcaps\");?></strong></p></div>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t} ?>\r\n<div class=\"wrap\">\r\n<form method=\"post\" action=\"<?php echo $_SERVER[\"REQUEST_URI\"]; ?>\">\r\n<h2>Drop Caps Plugin</h2>\r\n<h3>Options</h3>\r\n<p>Select the options which suit your blog. You can choose whether drop caps will appear in the content, the excerpt or in comments. You can also choose which pages drop caps will appear on.</p>\r\n<p>The plugin comes with a default stylesheet which is applied to the drop caps. This can be disabled if you wish to use your own styling.</p>\r\n<table class=\"form-table\"><tbody>\r\n\t<tr valign=\"top\">\r\n\t\t<th scope=\"row\">Enable drop caps in</th>\r\n\t\t<td>\r\n\t\t<label for=\"dropcaps_content\"><input type=\"checkbox\" id=\"dropcaps_content\" name=\"dropcaps_content\" <?php if ($options['the_content'])echo 'checked=\"checked\"';?> /> <code>the_content()</code></label><br />\r\n\t\t<label for=\"dropcaps_excerpt\"><input type=\"checkbox\" id=\"dropcaps_excerpt\" name=\"dropcaps_excerpt\" <?php if ($options['the_excerpt'])echo 'checked=\"checked\"';?> /> <code>the_excerpt()</code></label><br />\r\n\t\t<label for=\"dropcaps_comment\"><input type=\"checkbox\" id=\"dropcaps_comment\" name=\"dropcaps_comment\" <?php if ($options['the_comment'])echo 'checked=\"checked\"';?> /> <code>comment_text()</code></label>\r\n\t\t</td>\r\n\t</tr>\r\n\t<tr valign=\"top\">\r\n\t\t<th scope=\"row\">Enable drop caps on</th>\r\n\t\t<td>\r\n\t\t<label for=\"dropcaps_home\"><input type=\"checkbox\" id=\"dropcaps_home\" name=\"dropcaps_home\" <?php if ($options['home'])echo 'checked=\"checked\"';?> /> the main blog page</label><br />\r\n\t\t<label for=\"dropcaps_single\"><input type=\"checkbox\" id=\"dropcaps_single\" name=\"dropcaps_single\" <?php if ($options['single'])echo 'checked=\"checked\"';?> /> single post pages</label><br />\r\n\t\t<label for=\"dropcaps_page\"><input type=\"checkbox\" id=\"dropcaps_page\" name=\"dropcaps_page\" <?php if ($options['page'])echo 'checked=\"checked\"';?> /> PAGE pages</label><br />\r\n\t\t<label for=\"dropcaps_search\"><input type=\"checkbox\" id=\"dropcaps_search\" name=\"dropcaps_search\" <?php if ($options['search'])echo 'checked=\"checked\"';?> /> search results</label><br />\r\n\t\t<label for=\"dropcaps_feed\"><input type=\"checkbox\" id=\"dropcaps_feed\" name=\"dropcaps_feed\" <?php if ($options['feed'])echo 'checked=\"checked\"';?> /> feeds</label><br />\r\n\t\t<label for=\"dropcaps_attachment\"><input type=\"checkbox\" id=\"dropcaps_attachment\" name=\"dropcaps_attachment\" <?php if ($options['attachment'])echo 'checked=\"checked\"';?> /> attachments</label><br />\r\n\t\t<label for=\"dropcaps_archive\"><input type=\"checkbox\" id=\"dropcaps_archive\" name=\"dropcaps_archive\" <?php if ($options['archive'])echo 'checked=\"checked\"';?> onchange=\"if(this.checked){document.getElementById('dropcaps_tag').checked = true;document.getElementById('dropcaps_category').checked = true;document.getElementById('dropcaps_date').checked = true;document.getElementById('dropcaps_author').checked = true;}\" /> all archives</label><br />\r\n\t\t<div style=\"margin-left:2em;\"><label for=\"dropcaps_tag\"><input type=\"checkbox\" id=\"dropcaps_tag\" name=\"dropcaps_tag\" <?php if ($options['tag'])echo 'checked=\"checked\"';?> onchange=\"if(!this.checked){document.getElementById('dropcaps_archive').checked = false}\" /> tag archives</label><br />\r\n\t\t<label for=\"dropcaps_category\"><input type=\"checkbox\" id=\"dropcaps_category\" name=\"dropcaps_category\" <?php if ($options['category'])echo 'checked=\"checked\"';?> onchange=\"if(!this.checked){document.getElementById('dropcaps_archive').checked = false}\" /> category archives</label><br />\r\n\t\t<label for=\"dropcaps_date\"><input type=\"checkbox\" id=\"dropcaps_date\" name=\"dropcaps_date\" <?php if ($options['date'])echo 'checked=\"checked\"';?> onchange=\"if(!this.checked){document.getElementById('dropcaps_archive').checked = false}\" /> date archives</label><br />\r\n\t\t<label for=\"dropcaps_author\"><input type=\"checkbox\" id=\"dropcaps_author\" name=\"dropcaps_author\" <?php if ($options['author'])echo 'checked=\"checked\"';?> onchange=\"if(!this.checked){document.getElementById('dropcaps_archive').checked = false}\" /> author archives</label></div>\r\n\t\t</td>\r\n\t</tr>\r\n\t<tr valign=\"top\">\r\n\t\t<th scope=\"row\">CSS Styling</th>\r\n\t\t<td><label for=\"dropcaps_css\"><input type=\"checkbox\" id=\"dropcaps_css\" name=\"dropcaps_css\" <?php if ($options['plugin_css'])echo 'checked=\"checked\"';?>/> Style the drop caps using the plugin styling. (Leave unchecked to write your own CSS in your stylesheet)</label></td>\r\n\t</tr>\r\n</tbody></table>\r\n\t\t<h3>Exclude</h3>\r\n<p>Type the comma seperated names, slugs or IDs of the categories or posts that you want to exclude from having drop caps.</p>\r\n<p>If you have drop caps enabled on comments, these will show up wether or not the post is excluded.</p>\r\n<table class=\"form-table\"><tbody>\r\n\t<tr>\r\n\t\t<th>Excluded posts</th>\r\n\t\t<td><input type=\"text\" id=\"dropcaps_excluded_ids\" name=\"dropcaps_excluded_ids\" value=\"<?php if ($options['excluded_ids'])echo implode(',',$options['excluded_ids']);?>\" style=\"width:98%\" /></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<th>Excluded categorys</th>\r\n\t\t<td><input type=\"text\" id=\"dropcaps_excluded_cats\" name=\"dropcaps_excluded_cats\" value=\"<?php if ($options['excluded_cats'])echo implode(',',$options['excluded_cats']);?>\" style=\"width:98%\" /></td>\r\n\t</tr>\r\n</tbody></table>\r\n<div class=\"submit\">\r\n<input type=\"submit\" name=\"update_dropcaps\" value=\"<?php _e('Update Settings', 'dropcaps') ?>\" /></div>\r\n</form>\r\n </div>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t}", "private function dc_define_admin_hooks() {\n\n\t\t$plugin_admin = new Dorancafe_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'dc_enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'dc_enqueue_scripts' );\n\n\t}", "function gazette1_admin() {\n // Generates html for admin page view\n include('admin/gazette1_import_admin.php');\n}", "public function admin_render()\n {\n $output = $this->admin_form_before();\n $output .= $this->admin_form_start();\n $output .= $this->default_fields();\n $widget_saved_values = $this->get_settings();\n\n $output .= $this->admin_language_tab(); //have to start language tab from here on\n $output .= $this->admin_language_tab_start();\n\n $all_languages = LanguageHelper::all_languages();\n foreach ($all_languages as $key => $lang) {\n $output .= $this->admin_language_tab_content_start([\n 'class' => $key == 0 ? 'tab-pane fade show active' : 'tab-pane fade',\n 'id' => \"nav-home-\" . $lang->slug\n ]);\n $output .= Text::get([\n 'name' => 'title_'.$lang->slug,\n 'label' => __('Title'),\n 'value' => $widget_saved_values['title_' . $lang->slug] ?? null,\n ]);\n $output .= $this->admin_language_tab_content_end();\n }\n\n $output .= $this->admin_language_tab_end(); //have to end language tab\n\n $output .= Repeater::get([\n 'multi_lang' => true,\n 'settings' => $widget_saved_values,\n 'id' => 'contact_page_contact_info_01',\n 'fields' => [\n [\n 'type' => RepeaterField::TEXT,\n 'name' => 'title',\n 'label' => __('Title')\n ],\n [\n 'type' => RepeaterField::TEXTAREA,\n 'name' => 'description',\n 'label' => __('Details'),\n 'info' => __('new line count as a separate text')\n ],\n [\n 'type' => RepeaterField::ICON_PICKER,\n 'name' => 'icon',\n 'label' => __('Icon')\n ]\n ]\n ]);\n $output .= Select::get([\n 'name' => 'custom_form_id',\n 'label' => __('Custom Form'),\n 'placeholder' => __('Select form'),\n 'options' => FormBuilder::all()->pluck('title','id')->toArray(),\n 'value' => $widget_saved_values['custom_form_id'] ?? []\n ]);\n $output .= Slider::get([\n 'name' => 'padding_top',\n 'label' => __('Padding Top'),\n 'value' => $widget_saved_values['padding_top'] ?? 120,\n 'max' => 500,\n ]);\n $output .= Slider::get([\n 'name' => 'padding_bottom',\n 'label' => __('Padding Bottom'),\n 'value' => $widget_saved_values['padding_bottom'] ?? 120,\n 'max' => 500,\n ]);\n $output .= $this->admin_form_submit_button();\n $output .= $this->admin_form_end();\n $output .= $this->admin_form_after();\n\n return $output;\n }", "private function define_admin_hooks() {\n\n\t\t$plugin_admin = new APS_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\n\t}", "function AdminBodyMain()\n\t{\t$adminmenu = new AdminMenu($this->user, $_GET[\"id\"]);\n\t\tif ($adminmenu->menuitems)\n\t\t{\techo \"<ul>\";\n\t\t\tforeach ($adminmenu->menuitems as $item)\n\t\t\t{\techo \"<li>\";\n\t\t\t\tif ($item->details[\"menulink\"])\n\t\t\t\t{\techo \"<a href='\", $item->details[\"menulink\"], \"'>\", $this->InputSafeString($item->details[\"menutext\"]), \"</a>\";\n\t\t\t\t} else\n\t\t\t\t{\techo $this->InputSafeString($item->details[\"menutext\"]);\n\t\t\t\t}\n\t\t\t\tif ($item->submenu->menuitems)\n\t\t\t\t{\techo \" - <a href='rawmenu.php?id=\", $item->id, \"'>sub menu</a>\";\n\t\t\t\t}\n\t\t\t\techo \"</li>\";\n\t\t\t}\n\t\t\techo \"</ul>\";\n\t\t}\n\t}", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Error.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Error::error($error);\n return;\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "protected function runAdmin()\n {\n parent::runAdmin();\n\n $f3 = \\Base::instance();\n \n // Tell the admin that this is an available front-end theme\n \\Dsc\\System::instance()->get('theme')->registerTheme('Theme', $f3->get('PATH_ROOT') . 'apps/Theme/' );\n \n // register this theme's module positions with the admin\n \\Modules\\Factory::registerPositions( array('theme-head', 'theme-below-header', 'theme-above-footer', 'theme-below-footer', 'theme-above-content', 'theme-below-content', 'theme-left-content', 'theme-right-content', 'product-finalsale') );\n }", "function admin_load() {\n\n\t}", "private function admin_includes() {\n\n\t\t// load admin classes\n\t\t$this->admin = $this->load_class( '/includes/admin/class-wc-pip-admin.php', 'WC_PIP_Admin' );\n\t\t$this->orders_admin = $this->load_class( '/includes/admin/class-wc-pip-orders-admin.php', 'WC_PIP_Orders_Admin' );\n\t}", "function create_binding() {\r\n\t\ttry {\r\n\t\t\t$conn = db_connect::getInstance();\r\n\t\t\t$result = $conn->db->query(\"SELECT OLT_ID from OLT_IP_POOLS where OLT_ID = '$this->olt_id'\");\r\n\t\t} catch (PDOException $e) {\r\n\t\t\t$error = \"Connection Failed:\" . $e->getMessage() . \"\\n\";\r\n\t\t\treturn $error;\r\n\t\t}\r\n\t\twhile ($row = $result->fetch(PDO::FETCH_ASSOC)) {\r\n\t\t\tif ($row[\"OLT_ID\"])\r\n\t\t\t\t$error = (\"ERROR: THIS OLT have been ASSIGNED pool ALREADY, Please remove any existing bindings and try to create again!\");\r\n\t\t\t\treturn $error;\t\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$conn = db_connect::getInstance();\r\n\t\t\t$result = $conn->db->query(\"INSERT INTO OLT_IP_POOLS (OLT_ID, IP_POOL_ID) VALUES ('$this->olt_id', '$this->id')\");\r\n\t\t} catch (PDOException $e) {\r\n\t\t\t$error = \"Connection Failed:\" . $e->getMessage() . \"\\n\";\r\n\t\t\treturn $error;\r\n\t\t}\r\n\t}", "private function adminContentArea(): void {\n global $security;\n global $media_admin;\n global $media_manager;\n\n // Prepare Query\n if(($absolute = MediaManager::absolute($_GET[\"path\"] ?? DS)) === null) {\n $absolute = PATH_UPLOADS_PAGES;\n $relative = DS;\n } else {\n $relative = MediaManager::relative($absolute);\n }\n\n // Load Main Content Modal\n include \"admin\" . DS . \"modal.php\";\n\n // Load Modals\n \trequire \"admin\" . DS . \"modal-folder.php\";\n if(PAW_MEDIA_PLUS) {\n require \"admin\" . DS . \"modal-search.php\";\n }\n }", "function xanthia_admin_view()\n{\n\t/** Security check - important to do this as early as possible to avoid\n\t * potential security holes or just too much wasted processing. For the\n\t * main function we want to check that the user has at least edit privilege\n\t * for some item within this component, or else they won't be able to do\n\t * anything and so we refuse access altogether. The lowest level of access\n\t * for administration depends on the particular module, but it is generally\n\t * either 'edit' or 'delete'\n\t */\n\tif (!pnSecAuthAction(0, 'Xanthia::', '::', ACCESS_EDIT)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n\t}\n\n\t// Load user API\n\tif (!pnModAPILoad('Xanthia','user')) {\n pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay(_XA_APILOADFAILED));\n pnRedirect(pnModURL('Xanthia', 'admin', 'view'));\n return true;\n \t}\n\n\t// Load admin API\n\tif (!pnModAPILoad('Xanthia', 'admin')) {\n pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay(_XA_APILOADFAILED));\n pnRedirect(pnModURL('Xanthia', 'admin', 'view'));\n return true;\n \t}\n\n\t// Create output object - this object will store all of our output so that\n\t// we can return it easily when required\n\t$pnRender =& new pnRender('Xanthia');\n\n\t// As Admin output changes often, we do not want caching.\n\t$pnRender->caching = false;\n\n $pnRender->assign('showhelp', pnModGetVar('Xanthia','help'));\n\n\t// Themes\n\t// Get a list of all themes in the themes dir\n\t$allthemes = pnModAPIFunc('Xanthia','user','getAllThemes');\n\t// Get a list of all themes in database\n\t$allskins = pnModAPIFunc('Xanthia','user','getAllSkins');\n\n\t$skins = array();\n if ($allskins) {\n\t foreach($allskins as $allskin) {\n\t $skins[] = $allskin['name'];\n\t }\n\t}\n\n // Generate an Authorization ID\n $authid = pnSecGenAuthKey();\n\t$pnRender->assign('authid', $authid);\n\n if ($allthemes){\n //Start Foreach\n foreach($allthemes as $themes) {\n // Add applicable actions\n $actions = array();\n\n \t\tswitch ($themes) {\n //If theme is active in Xanthia then show the edit theme link\n\t\t case in_array($themes, $skins):\n $state = 1;\n break;\n //If theme is not active in Xanthia then show the add theme link \n\t\t\t default:\n $state = 0;\n break;\n\t\t\t}\n \n\t $theme[] = array('state' => $state,\n\t\t\t\t\t\t 'themename' => $themes);\n //End Foreach\n }\n }\n\t$pnRender->assign('theme', $theme);\n // Return the output that has been generated to the template\n return $pnRender->fetch('xanthiaadminviewmain.htm');\n}", "public function renderAdminSidebar()\r\n\t{\r\n\t\treturn;\r\n\t}", "public function renderAdminSidebar()\r\n\t{\r\n\t\treturn;\r\n\t}", "function moduleContent()\t{\n\t\t$mod = t3lib_div::makeInstance('tx_groupdelegation');\n\n\t\tif($mod->checkAdminAndSetAdminGroupsSqlString() === false) {\n\t\t\t$this->content .= $GLOBALS['LANG']->getLL('no_permission');\n\t\t} else {\n\t\t\t$mod->setEditableUsers();\n\n\t\t\t\t//build edit user form\n\t\t\tif(t3lib_div::GPvar('user') && !t3lib_div::GPvar('edit')) {\n\t\t\t\t$this->content.=$this->doc->section($GLOBALS['LANG']->getLL('edit_user'),$mod->renderEditUserForm(),0,1);\n\n\t\t\t\t//save and build user overview\n\t\t\t} elseif(t3lib_div::GPvar('user') && t3lib_div::GPvar('edit')) {\n\t\t\t\t$mod->save();\n\t\t\t\t$mod->setEditableUsers();\n\t\t\t\t$this->content .= $this->doc->section($GLOBALS['LANG']->getLL('editable_user_overview'),$mod->renderUserOverview(),0,1);\n\n\t\t\t\t\t//build user overview\n\t\t\t} else {\n\t\t\t\t\t$this->content .= $this->doc->section($GLOBALS['LANG']->getLL('editable_user_overview'),$mod->renderUserOverview(),0,1);\n\t\t\t}\n\t\t}\n\t}", "public function show_admin_page() {\n\t\t$this->view->render();\n\t}", "function admin_menu() {\n\t\t// The designation of add_MANAGEMENT_page causes the menu item to be listed under the Tools menu!\n\t\tadd_management_page('Revitalize Orders Output', 'Revitalize Orders', 'edit_posts', basename(__FILE__), array(&$this, 'page_handler'));\n\t}", "public function admin()\n {\n return $this->render('admin.twig');\n }", "function vntModule()\n {\n global $Template, $vnT, $func, $DB, $conf;\n require_once(\"function_\" . $this->module . \".php\");\n $this->skin = new XiTemplate(DIR_MODULE . DS . $this->module . \"_ad\" . DS . 'html' . DS . $this->action . \".tpl\");\n $this->skin->assign('LANG', $vnT->lang);\n $this->skin->assign('DIR_IMAGE', $vnT->dir_images);\n $lang = ($vnT->input['lang']) ? $lang = $vnT->input['lang'] : $func->get_lang_default();\n $this->linkUrl = \"?mod=\" . $this->module . \"&act=\" . $this->action . \"&lang=\" . $lang;\n\n switch ($vnT->input['sub']) {\n case 'edit':\n $nd['f_title'] = \"Cập nhật giao diện Admin\";\n $nd['content'] = $this->do_Edit($lang);\n break;\n default:\n $nd['f_title'] = \"Cập nhật giao diện Admin\";\n $nd['content'] = $this->do_Edit($lang);\n break;\n }\n// $nd['menu'] = $func->getToolbar_Small($this->module, $this->action, $lang);\n $nd['row_lang'] = $func->html_lang(\"?mod=\" . $this->module . \"&act=\" . $this->action, $lang);\n\n $Template->assign(\"data\", $nd);\n $Template->parse(\"box_main\");\n $vnT->output .= $Template->text(\"box_main\");\n\n }", "public function adminmenu()\n {\n\n $vue = new ViewAdmin(\"Administration\");\n $vue->generer(array());\n }", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Menu.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Menu::showMenu($error);\n return;\n }\n // see if we need to do anything to the db\n if(isset($_REQUEST['newadmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->department_id = $_REQUEST['department_id'];\n $admin->username = $_REQUEST['username'];\n $admin->save();\n }else if (isset($_REQUEST['deladmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->id = $_REQUEST['id'];\n $admin->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Menu.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Menu::showMenu($error);\n return;\n }\n // see if we need to do anything to the db\n if(isset($_REQUEST['newadmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->department_id = $_REQUEST['department_id'];\n $admin->username = $_REQUEST['username'];\n $admin->save();\n }else if (isset($_REQUEST['deladmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->id = $_REQUEST['id'];\n $admin->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "function Sniffer_admin_main()\n{\n // Security check - important to do this as early as possible to avoid\n // potential security holes or just too much wasted processing. For the\n // main function we want to check that the user has at least edit privilege\n // for some item within this component, or else they won't be able to do\n // anything and so we refuse access altogether. The lowest level of access\n // for administration depends on the particular module, but it is generally\n // either 'edit' or 'delete'\n if (!pnSecAuthAction(0, 'Sniffer::', '::', ACCESS_EDIT)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n }\n\n\t// get the object\n\t// Note: we're calling a technically private API function but since we're\n\t// in the module that's defined the API then this seems ok (ish...).\n\t$browserinfo = pnModAPIFunc('Sniffer', 'user', 'get');\n\n // Create output object - this object will store all of our output so that\n // we can return it easily when required\n $pnRender =& new pnRender('Sniffer');\n\n\t// assign the object\n\t// Note: we assign the object by reference to avoid duplication in memory\n\t$pnRender->assign_by_ref('browserinfo', $browserinfo);\n\n // Return the output that has been generated by this function\n return $pnRender->fetch('sniffer_admin_main.htm');\n}", "public function admincp_index()\n {\n modules::run('admincp/chk_perm', $this->session->userdata('ID_Module'), 'r', 0);\n $default_func = 'order_num';\n $default_sort = 'ASC';\n $data = array(\n 'module' => $this->module,\n 'module_name' => $this->session->userdata('Name_Module'),\n 'default_func' => $default_func,\n 'default_sort' => $default_sort\n );\n\n $this->template->write_view('content', 'BACKEND/index', $data);\n $this->template->render();\n }", "public function admincp_index(){\n\t\tpermission_force_check('r');\n\t\t$default_func = 'created';\n\t\t$default_sort = 'DESC';\n\t\t$data = array(\n\t\t\t'module'=>$this->module,\n\t\t\t'module_name'=>$this->session->userdata('Name_Module'),\n\t\t\t'default_func'=>$default_func,\n\t\t\t'default_sort'=>$default_sort\n\t\t);\n\t\t$this->template->write_view('content','BACKEND/index',$data);\n\t\t$this->template->render();\n\t}", "public function initContent()\n {\n\n $shipping = $this->get_ahref('AdminFrankShipping');\n $returns = $this->get_ahref('AdminFrankReturns');\n $statics = $this->get_ahref('AdminFrankStatics');\n $settings = $this->get_ahref('AdminFrankSettings');\n parent::initContent();\n $this->context->smarty->assign(\n array(\n// 'api_statics' => $api_statics['data'],\n 'shipping' => $shipping,\n 'returns' => $returns,\n 'settings' => $settings,\n )\n );\n\n $this->setTemplate('statics.tpl');\n }", "public function admin_render()\n {\n $output = $this->admin_form_before();\n $output .= $this->admin_form_start();\n $output .= $this->default_fields();\n $widget_saved_values = $this->get_settings();\n\n //render language tab\n $output .= $this->admin_language_tab();\n $output .= $this->admin_language_tab_start();\n\n $all_languages = Language::all();\n foreach ($all_languages as $key => $lang) {\n $output .= $this->admin_language_tab_content_start([\n 'class' => $key == 0 ? 'tab-pane fade show active' : 'tab-pane fade',\n 'id' => \"nav-home-\" . $lang->slug\n ]);\n $widget_title = $widget_saved_values['widget_title_' . $lang->slug] ?? '';\n $output .= '<div class=\"form-group\"><input type=\"text\" name=\"widget_title_' . $lang->slug . '\" class=\"form-control\" placeholder=\"' . __('Widget Title') . '\" value=\"' . purify_html($widget_title) . '\"></div>';\n\n $output .= $this->admin_language_tab_content_end();\n }\n $output .= $this->admin_language_tab_end();\n //end multi langual tab option\n\n $output .= $this->admin_form_submit_button();\n $output .= $this->admin_form_end();\n $output .= $this->admin_form_after();\n\n return $output;\n }", "function displayTools()\n\t{\n\t\t$this->checkDisplayMode();\n\n\t\t// output\n\t\tilUtil::sendInfo();\n\n\t\t// use property forms and add the settings type switch\n\t\t$ctrl_structure_form = $this->initControlStructureForm();\n\t\t$settings_type_form = $this->initSettingsTypeForm();\n\t\t$mp_ns_form = $this->initTreeImplementationForm();\n\n\t\t$this->tpl->setVariable(\"SETUP_CONTENT\",\n\t\t\t$ctrl_structure_form->getHTML() . \"<br />\" .\n\t\t\t$settings_type_form->getHTML().'<br />'.\n\t\t\t$mp_ns_form->getHTML());\n\n\t}", "public function custom_bulk_admin_footer() {\n\t\tglobal $post_type;\n\t\t\n\t\tif($post_type == 'post') {\n\t\t\t?>\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t\tjQuery('<option>').val('build').text('<?php _e('Build flat file')?>').appendTo(\"select[name='action']\");\n\t\t\t\t\t\tjQuery('<option>').val('build').text('<?php _e('Build flat file')?>').appendTo(\"select[name='action2']\");\n\t\t\t\t\t\tjQuery('#doaction').on('click', function(e) {\n\t\t\t\t\t\t\t// e.preventDefault();\n\t\t\t\t\t\t\tif(jQuery('#bulk-action-selector-top')[0].value == 'build') {\n\t\t\t\t\t\t\t\tif (jQuery('.updated')[0]) {\n\t\t\t\t\t\t\t\t\tjQuery('.updated').html('<p style=\"display:inline-block;\">Currently building...<span style=\"margin-top:0;\" class=\"spinner is-active\"></span></p>');\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tjQuery('.wrap h1').after('<div class=\"updated\"><p style=\"display:inline-block;\">Currently building...<span style=\"margin-top:0;\" class=\"spinner is-active\"></span></p></div>');\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\t\t\t\t</script>\n\t\t\t<?php\n \t}\n\t}" ]
[ "0.5953425", "0.585859", "0.5841698", "0.5824138", "0.58148354", "0.5809363", "0.5796085", "0.5781424", "0.575418", "0.57345647", "0.5716918", "0.5694845", "0.567676", "0.5615203", "0.5597088", "0.5592816", "0.55843425", "0.55826575", "0.5579435", "0.55663234", "0.5555022", "0.5526745", "0.55226827", "0.55209035", "0.551987", "0.5514313", "0.5499911", "0.5496692", "0.54789793", "0.54634416", "0.54576373", "0.54557145", "0.5438427", "0.5429731", "0.54213", "0.5410277", "0.5409868", "0.5408861", "0.540683", "0.5405734", "0.5400897", "0.5388671", "0.53860366", "0.5384515", "0.5384515", "0.5382666", "0.53707397", "0.537021", "0.53696984", "0.53596807", "0.5352017", "0.5348899", "0.53483576", "0.5347809", "0.5344332", "0.5341802", "0.5341802", "0.53389364", "0.53389364", "0.53389364", "0.53389364", "0.53389364", "0.53385216", "0.5338006", "0.53334177", "0.533046", "0.5330248", "0.53279054", "0.5316935", "0.5316671", "0.53137773", "0.52921796", "0.5291011", "0.52844834", "0.5282307", "0.5273537", "0.5271442", "0.52700514", "0.52698815", "0.5267625", "0.5267118", "0.5255703", "0.52531195", "0.52502054", "0.5245744", "0.5245744", "0.5243649", "0.52343154", "0.5234278", "0.5233912", "0.5230204", "0.5223164", "0.52184665", "0.52184665", "0.5211511", "0.5209692", "0.5207514", "0.5205521", "0.5205439", "0.5203301", "0.5190054" ]
0.0
-1
Handle an incoming request.
public function handle($request, Closure $next) { try { $token = $request->bearerToken(); $verifyToken = $this->jwtHelperService->verifyJwtToken($token); if ($verifyToken['errors'] == true) { // handle jwt error echo json_encode($verifyToken); exit(); } // passed token validate, continue with request $tokenClaims = (array) $verifyToken['result']; $request->attributes->add(['token_claims' => $tokenClaims]); } catch (\Exception $e) { // } 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
/ cek telat select nomor_surat_masuk, keterangan_surat_masuk, nomor_SIK, ((SLA)(DATEDIFF(tanggal_SIK,DATE_FORMAT(FROM_UNIXTIME(update_status_SIK), '%Y%m%d')))1) as pengerjaan, tanggal_sik, SLA, DATE_FORMAT(FROM_UNIXTIME(update_status_SIK), '%Y%m%d') as done from pms_lan WHERE status_SIK='Done' and ((SLA)(DATEDIFF(tanggal_SIK,DATE_FORMAT(FROM_UNIXTIME(update_status_SIK), '%Y%m%d')))1)<0 and tanggal_surat_masuk BETWEEN '20191201' AND '20191231'
public function SLA(){ $sql="select * from pms_lan WHERE status_SIK='Done' and status_by_case is null and kategori='pms_lan' and tanggal_surat_masuk BETWEEN '".date("Y-m-d" , strtotime($_POST['date1']))."' AND '".date("Y-m-d" , strtotime($_POST['date2']))."'"; return $this->db->query($sql)->result_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function check_peminjaman(){\n\t\t$tbl_peminjaman_inventaris = $this->db->query(\" SELECT a.kodepeminjam_user, a.kode_inventaris, \n\t\t\tCASE \n\t\t\t\tWHEN a.konfirmasi_peminjaman='0' AND a.konfirmasi_kembali='0' THEN 'Menunggu Konfirmasi'\n\t\t\t\tWHEN a.konfirmasi_peminjaman='0' AND a.konfirmasi_kembali='1' THEN 'Batal Pinjam'\n\t\t\t\tWHEN a.konfirmasi_peminjaman='1' AND a.konfirmasi_kembali='0' AND (UNIX_TIMESTAMP(a.tanggal_kembali) - UNIX_TIMESTAMP() >0) THEN 'Belum Kembali'\n\t\t\t\tWHEN a.konfirmasi_peminjaman='1' AND a.konfirmasi_kembali='0' AND (UNIX_TIMESTAMP(a.tanggal_kembali) - UNIX_TIMESTAMP() <0) THEN 'Terlambat'\n\t\t\t\tWHEN a.konfirmasi_peminjaman='1' AND a.konfirmasi_kembali='1' THEN 'Sudah Kembali'\n\t\t\tEND as keterangan\n\t\t\tFROM tbl_peminjaman_inventaris a \n\t\t\tLEFT JOIN tbl_inventaris b ON a.kode_inventaris=b.kode_inventaris\n\t\t\tLEFT JOIN tbl_user c ON a.kodepeminjam_user=c.kodepeminjam_user\n\t\t\tWHERE (CASE \n\t\t\t\tWHEN a.konfirmasi_peminjaman='0' AND a.konfirmasi_kembali='0' THEN 'Menunggu Konfirmasi'\n\t\t\t\tWHEN a.konfirmasi_peminjaman='0' AND a.konfirmasi_kembali='1' THEN 'Batal Pinjam'\n\t\t\t\tWHEN a.konfirmasi_peminjaman='1' AND a.konfirmasi_kembali='0' AND (UNIX_TIMESTAMP(a.tanggal_kembali) - UNIX_TIMESTAMP() >0) THEN 'Belum Kembali'\n\t\t\t\tWHEN a.konfirmasi_peminjaman='1' AND a.konfirmasi_kembali='0' AND (UNIX_TIMESTAMP(a.tanggal_kembali) - UNIX_TIMESTAMP() <0) THEN 'Terlambat'\n\t\t\t\tWHEN a.konfirmasi_peminjaman='1' AND a.konfirmasi_kembali='1' THEN 'Sudah Kembali'\n\t\t\tEND)='Terlambat'\n\t\t\torder by created_peminjaman DESC\")->result();\n\t\tforeach($tbl_peminjaman_inventaris as $peminjaman_inventaris){\n\t\t\t$tbl_user = $this->db->query(\"select GROUP_CONCAT(CONCAT('{',a.user_name,' - ',a.notelp_user,'}')) as admin from tbl_user a where a.level_user='administrator'\")->row();\n\t\t\t$where2['kode_inventaris'] = $peminjaman_inventaris->kode_inventaris;\n\t\t\t$inventaris = $this->m_general->view_by(\"tbl_inventaris\",$where2);\n\t\t\t$pesan = \"Anda terlambat mengembalikan { $inventaris->kode_inventaris } { $inventaris->nama_inventaris }, Mohon segera untuk menghubungi pihak Labor Komputer FASILKOM UNILAK: $tbl_user->admin, Terimakasih.\";\n\t\t\t$id_inbox = $this->m_general->bacaidterakhir(\"tbl_inbox\", \"id_inbox\");\n\t\t\t$inbox = array(\n\t\t\t\t\t'id_inbox' => $id_inbox,\n\t\t\t\t\t'isi_inbox' => $pesan,\n\t\t\t\t\t'kodepeminjam_user' => $peminjaman_inventaris->kodepeminjam_user\n\t\t\t);\n\t\t\t$this->m_general->add(\"tbl_inbox\", $inbox);\t\t\t\t\n\t\t}\n\t}", "function putus_lhdr_cg_pbt(){\n $query = $this->db->query(\"SELECT a.perkara_id, a.`nomor_perkara`,\n c.tanggal_sidang,c.dihadiri_oleh ,\n DATE_FORMAT(b.tanggal_putusan,'%d %M %Y') AS tanggal_putusan,\n DATE_FORMAT(DATE_ADD(b.tanggal_putusan, INTERVAL 7 DAY),'%d %M %Y') AS expire_pbt,\n DATEDIFF(DATE_ADD(b.tanggal_putusan, INTERVAL 7 DAY),CURDATE()) AS selisih,\n e.`alamat`\n FROM perkara AS a \n LEFT JOIN perkara_putusan AS b ON a.`perkara_id`=b.`perkara_id`\n LEFT JOIN perkara_jadwal_sidang AS c ON a.`perkara_id`=c.`perkara_id`\n LEFT JOIN perkara_putusan_pemberitahuan_putusan AS d ON a.`perkara_id`=d.`perkara_id`\n LEFT JOIN perkara_pihak2 AS e ON a.`perkara_id`=e.`perkara_id`\n LEFT JOIN perkara_akta_cerai AS f ON a.`perkara_id`=f.`perkara_id`\n LEFT JOIN perkara_banding AS g ON a.`perkara_id`=g.`perkara_id`\n WHERE b.`tanggal_putusan` =c.`tanggal_sidang`\n AND g.`tanggal_pendaftaran_banding`IS NULL\n AND DATE_FORMAT(a.tanggal_pendaftaran, '%Y') >2017\n AND f.`tgl_akta_cerai` IS NULL\n AND d.`tanggal_pemberitahuan_putusan` IS NULL\n AND c.`dihadiri_oleh`='2'\n AND b.`putusan_verstek`='T'\n AND b.status_putusan_id=62\n AND a.`jenis_perkara_id`=347\n GROUP BY nomor_perkara DESC\");\n return $query; \n }", "public function tidaklulus_UNDARAN(){\n\t\t$query=\"SELECT COUNT(id_pendadaran) AS jml_tdk_lulus FROM ujian_pendadaran WHERE status='tidak_lulus' GROUP BY status\"; //query untuk menghitung jumlah mahasiswa yang tidak lulus undaran\n\t\t$this->eksekusi($query); //mengeksekusi query diatas\n\t\treturn $this->result; //mengembalikan hasil query diatas\n\t}", "function putus_v_ct_phs(){\n $query = $this->db->query(\"SELECT a.perkara_id, a.`nomor_perkara`,\n c.tanggal_sidang,c.dihadiri_oleh ,\n DATE_FORMAT(b.tanggal_putusan,'%d %M %Y') AS tanggal_putusan,\n DATE_FORMAT(DATE_ADD(d.tanggal_pemberitahuan_putusan, INTERVAL 15 DAY),'%d %M %Y') AS expire_phs_ikrar\n FROM perkara AS a \n LEFT JOIN perkara_putusan AS b ON a.`perkara_id`=b.`perkara_id`\n LEFT JOIN perkara_jadwal_sidang AS c ON a.`perkara_id`=c.`perkara_id`\n LEFT JOIN perkara_putusan_pemberitahuan_putusan AS d ON a.`perkara_id`=d.`perkara_id`\n LEFT JOIN perkara_ikrar_talak AS e ON a.`perkara_id`= e.`perkara_id`\n\t\t\t\t\t\t\t\t\tLEFT JOIN perkara_akta_cerai AS f ON a.perkara_id=f.perkara_id\n\t\t\t\t\t\t\t\t\tLEFT JOIN perkara_banding AS g ON a.`perkara_id`=g.`perkara_id`\n WHERE b.`tanggal_putusan` =c.`tanggal_sidang`\n AND DATE_FORMAT(a.tanggal_pendaftaran, '%Y') >2017\n AND g.`tanggal_pendaftaran_banding`IS NULL\n AND e.`tgl_ikrar_talak` IS NULL\n\t\t\t\t\t\t\t\t\tAND f.tgl_akta_cerai IS NULL\n AND c.`dihadiri_oleh`='2'\n AND b.`putusan_verstek`='Y'\n AND a.`jenis_perkara_id`=346\n GROUP BY nomor_perkara DESC\");\n return $query; \n }", "function putus_lhdr_ct_pbt(){\n $query = $this->db->query(\"SELECT a.perkara_id,a.`jenis_perkara_nama`, a.`nomor_perkara`,\n c.tanggal_sidang,c.dihadiri_oleh ,\n DATE_FORMAT(b.tanggal_putusan, '%d %M %Y') AS tanggal_putusan, \n DATE_FORMAT(DATE_ADD(b.tanggal_putusan, INTERVAL 7 DAY),'%d %M %Y') AS expire_pbt,\n\t\t\t\t g.alamat\n FROM perkara AS a \n LEFT JOIN perkara_putusan AS b ON a.`perkara_id`=b.`perkara_id`\n LEFT JOIN perkara_jadwal_sidang AS c ON a.`perkara_id`=c.`perkara_id`\n LEFT JOIN perkara_putusan_pemberitahuan_putusan AS d ON a.`perkara_id`=d.`perkara_id`\n LEFT JOIN perkara_ikrar_talak AS e ON a.`perkara_id`= e.`perkara_id`\n LEFT JOIN perkara_akta_cerai AS f ON a.`perkara_id`=f.`perkara_id`\n LEFT JOIN perkara_pihak2 AS g ON a.`perkara_id`=g.`perkara_id`\n LEFT JOIN perkara_banding AS h ON a.`perkara_id`=h.`perkara_id`\n WHERE b.`tanggal_putusan` =c.`tanggal_sidang`\n AND DATE_FORMAT(a.tanggal_pendaftaran, '%Y') >2017\n AND h.`tanggal_pendaftaran_banding`IS NULL\n AND f.`tgl_akta_cerai`IS NULL\n AND e.`tgl_ikrar_talak` IS NULL\n AND c.`dihadiri_oleh`='2'\n AND b.status_putusan_id=62\n AND b.`putusan_verstek`='T'\n AND a.`jenis_perkara_id`=346\n GROUP BY nomor_perkara DESC \");\n return $query; \n }", "function tundaBayarTunjangan($conn, $r_periode, $r_sql = '') {\n //periode tarif sekarang\n $r_periodetarif = self::getLastPeriodeTarif($conn);\n\n //nip yang diselect\t\t\n if (!empty($r_sql)) {\n $a_peg = self::pegFilter($conn, $r_sql);\n }\n\n $sql = \"select g.idpegawai,g.kodetunjangan from \" . static::table('ga_tunjanganpeg') . \" g\n\t\t\t\t\tleft join \" . static::table('ms_tunjangan') . \" t on t.kodetunjangan = g.kodetunjangan\n\t\t\t\t\twhere g.periodegaji = '$r_periode' and g.periodetarif = '$r_periodetarif' and t.isbayargaji = 'T' and t.isaktif = 'Y' and g.isdibayar = 'Y'\";\n if (!empty($a_peg))\n $sql .= \" and g.idpegawai in ($a_peg)\";\n\n $rs = $conn->Execute($sql);\n\n $record = array();\n $record['isdibayar'] = 'T';\n $record['tglbayar'] = 'null';\n\n $recgaji = array();\n $recgaji['isbayarawal'] = 'T';\n while ($row = $rs->FetchRow()) {\n $key = $row['idpegawai'] . '|' . $r_periode . '|' . $r_periodetarif . '|' . $row['kodetunjangan'];\n $colkey = 'idpegawai,periodegaji,periodetarif,kodetunjangan';\n\n list($err, $msg) = self::updateRecord($conn, $record, $key, true, 'ga_tunjanganpeg', $colkey);\n\n if (!$err) {\n $keygaji = $row['idpegawai'] . '|' . $r_periode;\n $colkeygaji = 'idpegawai,periodegaji';\n list($err, $msg) = self::updateRecord($conn, $recgaji, $keygaji, true, 'ga_gajipeg', $colkeygaji);\n }\n }\n\n list($err, $msg) = self::updateStatus($conn);\n\n return array($err, $msg);\n }", "function putus_lhdr_ct_phs(){\n $query = $this->db->query(\"SELECT a.perkara_id, a.`nomor_perkara`,\n c.tanggal_sidang,c.dihadiri_oleh ,\n DATE_FORMAT(b.tanggal_putusan,'%d %M %Y') AS tanggal_putusan,\n DATE_FORMAT(d.`tanggal_pemberitahuan_putusan`,'%d %M %Y') AS tanggal_pbt,\n DATE_FORMAT(DATE_ADD(d.tanggal_pemberitahuan_putusan, INTERVAL 15 DAY),'%d %M %Y') AS expire_phs_ikrar\n FROM perkara AS a \n LEFT JOIN perkara_putusan AS b ON a.`perkara_id`=b.`perkara_id`\n LEFT JOIN perkara_jadwal_sidang AS c ON a.`perkara_id`=c.`perkara_id`\n LEFT JOIN perkara_putusan_pemberitahuan_putusan AS d ON a.`perkara_id`=d.`perkara_id`\n LEFT JOIN perkara_ikrar_talak AS e ON a.`perkara_id`= e.`perkara_id`\n LEFT JOIN perkara_akta_cerai AS f ON a.`perkara_id`=f.`perkara_id`\n LEFT JOIN perkara_banding AS g ON a.`perkara_id`=g.`perkara_id`\n WHERE b.`tanggal_putusan` =c.`tanggal_sidang`\n AND DATE_FORMAT(a.tanggal_pendaftaran, '%Y') >2017\n AND g.`tanggal_pendaftaran_banding`IS NULL\n AND f.`tgl_akta_cerai` IS NULL\n AND e.`tgl_ikrar_talak` IS NULL\n AND c.`dihadiri_oleh`='2'\n AND b.status_putusan_id=62\n AND b.`putusan_verstek`='T'\n AND a.`jenis_perkara_id`=346\n GROUP BY nomor_perkara DESC \");\n return $query; \n }", "function total_diasTrabajados($id) {\n// $resultado = $this->db->query($ssql);\n// echo $resultado->row()->fh_registro.\"---\".$resultado->row()->ahora;\n $ssql = \"SELECT TIMESTAMPDIFF(YEAR,(SELECT fh_registro FROM usuarios WHERE cod_user=$id),NOW()) AS diasTrab\";\n $ssql = \"SELECT TIMESTAMPDIFF(YEAR,(SELECT fecha_inicio FROM usuarios WHERE cod_user=$id),NOW()) AS diasTrab\";\n // echo $ssql;\n $resultado = $this->db->query($ssql);\n return $resultado;\n }", "function getDetailRekapPotKehadiran($conn, $r_unit, $r_periode, $sqljenis, $i_pegawai) {\n $last = self::getLastDataPeriodeGaji($conn);\n\n //data gaji\n $sql = \"select pr.idpegawai,sum(potkehadiran) as potkehadiran,sum(pottransport) as pottransport, sum(potkehadiran) + sum(pottransport) as totalpotkehadiran, \n\t\t\t\t\t\" . static::schema . \".f_namalengkap(p.gelardepan,p.namadepan,p.namatengah,p.namabelakang,p.gelarbelakang) as namalengkap, \n\t\t\t\t\tcase when p.idjstruktural is not null then s.jabatanstruktural else 'Staff' end as jabatanstruktural,j.jenispegawai\n\t\t\t\t\tfrom \" . static::table('pe_presensidet') . \" pr \n\t\t\t\t\tleft join \" . static::table('ms_pegawai') . \" p on p.idpegawai=pr.idpegawai\n\t\t\t\t\tleft join \" . static::table('ms_unit') . \" u on u.idunit=p.idunit\n\t\t\t\t\tleft join \" . static::table('ms_struktural ') . \" s on s.idjstruktural=p.idjstruktural\n\t\t\t\t\tleft join \" . static::table('ms_jenispeg ') . \" j on j.idjenispegawai=p.idjenispegawai\n\t\t\t\t\twhere pr.tglpresensi between '\" . $last['tglawalhit'] . \"' and '\" . $last['tglakhirhit'] . \"' {$sqljenis} and u.parentunit = $r_unit\";\n if (!empty($i_pegawai))\n $sql .= \" and p.idpegawai not in ($i_pegawai)\";\n\n $sql .=\" group by pr.idpegawai, \" . static::schema . \".f_namalengkap(p.gelardepan,p.namadepan,p.namatengah,p.namabelakang,p.gelarbelakang), p.idjstruktural, jabatanstruktural,p.idjenispegawai,j.jenispegawai\n\t\t\t\t\torder by p.idjenispegawai\";\n\n $rs = $conn->Execute($sql);\n\n $a_data = array();\n while ($row = $rs->FetchRow())\n $a_data[] = $row;\n\n return $a_data;\n }", "public function lulus_UNDARAN(){\n\t\t$query=\"SELECT COUNT(id_pendadaran) AS jml_lulus FROM ujian_pendadaran WHERE status='lulus' GROUP BY status\"; //query untuk menghitung jumlah mahasiswa yang lulus undaran\n\t\t$this->eksekusi($query); //mengeksekusi query diatas\n\t\treturn $this->result; //mengembalikan hasil query diatas\n\t}", "function get_qty_awal($tanggal_awal, $produk_id){\r\n\t\t$sql_saldo_awal=\r\n\t\t \"SELECT\r\n\t\t\t\t(produk_saldo_awal + produk_saldo_awal2 + produk_saldo_awal3 + produk_saldo_awal4) / konversi_nilai as jumlah,\r\n\t\t\t\tproduk_tgl_nilai_saldo_awal\r\n\t\t\tFROM produk, satuan_konversi\r\n\t\t\tWHERE \r\n\t\t\t\tkonversi_produk = produk_id\r\n\t\t\t\tAND\tkonversi_default = true\r\n\t\t\t\tAND\tproduk_id = '\".$produk_id.\"'\r\n\t\t\t\tAND produk_tgl_nilai_saldo_awal <= \".$tanggal_awal;\r\n\t\t\t\t\r\n\t\t$rs_saldo_awal\t= $this->db->query($sql_saldo_awal) or die(\"Error - 1.1 : \".$sql_saldo_awal);\r\n\t\t\r\n\t\t//dari hasil query di atas, akan diketahui apakah tanggal_awal >= produk_tgl_nilai_saldo_awal? jika tidak maka return 0\r\n\t\tif($rs_saldo_awal->num_rows()>0){\r\n\t\t\t\t\t\r\n\t\t\t$row_saldo_awal\t= $rs_saldo_awal->row();\r\n\t\t\r\n\t\t\t//Saldo transaksi, dihitung sejak produk_tgl_nilai_saldo_awal di master produk\r\n\t\t\t$sql = \"SELECT\r\n\t\t\t\t\t\tSUM(stok_masuk - stok_keluar) as stok_saldo\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\tks.ks_masuk as stok_masuk,\r\n\t\t\t\t\t\t\tks.ks_keluar as stok_keluar\r\n\t\t\t\t\t\tFROM kartu_stok_fix ks\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = ks.ks_satuan_id) AND (sk.konversi_produk = ks.ks_produk_id)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\tks.ks_produk_id = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND ks.ks_tgl_faktur >= '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' \r\n\t\t\t\t\t\t\tAND ks.ks_tgl_faktur < \".$tanggal_awal.\"\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tUNION ALL\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\t0 as stok_masuk,\r\n\t\t\t\t\t\t\td.cabin_jumlah as stok_keluar\r\n\t\t\t\t\t\tFROM detail_pakai_cabin d\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = d.cabin_satuan) AND (sk.konversi_produk = d.cabin_produk)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\td.cabin_produk = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND date_format(cabin_date_create,'%Y-%m-%d') >= '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' \r\n\t\t\t\t\t\t\tAND date_format(cabin_date_create,'%Y-%m-%d') <\".$tanggal_awal.\"\r\n\t\t\t\t\t) \r\n\t\t\t\t\tAS ks_gabungan\";\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t$query = $this->db->query($sql);\r\n\t\t\r\n\t\t\tif($query->num_rows()>0){\r\n\t\t\t\t$row = $query->row();\r\n\t\t\t\t$total = $row_saldo_awal->jumlah + $row->stok_saldo;\r\n\t\t\t\t//print_r(' sql: '.$sql.', saldo awal: '.$row_saldo_awal->jumlah.', stok saldo: '.$row->stok_saldo);\r\n\t\t\t\treturn $total;\r\n\t\t\t}\r\n\t\t\telseif($query->num_rows()==0){\r\n\t\t\t\treturn $row_saldo_awal->jumlah;\r\n\t\t\t\t//print_r($tanggal_awal.$row_saldo_awal->jumlah);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "function data_usulan_tb()\n {\n $query = $this->db->query(\"SELECT\n id_pegawai as id_pegawai,\n nama as nama,\n nip as nip,\n tgl_akhir as tgl_akhir,\n path_foto as path_foto,\n selisih as selisih\n FROM data_tgsbelajar_notif\n WHERE selisih <= 60 \");\n\n return $query->result();\n }", "public function data_mata_kuliah()\n\t{\n\t\t$query1 = \"SELECT t_mk.kode_mk,t_mk.nama_mk,t_mk.jumlah_sks\t,t_mk.sks_teori,t_mk.sks_praktek,t_mk.semester,t_mk.pengisian_nilai,t_mk.status,t_mk.flag,t_mk.id_mk_prasarat,t_mk.id_mk_prak,t_mk.is_pratikum,t_mk.id_mk,t_prodi.id_prodi,t_prodi.prodi FROM t_mk INNER JOIN t_prodi ON t_mk.id_prodi=t_prodi.id_prodi WHERE semester = '1' AND prodi = 'Analisis Kimia'\";\n\t\t$query2 = \"SELECT t_mk.kode_mk,t_mk.nama_mk,t_mk.jumlah_sks\t,t_mk.sks_teori,t_mk.sks_praktek,t_mk.semester,t_mk.pengisian_nilai,t_mk.status,t_mk.flag,t_mk.id_mk_prasarat,t_mk.id_mk_prak,t_mk.is_pratikum,t_mk.id_mk,t_prodi.id_prodi,t_prodi.prodi FROM t_mk INNER JOIN t_prodi ON t_mk.id_prodi=t_prodi.id_prodi WHERE semester = '1' AND prodi = 'Penjaminan Mutu Industri Pangan'\";\n\t\t$query3 = \"SELECT t_mk.kode_mk,t_mk.nama_mk,t_mk.jumlah_sks\t,t_mk.sks_teori,t_mk.sks_praktek,t_mk.semester,t_mk.pengisian_nilai,t_mk.status,t_mk.flag,t_mk.id_mk_prasarat,t_mk.id_mk_prak,t_mk.is_pratikum,t_mk.id_mk,t_prodi.id_prodi,t_prodi.prodi FROM t_mk INNER JOIN t_prodi ON t_mk.id_prodi=t_prodi.id_prodi WHERE semester = '1' AND prodi = 'Pengolahan Limbah Industri'\";\n\t\t$query4 = \"SELECT t_mk.kode_mk,t_mk.nama_mk,t_mk.jumlah_sks\t,t_mk.sks_teori,t_mk.sks_praktek,t_mk.semester,t_mk.pengisian_nilai,t_mk.status,t_mk.flag,t_mk.id_mk_prasarat,t_mk.id_mk_prak,t_mk.is_pratikum,t_mk.id_mk,t_prodi.id_prodi,t_prodi.prodi FROM t_mk INNER JOIN t_prodi ON t_mk.id_prodi=t_prodi.id_prodi WHERE semester = '2' AND prodi = 'Analisis Kimia'\";\n\t\t$query5 = \"SELECT t_mk.kode_mk,t_mk.nama_mk,t_mk.jumlah_sks\t,t_mk.sks_teori,t_mk.sks_praktek,t_mk.semester,t_mk.pengisian_nilai,t_mk.status,t_mk.flag,t_mk.id_mk_prasarat,t_mk.id_mk_prak,t_mk.is_pratikum,t_mk.id_mk,t_prodi.id_prodi,t_prodi.prodi FROM t_mk INNER JOIN t_prodi ON t_mk.id_prodi=t_prodi.id_prodi WHERE semester = '2' AND prodi = 'Penjaminan Mutu Industri Pangan'\";\n\t\t$query6 = \"SELECT t_mk.kode_mk,t_mk.nama_mk,t_mk.jumlah_sks\t,t_mk.sks_teori,t_mk.sks_praktek,t_mk.semester,t_mk.pengisian_nilai,t_mk.status,t_mk.flag,t_mk.id_mk_prasarat,t_mk.id_mk_prak,t_mk.is_pratikum,t_mk.id_mk,t_prodi.id_prodi,t_prodi.prodi FROM t_mk INNER JOIN t_prodi ON t_mk.id_prodi=t_prodi.id_prodi WHERE semester = '2' AND prodi = 'Pengolahan Limbah Industri'\";\n\t\t$data['semester1A'] = $this->m_aka->query_aka($query1);\n\t\t$data['semester2A'] = $this->m_aka->query_aka($query4);\n\t\t$data['semester1B'] = $this->m_aka->query_aka($query2);\n\t\t$data['semester2B'] = $this->m_aka->query_aka($query5);\n\t\t$data['semester1C'] = $this->m_aka->query_aka($query3);\n\t\t$data['semester2C'] = $this->m_aka->query_aka($query6);\n\t\t$data['data'] = $this->m_aka->data_mata_kuliah(); \n\t\t$data['pagination'] = $this->pagination->create_links();\n\t\t$data['content'] = 'mata_kuliah/data_mata_kuliah';\n\t\t$this->load->view('content', $data);\n\t}", "function work_data_emp($id)\n{\n// selecteaza datele platite deja din salarii\n $query = \"SELECT sum(salarii.prezent) AS lucratez, \n (DATE_FORMAT(LAST_DAY(data),'%d') - sum(salarii.prezent)) AS absent, \n sum(motiv) AS motivat, \n sum(suma) AS salarii, \n DATE_FORMAT(data, '%m') AS data\n FROM cozagro_db.salarii \n WHERE salarii.deleted = 0 AND salarii.id_angajat= $id\n GROUP BY MONTH(data)\";\n $result = Database::getInstance()->getConnection()->query($query);\n if (!$result) {\n die(\"Nu s-a reusit conexiunea la DB selectarea salariilor platite\" . Database::getInstance()->getConnection()->error);\n }\n $zile_lucrate = [];\n while ($x = $result->fetch_assoc()) {\n $zile_lucrate[$x['data']] = array(\"luc\" => $x['lucratez'], \"abs\" => $x['absent'], \"mot\" => $x['motivat'], \"sal\" => $x['salarii']);\n }\n $result->free_result();\n return $zile_lucrate;\n}", "function absen_tgl($id,$tgl,$bln,$thn)\n{\n\t$data = strtotime(date(\"Y-m-d\"));\n\t$date = date(\"$thn-$bln-$tgl\");\n\tif($data == strtotime($date))\n\t\t$minus = \"\";\n\telse \n\t\t$minus = \"and (jam_keluar is not null and jam_masuk is not null) \";\n\t$t=mysql_query(\"SELECT count(id_absen) as total, keterangan_hadir as hadir FROM absen WHERE id_karyawan='$id' and tanggal_absen='$thn-$bln-$tgl' $minus \") or die(alert_error(mysql_error()));\n\t\n\t$q=mysql_fetch_array($t);\n\tif(mysql_num_rows($t)>0)\n\t{\n\t\tif(@$q['hadir']=='')\n\t\t\t$status=$q['total'];\n\t\telse if(@$q['hadir']=='sakit')\n\t\t\t$status=\"S\";\n\t\telse if(@$q['hadir']=='alfa')\n\t\t\t$status=-1;\n\t\telse if(@$q['hadir']=='izin')\n\t\t\t$status=\"I\";\n\t\telse if(@$q['hadir']=='skd')\n\t\t\t$status=\"skd\";\n\t\telse if(@$q['hadir']=='spd')\n\t\t\t$status=\"spd\";\n\t\telse if(@$q['hadir']=='pulang' || @$q['hadir']=='pulang_libur' || @$q['hadir']=='masuk_setengah_hari')\n\t\t\t$status=\"0.5\";\n\t\telse if(@$q['hadir']=='libur')\n\t\t\t$status=\"lbr\";\n\t\telse if(@$q['hadir']=='out')\n\t\t\t$status=\"out\";\n\t\telse if(@$q['hadir']=='off')\n\t\t\t$status=\"off\";\n\t\telse\n\t\t\t$status=0;\n\n\t}\n\telse\n\t\t$status=0;\n\t\n\treturn $status;\n\t\n\t\n}", "function get_qty_akhir($tanggal_akhir, $produk_id){\r\n\t\t$sql_saldo_awal=\r\n\t\t \"SELECT\r\n\t\t\t\t(produk_saldo_awal + produk_saldo_awal2 + produk_saldo_awal3 + produk_saldo_awal4) / konversi_nilai as jumlah,\r\n\t\t\t\tproduk_tgl_nilai_saldo_awal\r\n\t\t\tFROM produk, satuan_konversi\r\n\t\t\tWHERE \r\n\t\t\t\tkonversi_produk = produk_id\r\n\t\t\t\tAND\tkonversi_default = true\r\n\t\t\t\tAND\tproduk_id = '\".$produk_id.\"'\r\n\t\t\t\tAND produk_tgl_nilai_saldo_awal < \".$tanggal_akhir;\r\n\t\t\t\t\r\n\t\t$rs_saldo_awal\t= $this->db->query($sql_saldo_awal) or die(\"Error - 1.1 : \".$sql_saldo_awal);\r\n\t\t\r\n\t\t//dari hasil query di atas, akan diketahui apakah tanggal_akhir >= produk_tgl_nilai_saldo_awal? jika tidak maka return 0\r\n\t\tif($rs_saldo_awal->num_rows()>0){\r\n\t\t\t\t\t\r\n\t\t\t$row_saldo_awal\t= $rs_saldo_awal->row();\r\n\t\t\r\n\t\t\t//Saldo transaksi, dihitung sejak produk_tgl_nilai_saldo_awal di master produk\r\n\t\t\t$sql = \"SELECT\r\n\t\t\t\t\t\tSUM(stok_masuk - stok_keluar) as stok_saldo\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\tks.ks_masuk as stok_masuk,\r\n\t\t\t\t\t\t\tks.ks_keluar as stok_keluar\r\n\t\t\t\t\t\tFROM kartu_stok_fix ks\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = ks.ks_satuan_id) AND (sk.konversi_produk = ks.ks_produk_id)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\tks.ks_produk_id = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND ks.ks_tgl_faktur BETWEEN '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' AND \".$tanggal_akhir.\"\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tUNION ALL\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\t0 as stok_masuk,\r\n\t\t\t\t\t\t\td.cabin_jumlah as stok_keluar\r\n\t\t\t\t\t\tFROM detail_pakai_cabin d\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = d.cabin_satuan) AND (sk.konversi_produk = d.cabin_produk)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\td.cabin_produk = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND date_format(cabin_date_create,'%Y-%m-%d') BETWEEN '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' AND \".$tanggal_akhir.\"\r\n\t\t\t\t\t) \r\n\t\t\t\t\tAS ks_gabungan\";\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t$query = $this->db->query($sql);\r\n\t\t\r\n\t\t\r\n\t\t\tif($query->num_rows()>0){\r\n\t\t\t\t$row = $query->row();\r\n\t\t\t\t$total = $row_saldo_awal->jumlah + $row->stok_saldo;\r\n\t\t\t\t//print_r(' sql: '.$sql.', saldo awal: '.$row_saldo_awal->jumlah.', stok saldo: '.$row->stok_saldo);\r\n\t\t\t\treturn $total;\r\n\t\t\t}\r\n\t\t\telseif($query->num_rows()==0){\r\n\t\t\t\treturn $row_saldo_awal->jumlah;\r\n\t\t\t\t//print_r($tanggal_akhir.$row_saldo_awal->jumlah);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public function hasil_kemiskinan(){\n $this->db->query(\"UPDATE mamdani m JOIN tb_variabel_desa tv JOIN mamdani_kecamatan mk\n SET m.hasil_kemiskinan=(CASE \n WHEN m.kemiskinan <= tv.persen_var_a * mk.kemiskinan THEN 'SEDIKIT'\n WHEN tv.persen_var_a * mk.kemiskinan <= m.kemiskinan AND m.kemiskinan <= tv.persen_var_b * mk.kemiskinan THEN 'SEDIKIT'\n WHEN tv.persen_var_b * mk.kemiskinan <= m.kemiskinan AND m.kemiskinan <= tv.persen_var_c * mk.kemiskinan THEN 'SEDANG'\n WHEN tv.persen_var_c * mk.kemiskinan <= m.kemiskinan AND m.kemiskinan <= tv.persen_var_d * mk.kemiskinan THEN 'BANYAK'\n WHEN tv.persen_var_d * mk.kemiskinan <= m.kemiskinan THEN 'BANYAK' END) WHERE tv.variabel_id = 1 AND m.nama_kecamatan=mk.nama_kecamatan\");\n }", "function subsub_hapus($kode, $gol, $ps, $pt, $tgl_pem)\n{\n $param_satker = $ps;\n $splitKodeSatker = explode ('.', $param_satker);\n if(count ($splitKodeSatker) == 4) {\n $paramSatker = \"m.kodeSatker = '$param_satker'\";\n } else {\n $paramSatker = \"m.kodeSatker like '$param_satker%'\";\n }\n $param_tgl = $pt;\n if($gol == 'mesin_ori') {\n $gol = \"mesin\";\n //cek kapitalisasi\n $kapitalisasi_kondisi = \" and m.Aset_ID not in(select Aset_ID from log_$gol where `action` LIKE 'Sukses kapitalisasi Mutasi%') \";\n\n $param_where = \"m.Status_Validasi_barang!=1 and m.StatusTampil != 1 and m.kondisi != '3' and \n ( (m.TglPerolehan < '2008-01-01' and m.TglPembukuan <= '$param_tgl' and m.TglPembukuan > '$tgl_pem' and m.kodeLokasi like '12%' and m.kodeKa=1) or \n (m.TglPerolehan >= '2008-01-01' and m.TglPembukuan <= '$param_tgl' and m.TglPembukuan > '$tgl_pem' and m.kodeLokasi like '12%' and (m.NilaiPerolehan >=300000 or m.kodeKa=1)))\n and $paramSatker\";\n\n\n $sql = \"select m.kodeKelompok as kelompok,m.Aset_ID,m.TahunPenyusutan,\n l.NilaiPerolehan as nilai,m.Status_Validasi_barang as jml,\n m.PenyusutanPerTahun as PP,m.Tahun as Tahun, m.noRegister as noRegister,\n m.AkumulasiPenyusutan as AP, m.NilaiBuku as NB,\n (select Uraian from kelompok \n where kode= m.kodeKelompok \n ) as Uraian,\n m.Status_Validasi_barang,m.kodeSatker from $gol m \n inner join log_$gol as l on l.Aset_ID=m.Aset_ID and l.TglPerubahan > '$tgl_pem' and l.kd_riwayat=3 and `action` like 'Sukses Mutasi%' \n where m.kodeKelompok like '$kode_sub%' and\n $param_where $kapitalisasi_kondisi \n order by kelompok asc\";\n } elseif($gol == 'bangunan_ori') {\n $gol = \"bangunan\";\n //cek kapitalisasi\n $kapitalisasi_kondisi = \" and m.Aset_ID not in(select Aset_ID from log_$gol where `action` LIKE 'Sukses kapitalisasi Mutasi%') \";\n\n $param_where = \"m.Status_Validasi_barang!=1 and m.StatusTampil != 1 and m.kondisi != '3' and \n ( (m.TglPerolehan < '2008-01-01' and m.TglPembukuan <= '$param_tgl' and m.TglPembukuan > '$tgl_pem' and m.kodeLokasi like '12%' and m.kodeKa=1) or \n (m.TglPerolehan >= '2008-01-01' and m.TglPembukuan <= '$param_tgl' and m.TglPembukuan > '$tgl_pem' and m.kodeLokasi like '12%' and (m.NilaiPerolehan >=10000000 or m.kodeKa=1)))\n and $paramSatker\";\n\n $sql = \"select m.kodeKelompok as kelompok,m.Aset_ID,m.TahunPenyusutan,\n l.NilaiPerolehan as nilai,m.Status_Validasi_barang as jml,\n m.PenyusutanPerTahun as PP,m.Tahun as Tahun, m.noRegister as noRegister,\n m.AkumulasiPenyusutan as AP, m.NilaiBuku as NB,\n (select Uraian from kelompok \n where kode= m.kodeKelompok \n ) as Uraian,\n m.Status_Validasi_barang,m.kodeSatker from $gol m \n inner join log_$gol as l on l.Aset_ID=m.Aset_ID and l.TglPerubahan > '$tgl_pem' and l.kd_riwayat=3 and `action` like 'Sukses Mutasi%' \n where m.kodeKelompok like '$kode_sub%' and\n $param_where $kapitalisasi_kondisi \n order by kelompok asc\";\n } else {\n if($gol != \"tanahView\")\n $param_where = \"m.Status_Validasi_barang!=1 and m.StatusTampil != 1 \n and m.TglPerolehan <= '$param_tgl' and m.TglPembukuan > '$tgl_pem' and l.kd_riwayat=3 and `action` like 'Sukses Mutasi%' \n and m.TglPembukuan <='$param_tgl' \n and m.kodeLokasi like '12%' \n and m.kondisi != '3' \n and $paramSatker\";\n else\n $param_where = \"m.Status_Validasi_barang!=1 and m.StatusTampil != 1 \n and m.TglPerolehan <= '$param_tgl' and m.TglPembukuan > '$tgl_pem' and l.kd_riwayat=3 and `action` like 'Sukses Mutasi%' \n and m.TglPembukuan <='$param_tgl' \n and m.kodeLokasi like '12%' \n and $paramSatker\";\n\n if($gol == 'jaringan_ori') {\n\n $gol = \"jaringan\";\n //cek kapitalisasi\n $kapitalisasi_kondisi = \" and m.Aset_ID not in(select Aset_ID from log_$gol where `action` LIKE 'Sukses kapitalisasi Mutasi%') \";\n\n $sql = \"select m.kodeKelompok as kelompok,m.Aset_ID,m.TahunPenyusutan,\n l.NilaiPerolehan as nilai,m.Status_Validasi_barang as jml,\n m.PenyusutanPerTahun as PP,m.Tahun as Tahun, m.noRegister as noRegister,\n m.AkumulasiPenyusutan as AP, m.NilaiBuku as NB,\n (select Uraian from kelompok \n where kode= m.kodeKelompok \n ) as Uraian,\n m.Status_Validasi_barang,m.kodeSatker from $gol m \n inner join log_$gol as l on l.Aset_ID=m.Aset_ID and l.TglPerubahan > '$tgl_pem' and l.kd_riwayat=3 and `action` like 'Sukses Mutasi%' \n where m.kodeKelompok like '$kode_sub%' and\n $param_where $kapitalisasi_kondisi\n order by kelompok asc\";\n } else {\n if($gol == \"kdp_ori\")\n $gol = \"kdp\";\n else if($gol == \"tanahView\")\n $gol = \"tanah\";\n else $gol = \"asetlain\";\n\n //cek kapitalisasi\n $kapitalisasi_kondisi = \" and m.Aset_ID not in(select Aset_ID from log_$gol where `action` LIKE 'Sukses kapitalisasi Mutasi%') \";\n\n $sql = \"select m.kodeKelompok as kelompok,m.Tahun as Tahun, m.noRegister as noRegister,\n m.Aset_ID,\n m.NilaiPerolehan as nilai,m.Status_Validasi_barang as jml,\n (select Uraian from kelompok \n where kode= m.kodeKelompok \n ) as Uraian,\n m.Status_Validasi_barang,m.kodeSatker from $gol m \n inner join log_$gol as l on l.Aset_ID=m.Aset_ID and l.TglPerubahan > '$tgl_pem' and l.kd_riwayat=3 and `action` like 'Sukses Mutasi%' \n where m.kodeKelompok like '$kode_sub%' and\n $param_where $kapitalisasi_kondisi\n order by kelompok asc\";\n }\n }\n\n//echo \"$gol == $sql<br/>\";\n $resultparentSubSub = mysql_query ($sql) or die(mysql_error());\n $data = array();\n while ($data_subsub = mysql_fetch_array ($resultparentSubSub, MYSQL_ASSOC)) {\n $data[] = $data_subsub;\n }\n return $data;\n}", "public function hasil_kemiskinan_kecamatan(){\n $this->db->query(\"UPDATE mamdani_kecamatan m JOIN tb_variabel_kecamatan tv JOIN tb_kecamatan tk\n SET m.hasil_kemiskinan=(CASE \n WHEN m.kemiskinan <= tv.persen_var_a * tk.total_penduduk THEN 'SEDIKIT'\n WHEN tv.persen_var_a * tk.total_penduduk <= m.kemiskinan AND m.kemiskinan <= tv.persen_var_b * tk.total_penduduk THEN 'SEDIKIT'\n WHEN tv.persen_var_b * tk.total_penduduk <= m.kemiskinan AND m.kemiskinan <= tv.persen_var_c * tk.total_penduduk THEN 'SEDANG'\n WHEN tv.persen_var_c * tk.total_penduduk <= m.kemiskinan AND m.kemiskinan <= tv.persen_var_d * tk.total_penduduk THEN 'BANYAK'\n WHEN tv.persen_var_d * tk.total_penduduk <= m.kemiskinan THEN 'BANYAK' END) WHERE tv.variabel_id = 1 AND m.nama_kecamatan=tk.nama_kecamatan\");\n }", "public function getTarifSatuan(){\n\t\t\t$tarif_satuan = 0;\n\t\t\t//recheck tarif menggunakan DAO agar lebih cepat \n\t\t\t$sql = \"SELECT tariftindakan_m.*, daftartindakan_m.daftartindakan_nama\n\t\t\t\t\tFROM tariftindakan_m\n\t\t\t\t\tJOIN daftartindakan_m ON daftartindakan_m.daftartindakan_id = tariftindakan_m.daftartindakan_id\n\t\t\t\t\tJOIN jenistarifpenjamin_m ON jenistarifpenjamin_m.jenistarif_id = tariftindakan_m.jenistarif_id\n\t\t\t\t\tWHERE tariftindakan_m.komponentarif_id = \".Params::KOMPONENTARIF_ID_TOTAL.\" \n\t\t\t\t\t\tAND tariftindakan_m.daftartindakan_id = \".$this->daftartindakan_id.\"\n\t\t\t\t\t\tAND tariftindakan_m.kelaspelayanan_id = \".$this->kelaspelayanan_id.\"\n\t\t\t\t\t\tAND jenistarifpenjamin_m.penjamin_id = \".$this->penjamin_id.\"\n\t\t\t\t\t\";\n\t\t\t$loadData = Yii::app()->db->createCommand($sql)->queryRow();\n\t\t\tif(isset($loadData['harga_tariftindakan'])){\n\t\t\t\t$tarif_satuan = $loadData['harga_tariftindakan']; \n\t\t\t}\n\t\t\treturn $tarif_satuan;\n\t\t}", "function get_jumlah_status($id_lap)\n {\n\t\t$this->db->select('*');\n\t\t$this->db->from('pelaporan');\n\t\t$this->db->where('id_lap',$id_lap);\t\t\n\t\t$jml_pelapor = $this->db->count_all_results(); //JUMLAH PELAPOR\n\t\t\n\t\t$this->db->select('*');\n\t\t$this->db->from('pelaporan p');\n\t\t$this->db->where('p.id_lap',$id_lap);\n\t\t$this->db->where('p.id_status',1); //belum lapor\n\t\t$this->db->join('skpd s', 's.id_skpd=p.id_skpd', 'left');\t\t\n\t\t$this->db->join('status t', 't.id_status=p.id_status', 'left');\n\t\t$this->db->join('jabatan j', 'j.id_jab=p.id_jab', 'left');\n\t\t$this->db->order_by('p.id_pelaporan','desc'); \n\t\t$query = $this->db->get();\n\t\t$jml_belum_lapor = $query->num_rows(); //JUMLAH status belum lapor\n\t\t$data_belum_lapor = $query->result(); //DATA STATUS BELUM LAPOR\n\t\t\n\t\t$this->db->select('*');\n\t\t$this->db->from('pelaporan p');\t\t\n\t\t$this->db->where('p.id_status',2); //sudah lapor\n\t\t$this->db->where('p.id_lap',$id_lap);\n\t\t$this->db->or_where('p.id_status',3); // diminta perbaiki\n\t\t$this->db->where('p.id_lap',$id_lap);\n\t\t$this->db->or_where('p.id_status',5); //direvisi\n\t\t$this->db->where('p.id_lap',$id_lap);\n\t\t$this->db->or_where('p.id_status',7); //direvisi\n\t\t$this->db->where('p.id_lap',$id_lap);\n\t\t$this->db->join('skpd s', 's.id_skpd=p.id_skpd', 'left');\t\t\n\t\t$this->db->join('status t', 't.id_status=p.id_status', 'left');\n\t\t$this->db->join('jabatan j', 'j.id_jab=p.id_jab', 'left');\n\t\t$this->db->order_by('p.tgl_upload','asc'); \n\t\t$query = $this->db->get();\n\t\t$jml_sudah_lapor = $query->num_rows(); //JUMLAH status sudah, revisi dan perbaiki\n\t\t$data_sudah_lapor = $query->result(); //DATA STATUS sudah, revisi dan perbaiki\n\t\t\t\t\n\t\t$this->db->select('*');\n\t\t$this->db->from('pelaporan p');\n\t\t$this->db->where('p.id_lap',$id_lap);\n\t\t$this->db->where('p.id_status',4); //oke\n\t\t$this->db->join('skpd s', 's.id_skpd=p.id_skpd', 'left');\t\t\n\t\t$this->db->join('status t', 't.id_status=p.id_status', 'left');\n\t\t$this->db->join('jabatan j', 'j.id_jab=p.id_jab', 'left');\n\t\t$this->db->order_by('p.id_skpd','asc'); \n\t\t$query = $this->db->get();\n\t\t$jml_oke = $query->num_rows(); //JUMLAH status oke\n\t\t$data_oke = $query->result(); //DATA STATUS oke\n\t\t\n\t\treturn array(\n\t\t\t'jml_belum_lapor' => $jml_belum_lapor,\n\t\t\t'jml_sudah_lapor' => $jml_sudah_lapor,\n\t\t\t'jml_oke' => $jml_oke,\n\t\t\t'data_belum_lapor' => $data_belum_lapor,\n\t\t\t'data_sudah_lapor' => $data_sudah_lapor,\n\t\t\t'data_oke' => $data_oke,\n\t\t\t'jml_pelapor' => $jml_pelapor,\n\t\t);\n }", "public function content_pengiriman_otw($id_cabang)\n {\n $query = \"\n select id_pk_penerimaan,id_pk_brg_pemenuhan,id_pk_brg_pengiriman,brg_pengiriman_qty,brg_pengiriman_note,brg_pemenuhan_status,pengiriman_tgl,cabang_daerah,toko_nama,toko_kode,brg_nama,brg_kode,ifnull(penerimaan_tgl,'-') as penerimaan_tgl\n from tbl_brg_pengiriman\n inner join mstr_pengiriman on mstr_pengiriman.id_pk_pengiriman = tbl_brg_pengiriman.id_fk_pengiriman and mstr_pengiriman.pengiriman_status = 'aktif' #harus yang jadi terkirim bukan yang dicancel\n inner join mstr_cabang on mstr_cabang.id_pk_cabang = mstr_pengiriman.id_fk_cabang #dapetin daerah cabang\n inner join mstr_toko on mstr_toko.id_pk_toko = mstr_cabang.id_fk_toko #dapetin nama toko\n inner join tbl_brg_pemenuhan on tbl_brg_pemenuhan.id_pk_brg_pemenuhan = tbl_brg_pengiriman.id_fk_brg_pemenuhan #cuman untuk dapetin id_cabang_minta & id_barang\n inner join tbl_brg_permintaan on tbl_brg_permintaan.id_pk_brg_permintaan = tbl_brg_pemenuhan.id_fk_brg_permintaan and tbl_brg_permintaan.id_fk_cabang = ? #menentukan peminta barang yang akan jadi penerima\n inner join mstr_barang on mstr_barang.id_pk_brg = tbl_brg_permintaan.id_fk_brg #dapetin detail barang\n left join tbl_brg_penerimaan on tbl_brg_penerimaan.id_fk_brg_pengiriman = tbl_brg_pengiriman.id_pk_brg_pengiriman and tbl_brg_penerimaan.brg_penerimaan_qty > 0 #dianggap diterima apabila brgditerima > 0 (klo delete, ini ke 0 sendiri)\n left join mstr_penerimaan on mstr_penerimaan.id_pk_penerimaan = tbl_brg_penerimaan.id_fk_penerimaan and mstr_penerimaan.penerimaan_status = 'aktif' and mstr_penerimaan.penerimaan_tipe = 'permintaan' #dianggap diterima apabila status penerimaan > 0\n where tbl_brg_pengiriman.brg_pengiriman_qty > 0 #dianggap terkirim apabila tidak di cancel (klo cancel, qty jadi 0)\n and brg_pemenuhan_status = 'perjalanan'\n union\n select id_pk_penerimaan,id_pk_brg_pemenuhan,id_pk_brg_pengiriman,brg_pengiriman_qty,brg_pengiriman_note,brg_pemenuhan_status,pengiriman_tgl,warehouse_alamat as cabang_daerah,warehouse_nama as toko_nama,'-' as toko_kode,brg_nama,brg_kode,ifnull(penerimaan_tgl,'-') as penerimaan_tgl\n from tbl_brg_pengiriman\n inner join mstr_pengiriman on mstr_pengiriman.id_pk_pengiriman = tbl_brg_pengiriman.id_fk_pengiriman and mstr_pengiriman.pengiriman_status = 'aktif' #harus yang jadi terkirim bukan yang dicancel\n inner join mstr_warehouse on mstr_warehouse.id_pk_warehouse = mstr_pengiriman.id_fk_warehouse\n inner join mstr_cabang on mstr_cabang.id_pk_cabang = mstr_warehouse.id_fk_cabang #dapetin daerah cabang\n inner join mstr_toko on mstr_toko.id_pk_toko = mstr_cabang.id_fk_toko #dapetin nama toko\n inner join tbl_brg_pemenuhan on tbl_brg_pemenuhan.id_pk_brg_pemenuhan = tbl_brg_pengiriman.id_fk_brg_pemenuhan #cuman untuk dapetin id_cabang_minta & id_barang\n inner join tbl_brg_permintaan on tbl_brg_permintaan.id_pk_brg_permintaan = tbl_brg_pemenuhan.id_fk_brg_permintaan and tbl_brg_permintaan.id_fk_cabang = ? #menentukan peminta barang yang akan jadi penerima\n inner join mstr_barang on mstr_barang.id_pk_brg = tbl_brg_permintaan.id_fk_brg #dapetin detail barang\n left join tbl_brg_penerimaan on tbl_brg_penerimaan.id_fk_brg_pengiriman = tbl_brg_pengiriman.id_pk_brg_pengiriman and tbl_brg_penerimaan.brg_penerimaan_qty > 0 #dianggap diterima apabila brgditerima > 0 (klo delete, ini ke 0 sendiri)\n left join mstr_penerimaan on mstr_penerimaan.id_pk_penerimaan = tbl_brg_penerimaan.id_fk_penerimaan and mstr_penerimaan.penerimaan_status = 'aktif' and mstr_penerimaan.penerimaan_tipe = 'permintaan' #dianggap diterima apabila status penerimaan > 0\n where tbl_brg_pengiriman.brg_pengiriman_qty > 0 #dianggap terkirim apabila tidak di cancel (klo cancel, qty jadi 0)\n and brg_pemenuhan_status = 'perjalanan'\n order by pengiriman_tgl DESC\";\n $args = array(\n $id_cabang, $id_cabang\n );\n //executeQuery($query,$args); echo $this->db->last_query();\n return executeQuery($query, $args);\n }", "public function getbidangminat(){\n\t\t$query=\"SELECT nama, bidang_minat, count(bidang_minat) as jumlah_bidang_minat1 from mahasiswa_metopen group by bidang_minat\";\n\t\t//query tersebut menjelaskan tentang menampilkan jumlah mahasiswa yang mengambil bidang minat sistemcerdas\n\t\t$this->eksekusi($query);// mengeksekusi query diatas\n\t\treturn $this->result; // mengembalikan hasil dari query diatas\n\t}", "function subsub_awal($kode, $gol, $ps, $pt)\n{\n $param_satker = $ps;\n $splitKodeSatker = explode ('.', $param_satker);\n if(count ($splitKodeSatker) == 4) {\n $paramSatker = \"kodeSatker = '$param_satker'\";\n } else {\n $paramSatker = \"kodeSatker like '$param_satker%'\";\n }\n $param_tgl = $pt;\n if($gol == 'mesin_ori') {\n $param_where = \"Status_Validasi_barang=1 and StatusTampil = 1 and kondisi != '3' and \n ( (TglPerolehan < '2008-01-01' and TglPembukuan <= '$param_tgl' and kodeLokasi like '12%' and kodeKa=1) or \n (TglPerolehan >= '2008-01-01' and TglPembukuan <= '$param_tgl' and kodeLokasi like '12%' and (NilaiPerolehan >=300000 or kodeKa=1)))\n and $paramSatker\";\n\n $sql = \"select kodeKelompok as kelompok,Aset_ID,TglPembukuan,kodeSatker,\n NilaiPerolehan as nilai,Status_Validasi_barang as jml,\n PenyusutanPerTahun as PP,Tahun as Tahun, noRegister as noRegister,\n AkumulasiPenyusutan as AP, NilaiBuku as NB,\n (select Uraian from kelompok \n where kode= kodeKelompok \n ) as Uraian,\n Status_Validasi_barang,kodeSatker from $gol m\n where kodeKelompok like '$kode_sub%' and\n $param_where \n order by kelompok asc\";\n } elseif($gol == 'bangunan_ori') {\n $param_where = \"Status_Validasi_barang=1 and StatusTampil = 1 and kondisi != '3' and \n ( (TglPerolehan < '2008-01-01' and TglPembukuan <= '$param_tgl' and kodeLokasi like '12%' and kodeKa=1) or \n (TglPerolehan >= '2008-01-01' and TglPembukuan <= '$param_tgl' and kodeLokasi like '12%' and (NilaiPerolehan >=10000000 or kodeKa=1)))\n and $paramSatker\";\n\n $sql = \"select kodeKelompok as kelompok,Aset_ID,TglPembukuan,kodeSatker,\n NilaiPerolehan as nilai,Status_Validasi_barang as jml,\n PenyusutanPerTahun as PP,Tahun as Tahun, noRegister as noRegister,\n AkumulasiPenyusutan as AP, NilaiBuku as NB,\n (select Uraian from kelompok \n where kode= kodeKelompok \n ) as Uraian,\n Status_Validasi_barang,kodeSatker from $gol m\n where kodeKelompok like '$kode_sub%' and\n $param_where \n order by kelompok asc\";\n } else {\n if($gol != \"tanahView\")\n $param_where = \"Status_Validasi_barang=1 and StatusTampil = 1 \n and TglPerolehan <= '$param_tgl' \n and TglPembukuan <='$param_tgl' \n and kodeLokasi like '12%' \n and kondisi != '3' \n and $paramSatker\";\n else\n $param_where = \"Status_Validasi_barang=1 and StatusTampil = 1 \n and TglPerolehan <= '$param_tgl' \n and TglPembukuan <='$param_tgl' \n and kodeLokasi like '12%' \n and $paramSatker\";\n\n if($gol == 'jaringan_ori') {\n $sql = \"select kodeKelompok as kelompok,Aset_ID,TglPembukuan,kodeSatker,\n NilaiPerolehan as nilai,Status_Validasi_barang as jml,\n PenyusutanPerTahun as PP,Tahun as Tahun, noRegister as noRegister,\n AkumulasiPenyusutan as AP, NilaiBuku as NB,\n (select Uraian from kelompok \n where kode= kodeKelompok \n ) as Uraian,\n Status_Validasi_barang,kodeSatker from $gol m\n where kodeKelompok like '$kode_sub%' and\n $param_where \n order by kelompok asc\";\n } else {\n $sql = \"select kodeKelompok as kelompok,Tahun as Tahun, noRegister as noRegister,Aset_ID,TglPembukuan,kodeSatker,\n NilaiPerolehan as nilai,Status_Validasi_barang as jml,\n (select Uraian from kelompok \n where kode= kodeKelompok \n ) as Uraian,\n Status_Validasi_barang,kodeSatker from $gol m\n where kodeKelompok like '$kode_sub%' and\n $param_where \n order by kelompok asc\";\n }\n }\n //echo \"$gol == $sql\";\n $resultparentSubSub = mysql_query ($sql) or die(mysql_error());\n $data = array();\n while ($data_subsub = mysql_fetch_array ($resultparentSubSub, MYSQL_ASSOC)) {\n $data[] = $data_subsub;\n }\n return $data;\n}", "public function get_kesimpulan() {\n\n $event_id = $this->input->post('event_id');\n $ref_id = $this->input->post('id');\n\n if (substr($ref_id, 0, 1) == 'd') {\n\n $id = preg_replace('/[^0-9]/', '', $ref_id);\n\n $event_attend = $this->db->query(\"SELECT IF(events_attend.time_scan IS NOT NULL, TIMEDIFF(MAX(events_attend.time_scan), MIN(events_attend.time_scan)), NULL) AS 'time_diff',\n MAX(IF(events_attend.attend = 'IN', review_events, 0)) AS 'in',\n MAX(IF(events_attend.attend = 'OUT', review_events, 0)) AS 'out' \n FROM ac_payroll_item\n JOIN ansena_department ON ansena_department.id = ac_payroll_item.office\n JOIN events_attend ON events_attend.ac_payroll_item_id = ac_payroll_item.id AND event_id = \" . $event_id . \"\n WHERE is_active = 1 \n AND office = \" . $id . \"\n AND time_scan IS NOT NULL\n GROUP BY ac_payroll_item.id, office\")->result();\n \n } else {\n\n $id = preg_replace('/[^0-9]/', '', $ref_id);\n\n $event_attend = $this->db->query(\"SELECT IF(events_attend.time_scan IS NOT NULL, TIMEDIFF(MAX(events_attend.time_scan), MIN(events_attend.time_scan)), NULL) AS 'time_diff',\n MAX(IF(events_attend.attend = 'IN', review_events, 0)) AS 'in',\n MAX(IF(events_attend.attend = 'IN', review_events, 0)) AS 'out' \n FROM ac_payroll_item\n JOIN ansena_department ON ansena_department.id = ac_payroll_item.office\n JOIN ansena_team_detail ON ansena_team_detail.ac_payroll_item_id = ac_payroll_item.id\n JOIN events_attend ON events_attend.ac_payroll_item_id = ac_payroll_item.id AND event_id = \" . $event_id . \"\n WHERE is_active = 1 \n AND ansena_team_detail.ansena_team_id = \" . $id . \"\n AND time_scan IS NOT NULL\n GROUP BY ac_payroll_item.id, ansena_team_detail.ansena_team_id\")->result();\n\n }\n\n $in_avg = 0; \n $out_avg = 0;\n $dur = 0;\n $count = 0; \n $count_dur = 0; \n foreach ($event_attend as $row) {\n $count += 1;\n $in_avg += $row->in;\n $out_avg += $row->out;\n $dur += strtotime($row->time_diff);\n if ($row->time_diff != '00:00:00') {\n $count_dur += 1;\n }\n }\n\n if ($in_avg != 0) {\n $in_avg = round($in_avg/$count, 2);\n }\n\n if ($out_avg != 0) {\n $out_avg = round($out_avg/$count, 2);\n }\n\n if ($count_dur != 0) {\n $dur = round($dur/$count_dur, 2);\n }\n\n $dur_time = $dur;\n\n if ($dur != null) {\n $dur = date('H:i:s', $dur);\n } else {\n $dur = 0;\n }\n\n $response = array(\n 'in_avg' => $in_avg,\n 'out_avg' => $out_avg,\n 'dur' => $dur,\n 'dur_time' => $dur_time\n );\n\n echo json_encode($response);\n\n }", "public function getruang1_semprop(){\n\t\t$query=\"SELECT count(tempat)as jumlah1semprop from penjadwalan where tempat='1' and jenis_ujian='SEMPROP'\"; //Query menampilkan jumlah ruangan 1 pada Seminar proposal\n\t\t$this->eksekusi($query); //Eksekusi query diatas\n\t\treturn $this->result; //Mengembalikan hasil dari query diatas\n\t}", "function multi_query(){\n $this->db->trans_start();\n$this->db->select_sum('kemiskinan');\n$p=$this->db->get('mamdani_kecamatan')->row();\n$t= $p->kemiskinan;\n\n\n$q=$this->db->query(\"UPDATE mamdani_kecamatan m JOIN tb_variabel_kecamatan tk ON m.id\n JOIN tb_sub_var_kecamatan sv ON tk.variabel_id=sv.sub_variabel_id\n SET m.hasil_kemiskinan=(CASE \n WHEN (m.kemiskinan / '$t' * 100) <= (sv.a /100 * '$t') THEN 0\n\n )\");\n \n $this->db->trans_complete();\n\n\n }", "function bayarTunjangan($conn, $r_periode, $r_sql = '') {\n //periode tarif sekarang\n $r_periodetarif = self::getLastPeriodeTarif($conn);\n\n //nip yang diselect\t\t\n if (!empty($r_sql)) {\n $a_peg = self::pegFilter($conn, $r_sql);\n }\n\n //pegawai yang gajinya sudah dibayar\n $b_peg = self::sudahBayar($conn, $r_periode);\n\n $sql = \"select g.idpegawai,g.kodetunjangan from \" . static::table('ga_tunjanganpeg') . \" g\n\t\t\t\t\tleft join \" . static::table('ms_tunjangan') . \" t on t.kodetunjangan = g.kodetunjangan\n\t\t\t\t\twhere g.periodegaji = '$r_periode' and g.periodetarif = '$r_periodetarif' and t.isbayargaji = 'T' and t.isaktif = 'Y'\n\t\t\t\t\tand (g.isdibayar = 'T' or g.isdibayar is null)\";\n if (!empty($a_peg))\n $sql .= \" and g.idpegawai in ($a_peg)\";\n if (!empty($b_peg))\n $sql .= \" and g.idpegawai not in ($b_peg)\";\n\n $rs = $conn->Execute($sql);\n\n $record = array();\n $record['isdibayar'] = 'Y';\n $record['tglbayar'] = date('Y-m-d');\n\n $recgaji = array();\n $recgaji['isbayarawal'] = 'Y';\n\n while ($row = $rs->FetchRow()) {\n $key = $row['idpegawai'] . '|' . $r_periode . '|' . $r_periodetarif . '|' . $row['kodetunjangan'];\n $colkey = 'idpegawai,periodegaji,periodetarif,kodetunjangan';\n\n list($err, $msg) = self::updateRecord($conn, $record, $key, true, 'ga_tunjanganpeg', $colkey);\n\n if (!$err) {\n $keygaji = $row['idpegawai'] . '|' . $r_periode;\n $colkeygaji = 'idpegawai,periodegaji';\n list($err, $msg) = self::updateRecord($conn, $recgaji, $keygaji, true, 'ga_gajipeg', $colkeygaji);\n }\n }\n\n list($err, $msg) = self::updateStatus($conn);\n\n return array($err, $msg);\n }", "function isNaikGaji($conn,$idpegawai,$tglkgb){\n\t\t\t$tglkgb = Cstr::formatDate($tglkgb);\n\t\t\t$bln = substr($tglkgb,5,2);\n\t\t\t$isnaik = true;\n\t\t\t//cek apakah pegawai sudah diproses naik pangkat\n\t\t\t$kgb = $conn->GetOne(\"select idpegawai from \".self::table('pe_kgb').\" \n\t\t\t\t\twhere idpegawai = $idpegawai and datepart(month,tglkgb)='$bln'\");\n\t\t\t\t\t\n\t\t\n\t\t\tif(!empty($kgb))\n\t\t\t\t$isnaik = false;\n\t\t\t\t\n\t\t\t//mendapatkan next pangkat\n\t\t\t$rown = mKenaikan::getNaikGaji($conn,$idpegawai,$tglkgb);\n\t\t\t\n\t\t\t//cek untuk status pegawai yang naik pangkat\n\t\t\t$sql = \"select p.idpegawai,coalesce(p.nik+' - ','')+\".static::schema.\".f_namalengkap(p.gelardepan,p.namadepan,p.namatengah,p.namabelakang,p.gelarbelakang) as pegawai,\n\t\t\t\t\tu.kodeunit+' - '+u.namaunit as namaunit,pl.golongan as golonganlama,p.tmtpangkat as tmtpangkatlama,cast(p.masakerjathngol as varchar)+' tahun '+cast(p.masakerjablngol as varchar)+' bulan' as mklama,\n\t\t\t\t\t'\".$rown['idpangkat'].\"' as pangkatbaru,'\".$rown['tmtpangkat'].\"' as tmtpangkat,substring(right(replicate('0', 4) + cast(\".$rown['mkg'].\" as varchar), 4),1,2) as mkthn, substring(right(replicate('0', 4) + cast(\".$rown['mkg'].\" as varchar), 4),3,2) as mkbln\n\t\t\t\t\tfrom \".self::table('ms_pegawai').\" p\n\t\t\t\t\tleft join \".self::table('ms_unit').\" u on u.idunit=p.idunit\n\t\t\t\t\tleft join \".self::table('ms_pangkat').\" pl on pl.idpangkat=p.idpangkat\n\t\t\t\t\tleft join \".self::table('pe_kgb').\" k on k.idpegawai=p.idpegawai and k.tglkgb = '$tglkgb'\n\t\t\t\t\twhere p.idpegawai = $idpegawai and p.idstatusaktif = 'AA'\";\n\t\t\t$row = $conn->GetRow($sql);\t\n\t\t\t\t\t\t\n\t\t\tif(empty($row))\n\t\t\t\t$isnaik = false;\n\t\t\t\t\n\t\t\t$a_data = array('kgb' => $kgb, 'row' => $rown, 'isnaik' => $isnaik, 'sql' => $sql);\n\t\t\t\n\t\t\treturn $a_data;\n\t\t}", "public function getGrafikPelayanan()\n {\n $tgl_skrg = Time::now('Asia/Jakarta')->toDateString();\n $id_jad = $this->db->table('jadwal')->select('id_jadwal')->get()->getResultArray();\n $id_kat = $this->db->table('jadwal')->get()->getRowArray(); \n\n if ($id_jad == NULL) {\n \n $grafik_pelayanan = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal')\n ->where('pertanyaan.id_unit', 3)->get()->getResultArray();\n\n }elseif (($id_kat['tgl_mulai'] <= $tgl_skrg) && ($id_kat['tgl_akhir'] >= $tgl_skrg)){\n\n $grafik_pelayanan = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('jadwal.tgl_mulai <=', $tgl_skrg)->where('jadwal.tgl_akhir >=', $tgl_skrg)\n ->where('pertanyaan.id_unit', 3)\n ->get()->getResultArray();\n }else {\n $row =$this->db->table('jadwal')->limit(1)->orderBy('id_jadwal',\"DESC\")->get()->getRowArray();\n $roow = $row['id_jadwal'];\n\n $grafik_pelayanan = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal', $roow)\n ->where('pertanyaan.id_unit', 3)->get()->getResultArray();\n }\n\n $sangatBaik = 0;\n $baik = 0;\n $tidakBaik = 0;\n $sangatTidakBaik = 0;\n foreach ($grafik_pelayanan as $grafik):\n if ($grafik['opsi'] == \"Sangat Baik\") {\n $sangatBaik = $sangatBaik + 1;\n }\n elseif($grafik['opsi'] == \"Baik\"){\n $baik = $baik + 1;\n }\n elseif($grafik['opsi'] == \"Tidak Baik\"){\n $tidakBaik = $tidakBaik + 1;\n }\n elseif($grafik['opsi'] == \"Sangat Tidak Baik\"){\n $sangatTidakBaik = $sangatTidakBaik + 1;\n }\n endforeach;\n\n $data = [$sangatBaik, $baik, $tidakBaik, $sangatTidakBaik];\n return $data;\n }", "public function tidaklulus_SEMPROP(){\n\t\t$query=\"SELECT COUNT(id_seminar) AS jml_tdk_lulus FROM seminar_proposal WHERE status='tidak_lulus' GROUP BY status\"; //query untuk menghitung jumlah mahasiswa yang tidak lulus semprop\n\t\t$this->eksekusi($query); //mengeksekusi query diatas\n\t\treturn $this->result; //mengembalikan hasil query diatas\n\t}", "function getDataPeriode($conn,$periode,$kurikulum,$kodeunit,$padanan=false,$kelasmk='',$infoMhs=array()) {\n\t\t\t$mhs = Akademik::isMhs();\n\t\t\t$dosen = Akademik::isDosen();\n\t\t\t$admin = Akademik::isAdmin();\n\t\t\t\n\t\t\tif($infoMhs) {\n\t\t\t\tif ($infoMhs['sistemkuliah'] == \"R\") {\n\t\t\t\t\t$basis = \"and k.sistemkuliah = 'R'\";\n\t\t\t\t}\n\t\t\t\t//$basis = $infoMhs['sistemkuliah'];\n\t\t\t\t$transfer = $infoMhs['mhstransfer'];\n\t\t\t\t$angkatan = $infoMhs['periodemasuk'];\n\t\t\t\t$semesterkrs = $infoMhs['semesterkrs'];\n\t\t\t}\n\t\t\t\n\t\t\tif($mhs and !$transfer) {\n\t\t\t\t$ceksmt = true;\n\t\t\t\tif($semesterkrs%2 == 0)\n\t\t\t\t\t$batasan = ' and c.semmk%2 = 0'; // untuk genap\n\t\t\t\telse\n\t\t\t\t\t$batasan = ' and c.semmk%2 <> 0'; // untuk ganjil\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$ceksmt = false;\n\t\t\t\t$batasan = '';\n\t\t\t}\n\t\t\t\n\t\t\t/* $sql = \"select distinct k.thnkurikulum, k.kodemk, k.kodeunit, k.kelasmk, c.namamk, c.sks, c.semmk,c.semmk_old, k.koderuang,\n\t\t\t\t\t\tk.nohari, k.jammulai, k.jamselesai, \n\t\t\t\t\t\tk.nohari2, k.jammulai2, k.jamselesai2,\n\t\t\t\t\t\tk.nohari3, k.jammulai3, k.jamselesai3,\n\t\t\t\t\t\tk.nohari4, k.jammulai4, k.jamselesai4,\n\t\t\t\t\t\tk.dayatampung,k.jumlahpeserta\n\t\t\t\t\tfrom \".static::table().\" k join \".static::table('ak_kurikulum').\" c using (thnkurikulum,kodemk,kodeunit)\n\t\t\t\t\tleft join \".static::table('ak_ekivaturan').\" e on e.tahunkurikulumbaru = k.thnkurikulum and e.kodemkbaru = k.kodemk\n\t\t\t\t\t\tand e.kodeunitbaru = k.kodeunit and e.thnkurikulum = '$kurikulum'\n\t\t\t\t\twhere k.kodeunit = '$kodeunit' and \n\t\t\t\t\t\tk.periode = '$periode' and (k.thnkurikulum = '$kurikulum'\".\n\t\t\t\t\t\t($padanan ? \" or e.kodemkbaru is not null\" : '').\")\".(!empty($kelasmk)?\" and k.kelasmk='$kelasmk'\":\"\").\n\t\t\t\t\t\t(($mhs or $dosen)?\" and k.sistemkuliah='$basis'\" :'').($ceksmt?\" and c.semmk<=$semesterkrs\" :'').\" $batasan\n\t\t\t\t\tunion\n\t\t\t\t\tselect distinct k.thnkurikulum, k.kodemk, kl.kodeunit, k.kelasmk, c.namamk, c.sks, c.semmk,c.semmk_old, kl.koderuang, \n\t\t\t\t\t\tkl.nohari, kl.jammulai,kl.jamselesai, \n\t\t\t\t\t\tkl.nohari2, kl.jammulai2, kl.jamselesai2,\n\t\t\t\t\t\tkl.nohari3, kl.jammulai3, kl.jamselesai3,\n\t\t\t\t\t\tkl.nohari4, kl.jammulai4, kl.jamselesai4,\n\t\t\t\t\t\tkl.dayatampung,kl.jumlahpeserta \n\t\t\t\t\tfrom \".static::table('ak_pesertamku').\" k \n\t\t\t\t\tjoin \".static::table().\" kl using (kodeunit,periode,thnkurikulum,kodemk,kelasmk)\n\t\t\t\t\tjoin \".static::table('ak_kurikulum').\" c on c.thnkurikulum=k.thnkurikulum and c.kodemk=k.kodemk and c.kodeunit=k.unitmku \n\t\t\t\t\twhere k.unitmku='$kodeunit' and k.periode = '$periode' and k.thnkurikulum = '$kurikulum' \".\n\t\t\t\t\t(($mhs or $dosen)?\" and kl.sistemkuliah='$basis'\" :'').($ceksmt?\" and c.semmk<=$semesterkrs\" :\"\").(!empty($kelasmk)?\" and kl.kelasmk='$kelasmk'\":\"\").\" $batasan\n\t\t\t\t\torder by namamk, kelasmk\"; */\n\t\t\t\n\t\t\t// cek: ekivalensi\n\t\t\t$sql = \"select k.thnkurikulum, k.kodemk, k.kodeunit, k.kelasmk, c.namamk, c.sks, c.semmk, c.semmk_old, k.koderuang,\n\t\t\t\t\tk.nohari, k.jammulai, k.jamselesai, \n\t\t\t\t\tk.nohari2, k.jammulai2, k.jamselesai2,\n\t\t\t\t\tk.nohari3, k.jammulai3, k.jamselesai3,\n\t\t\t\t\tk.nohari4, k.jammulai4, k.jamselesai4,\n\t\t\t\t\tk.dayatampung, k.jumlahpeserta\n\t\t\t\t\tfrom \".static::table().\" k\n\t\t\t\t\tjoin \".static::table('ak_kurikulum').\" c using (thnkurikulum,kodemk,kodeunit)\n\t\t\t\t\tleft join \".static::table('ak_pesertamku').\" p using (kodeunit,periode,thnkurikulum,kodemk,kelasmk)\n\t\t\t\t\twhere (p.unitmku = \".Query::escape($kodeunit).\" or p.unitmku is null) and (k.kodeunit = \".Query::escape($kodeunit).\" or p.unitmku is not null)\n\t\t\t\t\tand k.periode = \".Query::escape($periode).\" and k.thnkurikulum = \".Query::escape($kurikulum).\"\n\t\t\t\t\t\".(empty($kelasmk) ? '' : \" and k.kelasmk = \".Query::escape($kelasmk)).\"\t\t\t\n\t\t\t\t\t\".(($mhs or $dosen) ? $basis : '').\"\n\n\t\t\t\t\torder by c.namamk, k.kelasmk\";\n\t\t\t\n\t\t\treturn $conn->GetArray($sql);\n\t\t}", "public function get_base_mkprodid_by_mkid($mkid){\n $query = '\n SELECT \n ps.prodi_nama,\n ps.prodi_kode,\n mp.`mkkprod_id`,\n mp.`mkkprod_porsi_kelas`,\n mkk.`mkkur_pred_jml_peminat`,\n (\n SELECT SUM(mpv.mkkprod_porsi_kelas)\n FROM mkkur_prodi mpv\n WHERE mpv.mkkprod_mkkur_id = mp.`mkkprod_mkkur_id`\n AND mpv.`mkkprod_related_id` IS NULL\n GROUP BY mkkprod_mkkur_id\n ) AS t,\n mkkprod_porsi_kelas * (mkk.`mkkur_pred_jml_peminat` DIV\n (\n SELECT SUM(mpv.mkkprod_porsi_kelas)\n FROM mkkur_prodi mpv\n WHERE mpv.mkkprod_mkkur_id = mp.`mkkprod_mkkur_id`\n AND mpv.`mkkprod_related_id` IS NULL\n GROUP BY mkkprod_mkkur_id\n )) AS jml_porsi, \n mkk.`mkkur_pred_jml_peminat` MOD\n (\n SELECT SUM(mpv.mkkprod_porsi_kelas)\n FROM mkkur_prodi mpv\n WHERE mpv.mkkprod_mkkur_id = mp.`mkkprod_mkkur_id`\n AND mpv.`mkkprod_related_id` IS NULL\n GROUP BY mkkprod_mkkur_id\n ) AS sisa\n FROM program_studi ps\n LEFT JOIN mkkur_prodi mp ON ps.prodi_id = mp.mkkprod_prodi_id\n LEFT JOIN mata_kuliah_kurikulum mkk ON mp.`mkkprod_mkkur_id` = mkk.`mkkur_id`\n WHERE mp.mkkprod_mkkur_id = \"'.$mkid.'\"\n AND mp.`mkkprod_related_id` IS NULL \n AND mp.`mkkprod_porsi_kelas` <> 0\n ';\n\n $ret = $this->db->query($query);\n $ret = $ret->result_array();\n\n return $ret;\n }", "function get_qty_keluar($periode_start, $periode_end, $produk_id){\r\n\t\t$sql_tgl_awal =\r\n\t\t\t \"SELECT produk_tgl_nilai_saldo_awal\r\n\t\t\t\tFROM produk\r\n\t\t\t\tWHERE \r\n\t\t\t\t\tproduk_id = '\".$produk_id.\"'\r\n\t\t\t\t\tAND produk_tgl_nilai_saldo_awal <= $periode_start\";\r\n\t\t\t\t\r\n\t\t$query_tgl_awal\t= $this->db->query($sql_tgl_awal);\r\n\t\t\r\n\t\tif($query_tgl_awal->num_rows()>0){\r\n\t\t\t\t\t\t\r\n\t\t\t$sql = \"SELECT \r\n\t\t\t\t\t\tSUM(stok_keluar - stok_masuk) as qty_keluar\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\tks.ks_masuk as stok_masuk,\r\n\t\t\t\t\t\t\tks.ks_keluar as stok_keluar\r\n\t\t\t\t\t\tFROM kartu_stok_fix ks\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = ks.ks_satuan_id) AND (sk.konversi_produk = ks.ks_produk_id)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\tks.ks_produk_id = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND ks.ks_tgl_faktur BETWEEN \".$periode_start.\" AND \".$periode_end.\"\r\n\t\t\t\t\t\t\tAND (ks.ks_jenis = 'jual_produk' OR ks.ks_jenis = 'retur_produk')\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tUNION ALL\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\t0 as stok_masuk,\r\n\t\t\t\t\t\t\td.cabin_jumlah as stok_keluar\r\n\t\t\t\t\t\tFROM detail_pakai_cabin d\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = d.cabin_satuan) AND (sk.konversi_produk = d.cabin_produk)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\td.cabin_produk = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND date_format(cabin_date_create,'%Y-%m-%d') BETWEEN \".$periode_start.\" AND \".$periode_end.\"\r\n\t\t\t\t\t)\r\n\t\t\t\t\tAS ks_gabungan\";\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t$query_nbeli = $this->db->query($sql);\r\n\t\t\t\r\n\t\t\tif($query_nbeli->num_rows()){\r\n\t\t\t\t$nbeli =$query_nbeli->row();\r\n\t\t\t\treturn $nbeli->qty_keluar;\r\n\t\t\t}else\r\n\t\t\t\treturn 0;\r\n\t\t}\r\n\t\telse \r\n\t\t\treturn 0;\r\n\t}", "public function getKasMasukData($dept, $jurs, $kels, $tglfr, $tglto) {\n $wheres = '';\n $arrFetch = array();\n if(!empty($tglfr) || !empty($tglto)){\n if(!empty($tglfr) && !empty($tglto)){\n if($tglfr == $tglto) {\n $where[] = \"date_format(p.pbyr_createdate,'%Y-%m-%d') between :tglfr and :tglto\";\n $arrFetch[':tglfr'] = $tglfr;\n $arrFetch[':tglto'] = $tglfr;\n } elseif ($tglfr > $tglto) {\n $where[] = \"date_format(p.pbyr_createdate,'%Y-%m-%d') between :tglto and :tglfr\";\n $arrFetch[':tglfr'] = $tglfr;\n $arrFetch[':tglto'] = $tglto;\n } elseif ($tglfr < $tglto) {\n $where[] = \"date_format(p.pbyr_createdate,'%Y-%m-%d') between :tglfr and :tglto\";\n $arrFetch[':tglfr'] = $tglfr;\n $arrFetch[':tglto'] = $tglto;\n }\n } elseif(!empty($tglfr) && empty($tglto)){\n $where[] = \"date_format(p.pbyr_createdate,'%Y-%m-%d') = :tglfr\";\n $arrFetch[':tglfr'] = $tglfr;\n } elseif(empty($tglfr) && !empty($tglto)){\n $where[] = \"date_format(p.pbyr_createdate,'%Y-%m-%d') = :tglto\";\n $arrFetch[':tglto'] = $tglto;\n }\n }\n if(!empty($dept)){\n $where[] = \"s.ms_departemen=:dept\";\n $arrFetch[':dept'] = $dept;\n }\n if(!empty($jurs)){\n $where[] = \"s.ms_jurusan=:jurs\";\n $arrFetch[':jurs'] = $jurs;\n }\n if(!empty($kels)){\n $where[] = \"s.ms_kelas=:kels\";\n $arrFetch[':kels'] = $kels;\n }\n \n $where[] = \"p.pbyr_deletedate is null\";\n \n if(count($where) > 0){\n $wheres = \"where \" . implode(\" and \", $where);\n }\n \n $querySelect = \"\nselect \n date_format(p.pbyr_createdate, '%Y-%m-%d') as pbyr_createdate, \n t.mt_jenis, \n sum(p.pbyr_nominal_debet) as debet, \n sum(p.pbyr_nominal) as kredit \nfrom pembayaran p\nleft join m_transaksi t on t.mt_id = p.mt_id\nleft join m_siswa s on s.ms_id = p.ms_id\n$wheres\ngroup by p.mt_id \n\";\n $res = $this->fetchQuery($querySelect, $arrFetch);\n $saldo = 0;\n if(count($res) > 0){\n foreach($res as $ress){\n $saldo = $saldo + $ress['debet'] + $ress['kredit'];\n $ress['saldo'] = number_format($saldo, 0, ',','.');\n $ress['kredit'] = number_format($ress['kredit'], 0, ',', '.');\n $rowz[] = $ress;\n }\n $rowz[] = array(\n 'pbyr_createdate' => date(\"Y-m-d\"),\n 'mt_jenis' => 'Masuk Tab KJKS Mawar',\n 'debet' => number_format($saldo, 0, ',','.'),\n 'kredit' => '',\n 'saldo' => 0\n );\n return array('rows' => $rowz);\n } else {\n return array('rows' => array(array('pbyr_createdate' => \"no data\")));\n }\n }", "public function getGrafikPerpus()\n {\n $tgl_skrg = Time::now('Asia/Jakarta')->toDateString();\n $id_jad = $this->db->table('jadwal')->select('id_jadwal')->get()->getResultArray();\n $id_kat = $this->db->table('jadwal')->get()->getRowArray(); \n\n if ($id_jad == NULL) {\n \n $grafik_perpus = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal')\n ->where('pertanyaan.id_unit', 1)->get()->getResultArray();\n\n }elseif (($id_kat['tgl_mulai'] <= $tgl_skrg) && ($id_kat['tgl_akhir'] >= $tgl_skrg)){\n\n $grafik_perpus = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('jadwal.tgl_mulai <=', $tgl_skrg)->where('jadwal.tgl_akhir >=', $tgl_skrg)\n ->where('pertanyaan.id_unit', 5)\n ->get()->getResultArray();\n }else {\n $row =$this->db->table('jadwal')->limit(1)->orderBy('id_jadwal',\"DESC\")->get()->getRowArray();\n $roow = $row['id_jadwal'];\n\n $grafik_perpus = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal', $roow)\n ->where('pertanyaan.id_unit', 5)->get()->getResultArray();\n }\n\n $sangatBaik = 0;\n $baik = 0;\n $tidakBaik = 0;\n $sangatTidakBaik = 0;\n foreach ($grafik_perpus as $grafik):\n if ($grafik['opsi'] == \"Sangat Baik\") {\n $sangatBaik = $sangatBaik + 1;\n }\n elseif($grafik['opsi'] == \"Baik\"){\n $baik = $baik + 1;\n }\n elseif($grafik['opsi'] == \"Tidak Baik\"){\n $tidakBaik = $tidakBaik + 1;\n }\n elseif($grafik['opsi'] == \"Sangat Tidak Baik\"){\n $sangatTidakBaik = $sangatTidakBaik + 1;\n }\n endforeach;\n\n $data = [$sangatBaik, $baik, $tidakBaik, $sangatTidakBaik];\n return $data;\n }", "function dias_justificacion($id) {\n $ssql = \"SELECT DATEDIFF(a.fecha_fin,a.fecha_inicio) AS dif_diasPermiso, a.* \n FROM justificacion_permiso AS a \n WHERE id_admin=$id and a.estado='aceptado'\";\n // echo $ssql.\"<br>\";\n $resultado = $this->db->query($ssql);\n return $resultado;\n }", "function fetch_datebetwine_paiement_filtre()\n\t{\n\t $output = '';\n\t $query = '';\n\t $total;\n\t $jour1 =$this->input->post('jour1');\n\t $jour2 =$this->input->post('jour2');\n\t if($jour1 > $jour2)\n\t {\n\t $data = $this->crud_model->fetch_data_paiement_date($jour2, $jour1);\n\t $total = $this->crud_model->fetch_sum_data_paiement_date($jour2, $jour1);\n\t }\n\t else{\n\t $data = $this->crud_model->fetch_data_paiement_date($jour1, $jour2);\n\t $total = $this->crud_model->fetch_sum_data_paiement_date($jour1, $jour2);\n\t }\n\n\t $money = $this->crud_model->fetch_data_paiement_date_montant($jour1, $jour2);\n\t \n\n\t $pdf_link ='<a class=\"btn btn-outline-warning pull-right mt-2 mb-2\" \n\t href=\"'.base_url().'admin/pdf_liste_facture/'.$jour1.'/'.$jour2.' \"><i class=\"fa fa-print mr-1\"></i> PDF</a>';\n\t \n\t $output .= '\n\n\t <div align=\"right\" class=\"pull-right mb-2\">\n\t \n\t '.$pdf_link.'\n\t </div>\n\t \n\t <table class=\"table-striped table-bordered nk-tb-list nk-tb-ulist dataTable no-footer\" data-auto-responsive=\"true\" id=\"user_data\" role=\"grid\" aria-describedby=\"DataTables_Table_1_info\">\n\t <theader>\n\t <tr>\n\t <th width=\"5%\">Selectionner</th>\n\t <th width=\"5%\">Avatar</th>\n\t <th width=\"20%\">Nom complet</th>\n\t <th width=\"15%\">Rencontre</th>\n\t <th width=\"10%\">Statut</th>\n\t <th width=\"20%\">Jour</th>\n\t <th width=\"5%\">Heure</th>\n\t <th width=\"10%\">Place</th>\n\n\t <th width=\"10%\">Imprimer</th>\n\t \n\t \n\t </tr>\n\t <theader>\n\t <tbody>\n\t ';\n\t foreach($data->result() as $row)\n\t {\n\t if ($row->etat_reservation ==0) {\n\n\n\t $link = '<a href=\"tel:'.$row->telephone.'\" class=\"text-primary\"><i class=\"fa fa-phone\"></i></a>\n\t <input type=\"checkbox\" name=\"tel\" value=\"'.$row->telephone.'\" class=\"tels mr-1 delete_checkbox\">\n\t &nbsp;\n\t <a href=\"javascript:void(0);\" idreservation=\"'.$row->idreservation.'\" class=\"btn btn-dark btn-sm btn-circle valider\"><i class=\"fa fa-check text-white\"></i> </a>\n\t \n\t ';\n\n\t $etat_reservation = '\n\t \n\t <a type=\"button\" href=\"'.base_url().'admin/pdf_billet/'.$row->codeReservation.'\" class=\"btn btn-primary btn-circle btn-sm print\"><i class=\"fa fa-print\"></i></a>\n\t ';\n\t }\n\t else{\n\t $etat_reservation = '\n\t \n\t <a type=\"button\" href=\"'.base_url().'admin/pdf_billet/'.$row->codeReservation.'\" class=\"btn btn-primary btn-circle btn-sm print\"><i class=\"fa fa-print\"></i></a>\n\t ';\n\n\t $link = '<a href=\"tel:'.$row->telephone.'\" class=\"text-primary\"><i class=\"fa fa-phone\"></i></a>\n\t <input type=\"checkbox\" name=\"tel\" value=\"'.$row->telephone.'\" class=\"tels mr-1 delete_checkbox\">\n\t &nbsp;\n\t <a href=\"javascript:void(0);\" idreservation=\"'.$row->idreservation.'\" class=\"btn btn-success btn-circle btn-sm\"><i class=\"fa fa-check text-white\"></i></a>\n\t ';\n\t }\n\t \n\n\t $etat ='<span class=\"badge badge-warning\"><i class=\"fa fa-user\"></i> Client </span>';\n\n\n\t $email = '<a href=\"mailto:'.$row->email.'\" class=\"text-primary\"><i class=\"fa fa-google mr-1\"></i> '.$row->email.'</a>\n\t \n\t ';\n\n\t \n\t $output .= '\n\t <tr>\n\t <td>'.$link.'</td>\n\t <td><img src=\"'.base_url().'upload/photo/'.$row->image.'\" class=\"table-user-thumb\" style=\"border-radius: 50%; width: 50px; height: 30px;\" /></td>\n\n\t <td>'.substr($row->first_name.' '.$row->last_name, 0,20).'...</td>\n\n\t <td>'.$row->nomMatch.'</td>\n\t <td>'.$etat.'</td>\n\t <td>'.nl2br(substr(date(DATE_RFC822, strtotime($row->jour)), 0, 23)).'</td>\n\t <td>'.$row->heure.'</td>\n\n\t <td>'.$row->nomStade.' <br>'.$row->nomPlace.'</td>\n\n\t <td>'.$etat_reservation.'</td>\n\t \n\t </tr>\n\t ';\n\n\t }\n\n\t $output .='\n\t <tr>\n\t <td colspan=\"8\">Montant total </td>\n\t <td><h4>'.$total.'$</h4></td>\n\t \n\t </tr>\n\t \n\t ';\n\t $output .= '\n\t <tbody>\n\t <tfooter>\n\t <tr>\n\t <th width=\"5%\">Selectionner</th>\n\t <th width=\"5%\">Avatar</th>\n\t <th width=\"20%\">Nom complet</th>\n\t <th width=\"15%\">Rencontre</th>\n\t <th width=\"10%\">Statut</th>\n\t <th width=\"20%\">Jour</th>\n\t <th width=\"5%\">Heure</th>\n\t <th width=\"10%\">Place</th>\n\n\t <th width=\"10%\">Action</th>\n\t \n\t \n\t </tr>\n\t <tfooter>\n\t </table>';\n\t echo $output;\n\t}", "public function request_data_kwitansi()\n {\n $unit_id = $this->input->post('unit_id');\n $query = $this->db\n ->query(\"SELECT\n t_pembayaran.id AS pembayaran_id,\n FORMAT(t_pembayaran.tgl_bayar, 'dd-MM-yyyy hh:mm:ss') AS tgl_bayar,\n service_jenis.id AS service_jenis_id,\n service_jenis.code_default AS code_service,\n service_jenis.name_default AS name_service,\n CASE \n WHEN ttl.id IS NOT NULL THEN\n ttl.periode \n WHEN tta.id IS NOT NULL THEN\n tta.periode \n ELSE tta.periode \n END AS periode_service,\n SUM(ISNULL(t_pembayaran_detail.bayar, t_pembayaran_detail.bayar_deposit)) AS bayar,\n ISNULL(t_pembayaran.no_kwitansi, '') AS no_kwitansi,\n t_pembayaran.count_print_kwitansi \n FROM t_pembayaran\n INNER JOIN t_pembayaran_detail \n ON t_pembayaran_detail.t_pembayaran_id = t_pembayaran.id\n INNER JOIN service \n ON service.id = t_pembayaran_detail.service_id\n INNER JOIN service_jenis \n ON service_jenis.id = service.service_jenis_id\n\n LEFT JOIN t_tagihan_lingkungan ttl \n ON ttl.id = t_pembayaran_detail.tagihan_service_id AND service_jenis.id = 1\n LEFT JOIN t_tagihan_air tta \n ON tta.id = t_pembayaran_detail.tagihan_service_id AND service_jenis.id = 2\n LEFT JOIN t_tagihan_lainnya ttla \n ON ttla.id = t_pembayaran_detail.tagihan_service_id AND service_jenis.id = 6\n WHERE 1=1\n AND t_pembayaran.unit_id = '\" . $unit_id . \"'\n AND ISNULL(t_pembayaran.is_void, 0) = 0\n GROUP BY\n t_pembayaran.id,\n t_pembayaran.tgl_bayar,\n service_jenis.id,\n service_jenis.code_default, \n service_jenis.name_default,\n t_pembayaran.no_kwitansi,\n t_pembayaran.count_print_kwitansi,\n ttl.id,\n tta.id,\n ttl.periode,\n tta.periode,\n ttla.periode\n ORDER BY t_pembayaran.id\n \");\n $query = $query->result();\n\n $pembayaran_id = [];\n $kwitansi_all_service = [];\n foreach ($query as $q) {\n if (!in_array($q->pembayaran_id,$pembayaran_id)) {\n array_push($pembayaran_id, $q->pembayaran_id);\n array_push($kwitansi_all_service, $q);\n }\n }\n $data = [];\n foreach ($kwitansi_all_service as $k) {\n $service_jenis_id = [];\n $code_service = [];\n $name_service = [];\n $periode_tmp = [];\n $periode_service = [];\n $bayar = 0;\n foreach ($query as $q) {\n if ($q->pembayaran_id == $k->pembayaran_id) {\n if (!in_array($q->service_jenis_id, $service_jenis_id)) {\n array_push($service_jenis_id, $q->service_jenis_id);\n array_push($code_service, $q->code_service);\n array_push($name_service, $q->name_service);\n }\n\n $index = array_search($q->service_jenis_id, $service_jenis_id);\n if (!isset($periode_tmp[$index])) {\n $periode_tmp[$index] = [];\n }\n if (!in_array($q->periode_service, $periode_tmp[$index])) {\n array_push($periode_tmp[$index],$q->periode_service);\n }\n\n $bayar += $q->bayar; \n }\n }\n for ($i=0; $i < count($periode_tmp); $i++) {\n $periode_tmp_count = count($periode_tmp[$i]);\n sort($periode_tmp[$i]); \n\n\n $periode_service[$i] = $name_service[$i].' ('.($periode_tmp_count>1 ? (date('m/Y',strtotime($periode_tmp[$i][0])).' s/d '.date('m/Y',strtotime($periode_tmp[$i][$periode_tmp_count-1]))) : date('m/Y',strtotime($periode_tmp[$i][0]))).')';\n }\n\n $k->service_jenis_id = implode(',', $service_jenis_id);\n $k->code_service = implode(',', $code_service);\n $k->name_service = implode(',', $name_service);\n $k->periode_service = implode(',', $periode_service);\n $k->bayar = $bayar;\n\n array_push($data, $k);\n }\n\n echo json_encode(array('data' => $data));\n }", "function data_pensiun()\n {\n $query = $this->db->query(\"SELECT\n id_pegawai,\n nama,\n nip,\n path_foto,\n tgl_lahir,\n tgl_pensiun,\n umur,\n selisih\n FROM data_usulan_pensiun\n WHERE selisih <= 180 \");\n\n return $query->result();\n }", "function listQueryGajiHonorer() {\n $sql = \"select p.idpegawai,\" . static::schema() . \"f_namalengkap(gelardepan,namadepan,namatengah,namabelakang,gelarbelakang) as namalengkap,\n\t\t\t\t\tnamapendidikan,namaunit,th.nominal as tarif,g.isfinish,g.gajiditerima\n\t\t\t\t\tfrom \" . static::table('ga_gajipeg') . \" g \n\t\t\t\t\tleft join \" . static::table('ms_pegawai') . \" p on p.idpegawai=g.idpegawai\n\t\t\t\t\tleft join \" . static::table('lv_jenjangpendidikan') . \" j on j.idpendidikan=p.idpendidikan\n\t\t\t\t\tleft join \" . static::table('ms_unit') . \" u on u.idunit=p.idunit\n\t\t\t\t\tleft join \" . static::table('ga_tarifhonorer') . \" th on th.idpendidikan=p.idpendidikan\n\t\t\t\t\twhere p.idstatusaktif in (select idstatusaktif from \" . static::table('lv_statusaktif') . \" where isdigaji='Y')\n\t\t\t\t\tand idhubkerja in ('HP')\";\n return $sql;\n }", "function by_kelurahan_filter($bulan,$tahun,$kecamatan)\n {\n $this->db->select('kelurahan_tempat_praktek,COUNT( id ) AS total,COUNT( CASE WHEN status_berlaku = \"1\" THEN 1 END ) AS berlaku,\n COUNT( CASE WHEN status_berlaku = \"0\" THEN 1 END ) AS tidak_berlaku\t');\n $this->db->from($this->table);\n $this->db->where('MONTH(created_date)',$bulan);\n $this->db->where('YEAR(created_date)',$tahun);\n $this->db->where('kecamatan_tempat_praktek',$kecamatan);\n $this->db->group_by('kelurahan_tempat_praktek');\n $this->db->order_by('total','DESC');\n return $this->db->get()->result();\n }", "public function getTotalBiayaMhsPeriodePembayaran ($status='baru') { \n\t\t$tahun_masuk=$this->DataMHS['tahun_masuk'];\n $semester_masuk=$this->DataMHS['idsmt'];\n\t\t$kelas=$this->DataMHS['idkelas'];\n switch ($status) {\n case 'lama' :\n $str = \"SELECT SUM(biaya) AS jumlah FROM kombi_per_ta kpt,kombi k WHERE k.idkombi=kpt.idkombi AND tahun=$tahun_masuk AND idsmt=$semester_masuk AND idkelas='$kelas' AND periode_pembayaran='semesteran'\";\n break;\n case 'baru' :\n if ($this->getDataMhs('perpanjang')==true) {\n $str = \"SELECT SUM(biaya) AS jumlah FROM kombi_per_ta kpt,kombi k WHERE k.idkombi=kpt.idkombi AND tahun=$tahun_masuk AND idsmt=$semester_masuk AND idkelas='$kelas' AND periode_pembayaran!='none'\";\n }else {\n $str = \"SELECT SUM(biaya) AS jumlah FROM kombi_per_ta kpt,kombi k WHERE k.idkombi=kpt.idkombi AND tahun=$tahun_masuk AND idsmt=$semester_masuk AND idkelas='$kelas' AND periode_pembayaran!='none'\";\t\t\t\t\t\t\t\t\n }\t\t\n break;\n case 'sp' :\n $str = \"SELECT biaya AS jumlah FROM kombi_per_ta WHERE tahun=$tahun_masuk AND idsmt=$semester_masuk AND idkelas='$kelas' AND idkombi=14\";\n break;\n }\t\t\n\t\t$this->db->setFieldTable(array('jumlah'));\n\t\t$r=$this->db->getRecord($str);\t\n \n\t\treturn $r[1]['jumlah'];\n\t}", "function putus_hdr_ct(){\n $query = $this->db->query(\"SELECT a.perkara_id, a.`nomor_perkara`,\n c.tanggal_sidang,c.dihadiri_oleh ,\n DATE_FORMAT(b.tanggal_putusan,'%d %M %Y') AS tanggal_putusan,\n DATE_FORMAT(DATE_ADD(b.tanggal_putusan, INTERVAL 15 DAY),'%d %M %Y') AS expire_phs_ikrar,\n DATEDIFF(DATE_ADD(b.tanggal_putusan, INTERVAL 15 DAY),CURDATE()) AS selisih\n FROM perkara AS a \n LEFT JOIN perkara_putusan AS b ON a.`perkara_id`=b.`perkara_id`\n LEFT JOIN perkara_jadwal_sidang AS c ON a.`perkara_id`=c.`perkara_id`\n LEFT JOIN perkara_putusan_pemberitahuan_putusan AS d ON a.`perkara_id`=d.`perkara_id`\n LEFT JOIN perkara_ikrar_talak AS e ON a.`perkara_id`= e.`perkara_id`\n LEFT JOIN perkara_akta_cerai AS f ON a.`perkara_id`=f.`perkara_id`\n LEFT JOIN perkara_banding AS g ON a.`perkara_id`=g.`perkara_id`\n WHERE b.`tanggal_putusan` =c.`tanggal_sidang`\n AND g.`tanggal_pendaftaran_banding`IS NULL\n\t\t\t\t\t\t\t\t\tAND DATE_FORMAT(a.tanggal_pendaftaran, '%Y') >2017\n\t\t\t\t\t\t\t\t\tAND f.`tgl_akta_cerai` IS NULL\n AND e.`tgl_ikrar_talak` IS NULL\n AND c.`dihadiri_oleh`='1'\n AND b.status_putusan_id=62\n AND b.`putusan_verstek`='T'\n AND a.`jenis_perkara_id`=346 \n GROUP BY nomor_perkara DESC\");\n return $query; \n }", "public function assign($mine,$tahun,$periode){\n\t\t$hasil = $this->db->query(\"select d.*,e.status from (select c.target,c.name,c.penilai,1 periode,c.tahun from (SELECT DISTINCT a.target,b.name,a.penilai1 as penilai,a.tahun FROM `setup_assessment` a join tb_pegawai b ON a.target=b.NIP WHERE a.penilai1='$mine' UNION \nSELECT DISTINCT a.target,b.name,a.penilai2 as penilai,a.tahun FROM setup_assessment a join tb_pegawai b ON a.target=b.NIP WHERE a.penilai2='$mine' UNION \nSELECT DISTINCT a.target,b.name,a.penilai3 as penilai,a.tahun FROM setup_assessment a join tb_pegawai b ON a.target=b.NIP WHERE a.penilai3='$mine' UNION \nSELECT DISTINCT a.target,b.name,a.penilai4 as penilai,a.tahun FROM setup_assessment a join tb_pegawai b ON a.target=b.NIP WHERE a.penilai4='$mine') c UNION \n\nselect c.target,c.name,c.penilai,2 periode,c.tahun from (SELECT DISTINCT a.target,b.name,a.penilai1 as penilai,a.tahun FROM `setup_assessment` a join tb_pegawai b ON a.target=b.NIP WHERE a.penilai1='$mine' UNION \nSELECT DISTINCT a.target,b.name,a.penilai2 as penilai,a.tahun FROM setup_assessment a join tb_pegawai b ON a.target=b.NIP WHERE a.penilai2='$mine' UNION \nSELECT DISTINCT a.target,b.name,a.penilai3 as penilai,a.tahun FROM setup_assessment a join tb_pegawai b ON a.target=b.NIP WHERE a.penilai3='$mine' UNION \nSELECT DISTINCT a.target,b.name,a.penilai4 as penilai,a.tahun FROM setup_assessment a join tb_pegawai b ON a.target=b.NIP WHERE a.penilai4='$mine') c UNION\n\nselect c.target,c.name,c.penilai,3 periode,c.tahun from (SELECT DISTINCT a.target,b.name,a.penilai1 as penilai,a.tahun FROM `setup_assessment` a join tb_pegawai b ON a.target=b.NIP WHERE a.penilai1='$mine' UNION \nSELECT DISTINCT a.target,b.name,a.penilai2 as penilai,a.tahun FROM setup_assessment a join tb_pegawai b ON a.target=b.NIP WHERE a.penilai2='$mine' UNION \nSELECT DISTINCT a.target,b.name,a.penilai3 as penilai,a.tahun FROM setup_assessment a join tb_pegawai b ON a.target=b.NIP WHERE a.penilai3='$mine' UNION \nSELECT DISTINCT a.target,b.name,a.penilai4 as penilai,a.tahun FROM setup_assessment a join tb_pegawai b ON a.target=b.NIP WHERE a.penilai4='$mine') c UNION\n\nselect c.target,c.name,c.penilai,4 periode,c.tahun from (SELECT DISTINCT a.target,b.name,a.penilai1 as penilai,a.tahun FROM `setup_assessment` a join tb_pegawai b ON a.target=b.NIP WHERE a.penilai1='$mine' UNION \nSELECT DISTINCT a.target,b.name,a.penilai2 as penilai,a.tahun FROM setup_assessment a join tb_pegawai b ON a.target=b.NIP WHERE a.penilai2='$mine' UNION \nSELECT DISTINCT a.target,b.name,a.penilai3 as penilai,a.tahun FROM setup_assessment a join tb_pegawai b ON a.target=b.NIP WHERE a.penilai3='$mine' UNION \nSELECT DISTINCT a.target,b.name,a.penilai4 as penilai,a.tahun FROM setup_assessment a join tb_pegawai b ON a.target=b.NIP WHERE a.penilai4='$mine') c) d LEFT JOIN assessment e on d.target=e.target AND d.penilai=e.asesor AND d.periode=e.periode AND d.tahun=e.tahun\");\n\t\tif($hasil->num_rows() > 0){\n\t\t\treturn $hasil->result();\n\t\t} else{\n\t\t\treturn array();\n\t\t}\n\t}", "function get_nilai_awal($tanggal_awal, $bulan_sebelum, $tahun, $produk_id){\r\n\t\t$sql_saldo_awal=\r\n\t\t \"SELECT\r\n\t\t\t\t(produk_nilai_saldo_awal + produk_nilai_saldo_awal2 + produk_nilai_saldo_awal3 + produk_nilai_saldo_awal4) as produk_nilai_saldo_awal,\r\n\t\t\t\tproduk_tgl_nilai_saldo_awal\r\n\t\t\tFROM produk, satuan_konversi\r\n\t\t\tWHERE \r\n\t\t\t\tkonversi_produk = produk_id\r\n\t\t\t\tAND\tkonversi_default = true\r\n\t\t\t\tAND\tproduk_id = '\".$produk_id.\"'\r\n\t\t\t\tAND produk_tgl_nilai_saldo_awal = \".$tanggal_awal;\r\n\t\t\t\t\r\n\t\t$rs_saldo_awal\t= $this->db->query($sql_saldo_awal) or die(\"Error - 1.1 : \".$sql_saldo_awal);\r\n\t\t\r\n\t\t//dari hasil query di atas, akan diketahui apakah tanggal_awal >= produk_tgl_nilai_saldo_awal? jika tidak maka return 0\r\n\t\tif($rs_saldo_awal->num_rows()>0){\r\n\t\t\t\t\t\r\n\t\t\t$row_saldo_awal\t= $rs_saldo_awal->row();\t\t\t\r\n\t\t\treturn $row_saldo_awal->produk_nilai_saldo_awal;\r\n\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$sql = \"SELECT\r\n\t\t\t\t\t\t(hpp_nilai_awal + hpp_nilai_masuk - hpp_nilai_keluar) as nilai_awal\r\n\t\t\t\t\tFROM hpp_bulan\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\thpp_bulan = '$bulan_sebelum' AND hpp_tahun = '$tahun'\";\r\n\t\t\t\r\n\t\t\t$rs_sql \t= $this->db->query($sql);\r\n\t\t\t$row_sql\t= $rs_sql->row();\r\n\t\t\t\r\n\t\t\tif($rs_sql->num_rows()>0){\r\n\t\t\t\treturn $row_sql->nilai_awal;\r\n\t\t\t}\r\n\t\t\telse return 0;\r\n\t\t}\r\n\t}", "function getNaikPangkat($conn,$r_kodeunit,$r_tglmulai,$r_tglselesai){\n\t\t\tglobal $conf;\n\t\t\trequire_once($conf['gate_dir'].'model/m_unit.php');\n\t\t\t\t\t\n\t\t\t$col = mUnit::getData($conn,$r_kodeunit);\n\t\t\t\n\t\t\t$sql = \"select p.nik,\".static::schema.\".f_namalengkap(p.gelardepan,p.namadepan,p.namatengah,p.namabelakang,p.gelarbelakang) as namalengkap,\n\t\t\t\t\tr.*,substring(right(replicate('0', 4) + cast(r.mkglama as varchar), 4),1,2)+' tahun '+substring(right(replicate('0', 4) + cast(r.mkglama as varchar), 4),3,2)+' bulan' as mklama,\n\t\t\t\t\tsubstring(right(replicate('0', 4) + cast(r.mkg as varchar), 4),1,2)+' tahun '+substring(right(replicate('0', 4) + cast(r.mkg as varchar), 4),3,2)+' bulan' as mkbaru,\n\t\t\t\t\tpl.golongan as pangkatlama, pb.golongan as pangkatbaru,u.namaunit\n\t\t\t\t\tfrom \".self::table('pe_kpb').\" r \n\t\t\t\t\tleft join \".self::table('ms_pegawai').\" p on p.idpegawai=r.idpegawai\n\t\t\t\t\tleft join \".self::table('ms_unit').\" u on u.idunit=p.idunit\n\t\t\t\t\tleft join \".self::table('ms_pangkat').\" pl on pl.idpangkat=r.idpangkatlama\n\t\t\t\t\tleft join \".self::table('ms_pangkat').\" pb on pb.idpangkat=r.idpangkat\n\t\t\t\t\twhere u.infoleft >= \".(int)$col['infoleft'].\" and u.inforight <= \".(int)$col['inforight'].\" and r.tglkpb between '$r_tglmulai' and '$r_tglselesai'\";\n\t\t\t$rs = $conn->Execute($sql);\n\t\t\t\n\t\t\t$a_data = array('list' => $rs, 'namaunit' => $col['namaunit']);\n\t\t\t\n\t\t\treturn $a_data;\t\n\t\t}", "public function TyleUngThanhCong($f_date, $t_date){\r\n\t\t$select = $this->Select(\"select log_date, sum(total) as total, sum(sucess) as sucess from (\r\n\t\tselect trunc(log_date) log_date, 0 total, count(*) sucess from credit_trans \r\n\t\twhere log_date >= to_date('\".$f_date.\"','dd/mm/yyyy') and log_date <= to_date('\".$t_date.\"','dd/mm/yyyy') + 1 and status = 1 and mt_status = 2 group by log_date\r\n\t\tunion all\r\n\t\tselect trunc(log_date) log_date , count(*) total, 0 sucess from credit_trans \r\n\t\twhere log_date >= to_date('\".$f_date.\"','dd/mm/yyyy') and log_date <= to_date('\".$t_date.\"','dd/mm/yyyy') + 1 and condition_status =1 group by log_date\r\n\t\t)\r\n\t\tgroup by log_date\r\n\t\torder by log_date\");\r\n\t\t\r\n\t\t$result = $this->FetchAll($select);\r\n\t\t//$this->DumpQueriesStack(); \r\n\t\tif($this->NumRows($select) > 0){\r\n return $result;\r\n }\r\n }", "public function getTotalBiayaMhs ($status='baru') { \n\t\t$tahun_masuk=$this->DataMHS['tahun_masuk'];\n $semester_masuk=$this->DataMHS['semester_masuk'];\n\t\t$kelas=$this->DataMHS['idkelas'];\n switch ($status) {\n case 'lama' :\n $str = \"SELECT SUM(biaya) AS jumlah FROM kombi_per_ta WHERE tahun=$tahun_masuk AND idsmt=$semester_masuk AND idkelas='$kelas' AND idkombi != 1 AND idkombi != 12 AND idkombi != 13 AND idkombi != 14 AND (idkombi=2 OR idkombi=3 OR idkombi=7 OR idkombi=9)\";\n break;\n case 'baru' :\n if ($this->getDataMhs('perpanjang')==true) {\n $str = \"SELECT SUM(biaya) AS jumlah FROM kombi_per_ta WHERE tahun=$tahun_masuk AND idsmt=$semester_masuk AND idkelas='$kelas' AND idkombi != 1 AND idkombi != 12 AND idkombi != 13 AND idkombi != 14 AND (idkombi=2 OR idkombi=3 OR idkombi=7 OR idkombi=9)\";\n }else {\n $str = \"SELECT SUM(biaya) AS jumlah FROM kombi_per_ta WHERE tahun=$tahun_masuk AND idsmt=$semester_masuk AND idkelas='$kelas' AND idkombi != 1 AND idkombi != 12 AND idkombi != 13 AND idkombi != 14\";\t\t\t\t\t\t\t\t\n }\t\t\n break;\n case 'sp' :\n $str = \"SELECT biaya AS jumlah FROM kombi_per_ta WHERE tahun=$tahun_masuk AND idsmt=$semester_masuk AND idkelas='$kelas' AND idkombi=14\";\n break;\n }\t\t\n\t\t$this->db->setFieldTable(array('jumlah'));\n\t\t$r=$this->db->getRecord($str);\t\n \n\t\treturn $r[1]['jumlah'];\n\t}", "function whereQuery() {\n // $arrDate1 = explode(\"-\", $bulantahunpenggajian);\n // $date1 = $arrDate1[0].'-'.$arrDate1[1].'-01';\n // $date2 = $arrDate1[0].'-'.$arrDate1[1].'-'.cal_days_in_month(CAL_GREGORIAN, $arrDate1[1], $arrDate1[0]);\n \n // $wer = \" A.MONTH = '\".$arrDate1[1].\"' AND A.YEAR = \".$arrDate1[0].\"\";\n \n // return $wer;\n return '';\n }", "function subsub($kode, $gol, $ps, $pt)\n{\n $param_satker = $ps;\n $splitKodeSatker = explode ('.', $param_satker);\n if(count ($splitKodeSatker) == 4) {\n $paramSatker = \"kodeSatker = '$param_satker'\";\n } else {\n $paramSatker = \"kodeSatker like '$param_satker%'\";\n }\n $param_tgl = $pt;\n if($gol == 'mesin_ori') {\n $gol = \"mesin\";\n $param_where = \"Status_Validasi_barang=1 and StatusTampil = 1 and kondisi != '3' and \n ( (TglPerolehan < '2008-01-01' and TglPembukuan <= '$param_tgl' and kodeLokasi like '12%' and kodeKa=1) or \n (TglPerolehan >= '2008-01-01' and TglPembukuan <= '$param_tgl' and kodeLokasi like '12%' and (NilaiPerolehan >=300000 or kodeKa=1)))\n and $paramSatker\";\n\n $sql = \"select kodeKelompok as kelompok,Aset_ID,TglPembukuan,kodeSatker,TahunPenyusutan,\n NilaiPerolehan as nilai,Status_Validasi_barang as jml,\n PenyusutanPerTahun as PP,Tahun as Tahun, noRegister as noRegister,\n AkumulasiPenyusutan as AP, NilaiBuku as NB,\n (select Uraian from kelompok \n where kode= kodeKelompok \n ) as Uraian,\n Status_Validasi_barang,kodeSatker from $gol m\n where kodeKelompok like '$kode_sub%' and\n $param_where \n order by kelompok asc\";\n } elseif($gol == 'bangunan_ori') {\n $gol = \"bangunan\";\n $param_where = \"Status_Validasi_barang=1 and StatusTampil = 1 and kondisi != '3' and \n ( (TglPerolehan < '2008-01-01' and TglPembukuan <= '$param_tgl' and kodeLokasi like '12%' and kodeKa=1) or \n (TglPerolehan >= '2008-01-01' and TglPembukuan <= '$param_tgl' and kodeLokasi like '12%' and (NilaiPerolehan >=10000000 or kodeKa=1)))\n and $paramSatker\";\n\n $sql = \"select kodeKelompok as kelompok,Aset_ID,TglPembukuan,kodeSatker,TahunPenyusutan,\n NilaiPerolehan as nilai,Status_Validasi_barang as jml,\n PenyusutanPerTahun as PP,Tahun as Tahun, noRegister as noRegister,\n AkumulasiPenyusutan as AP, NilaiBuku as NB,\n (select Uraian from kelompok \n where kode= kodeKelompok \n ) as Uraian,\n Status_Validasi_barang,kodeSatker from $gol m\n where kodeKelompok like '$kode_sub%' and\n $param_where \n order by kelompok asc\";\n } else {\n if($gol != \"tanahView\")\n $param_where = \"Status_Validasi_barang=1 and StatusTampil = 1 \n and TglPerolehan <= '$param_tgl' \n and TglPembukuan <='$param_tgl' \n and kodeLokasi like '12%' \n and kondisi != '3' \n and $paramSatker\";\n else\n $param_where = \"Status_Validasi_barang=1 and StatusTampil = 1 \n and TglPerolehan <= '$param_tgl' \n and TglPembukuan <='$param_tgl' \n and kodeLokasi like '12%' \n and $paramSatker\";\n\n if($gol == 'jaringan_ori') {\n $gol = \"jaringan\";\n $sql = \"select kodeKelompok as kelompok,Aset_ID,TglPembukuan,kodeSatker,TahunPenyusutan,\n NilaiPerolehan as nilai,Status_Validasi_barang as jml,\n PenyusutanPerTahun as PP,Tahun as Tahun, noRegister as noRegister,\n AkumulasiPenyusutan as AP, NilaiBuku as NB,\n (select Uraian from kelompok \n where kode= kodeKelompok \n ) as Uraian,\n Status_Validasi_barang,kodeSatker from $gol m\n where kodeKelompok like '$kode_sub%' and\n $param_where \n order by kelompok asc\";\n } else {\n if($gol == \"kdp_ori\")\n $gol = \"kdp\";\n else if($gol == \"tanahView\")\n $gol = \"tanah\";\n else $gol = \"asetlain\";\n\n $sql = \"select kodeKelompok as kelompok,Tahun as Tahun, noRegister as noRegister,Aset_ID,TglPembukuan,kodeSatker,\n NilaiPerolehan as nilai,Status_Validasi_barang as jml,\n (select Uraian from kelompok \n where kode= kodeKelompok \n ) as Uraian,\n Status_Validasi_barang,kodeSatker from $gol m\n where kodeKelompok like '$kode_sub%' and\n $param_where \n order by kelompok asc\";\n }\n }\n\n//echo \"---$gol == $sql<br/>\";\n $resultparentSubSub = mysql_query ($sql) or die(mysql_error());\n $data = array();\n while ($data_subsub = mysql_fetch_array ($resultparentSubSub, MYSQL_ASSOC)) {\n $data[] = $data_subsub;\n }\n return $data;\n}", "function getdataRwyt($skpd_id, $AsetId, $tglakhirperolehan, $tglawalperolehan, $param, $tglpembukuan)\n{\n\n if($param == '01') {\n $tabel_log = 'log_tanah';\n\n $tabel = 'tanah';\n $tabel_view = 'view_mutasi_tanah';\n } elseif($param == '02') {\n $tabel_log = 'log_mesin';\n $tabel = 'mesin';\n $tabel_view = 'view_mutasi_mesin';\n } elseif($param == '03') {\n $tabel_log = 'log_bangunan';\n $tabel = 'bangunan';\n $tabel_view = 'view_mutasi_bangunan';\n } elseif($param == '04') {\n $tabel_log = 'log_jaringan';\n $tabel = 'jaringan';\n $tabel_view = 'view_mutasi_jaringan';\n } elseif($param == '05') {\n $tabel_log = 'log_asetlain';\n $tabel = 'asetlain';\n $tabel_view = 'view_mutasi_asetlain';\n } elseif($param == '06') {\n $tabel_log = 'log_kdp';\n $tabel = 'kdp';\n $tabel_view = 'view_mutasi_kdp';\n }\n\n /*Kode Riwayat\n 0 = Data baru\n 2 = Ubah Kapitalisasi\n 7 = Penghapusan Sebagian\n 21 = Koreksi Nilai\n 26 = Penghapusan Pemindahtanganan\n 27 = Penghapusan Pemusnahan\n */\n/* $paramLog = \"l.TglPerubahan >'$tglawalperolehan' and l.TglPerubahan <='$tglakhirperolehan' and l.TglPembukuan>='$tglpembukuan'\n AND l.Kd_Riwayat in (0,1,2,3,7,21,26,27,28,50,51,29) and l.Kd_Riwayat != 77 \n and l.Aset_ID = '{$AsetId}' \n order by l.Aset_ID ASC\";*/\n\n $paramLog = \"l.TglPerubahan >'$tglawalperolehan' and l.TglPerubahan <='$tglakhirperolehan' \n AND l.Kd_Riwayat in (0,1,2,3,7,21,26,27,28,50,51,29,30,281,291,36) and l.Kd_Riwayat != 77 \n and l.Aset_ID = '{$AsetId}' \n order by l.Aset_ID ASC\";\n\n\n $log_data = \"select l.* from {$tabel_log} as l \n inner join {$tabel} as t on l.Aset_ID = t.Aset_ID \n where $paramLog\";\n //pr($log_data);\n $splitKodeSatker = explode ('.', $skpd_id);\n if(count ($splitKodeSatker) == 4) {\n $paramSatker = \"kodeSatker = '$skpd_id'\";\n $paramSatker_mts_tr = \"SatkerAwal = '$skpd_id'\";\n $paramSatker_mts_rc = \"SatkerTujuan = '$skpd_id'\";\n\n } else {\n $paramSatker = \"kodeSatker like '$skpd_id%'\";\n $paramSatker_mts_tr = \"SatkerAwal like '$skpd_id%'\";\n $paramSatker_mts_rc = \"SatkerTujuan like '$skpd_id%'\";\n\n }\n $queryALL = array( $log_data );\n for ($i = 0; $i < count ($queryALL); $i++) {\n $result = mysql_query ($queryALL[ $i ]) or die ($param.\"---\".$queryALL[ $i ].\" \".mysql_error());\n if($result) {\n while ($dataAll = mysql_fetch_object ($result)) {\n if($dataAll->Kd_Riwayat == 3 && $dataAll->kodeSatker != $skpd_id) {\n\n } else {\n $getdata[] = $dataAll;\n }\n\n }\n }\n\n }\n if($getdata) {\n return $getdata;\n }\n}", "function get_pengeluaran_by_akun5digitl3($data){\n// var_dump($data);die;\n $str_ = '';\n if(count($data['array_id']) > 1){\n foreach($data['array_id'] as $id){\n $str_ .= \"rsa_2018.rsa_kuitansi.id_kuitansi = '{$id}' OR \" ;\n }\n $str_ = substr($str_,0, strlen($str_) - 3 );\n }else{\n $str_ = \"rsa_2018.rsa_kuitansi.id_kuitansi = '{$data['array_id'][0]}'\" ;\n }\n // echo $str_ ; die;\n $str = \"SELECT SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,10) AS rka,rsa_2018.rsa_kuitansi.id_kuitansi,SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,10) AS kode_usulan_rkat,rba_2018.komponen_input.nama_komponen,rba_2018.subkomponen_input.nama_subkomponen,rba_2018.akun_belanja.nama_akun5digit,\"\n . \"rsa_2018.rsa_kuitansi.kode_akun5digit,SUM(rsa_2018.rsa_kuitansi_detail.volume*rsa_2018.rsa_kuitansi_detail.harga_satuan) AS pengeluaran \"\n . \"FROM rsa_2018.rsa_kuitansi \"\n . \"JOIN rsa_2018.rsa_kuitansi_detail \"\n . \"ON rsa_2018.rsa_kuitansi_detail.id_kuitansi = rsa_2018.rsa_kuitansi.id_kuitansi \"\n . \"JOIN rba_2018.komponen_input ON rba_2018.komponen_input.kode_kegiatan = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,2) \"\n . \"AND rba_2018.komponen_input.kode_output = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,9,2) \"\n . \"AND rba_2018.komponen_input.kode_program = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,11,2) \"\n . \"AND rba_2018.komponen_input.kode_komponen = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,13,2) \"\n . \"JOIN rba_2018.subkomponen_input ON rba_2018.subkomponen_input.kode_kegiatan = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,2) \"\n . \"AND rba_2018.subkomponen_input.kode_output = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,9,2) \"\n . \"AND rba_2018.subkomponen_input.kode_program = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,11,2) \"\n . \"AND rba_2018.subkomponen_input.kode_komponen = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,13,2) \"\n . \"AND rba_2018.subkomponen_input.kode_subkomponen = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,15,2) \"\n . \"JOIN rba_2018.akun_belanja ON rba_2018.akun_belanja.kode_akun5digit = rsa_2018.rsa_kuitansi.kode_akun5digit \"\n . \"AND rba_2018.akun_belanja.kode_akun = rsa_2018.rsa_kuitansi.kode_akun \"\n . \"AND rba_2018.akun_belanja.sumber_dana = rsa_2018.rsa_kuitansi.sumber_dana \"\n . \"WHERE rsa_2018.rsa_kuitansi.kode_unit = '{$data['kode_unit_subunit']}' \"\n . \"AND rsa_2018.rsa_kuitansi.jenis = 'L3' \"\n . \"AND ( \" . $str_ . \" ) \"\n . \"AND rsa_2018.rsa_kuitansi.tahun = '{$data['tahun']}' \"\n . \"GROUP BY SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,10),SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,19,5) \"\n . \"ORDER BY SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,10) ASC,SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,19,5) ASC\";\n\n // echo $str;die;\n// var_dump($str);die;\n\n $q = $this->db->query($str);\n // var_dump($q->num_rows());die;\n if($q->num_rows() > 0){\n return $q->result();\n }else{\n return '';\n }\n }", "public function getGrafikSarpras()\n {\n $tgl_skrg = Time::now('Asia/Jakarta')->toDateString();\n $id_jad = $this->db->table('jadwal')->select('id_jadwal')->get()->getResultArray();\n $id_kat = $this->db->table('jadwal')->get()->getRowArray();\n\n if ($id_jad == NULL) {\n \n $grafik_sarpras = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal')\n ->where('pertanyaan.id_unit', 2)->get()->getResultArray();\n\n }elseif (($id_kat['tgl_mulai'] <= $tgl_skrg) && ($id_kat['tgl_akhir'] >= $tgl_skrg)){\n\n $grafik_sarpras = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('jadwal.tgl_mulai <=', $tgl_skrg)->where('jadwal.tgl_akhir >=', $tgl_skrg)\n ->where('pertanyaan.id_unit', 2)\n ->get()->getResultArray();\n }else {\n $row =$this->db->table('jadwal')->limit(1)->orderBy('id_jadwal',\"DESC\")->get()->getRowArray();\n $roow = $row['id_jadwal'];\n\n $grafik_sarpras = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal', $roow)\n ->where('pertanyaan.id_unit', 2)->get()->getResultArray();\n } \n\n $sangatBaik = 0;\n $baik = 0;\n $tidakBaik = 0;\n $sangatTidakBaik = 0;\n foreach ($grafik_sarpras as $grafik):\n if ($grafik['opsi'] == \"Sangat Baik\") {\n $sangatBaik = $sangatBaik + 1;\n }\n elseif($grafik['opsi'] == \"Baik\"){\n $baik = $baik + 1;\n }\n elseif($grafik['opsi'] == \"Tidak Baik\"){\n $tidakBaik = $tidakBaik + 1;\n }\n elseif($grafik['opsi'] == \"Sangat Tidak Baik\"){\n $sangatTidakBaik = $sangatTidakBaik + 1;\n }\n endforeach;\n\n $data = [$sangatBaik, $baik, $tidakBaik, $sangatTidakBaik];\n return $data;\n }", "public function ambil_pendapatan_l(){\n $data = \"SELECT * from keu_pendapatan_lainnya pl\n JOIN keu_tahun_kepengurusan tk ON pl.thnkepengurusan_id = tk.id_thnkepengurusan\n WHERE tk.aktif = 'Y'\n ORDER BY pl.tanggal_pl ASC\";\n return $this->db->query($data)->result();\n\n }", "function provjeri_oglase(){\n\t\tglobal $db;\n\t\t$oglasi = $db->query(\"SELECT * FROM jf_oglasi WHERE status=1\");\n\t\twhile($podatak = $oglasi->fetch_assoc()){\n\t\t\tif (date(\"d-m-Y\", strtotime($podatak['konkurs_end'])) < date(\"d-m-Y\")){\n\t\t\t\t$db->query(\"UPDATE jf_oglasi SET status=0 WHERE id={$podatak['id']}\");\n\t\t\t}\n\t\t}\n\t}", "function listQueryHitLembur($r_periode) {\n $sql = \"select g.*,p.nip,\" . static::schema . \".f_namalengkap(p.gelardepan,p.namadepan,p.namatengah,p.namabelakang,p.gelarbelakang) as namapegawai,\n\t\t\t\t\tu.namaunit,pd.namapendidikan,t.tipepeg||' - '||j.jenispegawai as namajenispegawai \n\t\t\t\t\tfrom \" . static::table('ga_upahlembur') . \" g\n\t\t\t\t\tleft join \" . static::table('ga_historydatagaji') . \" h on h.idpeg = g.idpegawai and h.gajiperiode = g.periodegaji\n\t\t\t\t\tleft join \" . static::table('ms_pegawai') . \" p on p.idpegawai = h.idpeg\n\t\t\t\t\tleft join \" . static::table('ms_tipepeg') . \" t on t.idtipepeg = h.idtipepeg\n\t\t\t\t\tleft join \" . static::table('ms_jenispeg') . \" j on j.idjenispegawai = h.idjenispegawai\n\t\t\t\t\tleft join \" . static::table('ms_unit') . \" u on u.idunit = h.idunit\n\t\t\t\t\tleft join \" . static::table('lv_jenjangpendidikan') . \" pd on pd.idpendidikan = h.pendidikan\";\n\n return $sql;\n }", "function info_rekening($nomor_rekening) {\n global $conn; //memanggil global variabel koneksi\n //melakukan select di tabel rekening dan dijoin dengan nama pemilik rekening tersebut berdasarkan nama-pengguna yang dimiliki rekening\n //saldo diperoleh dari tabel transaksi dengan rumus (total pemasukan)-(total pengeluaran) sbb:\n //pemasukan = saldo awal (kode 0) dan ditrasferi orang (kode 1 dengan nomor tujuan si rekening tersebut)\n //pengeluaran = melakukan transfer ke orang lain (kode 1 dengan rekening asal si rekening tersebut)\n $q = $conn->prepare(\"SELECT *, IFNULL((SELECT SUM(nominal) FROM transaksi WHERE rekening_asal=r.nomor_rekening AND jenis_transaksi='0'), 0) + IFNULL((SELECT SUM(nominal) FROM transaksi WHERE rekening_tujuan=r.nomor_rekening AND jenis_transaksi='1'), 0) - IFNULL((SELECT SUM(nominal) FROM transaksi WHERE rekening_asal=r.nomor_rekening AND jenis_transaksi='1'), 0)'saldo' FROM rekening r JOIN pengguna p ON r.nama_pengguna=p.nama_pengguna WHERE r.nomor_rekening='$nomor_rekening'\");\n $q->execute();\n return @$q->fetchAll()[0]; //return array 1 dimensi dari hasil tersebut/false jika tidak ada\n}", "private function ajustarDataReporte()\r\n\t\t{\r\n\t\t\tself::setConexion();\r\n\t\t\t$this->_conn->open();\r\n\t\t\t$this->_transaccion = $this->_conn->beginTransaction();\r\n\r\n\t\t\t$tabla = $this->tableName();\r\n\r\n\t\t\t//lapso=2 and ano_impositivo<year(fecha_pago) and impuesto=9 and fecha_pago>='2014-06-01\r\n\t\t\t$sql = \"UPDATE {$tabla} SET codigo=301035900, nombre_impuesto='Deuda Morosa Por Tasas'\r\n\t\t\t WHERE lapso=2 AND ano_impositivo<year(fecha_pago) AND impuesto=9 AND fecha_pago>='2014-06-01'\";\r\n\r\n\t\t\t$result = $this->_conn->createCommand($sql)->execute();\r\n\t\t\tif ( $result ) {\r\n\t\t\t\t$this->_transaccion->commit();\r\n\t\t\t} else {\r\n\t\t\t\t$this->_transaccion->rollBack();\r\n\t\t\t}\r\n\t\t\t$this->_conn->close();\r\n\t\t\treturn $result;\r\n\t\t}", "function rekap_prognosis() {\r\n\r\n$res_x = db_query('UPDATE prognosisskpd set realisasi=0, prognosis=0');\r\n\r\n$res_uk = db_query(\"select kodeuk from {unitkerja} order by kodeuk\");\r\nforeach ($res_uk as $data_uk) {\r\n\r\n\t$res_data = db_query('SELECT jurnal.kodeuk, LEFT(jurnalitem.kodero, 5) as kodeo, SUM(jurnalitem.debet-jurnalitem.kredit) as realisasi FROM jurnalitem inner join jurnal on jurnalitem.jurnalid=jurnal.jurnalid WHERE LEFT(jurnalitem.kodero,1)=:akun and \r\n\t\t\tMONTH(jurnal.tanggal)<=6 AND jurnal.kodeuk=:kodeuk GROUP BY jurnal.kodeuk, LEFT(jurnalitem.kodero, 5)', array(':akun'=>'5', ':kodeuk'=>$data_uk->kodeuk));\r\n\tforeach ($res_data as $data) {\r\n\t\t\r\n\t\tdb_update('prognosisskpd')\r\n\t\t->fields(array( \r\n\t\t\t\t'realisasi' => $data->realisasi,\r\n\t\t\t\t))\r\n\t\t->condition(\"kodeo\", $data->kodeo, '=')\r\n\t\t->condition(\"kodeuk\", $data_uk->kodeuk, '=')\t\t\r\n\t\t->execute();\r\n\r\n\t\t\r\n\t}\r\n\t$res_data = db_query('SELECT jurnal.kodeuk, LEFT(jurnalitem.kodero, 5) as kodeo, SUM(jurnalitem.kredit-jurnalitem.debet) as realisasi \r\n\t\t\tFROM jurnalitem inner join jurnal on jurnalitem.jurnalid=jurnal.jurnalid WHERE LEFT(jurnalitem.kodero,1)=:akun and \r\n\t\t\tMONTH(jurnal.tanggal)<=6 AND jurnal.kodeuk=:kodeuk GROUP BY jurnal.kodeuk, LEFT(jurnalitem.kodero, 5)', array(':akun'=>'4', ':kodeuk'=>$data_uk->kodeuk));\r\n\tforeach ($res_data as $data) {\r\n\t\t\r\n\t\tdb_update('prognosisskpd')\r\n\t\t->fields(array( \r\n\t\t\t\t'realisasi' => $data->realisasi,\r\n\t\t\t\t))\r\n\t\t->condition(\"kodeo\", $data->kodeo, '=')\r\n\t\t->condition(\"kodeuk\", $data_uk->kodeuk, '=')\t\t\r\n\t\t->execute();\r\n\r\n\t\t\r\n\t}\r\n\t\r\n\tif ($data_uk->kodeuk=='00') {\r\n\t\t$res_data = db_query('SELECT jurnal.kodeuk, LEFT(jurnalitem.kodero, 5) as kodeo, SUM(jurnalitem.debet-jurnalitem.kredit) as realisasi \r\n\t\t\t\tFROM jurnalitem inner join jurnal on jurnalitem.jurnalid=jurnal.jurnalid WHERE LEFT(jurnalitem.kodero,2)=:akun and \r\n\t\t\t\tMONTH(jurnal.tanggal)<=6 AND jurnal.kodeuk=:kodeuk GROUP BY jurnal.kodeuk, LEFT(jurnalitem.kodero, 5)', array(':akun'=>'62', ':kodeuk'=>$data_uk->kodeuk));\r\n\t\tforeach ($res_data as $data) {\r\n\t\t\t\r\n\t\t\tdb_update('prognosisskpd')\r\n\t\t\t->fields(array( \r\n\t\t\t\t\t'realisasi' => $data->realisasi,\r\n\t\t\t\t\t))\r\n\t\t\t->condition(\"kodeo\", $data->kodeo, '=')\r\n\t\t\t->condition(\"kodeuk\", $data_uk->kodeuk, '=')\t\t\r\n\t\t\t->execute();\r\n\r\n\r\n\t\t\t\r\n\t\t}\r\n\t\t$res_data = db_query('SELECT jurnal.kodeuk, LEFT(jurnalitem.kodero, 5) as kodeo, SUM(jurnalitem.kredit-jurnalitem.debet) as realisasi \r\n\t\t\t\tFROM jurnalitem inner join jurnal on jurnalitem.jurnalid=jurnal.jurnalid WHERE LEFT(jurnalitem.kodero,2)=:akun and \r\n\t\t\t\tMONTH(jurnal.tanggal)<=6 AND jurnal.kodeuk=:kodeuk GROUP BY jurnal.kodeuk, LEFT(jurnalitem.kodero, 5)', array(':akun'=>'61', ':kodeuk'=>$data_uk->kodeuk));\r\n\t\tforeach ($res_data as $data) {\r\n\t\t\t\r\n\t\t\tdb_update('prognosisskpd')\r\n\t\t\t->fields(array( \r\n\t\t\t\t\t'realisasi' => $data->realisasi,\r\n\t\t\t\t\t))\r\n\t\t\t->condition(\"kodeo\", $data->kodeo, '=')\r\n\t\t\t->condition(\"kodeuk\", $data_uk->kodeuk, '=')\t\t\r\n\t\t\t->execute();\r\n\r\n\r\n\t\t\t\r\n\t\t}\t\t\r\n\t}\r\n}\r\n\r\n$res_x = db_query('UPDATE prognosisskpd SET sisa=anggaran-realisasi');\r\n\r\n$res_x = db_query('UPDATE prognosisskpd inner join prognosis ON prognosisskpd.kodeo=prognosis.kodeo SET prognosisskpd.persen=prognosis.persen');\r\n$res_x = db_query('UPDATE prognosisskpd SET prognosis=(persen/100)*sisa');\r\n\r\n$res_x = db_query('UPDATE prognosisskpd SET sisa=0 WHERE sisa<0');\r\n$res_x = db_query('UPDATE prognosisskpd SET prognosis=realisasi WHERE prognosis<=0');\r\n\r\n//KAB*\r\n$res_x = db_query('UPDATE prognosiskab set realisasi=0, prognosis=0');\r\n\r\n$res_data = db_query('SELECT LEFT(jurnalitem.kodero, 5) as kodeo, SUM(jurnalitem.debet-jurnalitem.kredit) as realisasi FROM jurnalitem inner join jurnal on jurnalitem.jurnalid=jurnal.jurnalid WHERE LEFT(jurnalitem.kodero,1)=:akun and MONTH(jurnal.tanggal)<=6 GROUP BY LEFT(jurnalitem.kodero, 5)', array(':akun'=>'5'));\r\nforeach ($res_data as $data) {\r\n\t\r\n\tdb_update('prognosiskab')\r\n\t->fields(array( \r\n\t\t\t'realisasi' => $data->realisasi,\r\n\t\t\t))\r\n\t->condition(\"kodeo\", $data->kodeo, '=')\r\n\t->execute();\r\n\r\n\t\r\n}\r\n$res_data = db_query('SELECT LEFT(jurnalitem.kodero, 5) as kodeo, SUM(jurnalitem.kredit-jurnalitem.debet) as realisasi \r\n\t\tFROM jurnalitem inner join jurnal on jurnalitem.jurnalid=jurnal.jurnalid WHERE LEFT(jurnalitem.kodero,1)=:akun and \r\n\t\tMONTH(jurnal.tanggal)<=6 GROUP BY LEFT(jurnalitem.kodero, 5)', array(':akun'=>'4'));\r\nforeach ($res_data as $data) {\r\n\t\r\n\tdb_update('prognosiskab')\r\n\t->fields(array( \r\n\t\t\t'realisasi' => $data->realisasi,\r\n\t\t\t))\r\n\t->condition(\"kodeo\", $data->kodeo, '=')\r\n\t->execute();\r\n\r\n\t\r\n}\r\n\r\n$res_data = db_query('SELECT LEFT(jurnalitem.kodero, 5) as kodeo, SUM(jurnalitem.debet-jurnalitem.kredit) as realisasi \r\n\t\tFROM jurnalitem inner join jurnal on jurnalitem.jurnalid=jurnal.jurnalid WHERE LEFT(jurnalitem.kodero,2)=:akun and \r\n\t\tMONTH(jurnal.tanggal)<=6 AND LEFT(jurnalitem.kodero, 5)', array(':akun'=>'62'));\r\nforeach ($res_data as $data) {\r\n\t\r\n\tdb_update('prognosiskab')\r\n\t->fields(array( \r\n\t\t\t'realisasi' => $data->realisasi,\r\n\t\t\t))\r\n\t->condition(\"kodeo\", $data->kodeo, '=')\r\n\t->execute();\r\n\r\n\r\n\t\r\n}\r\n$res_data = db_query('SELECT LEFT(jurnalitem.kodero, 5) as kodeo, SUM(jurnalitem.kredit-jurnalitem.debet) as realisasi \r\n\t\tFROM jurnalitem inner join jurnal on jurnalitem.jurnalid=jurnal.jurnalid WHERE LEFT(jurnalitem.kodero,2)=:akun and \r\n\t\tMONTH(jurnal.tanggal)<=6 GROUP BY LEFT(jurnalitem.kodero, 5)', array(':akun'=>'61'));\r\nforeach ($res_data as $data) {\r\n\t\r\n\tdb_update('prognosiskab')\r\n\t->fields(array( \r\n\t\t\t'realisasi' => $data->realisasi,\r\n\t\t\t))\r\n\t->condition(\"kodeo\", $data->kodeo, '=')\r\n\t->execute();\r\n\r\n\r\n\t\r\n}\t\r\n\r\n$res_x = db_query('UPDATE prognosiskab SET sisa=anggaran-realisasi');\r\n\r\n$res_x = db_query('UPDATE prognosiskab inner join prognosis ON prognosiskab.kodeo=prognosis.kodeo SET prognosiskab.persen=prognosis.persen');\r\n$res_x = db_query('UPDATE prognosiskab SET prognosis=(persen/100)*sisa');\r\n\r\n$res_x = db_query('UPDATE prognosiskab SET sisa=0 WHERE sisa<0');\r\n$res_x = db_query('UPDATE prognosiskab SET prognosis=realisasi WHERE prognosis<=0');\t\r\n\t\r\n}", "function lg_add_debate($liga_id, $debata_id) {\n\t// neresi transakce, vraci true/false\n\t\n\t$status = true;\n\t\n\t$status &= cpdb_fetch_one_row(\"\n\t\tselect\n\t\t\tvitez,\n\t\t\tpresvedcive,\n\t\t\tdt_aff.tym_ID as aff_ID,\n\t\t\tdt_neg.tym_ID as neg_ID,\n\t\t\t(\n\t\t\t\tselect avg(liga_vytezek) / 2\n\t\t\t\tfrom debata_tym\n\t\t\t\twhere tym_ID = dt_aff.tym_ID\n\t\t\t\t\tand debata_ID in (select debata_ID from turnaj, debata where turnaj.liga_ID = :liga_id and turnaj.turnaj_ID = debata.turnaj_ID)\n\t\t\t) as aff_koef,\n\t\t\t(\n\t\t\t\tselect avg(liga_vytezek) / 2\n\t\t\t\tfrom debata_tym\n\t\t\t\twhere tym_ID = dt_neg.tym_ID\n\t\t\t\t\tand debata_ID in (select debata_ID from turnaj, debata where turnaj.liga_ID = :liga_id and turnaj.turnaj_ID = debata.turnaj_ID)\n\t\t\t) as neg_koef\n\t\tfrom\n\t\t\tdebata\n\t\t\tleft join debata_tym dt_aff on dt_aff.debata_ID = debata.debata_ID and dt_aff.pozice = 1\n\t\t\tleft join debata_tym dt_neg on dt_neg.debata_ID = debata.debata_ID and dt_neg.pozice = 0\n\t\twhere\n\t\t\tdebata.debata_ID = :debata_id\n\t\", array(\":liga_id\"=>$liga_id, \":debata_id\"=>$debata_id), $debata);\n\t\n\tif ($debata[\"aff_koef\"] === NULL) { $debata[\"aff_koef\"] = 25; }\n\tif ($debata[\"neg_koef\"] === NULL) { $debata[\"neg_koef\"] = 25; }\n\t\n\tif ($debata[\"vitez\"] == DRES_DRAW) {\n\t\t// draw debate in league --> illegal\n\t\tpg_achtung(sprintf($lang[\"debate %s ended up in draw, that is illegal in a league\"], $debata_id));\n\t\t$status &= cpdb_exec(\"update debata_tym set liga_vytezek = 0 where debata_ID = :debata_id\", array(\":debata_id\"=>$debata_id));\n\t\treturn $status;\n\t}\n\t\n\t// all ok, go by normal rules\n\t$rezultat_aff = ($debata[\"vitez\"]) ? (40 + 10 * $debata[\"presvedcive\"]) : (10 * (1 - $debata[\"presvedcive\"]));\n\t$rezultat_neg = 50 - $rezultat_aff;\n\t\n\t// update vytezku\n\t$status &= cpdb_exec(\"update debata_tym set liga_vytezek = :vytezek where debata_ID = :debata_id and tym_ID = :tym_id\", array(\":debata_id\"=>$debata_id, \":tym_id\"=>$debata[\"aff_ID\"], \":vytezek\"=>$rezultat_aff + $debata[\"neg_koef\"]));\n\t$status &= cpdb_exec(\"update debata_tym set liga_vytezek = :vytezek where debata_ID = :debata_id and tym_ID = :tym_id\", array(\":debata_id\"=>$debata_id, \":tym_id\"=>$debata[\"neg_ID\"], \":vytezek\"=>$rezultat_neg + $debata[\"aff_koef\"]));\n\t\n\treturn $status;\n}", "function m_tampil_soal_terisi($where, $nipg, $id_sub){\n\t\t$data = $this->db->query(\"SELECT\n\t\trk.jawaban, rk.id_kuesioner, rk.id_sub,\n\t\trk.id_sk, sk.soal_kuesioner\n\t\tFROM tb_respon_kuesioner as rk\n\t\tJOIN tb_soal_kuesioner as sk\n\t\tON rk.id_sk = sk.id_sk\n\t\tWHERE rk.id_kuesioner = $where AND rk.nipg = $nipg AND rk.id_sub = $id_sub\n\t\t\");\n\t\treturn $data;\n\t}", "function get_umur($no_medrec){\n\t\t\treturn $this->db->query(\"select datediff(now(),tgl_lahir) as umurday from data_pasien where no_medrec='$no_medrec'\");\n\t\t}", "public function getGrafikTotal()\n {\n $tgl_skrg = Time::now('Asia/Jakarta')->toDateString();\n $id_jad = $this->db->table('jadwal')->select('id_jadwal')->get()->getRowArray();\n $id_kat = $this->db->table('jadwal')->get()->getRowArray();\n \n \n if ($id_jad == NULL) {\n\n $grafik_total = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal')\n ->get()->getResultArray();\n\n }elseif (($id_kat['tgl_mulai'] <= $tgl_skrg) && ($id_kat['tgl_akhir'] >= $tgl_skrg)){\n\n $grafik_total = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('jadwal.tgl_mulai <=', $tgl_skrg)->where('jadwal.tgl_akhir >=', $tgl_skrg)\n ->get()->getResultArray();\n }else {\n $row =$this->db->table('jadwal')->limit(1)->orderBy('id_jadwal',\"DESC\")->get()->getRowArray();\n $roow = $row['id_jadwal'];\n $grafik_total = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal',$roow)\n ->get()->getResultArray();\n } \n\n $sangatBaik = 0;\n $baik = 0;\n $tidakBaik = 0;\n $sangatTidakBaik = 0;\n foreach ($grafik_total as $grafik):\n if ($grafik['opsi'] == \"Sangat Baik\") {\n $sangatBaik = $sangatBaik + 1;\n }\n elseif($grafik['opsi'] == \"Baik\"){\n $baik = $baik + 1;\n }\n elseif($grafik['opsi'] == \"Tidak Baik\"){\n $tidakBaik = $tidakBaik + 1;\n }\n elseif($grafik['opsi'] == \"Sangat Tidak Baik\"){\n $sangatTidakBaik = $sangatTidakBaik + 1;\n }\n endforeach;\n\n $data = [$sangatBaik, $baik, $tidakBaik, $sangatTidakBaik];\n return $data;\n }", "function getDataSingkatPrakt($conn,$key,$pengajar=true,$nip='') {\n\t\t\t$sql = \"select k.thnkurikulum, k.kodemk, k.kodeunit, k.periode, k.kelasmk, k.koderuang,\n\t\t\t\t\tk.nohari, k.jammulai, k.jamselesai, c.namamk\n\t\t\t\t\tfrom \".static::table('ak_kelaspraktikum').\" k join \".static::table('ak_kurikulum').\" c using (thnkurikulum,kodemk,kodeunit)\n\t\t\t\t\twhere \".static::getCondition($key,null,'k');\n\t\t\t$row = $conn->GetRow($sql);\n\t\t\t\n\t\t\t$row['jadwal'] = Date::indoDay($row['nohari']).', '.CStr::formatjam($row['jammulai']).' - '.CStr::formatjam($row['jamselesai']);\n\t\t\t//$row['jadwal2'] = Date::indoDay($row['nohari2']).', '.CStr::formatjam($row['jammulai2']).' - '.CStr::formatjam($row['jamselesai2']);\n\t\t\t\t\n\t\t\t// ambil data pengajar\n\t\t\tif($pengajar) {\n\t\t\t\t$sql = \"select p.idpegawai::text as nipdosen, akademik.f_namalengkap(p.gelardepan,p.namadepan,p.namatengah,p.namabelakang,p.gelarbelakang) as nama from \".static::table('ak_mengajar').\" a\n\t\t\t\t\t\tjoin sdm.ms_pegawai p on a.nipdosen::text = p.idpegawai::text\n\t\t\t\t\t\twhere \".static::getCondition($key,null,'a').\" order by a.nipdosen\";\n\t\t\t\t$rs = $conn->Execute($sql);\n\t\t\t\t\n\t\t\t\t$a_ajar = array();\n\t\t\t\twhile($rowa = $rs->FetchRow())\n\t\t\t\t\t$a_ajar[] = $rowa['nama'].' ('.$rowa['nipdosen'].')';\n\t\t\t\t\n\t\t\t\t$row['pengajar'] = implode('<br>',$a_ajar);\n\t\t\t}\n\t\t\tif(!empty($nip)){\n\t\t\t\t$sql = \"select idpegawai::text as nik, akademik.f_namalengkap(gelardepan,namadepan,namatengah,namabelakang,gelarbelakang) as nama \n\t\t\t\t\t\tfrom sdm.ms_pegawai where nik='$nip' or idpegawai::text='$nip'\";\n\t\t\t\t$rs=$conn->GetRow($sql);\n\t\t\t\t$row['pengajar'] =$rs['nama'].\" (\".$rs['nik'].\")\";\n\t\t\t}\n\t\t\treturn $row;\n\t\t}", "function data_jumlah_siswa(){\n $this->db->select('s.id as idsiswa,s.namaDepan,s.namaBelakang,s.alamat,s.noKontak,s.namaSekolah,s.alamatSekolah,s.penggunaID,p.namaPengguna,p.eMail');\n $this->db->join('tb_pengguna p', 's.penggunaID = p.id');\n $this->db->where('s.status','1');\n $this->db->where('p.status','1');\n $this->db->order_by('s.namaDepan', 'asc');\n return $query = $this->db->get('tb_siswa s')->num_rows(); \n }", "function duree_star(){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->query(\"SELECT TIMEDIFF(MINUTE(CURRENT_TIMESTAMP),MINUTE(date_star)) FROM utilisateur WHERE star = TRUE\");\n\n\t\t$result = $req->$fetchAll();\n\n\t\t$req->closeCursor();\n\t\treturn $result;\n\t}", "function perpraktikum($mhsw, $khs, $bipot, $ada, $pmbmhswid=1) {\r\n // Jumlah Matakuliah praktikum/responsi yg diambil mhsw. \r\n $jml = GetaField('krstemp k left outer join jadwal j on k.JadwalID=j.JadwalID', \r\n \"k.TahunID='$khs[TahunID]' and k.MhswID='$mhsw[MhswID]' and j.JenisJadwalID\", \r\n 'R', \"count(*)\") *2;\r\n if (($jml == 0) and (empty($mhsw['MhswID']))) $jml = 2;\r\n $totharga = $bipot['Jumlah'];\r\n if (empty($ada) && ($totharga > 0)) {\r\n $s0 = \"insert into bipotmhsw(PMBID, MhswID, TahunID, BIPOT2ID, BIPOTNamaID,\r\n PMBMhswID, TrxID, Jumlah, Besar, Catatan,\r\n LoginBuat, TanggalBuat)\r\n values('$mhsw[PMBID]', '$mhsw[MhswID]', '$khs[TahunID]', '$bipot[BIPOT2ID]', '$bipot[BIPOTNamaID]',\r\n '$pmbmhswid', '$bipot[TrxID]', $jml, '$totharga', '$mk',\r\n '$_SESSION[_Login]', now())\";\r\n $r0 = _query($s0);\r\n }\r\n else {\r\n $s0 = \"update bipotmhsw set Jumlah=$jml, Besar='$totharga',\r\n PMBMhswID='$pmbmhswid',\r\n Catatan='Total SKS: $totsks',\r\n LoginEdit='$_SESSION[_Login]', TanggalEdit=now()\r\n where BIPOTMhswID='$ada[BIPOTMhswID]' \";\r\n $r0 = _query($s0);\r\n }\r\n}", "public function aktifStatusFinalisasi()\n\t{\n\t\t$this->load->database();\n\t\t$query = $this->db->query\n\t\t\t\t(\"\n\t\t\t\t\tUPDATE psb_calonsiswa\n\t\t\t\t\tSET statusfinalisasi = 'y'\n\t\t\t\t\tWHERE \n\t\t\t\t\t\tnopendaftaran = '$this->nopendaftaran'\t\n\t\t\t\t\");\n\t\t$this->db->close();\n\t\treturn $query;\n\t}", "public function index()\n {\n if (Auth::check()) {\n $data_user = Auth::user();\n if ($data_user->level == 1) {\n $nama_faskes = $data_user->load('nama_faskes');\n $now = Carbon::now()->toDateString();\n $twoDays = Carbon::now()->addDays(2)->toDateString();\n $oneDays = Carbon::now()->addDays(1)->toDateString();\n $sekarang = Carbon::now()->toDateString();\n // print_r($twoDays);exit;\n\n $count_notification = DB::table('jadwal_perjanjians')\n ->join('kartu_pengobatans', 'kartu_pengobatans.id', '=', 'jadwal_perjanjians.kartu_pengobatan_id')\n ->join('daftar_terdugas', 'daftar_terdugas.id', '=', 'kartu_pengobatans.pasien_id')\n ->select('jadwal_perjanjians.*')\n ->whereBetween('jadwal_perjanjians.tanggal_harus_kembali', [$now,$twoDays])\n ->where('jadwal_perjanjians.deleted_at', null)\n ->count(); \n\n if (empty($data_user)) {\n return redirect('/');\n }\n $pasiens = DaftarTerduga::all();\n $dokters = Dokter::all();\n $faskes = faskes::where('id',$data_user->faskes_id)->first();\n\n $list_min_duas = JadwalPerjanjian::where('tanggal_harus_kembali',$twoDays)->with('kartu_pengobatan.daftar_terduga.nama_faskes')->get();\n $list_min_satus = JadwalPerjanjian::where('tanggal_harus_kembali',$oneDays)->with('kartu_pengobatan.daftar_terduga.nama_faskes')->get();\n $list_min_nows = JadwalPerjanjian::where('tanggal_harus_kembali',$sekarang)->with('kartu_pengobatan.daftar_terduga.nama_faskes')->get();\n \n return view('tb05.permohonan_lab',compact('pasiens','nama_faskes','faskes','dokters','data_user','notification','count_notification','list_min_nows','list_min_satus','list_min_duas'));\n }else{\n $nama_faskes = $data_user->load('nama_faskes');\n $now = Carbon::now()->toDateString();\n $twoDays = Carbon::now()->addDays(2)->toDateString();\n $oneDays = Carbon::now()->addDays(1)->toDateString();\n $sekarang = Carbon::now()->toDateString();\n // print_r($twoDays);exit;\n\n $count_notification = DB::table('jadwal_perjanjians')\n ->join('kartu_pengobatans', 'kartu_pengobatans.id', '=', 'jadwal_perjanjians.kartu_pengobatan_id')\n ->join('daftar_terdugas', 'daftar_terdugas.id', '=', 'kartu_pengobatans.pasien_id')\n ->select('jadwal_perjanjians.*')\n ->whereBetween('jadwal_perjanjians.tanggal_harus_kembali', [$now,$twoDays])\n ->where('daftar_terdugas.faskes_id', $data_user->faskes_id)\n ->where('jadwal_perjanjians.deleted_at', null)\n ->count(); \n\n if (empty($data_user)) {\n return redirect('/');\n }\n $pasiens = DaftarTerduga::where('faskes_id',$data_user->faskes_id)->get();\n $dokters = Dokter::all();\n $faskes = faskes::where('id',$data_user->faskes_id)->first();\n\n $list_min_duas = JadwalPerjanjian::where('tanggal_harus_kembali',$twoDays)->with('kartu_pengobatan.daftar_terduga.nama_faskes')->get();\n $list_min_satus = JadwalPerjanjian::where('tanggal_harus_kembali',$oneDays)->with('kartu_pengobatan.daftar_terduga.nama_faskes')->get();\n $list_min_nows = JadwalPerjanjian::where('tanggal_harus_kembali',$sekarang)->with('kartu_pengobatan.daftar_terduga.nama_faskes')->get();\n \n return view('tb05.permohonan_lab',compact('pasiens','nama_faskes','faskes','dokters','data_user','notification','count_notification','list_min_nows','list_min_satus','list_min_duas'));\n \n }\n }else{\n return redirect('/');\n }\n \n }", "function get_limit_datapencarian($tahun, $bulan, $id_puskesmas) {\n $this->db->group_by('persediaan.kode');\n // $this->db->order_by($this->id, $this->order);\n // $this->db->like('id_persediaan', $q);\n/* $this->db->or_like('persediaan.id_puskesmas', $q);\n $this->db->or_like('persediaan.kode', $q);\n $this->db->or_like('stok', $q);*/\n // $this->db->limit($limit, $start);\n\n $this->db->select('*');\n $this->db->select('persediaan.id_persediaan, persediaan.kode, obat.nama_obat, SUM(persediaan.persediaan) AS persediaan');\n $this->db->join('puskesmas', 'puskesmas.id_puskesmas=persediaan.id_puskesmas');\n $this->db->join('obat', 'obat.kode=persediaan.kode');\n if ($id_puskesmas==0 && $bulan==\"all\"){\n $this->db->where('persediaan.tahun',$tahun);\n }elseif ($id_puskesmas==0 && $bulan!=\"all\") {\n $this->db->where('persediaan.bulan',$bulan);\n $this->db->where('persediaan.tahun',$tahun);\n }elseif ($id_puskesmas!=0 && $bulan==\"all\") {\n $this->db->where('persediaan.tahun',$tahun);\n $this->db->where('persediaan.id_puskesmas',$id_puskesmas);\n }else{\n $this->db->where('persediaan.tahun',$tahun);\n $this->db->where('persediaan.bulan',$bulan);\n $this->db->where('persediaan.id_puskesmas',$id_puskesmas);\n }\n return $this->db->get($this->table)->result();\n }", "public function ambil_pendapatan_d(){\n $data = \"SELECT d.nama_donatur,p.*\n from keu_pendapatan_donatur as p left join keu_donatur as d on p.id_donatur = d.id_donatur\n JOIN keu_tahun_kepengurusan tk ON d.thnkepengurusan_id = tk.id_thnkepengurusan\n WHERE tk.aktif = 'Y'\";\n return $this->db->query($data)->result();\n }", "public function Stat_Tahun()\n {\n $query = $this->db->query(\"SELECT YEAR(tanggal) AS tahun, COUNT(*) AS jumtahun FROM ticket\n GROUP BY YEAR(tanggal)\");\n return $query;\n }", "function getDataSingkat($conn,$key,$pengajar=true,$nip='') {\n\t\t\t$sql = \"select k.thnkurikulum, k.kodemk, c.namamk, k.kodeunit, k.periode, k.kelasmk, k.koderuang,\n\t\t\t\t\tk.nohari, k.jammulai, k.jamselesai, k.nohari2, k.jammulai2, k.jamselesai2, k.nilaimasuk, k.kuncinilai,\n\t\t\t\t\tk.dayatampung,k.jumlahpeserta,k.isonline\n\t\t\t\t\tfrom \".static::table().\" k join \".static::table('ak_kurikulum').\" c using (thnkurikulum,kodemk,kodeunit)\n\t\t\t\t\twhere \".static::getCondition($key,null,'k');\n\t\t\t$row = $conn->GetRow($sql);\n\t\t\t\n\t\t\t$row['jadwal'] = Date::indoDay($row['nohari']).', '.CStr::formatjam($row['jammulai']).' - '.CStr::formatjam($row['jamselesai']);\n\t\t\t$row['jadwal2'] = Date::indoDay($row['nohari2']).', '.CStr::formatjam($row['jammulai2']).' - '.CStr::formatjam($row['jamselesai2']);\n\t\t\t\n\t\t\t// ambil data pengajar\n\t\t\tif($pengajar) {\n\t\t\t\t$sql = \"select p.idpegawai::text as nipdosen, akademik.f_namalengkap(p.gelardepan,p.namadepan,p.namatengah,p.namabelakang,p.gelarbelakang) as nama from \".static::table('ak_mengajar').\" a\n\t\t\t\t\t\tjoin sdm.ms_pegawai p on a.nipdosen::text = p.idpegawai::text\n\t\t\t\t\t\twhere \".static::getCondition($key,null,'a').\" order by a.nipdosen\";\n\t\t\t\t$rs = $conn->Execute($sql);\n\t\t\t\t\n\t\t\t\t$a_ajar = array();\n\t\t\t\twhile($rowa = $rs->FetchRow())\n\t\t\t\t\t$a_ajar[] = $rowa['nama'];\n\t\t\t\t\n\t\t\t\t$row['pengajar'] = implode('<br>',$a_ajar);\n\t\t\t}\n\t\t\tif(!empty($nip)){\n\t\t\t\t$sql = \"select idpegawai::text as nik, akademik.f_namalengkap(gelardepan,namadepan,namatengah,namabelakang,gelarbelakang) as nama \n\t\t\t\t\t\tfrom sdm.ms_pegawai where nik='$nip' or idpegawai::text='$nip'\";\n\t\t\t\t$rs=$conn->GetRow($sql);\n\t\t\t\t$row['pengajar'] =$rs['nama'];\n\t\t\t}\n\t\t\treturn $row;\n\t\t}", "function hitung_kp()\n {\n $query = $this->db->query(\"SELECT\n COUNT(id_pegawai) as jumlah_pejabat\n FROM data_kp_notif\n WHERE selisih <= 100 AND notifikasi = 'aktif' \");\n\n return $query->result();\n }", "function editPribadi($id,$status=''){\n // //$sql_cari = \"SELECT a.*,b.camat_kode,(((upper((a.wp_wr_jenis)::text) || '.'::text || (a.wp_wr_no_form)::text) || '.'::text || (b.camat_kode)::text) || '.'::text || (c.lurah_kode)::text) AS npwprd FROM wp_wr a, kecamatan b, kelurahan c WHERE a.wp_wr_kd_camat=b.camat_id::text AND a.wp_wr_kd_lurah = c.lurah_id::text AND a.wp_wr_id=$idedit\";\n // $ar_edit_data = &$db->GetRow($sql_cari );\n // $idcmt = $ar_edit_data[wp_wr_kd_camat];\n // $idlrh = $ar_edit_data[wp_wr_kd_lurah];\n // $qrycmt = \"SELECT * FROM kecamatan WHERE camat_id='$idcmt'\";\n // $ar_cmt = &$db->GetRow($qrycmt);\n // $qrylrh = \"SELECT * FROM kelurahan WHERE lurah_id='$idlrh'\";\n // $ar_lrh = &$db->GetRow($qrylrh);\n\n $kodus = $this->getBidangUsaha();\n $kecamatan = $this->getKecamatan();\n $no_urut = $this->getNomorUrut();\n\n try {\n $rs = DB::select(DB::raw('select a.*,b.camat_kode FROM wp_wr a, kecamatan b WHERE a.wp_wr_kd_camat=b.camat_id::text AND a.wp_wr_id='.$id));\n } catch (Exception $e) {\n \n }\n \n\n // $rs= DB::table('wp_wr as a')\n // ->join('kecamatan as b','a.wp_wr_kd_camat','=','b.camat_id::text')\n // ->select('a.*','b.camat_kode')\n // ->where('a.wp_wr_id',$id)\n // ->get();\n // $qrycmt = \"SELECT * FROM kecamatan WHERE camat_id='$idcmt'\";\n // $ar_cmt = &$db->GetRow($qrycmt);\n // $qrylrh = \"SELECT * FROM kelurahan WHERE lurah_id='$idlrh'\";\n // $ar_lrh = &$db->GetRow($qrylrh);\n \n if(count($rs)>0){\n $ar = (array)$rs[0];\n $cmt = DB::table('kecamatan')\n ->where('camat_id','=',$ar['wp_wr_kd_camat'])\n ->get();\n $lrh = DB::table('kelurahan')\n ->where('lurah_id','=',$ar['wp_wr_kd_lurah'])\n ->get();\n $ar_lrh = (array)$lrh[0];\n $ar_cmt = (array)$cmt[0];\n $arRs = array_merge($ar, ['kodus'=>$kodus, 'kecamatan'=>$kecamatan, 'no_urut' =>$no_urut, 'jenis' => 'Edit','status'=>$status],$ar_lrh,$ar_cmt);\n // echo'<pre>';\n // print_r($arRs);\n // echo'</pre>';\n // exit;\n return view('pendaftaranwpwrpribadi',$arRs);\n } else {\n return redirect()->route('createPribadi',['status'=>-3]);\n }\n }", "public function getGrafikLab()\n {\n $tgl_skrg = Time::now('Asia/Jakarta')->toDateString();\n $id_jad = $this->db->table('jadwal')->select('id_jadwal')->get()->getResultArray();\n $id_kat = $this->db->table('jadwal')->get()->getRowArray(); \n\n if ($id_jad == NULL) {\n \n $grafik_lab = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal')\n ->where('pertanyaan.id_unit', 4)->get()->getResultArray();\n\n }elseif (($id_kat['tgl_mulai'] <= $tgl_skrg) && ($id_kat['tgl_akhir'] >= $tgl_skrg)){\n\n $grafik_lab = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('jadwal.tgl_mulai <=', $tgl_skrg)->where('jadwal.tgl_akhir >=', $tgl_skrg)\n ->where('pertanyaan.id_unit', 4)\n ->get()->getResultArray();\n }else {\n $row =$this->db->table('jadwal')->limit(1)->orderBy('id_jadwal',\"DESC\")->get()->getRowArray();\n $roow = $row['id_jadwal'];\n\n $grafik_lab = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal', $roow)\n ->where('pertanyaan.id_unit', 4)->get()->getResultArray();\n }\n\n $sangatBaik = 0;\n $baik = 0;\n $tidakBaik = 0;\n $sangatTidakBaik = 0;\n foreach ($grafik_lab as $grafik):\n if ($grafik['opsi'] == \"Sangat Baik\") {\n $sangatBaik = $sangatBaik + 1;\n }\n elseif($grafik['opsi'] == \"Baik\"){\n $baik = $baik + 1;\n }\n elseif($grafik['opsi'] == \"Tidak Baik\"){\n $tidakBaik = $tidakBaik + 1;\n }\n elseif($grafik['opsi'] == \"Sangat Tidak Baik\"){\n $sangatTidakBaik = $sangatTidakBaik + 1;\n }\n endforeach;\n\n $data = [$sangatBaik, $baik, $tidakBaik, $sangatTidakBaik];\n return $data;\n }", "function _is_pejabat_penunjang_nt(){\n\t\t$CI \t\t=& get_instance();\n\t\t$kd \t\t= $CI->session->userdata('kd_dosen');\n\t\t$tgl \t\t= date('d-m-Y');\n\t\t$api_url \t= URL_API_SIMPEG1.'simpeg_mix/data_search';\n\t\t$parameter = array('api_kode' =>1121, 'api_subkode' => 3, 'api_search' => array($tgl, $kd, 1));\n\t\t$data = $CI->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\t//print_r ($data);\n\t\t$value = array();\n\t\t//echo $data[count($data)-1]->STR_NAMA;\n\t\tif(!empty($data)){\n\t\t\t//$kd_jab \t= $data[count($data)-1]->STR_ID;\n\t\t\t//ini harusnya yang aktif, bukan yang index 0 ; \n\t\t\tforeach ($data as $d) {\n\t\t\t\t$kd_jab \t= $d->STR_ID;\n\t\t\t\t$api_url \t= URL_API_BKD.'bkd_dosen/jabatan';\n\t\t\t\t$parameter = array('api_kode' =>20000, 'api_subkode' => 1, 'api_search' => array($kd_jab));\n\t\t\t\t$data2 = $CI->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\t\t\tif(!empty($data2)){\n\t\t\t\t\t//$value['nama_jabatan'] = $data[count($data)-1]->STR_NAMA;\n\t\t\t\t\t$value['nama_jabatan'] = $d->STR_NAMA;\n\t\t\t\t\t$value['sks_maks'] = $this->_get_sks_max($d->STR_ID);//$data2[0]->SKS_MAX;\n\t\t\t\t\t$value['bukti_penugasan'] = 'Surat Keputusan';\n\t\t\t\t\t$value['masa_penugasan'] = '1 Tahun';\n\t\t\t\t\t$value['tgl_mulai'] = $d->RR_TANGGAL_MULAI_F;\n\t\t\t\t\t$value['tgl_selesai'] = $d->RR_TANGGAL_AKHIR_F;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn $value;\n\t\t#return $data;\n\t\t\n\t}", "function get_p2hp_dt($daltu) {\n return $this->db->select('*')\n ->from('tb_p2hp')\n //->join('tb_pka', 'tb_pka.id_pka = tb_p2hp.id_pka')\n ->join('tb_penugasan', 'tb_penugasan.id_tugas = tb_p2hp.fk_tgs')\n ->join('tb_tim', 'tb_tim.id_tim = tb_penugasan.id_tim')\n ->where('daltu', $daltu)\n //->order_by('id_p2hp', 'desc')\n ->get()->result();\n }", "function by_jenis_surat()\n {\n $this->db->select(\"COUNT( id ) AS total,COUNT( CASE WHEN jenis_surat LIKE '%KERJA%' AND status_berlaku = '1' THEN 1 END ) AS surat_izin_kerja,COUNT( CASE WHEN jenis_surat LIKE '%SIK%' AND status_berlaku = '1' THEN 1 END ) AS surat_izin_keterangan,COUNT( CASE WHEN jenis_surat LIKE '%SIP%' AND status_berlaku = '1' THEN 1 END ) AS surat_izin_praktik,COUNT( CASE WHEN jenis_surat LIKE '%SIP-E%' AND status_berlaku = '1' THEN 1 END ) AS sipe,COUNT( CASE WHEN jenis_surat LIKE '%SIKA%' AND status_berlaku = '1' THEN 1 END ) AS sika,\");\n $this->db->from($this->table);\n return $this->db->get()->row();\n }", "public function getTotalPenjualanAllDivisi($tanggal)\n {\n $connection=Yii::app()->db;\n $sql =\"SELECT SUM(hargatotal) as totalpenjualan FROM transaksi.penjualanbarang WHERE cast(tanggal as date)='$tanggal'\n\t\t\t\t\t\tAND statuspenjualan=TRUE\"; \n $data=$connection->createCommand($sql)->queryRow();\n return $data[\"totalpenjualan\"];\n }", "function HitungUlangBIPOTPMB($PMBID) {\r\n $pmb = GetFields('pmb', \"KodeID='\".KodeID.\"' and PMBID\", $PMBID, '*');\r\n // Hitung Total BIPOT & Pembayaran\r\n $TotalBiaya = GetaField(\"bipotmhsw bm\r\n left outer join bipot2 b2 on bm.BIPOT2ID = b2.BIPOT2ID\",\r\n \"bm.PMBMhswID = 0 and bm.KodeID = '\".KodeID.\"'\r\n and bm.NA = 'N'\r\n and bm.TahunID = '$pmb[PMBPeriodID]' and bm.PMBID\", $PMBID,\r\n \"sum(bm.TrxID * bm.Jumlah * bm.Besar)\")+0;\r\n $TotalBayar = GetaField('bayarmhsw',\r\n \"PMBMhswID = 0 and KodeID = '\".KodeID.\"'\r\n and NA = 'N'\r\n and TahunID = '$pmb[PMBPeriodID]' and PMBID\", $PMBID,\r\n \"sum(Jumlah)\")+0;\r\n // Update data PMB\r\n $s = \"update pmb\r\n set TotalBiaya = $TotalBiaya,\r\n TotalBayar = $TotalBayar\r\n where KodeID = '\".KodeID.\"'\r\n and PMBID = '$PMBID' \r\n limit 1\";\r\n $r = _query($s);\r\n //echo \"<pre>$s</pre>\";\r\n}", "function getDataPeriodeTh($conn,$periode,$kurikulum,$kodeunit,$padanan=false) {\n\t\t\t$sql_in=\"select distinct(kodemk) from \".static::table().\" k join \".static::table('ak_kurikulum').\" c using (thnkurikulum,kodemk,kodeunit) \n\t\t\t\t\t\twhere (k.periode = '\".substr($periode,0,4).\"1' or k.periode = '\".substr($periode,0,4).\"2') and k.kodeunit = '$kodeunit' and (k.thnkurikulum = '$kurikulum'\".\n\t\t\t\t\t\t($padanan ? \" or e.kodemkbaru is not null\" : '').\")\";\n\t\t\t$sql = \"select distinct k.thnkurikulum, k.kodemk, k.kodeunit, k.kelasmk, c.namamk, c.sks, c.semmk, k.koderuang,\n\t\t\t\t\t\tk.nohari, k.jammulai, k.jamselesai, k.nohari2, k.jammulai2, k.jamselesai2\n\t\t\t\t\tfrom \".static::table().\" k join \".static::table('ak_kurikulum').\" c using (thnkurikulum,kodemk,kodeunit)\n\t\t\t\t\tleft join \".static::table('ak_ekivaturan').\" e on e.tahunkurikulumbaru = k.thnkurikulum and e.kodemkbaru = k.kodemk\n\t\t\t\t\t\tand e.kodeunitbaru = k.kodeunit and e.thnkurikulum = '$kurikulum'\n\t\t\t\t\twhere (k.periode = '\".substr($periode,0,4).\"1' or k.periode = '\".substr($periode,0,4).\"2') and k.kodemk in ($sql_in) and (k.thnkurikulum = '$kurikulum'\".\n\t\t\t\t\t\t($padanan ? \" or e.kodemkbaru is not null\" : '').\")\n\t\t\t\t\torder by c.namamk, k.kelasmk\";\n\t\t\t\n\t\t\treturn $conn->GetArray($sql);\n\t\t}", "public function getTotalPiutangAllDivisi($tanggal)\n {\n $connection=Yii::app()->db;\n $sql =\"SELECT SUM(sisa) as totalpiutang FROM transaksi.penjualanbarang pb inner join transaksi.fakturpenjualanbarang fjb on fjb.penjualanbarangid=pb.id\"\n . \" inner join transaksi.faktur f on f.id=fjb.fakturid WHERE cast(f.tanggal as date)='$tanggal'\"; \n $data=$connection->createCommand($sql)->queryRow();\n return $data[\"totalpiutang\"];\n }", "public function cetakLaporanPenjualanBulanan($bulan)\n {\n $totalQty = DB::table('tb_transaksi')\n ->join('tb_transaksi_penjualan','tb_transaksi.id_transaksi','=','tb_transaksi_penjualan.id_transaksi')\n ->join('tb_penjualan','tb_transaksi_penjualan.no_penjualan','=','tb_penjualan.no_penjualan')\n ->where('status','=','berhasil')\n ->whereRaw('date_format(waktu,\"%Y-%m\") = ?',[$bulan])\n ->sum('qty');\n\n #2. Ambil Total Diskon Item\n $totalDiskonItem = DB::table('tb_transaksi')\n ->join('tb_transaksi_penjualan','tb_transaksi.id_transaksi','=','tb_transaksi_penjualan.id_transaksi')\n ->join('tb_penjualan','tb_transaksi_penjualan.no_penjualan','=','tb_penjualan.no_penjualan')\n ->where('status','=','berhasil')\n ->whereRaw('date_format(waktu,\"%Y-%m\") = ?',[$bulan])\n ->sum('nilai_diskon');\n\n\n #3. Ambil Total Diskon Penjualan\n $totalDiskonPenjualan = DB::table('tb_detail_diskon_penjualan')\n ->join('tb_penjualan','tb_detail_diskon_penjualan.no_penjualan','=','tb_penjualan.no_penjualan')\n ->whereRaw('date_format(waktu,\"%Y-%m\") = ?',[$bulan])\n ->sum('tb_detail_diskon_penjualan.total');\n\n\n\n #4. Ambil total Tunai\n $totalTunai = DB::table('tb_penjualan')\n ->where('jenis_pembayaran','=','tunai')\n ->whereRaw('date_format(waktu,\"%Y-%m\") = ?',[$bulan])\n ->sum('total');\n\n\n #5. Ambil total Debit\n $totalDebit = DB::table('tb_penjualan')\n ->where('jenis_pembayaran','=','debit')\n ->whereRaw('date_format(waktu,\"%Y-%m\") = ?',[$bulan])\n ->sum('total');\n\n #6. Total Tunai Dan Debit\n $totalTunaiDebit = $totalTunai+$totalDebit;\n\n #7. Ambil total Hpp\n $totalHpp = DB::select('SELECT SUM(hpp*qty) AS totalHpp\n FROM tb_transaksi_penjualan\n INNER JOIN tb_transaksi using(id_transaksi)\n INNER JOIN tb_stok USING(barcode)\n INNER JOIN tb_penjualan USING(no_penjualan)\n WHERE DATE_FORMAT(waktu,\"%Y-%m\") = ?\n AND tb_transaksi_penjualan.status = ?',[$bulan,'berhasil']);\n\n\n #8. Margin\n $margin = ($totalTunaiDebit - ($totalDiskonItem-$totalDiskonPenjualan))-$totalHpp[0]->totalHpp;\n\n #9. Detail Penjualan Produk\n $detailProduk = DB::select('SELECT sum(qty) AS totalQty,sum(subtotal) AS total,nama_barang\n FROM tb_transaksi\n INNER JOIN tb_transaksi_penjualan USING(id_transaksi)\n INNER JOIN tb_penjualan USING(no_penjualan)\n INNER JOIN tb_stok USING(barcode)\n WHERE tb_transaksi_penjualan.status = ?\n AND date_format(waktu,\"%Y-%m\") = ?\n GROUP BY nama_barang',['berhasil',$bulan]);\n\n\n\n // return $detailProduk;\n return view('laporan.laporanPenjualan.cetakLaporanPenjualanBulanan',['bulan' => $bulan,\n 'totalQty' => $totalQty,\n 'totalDiskonItem' => $totalDiskonItem,\n 'totalDiskonPenjualan' => $totalDiskonPenjualan,\n 'totalTunai' => $totalTunai,\n 'totalDebit' => $totalDebit,\n 'totalTunaiDebit' => $totalTunaiDebit,\n 'totalHpp' => $totalHpp[0]->totalHpp,\n 'margin' => $margin,\n 'detailProduk' => $detailProduk]);\n\n\n }", "function hitung_pejabat()\n {\n $query = $this->db->query(\"SELECT\n COUNT(DISTINCT id_pegawai) as jumlah_pejabat,\n COUNT(DISTINCT CASE WHEN id_kp = '1' THEN id_pegawai END) as jastruk,\n COUNT(DISTINCT CASE WHEN id_kp = '2' THEN id_pegawai END) as jafung_umum,\n COUNT(DISTINCT CASE WHEN id_kp = '3' THEN id_pegawai END) as jafung_tertentu\n FROM tb_pegawai\n WHERE id_pegawai\");\n return $query->result();\n }", "public function ambil_pendapatan_iuran(){\n $data = \"SELECT p.nim,p.nama,a.nama_amanah,b.nama_departemen,i.total_iuran from keu_pengurus p\n INNER JOIN keu_amanah a ON p.keu_amanah = a.id_amanah\n LEFT JOIN keu_departemen b ON p.keu_departemen = b.id_departemen\n LEFT JOIN keu_iuran_pengurus as i ON p.id_pengurus = i.id_pengurus\n JOIN keu_tahun_kepengurusan tk ON p.thnkepengurusan_id = tk.id_thnkepengurusan\n WHERE tk.aktif = 'Y'\n order by b.id_departemen,a.id_amanah\";\n return $this->db->query($data)->result();\n }", "function get_timestamp_jour_suivant($timestamp_today) {\n\tglobal $mysqli;\n\t$demain=false;\n\n\t$tab_nom_jour=array('dimanche','lundi','mardi','mercredi','jeudi','vendredi','samedi');\n\t$sql=\"SELECT * from horaires_etablissement WHERE ouverture_horaire_etablissement!=fermeture_horaire_etablissement AND ouvert_horaire_etablissement!='0' ORDER BY id_horaire_etablissement;\";\n\t$res_jours_ouverts=mysqli_query($mysqli, $sql);\n\tif($res_jours_ouverts->num_rows > 0) {\n\t\t$tab_jours_ouverture=array();\n\t\twhile($lig_j = $res_jours_ouverts->fetch_object()) {\n\t\t\t$tab_jours_ouverture[]=$lig_j->jour_horaire_etablissement;\n\t\t\t//echo \"\\$tab_jours_ouverture[]=\".$lig_j->jour_horaire_etablissement.\"<br />\";\n\t\t}\n\t\t$res_jours_ouverts->close();\n\n\t\t$compteur=0;\n\t\t$j_prec = $timestamp_today - 3600*24;\n\t\twhile((isset($tab_nom_jour[strftime(\"%w\",$j_prec)]))&&(!in_array($tab_nom_jour[strftime(\"%w\",$j_prec)],$tab_jours_ouverture))&&($compteur<8)) {\n\t\t\t$j_prec -= 3600*24;\n\t\t\t$compteur++;\n\t\t}\n\t\tif($compteur<7) {\n\t\t\t$hier=$j_prec;\n\t\t}\n\n\t\t$compteur=0;\n\t\t$j_suiv = $timestamp_today + 3600*24;\n\t\twhile((isset($tab_nom_jour[strftime(\"%w\",$j_suiv)]))&&(!in_array($tab_nom_jour[strftime(\"%w\",$j_suiv)],$tab_jours_ouverture))&&($compteur<8)) {\n\t\t\t$j_suiv += 3600*24;\n\t\t\t$compteur++;\n\t\t}\n\t\tif($compteur<7) {\n\t\t\t$demain=$j_suiv;\n\t\t}\n\t}\n\n\treturn $demain;\n}", "function get_stattovday($dt){\n\t\t$dt1=$dt+24*60*60;\n\t\t$cnt='<table align=\"center\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" class=\"selstr\"><tbody><tr><th class=\"news_header lft\">Код</th><th class=\"news_header lft\">Наименование</th><th class=\"news_header cen\">Кол-во</th><th class=\"news_header rgt\">Сумма</th></tr>';\n\t\tglobal $db;\n\t\t$qy = $db->get_rows(\"select sum((o.summa-o.summa*o.skidka/100) * o.count ) as sm, sum(o.count) as cnt,p.title, p.param_kodtovara,o.prd_id from chudo_ishop_order_idet o ,chudo_ishop_products p, chudo_ishop_order_i c where c.data>=\".$dt.\" and c.data<\".$dt1.\" and o.order_id=c.id and p.id=o.prd_id group by o.prd_id order by p.param_kodtovara\");\n\t\tforeach($qy as $id=>$row){\n\t\t\t$cnt.='<tr><td class=\"news_td lft\">'.$row['param_kodtovara'].'</td><td class=\"news_td lft cli\" onclick=\"view_statdt(this,'.$dt.','.$row['prd_id'].')\">'.$row['title'].'</td><td class=\"news_td cen\">'.$row['cnt'].'</td><td class=\"news_td rgt\">'.number_format($row['sm'],2,'.',\"\").'</td></tr>';\n\t\t}\n\t\t$cnt.='</tbody></table><!--'.$dt.'-->';\n\t\treturn $cnt;\n\t}", "public function getPercentageProgress($jenis)\n\t{\n\t\t$id=$this->id;\n\t\t$sql=\"SELECT IF(SUM(jumlah) IS NULL, 0, SUM(jumlah)) AS val FROM value_kegiatan WHERE kegiatan=$id AND jenis=$jenis\";\n\t\t$hasil=Yii::app()->db->createCommand($sql)->queryScalar();\n if($jenis==1){\n if($hasil==0){\n $sql2=\"SELECT IF(end_date<NOW(), 0, 1) AS val FROM kegiatan WHERE id={$id}\";\n $hasil2=Yii::app()->db->createCommand($sql2)->queryScalar();\n if($hasil2==0)\n $hasil='<span class=\"text-red\">TIDAK DILAPORKAN OPERATOR PROVINSI</span>';\n }\n // else if($hasil<$this->getTarget()){\n // $hasil='<span class=\"label label-danger\">'.$hasil.'</span>';\n // }\n }\n return $hasil;\n\t}", "function hitung_kgb()\n {\n $query = $this->db->query(\"SELECT\n COUNT(id_pegawai) as jumlah_pejabat\n FROM data_kgb_notif\n WHERE selisih <= 60 \");\n return $query->result();\n }", "function sum_plati_moth_group_emp($id)\n{\n $query = \"SELECT count(platit) AS plati, sum(platit) AS suma, DATE_FORMAT(data, '%m') AS data, comment\n FROM cozagro_db.lichidare WHERE deleted = 0 AND id_angajat= $id\n GROUP BY MONTH(data)\";\n $result = Database::getInstance()->getConnection()->query($query);\n if (!$result) {\n die(\"Nu s-a reusit conexiunea la DB selectarea salariilor platite\" . Database::getInstance()->getConnection()->error);\n }\n $lichidare_luna = [];\n while ($x = $result->fetch_assoc()) {\n $lichidare_luna[$x['data']] = array(\"nr\" => $x['plati'], \"pla\" => $x['suma'], \"com\" => $x['comment']);\n }\n $result->free_result();\n return $lichidare_luna;\n}", "public function actionLaporanKunjunganRD() {\n $format = new MyFormatter();\n $model = new PPInfoKunjunganRDV('searchTableLaporan'); \n $model->unsetAttributes();\n $model->jns_periode = \"hari\";\n $model->tgl_awal = date('Y-m-d', strtotime('first day of this month'));\n $model->tgl_akhir = date('Y-m-d');\n $model->bln_awal = date('Y-m', strtotime('first day of january'));\n $model->bln_akhir = date('Y-m');\n $model->thn_awal = date('Y');\n $model->thn_akhir = date('Y');\n\n if (isset($_GET['PPInfoKunjunganRDV'])) {\n $model->attributes = $_GET['PPInfoKunjunganRDV']; \n $model->jns_periode = $_GET['PPInfoKunjunganRDV']['jns_periode'];\n $model->tgl_awal = $format->formatDateTimeForDb($_GET['PPInfoKunjunganRDV']['tgl_awal']);\n $model->tgl_akhir = $format->formatDateTimeForDb($_GET['PPInfoKunjunganRDV']['tgl_akhir']);\n $model->bln_awal = $format->formatMonthForDb($_GET['PPInfoKunjunganRDV']['bln_awal']);\n $model->bln_akhir = $format->formatMonthForDb($_GET['PPInfoKunjunganRDV']['bln_akhir']);\n $model->thn_awal = $_GET['PPInfoKunjunganRDV']['thn_awal'];\n $model->thn_akhir = $_GET['PPInfoKunjunganRDV']['thn_akhir'];\n $bln_akhir = $model->bln_akhir.\"-\".date(\"t\",strtotime($model->bln_akhir));\n $thn_akhir = $model->thn_akhir.\"-\".date(\"m-t\",strtotime($model->thn_akhir.\"-12\"));\n switch($model->jns_periode){\n case 'bulan' : $model->tgl_awal = $model->bln_awal.\"-01\"; $model->tgl_akhir = $bln_akhir; break;\n case 'tahun' : $model->tgl_awal = $model->thn_awal.\"-01-01\"; $model->tgl_akhir = $thn_akhir; break;\n default : null;\n }\n $model->tgl_awal = $model->tgl_awal.\" 00:00:00\";\n $model->tgl_akhir = $model->tgl_akhir.\" 23:59:59\"; \n }\n\n $this->render($this->pathViewPP.'rawatDarurat/adminRD', array(\n 'model' => $model, 'format' => $format\n ));\n }", "function by_kelurahan_all($kecamatan)\n {\n $this->db->select('kelurahan_tempat_praktek,COUNT( id ) AS total,COUNT( CASE WHEN status_berlaku = \"1\" THEN 1 END ) AS berlaku,\n COUNT( CASE WHEN status_berlaku = \"0\" THEN 1 END ) AS tidak_berlaku\t');\n $this->db->from($this->table);\n $this->db->where('kecamatan_tempat_praktek',$kecamatan);\n $this->db->group_by('kelurahan_tempat_praktek');\n $this->db->order_by('total','DESC');\n return $this->db->get()->result();\n }", "public function get_det_adjust() \n {\n return $get_data = $this->db->query(\"SELECT * FROM temp_adjust_barang where id_karyawan='\".$this->session->userdata('id_karyawan').\"' AND kode_barang !='' \");\n }", "public function GetReportCustom($judul=FALSE , $tgl1=FALSE , $tgl2 ,$seksi=FALSE ,$unit=FALSE,$dept=FALSE,$trainer_get=FALSE,$namapkj=FALSE )\r\n\t{\t\r\n\t\t// KONDISI-------------------------------------------------------------------------------------------\r\n\t\tif ($judul==FALSE) {\r\n\t\t\t$j='';\r\n\t\t}else{\r\n\t\t\t$j=\"and jumlah.nama_pelatihan like '$judul%'\";\r\n\t\t}\r\n\t\t// --------------------------------------------------\r\n\t\tif ($tgl1==TRUE) {\r\n\t\t\t$t=\"and jumlah.tanggal between TO_DATE('$tgl1','MM/DD/YYYY') and TO_DATE('$tgl2','MM/DD/YYYY')\";\r\n\t\t}else{\r\n\t\t\t$t='';\r\n\t\t}\r\n\t\t// ---------------------------------------------------\r\n\t\tif ($seksi==FALSE) {\r\n\t\t\t$s='';\r\n\t\t}else{\r\n\t\t\t$s=\"and es.section_name like '%$seksi%'\";\r\n\t\t}\r\n\t\t// ---------------------------------------------------\r\n\t\tif ($unit==FALSE) {\r\n\t\t\t$u='';\r\n\t\t}else{\r\n\t\t\t$u=\"and es.unit_name like '%$unit%'\";\r\n\t\t}\r\n\t\t// ---------------------------------------------------\r\n\t\tif ($dept==FALSE) {\r\n\t\t\t$d='';\r\n\t\t}else{\r\n\t\t\t$d=\"and es.department_name like '%$dept%'\";\r\n\t\t}\r\n\t\t// ---------------------------------------------------\r\n\t\tif ($trainer_get==FALSE) {\r\n\t\t\t$tg='';\r\n\t\t}else{\r\n\t\t\t$tg=\"and pst.trainer like '%$trainer_get%'\";\r\n\t\t}\r\n\t\t// ---------------------------------------------------\r\n\t\tif ($namapkj==FALSE) {\r\n\t\t\t$n='';\r\n\t\t}else{\r\n\t\t\t$n=\"and jumlah.participant_name like '$namapkj%'\";\r\n\t\t}\r\n\t\t// --------------------------------------------------------------------------------------------------\r\n\t\t$sql=\r\n\t\t\"\r\n\t\t\tSELECT\tes.section_name, es.unit_name, es.department_name, jumlah.nama_pelatihan, jumlah.tanggal,jumlah.scheduling_id, \r\n\t\t\t\t\tjumlah.trainer , jumlah.standar_kelulusan ,jumlah.participant_name, jumlah.noind, jumlah.score_eval2_pre, jumlah.score_eval2_post, jumlah.score_eval2_r1,\r\n\t\t\t\t\tjumlah.score_eval2_r2, jumlah.score_eval2_r3, jumlah.score_eval3_hardskill, jumlah.keterangan_hardskill, jumlah.score_eval3_softskill ,\r\n\t\t\t\t\tjumlah.keterangan_softskill\r\n\t\t\tfrom\t\r\n\t\t\ter.er_section es,\r\n\t\t\t(\r\n\t\t\t\tselect \r\n\t\t\t\t\t\tees.section_name,\r\n\t\t\t\t\t\tpst.scheduling_name as nama_pelatihan,\r\n\t\t\t\t\t\tpst.date as tanggal,\r\n\t\t\t\t\t\tpst.scheduling_id,\r\n\t\t\t\t\t\tpst.trainer,\r\n\t\t\t\t\t\tpp.participant_name,\r\n\t\t\t\t\t\tpp.noind,\r\n\t\t\t\t\t\tpp.score_eval2_pre,\r\n\t\t\t\t\t\tpp.score_eval2_post,\r\n\t\t\t\t\t\tpp.score_eval2_r1,\r\n\t\t\t\t\t\tpp.score_eval2_r2,\r\n\t\t\t\t\t\tpp.score_eval2_r3,\r\n\t\t\t\t\t\tpp.score_eval3_hardskill,\r\n\t\t\t\t\t\tpp.score_eval3_softskill,\r\n\t\t\t\t\t\tpp.keterangan_hardskill,\r\n\t\t\t\t\t\tpp.keterangan_softskill,\r\n\t\t\t\t\t\tpst.standar_kelulusan,\r\n\t\t\t\t\t\tcount(pp.participant_name)as jml\r\n\t\t\t\t\t\tfrom\tpl.pl_participant pp,\r\n\t\t\t\t\t\t\t\ter.er_employee_all pea,\r\n\t\t\t\t\t\t\t\ter.er_section ees,\r\n\t\t\t\t\t\t\t\tpl.pl_scheduling_training pst\r\n\t\t\t\t\t\twhere\r\n\t\t\t\t\t\t\tpp.noind = pea.employee_code\r\n\t\t\t\t\t\t\tand ees.section_code = pea.section_code\r\n\t\t\t\t\t\t\tand pp.scheduling_id=pst.scheduling_id\r\n\t\t\t\t\t\t\t$tg\r\n\t\t\t\t\t\tgroup by\r\n\t\t\t\t\t\t\tees.section_name,\r\n\t\t\t\t\t\t\tpst.scheduling_name,\r\n\t\t\t\t\t\t\t3,4,5,6,7,8,9,10,11,12,13,14,15,16,17\r\n\t\t\t) as jumlah\r\n\t\t\twhere \r\n\t\t\tjumlah.jml is not null\r\n\t\t\tand jumlah.section_name = es.section_name\r\n\t\t\t$j $t $s $n $u $d\r\n\t\t\tgroup by es.section_name,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19\r\n\t\t\torder by jumlah.tanggal asc;\r\n\t\t\";\r\n\t\t$query=$this->db->query($sql);\r\n\t\treturn $query->result_array();\r\n\t\t// return $sql;\r\n\t}", "function filter_TREPORTE_By_S($SEDE, $state, $row, $index)\n{\n global $mysqli;\n $TR = \"resultados2017\";\n $addQuery = \"ORDER BY \" . $row . \" \" . $index;\n $lastQuery = \"limit 20\";\n\n //SET QUERY\n //1 to send at main table\n //2 to send at the report\n if ($state == 1) {\n $query = new Query($mysqli, \"SELECT apellido,nombre,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,sede,areap,ps,gatb,pca,indice,verbal,numer FROM \" . $TR . \" where sede = ? limit 20\");\n $parametros = array('i', &$SEDE);\n $data = $query->getresults($parametros);\n\n } else if ($state == 2) {\n $query = new Query($mysqli, \"SELECT apellido,nombre,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,sede,areap,ps,gatb,pca,indice,verbal,numer FROM \" . $TR . \" where sede = ? \" . $addQuery);\n $parametros = array('i', &$SEDE);\n $data = $query->getresults($parametros);\n\n } else {\n //error\n }\n\n//return\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "public function reporte_comparativo_compras_ventas($tipo_op)\n {\n //CPC_TipoDocumento => F factura, B boleta\n //CPC_total => total de la FACTURA o BOLETA\n $sql = \"SELECT\n SUM((CASE MONTH(c.CPC_FechaRegistro) WHEN '01' THEN c.CPC_total ELSE 0 END)) enero,\n SUM((CASE MONTH(c.CPC_FechaRegistro) WHEN '02' THEN c.CPC_total ELSE 0 END)) febrero,\n SUM((CASE MONTH(c.CPC_FechaRegistro) WHEN '03' THEN c.CPC_total ELSE 0 END)) marzo,\n SUM((CASE MONTH(c.CPC_FechaRegistro) WHEN '04' THEN c.CPC_total ELSE 0 END)) abril,\n SUM((CASE MONTH(c.CPC_FechaRegistro) WHEN '05' THEN c.CPC_total ELSE 0 END)) mayo,\n SUM((CASE MONTH(c.CPC_FechaRegistro) WHEN '06' THEN c.CPC_total ELSE 0 END)) junio,\n SUM((CASE MONTH(c.CPC_FechaRegistro) WHEN '07' THEN c.CPC_total ELSE 0 END)) julio,\n SUM((CASE MONTH(c.CPC_FechaRegistro) WHEN '08' THEN c.CPC_total ELSE 0 END)) agosto,\n SUM((CASE MONTH(c.CPC_FechaRegistro) WHEN '09' THEN c.CPC_total ELSE 0 END)) setiembre,\n SUM((CASE MONTH(c.CPC_FechaRegistro) WHEN '10' THEN c.CPC_total ELSE 0 END)) octubre,\n SUM((CASE MONTH(c.CPC_FechaRegistro) WHEN '11' THEN c.CPC_total ELSE 0 END)) noviembre,\n SUM((CASE MONTH(c.CPC_FechaRegistro) WHEN '12' THEN c.CPC_total ELSE 0 END)) diciembre\n FROM cji_comprobante c\n WHERE c.CPC_TipoOperacion='\" . $tipo_op . \"' AND c.CPC_FlagEstado='1' AND c.CPP_Codigo<>0 AND YEAR(c.CPC_FechaRegistro)=YEAR(CURDATE())\";\n $query = $this->db->query($sql);\n\n if ($query->num_rows > 0) {\n foreach ($query->result() as $fila) {\n $data[] = $fila;\n }\n return $data;\n }\n return array();\n }", "public function datatable_verifikasi_transaksi_kas_petugas()\n\t{\n\n\t\t$from_date = str_replace('/','',@$_GET['from_date']);\n\t\t$from_date = substr($from_date,4,4).'-'.substr($from_date,2,2).'-'.substr($from_date,0,2);\n\t\t$thru_date = str_replace('/','',@$_GET['thru_date']);\n\t\t$thru_date = substr($thru_date,4,4).'-'.substr($thru_date,2,2).'-'.substr($thru_date,0,2);\n\t\t$aColumns = array( '','trx_date','account_cash_code','account_teller_code','mfi_trx_gl_cash.trx_gl_cash_type','mfi_trx_gl_cash.amount','mfi_trx_gl_cash.description','');\n\t\t\t\t\n\t\t/* \n\t\t * Paging\n\t\t */\n\t\t$sLimit = \"\";\n\t\tif ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )\n\t\t{\n\t\t\t$sLimit = \" OFFSET \".intval( $_GET['iDisplayStart'] ).\" LIMIT \".\n\t\t\t\tintval( $_GET['iDisplayLength'] );\n\t\t}\n\t\t\n\t\t/*\n\t\t * Ordering\n\t\t */\n\t\t$sOrder = \"\";\n\t\tif ( isset( $_GET['iSortCol_0'] ) )\n\t\t{\n\t\t\t$sOrder = \"ORDER BY \";\n\t\t\tfor ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == \"true\" )\n\t\t\t\t{\n\t\t\t\t\t$sOrder .= \"\".$aColumns[ intval( $_GET['iSortCol_'.$i] ) ].\" \".\n\t\t\t\t\t\t($_GET['sSortDir_'.$i]==='asc' ? 'asc' : 'desc') .\", \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$sOrder = substr_replace( $sOrder, \"\", -2 );\n\t\t\tif ( $sOrder == \"ORDER BY\" )\n\t\t\t{\n\t\t\t\t$sOrder = \"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* \n\t\t * Filtering\n\t\t */\n\t\t$sWhere = \"\";\n\t\tif ( isset($_GET['sSearch']) && $_GET['sSearch'] != \"\" )\n\t\t{\n\t\t\t$sWhere = \"WHERE (\";\n\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower( $_GET['sSearch'] ).\"%' OR \";\n\t\t\t}\n\t\t\t$sWhere = substr_replace( $sWhere, \"\", -3 );\n\t\t\t$sWhere .= ')';\n\t\t}\n\t\t\n\t\t/* Individual column filtering */\n\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t{\n\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t{\n\t\t\t\tif ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == \"true\" && $_GET['sSearch_'.$i] != '' )\n\t\t\t\t{\n\t\t\t\t\tif ( $sWhere == \"\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere = \"WHERE \";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere .= \" AND \";\n\t\t\t\t\t}\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower($_GET['sSearch_'.$i]).\"%' \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$rResult \t\t\t= $this->model_transaction->datatable_verifikasi_transaksi_kas_petugas($sWhere,$sOrder,$sLimit,$from_date,$thru_date); // query get data to view\n\t\t$rResultFilterTotal = $this->model_transaction->datatable_verifikasi_transaksi_kas_petugas($sWhere,'','',$from_date,$thru_date); // get number of filtered data\n\t\t$iFilteredTotal \t= count($rResultFilterTotal); \n\t\t$rResultTotal \t\t= $this->model_transaction->datatable_verifikasi_transaksi_kas_petugas('','','',$from_date,$thru_date); // get number of all data\n\t\t$iTotal \t\t\t= count($rResultTotal);\t\n\t\t\n\t\t/*\n\t\t * Output\n\t\t */\n\t\t$output = array(\n\t\t\t\"sEcho\" => intval($_GET['sEcho']),\n\t\t\t\"iTotalRecords\" => $iTotal,\n\t\t\t\"iTotalDisplayRecords\" => $iFilteredTotal,\n\t\t\t\"aaData\" => array()\n\t\t);\n\t\t\n\t\tforeach($rResult as $aRow)\n\t\t{\n\t\t\t$row = array();\n\t\t\tif ($aRow['trx_gl_cash_type']==1) \n\t\t\t{\n\t\t\t\t$jenis_trx = \"droping kas\";\n\t\t\t} \n\t\t\telse if ($aRow['trx_gl_cash_type']==2) \n\t\t\t{\n\t\t\t\t$jenis_trx = \"setoran rembug\";\n\t\t\t}\n\t\t\telse if ($aRow['trx_gl_cash_type']==3) \n\t\t\t{\n\t\t\t\t$jenis_trx = \"penarikan rembug\";\n\t\t\t}\n\t\t\telse if ($aRow['trx_gl_cash_type']==4) \n\t\t\t{\n\t\t\t\t$jenis_trx = \"setor ke teller\";\n\t\t\t}\n\t\t\t\n\t\t\t$row[] = '<input type=\"checkbox\" value=\"'.$aRow['trx_gl_cash_id'].'\" id=\"checkbox\" class=\"checkboxes\" >';\n\t\t\t$row[] = '<div align=\"center\">'.$aRow['trx_date'].'</div>';\n\t\t\t$row[] = $aRow['kode_kas_petugas'];\n\t\t\t$row[] = $aRow['kode_kas_teller'];\n\t\t\t$row[] = $jenis_trx;\n\t\t\t$row[] = '<div align=\"right\">'.number_format($aRow['amount'],0,',','.').'</div>';\n\t\t\t$row[] = $aRow['description'];\n\t\t\t$row[] = '<a href=\"javascript:;\" trx_gl_cash_id=\"'.$aRow['trx_gl_cash_id'].'\" id=\"link-verifikasi\">Verifikasi</a>';\n\n\t\t\t$output['aaData'][] = $row;\n\t\t}\n\t\t\n\t\techo json_encode( $output );\n\t}", "function get_umur_kedatangan($date,$date2)\n\t\t{\n\t\t\t$date_curr=explode(\"-\",$date);\n\t\t\t$tahun_lahir=$date_curr[0];\n\t\t\t$bulan_lahir=$date_curr[1];\n\t\t\t$tanggal_lahir=$date_curr[2];\n\t\t\t//--------------------------- > input date 2 tgl kedatangannya\n\t\t\t$date_curr2=explode(\"-\",$date2);\n\t\t\t$tahun_lahir2=$date_curr2[0];\n\t\t\t$bulan_lahir2=$date_curr2[1];\n\t\t\t$tanggal_lahir2=$date_curr2[2];\n\t\t\t\n\t\t\t\n\t\t\t$tgl_skrg=mktime(0,0,0,$bulan_lahir2,$tanggal_lahir2,$tahun_lahir2);\n\n\t\t\t//tentukan taggal lahirnya\n\t\t\t$tgl_lahir=mktime(0,0,0,$bulan_lahir,$tanggal_lahir,$tahun_lahir);\n\t\t\t//format : bulan,tanggal,tahun\n\n\t\t\t//hitung umur\n\t\t\t$umur=intval(($tgl_skrg-$tgl_lahir)/(60*60*24*365));\n\n\n\t\t\t$full_umur=($tgl_skrg-$tgl_lahir)/(60*60*24*365);\n\t\t\t//echo $full_umur.\"<br>\";\n\t\t\t$full_bulan = round(($full_umur-$umur)*12);\n\t\t\t$res['umur']=$umur;\n\t\t\t$res['bulan']=$full_bulan;\n\t\t\treturn $res;\n\t}" ]
[ "0.6335532", "0.6151182", "0.60268176", "0.5979784", "0.5976792", "0.5973393", "0.5884077", "0.58538026", "0.58411914", "0.58250445", "0.57868296", "0.57827914", "0.57699525", "0.575896", "0.5757371", "0.5748462", "0.5726883", "0.57199335", "0.5710533", "0.570993", "0.5704452", "0.57026076", "0.5696138", "0.568362", "0.5681635", "0.5663476", "0.5658676", "0.5641205", "0.5636509", "0.5635779", "0.5623441", "0.56203914", "0.56189704", "0.56185865", "0.5594017", "0.5592183", "0.55835867", "0.55814105", "0.5579615", "0.5575719", "0.5563362", "0.5559225", "0.5549703", "0.5542139", "0.5528455", "0.552718", "0.5518733", "0.55105084", "0.55043584", "0.54813665", "0.54805684", "0.5472996", "0.5457497", "0.54545605", "0.5452247", "0.5447829", "0.54453343", "0.5442334", "0.5434078", "0.54240316", "0.5420993", "0.54133475", "0.540745", "0.54005224", "0.53932893", "0.5375353", "0.53718317", "0.53659296", "0.5358467", "0.5357378", "0.5357085", "0.53519416", "0.5344203", "0.5343517", "0.53391", "0.53343886", "0.5332889", "0.53268576", "0.5326594", "0.5315307", "0.5298782", "0.5286416", "0.52820116", "0.52818084", "0.5278847", "0.52775216", "0.5268322", "0.5259286", "0.52563137", "0.5254336", "0.525417", "0.52519995", "0.5246628", "0.52412355", "0.52333194", "0.5232522", "0.5227305", "0.52252036", "0.52225477", "0.5219605" ]
0.6240229
1
Authenticates a user. The example implementation makes sure if the username and password are both 'demo'. In practical applications, this should be changed to authenticate against some persistent user identity storage (e.g. database).
public function authenticate() { $record = Employee::model()->findByAttributes(array('username' => $this->username)); // here I use Email as user name which comes from database if ($record === null) { $this->_id = 'user Null'; $this->errorCode = self::ERROR_USERNAME_INVALID; } else if (CPasswordHelper::verifyPassword($this->password, $record->password) == false) // here I compare db password with password field { $this->_id = $this->username; $this->errorCode = self::ERROR_PASSWORD_INVALID; } else if ($record['is_active'] != 1) // here I check status as Active in db { $this->errorCode = Y::t('login', 'Prisijungimas išjungtas'); } else { $this->_id = $record->usertype; $this->errorCode = self::ERROR_NONE; $this->setState('__name', $record->usertype); $this->setState('title', $record->name); $this->setState('id', $record->id); $settings = Setting::model()->findAll('employee_id=:eid', array(':eid' => $record->id)); $grid = array(); foreach($settings as $s) { $grid[$s->title] = $s->value; } $this->setState('grid', $grid); Yii::app()->user->setState('_timeZone', 'Europe/Vilnius'); //Yii::app()->localtime->Locale = 'lt_lt'; // eg 'en_gb' //Yii::app()->localtime->TimeZone = 'Europe/Vilnius'; //$user->timezone->name; //Yii::app()->localtime->dateFormat = 'long'; //$user->timezone->name; } return !$this->errorCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authenticate()\n {\n $query = $this->newQuery()->select('*')->where([\n 'username' => $this->username,\n 'disabled' => 0\n ]);\n\n $userRow = $query->execute()->fetch('assoc');\n\n if (empty($userRow)) {\n return new AuthenticationResult(AuthenticationResult::FAILURE_IDENTITY_NOT_FOUND);\n }\n\n $user = new UserEntity($userRow);\n\n if (!$this->token->verifyHash($this->password, $user->password)) {\n return new AuthenticationResult(AuthenticationResult::FAILURE_CREDENTIAL_INVALID);\n }\n\n return new AuthenticationResult(AuthenticationResult::SUCCESS, $user);\n }", "public function AuthenticateUser($name, $password);", "public function authenticate()\n {\n $credential = $this->getCredential();\n $identity = $this->getIdentity();\n $userObject = $this->getUserObject();\n\n $bcrypt = new Bcrypt();\n $bcrypt->setCost(14);\n\n if (!$bcrypt->verify($this->getCredential(),$userObject->getPassword())) {\n // Password does not match\n return false;\n }\n\n $this->updateIdentity($userObject);\n\n return $this->getAuthResult(AuthenticationResult::SUCCESS, $userObject->getEmail());\n }", "public function authenticate()\n\t{\n\n\t\t$username = strtolower($this->username);\n\t\t/** @var $user User */\n\t\t$user = User::model()->with('roles')->find('LOWER(use_username)=?', array($username));\n\t\tif ($user === null) {\n\t\t\t$this->errorCode = self::ERROR_USERNAME_INVALID;\n\t\t} else {\n\t\t\tif (!$user->validatePassword($this->password)) {\n\t\t\t\t$this->errorCode = self::ERROR_PASSWORD_INVALID;\n\t\t\t} else {\n\t\t\t\t$this->_id = $user->use_id;\n\t\t\t\t$this->username = $user->use_fname;\n\t\t\t\t$this->_branchId = $user->use_branch;\n\t\t\t\t$this->_scope = $user->use_scope;\n\t\t\t\t$this->_roles = $user->roles;\n\n\t\t\t\t$this->userData = serialize($user);\n\n\t\t\t\tYii::app()->user->setState(\"fullname\", $user->getFullName());\n\n\t\t\t\t$this->errorCode = self::ERROR_NONE;\n\t\t\t\t$this->loadSessionForOldLogin($user);\n\t\t\t}\n\t\t}\n\t\tLoginLog::model()->log($this, $user);\n\t\treturn $this->errorCode == self::ERROR_NONE;\n\t}", "public function authenticate()\n\t{\n\t\tif ($this->hasErrors())\n return; // There are errors already\n\t\t\n $identity = $this->getIdentity();\n if ($identity->ok)\n return; // Authenticate successfully\n \n if (!YII_DEBUG) {\n $this->addError('password','Incorrect email or password.');\n\n } else {\n switch ($identity->errorCode) {\n case UserIdentity::ERROR_USERNAME_INVALID:\n $this->addError('email', 'Invalid email.');\n break;\n\n case UserIdentity::ERROR_PASSWORD_INVALID:\n $this->addError('email', 'Invalid password.');\n break;\n\n default:\n $this->addError('password', 'Unknown UserIdenitity error.');\n break;\n }\n }\n\t}", "abstract public function authenticate($user, $pass);", "public function authenticate()\n {\n $user = Proxy_users::get()->auth($this->username, $this->password);\n if (!$user) {\n return new Result(Result::FAILURE, null, array(\"The username or password you have entered is incorrect.\"));\n }\n return new Result(Result::SUCCESS, $user->user_id);\n }", "public function Authenticate( )\n\t\t{\n\t\t\t$dataArray = array(\n \"email\"=>$this->email,\n \"password\"=>$this->password\n );\n \n $response = ServiceAPIUtils::CallAPIService( $dataArray,\"/User/Authenticate/123\", \"json\" );\n \n return $response;\n\t\t}", "public function authenticate()\n {\n $identity = new AmfUserIdentity($this->_username, $this->_password);\n\n if(is_null($this->_username) || $this->_username == '' || ctype_digit(strval($this->_username)))\n {\n $identity->token = $this->_password;\n }\n\n if($identity->authenticate())\n {\n $this->_username = $identity->username;\n $identity->role = AmfAcl::DEFAULT_LOGIN_ROLE;\n $code = AuthResult::SUCCESS;\n /** @var WebUser $wu */\n $wu = Yii::app()->user;\n $wu->setUsername($this->_username);\n $wu->setSub($identity->sub);\n }\n else\n {\n switch($identity->errorCode)\n {\n case AmfUserIdentity::ERROR_INVALID_TOKEN:\n case AmfUserIdentity::ERROR_PASSWORD_INVALID:\n $code = AuthResult::FAILURE_CREDENTIAL_INVALID;\n break;\n case AmfUserIdentity::ERROR_USERNAME_INVALID:\n $code = AuthResult::FAILURE_IDENTITY_NOT_FOUND;\n break;\n default:\n $code = AuthResult::FAILURE;\n }\n }\n return new AuthResult($code, $identity);\n }", "public function authenticate() {\n $user = Zebu_User::createInstance($this->username);\n if($user && $this->passhash == $user->passhash){\n return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS,$this->username);\n }\n return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID,$this->username);\n }", "public function authenticate()\n {\n $user = $this->em->getRepository('Auth\\Entity\\User')\n ->findByLoginAndPassword(\n new User(),\n $this->getStrEmailUser(),\n $this->getStrPasswordUser()\n );\n if ($user) {\n return new Result(Result::SUCCESS, $user, array());\n }\n return new Result(\n Result::FAILURE_CREDENTIAL_INVALID,\n null,\n array('Username ou senha inválidos')\n );\n }", "public function authenticate($username, $password);", "public function authenticate($username, $password);", "public function authenticate(string $username, string $password);", "public function testUserCanAuthenticate()\n {\n $password = 'test';\n\n $user = User::factory()->create([\n 'password' => bcrypt($password)\n ]);\n\n $response = $this->json('POST', '/api/v1/login', [\n 'email' => $user->email,\n 'password' => $password\n ]);\n\n $response->assertStatus(200);\n }", "public function userLogin(){\n\t\t\tif (isset($_POST['user_name']) && isset($_POST['password'])){\n\t\t\t\t$response = $this->model->getUser(\"*\", \"user_name = \".\"'\".$_POST['user_name'].\"'\");\n\t\t\t\t$response = $response[0];\n\t\t\t\t$user_rol = null;\n\t\t\t\t//The user is valid\n\t\t\t\tif ($response['password']==$_POST['password']) {\n\t\t\t\t\t//Verify the roles\n\t\t\t\t\t$response_role = $this->model->getRoles(\"user_id = '\".$response['_id'].\"'\");\n\t\t\t\t\tif (count($response_role)>1) {\n\t\t\t\t\t\t//Multipage user\n\t\t\t\t\t\t$user_rol = array();\n\t\t\t\t\t\tforeach ($response_role as $value) {\n\t\t\t\t\t\t\tarray_push($user_rol, $value['role']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (in_array('ADMIN', $user_rol)) { \n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n \t\t\t\t\t$_SERVER['AUTH_TYPE'] = \"Basic Auth\"; \n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$user_rol = $response_role[0]['role'];\n\t\t\t\t\t\tif ($user_rol == 'ADMIN') {\n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->createSession($response['user_name'], $user_rol);\n\t\t\t\t\techo 1;\n\t\t\t\t}\n\t\t\t \n\t\t\t}\n\t\t}", "function authenticateUser($username, $password) {\n\t\tif($this->isSSOEnabled() && empty($username) && empty($password)) {\n\t\t\t// SSO uses a different auth mechanism and handles cookies\n\t\t\t$authenticated_username = $this->tokenAuth();\n\t\t\tif($authenticated_username != null) {\n\t\t\t\treturn $authenticated_username; // success!\n\t\t\t};\n\t\t}\n\n\t\tif(!empty($username) && !empty($password)) {\n\t\t \n\t\t if($this->isSSOEnabled()) {\n\t\t \t// authenticate and create SSO tokens\n\t\t \treturn $this->tokenAuthCreateSession($username,$password);\n\t\t } else {\n\t\t\t\treturn $this->simpleAuth($username, $password);\n\t\t }\n\t\t}\n\n\t\treturn false;\n\t}", "public function authenticate()\n {\n $response = $this->client->write(\n sprintf('/auth/userpass/login/%s', $this->username),\n ['password' => $this->password]\n );\n\n return $response->getAuth();\n }", "public function login()\n {\n $username = $this->getAttribute('username');\n\n $this->_user = $this->db->select(Db::TABLE_USER, array(\n 'username' => $username,\n 'password' => UserAuth::hash(\n $this->getAttribute('password')\n ),\n ));\n\n if(!empty($this->_user)) {\n\n $identity = new UserAuth();\n $identity->login($username);\n\n return true;\n } else {\n $this->addError('password','Incorrect username or password');\n }\n\n return false;\n }", "public function loginUser()\n {\n $request = new Request();\n\n $email = $request->input('email');\n $password = $request->input('password');\n\n // Check email\n if (!$email) {\n $this->showLoginForm(['Please enter email']);\n }\n // Check password\n if (!$password) {\n $this->showLoginForm(['Please enter password']);\n }\n\n // Check user exist and then password\n $user = $this->getUser($email);\n $password = md5($password);\n if (!$user || $password !== $user['password']) {\n $this->showLoginForm(['Error on login']);\n }\n\n // Save login details to cookies\n if (!defined('APP_USERS_COOKIES_EMAIL')\n || !defined('APP_USERS_COOKIES_PASSWORD')) {\n $this->showLoginForm(['Error on login']);\n }\n setcookie(APP_USERS_COOKIES_EMAIL, $email);\n setcookie(APP_USERS_COOKIES_PASSWORD, $password);\n\n // Redirect to endpoint\n header(\"Location: \" . self::ENDPOINTS['success_login']);\n }", "public function authenticate() {\n if ($this->email == null || $this->password == null) {\n return new Result(Result::FAILURE);\n }\n $UserMapper = $this->getServiceLocator()->get(\"Profond\\Mapper\\User\");\n $UserMapper->setServiceLocator($this->getServiceLocator());\n $User = $UserMapper->getOneUserByEmail($this->email);\n if ($User != null) {\n if ($this->password == $User->getPassword()) {\n return new Result(Result::SUCCESS, $User);\n } else {\n return new Result(Result::FAILURE_CREDENTIAL_INVALID, null);\n }\n } else {\n return new result(Result::FAILURE_IDENTITY_NOT_FOUND, null);\n }\n }", "public function authenticate()\n {\n try {\n $userData = $this->client->httpPost('/v1/auth', [\n 'email' => $this->email,\n 'password' => $this->password,\n ]);\n\n // If no exception has been thrown then this is OK - transfer the details to the success result\n $user = new User($userData);\n\n // Regenerate the session ID post authentication\n $this->sessionManager->regenerateId(true);\n\n return new Result(Result::SUCCESS, $user);\n } catch (ApiException $apiEx) {\n if ($apiEx->getCode() === 401) {\n return new Result(Result::FAILURE_CREDENTIAL_INVALID, null, [\n $apiEx->getMessage()\n ]);\n } elseif ($apiEx->getCode() === 403) {\n return new Result(Result::FAILURE_ACCOUNT_LOCKED, null, [\n $apiEx->getMessage()\n ]);\n }\n\n return new Result(Result::FAILURE, null, [\n $apiEx->getMessage()\n ]);\n }\n }", "public function authenticate()\n {\n // Retrieve the user's information (e.g. from a database)\n // and store the result in $row (e.g. associative array).\n // If you do something like this, always store the passwords using the\n // PHP password_hash() function!\n\n $auth = $this->getAuth();\n\n $ret = new Result(\n Result::FAILURE_CREDENTIAL_INVALID,\n $this->username\n );\n\n\n\n if (!isset($auth['verified'])) {\n return $ret;\n }\n if ($auth['verified'] !== true) {\n return $ret;\n }\n if (!empty($auth['password'])) {\n if (password_verify($this->password, $auth['password'])) {\n $ret = new Result(Result::SUCCESS, $auth);\n }\n }\n return $ret;\n }", "public function authenticate()\n {\n $concat = $this->_password.self::getSalt();\n\n $sql = \"SELECT\n id\n FROM account\n WHERE\n email = '{$this->_email}'\n AND password = MD5(CONCAT(hash, '{$concat}'))\";\n\n $user = Doctrine_Manager::getInstance()->getCurrentConnection()->fetchOne($sql);\n \n // check to make sure the email address and password match\n if (!$user) {\n $error = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID;\n return new Zend_Auth_Result($error, 0);\n }\n\n $account = Js_Query::create()->from('account')->where('id = ?', $user['id'])->fetchOne();\n \n // return a valid login\n return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $account);\n }", "public function authenticate()\n {\n $codeError = Zend_Auth_Result::FAILURE;\n\n $userRow = DbTable_User::getInstance()->fetchRow(\n array('Login = ?' => $this->getUsername())\n );\n\n if (!$userRow) {\n return new Zend_Auth_Result($codeError, null, array('Authentication error'));\n }\n\n $hashedPassword = Vtx_Util_String::hashMe(\n $this->getPassword(), $userRow->getSalt()\n );\n\n if ($hashedPassword['sha'] != $userRow->getKeypass()) {\n return new Zend_Auth_Result($codeError, null, array('Authentication error'));\n }\n\n return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $userRow, array());\n }", "public function authenticate(){\n $user = $_SERVER['PHP_AUTH_USER'];\n $pass = $_SERVER['PHP_AUTH_PW'];\n\n if(!empty($user) && $this->api_config['allowed_users'][$user] === $pass){\n return True;\n }\n return False;\n }", "public function authenticate()\n\t{\n\t\t# make the call to the API\n\t\t$response = App::make('ApiClient')->post('login', Input::only('email', 'password'));\n\n\t\t# if the user was authenticated\n\t\tif(isset($response['success']))\n\t\t{\t\n\t\t\t# save the returned user object to the session for later use\n\t\t\tUser::startSession($response['success']['data']['user']);\n\n\t\t\t# we got here from a redirect. if they came via a new account registration then reflash the \n\t\t\t# session so we can use the data on the next page load\n\t\t\tif(Session::has('success')) {\n\t\t\t\tSession::reflash();\n\t\t\t}\t\t\t\n\n\t\t\tif(Input::get('redirect') && ! Session::has('ignoreRedirect')) {\n\t\t\t\treturn Redirect::to(Input::get('redirect'));\n\t\t\t}\n\n\t\t\t# and show the profile page\n\t\t\treturn Redirect::to('profile');\t\n\t\t}\n\t\t# auth failed. return to the log in screen and display an error\n\t\telse \n\t\t{ \n\t\t\t# save the API response to some flash data\n\t\t\tSession::flash('login-errors', getErrors($response));\n\n\t\t\t# also flash the input so we can replay it out onto the reg form again\n\t\t\tInput::flash();\n\n\t\t\t# ... and show the log in page again\n\t\t\treturn Redirect::to('login');\n\t\t}\n\t}", "public static function authenticate(User $user)\n\t{\n\t\tUser::current($user);\n\t}", "public function loginUser()\n {\n $validate = $this->loginValidator->validate();\n $user = $this->userRepository->getUserWithEmail($validate[\"email\"]);\n\n if ($this->userCorrect($validate, $user)) {\n $user['api_token'] = $this->getToken();\n $user->save();\n\n return $this->successResponse('user', $user, 200)\n ->header('Token', $user['api_token']);\n }\n }", "public static function LogIn ($userName = '', $password = '');", "function authenticateUser($username, $password) \n{\n\t$arr = validateUser($username, $password);\n\tif ($arr === null)\n\t{\n\t\treturn false;\n\t}\n\telse\n\t{\n\t session_start();\n\t $_SESSION[\"userId\"] = $arr[0];\n $_SESSION[\"displayName\"] = $arr[1];\n $_SESSION[\"emailAddress\"] = $arr[2];\n return true;\n\t}\n}", "public function login($userName, $password);", "private function auth() {\n // If the user has previously been authenticated\n if(isset($_SESSION['adminUsername']) && isset($_SESSION['adminPassword'])) {\n $this->admin->username = $_SESSION['adminUsername'];\n $this->admin->password = $_SESSION['adminPassword'];\n $auth = $this->admin->get(1);\n\n if($this->admin->password == $auth['password']) {\n $logged = true;\n }\n }\n // If the user has long term login enabled\n elseif(isset($_COOKIE['adminUsername']) && isset($_COOKIE['adminToken'])) {\n $this->admin->username = $_COOKIE['adminUsername'];\n $this->admin->rememberToken = $_COOKIE['adminToken'];\n $auth = $this->admin->get(2);\n\n if($this->admin->rememberToken == $auth['remember_token'] && !empty($auth['remember_token'])) {\n $_SESSION['adminUsername'] = $this->admin->username;\n $this->setPassword($auth['password']);\n $logged = true;\n }\n }\n // If the user is authenticating\n else {\n $auth = $this->admin->get(0);\n\n // Set the sessions\n $_SESSION['adminUsername'] = $this->admin->username;\n $this->setPassword($this->admin->password);\n\n if(password_verify($this->admin->password, $auth['password'])) {\n if($this->admin->rememberToken) {\n $this->admin->renewToken();\n }\n session_regenerate_id();\n $logged = true;\n }\n }\n\n if(isset($logged)) {\n $_SESSION['isAdmin'] = true;\n return $auth;\n }\n\n return false;\n }", "public function authenticate() {\n $user = SysAdminUser::model()->find('LOWER(account)=?', array(strtolower($this->username)));\n if ($user === null){\n $this->errorCode = self::ERROR_USERNAME_INVALID;\n }else if (!$user->validatePassword($this->password)){\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n }else {\n $this->_uid = $user->id;\n $this->username = $user->name;\n $this->setUser($user);\n $roleArr = OBJTool::convertModelToArray($user->role);\n if ($roleArr) {\n $role = $roleArr[0]['id'];\n } else {\n $role = NULL;\n }\n $this->setState('__role', $role);\n $this->errorCode = self::ERROR_NONE;\n //Yii::app()->user->setState(\"isadmin\", true);\n }\n return $this->errorCode == self::ERROR_NONE;\n }", "public function doLogin()\r\n {\r\n $input = Request::all();\r\n \r\n if (Auth::attempt(['username' => $input['email'], 'password' => $input['password'], 'deleted_at' => null, 'user_type' => 1]))\r\n {\r\n \r\n $user = Auth::user();\r\n Session::set('current_user_id',$user->id);\r\n return Redirect::intended('/dashboard');\r\n }\r\n else { \r\n Session::flash(\r\n 'systemMessages', ['error' => Lang::get('pages.login.errors.wrong_credentials')]\r\n );\r\n return Redirect::action('UserController@login')\r\n ->withInput(Request::except('password'));\r\n }\r\n }", "public function authenticate()\n {\n $model = new Default_Model_User();\n \n $result = false;\n foreach ($model->getAll() as $key => $user) {\n if ($user['handle'] == $this->_identity && $user['password'] == $this->_credential) {\n $result = (object)$user;\n }\n }\n \n $code = Zend_Auth_Result::FAILURE;\n $messages = array();\n\n if ($result === false || $result->active === 0) {\n $code = Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND;\n $messages[] = 'A record with the supplied identity could not be found.';\n } elseif ($this->_credential !== $result->password) {\n $code = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID;\n $messages[] = 'Supplied credential is invalid.';\n } else {\n unset($result->password);\n $this->_resultRow = $result;\n $code = Zend_Auth_Result::SUCCESS;\n $messages[] = 'Authentication successful.';\n }\n\n return new Zend_Auth_Result($code, $this->_identity, $messages);\n }", "public function authenticate()\n {\n \n if($this->username === 'admin' && $this->password === 'admin') {\n $resultCode = Result::SUCCESS;\n $identity = 'Admin';\n } else {\n $resultCode = Result::FAILURE_CREDENTIAL_INVALID;\n $identity = 'guest';\n }\n \n return new \\Zend\\Authentication\\Result($resultCode, $identity);\n }", "public function authUser()\n {\n //я не знаю почему, что эти функции возвращают пустые строки...\n //$login = mysql_real_escape_string($_POST['login']);\n //$password = mysql_real_escape_string($_POST['password']);\n $login = $_POST['login'];\n $password = $_POST['password'];\n if(DBunit::checkLoginPassword($login, $password)){\n DBunit::createUserSession(DBunit::getUser($login, $password));\n return true;\n }\n else {\n return false;\n }\n }", "public function login() {\n\t\tif(!empty(Session::get('http_response'))) {\n\t\t\thttp_response_code(Session::get('http_response'));\n\t\t\tSession::delete('http_response');\n\t\t}\n\t\tif($_POST && isset($_POST['login']) && isset($_POST['password'])) {\n\t\t\t$user = $this->_model->getLogin(strtolower($_POST['login']));\n\t\t\tif($user && $user->enabled) {\n\t\t\t\tif(hash_equals($user->password,crypt($_POST['password'],$user->password))) {\n\t\t\t\t\tif($user->blocked) {\n\t\t\t\t\t\thttp_response_code(403);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is blocked\"));\n\t\t\t\t\t} elseif($user->verified) {\n\t\t\t\t\t\tSession::set('user',$user);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'success','icon'=>'check','text'=>\"User has logged in successfully\"));\n\t\t\t\t\t\t$redirect = Session::get('login_redirect');\n\t\t\t\t\t\tRouter::redirect(Session::get('login_redirect'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is not yet confirmed\"));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thttp_response_code(401);\n\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t}\t\n\t\t}\n\t}", "public static function authenticate($username, $password) {\n $username = strtolower($username);\n $username = preg_replace('/ /', '_', $username);\n $password = Rock::hash($password);\n $result = Moedoo::select('user', ['user_username' => $username, 'user_password' => $password]);\n $included = Moedoo::included(true);\n\n if (count($result) === 1) {\n $user = $result[0];\n $userGroup = $included['user_group'][$user['user_group']];\n\n if ($user['user_status'] === false) {\n //-> user account has been suspended\n Rock::halt(401, 'account has been suspended');\n } elseif (is_null($user['user_group']) === true) {\n Rock::halt(401, 'account permission set can not be identified');\n } elseif ($userGroup['user_group_status'] === false) {\n Rock::halt(401, \"user group `{$userGroup['user_group_name']}` has been suspended\");\n } else {\n //-> all good, proceeding with authentication...\n $token = [\n 'iss' => Config::get('JWT_ISS'),\n 'iat' => strtotime(Config::get('JWT_IAT')),\n 'id' => $user['user_id'],\n ];\n\n $jwt = Firebase\\JWT\\JWT::encode($token, Config::get('JWT_KEY'), Config::get('JWT_ALGORITHM'));\n Rock::JSON(['jwt' => $jwt, 'user' => $user], 202);\n }\n } else {\n Rock::halt(401, 'wrong username and/or password');\n }\n }", "public function login()\n {\n $user = $this->repository->findBy(\n 'email',\n $this->request->input('email')\n );\n if(empty($user)) {\n throw new AuthException(\"These credentials do not match our records.\");\n }\n\n if(app('hash')->check($this->request->input('password'), $user->password)) {\n return $this->respondSuccess([\n 'data' => [\n 'token' => $this->jwt($user->toArray())\n ]\n ]);\n }\n\n throw new AuthException(\"These credentials do not match our records.\");\n\n }", "public function authForUser( $user ){ return $user->authForDB( $this ); }", "public function testAuthenticateUser ()\n {\n $result = $this->storage->authenticateUser($this->accessId1, $this->signature1, $this->stringToSign1);\n $this->assertEquals($this->accessId1, $result['access_key']);\n }", "public function authenticate(){\n\t\t// also return typeOfUser???\n\n\t\t// if user is logged\n\t\tif($this->model->isUserLogged($this->view->getServerInfo())){\n\t\t\t\n\t\t\t/* Use Case 2 Logging out an authenticated user */\n\t\t\treturn $this->logoutUser();\n\t\t\t\n\t\t// if user wants to register\n\t\t} else if($this->view->userGoRegister()){\n\t\t\t\n\t\t\treturn $this->view->showRegisterPage();\n\t\t\n\t\t// if user tries to save new credentials\n\t\t} else if($this->view->userTryRegister()){\n\t\n\t\t\treturn $this->doRegister();\n\t\n\t\t// if user is out logged and...\n\t\t} else {\n\t\t\t\n\t\t\t// ...has stored credentials\n\t\t\tif($this->view->hasStoredCredentials()){\n\t\t\t\t\n\t\t\t\t/* Use Case 3 Authentication with saved credentials */\n\t\t\t\treturn $this->authCredUser();\n\t\t\t\t\n\t\t\t// ...does not have stored credentials\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t/* Use Case 1 Authenticate user */\n\t\t\t\treturn $this->authUser();\n\t\t\t}\n\t\t}\n\t}", "public function testUserCanLoginWithCorrectCredential()\n {\n $password = 'boss';\n \n $user = factory(User::class)->create();\n $login = factory(Login::class)->create([\n 'password' => bcrypt($password),\n 'user_id' => $user->id,\n ]);\n\n $response = $this->from('/login')->post(route('login'), [\n 'email' => $login->email,\n 'password' => $password,\n ]);\n\n $response->assertRedirect('/');\n $this->assertAuthenticated();\n }", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->UserName,$this->passWd);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tuser()->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function authenticate()\n {\n /* authenticate if the login credentials are correct */\n $db = Sweia::getInstance()->getDB();\n $args = array(\n \":email\" => $this->getEmail(),\n \":password\" => $this->password\n );\n $sql = \"SELECT email,uid FROM \" . SystemTables::DB_TBL_USER . \" WHERE email = ':email' AND password = ':password' AND status != 4 LIMIT 1\";\n $res = $db->query($sql, $args);\n if ($res && $db->resultNumRows($res) == 1)\n {\n $data = $db->fetchObject($res);\n $this->uid = 1;\n return true;\n }\n\n return false;\n }", "function authenticate(string $username, string $password): IIdentity;", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->username,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function authenticate()\n\t{\n\t if ($this->isAuthenticated) return true;\n\t \n\t\t$username = strtolower($this->username);\n\t $user = User::model()->find('LOWER(username) = ?', array($username));\n\t\t\n\t\tif ($user === null)\n\t\t\t$this->errorCode = self::ERROR_USERNAME_INVALID;\n\t\telseif ($user->password != md5($this->password))\n\t\t\t$this->errorCode = self::ERROR_PASSWORD_INVALID;\n\t\telse {\n\t\t\t$this->errorCode = self::ERROR_NONE;\n\t\t\t$this->_id = $user->id;\n\t\t\t$this->setUserStates($user);\n\t\t\t$user->afterLogin();\n\t\t}\n\t\treturn !$this->errorCode;\n\t}", "public function authenticate() {\n \n $user = UserMaster::model()->findByAttributes(array('user_name' => $this->username));\n if ($user === null) { // No user found!\n $this->errorCode = self::ERROR_USERNAME_INVALID;\n } else if ($user->user_pass !== base64_encode($this->password)) { // Invalid password!\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n } else {\n /**\n * @desc: Start the Session Here\n */\n $session = new CHttpSession;\n $session->open();\n /**\n * @desc: User Full Name\n */\n $session[\"fullname\"] = ucfirst($user->first_name);\n /**\n * @desc: User ID\n */\n $session[\"uid\"] = $user->u_id;\n /**\n * @desc: User Role Id for ACL Management\n */\n $session[\"rid\"] = $user->ur_id;\n /**\n * @desc : User name\n */\n $session[\"uname\"] = $user->first_name;\n $this->setState('id', $user->ur_id);\n $this->errorCode = self::ERROR_NONE;\n }\n return !$this->errorCode;\n }", "public function doAuthentication();", "function login($username, $password)\n\t{\n\t\tglobal $access, $xnyo_parent, $input;\n\n\t\t// debug\n\t\tif (XNYO_DEBUG) $xnyo_parent->debug('Authenticating user, running checks.');\n\n\t\t// Check for blank username\n\t\tif (empty($username))\n\t\t{\n\t\t\n\t\t\t// Drop warning into the logs, return error status to the user\n\t\t\t$xnyo_parent->trigger_error('Blank Username', NOTICE);\n\t\t\t$this->error = XNYO_AUTH_BLANK_USERNAME;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Check for blank password\n\t\tif (empty($password))\n\t\t{\n\t\t\t// Drop warning into the logs, return error status to the user\n\t\t\t$xnyo_parent->trigger_error('Blank Password', NOTICE);\n\t\t\t$this->error = XNYO_AUTH_BLANK_PASSWORD;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// run security checking functions over the username\n\t\tif (XNYO_DEBUG) $xnyo_parent->debug('Running security over username/password.');\n\t\t$username = $input->username($username);\n\t\t\n\t\t// Run less tight security over the password as it may contain non alpha-numeric characters\n\t\t$password = $input->password($password);\n\t\t\n\t\t\n\t\t// include warez\n\t\tif (!isset($xnyo_parent->auth_type))\n\t\t{\n\t\t\t$xnyo_parent->trigger_error('No authentication type selected', WARNING);\n\t\t\t$this->error = XNYO_AUTH_NO_AUTH_TYPE;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// load the fucking plugin, moron\n\t\tif (!$xnyo_parent->load_plugin($xnyo_parent->auth_type, 'auth'))\n\t\t{\n\t\t\t$xnyo_parent->trigger_error('Unable to load plugin for selected authentication type ('.$xnyo_parent->auth_type.')', WARNING);\n\t\t\t$this->error = XNYO_AUTH_NO_PLUGIN;\n\t\t\treturn false;\n\t\t}\n\n\t\t// debug\n\t\tif (XNYO_DEBUG) $xnyo_parent->debug('Loaded auth plugin <i>'.$xnyo_parent->auth_type.'</i>, calling it now.');\n\n\t\t// auth the user\n\t\t$class = \"_auth_\".$xnyo_parent->auth_type.\"_handler\";\n\t\t$details = $xnyo_parent->$class->login($username, $password, $xnyo_parent->auth_params);\n\t\t\n\t\t// invalid login if false\n\t\tif (!$details)\n\t\t{\n\t\t\tif (empty($this->error) && !is_array($this->error_data))\n\t\t\t\t$this->error = XNYO_AUTH_INVALID;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// not in any groups, not authorised to use\n\t\tif (count($details['groups']) < 1)\n\t\t{\n\t\t\t$xnyo_parent->trigger_error('Unauthorised access attempted by '.$username, WARNING);\n\t\t\t$this->error = XNYO_AUTH_UNAUTHORISED;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//echo $details;\n\t\t//print_r($details);\n\t\t\n\t\t$xnyo_parent->user = $details;\n\n\t\t// store the username and groups in the session variables\n\t\t$xnyo_parent->user['user'] = $username;\n\t\t$xnyo_parent->user['browser'] = $_SERVER['HTTP_USER_AGENT'];\n\t\t$xnyo_parent->user['expiry'] = time() + $xnyo_parent->session_lifetime;\n\t\t$xnyo_parent->user['subnet'] = $access->subnet();\n\t\t//print_r($xnyo_parent->user);\n\t\t// authenticated, return ok\n\t\treturn true;\n\t}", "public function login()\n\t{\n\t\t//Compute the hash code of the password submited by user\n\t\t$user_password_hash = $this->passwordEncrypt($this->user_info['user_password']);\n\t\t\n\t\t//Do datebase query to get the hash code of the password\n\t\t$db = BFL_Database :: getInstance();\n\t\t$stmt = $db->factory('select `user_id`,`user_password` from '.DB_TABLE_USER.' WHERE `user_name` = :user_name');\n\t\t$stmt->bindParam(':user_name', $this->user_info['user_name']);\n\t\t$stmt->execute();\n\t\t$rs = $stmt->fetch();\n\t\tif (empty($rs))\n\t\t\tthrow new MDL_Exception_User_Passport('user_name');\n\t\t\n\t\tif ($rs['user_password'] != $user_password_hash)\n\t\t\tthrow new MDL_Exception_User_Passport('user_password');\n\n\t\t//Set user session\n\t\t$auth = BFL_ACL :: getInstance();\n\t\t$auth->setUserID($rs['user_id']);\n\t}", "public function authenticate( $user, $request, $response ) {\n\t\t// TODO: Implement authenticate() method.\n}", "public function authenticate() {\n\t\t \n\t\t$db = db_connect();\n $query= \"SELECT * FROM users WHERE username=:username AND password=:password\";\n $statement=$db->prepare($query);\n $statement->execute(array(\n 'username' => $_POST['username'],'password' => $_POST['password']\n ));\n $count=$statement->rowCount();\n if($count>0){\n $_SESSION['username']=$_POST['username'];\n $_SESSION['is authenticated']= true;\n\t\t}\n }", "public function authenticate();", "public function authenticate();", "public function authenticate();", "public function authenticate() {}", "public function auth($username, $password)\n {\n\n }", "public function authenticate()\n {\n $email = Input::get('email');\n $password = Input::get('password');\n $u = User::where('email', '=', $email)->first();\n if($u != null)\n {\n if($u->status == Config::get('constants.USER_STATUS_PENDING'))\n {\n return View::make('users.login')->with('message', 'Account not verified. Please verify your account first and try logging in again.');\n }\n elseif($u->status == Config::get('constants.USER_STATUS_BANNED'))\n {\n return View::make('users.login')->with('message', 'Account not authorized. Please contact admin to resolve any issues with your account.');\n }\n }\n if(Auth::attempt(array('email' => $email, 'password' => $password)))\n {\n $u->last_login = date('YmdHis');\n $u->save();\n return Redirect::intended('/');\n }\n return View::make('users.login')->with('message', 'Incorrect login details. Please try again.');\n }", "public function signInAction()\n {\n $userData = $this->manager->findOneBy(['username' => $this->httpParameters['login']]);\n\n //If no user were found, redirects\n if(empty($userData))\n {\n $this->response->redirect('/auth',HttpResponse::WRONG_LOGIN);\n }\n\n //Instantiates the user\n $user = new User($userData);\n\n //Checks if typed password matches user's password\n if($this->passwordMatch($this->httpParameters['loginPassword'],$user,'/auth'))\n {\n //Sets the user instance as a the new $_SESSION['user']\n $_SESSION['user'] = $user;\n\n $this->response->redirect('/admin');\n }\n }", "private function authCredUser(){\n\t\t\n\t\t// UC 3 1: User wants to authenticate with saved credentials\n\t\t\t// - System authenticates the user and presents that the authentication succeeded and that it happened with saved credentials\n\t\t$inpName = $this->view->getInputName(true);\t\n\t\t$inpPass = $this->view->getInputPassword(true);\n\n\t\t$answer = $this->model->loginCredentialsUser($inpName, $inpPass, $this->view->getServerInfo());\n\t\t\n\t\tif($answer == null){\n\t\t\t$this->view->showLogin(false);\n\t\t\t\n\t\t} else if($answer == true){\t\t\n\t\t\t$this->view->storeMessage(\"Inloggning lyckades via cookies\");\n\t\t\treturn $this->view->showLogin(true);\n\t\t} else {\t\t\n\t\t\t// 2a. The user could not be authenticated (too old credentials > 30 days) (Wrong credentials) Manipulated credentials.\n\t\t\t\t// 1. System presents error message\n\t\t\t\t// Step 2 in UC 1\t\t\t\t\n\t\t\t$this->view->removeCredentials();\n\t\t\t$this->view->storeMessage(\"Felaktig eller föråldrad information i cookie\");\n\t\t\treturn $this->view->showLogin(false);\n\t\t}\n\t}", "public function authenticate_user($username = '', $password = '', $encrypted = true)\n {\n return $this->call_method(\"authenticate/user\",\n array('username' => $username,\n 'password' => $password,\n 'encrypted' => $encrypted,\n )\n );\n }", "public function login($username, $password)\r\n\t{\r\n\t\t// Make sure we have something to work with\r\n\t\tif(!strlen($username) || !strlen($password)) return $this->user = false;\r\n\t\t\r\n\t\t// Check who the user is and if the password is right\r\n\t\t$username = mysql_real_escape_string($username);\r\n\t\t$password = hash(HASH_ALGO, $password . $username);\r\n\t\t$query = 'SELECT id,username,userlevel,email,realname,country,linkedin_id,linkedin_url FROM users WHERE username=\"' . $username\r\n\t\t\t\t\t. '\" AND password=\"' . $password . '\" LIMIT 1';\r\n\t\t$res = mysql_query($query) or die('Bad SQL Query on login attempt');\r\n\t\t$res = mysql_fetch_array($res);\r\n\t\tif($res === false) return $this->user = false;\r\n\r\n\t\t// Credentials OK. Approve the login.\r\n\t\t$this->user = new User();\r\n\t\t$this->user->id = $res['id'];\r\n\t\t$this->user->username = $res['username'];\r\n\t\t$this->user->email = $res['email'];\r\n\t\t$this->user->userlevel = $res['userlevel'];\r\n\t\t$this->user->realname = $res['realname'];\r\n\t\t$this->user->country = $res['country'];\r\n\t\t$this->user->linkedin_id = $res['linkedin_id'];\r\n\t\t$this->user->linkedin_url = $res['linkedin_url'];\r\n\t\t\r\n\t\t$query = 'UPDATE users SET fingerprint=\"' . genPrint() . '\" WHERE id=' . $this->user->id . ' LIMIT 1';\r\n\t\t$res = mysql_query($query) or die('Bad SQL Query on login approval');\r\n\t\tsetcookie('qw_login', $this->user->id, time()+60*60*24*365, '/');\r\n\t\treturn true;\r\n\t}", "public function Authenticate()\n {\n try\n {\n // check if we're already authenticated\n if( !$this->IsAuthenticated() )\n {\n // check for cookie\n if( isset( $_COOKIE[ 'CUTOKENTNG' ] ) )\n {\n // check if the user is valid\n ini_set( 'soap.wsdl_cache_enabled', 0 );\n $oClient = new SoapClient( 'http://login.clemson.edu/authdotnet.php?wsdl' );\n $oResult = $oClient->verifyAuthToken( $_COOKIE[ 'CUTOKENTNG' ] );\n\n // if the user is not valid, redirect them\n if( !empty( $oResult->ERROR ) )\n {\n // redirect to login.clemson.edu\n $this->LoginRedirect();\n }\n else\n {\n // save the user id\n $this->SetUser( $oResult->USERID );\n }\n }\n else\n {\n // redirect to login.clemson.edu\n $this->LoginRedirect();\n }\n }\n }\n catch( Exception $oException )\n {\n throw cAnomaly::BubbleException( $oException );\n }\n }", "public function authenticate($userParams = [], $isRememberMe = false, $isAdmin = false)\r\n\t{\r\n\t\t$userColumns = $isAdmin ? ['account' => $userParams['account'], 'rank' => $this->administratorToken] : ['account' => $userParams['account']];\r\n\t\t\r\n\t\t$user = $this->classMapper->staticMethod('user', 'where', $userColumns)->first();\r\n\t\t\r\n\t\tif (!$user) {\r\n\t\t\tthrow new InvalidCredentialsException();\r\n\t\t}\r\n\t\t\r\n\t\tif (!$user->password) {\r\n\t\t\tthrow new InvalidCredentialsException();\r\n\t\t}\r\n\r\n\t\tif (!Validator::validateBoolean($user->flag_enabled)) {\r\n\t\t\tthrow new AccountDisabledException();\r\n\t\t}\r\n\r\n\t\tif (!Validator::validateBoolean($user->flag_verified)) {\r\n\t\t\tthrow new AccountNotVerifiedException($user);\r\n\t\t}\r\n\r\n\t\tif (!Password::verify($userParams['password'], $user->password)) {\r\n\t\t\tthrow new InvalidCredentialsException();\r\n\t\t}\r\n\r\n\t\t$this->requestLogin($user, $isRememberMe);\r\n\t\treturn $user;\r\n\t}", "public function authenticate()\n {\n $core = Zend_Controller_Front::getInstance()->getParam(\"bootstrap\")->getResource(\"core\");\n /* @var $response Adsolut_Http_Response */\n $response = $core->get($this->endpoint, \n array(\n 'email' => $this->username,\n 'password' => $this->password));\n $result = Zend_Auth_Result::FAILURE;\n if (!$response->hasErrors()) {\n $result = Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND;\n $data = $response->getData();\n if (!empty($data)) {\n $result = Zend_Auth_Result::SUCCESS;\n }\n } \n return new Zend_Auth_Result($result, $response->getData());\n }", "public function loginUser()\n {\n\n $user = factory(User::class)->create();\n\n return Auth::login($user, true);\n\n\n }", "function user_login($username,$password,$redirect='/'){\n\t$app = \\Jolt\\Jolt::getInstance();\n\t$user = $app->db->findOne('user', array('login'=>$username) );\n\tif( $user['pass'] == passhash($password) ){\n\t\t$app->store( \"user\",$user['_id'] );\n\t\t$app->redirect( $redirect );\n\t}else{\n\t\t$app->redirect( $app->getBaseUri().'/login');\n\t}\n\n}", "function auth($username, $password) {\n\n if ($password == 'password') { \n return true;\n }\n return false;\n\n}", "public function authByUserPassword($password) {}", "public function authenticateExistingUser(UserInterface $drupal_user) {\n // If Admin (user 1) can not authenticate.\n if ($this->isAdminDisabled($drupal_user)) {\n $this->nullifySessionKeys();\n $this->messenger->addError($this->t('Authentication for Admin (user 1) is disabled.'));\n\n $this->response = $this->getLoginFormRedirection();\n\n return;\n }\n\n // If user can not login because of their role.\n $disabled_role = $this->isUserRoleDisabled($drupal_user);\n if ($disabled_role) {\n $this->messenger->addError($this->t(\"Authentication for '@role' role is disabled.\", ['@role' => $disabled_role]));\n\n $this->response = $this->getLoginFormRedirection();\n\n return;\n }\n\n // If user could be logged in.\n if ($this->loginUser($drupal_user)) {\n $this->response = $this->getPostLoginRedirection();\n }\n else {\n $this->nullifySessionKeys();\n $this->messenger->addError($this->t('Your account has not been approved yet or might have been canceled, please contact the administrator.'));\n\n $this->response = $this->getLoginFormRedirection();\n }\n }", "public function authenticateUser(string $userName, string $password) : bool {\n $result = false;\n foreach ($this->users as $user => $value) {\n if ($userName == $value[self::$usernameVal] && $this->verifyHashedPassword($value[self::$passwordVal], $password)) {\n $result = true;\n }\n }\n return $result;\n }", "public function authUser(){\n if(!isset($this->sessionBool) || empty($this->sessionBool)){\n die($this->alerts->ACCESS_DENIED);\n }else{\n if(!$this->sessionBool){\n die($this->alerts->ACCESS_DENIED);\n }\n } \n }", "public function authenticate() {\n $email = Input::get('email');\n $password = Input::get('password');\n $remember = Input::get('remember');\n\n $validator = Validator::make([\n 'email' => $email,\n 'password' => $password,\n ], [\n 'email' => 'required | email',\n 'password' => 'required'\n ]);\n\n if ($validator->fails()) {\n return redirect()->back()->withErrors($validator->messages())->withInput();\n }\n\n if (!Auth::attempt(['email' => $email, 'password' => $password, 'role' => 'admin'], $remember)) {\n return redirect()->intended('/login')->withErrors('Email or Password is invalid');\n }\n\n return redirect()->intended('/admin/dashboard');\n }", "function auth($username,$password)\r\n{\r\n $user = getUserByUsername($username);\r\n if($user){\r\n //return $user[4] == md5($password);\r\n return $user[5] == $password;\r\n\r\n }\r\n}", "public function auth()\n {\n $email = $this->loginEntry->input('email');\n $password = $this->commonFunction->generateHash($this->loginEntry->input('pass'));\n \n $info = $this->userDetail->getDetail($email, $password);\n if (count($info) == 1) \n {\n $this->commonFunction->setSession($info->id, $info->user_name);\n return redirect('/dashboard'); \n } \n echo '<script language=\"javascript\">';\n echo 'alert(\"Username/Password does not match.\")';\n echo '</script>';\n return redirect('/login');\n }", "public function login()\n {\n if ($this->getCurrentUser()->get('id')) {\n $this->redirect($this->Auth->redirectUrl());\n }\n\n if ($user = $this->Auth->identify()) {\n $this->Auth->setUser($user);\n\n // set cookie\n if (!empty($this->getRequest()->getData('remember_me'))) {\n if ($CookieAuth = $this->Auth->getAuthenticate('Lil.Cookie')) {\n $CookieAuth->createCookie($this->getRequest()->getData());\n }\n }\n } else {\n if ($this->getRequest()->is('post') || env('PHP_AUTH_USER')) {\n $this->Flash->error(__d('lil', 'Invalid username or password, try again'));\n }\n }\n\n if ($this->getCurrentUser()->get('id')) {\n $redirect = $this->Auth->redirectUrl();\n $event = new Event('Lil.Auth.afterLogin', $this->Auth, [$redirect]);\n $this->getEventManager()->dispatch($event);\n\n return $this->redirect($redirect);\n }\n }", "public function authentificate($username, $password) {\r\n\r\n if ($username === '' || $username === null || $password === '' || $password === null)\r\n throw new InvalidUserAuthException();\r\n\r\n $this->getAdapter()\r\n ->setIdentity($username)\r\n ->setCredential(md5($password));\r\n\r\n $auth = new AuthenticationService;\r\n\r\n $result = $auth->authenticate($this->getAdapter());\r\n\r\n if ($result->isValid()) {\r\n $user = $auth->getIdentity();\r\n\r\n if (!$user->isActive()) {\r\n $this->logout();\r\n throw new InactiveUserAuthException($user);\r\n } else {\r\n return true;\r\n }\r\n } else {\r\n $this->logout();\r\n throw new InvalidUserAuthException();\r\n }\r\n }", "public function auth_user()\n {\n //echo $this->id;\n //echo $this->username. ' is authenticated';\n }", "public function loginUser($emailusername, $passwd) {\n\n $sql = \"SELECT * FROM users WHERE username=? OR email=?\";\n $stmt = $this->get()->prepare($sql);\n\n if ($stmt) {\n $stmt->execute([$emailusername, $emailusername]);\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\n\n if ($result) {\n $passCheck = password_verify($passwd, $result['passwd']);\n\n // Error check against password in the database\n if ($passCheck == false) {\n return [ \"status\" => 403, \"message\" => 'Invalid credentials' ];\n }\n else if ($passCheck == true) {\n\n // Create session\n $_SESSION['id'] = $result['id'];\n $_SESSION['username'] = $result['username'];\n $_SESSION['email'] = $result['email'];\n\n // Force a refresh on login.\n header('Location: index.php');\n exit();\n }\n }\n else {\n return [ \"status\" => 403, \"message\" => 'Invalid credentials' ];\n }\n }\n }", "public function authenticate() {\n $users = Users::model()->findByAttributes(array('username' => $this->username));\n if ($users == null) {\n $this->errorCode = self::ERROR_USERNAME_INVALID;\n } else if (!$users->validatePassword($this->password)) {\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n } else {\n $this->_id = $users->id;\n $this->setState('role_id', $users->role_id);\n $this->setState('role_name', $users->rRole->role_name);\n $this->setState('agent_id', $users->getAgentId());\n $this->setState('agent_id_array', $users->getAgentIds());\n $this->saveParamToSession($users);\n $this->errorCode = self::ERROR_NONE;\n }\n return !$this->errorCode;\n }", "public function test_user_can_login_with_true_credentials()\n {\n $user=User::factory()->create();\n $response = $this->postJson(route('auth.login') , [\n 'email'=>$user->email,\n 'password'=>'password',\n ]);\n\n $response->assertStatus(Response::HTTP_OK);\n }", "public function authenticate(Request $request) {\n $user = \\App\\User::where(function($q) use($request) {\n\t\t\t$q->where('email' , $request->email);\n\t\t\t$q->Where('role' , 'manager');\n\t\t})->where('password' , md5($request->password))->first();\n\n if ($user) {\n\n \\Auth::login($user );\n return view('/welcomeview');\n }\n\t\t\n\t\t$credentials = $request->only('username', 'password');\n if (\\Auth::attempt($credentials , $request->has('rememberme') )) {\t\t\t\n\t\t\t$user = \\App\\User::find(Auth::id());\n\t\t\t$user->password = md5($request->password);\n\t\t\t$user->save();\n\t\t\treturn redirect('/welcomeview');\n }\n\t\telse{\n return redirect('/')->withInput()->withErrors(['email'=>'Invalid Email Or Password']);\n }\n }", "public function login()\n {\n if ($this->validate()) {\n return User::setIdentityByAccessToken($this->user_id);\n }\n return false;\n }", "function authenticate() {}", "public function do_login()\n {\n $input = array(\n 'email' => Input::get( 'username' ), // May be the username too\n 'username' => Input::get( 'username' ), // so we have to pass both\n 'password' => Input::get( 'password' ),\n 'remember' => Input::get( 'remember' ),\n );\n\n // If you wish to only allow login from confirmed users, call logAttempt\n // with the second parameter as true.\n // logAttempt will check if the 'email' perhaps is the username.\n // Get the value from the config file instead of changing the controller\n if ( Confide::logAttempt( $input, Config::get('confide::signup_confirm') ) ) \n {\n // Redirect the user to the URL they were trying to access before\n // caught by the authentication filter IE Redirect::guest('user/login').\n // Otherwise fallback to '/'\n // Fix pull #145\n return Redirect::intended('/member'); // change it to '/admin', '/dashboard' or something\n }\n else\n {\n $user = new User;\n\n // Check if there was too many login attempts\n if( Confide::isThrottled( $input ) )\n {\n $err_msg = Lang::get('confide::confide.alerts.too_many_attempts');\n }\n elseif( $user->checkUserExists( $input ) and ! $user->isConfirmed( $input ) )\n {\n $err_msg = Lang::get('confide::confide.alerts.not_confirmed');\n }\n else\n {\n $err_msg = Lang::get('confide::confide.alerts.wrong_credentials');\n }\n \n return Redirect::action('UserController@login')\n ->withInput(Input::except('password'))\n ->with( 'error', $err_msg );\n }\n }", "protected function _authByUserPassword($userPassword = '') {}", "private function authenticate()\n {\n $this->_validator->setCredentials($this->_user, $this->_pass);\n if ($this->_validator->authenticate()) {\n $this->_accepted = true;\n }\n }", "public function authentication(): void\n {\n $userData = $this->getValidated([\n 'name',\n 'password',\n ]);\n\n $user = $this->getUserByName($userData['name']);\n\n if (password_verify($userData['password'], $user->password)) {\n NotificationService::sendInfo('Hello! You are logged in as ' . $user->name);\n $_SESSION['name'] = $user->name;\n $this->redirect(APP_URL);\n }\n\n NotificationService::sendError('failed authentication!');\n $_SESSION['login_modal_show'] = ' show';\n $this->redirect(APP_URL);\n }", "function authenticated() {\n switch (getConfig(\"auth_method\")) {\n case PASSWORD:\n // Static shared password authentication.\n requirePOST(\"pwd\");\n return password_verify($_POST[\"pwd\"], getConfig(\"password_hash\"));\n\n case HTPASSWD:\n // .htpasswd file based authentication.\n global $LANG;\n if (!isset($_POST[\"usr\"])) die($LANG[\"username_required\"]);\n requirePOST(\"pwd\", \"usr\");\n if (file_exists(getConfig(\"htpasswd_path\"))) {\n $file = fopen(getConfig(\"htpasswd_path\"), \"r\");\n $authed = false;\n while (($line = fgets($file)) !== false && !$authed) {\n $creds = explode(\":\", trim($line));\n if ($creds[0] == $_POST[\"usr\"]) {\n $authed = password_verify($_POST[\"pwd\"], $creds[1]);\n }\n }\n fclose($file);\n return $authed;\n }\n\n case LDAP:\n // LDAP-based authentication.\n global $LANG;\n if (!extension_loaded(\"ldap\")) die($LANG[\"ldap_extension_missing\"]);\n if (!isset($_POST[\"usr\"])) die($LANG[\"username_required\"]);\n requirePOST(\"pwd\", \"usr\");\n if (strlen($_POST[\"pwd\"]) == 0) die($LANG[\"incorrect_password\"]);\n\n // Connect to the LDAP server.\n $ldc = @ldap_connect(getConfig(\"ldap_uri\"));\n if ($ldc === false) die($LANG[\"ldap_config_error\"]);\n ldap_set_option($ldc, LDAP_OPT_PROTOCOL_VERSION, 3);\n ldap_set_option($ldc, LDAP_OPT_REFERRALS, 0);\n if (getConfig(\"ldap_start_tls\")) ldap_start_tls($ldc);\n\n // Bind the admin user.\n $ldbind = @ldap_bind($ldc, getConfig(\"ldap_bind_dn\"), getConfig(\"ldap_bind_pass\"));\n if ($ldbind === false) die($LANG[\"ldap_connection_failed\"]);\n\n // Search for the user.\n $ldsearch = @ldap_search($ldc, getConfig(\"ldap_base_dn\"), str_replace(\"%s\", ldap_escape($_POST[\"usr\"]), getConfig(\"ldap_user_filter\")), array(\"dn\"));\n if ($ldsearch === false) {\n ldap_unbind($ldc);\n die($LANG[\"ldap_search_failed\"]);\n };\n $ldentries = @ldap_get_entries($ldc, $ldsearch);\n if ($ldentries[\"count\"] == 0) {\n // No users matched; throw a generic \"incorrect password\"\n // message anyway to prevent user enumeration issues.\n ldap_unbind($ldc);\n die($LANG[\"ldap_user_unauthorized\"]);\n } elseif ($ldentries[\"count\"] > 1) {\n // Filter matched multiple users; most likely a misconfiguration\n // of the filter.\n ldap_unbind($ldc);\n die($LANG[\"ldap_search_ambiguous\"]);\n }\n\n // Bind as the user.\n $ldbind = @ldap_bind($ldc, $ldentries[0][\"dn\"], $_POST[\"pwd\"]);\n if ($ldbind === false) {\n ldap_unbind($ldc);\n die($LANG[\"ldap_user_unauthorized\"]);\n }\n\n // Successful authentication and authorization.\n ldap_unbind($ldc);\n return true;\n\n default:\n return false;\n }\n}", "public function authenticateByUsernamePassword(string $username, string $password): self;", "function test_authourization_fun( $vars ){\r\n\r\n if (isset($_GET['user']) && $_GET['user']){\r\n $_SERVER[\"PHP_AUTH_USER\"] = $_GET['user'];\r\n }else{\r\n $_SERVER[\"PHP_AUTH_USER\"] = 'NOUSER';\r\n }\r\n if (isset($_GET['pw']) && $_GET['pw']){\r\n $_SERVER[\"PHP_AUTH_PW\"] = $_GET['pw'];\r\n }else{\r\n $_SERVER[\"PHP_AUTH_PW\"] = 'ERRORPASSWORD';\r\n }\r\n}", "public function log_in() {\n\n // Check if the user exists on the database\n if (!$this->does_exist('username')) {\n return \"Username does not exist\";\n }\n\n $user = User::find($this->username, 'username');\n\n // If password matches\n if ($user->password !== $this->password) {\n return \"Sorry, password does not match\";\n }\n\n return true;\n }", "public function authenticateLogin($username, $password) {\n\t\t// hash password - use standard md5 for now\n\t\t$hashedPassword = md5($password); \n\t\treturn $this->_user_factory->authenticateLogin($username, $hashedPassword);\n\t}", "public function authenticate()\n {\n try\n \t{\n \t\t$user = AdminUser::authenticate($this->_username, $this->_password);\n \t\t$result = new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $user, array());\n \t\treturn $result;\n \t}\n catch (Exception $e)\n {\n \tswitch ($e->getMessage())\n \t{\n \t\tcase AdminUser::WRONG_PW:\n \t\tcase AdminUser::NOT_FOUND:\n \t\t\treturn new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, null, array());\n \t\t\tbreak;\n \t}\n\n throw $e;\n }\n }", "public function authenticate()\n {\n $allowOverride = $this->shardServiceManager->getAllowOverride();\n $this->shardServiceManager->setAllowOverride(true);\n\n $sysUser = new User;\n $sysUser->addRole('sys::authenticate');\n $this->shardServiceManager->setService('user', $sysUser);\n \n $this->doctrineAdapter->setIdentity($this->identity);\n $this->doctrineAdapter->setCredential($this->credential);\n $result = $this->doctrineAdapter->authenticate();\n \n if ($result->isValid()) {\n $this->shardServiceManager->setService('user', $result->getIdentity());\n } else {\n $sysUser->removeRole('sys::authenticate');\n }\n $this->shardServiceManager->setAllowOverride($allowOverride);\n \n return $result;\n }", "function interal_authentication( $username, $password, $remember = false )\n{\n\t//redirect if successful already\n\tif(is_user_logged_in()) { redirect( Router::url(array('controller'=>'user','action'=>'profile')) ); }\n\tif(login_has_error()) return false;\n\t\n\t$user = FiveTable::getInstance('user');\n\tif (!$user->authenticate( $username, $password ))\n\t{\n\t\tset_error( $user->getErrors() ); \n\t\tlogin_has_error(1);\n\t}\n\telse\n\t{\n\t\t//success\n\t\tredirect( Router::url(array('controller'=>'user','action'=>'profile')) );\n\t}\n}", "public function authenticate()\n\t{\n\t\t$this->record = User::model()->findByAttributes(\n\t\t\tarray(\"username\" => $this->username)\n\t\t);\n\t\t\n\t\t// controleer record\n\t\tif($this->record === null){\n\t\t\t$this->errorCode = self::ERROR_USERNAME_INVALID;\n\t\t}else if($this->record->password !== User::encrypt($this->password)){\n\t\t\t$this->errorCode = self::ERROR_PASSWORD_INVALID;\n\t\t}else{\n\t\t\t$this->_id = $this->record->id;\n\t\t\t$this->errorCode = self::ERROR_NONE;\n\t\t}\n\t\t\n\t\treturn !$this->errorCode;\n\t}" ]
[ "0.6910684", "0.6747703", "0.6731109", "0.66322005", "0.66122454", "0.65927655", "0.6576096", "0.65335304", "0.65280175", "0.6524533", "0.6501626", "0.6488619", "0.6488619", "0.64870036", "0.64792305", "0.6460366", "0.6458286", "0.64514524", "0.6441598", "0.64366984", "0.6406821", "0.64041185", "0.6402564", "0.6387966", "0.6387212", "0.6387114", "0.6377128", "0.63703346", "0.6364692", "0.635566", "0.63510567", "0.6348502", "0.6347201", "0.63359416", "0.63279283", "0.6306167", "0.63020396", "0.62875426", "0.62609756", "0.62591946", "0.62569636", "0.62338644", "0.62282294", "0.6218501", "0.6218021", "0.6215624", "0.6215276", "0.62066036", "0.6162379", "0.6158267", "0.6157887", "0.61385953", "0.6128537", "0.6123231", "0.6120411", "0.61083823", "0.6106986", "0.6106986", "0.6106986", "0.61055875", "0.61003053", "0.6097807", "0.60939324", "0.6093505", "0.6087783", "0.60748935", "0.60717124", "0.60648715", "0.60644853", "0.6062662", "0.6061295", "0.60604876", "0.60602415", "0.6027095", "0.6025498", "0.6017299", "0.601713", "0.6012775", "0.60100204", "0.6005538", "0.60045093", "0.6003648", "0.59992856", "0.5997437", "0.5996291", "0.59934574", "0.59848785", "0.5984661", "0.5980275", "0.59788364", "0.59780073", "0.59667975", "0.5964148", "0.59607595", "0.5959983", "0.59541225", "0.59442604", "0.594249", "0.5936731", "0.5934324", "0.5933907" ]
0.0
-1
1 = CSV import error
public static function addErrorRowToDatabase($data, $errorType) { // 2 = no source_fiscal // 3 = contract_value is 0 // 4 = manual error flag if (! isset($data['sourceOrigin'])) { $data['sourceOrigin'] = 1; } $defaults = [ 'uuid' => null, 'ownerAcronym' => '', 'referenceNumber' => null, 'contractValue' => 0, 'sourceYear' => null, 'sourceQuarter' => null, 'sourceFiscal' => null, 'sourceOrigin' => null, 'sourceCsvFilename' => null, ]; $data = array_merge($defaults, $data); $output = [ 'json_id' => $data['uuid'], 'owner_acronym' => $data['ownerAcronym'], 'reference_number' => $data['referenceNumber'], 'contract_value' => $data['contractValue'], 'source_year' => $data['sourceYear'], 'source_quarter' => $data['sourceQuarter'], 'source_fiscal' => $data['sourceFiscal'], 'source_origin' => $data['sourceOrigin'], 'source_csv_filename' => $data['sourceCsvFilename'], 'row_created_at' => date('Y-m-d H:i:s'), 'gen_is_error' => 1, 'gen_error_via' => intval($errorType), ]; DB::table('l_contracts')->insert($output); try { return true; } catch (\Illuminate\Database\QueryException $e) { // dd($output); echo "Failed to add error row (query exception) \n"; return false; } catch (PDOException $e) { echo "Failed to add error row (PDO exception) \n"; return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function importcsv()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t// Reads the content which has been uploaded to the tmp file into a text var\n\t\t\t$content = file_get_contents($this->file['tmp_name']);\n\t\t\tunlink($this->file['tmp_name']);\t\t\t\t//delete tmp file\n\n\t\t\t$rows\t\t= $this->cvs2array($content, ';');\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t}", "function import_csv()\n {\n $msg = 'OK';\n $path = JPATH_ROOT.DS.'tmp'.DS.'com_condpower.csv';\n if (!$this->_get_file_import($path))\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_UPLOAD_IMPORT_CSV_FILE'));\n }\n// $_data = array(); \n if ($fp = fopen($path, \"r\"))\n {\n while (($data = fgetcsv($fp, 1000, ';', '\"')) !== FALSE) \n {\n unset($_data);\n $_data['virtuemart_custom_id'] = $data[0];\n $_data['virtuemart_product_id'] = $data[1];\n $id = $this->_find_id($_data['virtuemart_custom_id'],$_data['virtuemart_product_id']);\n if((int)$id>0)\n {\n $_data['id'] = $id;\n }\n// $_data['intvalue'] = iconv('windows-1251','utf-8',$data[3]);\n $_data['intvalue'] = str_replace(',', '.', iconv('windows-1251','utf-8',$data[3]));\n if(!$this->_save($_data))\n {\n $msg = 'ERROR';\n }\n }\n fclose($fp);\n }\n else\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_OPEN_TO_IMPORT'));\n }\n return array(TRUE,$msg);\n }", "function bit_admin_import_csv( $playid ) {\n}", "protected function initCSV() {}", "function verifyCSV($csv, $action, $choice, $cm) {\n\tif ($action = 'importassignments') {\n\t\t$data = parse_assignment_csv($csv, $choice, $cm);\n\t\t$errors = $data->errors;\t\t\n\t\treturn $errors;\n\t} else\n\t\treturn array('Not implemented!');\n}", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "public function __construct()\n {\n parent::__construct(\"CSV headers and rows did not match up.\");\n }", "public function actionImportFromCsv()\n {\n HBackup::importDbFromCsv($this->csvFile);\n }", "public function testMalformedFilePath() {\n $configuration = [\n 'path' => 'non-existent-path',\n 'ids' => ['id'],\n ];\n\n $csv = new CSV($configuration, $this->pluginId, $this->pluginDefinition, $this->migration);\n $this->expectException(Warning::class);\n $this->expectExceptionMessage('fopen(non-existent-path): failed to open stream: No such file or directory');\n $csv->initializeIterator();\n }", "private function importCSV($filename)\n\t{\n\t\t$path = $this->localdir . \"/\" . $filename;\n\t\tif (file_exists($path)) {\n\t\t\t$files = $this->csv_to_array($path, $this->separator);\n// \t\t\tVideodeskCall::importCsv($files, $this->shop->id);\n\t\t\tVideodeskCall::importCsv($files, 1);\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function Quick_CSV_import($file_name=\"\")\r\n {\r\n $this->file_name = $file_name;\r\n\t\t$this->source = '';\r\n $this->arr_csv_columns = array();\r\n $this->use_csv_header = true;\r\n $this->field_separate_char = \",\";\r\n $this->field_enclose_char = \"\\\"\";\r\n $this->field_escape_char = \"\\\\\";\r\n $this->table_exists = false;\r\n }", "function import_csv($obj)\n\t{\n\t\t$param_array = func_get_args();\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::import_csv() - PARAMETER LIST : ', $param_array);\n\t\t\n\t\t\t$row = 0;\n\t\t\t\n\t\t\t$handle = fopen($obj->csv_file_path, \"r\");\n\t\t\t\n\t\t\twhile (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) \n\t\t\t{\n\t\t\t\t\n\t\t\t\tif($row > 0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$res = $this->fetch_flds($obj->cls_tbl, $obj->primary_fld, $obj->primary_fld . \" = '\" . $data[0] . \"'\");\n\t\t\t\t\t\n\t\t\t\t\tif($res[1] > 0)\n\t\t\t\t\t{//update the record\n\t\t\t\t\t\t$cond = $obj->primary_fld . \" = '\" . $data[0] . \"'\";\n\t\t\t\t\t\tdatabase_manipulation::update_record($obj, $cond, \"csv\", $data);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{//insert the record\n\t\t\t\t\t\tdatabase_manipulation::insert_record($obj, \"csv\", $data);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t$row++;\n\t\t\t}\n\t\t\t\n\t\t\tfclose($handle);\n\t\t\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::import_csv() - Return Value : ', 'Importing Csv Data Into the Database.', true);\n\n\t}", "public function importCsv()\n {\n $file = fopen($_FILES['csvFile']['tmp_name'], \"r\");\n $payments = array();\n while (!feof($file)) {\n $row = fgetcsv($file, 0, \"\\t\");\n if (count($row) == 14 && $row[0] != \"Kirjauspäivä\") {\n $dateOfPayment = new \\DateTime($row[2]);\n $values = array(\n 'date_of_payment' => $dateOfPayment->format('Y-m-d H:i:s'),\n 'amount' => $this->makeFloat($row[3]),\n 'reference_number' => $row[8],\n 'amount_left' => 0,\n );\n $payments[] = new Payment($values);\n }\n }\n fclose($file);\n $insert = $this->paymentRepository->insert($payments);\n if ($insert !== true) {\n $message = \"Maksujen kirjaamisessa tapahtui virhe.<br />\" . $insert;\n $error = array(\"error\" => $message);\n ErrorService::setErrors($error);\n return;\n }\n Redirect::to(\"/maksut/syotto\", array(\"success\" => \"Maksut kirjattu onnistuneesti.\"));\n\n }", "public function importData(){\n $status = false;\n\n // rtrim(); for arrays (removes empty values) from the end\n $rtrim = function($array = [], $lengthMin = false){\n $length = key(array_reverse(array_diff($array, ['']), 1))+1;\n $length = $length < $lengthMin ? $lengthMin : $length;\n return array_slice($array, 0, $length);\n };\n\n if(static::$enableDataImport){\n $filePath = $this->getF3()->get('EXPORT') . 'csv/' . $this->getTable() . '.csv';\n\n if(is_file($filePath)){\n $handle = @fopen($filePath, 'r');\n $keys = array_map('lcfirst', fgetcsv($handle, 0, ';'));\n $keys = $rtrim($keys);\n\n if(count($keys) > 0){\n $tableData = [];\n while (!feof($handle)) {\n $tableData[] = array_combine($keys, $rtrim(fgetcsv($handle, 0, ';'), count($keys)));\n }\n // import row data\n $status = $this->importStaticData($tableData);\n $this->getF3()->status(202);\n }else{\n $this->getF3()->error(500, 'File could not be read');\n }\n }else{\n $this->getF3()->error(404, 'File not found: ' . $filePath);\n }\n }\n\n return $status;\n }", "public function import(){\r\n $logs = array();\r\n $data = $this->data;\r\n if($this->__isCsvFileUploaded()){\r\n $logs[] = 'Loading model.User and model.Group ...';\r\n $this->loadModel('User');\r\n $this->loadModel('Group');\r\n extract($this->Student->import(array(\r\n 'data' => $this->data,\r\n 'log' => 'database',\r\n 'logs' => &$logs,\r\n 'user' => &$this->User,\r\n 'group' => &$this->Group,\r\n 'password' => $this->Auth->password('000000'),\r\n 'merge' => $this->data['User']['merge']\r\n )));\r\n }elseif($this->data){\r\n $logs[] = 'Error: No valid file provided';\r\n $logs[] = 'Expecting valid CSV File encoded with UTF-8';\r\n }\r\n $this->set(compact('logs', 'data'));\r\n }", "private function validateImportFile($pathToImportFile)\n {\n $requiredColumns = [ 0,1,2 ];\n if (($fileHandle = fopen($pathToImportFile,\"r\")) !== FALSE)\n {\n $row = 0;\n while (($data = fgetcsv($fileHandle, 8096, \",\")) !== FALSE) {\n $row++;\n foreach ($requiredColumns as $colNumber) {\n if (trim($data[$colNumber]) == '') {\n throw new InvalidArgumentException(\"In the inventory import, column number \" . ($colNumber + 1) . \" is required, and it is empty on row $row.\");\n }\n }\n if ((count($data) % 2) !== 0)\n {\n throw new InvalidArgumentException(\"There is an odd number of columns on row \" . ($row+1) . \", which is not valid.\");\n }\n }\n }\n else\n {\n throw new InvalidArgumentException(\"Could not open import file.\");\n }\n\n return;\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}", "public function acfedu_import_raw_data() {\n\t\t\t\tif ( isset( $_POST[\"import_raw_nonce\"] ) ) {\n\t\t\t\t\tif ( ! wp_verify_nonce( $_POST[\"import_raw_nonce\"], 'import-raw-nonce' ) ) {\n\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_no_nonce_match', esc_html__( 'Something went wrong, please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( isset( $_POST['verify'] ) ) {\n\t\t\t\t\t\t\t$verify_data = acfedu_verify_csv_data( $_POST['raw_csv_import'] );\n\t\t\t\t\t\t\tif ( false != $verify_data ) {\n\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_csv_valid', esc_html__( 'Congratulations, your CSV data seems valid.', 'acf-faculty-selector' ) );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} elseif ( isset( $_POST['import'] ) ) {\n\n\t\t\t\t\t\t\t$verified_data = acfedu_verify_csv_data( $_POST['raw_csv_import'] );\n\t\t\t\t\t\t\tif ( false != $verified_data ) {\n\t\t\t\t\t\t\t\t// import data\n\t\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\t\t$line_number = 0;\n\t\t\t\t\t\t\t\tforeach ( $verified_data as $line ) {\n\t\t\t\t\t\t\t\t\t$line_number ++;\n\n\t\t\t\t\t\t\t\t\t$faculty = $line[0];\n\t\t\t\t\t\t\t\t\t$univ_abbr = $line[1];\n\t\t\t\t\t\t\t\t\t$univ = $line[2];\n\t\t\t\t\t\t\t\t\t$country_abbr = $line[3];\n\t\t\t\t\t\t\t\t\t$country = $line[4];\n\t\t\t\t\t\t\t\t\t$price = $line[5];\n\n\t\t\t\t\t\t\t\t\t$faculty_row = array(\n\t\t\t\t\t\t\t\t\t\t'faculty_name' => $faculty,\n\t\t\t\t\t\t\t\t\t\t'univ_code' => $univ_abbr,\n\t\t\t\t\t\t\t\t\t\t'univ_name' => $univ,\n\t\t\t\t\t\t\t\t\t\t'country_code' => $country_abbr,\n\t\t\t\t\t\t\t\t\t\t'country' => $country,\n\t\t\t\t\t\t\t\t\t\t'price' => $price,\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\t\t\t$wpdb->insert( $wpdb->prefix . 'faculty', $faculty_row );\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_faculty_imported', sprintf( _n( 'Congratulations, you imported %d faculty.', 'Congratulations, you imported %d faculty.', $line_number, 'acf-faculty-selector' ), $line_number ) );\n\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_raw' );\n\n\t\t\t\t\t\t\t\treturn;\n\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}", "function importAll() {\n $row = 1;\n $data = array();\n if ($GLOBALS[\"handle\"]) {\n while (($line = fgetcsv($GLOBALS[\"handle\"])) !== false) {\n \n if ($row == 1 || $row == 2) { $row++; continue; } //skip rows 1 and 2.\n \n $identify = rtrim(sprintf(\"%04d\\n\", $line[1])).ltrim(sprintf(\"%04d\\n\", $line[3]));\n $data[$identify] = array(\"cityCode\"=>$line[1], \"cityName\"=>$line[2], \"streetCode\"=>$line[3], \"streetName\"=>$line[4]);\n $row++;\n }\n fclose($GLOBALS[\"handle\"]);\n } else {\n return 0; //error read file\n }\n return $data;\n}", "function tt_validate_upload_columns(csv_import_reader $cir, $stdfields, moodle_url $returnurl) {\n $columns = $cir->get_columns();\n\n if (empty($columns)) {\n $cir->close();\n $cir->cleanup();\n print_error('cannotreadtmpfile', 'error', $returnurl);\n }\n if (count($columns) < 2) {\n $cir->close();\n $cir->cleanup();\n print_error('csvfewcolumns', 'error', $returnurl);\n }\n\n // test columns\n $processed = array();\n foreach ($columns as $key=>$unused) {\n $field = $columns[$key];\n $lcfield = textlib::strtolower($field);\n if (in_array($field, $stdfields) or in_array($lcfield, $stdfields)) {\n // standard fields are only lowercase\n $newfield = $lcfield;\n } else {\n $cir->close();\n $cir->cleanup();\n print_error('invalidfieldname', 'error', $returnurl, $field);\n }\n if (in_array($newfield, $processed)) {\n $cir->close();\n $cir->cleanup();\n print_error('duplicatefieldname', 'error', $returnurl, $newfield);\n }\n $processed[$key] = $newfield;\n }\n return $processed;\n}", "public static function validateCSV($csv) {\n $companyAttributeMapArray = self::getCsvAttributeMapArray();\n $companyAttributes = $result = [];\n $file = fopen(\"uploads/import/\" . $csv, \"r\");\n $headerRow = array_map('trim', array_map('strtolower', fgetcsv($file))); //fgetcsv($file);\n if (!empty($headerRow)) {\n $rowNo = 1;\n $models = [];\n while (!feof($file)) {\n $rowNo++;\n $companyModel = new CompanyForm();\n $dataRow = fgetcsv($file);\n if (!empty($dataRow) && count(array_filter($dataRow))) {\n foreach ($headerRow as $key => $value) {\n if (isset($companyAttributeMapArray[$value])) {\n $companyAttributes[$companyAttributeMapArray[$value]] = trim($dataRow[$key]);\n } elseif (!empty($value)) {\n fclose($file);\n return ['result' => FALSE, 'msg' => '<b>Invalid field \"' . $value . '\" at Row ' . $rowNo . ' and Column ' . $key . '</b> <br>'];\n }\n }\n $company = Company::findOne(['name' => $companyAttributes['name']]);\n if (count($company) > 0) {\n $companyModel->c_id = $company->_id;\n }\n $companyModel->attributes = $companyAttributes;\n\n if (!$companyModel->validate()) {\n fclose($file);\n return ['result' => FALSE, 'msg' => '<b>Following error occured at row ' . $rowNo . '</b> <br>' . \\components\\GlobalFunction::modelErrorsToString($companyModel->getErrors()), 'row' => json_encode($dataRow)];\n }\n array_push($models, $companyModel);\n }\n }\n }\n\n fclose($file);\n return ['result' => TRUE, 'models' => $models];\n }", "public function DataInFileImportCSV($redirect_to)\n {\n\n }", "public function import_csv_products($upload_path)\n\t{\n\t\t$this->load->model('admin/file_model');\n\t\t/*\n\t\t\t-----------------------------------------------------------------------------------------\n\t\t\tUpload csv\n\t\t\t-----------------------------------------------------------------------------------------\n\t\t*/\n\t\t$response = $this->file_model->upload_csv($upload_path, 'import_csv');\n\t\t\n\t\tif($response['check'])\n\t\t{\n\t\t\t$file_name = $response['file_name'];\n\t\t\t\n\t\t\t$array = $this->file_model->get_array_from_csv($upload_path.'/'.$file_name);\n\t\t\t//var_dump($array); die();\n\t\t\t$response2 = $this->sort_csv_data($array);\n\t\t\n\t\t\tif($this->file_model->delete_file($upload_path.\"\\\\\".$file_name, $upload_path))\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\treturn $response2;\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', $response['error']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "private function __isCsvFileUploaded(){\r\n $name = $this->data['Attachment'][0]['file']['name'];\r\n return !empty($name) && (strpos($name, '.csv') !== false);\r\n }", "public function testLoadCsvSimple()\n {//{{{\n $expect = array();\n $expect[0]['col1'] = 'Aa';\n $expect[0]['col2'] = 'Bb';\n $expect[1]['col1'] = 'Cc';\n $expect[1]['col2'] = 'Dd';\n\n $csv = CsvUtil::loadCsv(__DIR__.'/CsvUtilTest.csv');\n $this->assertEquals($expect, $csv);\n }", "public function testInvalidFileImport(): void\n {\n $this->expectException(ValidationException::class);\n $file_path = base_path('tests/data/aircraft.csv');\n $this->importSvc->importAirports($file_path);\n }", "protected function import_data_into_interface_common($upload_path, $csv_filename)\r\n\t{\r\n\t\t$error_code = self::NO_ERROR;\r\n\t\t$batch_id = 0;\r\n\t\t$number_of_successes = 0;\r\n\t\t$error_message = \"\";\r\n\t\t$result = true;\r\n\r\n\t\t$uploadedFile = $upload_path . \"/\" . $csv_filename;\r\n\t\t$data = $this->get_import_service()->get_file_data($uploadedFile);\r\n\t\t$number_of_rows_in_csv = sizeof((array) $data);\r\n\r\n\t\tif (sizeof((array) $data) == 0)\r\n\t\t{\r\n\t\t\t$error_code = self::NO_DATA_IN_THE_FILE;\r\n\t\t\t$error_message = \"Upload File is empty\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$data_result = $this->get_import_service()->validate_import_data($data);\r\n\t\t}\r\n\r\n\t\tif ((sizeof($data_result) == 0) && ($error_code == self::NO_ERROR))\r\n\t\t{\r\n//create a new batch\r\n\t\t\tif ($batch_id = $this->get_import_service()->create_new_batch($this->get_function_name(), 0, $csv_filename))\r\n\t\t\t{\r\n//insert all record to interface table\r\n\t\t\t\t$import_result = $this->import_record($data, $batch_id);\r\n\t\t\t\tif ($import_result[\"result\"])\r\n\t\t\t\t{\r\n\t\t\t\t\t$number_of_successes = $import_result[\"number_of_successes\"];\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$error_code = self::ERROR_DURING_IMPORT_TO_INTERFACE;\r\n\t\t\t\t\t$error_message .= \"\\n \" . __METHOD__ . \" \" . __LINE__ . \" Error during Import into interface \\n\" . $import_result[\"error_message\"];\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\t$error_code = self::CANNOT_CREATE_BATCH;\r\n\t\t\t\t$error_message .= \"\\n create new batch error.\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn array(\"batch_id\" => $batch_id\r\n\t\t\t\t\t, \"error_message\" => $error_message\r\n\t\t\t\t\t, \"error_code\" => $error_code\r\n\t\t\t\t\t, \"number_of_successes\" => $number_of_successes\r\n\t\t\t\t\t, \"number_of_rows_in_csv\" => $number_of_rows_in_csv\r\n\t\t\t\t\t, \"validate_result\" => $data_result\r\n\t\t\t\t\t, \"is_fail_validation\" => sizeof($data_result) ? TRUE : FALSE\r\n\t\t\t\t\t, \"data_from_csv\" => $data\r\n\t\t\t\t\t, \"import_data\" => $import_result[\"import_data\"]);\r\n\t}", "function importCSV($cols = array())\n {\n $cols = array_change_key_case(array_keys($this->options));\n \n $inputValues[] = array(); // source for db insert values\n $row = 0;\n $num = 0;\n $status = FALSE;\n $csv_url = $this->csv_url . '&f='. implode('', $this->options) .'&s='. implode(',', $this->current_symbols);\n\n if (($handle = fopen($csv_url, \"r\")) !== FALSE) {\n while (($data = fgetcsv($handle, count($this->options), \",\")) !== FALSE) {\n $num = count($data);\n for ($c = 0; $c < count($cols); $c++) {\n $inputValues[$row][$cols[$c]] = $data[$c];\n }\n $row++;\n }\n fclose($handle);\n \n if(count($inputValues) > 0)\n {\n $this->db->empty_table($this->csv_import_table);\n $this->db->insert_batch($this->csv_import_table, $inputValues); \n if($this->db->affected_rows() > 0)\n $status = TRUE;\n\t\t\t\telse {\n\t\t \t\t$status = 'Inserts failed';\n\t\t \t\tlog_message('error', $status . ': Yahoo finance csv data insert failed.');\n\t\t\t\t}\n }\n\t \telse {\n\t\t\t\t$status = 'Nothing to import';\n\t\t\t\tlog_message('error', $status . ': Yahoo finance csv data insert array was empty.');\n\t \t}\n\n }\n else {\n $status = 'Network error';\n log_message('error', $status .': Yahoo finance csv download url could not be read.');\n }\n return $status;\n }", "abstract public function convert_from_csv($source);", "public function import_read_record()\n\t{\n // phpcs:enable\n\t\tglobal $conf;\n\n\t\t$arrayres=fgetcsv($this->handle, 100000, $this->separator, $this->enclosure, $this->escape);\n\n\t\t// End of file\n\t\tif ($arrayres === false) return false;\n\n\t\t//var_dump($this->handle);\n\t\t//var_dump($arrayres);exit;\n\t\t$newarrayres=array();\n\t\tif ($arrayres && is_array($arrayres))\n\t\t{\n\t\t\tforeach($arrayres as $key => $val)\n\t\t\t{\n\t\t\t\tif (! empty($conf->global->IMPORT_CSV_FORCE_CHARSET))\t// Forced charset\n\t\t\t\t{\n\t\t\t\t\tif (strtolower($conf->global->IMPORT_CSV_FORCE_CHARSET) == 'utf8')\n\t\t\t\t\t{\n\t\t\t\t\t\t$newarrayres[$key]['val']=$val;\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$newarrayres[$key]['val']=utf8_encode($val);\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\t// Autodetect format (UTF8 or ISO)\n\t\t\t\t{\n\t\t\t\t\tif (utf8_check($val))\n\t\t\t\t\t{\n\t\t\t\t\t\t$newarrayres[$key]['val']=$val;\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$newarrayres[$key]['val']=utf8_encode($val);\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->col=count($newarrayres);\n\t\t}\n\n\t\treturn $newarrayres;\n\t}", "private function import()\n {\n if ($this->option('file') == null) {\n $this->warn('Please specify an import file');\n\n return;\n }\n\n $translatedLocaleValues = [];\n $file = fopen($this->option('file'), 'r');\n\n // Header row\n $line = fgetcsv($file, 0, $this->csvSeperator);\n if ($line[0] == 'translation_string') {\n $translationLocale = $line[2];\n } else {\n $this->warn('The given file seems to have an incorrect format');\n\n return;\n }\n\n // Data rows\n while (($line = fgetcsv($file, 0, $this->csvSeperator)) !== false) {\n if (empty($line[2])) {\n continue;\n }\n\n $translatedLocaleValues[$translationLocale][$line[0]] = $line[2];\n }\n\n $this->manager->write($translatedLocaleValues);\n }", "function handle_upload() {\n\t\tif ( !isset($_FILES['import']) ) {\n\t\t\t$file['error'] = '文件为空';\n\t\t}\n\t\t$temp_file = tempnam(sys_get_temp_dir(), 'chemcsv');\n\t\tmove_uploaded_file($_FILES[\"import\"][\"tmp_name\"], $temp_file);\n\t\t$file['file'] = $temp_file;\n\n\t\tif ( isset( $file['error'] ) ) {\n\t\t\techo '<p><strong>错误</strong><br />';\n\t\t\techo esc_html( $file['error'] ) . '</p>';\n\t\t\treturn false;\n\t\t} else if ( ! file_exists( $file['file'] ) ) {\n\t\t\techo '<p><strong>错误</strong><br />';\n\t\t\tprintf('无法读取导入的文件 <code>%s</code>.', esc_html( $file['file'] ) );\n\t\t\techo '</p>';\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $file['file'];\n\t}", "function csvimport($tpl = null)\n\t{\n\t\tif (JVersion::isCompatible(\"1.6.0\"))\n\t\t\tJHTML::stylesheet('administrator/components/' . JEV_COM_COMPONENT . '/assets/css/eventsadmin.css');\n\t\telse\n\t\t\tJHTML::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');\n\n\t\t$document = & JFactory::getDocument();\n\t\t$document->setTitle(JText::_( 'CSV_IMPORT' ));\n\n\t\t// Set toolbar items for the page\n\t\tJToolBarHelper::title(JText::_( 'CSV_IMPORT' ), 'jevents');\n\n\t\tJToolBarHelper::cancel('icalevent.list');\n\n\t\t$this->_hideSubmenu();\n\n\t\tJSubMenuHelper::addEntry(JText::_( 'CONTROL_PANEL' ), 'index.php?option=' . JEV_COM_COMPONENT, true);\n\n\t\t$params = JComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t//$section = $params->getValue(\"section\",0);\n\n\t\tJHTML::_('behavior.tooltip');\n\n\t}", "public function loadData($path) {\n\t\t\n\t\t$this->properties->lines = 1;\n\t\t\n\t\t$sql = 'INSERT INTO '.$this->properties->table.' ('.implode(\", \", $this->properties->columns).') VALUES (:'.implode(\", :\", $this->properties->columns).')'; \n\t\t$statement = $this->properties->con->prepare($sql); \t\t\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t\t\n\t\t\tif(substr(finfo_file($finfo,$path),0,4) != \"text\") {\n\t\t\t\tthrow new ImporterException(\"Not a CSV document!\");\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($path,\"rt\");\n\t\t\t\n\t\t\tif(!$fp) {\n\t\t\t\tthrow new ImporterException(\"Couldn't read file!\");\n\t\t\t}\n\t\t\t\n\t\t\t$first_row = 1;\n\t\t\t\n\t\t\twhile(($row = fgetcsv($fp,0,$this->properties->delimeter,$this->properties->enclosure)) !== false) {\n\t\t\t\tif(count($row) == 1 && !$row[0]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach($row as &$value) {\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t}\n\t\t\t\t$this->data[] = $row;\n\t\t\t\tif($first_row && $this->properties->has_header) {\n\t\t\t\t\t$first_row = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tparent::insertData($statement);\n\t\t\t\t$this->properties->lines++;\n\t\t\t\t$this->properties->has_header = false;\n\t\t\t\t$this->properties->append = true;\n\t\t\t\t$this->data = array();\n\t\t\t}\n\t\t\t\n\t\t\tfclose($fp);\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t/*if($this->properties->lines > 1) {\n\t\t\t\tparent::deleteData();\n\t\t\t}*/\n\t\t\tthrow new ImporterException(\"<b>File</b>: \".$path.\"<br /><br /><b>Error</b>: \".$e->getMessage().\"<br/>\");\n\t\t}\n\n\t}", "public function acfedu_upload_csv_file() {\n\t\t\t\tif ( isset( $_POST[\"upload_csv_nonce\"] ) ) {\n\t\t\t\t\tif ( ! wp_verify_nonce( $_POST[\"upload_csv_nonce\"], 'upload-csv-nonce' ) ) {\n\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_no_nonce_match', esc_html__( 'Something went wrong, please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t$this->acfedu_check_uploads_folder();\n\t\t\t\t\t\t$target_dir = wp_upload_dir()['basedir'] . '/acfedu/';\n\t\t\t\t\t\t$target_file = $target_dir . basename( $_FILES['csv_upload']['name'] );\n\n\t\t\t\t\t\tif ( move_uploaded_file( $_FILES['csv_upload']['tmp_name'], $target_file ) ) {\n\n\t\t\t\t\t\t\t// file uploaded succeeded\n\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_file_uploaded', sprintf( esc_html__( \"File '%s' is successfully uploaded and now shows under 'Select files to import'\", 'acf-faculty-selector' ), $_FILES['csv_upload']['name'] ) );\n\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// file upload failed\n\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_file_uploaded', esc_html__( 'Upload failed. Please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function importFile()\r\n {\r\n\t\t$args = new safe_args();\r\n\t\t$args->set('key',NOTSET,'any');\t\t\n\n\t\tfor( $i = 0 ; $i < $_SESSION['import']['count'] ; $i++ )\n\t\t\t$args->set( 'f'.$i, NOTSET, 'any');\n\n\t\t$args = $args->get(func_get_args());\t\n\r\n\t\t$this->load_specific_xsl();\r\n $GLOBALS['appshore']->add_xsl('lib.import');\r\n $GLOBALS['appshore']->add_xsl('lib.base'); \r\n\r\n\t\t// test of RBAC level upon record owner, if no READ_WRITE then go to the View display \n\t\tif ( !$GLOBALS['appshore']->rbac->check( $this->appRole, RBAC_USER_WRITE ) )\r\n {\r\n\t\t\t$args['key'] = 'Error';\r\n $error = ERROR_PERMISSION_WRITE_DENIED;\r\n }\r\n\r\n \t\tswitch($args['key'])\r\n\t\t{\r\n\t\t\tcase 'Error':\r\n\t\t\t\tmessagebox( $error, ERROR);\r\n\t\t\t\t$result['action']['import'] = 'importFile';\r\n\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\t\r\n\t\t\tcase 'importFile':\r\n\n\t\t\t\t// we create a temporay table to host the records\n\t\t\t\t/*\n\t\t\t\tif ( ($tmpTable = $this->createTMP()) == NULL )\n\t\t\t\t{\n\t messagebox( 'Can\\'t import these datas', ERROR);\t\n\t\t\t\t\treturn $this->upload();\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t\r\n \t\t\t\t$fp = fopen( $_SESSION['import']['tmp_name'], \"r\"); //open the file\n \t\t\t\t$filesize = filesize( $_SESSION['import']['tmp_name']);\n \t\t\t\t\n \t\t\t\tif( $_SESSION['import']['header'] == 1 )\t// there is a header\n \t\t\t\t{\n\t \t\t\t\t$header = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"'); \n\t\t\t\t}\n\n\t\t\t\t$this->error = array();\n\t\t\t\t\n\t\t\t\t$row=1;\n\t\t\t\twhile ( ($record = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"')) !== FALSE && $row < IMPORT_MAX_LINES) \n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t$converted = array();\n\t\t\t\t\tforeach($record as $key => $value)\n\t\t\t\t\t\t$converted[$args['f'.$key]] = sanitize($value, 'string'); \t\t\t\t\t\t\n\t\t\t\t\n\t //$this->insertRecord( $tmpTable, $converted, $row);\t\t\t\n\t\t\t\t\t$this->importSpecific( $tmpTable, $converted);\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$row++;\t \t\t\n\t\t\t\t}\t\n\t\t\t\t\t\t\t\n\t\t\t\tfclose($fp);\n\t\t\t\tunlink( $_SESSION['import']['tmp_name']);\n\n\t\t\t\t//now we do application specific import process\n\t\t\t\t//$result['import']['specific'] = $this->importSpecific( $tmpTable);\n\t\t\t\t\n\t\t\t\t$result['import']['rows'] = $row-1; \t\t\r\n\t\t\t\t$result['import']['specific'] = $this->specific;\t\t\t\t\t\t\t\t\r\n\t\t\t\t$result['action']['import'] = 'importFile';\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t}\n\t\t\r\n return $result;\r\n }", "public function importuser() {\r\n if($this->input->post('upload') != NULL ){ \r\n $data = array(); \r\n if(!empty($_FILES['file']['name'])){ \r\n // Set preference \r\n $config['upload_path'] = 'assets/files/'; \r\n $config['allowed_types'] = 'csv'; \r\n $config['max_size'] = '1000'; // max_size in kb \r\n $config['file_name'] = $_FILES['file']['name']; \r\n\r\n // Load upload library \r\n $this->load->library('upload',$config); \r\n \r\n // File upload\r\n if($this->upload->do_upload('file')){ \r\n // Get data about the file\r\n $uploadData = $this->upload->data(); \r\n $filename = $uploadData['file_name']; \r\n\r\n // Reading file\r\n $file = fopen(\"assets/files/\".$filename,\"r\");\r\n $i = 0;\r\n\r\n $importData_arr = array();\r\n \r\n while (($filedata = fgetcsv($file, 1000, \",\")) !== FALSE) {\r\n $num = count($filedata);\r\n\r\n for ($c=0; $c < $num; $c++) {\r\n $importData_arr[$i][] = $filedata[$c];\r\n }\r\n $i++;\r\n }\r\n fclose($file);\r\n\r\n $skip = 0;\r\n\r\n // insert import data\r\n foreach($importData_arr as $userdata){\r\n if($skip != 0){\r\n \r\n \r\n $this->Multiplerecord_model->insertUser($userdata);\r\n \r\n }\r\n $skip ++;\r\n }\r\n\r\n $data['response'] = 'successfully uploaded '.$filename;\r\n \r\n redirect('usercontrol/newlogin', $data); \r\n\r\n } else{ \r\n \r\n \r\n \r\n $this->session->set_flashdata('import_record_failed', 'Patient Already Exist');\r\n redirect('admissioncontrol/admitdatatable', $data); \r\n \r\n\r\n } \r\n } else{ \r\n \r\n \r\n $data['response'] = \"failed\";\r\n $this->session->set_flashdata('import_record_failed', 'Patient Already Exist');\r\n $data['topbar'] = 'navbar-default';\r\n $data['main_view'] = 'admission/admitdatatable';\r\n $this->load->view('layouts/central_template',$data); \r\n \r\n } \r\n \r\n } else{\r\n \r\n \r\n $data['response'] = \"failed\";\r\n $this->session->set_flashdata('import_record_failed', 'Patient Already Exist');\r\n $data['topbar'] = 'navbar-default';\r\n $data['main_view'] = 'admission/admitdatatable';\r\n $this->load->view('layouts/central_template',$data); \r\n \r\n } \r\n\r\n }", "public function processImport(Request $request)\n\t{\n\n\t\t$importCsv = new ImportCsv;\n\t\t$csvData = $importCsv->getTmpCsv($request);\n\n\t\tif ($csvData === null || route('import_parse') !== \\URL::previous() ) {\n\t\t\treturn back();\n\t\t}\n\n\t\tif (!in_array('0', $_POST['fields']) || !in_array('1', $_POST['fields']) || !in_array('2', $_POST['fields']) || !in_array('3', $_POST['fields']) || count($_POST['fields']) != 4) {\n\t\t\treturn redirect('/errorparseimport')->with('status', 'Error! Make sure there is one of each fields set. No more or less.');\n\t\t}\n\n\t\t$csvData = array_slice($csvData, 1);\n\n\t\t$newArray = array();\n\t\tfor ($i = 0; $i < 4; $i++) {\n\t\t\t$newArray[$i] = array_search($i, $_POST['fields']);\n\t\t}\n\n\t\tforeach ($csvData as $data) {\n\t\t\t$dbData = array();\n\n\t\t\tfor ($i = 0; $i < count($newArray); $i++) {\n\t\t\t\t$db_field = $newArray[$i];\n\t\t\t\t$dbData[] = $data[$db_field];\n\t\t\t}\n\n\t\t\tif ($dbData[2] != null) {\n\t\t\t\t$dbData[2] = $dbData[2] . ' ' . $dbData[3];\n\t\t\t} else {\n\t\t\t\t$dbData[2] = $dbData[3];\n\t\t\t}\n\n\t\t\t$dbData[3] = $dbData[0] . '@mydavinci.nl';\n\n\t\t\t$errors = $this->validateRowData($dbData);\n\t\t\tif (empty($errors)) {\n\t\t\t\t$importCsv->saveCsv($dbData);\n\t\t\t}\n\t\t}\n\n\t\treturn redirect('importcsv')->with('status', 'success');\n\t}", "protected function _init(){\n ini_set('auto_detect_line_endings', 1);\n $this->_init = true;\n $this->_handle = fopen($this->_csv, \"r\");\n if(!$this->_handle){\n throw new Exception('Could not open file: ' . $this->_csv);\n }\n }", "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}", "public function import($csv)\n {\n // convert to UTF-8\n $head = substr($csv, 0, 4096);\n $charset = rcube_charset::detect($head, RCUBE_CHARSET);\n $csv = rcube_charset::convert($csv, $charset);\n $csv = preg_replace(array('/^[\\xFE\\xFF]{2}/', '/^\\xEF\\xBB\\xBF/', '/^\\x00+/'), '', $csv); // also remove BOM\n $head = '';\n $prev_line = false;\n\n $this->map = array();\n $this->gmail_map = array();\n\n // Parse file\n foreach (preg_split(\"/[\\r\\n]+/\", $csv) as $line) {\n if (!empty($prev_line)) {\n $line = '\"' . $line;\n }\n\n $elements = $this->parse_line($line);\n\n if (empty($elements)) {\n continue;\n }\n\n // Parse header\n if (empty($this->map)) {\n $this->parse_header($elements);\n if (empty($this->map)) {\n break;\n }\n }\n // Parse data row\n else {\n // handle multiline elements (e.g. Gmail)\n if (!empty($prev_line)) {\n $first = array_shift($elements);\n\n if ($first[0] == '\"') {\n $prev_line[count($prev_line)-1] = '\"' . $prev_line[count($prev_line)-1] . \"\\n\" . substr($first, 1);\n }\n else {\n $prev_line[count($prev_line)-1] .= \"\\n\" . $first;\n }\n\n $elements = array_merge($prev_line, $elements);\n }\n\n $last_element = $elements[count($elements)-1];\n if ($last_element[0] == '\"') {\n $elements[count($elements)-1] = substr($last_element, 1);\n $prev_line = $elements;\n continue;\n }\n $this->csv_to_vcard($elements);\n $prev_line = false;\n }\n }\n }", "public function importcsv() {\n \t$data['error'] = '';\n $type = $this->input->post('type');\n \t$config['upload_path'] = ('./uploads/');\n \t$config['allowed_types'] = 'csv';\n \t$config['max_size'] = '1000';\n\n \t$this->load->library('upload', $config);\n\n \t//Als upload failt, toon error\n if (!$this->upload->do_upload()) {\n $data['error'] = $this->upload->display_errors();\n \n $this->load->view('/login-beheerder/beheerder_gebruiker_import_error', $data);\n } else {\n $file_data = $this->upload->data();\n $file_path = './uploads/'.$file_data['file_name'];\n \n if ($this->csvimport->get_array($file_path)) {\n $csv_array = $this->csvimport->get_array($file_path);\n foreach ($csv_array as $row) {\n\n $insert_data = array(\n\n 'voornaam'=>$row[\"'voornaam'\"],\n 'achternaam'=>$row[\"'achternaam'\"],\n 'email'=>$row[\"'email'\"],\n 'gender'=>$row[\"'gender'\"],\n 'klasId'=>$row[\"'klasId'\"],\n 'titel'=>$row[\"'titel'\"],\n 'institutie'=>$row[\"'institutie'\"],\n 'mobiel'=>$row[\"'mobiel'\"],\n 'biografie'=>$row[\"'biografie'\"],\n 'positie'=>$row[\"'positie'\"],\n 'tmContact'=>$row[\"'tmContact'\"],\n 'studieGebied'=>$row[\"'studieGebied'\"],\n 'land'=>$row[\"'land'\"],\n 'typeId'=>$type,\n 'pwdCode'=>$code\n\n );\n print_r($row);\n\n\n $this->csv_model->insert_csv($insert_data);\n\n }\n $this->notifications->createNotification(\"File successfully imported!\", \"success\", true);\n redirect('/gebruiker');\n } else {\n $data['error'] = \"Error occured\";\n $this->load->view('/login-beheerder/beheerder_gebruiker_import_error', $data);\n }\n \n } \n }", "protected function load_csv_data() {\n $dataset = $this->createCsvDataSet(array(\n usermoodle::TABLE => elispm::file('tests/fixtures/user_moodle.csv')\n ));\n $this->loadDataSet($dataset);\n }", "private function parseCsvLine($line)\n\t{\n\n\t\t$data = str_getcsv($line);\n\t\t// different count of data cols than header cols, bad CSV\n\t\tif (count($data) != $this->colsNum && count($data) != 1)\n\t\t{ // == 1 probably last empty line\n\t\t\t// different number of cols than in header, file is not in correct format\n\t\t\treturn false;\n\t\t}\n\t\t$dataLine = new CsvLine($data[$this->colsOrder[\"CATEGORIES\"]],\n\t\t\t$data[$this->colsOrder[\"SUMMARY\"]],\n\t\t\t$data[$this->colsOrder[\"DTSTART\"]],\n\t\t\t$data[$this->colsOrder[\"DTEND\"]]);\n\t\tforeach ($this->colsOrder as $col => $order)\n\t\t{\n\t\t\tswitch ($col)\n\t\t\t{\n\t\t\t\tcase \"TIMEZONE\":\n\t\t\t\t\t$dataLine->setTimezone($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"LOCATION\":\n\t\t\t\t\t$dataLine->setLocation($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"DTSTAMP\":\n\t\t\t\t\t$dataLine->setDtstamp($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"X-EXTRAINFO\":\n\t\t\t\t\t$dataLine->setExtraInfo($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"X-COLOR\":\n\t\t\t\t\t$dataLine->setColor($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"CONTACT\":\n\t\t\t\t\t$dataLine->setContact($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"DESCRIPTION\":\n\t\t\t\t\t$dataLine->setDescription($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"RRULE\":\n\t\t\t\t\t$dataLine->setRrule($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"UID\":\n\t\t\t\t\t$dataLine->setUid($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"CATEGORIES\":\n\t\t\t\tcase \"SUMMARY\":\n\t\t\t\tcase \"DTSTART\":\n\t\t\t\tcase \"DTEND\":\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"NOENDTIME\":\n\t\t\t\t\t$dataLine->setNoendtime($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"PUBLISHED\":\n\t\t\t\t\t$dataLine->setPublished($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"MULTIDAY\":\n\t\t\t\t\t$dataLine->setMultiday($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"lockevent\":\n\t\t\t\t\t$dataLine->lockevent = $data[$order];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$dataLine->customField($data[$order], $col);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $dataLine;\n\n\t}", "function parse($csv_filename,$is_tmp,\n\t\t &$artifacts_data,\n\t\t &$number_inserts,&$number_updates) {\n global $Language;\n $hp = Codendi_HTMLPurifier::instance();\n \n $number_inserts = 0;\n $number_updates = 0;\n \n //avoid that lines with a length > 1000 will be truncated by fgetcsv\n $length = 1000;\n $array = file($csv_filename);\n for($i=0;$i<count($array);$i++) {\n if ($length < strlen($array[$i])) {\n\t$length = strlen($array[$i]);\n }\n }\n $length++;\n //unset($array);\n \n \n \n $csv_file = fopen($csv_filename, \"r\");\n $row = 0;\n \n while ($data = fgetcsv($csv_file, $length, get_csv_separator())) {\n // do the real parsing here\n \n //parse the first line with all the field names\n if ($row == 0) {\n $ok = $this->parseFieldNames($data);\n \n if (!$ok) return false;\n \n\n // get already predefined values for fields\n $this->getPredefinedValues();\n\n //parse artifact values\n } else {\n \n //verify whether this row contains enough values\n $num = count($data);\n if ($num != $this->num_columns) { \n\t$data_details = \"\";\n\tforeach ($data as $key => $value) {\n\t if ($data_details != \"\") $data_details .= \", \";\n\t $data_details .= \"[\".$this->parsed_labels[$key].\"] => $value\";\n\t}\n\treset($data);\n\t$this->setError($Language->getText('plugin_tracker_import_utils','column_mismatch',array(\n $row+1,\n $hp->purify($data_details, CODENDI_PURIFIER_CONVERT_HTML) ,\n $num,\n $this->num_columns)));\n\treturn FALSE;\n }\n \n \n // if no tracker_id given, create new artifacts\t\n if ($this->aid_column == -1) {\n\t$ok = $this->checkInsertArtifact($row,$data);\n\t$number_inserts++;\n\t// if tracker_id given, verify if it exists already \n\t//else send error\n } else {\n\t$aid = $data[$this->aid_column];\n\tif ($aid != \"\") {\n\t $ok = $this->checkUpdateArtifact($row,$data,$aid);\n\t $number_updates++;\n\t \n\t} else {\n\t // have to create artifact from scratch\n\t $ok = $this->checkInsertArtifact($row,$data,true);\n\t $number_inserts++;\n\t}\t \n }\n if (!$ok) return false;\n else $artifacts_data[] = $data;\n }\n $row++;\n }\n \n fclose($csv_file);\n if ($is_tmp) {\n unlink($csv_filename);\n }\n return true;\n }", "private function open_csv() {\n $this->fh = fopen(CSV_FILE, \"r\");\n if ($this->fh === false) {\n $this->log_it(\"Could not open CSV file.\");\n return false;\n }\n\n return true;\n }", "public function prepareImport();", "public function test_load_csv_content() {\n $encoding = 'utf8';\n $separator = 'comma';\n $previewrows = 5;\n $csvpreview = new phpunit_gradeimport_csv_load_data();\n $csvpreview->load_csv_content($this->oktext, $encoding, $separator, $previewrows);\n\n $expecteddata = array(array(\n 'Anne',\n 'Able',\n '',\n 'Moodle HQ',\n 'Rock on!',\n '[email protected]',\n 56.00,\n 'We welcome feedback',\n '',\n 56.00\n ),\n array(\n 'Bobby',\n 'Bunce',\n '',\n 'Moodle HQ',\n 'Rock on!',\n '[email protected]',\n 75.00,\n '',\n 45.0,\n 75.00\n )\n );\n\n $expectedheaders = array(\n 'First name',\n 'Surname',\n 'ID number',\n 'Institution',\n 'Department',\n 'Email address',\n 'Assignment: Assignment for grape group',\n 'Feedback: Assignment for grape group',\n 'Assignment: Second new grade item',\n 'Course total'\n );\n // Check that general data is returned as expected.\n $this->assertEquals($csvpreview->get_previewdata(), $expecteddata);\n // Check that headers are returned as expected.\n $this->assertEquals($csvpreview->get_headers(), $expectedheaders);\n\n // Check that errors are being recorded.\n $csvpreview = new phpunit_gradeimport_csv_load_data();\n $csvpreview->load_csv_content($this->badtext, $encoding, $separator, $previewrows);\n // Columns shouldn't match.\n $this->assertEquals($csvpreview->get_error(), get_string('csvweirdcolumns', 'error'));\n }", "public function import($csv)\n {\n $this->em->getFilters()->disable('softdeleteable');\n\n $csv = preg_replace('#[\\n\\r]+#', '#', $csv);\n\n $lines = explode('#', $csv);\n\n $ids = array();\n\n foreach($lines as $line){\n $info = explode(';', $line);\n $student = new Student();\n $student->setId($info[0]);\n $student->setLastName($info[1]);\n $student->setFirstName($info[2]);\n if(isset($info[3]) && $info[3] != '') $student->setClass(preg_replace('#^[0-9]+_(.+)$#', '$1', $info[3]));\n if(isset($info[4]) && $info[4] != '') $student->setEmail($info[4]);\n #$student->setIsContributor(false);\n\n if($this->em->getRepository('FerusStudentBundle:Student')->isIdAvailable($student->getId())){\n $this->em->persist($student);\n $this->em->flush();\n\n $this->success++;\n }\n else{\n $student = $this->em->getRepository('FerusStudentBundle:Student')->findOneById($student->getId());\n $student->setLastName($info[1]);\n $student->setFirstName($info[2]);\n $student->setEmail(null);\n $student->setDeletedAt(null);\n if(isset($info[3]) && $info[3] != '') $student->setClass(preg_replace('#^[0-9]+_(.+)$#', '$1', $info[3]));\n if(isset($info[4]) && $info[4] != '') $student->setEmail($info[4]);\n $this->em->persist($student);\n $this->em->flush();\n\n $this->error++;\n }\n\n $ids[] = $info[0];\n }\n\n #Softdelete any missing student from the CSV\n $students = $this->em->getRepository('FerusStudentBundle:Student')->findByNotDeleted();\n $date = new \\DateTime();\n foreach($students as $student){\n if(!in_array($student->getId(), $ids)){\n if($student->hasFairpay()){\n if($student->getAccount()->getBalance() != \"0.00\"){\n $class = $student->getClass();\n $newClass = preg_replace('#^E[1-5](.*)$#', \"E6$1\", $class);\n if($newClass === $class) $student->setClass('E6');\n else $student->setClass($newClass);\n }\n else{\n $student->getAccount()->setDeletedAt($date);\n $student->setDeletedAt($date);\n }\n }\n else{\n $student->setDeletedAt($date);\n }\n\n $student->setIsContributor(false);\n $this->em->persist($student);\n $this->em->flush();\n\n $this->error++;\n }\n }\n\n return $this->success . ' étudiants créés et '.$this->error.' mis à jour.';\n }", "function read_csv($db)\n {\n $query=\"INSERT into dishes(did,dname,resturant) values\";\n $temp=array();\n $handle=fopen('sample.csv', 'r');\n if(!$handle)\n {\n echo \"error\";\n }\n\n $temp=fgetcsv($handle);//skip the heading...\n\n while(!feof($handle))\n {\n $temp=fgetcsv($handle);\n $did=$db->mysqlready($temp[0]);\n $dname=$db->mysqlready($temp[1]);\n $dname=check_appro($dname);\n $rest=$db->mysqlready($temp[2]);\n $rest=check_appro($rest);\n $query.=\"($did,'$dname','$rest'),\";\n\n }\n $fquery=substr($query, 0,-1);\n $fquery.=\";\";\n $status=$db->query($fquery);\n\n if(!$status)\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "public function testMigrateExceptionPathMissing() {\n $this->expectException(\\InvalidArgumentException::class);\n $this->expectExceptionMessage('You must declare the \"path\" to the source CSV file in your source settings.');\n new CSV([], $this->pluginId, $this->pluginDefinition, $this->migration);\n }", "public function importFromCsvFile($file)\n {\n if (!isset($file['tmp_name'])) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(__('Invalid file upload attempt.'));\n }\n\t\tset_time_limit(0);//Added to avoid time out error\n\t\tini_set('memory_limit', '2G');//Set memory limit to avoid memory exhaust\n $couponRawData = $this->csvProcessor->getData($file['tmp_name']);\n // first row of file represents headers\n $fileFields = $couponRawData[0];\t\t\n $validFields = $this->_filterFileFields($fileFields);\n $invalidFields = array_diff_key($fileFields, $validFields);\n $couponsData = $this->_filterCouponData($couponRawData, $invalidFields, $validFields);\n\t\t/** REMOVE AFTER IMPLEMENTATION **/\n\t\t//$this->_deleteExistingRules();\n\t\t/** EOF REMOVE RULE **/\n foreach ($couponsData as $rowIndex => $dataRow) {\n // skip headers\n if ($rowIndex == 0) {\n continue;\n }\n $regionsCache = $this->_importCoupon($dataRow);\n }\n\t\tini_restore('max_execution_time');//restore the default time out\n }", "public function importCSV($filePath, $bibstart) {\n\t\t$keyMap = array('activeid' => 0, 'lastname' => 1, 'firstname' => 2, 'address1' => 3, 'city' => 4, 'state' => 5, 'zipcode' => 6, 'email' => 7, 'age' => 8, 'sex' => 9, 'size' => 10, 'event' => 11, 'division' => 12, 'team' => 13, 'registration' => 14);\n\t\t$db = Zend_Db_Table_Abstract::getDefaultAdapter();\n\t\t$lineCount = 0;\n\t\t$recordsInserted = 0;\n\t\t$recordsRead = 0;\n\t\t$bibNumber = $bibstart;\n\n\t\tif (($handle = fopen($filePath, \"r\")) !== FALSE) {\n\n\t\t\twhile (($data = fgetcsv($handle, 100000, \",\")) !== FALSE) {\n\t\t\t\t$lineCount++;\n\t\t\t\t$insertData = array();\n\n\t\t\t\tif ($lineCount >= 2) {//SKIP THE HEADER\n\t\t\t\t\tforeach ($keyMap as $key => $column) {\n\t\t\t\t\t\t//teamname special rules\n\t\t\t\t\t\tif ($key == 'team') {\n\t\t\t\t\t\t\t//get both teamname fields and insert them in the proper place\n\t\t\t\t\t\t\t$insertData[$key] = $data[$column] . $data[15];\n\n\t\t\t\t\t\t} elseif ($key == 'size') {\n\t\t\t\t\t\t\t$result = $this -> findLike('sid', $key, $data[$column]);\n\t\t\t\t\t\t\tif (sizeof($result)) {\n\t\t\t\t\t\t\t\t$insertData[$key] = $result;\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$insertData[$key] = 8;\n\t\t\t\t\t\t\t\t//unknown size\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//division special rules, dont set if already set by event\n\t\t\t\t\t\t} elseif ($key == 'division') {\n\t\t\t\t\t\t\tif (!isset($insertData['division'])) {\n\t\t\t\t\t\t\t\t$result = $this -> findLike('did', $key, $data[$column]);\n\t\t\t\t\t\t\t\tif (sizeof($result)) {\n\t\t\t\t\t\t\t\t\t$insertData[$key] = $result;\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$insertData[$key] = 1;\n\t\t\t\t\t\t\t\t\t//default to NONE\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//event special rules HALFC causes overwrite of division and event to HALF\n\t\t\t\t\t\t} elseif ($key == 'event') {\n\t\t\t\t\t\t\tif ($data[$column] == \"HALFC\") {\n\t\t\t\t\t\t\t\t$insertData[$key] = 6;\n\t\t\t\t\t\t\t\t//event value\n\t\t\t\t\t\t\t\t$insertData['division'] = 5;\n\t\t\t\t\t\t\t\t//division value\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$result = $this -> findLike('eid', $key, $data[$column]);\n\t\t\t\t\t\t\t\t$insertData[$key] = $result;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//registration special rules\n\t\t\t\t\t\t} elseif ($key == 'registration') {\n\t\t\t\t\t\t\t$result = $this -> findLike('rid', $key, $data[$column]);\n\t\t\t\t\t\t\tif (sizeof($result)) {\n\t\t\t\t\t\t\t\t$insertData[$key] = $result;\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$insertData[$key] = 3;\n\t\t\t\t\t\t\t\t// Default To Packet Pickup\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$insertData[$key] = $data[$column];\n\t\t\t\t\t\t}\n\t\t\t\t\t}// do insert with verified free bib number and only if activeid is unique\n\t\t\t\t\t$recordsRead++;\n\t\t\t\t\tif ($this -> checkConflicts($bibNumber, $insertData['activeid'])) {\n\t\t\t\t\t\t$insertData['bibnumber'] = $bibNumber;\n\t\t\t\t\t\t$db -> insert('participant', $insertData);\n\t\t\t\t\t\t$recordsInserted++;\n\t\t\t\t\t\t$bibNumber++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfclose($handle);\n\t\t\tZend_Registry::get('session') -> messages[] = array('type' => 'success', 'text' => 'CSV Import Complete, Last Bib: ' . $bibNumber . \" Read: \" . $recordsRead . \" Inserted: \" . $recordsInserted);\n\t\t\t$this -> _redirect('/csvinterface');\n\n\t\t}\n\n\t}", "public static function importCsv($filePath, $noRows)\n {\n\n $tempArr = ImportCsvIO::csvToArray($filePath);\n if ($noRows > count($tempArr)) {\n $message = [\"status\" => \"301\", \"message\" => 'The no of rows('.$noRows.') requested exceeds the records to be imported. Try a smaller figure!'];\n } else {\n for ($i = 0; $i < $noRows; $i++) {\n Temperature::create($tempArr[$i]);\n }\n $message = [\"status\" => \"200\", \"message\" => 'Ok'];\n }\n\n return $message;\n }", "function _load_source_data($sourceFile) {\n /*\n * empty receiving files in advance just in case\n */\n CRM_Core_DAO::executeQuery('TRUNCATE TABLE kov_import');\n CRM_Core_DAO::executeQuery('TRUNCATE TABLE kov_header');\n $csvSeparator = _check_separator($sourceFile);\n \n $sourceData = fopen($sourceFile, 'r');\n while ($sourceRow = fgetcsv($sourceData, 0, $csvSeparator)) {\n if (!_check_empty_sourcerow($sourceRow)) {\n $insFields = _get_import_record($sourceRow);\n if (!empty($insFields)) {\n $insImport = \"INSERT INTO kov_import SET \".implode(\", \", $insFields);\n CRM_Core_DAO::executeQuery($insImport);\n }\n }\n }\n fclose($sourceData);\n \n $kovHdrInsert = \"INSERT INTO kov_header (SELECT DISTINCT(kov_nr), vge_nr, corr_naam, \n ov_datum, vge_adres, type, prijs, notaris, tax_waarde, taxateur, tax_datum, \n bouwkundige, bouw_datum, definitief FROM kov_import)\";\n CRM_Core_DAO::executeQuery($kovHdrInsert);\n return TRUE;\n}", "function add_stream2()\n {\n //$this->load->view('import_data');\n if (isset($_POST[\"submit\"])) {\n $file = $_FILES['file']['tmp_name'];\n $handle = fopen($file, \"r\");\n $c = 0; //\n while (($filesop = fgetcsv($handle, 1000, \",\")) !== false) {\n $names = $filesop[0];\n $class = $filesop[1];\n $stream = $filesop[3];\n $year = $filesop[4];\n if ($c <> 0) { //SKIP THE FIRST ROW\n $this->Excel_import_model->saverecords($names, $class, $stream, $year);\n }\n $c = $c + 1;\n }\n echo \"Stream imported sucessfully\";\n }\n }", "function import_users($file_path) {\n $h = fopen($file_path,'r');\n if($h) {\n $line = 0;\n while(($data = fgetcsv($h, 1000, ',')) !== false) {\n $user_data = null;\n $user_id = null;\n $num = count($data);\n if($line > 0) { // skip first line headings\n // example csv columns: role,email,first_name,last_name,title,phone,fax,group\n $user_data = array(\n 'role' => $data[0],\n 'user_email' => $data[1],\n 'first_name' => $data[2],\n 'last_name' => $data[3],\n 'user_login' => sanitize_title($data[2].$data[3]),\n 'user_nicename' => $data[2].' '.$data[3]\n );\n $user_id = wp_insert_user($user_data);\n if(is_numeric($user_id)) {\n // add custom user meta\n /*\n update_user_meta($user_id, 'phone', $data[5]);\n update_user_meta($user_id, 'fax', $data[6]);\n */\n\n // add user to group\n /*\n $group = Groups_Group::read_by_name($data[7]);\n Groups_User_Group::create(array('user_id' => $user_id, 'group_id' => $group->group_id));\n */\n } else {\n echo 'failed to create the user on csv row '.$line+1;\n var_dump($user_id);\n }\n }\n $line++;\n }\n fclose($h);\n } else {\n echo 'error opening file';\n }\n}", "private function csvTaskLoad($csv){\n $multiCsvArr = [];\n if(($handle = fopen(\"{$csv}\", \"r\")) !== false){\n while(($dataRow = fgetcsv($handle, 1000, \",\")) !== false){\n $multiCsvArr[] = $dataRow;\n }\n }\n fclose($handle);\n return $multiCsvArr;\n }", "protected function parseCsv() {\r\n\t\t\r\n\t\t$csv_data = array();\r\n\t\twhile ($this->_currentRow = fgetcsv($this->_fileHandler, null, $this->_delimiter, $this->_enclosure)) {\r\n\t\t\t$csv_data[] = $this->_currentRow;\r\n\t\t}\r\n\t\t\r\n\t\t$this->_data = $csv_data;\r\n\t}", "public function testValidateDocumentCsvValidation()\n {\n }", "public function import()\n\t{\n\t\t$optionStart = $this->importOptions->getOptionValue(\"start\", \"0\");\n\t\t$optionLength = $this->importOptions->getOptionValue(\"length\", \"0\");\n\t\t$optionCols = $this->importOptions->getOptionValue(\"cols\", \"0\");\n\t\t$optionDelimiter = $this->importOptions->getOptionValue(\"delimiter\", \";\");\n\t\t$optionEnclosure = $this->importOptions->getOptionValue(\"enclosure\", \"\");\n\t\t$optionType = $this->importOptions->getOptionValue(\"objectType\", \"\");\n\t\tif($optionType == \"\")\n\t\t{\n\t\t\tthrow new FileImportOptionsRequiredException(gettext(\"Missing option objectType for file import\"));\n\t\t}\n\n\t\t//create object controller\n\t\t$objectController = ObjectController::create();\n\t\t$config = CmdbConfig::create();\n\n\t\t//get mapping of csv columns to object fiels\n\t\t$objectFieldConfig = $config->getObjectTypeConfig()->getFields($optionType);\n\t\t$objectFieldMapping = Array();\n\t\t$foreignKeyMapping = Array();\n $assetIdMapping = -1;\n $activeMapping = -1;\n\t\tfor($i = 0; $i < $optionCols; $i++)\n\t\t{\n\t\t\t$fieldname = $this->importOptions->getOptionValue(\"column$i\", \"\");\n\t\t\t//assetId mapping\n\t\t\tif($fieldname == \"yourCMDB_assetid\")\n\t\t\t{\n\t\t\t\t$assetIdMapping = $i;\n }\n\t\t\t//active state mapping\n\t\t\tif($fieldname == \"yourCMDB_active\")\n {\n\t\t\t\t$activeMapping = $i;\n\t\t\t}\n\t\t\t//foreign key mapping\n\t\t\telseif(preg_match('#^yourCMDB_fk_(.*)/(.*)#', $fieldname, $matches) == 1)\n\t\t\t{\n\t\t\t\t$foreignKeyField = $matches[1];\n\t\t\t\t$foreignKeyRefField = $matches[2];\n\t\t\t\t$foreignKeyMapping[$foreignKeyField][$foreignKeyRefField] = $i;\n\t\t\t}\n\t\t\t//fielf mapping\n\t\t\telseif($fieldname != \"\")\n\t\t\t{\n\t\t\t\t$objectFieldMapping[$fieldname] = $i;\n\t\t\t}\n\t\t}\n\n\t\t//open file\t\t\n\t\t$csvFile = fopen($this->importFilename, \"r\");\n\t\tif($csvFile == FALSE)\n\t\t{\n\t\t\tthrow new FileImportException(gettext(\"Could not open file for import.\"));\n\t\t}\n\n\t\t//create or update objects for each line in csv file\n\t\t$i = 0;\n\t\twhile(($line = $this->readCsv($csvFile, 0, $optionDelimiter, $optionEnclosure)) !== FALSE)\n\t\t{\n\t\t\t//\n\t\t\tif($i >= ($optionLength + $optionStart) && $optionLength != 0)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//check start of import\n\t\t\tif($i >= $optionStart)\n\t\t\t{\n\t\t\t\t//generate object fields\n\t\t\t\t$objectFields = Array();\n\t\t\t\tforeach(array_keys($objectFieldMapping) as $objectField)\n\t\t\t\t{\n\t\t\t\t\tif(isset($line[$objectFieldMapping[$objectField]]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$objectFields[$objectField] = $line[$objectFieldMapping[$objectField]];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//resolve foreign keys\n\t\t\t\tforeach(array_keys($foreignKeyMapping) as $foreignKey)\n\t\t\t\t{\n\t\t\t\t\tforeach(array_keys($foreignKeyMapping[$foreignKey]) as $foreignKeyRefField)\n\t\t\t\t\t{\n\t\t\t\t\t\t//set foreign key object type\n\t\t\t\t\t\t$foreignKeyType = Array(preg_replace(\"/^objectref-/\", \"\", $objectFieldConfig[$foreignKey]));\n\t\t\t\t\t\t$foreignKeyLinePosition = $foreignKeyMapping[$foreignKey][$foreignKeyRefField];\n\t\t\t\t\t\tif(isset($line[$foreignKeyLinePosition]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$foreignKeyRefFieldValue = $line[$foreignKeyLinePosition];\n\t\n\t\t\t\t\t\t\t//get object defined by foreign key\n\t\t\t\t\t\t\t$foreignKeyObjects = $objectController->getObjectsByField(\t$foreignKeyRefField, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyRefFieldValue, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyType, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull, 0, 0, $this->authUser);\n\t\t\t\t\t\t\t//if object was found, set ID as fieldvalue\n\t\t\t\t\t\t\tif(isset($foreignKeyObjects[0]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$objectFields[$foreignKey] = $foreignKeyObjects[0]->getId();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n }\n\n //set active state\n $active = \"A\";\n if($activeMapping != -1 && isset($line[$activeMapping]))\n {\n if($line[$activeMapping] == \"A\" || $line[$activeMapping] == \"N\")\n {\n $active = $line[$activeMapping];\n }\n }\n\n\n\t\t\t\t//only create objects, if 1 or more fields are set\n\t\t\t\tif(count($objectFields) > 0)\n\t\t\t\t{\n\t\t\t\t\t//check if assetID is set in CSV file for updating objects\n\t\t\t\t\tif($assetIdMapping != -1 && isset($line[$assetIdMapping]))\n\t\t\t\t\t{\n $assetId = $line[$assetIdMapping];\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$objectController->updateObject($assetId, $active, $objectFields, $this->authUser);\n\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\t//if object was not found, add new one\n\t\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if not, create a new object\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//generate object and save to datastore\n\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//increment counter\n\t\t\t$i++;\n\t\t}\n\n\t\t//check, if CSV file could be deleted\n\t\t$deleteFile = false;\n\t\tif(feof($csvFile))\n\t\t{\n\t\t\t$deleteFile = true;\n\t\t}\n\n\t\t//close file\n\t\tfclose($csvFile);\n\n\t\t//delete file from server\n\t\tif($deleteFile)\n\t\t{\n\t\t\tunlink($this->importFilename);\n\t\t}\n\n\t\t//return imported objects\n\t\treturn $i;\n\t}", "public function import_Categories(){\n\n \t\t\tExcel::import(new ComponentsImport,'/imports/categories_main.csv');\n return 200;\n\n \t}", "public function uploadThirdpartyCsv()\n\t{\n\t\t$file = fopen($_FILES['third_party_csv']['tmp_name'], 'r');\n\t\t$count = 0;\n\t\t$failed = 0;\n\t\t$user_id = Auth::user()->id;\n\t\t$message = '';\n\t\t$already_exist = '';\n\t\t$added_count = 0;\n\t\t$existing_added_count = 0;\n\n\t\twhile (($line = fgetcsv($file)) !== FALSE) {\n\t\t\tif ($count == 0){\n\t\t\t\t$count++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttry{\n\t\t\t\t$line[1] = str_ireplace(\",\", \"\", str_ireplace(\",\", \"\", trim($line[1])));\n\t\t\t\tif(!filter_var($line[1], FILTER_VALIDATE_EMAIL)) {\n\t\t\t\t continue;\n\t\t\t\t}\n\t\t\t\t$thirdparty = Thirdparty::where('email', '=', $line[1])->get();\n\n\t\t\t\tif(!$thirdparty->isEmpty()) {\n\t\t\t\t\t$thirdparty = $thirdparty->first();\n\t\t\t\t\t$thirdpartyuser = Thirdpartyuser::where('source_id', '=', $thirdparty->id)->where('user_id', '=', $user_id)->get();\n\t\t\t\t\tif(!$thirdpartyuser->isEmpty()) {\n\t\t\t\t\t\t$thirdpartyuser = $thirdpartyuser->first();\n\t\t\t\t\t\t$failed++;\n\t\t\t\t\t\t$already_exist .= $line[1].\" Already belongs to you<br />\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$thirdpartyuser = new Thirdpartyuser();\n\t\t\t\t\t\t$thirdpartyuser->user_id = $user_id;\n\t\t\t\t\t\t$thirdpartyuser->source_id = $thirdparty->id;\n\t\t\t\t\t\t$thirdpartyuser->save();\n\t\t\t\t\t\t$existing_added_count++;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$third_party = new Thirdparty();\n\t\t\t\t\t$third_party->poc = $line[0];\n\t\t\t\t\t$third_party->email = $line[1];\n\t\t\t\t\t$org_array = $this->getThirdPartyOrganisation($third_party->email);\n\t\t\t\t\tif (!$org_array[0]) {\n\t\t\t\t\t\t// Setting status as mca and nsa data not provided\n\t\t\t\t\t\t$third_party->status = 2;\n\t\t\t\t\t}\n\t\t\t\t\t$third_party->source_organisation_id = $org_array[1];\n\t\t\t\t\t$third_party->phone = $line[2];\n\t\t\t\t\t$third_party->phone_ext = $line[3];\n\t\t\t\t\t$third_party->created_by = $user_id;\n\t\t\t\t\t$third_party->save();\n\t\t\t\t\t$mail_group = new MailGroupMember();\n\t\t\t\t\t$mail_group->group_id = 3;\n\t\t\t\t\t$mail_group->user_id = $third_party->id;\n\t\t\t\t\t$mail_group->save();\n\t\t\t\t\t$thirdpartyuser = new Thirdpartyuser();\n\t\t\t\t\t$thirdpartyuser->user_id = Auth::user()->id;\n\t\t\t\t\t$thirdpartyuser->source_id = $third_party->id;\n\t\t\t\t\t$thirdpartyuser->save();\n\t\t\t\t\t$added_count++;\n\t\t\t\t}\n\t\t\t} catch(Exception $e) {\n\t\t\t\t$message .= \"Error while adding email: \".$line[1].\"<br />\";\n\t\t\t} \n\t\t\t$count++;\n\t\t}\n\t\tfclose($file);\n\t\t$message = $already_exist.$message.'<b><br />Report : '.$failed.' already exists out of '.($count-1).\"</b>\";\n\n\t\t/* User activity */\n\t\t$description = Config::get('activity.third_party_multi_upload');\n\t\t$authUser = Auth::user();\n\t\t$formatted_description = sprintf(\n\t\t\t$description,\n\t\t\t'<a href=\"/view-employee/'.$authUser->id.'\">'.$authUser->first_name.\" \".$authUser->last_name.'</a>',\n\t\t\t$added_count,\n\t\t\t$existing_added_count\n\t\t);\n\t\t$this->saveActivity('2', $formatted_description);\n\n\t\tSession::flash('flashmessagetxt', 'Uploaded Successfully!!');\n\t\tSession::flash('upload_result', $message);\n\t\treturn Redirect::route('vendor-third-party');\n\t}", "public function testCsvReaderThrowsCannotDetermineDialectIfDataCorrupt() {\n \n //$this->expectException(new Csv_Exception_CannotDetermineDialect('File does not exist or is not readable: \"./data/nonexistant.csv\".'));\n $reader = new Csv_Reader('./data/corrupt.csv');\n \n }", "abstract public function import(): bool;", "function oak_import_csv() {\n global $wpdb;\n\n $table = $_POST['table'];\n $rows = $_POST['rows'];\n $single_name = $_POST['single_name'];\n\n $table_name = $table;\n if ( $_POST['wellDefinedTableName'] == 'false' ) :\n $table_name = $wpdb->prefix . 'oak_' . $table;\n if ( $single_name == 'term' ) :\n $table_name = $wpdb->prefix . 'oak_taxonomy_' . $table;\n elseif( $single_name == 'object' ) :\n $table_name = $wpdb->prefix . 'oak_model_' . $table;\n endif;\n endif;\n\n foreach( $rows as $key => $row ) :\n if ( $key != 0 && !is_null( $row[1] ) ) :\n $arguments = [];\n foreach( $rows[0] as $property_key => $property ) :\n if ( $property != 'id' && $property_key < count( $rows[0] ) && $property != '' ) :\n $arguments[ $property ] = $this->oak_filter_word( $row[ $property_key ] );\n endif;\n if ( strpos( $property, '_trashed' ) != false ) :\n $arguments[ $_POST['single_name'] . '_trashed' ] = $row[ $property_key ];\n endif;\n endforeach;\n $result = $wpdb->insert(\n $table_name,\n $arguments\n );\n endif;\n endforeach;\n\n wp_send_json_success();\n }", "public function testFileToArrayAssertsCorrect()\n {\n $this->createImportFile();\n $response = $this->importer->import('test.csv');\n\n $this->assertSame([\n \"user_id\" => \"3121\",\n \"created_at\" => \"2016-07-19\",\n \"onboarding_perentage\" => \"40\",\n \"count_applications\" => \"0\",\n \"count_accepted_applications\" => \"0\"\n ], $response[0]);\n\n $this->destroyFile();\n }", "function import_or_kill_data() {\n\tcheck_admin_referer( 'import-or-kill', 'process_data_nonce' );\n\n\tif (\n\t\tempty( $_POST['csv_id'] ) || empty( $_POST['slug'] )\n\t\t|| ( empty( $_POST['cancel'] ) && empty( $_POST['import'] ) )\n\t) {\n\t\twp_die( esc_html__( 'That request is not valid, please go back and try again.', 'csv-import-framework' ) );\n\t}\n\n\t$csv_post = CSV_Post::load( absint( $_POST['csv_id'] ) );\n\tif ( ! $csv_post ) {\n\t\twp_die( esc_html__( 'Something went wrong, that is an invalid CSV import ID. Please try again.', 'csv-import-framework' ) );\n\t}\n\n\t$page = sanitize_text_field( wp_unslash( $_POST['slug'] ) );\n\t$importer = load_importer( $page );\n\tif ( empty( $importer ) ) {\n\t\twp_die( esc_html__( 'That importer was not found! Please go back and try again.', 'csv-import-framework' ) );\n\t}\n\n\tif ( ! empty( $_POST['cancel'] ) ) {\n\t\t/**\n\t\t * Trigger the cancel/delete process for a CSV import.\n\t\t *\n\t\t * @param \\WP_Post $post Post object for the CSV data.\n\t\t * @param string $page The current import page, which contains the\n\t\t * importer slug.\n\t\t */\n\t\tdo_action( 'csv_import_framework_cancel_import', $csv_post->get_post(), $page );\n\t\t$msg = 'cancel';\n\t} elseif ( ! empty( $_POST['import'] ) ) {\n\t\tschedule_runner( $csv_post->get_id() );\n\t\t$csv_post->start_import();\n\t\t$msg = 'success';\n\t}\n\n\twp_redirect( get_page_url( $page, compact( 'msg' ) ) );\n\texit;\n}", "public function testValidateThrowMissingColumnException()\n {\n $this->job->setCsvData([['Id'], ['test', 'test2']]);\n\n try {\n $this->job->validate();\n } catch (\\Exception $e) {\n $this->assertEquals($e->getMessage(), EntityException::MGS_CSV_ROW_COUNT_MISMATCH);\n }\n }", "private function importCsv($params) {\n\n $conn = $this->container->get('doctrine.dbal.default_connection');\n\n // set content in file handler\n $fiveMBs = 5 * 1024 * 1024;\n $fp = fopen(\"php://temp/maxmemory:$fiveMBs\", 'r+');\n fputs($fp, $params['data']);\n rewind($fp);\n\n // get array from CSV\n $data = array();\n while (($row = fgetcsv($fp, 1000, \",\")) !== FALSE) {\n $data[] = $row;\n }\n fclose($fp);\n\n // let's check how the CSV is structured. There can be 3 options\n\n // Option 1.\n // date, value\n // date2, value2\n\n // Option 2.\n // x, date1, date2\n // source_title, value11, value12\n // source_title2, value21, value22\n\n // so let's check the first field to see if it's a date\n $firstField = $data[0][0];\n $dateAr = \\Dagora\\CoreBundle\\Entity\\Data::convertDate($firstField);\n\n $dataToInsert = array();\n $sourcesToInsert = array();\n\n // it's a date, so Option 1\n if ( $dateAr ) {\n\n $sourceHash = md5($params['title']);\n\n $sourcesToInsert[] = '('\n . $conn->quote(trim($params['title']), 'string').', '\n . $conn->quote($sourceHash, 'string').', '\n . $conn->quote($params['unit'], 'string').', '\n . $conn->quote($params['link'], 'string').', now(), now())';\n\n // the data is already on the desired format\n $dataToInsert[ $sourceHash ] = $data;\n }\n // Option 2.\n else {\n\n // get dates which are on the first line\n $dates = array_slice($data[0], 1);\n $avoidFirst = true;\n foreach ($data as $lineData) {\n\n // do not insert first line\n if ( $avoidFirst ) {\n $avoidFirst = false;\n continue;\n }\n\n // source title\n $titleSuffix = $lineData[0];\n $sourceTitle = trim($params['title']) . ' - ' . trim($titleSuffix);\n $sourceHash = md5($sourceTitle);\n\n $sourcesToInsert[] = '('\n . $conn->quote($sourceTitle, 'string').', '\n . $conn->quote($sourceHash, 'string').', '\n . $conn->quote($params['unit'], 'string').', '\n . $conn->quote($params['link'], 'string').', now(), now())';\n\n // values\n $values = array_slice($lineData, 1);\n\n $dataToInsert[ $sourceHash ] = array_combine($dates, $values);\n }\n }\n\n $now = date('Y-m-d H:m:s');\n\n // insert masivo de sources\n $r = $conn->executeUpdate('INSERT INTO source (title, hash, unit, link, created_at, updated_at)\n VALUES '.join(',', $sourcesToInsert));\n\n // get all sources\n $results = $conn->fetchAll(\"SELECT id, hash FROM source where created_at > ?\", array($now));\n\n // create array that identifies source\n $sources = array();\n foreach ($results as $r) {\n $sources[ $r['hash'] ] = $r['id'];\n }\n unset($results);\n\n $insert = array();\n foreach ($dataToInsert as $sourceCode => $data) {\n\n foreach ($data as $date => $value ) {\n\n $dateAr = \\Dagora\\CoreBundle\\Entity\\Data::convertDate($date);\n\n $date = $dateAr['date'];\n $dateType = $dateAr['dateType'];\n\n $insert[] = '('.$sources[ $sourceCode ].', '\n .$conn->quote($date, 'string').', '\n .$conn->quote($dateType, 'string').', '\n .$conn->quote($value, 'string').', now(), now())';\n }\n }\n\n $offset = 0;\n $MAX = 10000;\n $total = count($insert);\n\n //$this->output->writeln('Hay '.$total.' data points');\n\n while ( $offset < $total ) {\n\n $insertNow = array_slice($insert, $offset, $MAX);\n\n // hacer insert masivo\n $r = $conn->executeUpdate('INSERT INTO data (source_id, date, date_type, value, created_at, updated_at)\n VALUES '.join(',', $insertNow));\n\n $offset += $MAX;\n\n //$this->output->writeln(' ...añadidos '.$offset);\n }\n }", "function readCSV($url) {\n $row = 0;\n $readData = [];\n print_r(\"Opening CSV File ... \");\n if (($handle = fopen($url, \"r\")) !== FALSE) {\n print_r(\"SUCCESS\\n\");\n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n if($row!=0) { // skip first row\n $readData[$row] = $data;\n }\n $row++;\n }\n fclose($handle);\n return $readData;\n } else {\n print_r(\"FAIL\\n\");\n return null;\n }\n}", "public static function parseImportFile($path)\n {\n $data = null;\n $columns = null;\n $output = array();\n\n // Work out some basic config settings\n \\Config::load('format', true);\n\n // Work out the format from the extension\n $pathinfo = pathinfo($path);\n $format = strtolower($pathinfo['extension']);\n\n // Stop if we don't support the format\n if (!static::supportsFormat($format)) {\n throw new \\Exception(\\Lang::get('admin.errors.import.file_format_unknown'));\n }\n\n // Work out how to parse the data\n switch ($format) {\n case 'xls':\n case 'xlsx':\n\n $data = \\Format::forge($path, 'xls')->to_array();\n $first = array_shift($data);\n $columns = is_array($first) ? array_filter(array_map(function($key) {\n return \\Inflector::friendly_title($key, '_', true);\n }, array_values($first))) : array();\n \n break;\n default:\n\n $data = @file_get_contents($path);\n if (strpos($data, \"\\n\") !== false) {\n \\Config::set('format.csv.regex_newline', \"\\n\");\n } else if (strpos($data, \"\\r\") !== false) {\n \\Config::set('format.csv.regex_newline', \"\\r\");\n }\n $data = \\Format::forge($data, $format)->to_array();\n\n // Find out some stuff...\n $first = \\Arr::get($data, '0');\n $columns = is_array($first) ? array_map(function($key) {\n return \\Inflector::friendly_title($key, '_', true);\n }, array_keys($first)) : array();\n\n break;\n }\n\n if (count($columns) > 0) {\n foreach ($data as $num => $row) {\n $values = array_values($row);\n $filtered = array_filter($values);\n if (count($values) > count($columns)) {\n $values = array_slice($values, 0, count($columns));\n } else if (count($values) < count($columns)) {\n while (count($values) < count($columns)) {\n $values[] = null;\n }\n }\n if (!empty($filtered)) $output[] = array_combine($columns, $values);\n }\n } else {\n $columns = $data = $output = null;\n }\n\n // Stop if there's no data by this point\n if (!$data) {\n throw new \\Exception(\\Lang::get('admin.errors.import.file_parse_error'));\n }\n\n return array(\n 'columns' => $columns,\n 'data' => $output\n );\n }", "function import_post() {\n\n $flag1 = true;\n $flag2 = true;\n \n $fields = $this->csvimport->get_array($_FILES['csv_file']['tmp_name']);\n $result[\"records\"] = $fields;\n $result[\"status\"] = \"1\";\n $result[\"message\"] = \"Records saved successfully\";\n\n $this->response($result, 200);\n\n exit;\n }", "public function testMigrateExceptionKeysMissing() {\n $configuration = [\n 'path' => $this->standardCharsPath,\n ];\n $this->expectException(\\InvalidArgumentException::class);\n $this->expectExceptionMessage('You must declare \"ids\" as a unique array of fields in your source settings.');\n new CSV($configuration, $this->pluginId, $this->pluginDefinition, $this->migration);\n }", "protected function load_csv_data() {\n $dataset = $this->createCsvDataSet(array(\n 'user' => elis::component_file('program', 'tests/fixtures/mdluser.csv'),\n 'user_info_field' => elis::component_file('program', 'tests/fixtures/user_info_field.csv'),\n 'user_info_data' => elis::component_file('program', 'tests/fixtures/user_info_data.csv'),\n user::TABLE => elis::component_file('program', 'tests/fixtures/pmuser.csv'),\n usermoodle::TABLE => elis::component_file('program', 'tests/fixtures/usermoodle.csv'),\n field::TABLE => elis::component_file('program', 'tests/fixtures/user_field.csv'),\n field_owner::TABLE => elis::component_file('program', 'tests/fixtures/user_field_owner.csv'),\n userset::TABLE => elis::component_file('program', 'tests/fixtures/userset.csv')\n ));\n $dataset = new PHPUnit_Extensions_Database_DataSet_ReplacementDataSet($dataset);\n $dataset->addSubStrReplacement('\\n', \"\\n\");\n $this->loadDataSet($dataset);\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 upload($csv){\n \n // Transformation des fins de ligne au format LF\n $csv = str_replace(\"\\r\\n\", PHP_EOL, $csv);\n $csv = explode(PHP_EOL, $csv);\n $i = 0;\n \n foreach($csv as $line) {\n \n $entry = str_getcsv($line, \";\");\n if(count($entry) != 4) {\n continue;\n }\n \n $address = new Address();\n $address->setNom($entry[0])\n ->setDescription($entry[1])\n ->setAdresse($entry[2])\n ->setUrl($entry[3]);\n \n $this->addressMapper->save($address);\n $i++;\n }\n return $i; \n }", "function _check_separator($sourceFile) {\n $testSeparator = fopen($sourceFile, 'r');\n /*\n * first test if semi-colon or comma separated, based on assumption that\n * it is semi-colon and it should be comma if I only get one record then\n */\n if ($testRow = fgetcsv($testSeparator, 0, ';')) {\n if (!isset($testRow[1])) {\n $csvSeparator = \",\";\n } else {\n $csvSeparator = \";\";\n }\n }\n fclose($testSeparator);\n return $csvSeparator; \n}", "private function valid_csv ($file_path) {\n $csv_mime_types = [ \n 'text/csv',\n 'text/plain',\n 'application/csv',\n 'text/comma-separated-values',\n 'application/excel',\n 'application/vnd.ms-excel',\n 'application/vnd.msexcel',\n 'text/anytext',\n 'application/octet-stream',\n 'application/txt',\n ];\n $finfo = finfo_open( FILEINFO_MIME_TYPE );\n $mime_type = finfo_file( $finfo, $file_path );\n\n return in_array( $mime_type, $csv_mime_types );\n }", "protected function import_data_into_interface_common($upload_path, $csv_filename, &$error_trans_id, &$batch_id, $using_master_sku)\r\n\t{\r\n\t\t$result = $this->validate_import_data($upload_path . $csv_filename, $error_message);\r\n\r\n\t\tif ($result == Stock_import_model::ALL_DATA_PASS)\r\n\t\t{\r\n//create a new batch\r\n\t\t\tif ($this->create_new_batch(0, $csv_filename, $batch_id))\r\n\t\t\t{\r\n//insert all record to interface table\r\n\t\t\t\tif ($this->import_record($upload_path . $csv_filename, $batch_id))\r\n\t\t\t\t{\r\n//process the interface table data\r\n\t\t\t\t\tif ($this->get_number_of_different_warehouse_ids($batch_id) > 1)\r\n\t\t\t\t\t{\r\n//validate data consisteny in warehouse id\r\n\t\t\t\t\t\t$this->set_batch_data_to_status($batch_id, Stock_import_model::IMPORT_PROCESS_ERROR_MORE_THAN_ONE_WAREHOUSE);\r\n\t\t\t\t\t\t$this->update_batch_status($batch_id, Stock_import_model::BATCH_PROCESSING_STATUS_MORE_THAN_ONE_WAREHOUSE, date(\"Y-m-d H:i:s\"));\r\n\t\t\t\t\t\treturn Stock_import_model::IMPORT_PROCESS_ERROR_MORE_THAN_ONE_WAREHOUSE;\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\tif (!$this->check_correct_sku_mapping($batch_id, $using_master_sku))\r\n\t\t\t\t\t\t{\r\n//check if all the sku has been mapped to master sku\r\n\t\t\t\t\t\t\t$this->set_batch_data_to_status($batch_id, Stock_import_model::IMPORT_PROCESS_ERROR_NO_SKU_MAPPING);\r\n\t\t\t\t\t\t\t$this->update_batch_status($batch_id, Stock_import_model::BATCH_PROCESSING_STATUS_NO_SKU_MAPPING, date(\"Y-m-d H:i:s\"));\r\n\t\t\t\t\t\t\treturn Stock_import_model::IMPORT_PROCESS_ERROR_NO_SKU_MAPPING;\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$record_processed = 0;\r\n\t\t\t\t\t\t\tif (!$this->process_imported_stock_data($batch_id, $record_processed, $error_message, $error_trans_id, $using_master_sku))\r\n\t\t\t\t\t\t\t{\r\n//set error message\r\n\t\t\t\t\t\t\t\t$_SESSION[\"NOTICE\"] = \"Error occurs during data import, part of the data may be imported/checked\\n\" . $error_message;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn $record_processed;\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\t$error_message .= \"\\n error during interface_import_service::import_record \\n\" . $this->db->last_query();;\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\t$error_message .= \"\\n create new batch error.\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if ($result == Stock_import_model::NO_DATA_IN_THE_FILE)\r\n\t\t{\r\n\t\t\t$error_message .= \"The import file has no data inside.\\n\";\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t$_SESSION[\"NOTICE\"] = $error_message;\r\n\t\treturn -1;\r\n\t}", "private function validatePromoCsvFile($file)\n {\n $extension = $file->getClientOriginalExtension();\n\n if ($extension != 'csv') {\n return 'Please upload csv file.';\n }\n\n if ($file->getSize() == 0) {\n return 'CSV is empty!';\n }\n\n $file = $file->openFile();\n $headerRow = $file->fgetcsv();\n\n $headers = [\n 'distid',\n 'Amount'\n ];\n\n foreach ($headers as $header) {\n if (in_array($header, $headerRow)) {\n continue;\n }\n\n $missingHeaders[] = $header;\n }\n\n if (!empty($missingHeaders)) {\n $missingHeadersMessage = implode('<br>- ', $missingHeaders);\n return 'CSV is missing the header(s):<br> - ' . $missingHeadersMessage;\n }\n\n return null;\n }", "public function importExternalData($source){\n //importing data into db\n $this->log(\"importing external: $source...\");\n $res = $this->importer->importCsv($source);\n $this->log(\"import finished : \\n\".print_r($res, true));\n\n }", "public function readCsv()\n {\n ini_set(\"auto_detect_line_endings\", true);\n $fp = fopen($this->inputFile , 'r');\n while($row = fgetcsv($fp)){\n $this->data[] = $row;\n }\n }", "public function upload_csv($filename){\n\t\t $this->load->library('upload'); // Load librari upload\n\t\t \n\t\t $config['upload_path'] = './csv/';\n\t\t $config['allowed_types'] = 'csv';\n\t\t $config['max_size'] = '5120';\n\t\t $config['max_width'] = '0';\n\t\t\t$config['max_height'] = '0';\n\t\t \n\t\t $this->upload->initialize($config); // Load konfigurasi uploadnya\n\t\t if($this->upload->do_upload('file')){ // Lakukan upload dan Cek jika proses upload berhasil\n\t\t // Jika berhasil :\n\t\t $return = array('result' => 'success', 'file' => $this->upload->data(), 'error' => '');\n\t\t return $return;\n\t\t }else{\n\t\t // Jika gagal :\n\t\t $return = array('result' => 'failed', 'file' => '', 'error' => $this->upload->display_errors());\n\t\t return $return;\n\t\t }\n\t\t }", "private function importSales()\n {\n $sales = new Sales();\n $userid = Auth::user()->id;\n\n if (($handle = fopen($_FILES['import_file']['tmp_name'], \"r\")) !== FALSE) {\n $i = 0;\n while (($row = fgets($handle, 4096)) !== FALSE) {\n $i++;\n if ($i == 1) continue;\n\n $csvRow = str_getcsv($row, \"\\n\");\n foreach($csvRow as &$row){\n $row = str_getcsv($row, \";\");\n\n if (count($row) < 7){\n echo \"<span style='color: red'>Záznam nemá správny formát</span><br>\" . count($row);\n continue;\n }\n\n $products = '';\n if (isset($row[7])){\n $products = $row[7];\n }\n\n try{\n $store = $sales->create([\n 'user_id' => $userid,\n 'company_id' => session('selectedCompany'),\n 'products' => $products,\n 'total_price' => $row[0],\n 'fik' => $row[1],\n 'bkp' => $row[2],\n 'receiptNumber' => $row[3],\n 'premiseId' => $row[5],\n 'cash_register' => $row[6],\n 'receipt_time' => $row[4],\n 'not_sent' => 0,\n ]);\n echo \"<span style='color: green'>Záznam \" . implode(\";\",$row) . \" sa úspešne naimportoval.</span><br>\";\n }\n catch (\\Illuminate\\Database\\QueryException $e){\n echo \"<span style='color: red'>Záznam \" . implode(\";\",$row) . \" sa nepodarilo importovať.</span><br>\";\n }\n }\n }\n fclose($handle);\n }\n\n echo 'hotovo';\n }", "function importar_archivo_sigepp(){\n if ($this->input->post()) {\n $post = $this->input->post();\n \n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n \n /*--------------------------------------------------------------*/\n $i=0;\n $nro=0;$nroo=0;\n $lineas = file($archivotmp);\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){ \n\n $datos = explode(\";\",$linea);\n //echo count($datos).\"<br>\";\n if(count($datos)==7){\n\n $da=$datos[0]; /// Da\n $ue=$datos[1]; /// Ue\n $prog=$datos[2]; /// Aper Programa\n $proy=trim($datos[3]);\n if(strlen($proy)==2){\n $proy='00'.$proy; /// Aper Proyecto\n }\n $act=trim($datos[4]); /// Aper Actividad\n if(strlen($act)==2){\n $act='0'.$act;\n }\n $cod_part=trim($datos[5]); /// Partida\n if(strlen($cod_part)==3){\n $cod_part=$cod_part.'00';\n }\n\n $importe=(float)$datos[6]; /// Monto\n\n // echo $this->gestion.\"<br>\";\n echo $prog.'- ('.strlen($prog).') -> '.$proy.' ('.strlen($proy).') -> '.$act.' ('.strlen(trim($act)).') ----'.$importe.'-- CODIGO PARTIDA '.is_numeric($cod_part).'<br>';\n if(strlen($prog)==2 & strlen($proy)==4 & strlen(trim($act))==3 & $importe!=0 & is_numeric($cod_part)){\n // echo \"INGRESA : \".$prog.'-'.$proy.'-'.$act.'..'.$importe.\"<br>\";\n $nroo++;\n // echo \"string<br>\";\n $aper=$this->model_ptto_sigep->get_apertura($prog,$proy,$act);\n if(count($aper)!=0){\n $partida = $this->minsumos->get_partida_codigo($cod_part); //// DATOS DE LA PARTIDA\n $par_id=0;\n if(count($partida)!=0){\n $par_id=$partida[0]['par_id'];\n }\n\n $ptto=$this->model_ptto_sigep->get_ptto_sigep($prog,$proy,$act,$cod_part);\n if(count($ptto)!=0){\n echo \"UPDATES : \".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*------------------- Update Datos ----------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $update_ptto = array(\n 'aper_id' => $aper[0]['aper_id'],\n 'importe' => $importe,\n 'fun_id' => $this->session->userdata(\"fun_id\")\n );\n\n $this->db->where('sp_id', $ptto[0]['sp_id']);\n $this->db->update('ptto_partidas_sigep', $update_ptto);*/\n /*-------------------------------------------------------*/\n }\n else{\n echo \"INSERTS : \".$nroo.\" -\".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*-------------------- Guardando Datos ------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'aper_id' => $aper[0]['aper_id'],\n 'da' => $da,\n 'ue' => $ue,\n 'aper_programa' => $prog,\n 'aper_proyecto' => $proy,\n 'aper_actividad' => $act,\n 'par_id' => $par_id,\n 'partida' => $cod_part,\n 'importe' => $importe,\n 'g_id' => $this->gestion,\n 'fun_id' => $this->session->userdata(\"fun_id\"),\n );\n $this->db->insert('ptto_partidas_sigep', $data_to_store);\n $sp_id=$this->db->insert_id();*/\n /*-------------------------------------------------------*/ \n }\n $nro++;\n }\n else{\n echo \"NO INGRESA : \".$prog.'-'.$proy.'-'.$act.'..'.$importe.\"<br>\";\n /* $partida = $this->minsumos->get_partida_codigo($cod_part); //// DATOS DE LA PARTIDA\n $par_id=0;\n if(count($partida)!=0){\n $par_id=$partida[0]['par_id'];\n }*/\n /*-------------------- Guardando Datos ------------------*/\n /* $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'aper_id' => 0,\n 'da' => $da,\n 'ue' => $ue,\n 'aper_programa' => $prog,\n 'aper_proyecto' => $proy,\n 'aper_actividad' => $act,\n 'par_id' => $par_id,\n 'partida' => $cod_part,\n 'importe' => $importe,\n 'g_id' => $this->gestion,\n 'fun_id' => $this->session->userdata(\"fun_id\"),\n );\n $this->db->insert('ptto_partidas_sigep', $data_to_store);\n $sp_id=$this->db->insert_id();*/\n /*-------------------------------------------------------*/ \n }\n }\n elseif(strlen($prog)==2 & strlen($proy)==4 & strlen($act)==3 & $importe==0){\n $ptto=$this->model_ptto_sigep->get_ptto_sigep($prog,$proy,$act,$cod_part);\n if(count($ptto)!=0){\n echo \"UPDATES 0->VALOR : \".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*------------------- Update Datos ----------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $update_ptto = array(\n 'aper_id' => $aper[0]['aper_id'],\n 'importe' => $importe,\n 'fun_id' => $this->session->userdata(\"fun_id\")\n );\n\n $this->db->where('sp_id', $ptto[0]['sp_id']);\n $this->db->update('ptto_partidas_sigep', $update_ptto);*/\n /*-------------------------------------------------------*/\n }\n }\n }\n }\n\n $i++;\n }\n\n /*--------------------------------------------------------------*/\n } \n elseif (empty($file_basename)) {\n echo \"<script>alert('SELECCIONE ARCHIVO .CSV')</script>\";\n } \n elseif ($filesize > 100000000) {\n //redirect('');\n } \n else {\n $mensaje = \"Sólo estos tipos de archivo se permiten para la carga: \" . implode(', ', $allowed_file_types);\n echo '<script>alert(\"' . $mensaje . '\")</script>';\n }\n\n } else {\n show_404();\n }\n }", "public function uploadData()\n {\n\n $count=0;\n $fp = fopen($_FILES['file']['name'],\n \t\t\t$_FILES['file']['tmp_name'],'r') or die(\"can't open file\");\n while($csv_line = fgetcsv($fp,1024))\n {\n $count++;\n if($count == 1)\n {\n continue;\n }//keep this if condition if you want to remove the first row\n for($i = 0, $j = count($csv_line); $i < $j; $i++)\n {\n $insert_csv = array();\n //$insert_csv['id'] = $csv_line[0];//remove if you want to have primary key,\n $insert_csv['category_name'] = $csv_line[0];\n $insert_csv['unit_name'] = $csv_line[1];\n $insert_csv['tax_name'] = $csv_line[2];\n $insert_csv['item_name'] = $csv_line[3];\n $insert_csv['item_description'] = $csv_line[4];\n $insert_csv['purchase_price'] = $csv_line[5];\n $insert_csv['sales_price'] = $csv_line[6];\n\n }\n $i++;\n $data = array(\n 'category_name' => $insert_csv['category_name'],\n 'unit_name' => $insert_csv['unit_name'],\n 'tax_name' => $insert_csv['tax_name'],\n 'item_name' =>$insert_csv['item_name'],\n 'item_description' =>$insert_csv['item_description'],\n 'purchase_price' =>$insert_csv['purchase_price'],\n 'sales_price' =>$insert_csv['sales_price']);\n\n $data['crane_features']=$this->db->insert('import',$data);\n }\n fclose($fp) or die(\"can't close file\");\n $data['success']=\"success\";\n return $data;\n }", "private function validateVibeCsvFile($file)\n {\n $extension = $file->getClientOriginalExtension();\n\n if ($extension != 'csv') {\n return 'Please upload csv file.';\n }\n\n if ($file->getSize() == 0) {\n return 'CSV is empty!';\n }\n\n $file = $file->openFile();\n $headerRow = $file->fgetcsv();\n\n $headers = [\n 'date',\n 'ride_id',\n 'durationDistanceAmount',\n 'TSA #',\n 'PAYOUT'\n ];\n\n foreach ($headers as $header) {\n if (in_array($header, $headerRow)) {\n continue;\n }\n\n $missingHeaders[] = $header;\n }\n\n if (!empty($missingHeaders)) {\n $missingHeadersMessage = implode('<br>- ', $missingHeaders);\n return 'CSV is missing the header(s):<br> - ' . $missingHeadersMessage;\n }\n\n return null;\n }", "public function import($fileName, $blfName) {\n\t\t$this->_blfName = $blfName;\n\t\t$this->fileName = $fileName;\n\t\t$missionId = - 1;\n\t\t$this->loadingStep = 0;\n\t\t\n\t\tini_set ( \"memory_limit\", \"1024M\" );\n\t\t\n\t\tset_time_limit ( 1000 );\n\t\t\n\t\tif (! $this->uploaded) {\n\t\t\t$file = sfConfig::get ( 'app_import_data_stack_log' );\n\t\t\t$csv_file = sfConfig::get ( 'app_import_path_stack_log' ) . DIRECTORY_SEPARATOR . $this->year . DIRECTORY_SEPARATOR . $this->month . DIRECTORY_SEPARATOR . $this->day . DIRECTORY_SEPARATOR . $file;\n\t\t} else {\n\t\t\t$csv_file = sfConfig::get ( 'sf_upload_dir' ) . '/' . $fileName;\n\t\t}\n\t\t\n\t\tif (file_exists ( $csv_file )) {\n\t\t\t$handle = fopen ( $csv_file, \"r\" );\n\t\t} else {\n\t\t\t/*\n\t\t\t * Print error to STDERR and exit the whole script.\n\t\t\t */\n\t\t\tfwrite ( STDERR, \"[\" . date ( 'Y-m-d H:i:s' ) . \"] [stack] Csv-file from \" . date ( 'Y-m-d', $this->calendar_date ) . \" not found.\\n\" );\n\t\t\t\n\t\t\treturn $missionId;\n\t\t}\n\t\t\n\t\t// start working on the file\n\t\tif ($handle) {\n\t\t\t\n\t\t\t/*\n\t\t\t * Read csv-file and put contents to the associative array $import_data\n\t\t\t */\n\t\t\t$import_data = array ();\n\t\t\t$row = 0;\n\t\t\t\n\t\t\t// get field names - column headers\n\t\t\t$fieldnames = fgetcsv ( $handle, 4096, \",\" );\n\t\t\t// $this->printArray($fieldnames);\n\t\t\t\n\t\t\t$dateTimeRow = null;\n\t\t\t\n\t\t\twhile ( ($line = fgets ( $handle )) !== FALSE ) {\n\t\t\t\t$rowData = $this->getCsvWoWhiteSpace ( $line );\n\t\t\t\t\n\t\t\t\t$row ++;\n\t\t\t\t$number_of_columns = count ( $rowData );\n\t\t\t\t\n\t\t\t\tfor($i = 0; $i < $number_of_columns; $i ++) {\n\t\t\t\t\t$trimmed = trim ( $rowData [$i] );\n\t\t\t\t\t$import_data [$fieldnames [$i]] = $trimmed;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// $this->printArray($import_data);die();\n\t\t\t\t$this->padData ( $import_data );\n\t\t\t\t$this->_currentRowDateTime = $import_data [LoggerFields::Data_Time_UTC];\n\t\t\t\t$this->analyzeRecord ( $import_data );\n\t\t\t}\n\t\t\t\n\t\t\tfclose ( $handle );\n\t\t\t$this->missionEnded ();\n\t\t\t// echo \"mission endede\";//debug\n\t\t\t$number_of_entries = $row;\n\t\t}\n\t\t// echo \"import done\"; die();\n\t\treturn $this->_mission;\n\t}", "public function doImport() \n\t{ \n\t // first save the import object in the database\n $this->status = self::STATUS_IN_PROGRESS_IMPORT;\n $this->item_count = $this->getItemCount();\n\t $this->save(); \n\t \t \n\t // add an import object\n\t $db = get_db();\n\t $csvFile = $this->getCsvFile();\n\t $columnMaps = $this->getColumnMaps();\n\t \t \n if ($csvFile->isValid()) { \t \n\n // define item metadata\t \n $itemMetadata = array(\n 'public' => $this->is_public, \n 'featured' => $this->is_featured, \n 'item_type_id' => $this->item_type_id,\n 'collection_id' => $this->collection_id\n );\n \n // create a map from the column index number to an array of element infos, where each element info contains \n // the element set name, element name, and whether the element text is html or not \n $colNumToElementInfosMap = array();\n\n $colNumMapsToTag = array();\n \n foreach($columnMaps as $columnMap) {\n $columnIndex = $columnMap->getColumnIndex();\n \n // check to see if the column maps to a tag\n $mapsToTag = $colNumMapsToTag[$columnIndex];\n if (empty($mapsToTag)) {\n $colNumMapsToTag[$columnIndex] = false; \n }\n if ($columnMap->mapsToTag()) {\n $colNumMapsToTag[$columnIndex] = true; \n }\n \n // check to see if the column maps to a file\n $mapsToFile = $colNumMapsToFile[$columnIndex];\n if (empty($mapsToFile)) {\n $colNumMapsToFile[$columnIndex] = false; \n }\n if ($columnMap->mapsToFile()) {\n $colNumMapsToFile[$columnIndex] = true; \n }\n \n // build element infos from the column map\n $elementIds = $columnMap->getElementIds();\n foreach($elementIds as $elementId) {\n $et = $db->getTable('Element');\n $element = $et->find($elementId);\n $es = $db->getTable('ElementSet');\n $elementSet = $es->find($element['element_set_id']);\n $elementInfo = array('element_name' => $element->name, \n 'element_set_name' => $elementSet->name, \n 'element_text_is_html' => $columnMap->getDataIsHtml());\n \n // make sure that an array of element infos exists for the column index\n if (!is_array($colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex] = array();\n }\n \n // add the element info if it does not already exist for the column index \n if (!in_array($elementInfo, $colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex][] = $elementInfo; \n }\n } \n }\n \n // add item from each row\n $rows = $csvFile->getRows();\n $i = 0;\n foreach($rows as $row) {\n $i++;\n \n // ignore the first row because it is the header\n if ($i == 1) {\n continue;\n }\n \n //insert the item \n try {\n $item = $this->addItemFromRow($row, $itemMetadata, $colNumToElementInfosMap, $colNumMapsToTag, $colNumMapsToFile);\n } catch (Exception $e) {\n $this->status = self::STATUS_IMPORT_ERROR_INVALID_ITEM;\n \t $this->error_details = $e->getMessage();\n }\n release_object($item);\n \n // stop import on error\n if ($this->hasErrorStatus()) {\n \t $this->save();\n \t return false;\n \t }\n }\n \n $this->status = self::STATUS_COMPLETED_IMPORT;\n $this->save();\n return true;\n \n }\n \n $this->status = self::STATUS_IMPORT_ERROR_INVALID_CSV_FILE;\n $this->save();\n return false;\n\t}", "function sql_import_csv($options) {\n\t$sql = sql_connect();\n\t$options = array_merge(array(\n\t\t'charset' => 'utf8',\n\t\t'columns' => null,\n\t\t'lineStarting' => '',\n\t\t'lineEnding' => \"\\n\",\n\t\t'fieldEnclosing' => '',\n\t\t'fieldEscaping' => '',\n\t\t'fieldEnding' => ',',\n\t\t'ignoreLines' => 0\n\t), $options);\n\n\tif( !isset($options['filename'], $options['table']) || sql_driver() !== 'mysql' ){\n\t\treturn FALSE;\n\t}\n\n\t$options['filename'] = str_replace('/', '\\\\', $options['filename']);\n\t$query = 'LOAD DATA INFILE ' . sql_quote($options['filename']) . ' INTO TABLE ' . sql_quote($options['table'], true);\n\t$query .= ' CHARACTER SET ' . sql_quote($options['charset']);\n\t$query .= ' FIELDS TERMINATED BY ' . $sql->quote($options['fieldEnding']) . ' ENCLOSED BY ' . $sql->quote($options['fieldEnclosing']) . ' ESCAPED BY ' . $sql->quote($options['fieldEscaping']);\n\t$query .= ' LINES STARTING BY ' . $sql->quote($options['lineStarting']) . ' TERMINATED BY ' . $sql->quote($options['lineEnding']);\n\t$query .= ' IGNORE ' . $options['ignoreLines'] . ' LINES';\n\tif( is_array($options['columns']) ){\n\t\t$query .= ' (' . implode(', ', $options['columns']) . ')';\n\t}\n\t$query .= ';';\n\treturn sql_query($query, null, null);\n}", "private function get_csv_data() {\n if (!is_resource($this->fh) || get_resource_type($this->fh) !== \"stream\") {\n $this->log_it(\"CSV file not open when get_csv_data() called.\");\n return false;\n }\n\n // Consume/discard header row, if it exists.\n if (HEADER_ROW_EXISTS) {\n fgets($this->fh);\n $row_num = 2;\n } else {\n $row_num = 1;\n }\n\n $graded_reg_codes = STUDENT_REGISTERED_CODES;\n $audit_reg_codes = is_null(STUDENT_AUDIT_CODES) ? array() : STUDENT_AUDIT_CODES;\n $latedrop_reg_codes = is_null(STUDENT_LATEDROP_CODES) ? array() : STUDENT_LATEDROP_CODES;\n $all_valid_reg_codes = array_merge($graded_reg_codes, $audit_reg_codes, $latedrop_reg_codes);\n $unexpected_term_codes = array();\n\n // Read and assign csv rows into $this->data array\n $row = fgetcsv($this->fh, 0, CSV_DELIM_CHAR);\n while(!feof($this->fh)) {\n // Course is comprised of an alphabetic prefix and a numeric suffix.\n $course = strtolower($row[COLUMN_COURSE_PREFIX] . $row[COLUMN_COURSE_NUMBER]);\n\n // Trim whitespace from all fields in $row.\n array_walk($row, function(&$val, $key) { $val = trim($val); });\n\n // Remove any leading zeroes from \"integer\" registration sections.\n if (ctype_digit($row[COLUMN_SECTION])) $row[COLUMN_SECTION] = ltrim($row[COLUMN_SECTION], \"0\");\n\n switch(true) {\n // Check that $row has an appropriate student registration.\n case array_search($row[COLUMN_REGISTRATION], $all_valid_reg_codes) === false:\n // Skip row.\n break;\n\n // Check that $row is associated with the current term (if check is enabled)\n // Assume this check is OK, when EXPECTED_TERM_CODE is null (check disabled)\n case is_null(EXPECTED_TERM_CODE) ? false : $row[COLUMN_TERM_CODE] !== EXPECTED_TERM_CODE:\n // Note the unexpected term code for logging, if not already noted.\n if (array_search($row[COLUMN_TERM_CODE], $unexpected_term_codes) === false) {\n $unexpected_term_codes[] = $row[COLUMN_TERM_CODE];\n }\n break;\n\n // Check that $row is associated with the course list.\n case array_search($course, $this->course_list) !== false:\n if (validate::validate_row($row, $row_num)) {\n // Include $row\n $this->data[$course][] = $row;\n\n // $row with a blank email is included, but it is also logged.\n if ($row[COLUMN_EMAIL] === \"\") {\n $this->log_it(\"Blank email found for user {$row[COLUMN_USER_ID]}, row {$row_num}.\");\n }\n } else {\n // There is a problem with $row, so log the problem and skip.\n $this->invalid_courses[$course] = true;\n $this->log_it(validate::$error);\n }\n break;\n\n // Check that the $row is associated with a mapped course.\n case array_key_exists($course, $this->mapped_courses):\n // Also verify that the section is mapped.\n $section = $row[COLUMN_SECTION];\n if (array_key_exists($section, $this->mapped_courses[$course])) {\n $m_course = $this->mapped_courses[$course][$section]['mapped_course'];\n if (validate::validate_row($row, $row_num)) {\n // Include $row.\n $row[COLUMN_SECTION] = $this->mapped_courses[$course][$section]['mapped_section'];\n $this->data[$m_course][] = $row;\n\n // $row with a blank email is allowed, but it is also logged.\n if ($row[COLUMN_EMAIL] === \"\") {\n $this->log_it(\"Blank email found for user {$row[COLUMN_USER_ID]}, row {$row_num}.\");\n }\n } else {\n // There is a problem with $row, so log the problem and skip.\n $this->invalid_courses[$m_course] = true;\n $this->log_it(validate::$error);\n }\n }\n break;\n\n default:\n // Skip row by default.\n break;\n\n } // END switch (true)\n\n $row = fgetcsv($this->fh, 0, CSV_DELIM_CHAR);\n $row_num++;\n }\n\n // Log any unexpected term codes.\n // This may provide a notice that the next term's data is available.\n if (!empty($unexpected_term_codes)) {\n $msg = \"Unexpected term codes in CSV: \";\n $msg .= implode(\", \", $unexpected_term_codes);\n $this->log_it($msg);\n }\n\n /* ---------------------------------------------------------------------\n There may be \"fake\" or \"practice\" courses in Submitty that shouldn't be\n altered by the autofeed. These courses will have no enrollments in the\n csv file as these courses are not recognized by the registrar.\n --------------------------------------------------------------------- */\n\n // Filter out any \"empty\" courses so they are not processed.\n // There shouldn't be any \"empty\" course data, but this is just in case.\n $this->data = array_filter($this->data, function($course) { return !empty($course); }, 0);\n\n // Most runtime involves the database, so we'll release the CSV now.\n $this->close_csv();\n\n // Done.\n return true;\n }", "function loadCSV($filename) {\n // Assume we are following the format of:\n // +15554442222,[email protected]\n $csvArray = array(); \n if (($handle = fopen($filename, \"r\")) !== FALSE) {\n while (($row = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n $csvArray[\"$row[0]\"] = \"$row[1]\";\n }\n if (!feof($handle)) {\n error_log(\"Error: unexpected fgets() fail\\n\");\n }\n }\n fclose($handle);\n\n return $csvArray;\n}", "public function ftpParseCsv(){\n\t\tif(Mage::helper('dropship360')->isProcessRunning('bulk_assign')){\n\t\t\t$message = 'Bulk product setup is currently running hence cannot run ftp import';\n\t\t\tMage::log($message, null, 'logicbroker_log_report.log');\n\t\t\treturn;\n\t\t}\n\t\t$ftpfileName = array();\n\t\t$vendorFiles = array();\n\t\t$ftpObj = Mage::getModel('dropship360/import_ftpimport');\n\t\tif (!$ftpObj->isFtpUploadEnable()) {\n\t\t\treturn $this;\n\t\t}\n\t\ttry{\n\t\t\t$ftpObj->connect(); // connect to FTP site\n\t\t\t$vendorFiles = $ftpObj->downloadFiles(self::getWorkingDir()); // download and archive all FTP files \n\t\t}catch (Exception $e){\n\t\t\t$ftpObj->sendMail(array('subject'=>'Your magento site has failed to connect FTP site','message' =>$e->getMessage(),'bcc'=>trim(Mage::helper('dropship360')->getConfigObject('apiconfig/email/bcc'))));\n\t\t\tMage::log($e->getMessage(), null, 'logicbroker_ftp_vendor_inventory_import.log');\n\t\t\t$valueArray = array (\n\t\t\t\t\t'con_error'=>$e->getMessage(),\n\t\t\t\t\t'magento_sku' => '',\n\t\t\t\t\t'vendor_sku' => '',\n\t\t\t\t\t'cost' => '',\n\t\t\t\t\t'qty' => '',\n\t\t\t);\n\t\t\t$ftpObj->saveFtpHistoryError($valueArray,'connection_error','connection-error');\n\t\t}\n\t\t/*\n\t\t * vendors files on FTP server return empty \n\t\t * 1) vendor inventory folder empty\n\t\t * 2) supplier vendor not set at supplier management screen \n\t\t */\n\t\tif(empty($vendorFiles)){\n\t\t\tMage::log('Files not found on FTP server Or Supplier vendor not set', null, 'logicbroker_ftp_vendor_inventory_import.log');\n\t\t\treturn $this;\n\t\t}\n\t\t\n\t\t/*\n\t\t * start process files as per vendor.\n\t\t */\n\t\t$ftpObj->initialize();\n\t\tMage::helper('dropship360')->turnOnReadUncommittedMode(); // dirty read patch\n\t\tforeach($vendorFiles as $vendor=>$files){\n\t\t\t$ftpObj->initVar($vendor);\n\t\t\tforeach ($files as $filepath) {\n\t\t\t\ttry{\n\t\t\t$ftpObj->initFtpCsvData($filepath);\n\t\t\t$isInvalid = $ftpObj->validateFtpCsv($filepath);\n\t\t\tif($isInvalid){\n\t\t\t\tcontinue; // skip file for invalid header and empty file\n\t\t\t}\n\t\t\t$ftpObj->startImport($filepath,$vendor);\n\t\t\t$ftpObj->resetVar();\n\t\t\t$this->_fileObj->rm($filepath);\n\t\t\t}catch (Exception $e){\n\t\t\t\t$ftpObj->sendMail ( array (\n\t\t\t\t\t\t\t'subject' => 'Exception occurred during FTP inventory import for supplier '.$vendor,\n\t\t\t\t\t\t\t'message' => $filepath.'<br>'.$e->getMessage (),\n\t\t\t\t\t\t\t'bcc' => trim ( Mage::helper ( 'dropship360' )->getConfigObject ( 'apiconfig/email/bcc' ) ) \n\t\t\t\t\t) );\n\t\t\t\tMage::log('FTP-'.$e->getMessage().'Description ##'.$vendor.' ## '.$filepath, null, 'logicbroker_ftp_vendor_inventory_import.log');\n\t\t\t\t$ftpObj->resetVar();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\tMage::helper('dropship360')->turnOnReadCommittedMode(); //restore to orignal transection level\n\t\t$ftpObj->finalize();\n\t}", "function import_file($contents) {\n\t\ttrigger_error('Importer::import_file needs to be implemented', E_USER_ERROR);\n\t\t\n\t}", "public function validateCSV($csv)\n {\n if (!is_array($csv)) {\n return false;\n }\n $firstLine = $csv[0];\n if (!array_key_exists('StudentID', $firstLine)) {\n return 'StudentID is missing';\n }\n for ($i = 1; $i < 23; $i++) {\n $key = 'Q' . $i;\n if (!array_key_exists($key, $firstLine)) {\n return \"$key is missing\";\n }\n }\n return '';\n }", "function importar_archivo_sigep(){\n if ($this->input->post()) {\n $post = $this->input->post();\n $tp = $this->security->xss_clean($post['tp']);\n\n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n \n /*--------------------------------------------------------------*/\n if($tp==0){\n $lineas=$this->subir_archivo($archivotmp); /// Techo Inicial\n }\n else{\n $lineas=$this->subir_archivo_aprobado($archivotmp); /// Techo Aprobado\n }\n $this->session->set_flashdata('success','SE SUBIO CORRECTAMENTE EL ARCHIVO ('.$lineas.')');\n redirect(site_url(\"\").'/ptto_asig_poa');\n /*--------------------------------------------------------------*/\n } \n elseif (empty($file_basename)) {\n echo \"<script>alert('SELECCIONE ARCHIVO .CSV')</script>\";\n } \n elseif ($filesize > 100000000) {\n //redirect('');\n } \n else {\n $mensaje = \"Sólo estos tipos de archivo se permiten para la carga: \" . implode(', ', $allowed_file_types);\n echo '<script>alert(\"' . $mensaje . '\")</script>';\n }\n\n } else {\n show_404();\n }\n }", "function import_ch8bt_bug() {\r\n if ( !current_user_can( 'manage_options' ) ) {\r\n wp_die( 'Not allowed' );\r\n }\r\n \r\n // Check if nonce field is present \r\n check_admin_referer( 'ch8bt_import' ); \r\n \r\n // Check if file has been uploaded \r\n if( array_key_exists( 'import_bugs_file', $_FILES ) ) { \r\n // If file exists, open it in read mode \r\n $handle = fopen( $_FILES['import_bugs_file']['tmp_name'], 'r' ); \r\n \r\n // If file is successfully open, extract a row of data \r\n // based on comma separator, and store in $data array \r\n if ( $handle ) { \r\n while ( ( $data = fgetcsv( $handle, 5000, ',' ) ) !== FALSE ) { \r\n $row += 1; \r\n \r\n // If row count is ok and row is not header row \r\n // Create array and insert in database \r\n if ( count( $data ) == 4 && $row != 1 ) { \r\n $new_bug = array( \r\n 'bug_title' => $data[0], \r\n 'bug_description' => $data[1], \r\n 'bug_version' => $data[2], \r\n 'bug_status' => $data[3], \r\n 'bug_report_date' => date( 'Y-m-d' ) ); \r\n \r\n global $wpdb; \r\n \r\n $wpdb->insert( $wpdb->get_blog_prefix() . \r\n 'ch8_bug_data', $new_bug ); \r\n } \r\n } \r\n } \r\n } \r\n \r\n // Redirect the page to the user submission form \r\n wp_redirect( add_query_arg( 'page', 'ch8bt-bug-tracker', \r\n admin_url( 'options-general.php' ) ) ); \r\n exit; \r\n}", "private function validateFile(string $path): void\n {\n if (!file_exists($path)) {\n throw new InvalidArgumentException(sprintf('File: %s doesn\\'t exist', $path));\n }\n\n if (!$this->isCsvFile($path)) {\n throw new InvalidArgumentException(sprintf('Format of the file: %s is not csv', $path));\n }\n }", "public function process_export_import() {\r\n if(Tools::isSubmit('exportSubmit')){ // export data\r\n $this->_export();\r\n } else if(!empty($_FILES['importFile']['tmp_name'])){ // import data\r\n $file = $_FILES['importFile'];\r\n $type = Tools::strtolower(Tools::substr(strrchr($file['name'], '.'), 1));\r\n if ( $type == 'json' ){\r\n return $this->_import($file['tmp_name']);\r\n } else {\r\n return GearHelper::displayAlert('Please use a valid JSON file for import', 'danger');\r\n }\r\n }\r\n }", "function process_csv_upload() {\n\tcheck_admin_referer( 'upload-csv', 'upload_nonce' );\n\n\tif ( empty( $_FILES['csv_upload'] ) ) {\n\t\twp_die( esc_html__( 'Unable to access uploaded file!', 'csv-import-framework' ) );\n\t}\n\n\t$file = $_FILES['csv_upload']; // wpcs: sanitization ok.\n\n\t// Overwrite the post action so `wp_handle_upload()` does additional checks.\n\t$_POST['action'] = 'wp_handle_upload';\n\n\t// This filter will save the CSV data and then ultimately kill the request.\n\tadd_filter( 'pre_move_uploaded_file', __NAMESPACE__ . '\\store_csv_upload', 10, 2 );\n\n\t$result = wp_handle_upload( $file, [\n\t\t'mimes' => [\n\t\t\t'csv' => 'text/csv',\n\t\t],\n\t] );\n}" ]
[ "0.7146849", "0.7133175", "0.6796284", "0.66229147", "0.6596257", "0.65135676", "0.65079963", "0.6497818", "0.6457223", "0.6449575", "0.6449289", "0.644322", "0.63494515", "0.63454115", "0.63079023", "0.6222137", "0.62158084", "0.6185931", "0.61650974", "0.61631113", "0.6154209", "0.6153003", "0.61513853", "0.61349475", "0.6119725", "0.6100037", "0.60849774", "0.6081837", "0.60638165", "0.60605025", "0.6059751", "0.60517955", "0.6046445", "0.6035689", "0.60351664", "0.6019516", "0.59918714", "0.5965891", "0.5945583", "0.59302026", "0.5929954", "0.59274125", "0.5901938", "0.59016407", "0.5887877", "0.5869235", "0.5845445", "0.58453494", "0.58401763", "0.5838722", "0.5836888", "0.58288354", "0.58208746", "0.57944405", "0.57934177", "0.57864165", "0.57790464", "0.5761489", "0.5760562", "0.5759932", "0.57519174", "0.57470185", "0.57297033", "0.5729546", "0.5721913", "0.5720257", "0.571912", "0.57073355", "0.56987005", "0.5691286", "0.5689231", "0.5679466", "0.56562054", "0.5630518", "0.56270796", "0.5615086", "0.5612661", "0.560094", "0.5595205", "0.5593483", "0.55826896", "0.55692667", "0.5559692", "0.5536499", "0.5529158", "0.5528933", "0.55244863", "0.5520659", "0.55149627", "0.5500377", "0.549829", "0.54966736", "0.549614", "0.5495268", "0.54867536", "0.5480031", "0.5479395", "0.5469509", "0.5461932", "0.543976", "0.5433893" ]
0.0
-1
Reset all the "generated" values related to identifying duplicates and amended contracts
public static function resetGeneratedValues($acronym = null) { $updateArray = [ 'gen_is_duplicate' => 0, 'gen_duplicate_via' => null, 'gen_duplicate_source_id' => null, 'gen_is_amendment' => 0, 'gen_amendment_via' => null, 'gen_amendment_group_id' => null, 'gen_effective_start_year' => null, 'gen_effective_end_year' => null, 'gen_effective_total_value' => null, 'gen_effective_yearly_value' => null, ]; if ($acronym) { return DB::table('l_contracts')->where('owner_acronym', '=', $acronym)->update($updateArray); } else { return DB::table('l_contracts')->update($updateArray); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reset()\n {\n $this->values[self::contractorstatics] = null;\n $this->values[self::stores] = array();\n $this->values[self::visited] = array();\n $this->values[self::review_info] = array();\n $this->values[self::customer_info] = array();\n $this->values[self::mark_price_info] = array();\n $this->values[self::more_url] = null;\n $this->values[self::order_tracking] = array();\n }", "public function reset()\n {\n $this->values[self::EQUIPMENTING_ITEM] = array();\n $this->values[self::HAVING_ITEM] = array();\n }", "public function reset()\n {\n $this->values[self::_ITEM_IDS] = array();\n $this->values[self::_NEW_HEROES] = array();\n $this->values[self::_SMASH_IDX] = array();\n }", "public function reset()\n {\n $this->values[self::BOXID] = null;\n $this->values[self::DRAFTID] = null;\n $this->values[self::TOBOXID] = null;\n $this->values[self::TODEPARTMENTID] = null;\n $this->values[self::DOCUMENTSIGNATURES] = array();\n $this->values[self::PROXYBOXID] = null;\n $this->values[self::PROXYDEPARTMENTID] = null;\n }", "public function reset()\n {\n $this->values[self::_SUMMARY] = null;\n $this->values[self::_MEMBERS] = array();\n $this->values[self::_APPLIERS] = array();\n $this->values[self::_VITALITY] = null;\n $this->values[self::_SELF_VITALITY] = null;\n $this->values[self::_LEFT_DISTRIBUTE_TIME] = null;\n }", "public function reset()\n {\n $this->values[self::_OWNER] = null;\n $this->values[self::_ID] = null;\n $this->values[self::_TYPE_ID] = null;\n $this->values[self::_TEAM] = array();\n $this->values[self::_STATE] = null;\n $this->values[self::_STATE_END_TS] = null;\n $this->values[self::_PRODUCE_SPEED] = null;\n $this->values[self::_STORAGE] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_RSEED] = null;\n $this->values[self::_HERO_BASES] = array();\n $this->values[self::_HERO_DYNAS] = array();\n }", "public function reset()\n {\n $this->values[self::_MONEY] = null;\n $this->values[self::_DIAMOND] = null;\n $this->values[self::_ITEMS] = array();\n $this->values[self::_HEROES] = array();\n $this->values[self::_MONTH_CARD] = null;\n }", "public function reset()\n {\n $this->values[self::pending_pay] = null;\n $this->values[self::pending_shipped] = null;\n $this->values[self::pending_received] = null;\n $this->values[self::user_received] = null;\n $this->values[self::to_share] = null;\n }", "public function reset() {\n $this->values[self::NAME] = null;\n $this->values[self::ISMONTICKET] = null;\n $this->values[self::MAXPRICE] = null;\n $this->values[self::KINDTYPE] = null;\n $this->values[self::STARTTIME] = null;\n $this->values[self::ENDTIME] = null;\n $this->values[self::TICKETPRICE] = null;\n $this->values[self::UID] = null;\n $this->values[self::PRIMARY_UID] = null;\n $this->values[self::HAS_RTBUS] = null;\n $this->values[self::RTBUS_UPDATE_TIME] = null;\n $this->values[self::NEAREST_STATION] = null;\n }", "public function reset()\n {\n $this->values[self::_TEAMS] = array();\n $this->values[self::_REWARD] = null;\n $this->values[self::_GUESS] = null;\n }", "public function reset()\n {\n $this->values[self::_EXCAVATE] = array();\n $this->values[self::_SEARCHED_ID] = null;\n $this->values[self::_SEARCH_TIMES] = null;\n $this->values[self::_LAST_SEARCH_TS] = null;\n $this->values[self::_ATTACKING_ID] = null;\n $this->values[self::_BAT_HEROES] = array();\n $this->values[self::_CFG] = null;\n $this->values[self::_HIRE] = null;\n }", "public function reset()\n {\n $this->values[self::_AMOUNT] = null;\n $this->values[self::_REWARDS] = array();\n $this->values[self::_DAILYJOB] = null;\n }", "public function reset()\n {\n $this->values[self::_ITEMS] = array();\n $this->values[self::_RAID_ID] = null;\n $this->values[self::_APPLY_ITEM_ID] = null;\n $this->values[self::_RANK] = null;\n }", "public function reset()\n {\n $this->values[self::_RANK] = null;\n $this->values[self::_LEFT_COUNT] = null;\n $this->values[self::_LAST_BT_TIME] = null;\n $this->values[self::_BUY_TIMES] = null;\n $this->values[self::_LINEUP] = array();\n $this->values[self::_GS] = null;\n $this->values[self::_OPPOS] = array();\n }", "public function reset()\n {\n $this->values[self::TRANSACTION_ID] = null;\n $this->values[self::EVENTS] = [];\n $this->values[self::REQUIRE_MASTER] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_ITEMS] = array();\n $this->values[self::_HERO] = array();\n $this->values[self::_DIAMOND] = null;\n }", "public function reset()\n {\n $this->values[self::OPERATIONINFO] = null;\n $this->values[self::TRANSFERDATE] = null;\n $this->values[self::CREATEDTHINGTRANSFERDATE] = null;\n $this->values[self::CREATEDTHINGINFO] = null;\n $this->values[self::ADDITIONALINFOS] = array();\n }", "public function reset()\n {\n $this->values[self::_SUMMARY] = array();\n $this->values[self::_TIMEOUT] = null;\n $this->values[self::_ITEM_COUNT] = null;\n $this->values[self::_RANK] = null;\n $this->values[self::_ITEM_ID] = null;\n $this->values[self::_JUMP_TIMES] = null;\n $this->values[self::_COST_MONEY] = null;\n }", "public function reset()\n {\n $this->values[self::_MONEY] = null;\n $this->values[self::_RMB] = null;\n $this->values[self::_HEROES] = array();\n $this->values[self::_ITEMS] = array();\n }", "public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_EXPIRE_TIME] = null;\n $this->values[self::_STAR_GOODS] = array();\n }", "public function reset()\n {\n $this->values[self::_SUMMARY] = array();\n $this->values[self::_SELF_RANKING] = null;\n $this->values[self::_SELF_SUMMARY] = null;\n }", "public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_LAST_AUTO_REFRESH_TIME] = null;\n $this->values[self::_EXPIRE_TIME] = null;\n $this->values[self::_LAST_MANUAL_REFRESH_TIME] = null;\n $this->values[self::_TODAY_TIMES] = null;\n $this->values[self::_CURRENT_GOODS] = array();\n }", "public function reset()\n {\n $this->values[self::_COMP] = array();\n }", "abstract protected function reset_values();", "public function reset()\n {\n $this->values[self::_ITEM_ID] = null;\n $this->values[self::_NUM] = null;\n $this->values[self::_STATE] = null;\n $this->values[self::_APPLY_NUM] = null;\n $this->values[self::_ABLE_APP_COUNT] = null;\n }", "public function reset()\n {\n $this->values[self::_GUILDS] = array();\n $this->values[self::_RESULT] = null;\n $this->values[self::_CREATE_COST] = null;\n }", "public function reset()\n {\n $this->values[self::_INSTANCE_INFO] = null;\n $this->values[self::_RSEED] = null;\n $this->values[self::_LOOTS] = array();\n $this->values[self::_HP_DROP] = array();\n }", "public function reset()\n {\n $this->values[self::_SELF_TEAM] = null;\n $this->values[self::_OPPO_TEAM] = null;\n $this->values[self::_RESULT] = null;\n $this->values[self::_RECORD_ID] = null;\n $this->values[self::_RECORD_SVRID] = null;\n }", "public function reset()\n {\n $this->values[self::SHIPMENTRECEIPTDATE] = null;\n $this->values[self::ATTORNEY] = null;\n $this->values[self::ACCEPTEDBY] = null;\n $this->values[self::RECEIVEDBY] = null;\n $this->values[self::SIGNER] = null;\n $this->values[self::ADDITIONALINFO] = null;\n }", "public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_STATUS] = null;\n $this->values[self::_MAIL_TIME] = null;\n $this->values[self::_EXPIRE_TIME] = null;\n $this->values[self::_CONTENT] = null;\n $this->values[self::_MONEY] = null;\n $this->values[self::_DIAMONDS] = null;\n $this->values[self::_SKILL_POINT] = null;\n $this->values[self::_ITEMS] = array();\n $this->values[self::_POINTS] = array();\n }", "public function reset()\n {\n $this->values[self::_ID] = array();\n }", "public function reset()\n {\n $this->values[self::_RSEED] = null;\n $this->values[self::_LOOTS] = array();\n }", "public function reset()\n {\n $this->values[self::_GUILDS] = null;\n $this->values[self::_RESULT] = null;\n $this->values[self::_CREATE_COST] = null;\n }", "public function reset()\n {\n $this->values[self::RMB] = null;\n $this->values[self::CHARGE_SUM] = null;\n $this->values[self::HEROES] = array();\n $this->values[self::RECHARGE_LIMIT] = array();\n $this->values[self::_MONTH_CARD] = array();\n }", "private function reset()\n {\n $this->senderId = $this->factory->uuid;\n $this->amount = $this->factory->numberBetween(1, 10000);\n $this->recipientId = $this->factory->uuid;\n }", "public function reset()\n {\n $this->values[self::_SERIAL_ID] = null;\n $this->values[self::_CHARGE_ID] = null;\n }", "public function reset()\n {\n $this->values[self::_ITEM_ID] = null;\n $this->values[self::_RECEIVER_NAME] = null;\n $this->values[self::_SEND_TIME] = null;\n $this->values[self::_SENDER_NAME] = null;\n }", "public function reset()\n {\n $this->values[self::_TEAM_ID] = null;\n $this->values[self::_PLAYER] = null;\n $this->values[self::_HERO_BASES] = array();\n $this->values[self::_HERO_DYNAS] = array();\n $this->values[self::_RES_GOT] = null;\n $this->values[self::_SVR_ID] = null;\n $this->values[self::_DISPLAY_SVR_ID] = null;\n $this->values[self::_SVR_NAME] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_RSEED] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_HERO] = null;\n $this->values[self::_ITEMS] = array();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_BUY_TIMES] = null;\n }", "public function reset()\n {\n $this->values[self::_SUMMARY] = null;\n $this->values[self::_RESULT] = null;\n $this->values[self::_REWARDS] = array();\n $this->values[self::_APPLY_REWARDS] = array();\n $this->values[self::_STAGE_OLD_PROGRESS] = null;\n $this->values[self::_JOIN_TIMES] = null;\n $this->values[self::_BREAK_HISTORY] = null;\n }", "public function reset()\n {\n $this->values[self::_HERO] = null;\n $this->values[self::_COST] = null;\n $this->values[self::_INCOME] = null;\n $this->values[self::_HIRE_TS] = null;\n }", "public function reset()\n {\n $this->values[self::_LADDER_NOTIFY] = null;\n $this->values[self::_NEW_MAIL] = null;\n $this->values[self::_GUILD_CHAT] = null;\n $this->values[self::_ACTIVITY_NOTIFY] = null;\n $this->values[self::_ACTIVITY_REWARD] = null;\n $this->values[self::_RELEASE_HEROES] = array();\n $this->values[self::_EXCAV_RECORD] = null;\n $this->values[self::_GUILD_DROP] = null;\n $this->values[self::_PERSONAL_CHAT] = null;\n $this->values[self::_SPLITABLE_HEROES] = null;\n }", "public function reset()\n {\n $this->values[self::_DIAMOND] = null;\n $this->values[self::_GUILDPOINT] = null;\n $this->values[self::_DPS] = null;\n $this->values[self::_OLD_DPS] = null;\n $this->values[self::_OLD_SUMMARY] = null;\n }", "public function reset()\n {\n $this->values[self::_HERO_ID] = null;\n $this->values[self::_DYNA] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_HIRE_REWARD] = null;\n $this->values[self::_STAY_REWARD] = null;\n $this->values[self::_HEROID] = null;\n }", "public function reset()\n {\n $this->values[self::_CHECKID] = null;\n $this->values[self::_USERID] = null;\n $this->values[self::_USERNAME] = null;\n $this->values[self::_LEVEL] = null;\n $this->values[self::_AVATAR] = null;\n $this->values[self::_VIP] = null;\n $this->values[self::_OPPO_USERID] = null;\n $this->values[self::_OPPO_NAME] = null;\n $this->values[self::_OPPO_LEVEL] = null;\n $this->values[self::_OPPO_AVATAR] = null;\n $this->values[self::_OPPO_VIP] = null;\n $this->values[self::_OPPO_ROBOT] = null;\n $this->values[self::_RESULT] = Down_BattleResult::victory;\n $this->values[self::_SELF_HEROES] = array();\n $this->values[self::_SELF_DYNAS] = array();\n $this->values[self::_OPPO_HEROES] = array();\n $this->values[self::_OPPO_DYNAS] = array();\n $this->values[self::_RSEED] = null;\n $this->values[self::_SELF_ROBOT] = null;\n $this->values[self::_PARAM1] = null;\n $this->values[self::_OPERATIONS] = array();\n }", "private function resetAll(){\n $this->score = ['heritage'=> 0,'relax'=> 0,'sightseeing'=> 0,'weather'=> 0,'populated'=> 0];\n $this->answeredQuestions = [];\n $this->answersId = [];\n }", "public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_LAST_REWARDS_TIME] = null;\n $this->values[self::_TASK_TARGET] = null;\n }", "public function reset() {\n $this->values[self::FROM_TIME] = null;\n $this->values[self::PRICE] = array();\n $this->values[self::MILEAGE] = null;\n $this->values[self::GEO] = null;\n }", "public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_AMOUNT] = null;\n $this->values[self::_TYPE] = null;\n $this->values[self::_PRICE] = null;\n $this->values[self::_IS_SALE] = null;\n }", "public function reset()\n {\n $this->values[self::_USER_ID] = null;\n $this->values[self::_SUMMARY] = null;\n $this->values[self::_DETA_RANK] = null;\n $this->values[self::_BT_TIME] = null;\n $this->values[self::_BT_RESULT] = null;\n $this->values[self::_REPLAY_ID] = null;\n }", "public function reset()\n {\n $this->values[self::_EXP] = null;\n $this->values[self::_MONEY] = null;\n $this->values[self::_ITEMS] = array();\n }", "public function reset()\n {\n $this->values[self::product_id] = null;\n $this->values[self::product_num] = null;\n $this->values[self::deal_price] = null;\n $this->values[self::new_user_price] = null;\n }", "public function reset()\n {\n $this->values[self::ITEM] = null;\n $this->values[self::COUNT] = null;\n $this->values[self::USE_TYPE] = null;\n $this->values[self::TARGET] = null;\n $this->values[self::NAME] = null;\n $this->values[self::PARAMS_INT] = array();\n }", "public function reset()\n {\n $this->values[self::_INFO] = null;\n $this->values[self::_WORSHIP] = null;\n $this->values[self::_DROP_INFO] = null;\n $this->values[self::_TO_CHAIRMAN] = null;\n }", "public function reset()\n {\n $this->values[self::customer_id] = null;\n $this->values[self::auth_token] = null;\n $this->values[self::wholesaler_id] = null;\n $this->values[self::order_id] = null;\n $this->values[self::quality] = null;\n $this->values[self::delivery] = null;\n $this->values[self::comment] = null;\n }", "public function reset()\n {\n $this->values[self::STATUS] = null;\n $this->values[self::ERRORS] = array();\n $this->values[self::VALIDATOR_REVISION] = self::$fields[self::VALIDATOR_REVISION]['default'];\n $this->values[self::SPEC_FILE_REVISION] = self::$fields[self::SPEC_FILE_REVISION]['default'];\n $this->values[self::TRANSFORMER_VERSION] = self::$fields[self::TRANSFORMER_VERSION]['default'];\n $this->values[self::TYPE_IDENTIFIER] = array();\n $this->values[self::VALUE_SET_PROVISIONS] = array();\n $this->values[self::VALUE_SET_REQUIREMENTS] = array();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_RSEED] = null;\n $this->values[self::_SELF_HEROES] = array();\n $this->values[self::_HEROES] = array();\n $this->values[self::_IS_ROBOT] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_LINEUP] = array();\n $this->values[self::_GS] = null;\n }", "public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_TYPE] = null;\n $this->values[self::_START_TIME] = null;\n $this->values[self::_END_TIME] = null;\n $this->values[self::_REWARDS] = array();\n $this->values[self::_TITLE] = null;\n $this->values[self::_DESC] = null;\n $this->values[self::_RULES] = null;\n }", "public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_STAGE_ID] = null;\n $this->values[self::_LEFT_TIME] = null;\n $this->values[self::_START_TIME] = null;\n $this->values[self::_PROGRESS] = null;\n $this->values[self::_STAGE_PROGRESS] = null;\n $this->values[self::_BATTLE_USER_ID] = null;\n }", "public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_FREQUENCY] = null;\n $this->values[self::_LAST_CHANGE] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_ACTIVITY_REWARD] = array();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_BEST_RANK_REWARD] = null;\n $this->values[self::_BEST_RANK] = null;\n $this->values[self::_CUR_RANK] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_EXCAVATE] = null;\n $this->values[self::_REWARD] = null;\n }", "public function reset()\n {\n $this->values[self::_RANK_LIST] = array();\n }", "public function reset()\n {\n $this->values[self::_CHALLENGER] = null;\n $this->values[self::_DAMAGE] = null;\n }", "public function reset()\n {\n $this->values[self::_CHALLENGER] = null;\n $this->values[self::_DAMAGE] = null;\n }", "public function reset()\n {\n $this->values[self::_RAID_ID] = null;\n $this->values[self::_DPS_LIST] = array();\n $this->values[self::_ITEM_INFO] = array();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_STAGE_ID] = null;\n $this->values[self::_REWARDS] = array();\n $this->values[self::_HEROES] = array();\n }", "public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_EXCAVATE_ID] = null;\n $this->values[self::_RESULT] = null;\n $this->values[self::_ENEMY_NAME] = null;\n $this->values[self::_ENEMY_SVRID] = null;\n $this->values[self::_ENEMY_SVRNAME] = null;\n $this->values[self::_TIME] = null;\n $this->values[self::_VATILITY] = null;\n }", "public function reset()\n {\n $this->values[self::_CURRENT] = null;\n $this->values[self::_LASTCHANGE] = null;\n $this->values[self::_TODAYBUY] = null;\n $this->values[self::_LASTBUY] = null;\n }", "public function reset()\n {\n $this->values[self::_USER_ID] = null;\n $this->values[self::_SUMMARY] = null;\n $this->values[self::_RANK] = null;\n $this->values[self::_WIN_CNT] = null;\n $this->values[self::_GS] = null;\n $this->values[self::_IS_ROBOT] = null;\n $this->values[self::_HEROS] = array();\n }", "public function reset()\n {\n $this->values[self::TIME] = null;\n $this->values[self::TYPE] = null;\n $this->values[self::GAMER_ID] = null;\n $this->values[self::GAMER_NAME] = null;\n $this->values[self::RELATER_ID] = null;\n $this->values[self::RELATER_NAME] = null;\n }", "public function reset()\n {\n $this->values[self::_INDEX] = null;\n $this->values[self::_ITEM_ID] = null;\n $this->values[self::_EXP] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_REWARDS] = array();\n }", "public function reset()\n {\n $this->values[self::_MEMBERS] = array();\n $this->values[self::_ITEMS] = array();\n }", "public function reset()\n {\n $this->values[self::_TID] = null;\n $this->values[self::_SPLIT_TIMES] = null;\n $this->values[self::_END_POINT] = null;\n }", "public function reset()\n {\n $this->values[self::services] = array();\n $this->values[self::mapping] = array();\n $this->values[self::short_tcp] = self::$fields[self::short_tcp]['default'];\n }", "public function reset()\n {\n $this->values[self::_PER] = null;\n $this->values[self::_ITEMS] = array();\n }", "public function reset()\n {\n $this->values[self::_CURRENT_RAID_ID] = null;\n $this->values[self::_SUMMARY] = array();\n $this->values[self::_STAGE_PASS] = null;\n $this->values[self::_IS_CAN_JUMP] = null;\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_AMOUNT] = null;\n $this->values[self::_STONE_ID] = null;\n $this->values[self::_STONE_AMOUNT] = null;\n }", "public function reset()\n {\n $this->values[self::_USERID] = null;\n $this->values[self::_NAME_CARD] = null;\n $this->values[self::_LEVEL] = null;\n $this->values[self::_RECHARGE_SUM] = null;\n $this->values[self::_EXP] = null;\n $this->values[self::_MONEY] = null;\n $this->values[self::_RMB] = null;\n $this->values[self::_VITALITY] = null;\n $this->values[self::_HEROES] = array();\n $this->values[self::_ITEMS] = array();\n $this->values[self::_SKILL_LEVEL_UP] = null;\n $this->values[self::_USERSTAGE] = null;\n $this->values[self::_SHOP] = array();\n $this->values[self::_TUTORIAL] = array();\n $this->values[self::_TASK] = array();\n $this->values[self::_TASK_FINISHED] = array();\n $this->values[self::_LAST_LOGIN] = null;\n $this->values[self::_DAILYJOB] = array();\n $this->values[self::_TAVERN_RECORD] = array();\n $this->values[self::_USERMIDAS] = null;\n $this->values[self::_DAILY_LOGIN] = null;\n $this->values[self::_RECHARGE_LIMIT] = array();\n $this->values[self::_VIP_GIFTS_DRAW] = array();\n $this->values[self::_POINTS] = array();\n $this->values[self::_MONTH_CARD] = array();\n $this->values[self::_USER_GUILD] = null;\n $this->values[self::_CHAT] = null;\n $this->values[self::_SSHOP] = null;\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_ID] = null;\n $this->values[self::_AMOUNT] = null;\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_ID] = null;\n $this->values[self::_AMOUNT] = null;\n }", "public function reset()\n {\n $this->values[self::_DAMAGES] = array();\n }", "public function reset()\n {\n $this->values[self::promotions] = array();\n }", "public function reset()\n {\n $this->values[self::payment_method] = null;\n $this->values[self::wechat_pay] = null;\n $this->values[self::alipay_express] = null;\n $this->values[self::order_id] = array();\n $this->values[self::order] = array();\n }", "public function reset()\n {\n $this->setValue($this->generate());\n }", "public function reset()\n {\n $this->values[self::_ITEMS] = array();\n $this->values[self::_GOLD] = null;\n $this->values[self::_SKILL_POINT] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_NEW_MAN] = null;\n }", "public function reset()\n {\n $this->values[self::_TID] = null;\n $this->values[self::_RANK] = null;\n $this->values[self::_LEVEL] = null;\n $this->values[self::_STARS] = null;\n $this->values[self::_EXP] = null;\n $this->values[self::_GS] = null;\n $this->values[self::_STATE] = null;\n $this->values[self::_SKILL_LEVELS] = array();\n $this->values[self::_ITEMS] = array();\n }", "public function reset()\n {\n $this->_contacts = [];\n $this->_lists = [];\n }", "public function reset()\n {\n $this->values[self::_LOOT] = array();\n $this->values[self::_ITEMS] = array();\n $this->values[self::_SHOP] = null;\n $this->values[self::_SSHOP] = null;\n }", "public function reset()\n {\n $this->values[self::ID] = null;\n $this->values[self::LEVELUP_TIME] = null;\n $this->values[self::BEHELPED_TIMES] = null;\n $this->values[self::HELP_ASKED] = self::$fields[self::HELP_ASKED]['default'];\n $this->values[self::TOTAL_TIME] = null;\n }", "public function reset()\n {\n $this->values[self::_ITEM_HISTORYS] = array();\n }", "public function reset() {\n $this->values[self::CODE] = null;\n $this->values[self::NAME] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_INCOME] = null;\n }" ]
[ "0.68253595", "0.6740691", "0.6681399", "0.6585703", "0.6581564", "0.65534204", "0.65452754", "0.65414774", "0.652923", "0.64638394", "0.6457158", "0.6444771", "0.64388466", "0.6429578", "0.64243233", "0.6423029", "0.64032197", "0.64020044", "0.6388882", "0.6388422", "0.63872683", "0.63793683", "0.63782847", "0.6364846", "0.6361381", "0.635453", "0.6352254", "0.6350802", "0.6321486", "0.6310502", "0.6300588", "0.6298219", "0.6283603", "0.6275439", "0.626297", "0.62563854", "0.6249722", "0.62372565", "0.6230302", "0.6215488", "0.61971277", "0.61854243", "0.61846286", "0.61830467", "0.61767846", "0.61671704", "0.6156933", "0.6155307", "0.6153934", "0.6150566", "0.61439985", "0.6139807", "0.6128627", "0.61286086", "0.6128333", "0.61279666", "0.61279565", "0.61274576", "0.6125924", "0.6113874", "0.6101098", "0.60965604", "0.6094023", "0.60909194", "0.60830253", "0.6081735", "0.6079345", "0.6077373", "0.6076613", "0.60656184", "0.6065413", "0.60601026", "0.6058196", "0.6046708", "0.60405016", "0.6036191", "0.60331327", "0.6029129", "0.60281384", "0.60248214", "0.602166", "0.6019821", "0.60044825", "0.59997565", "0.59971845", "0.59945786", "0.59907156", "0.59907156", "0.5988583", "0.5987727", "0.5986229", "0.5984853", "0.5984757", "0.5980961", "0.59791034", "0.597416", "0.5972768", "0.596842", "0.5959809", "0.5957551", "0.59551555" ]
0.0
-1
Update a list of IDs and mark them as duplicates
public static function markDuplicateEntries($ownerAcronym, $duplicateRows, $method = 1) { // Includs the ownerAcronym just to be on the safe side. // Remove the first entry (so that it isn't also marked as a duplicate, since at least one entry should stay "valid") $sourceId = $duplicateRows->shift(); $duplicateRows = $duplicateRows->toArray(); return DB::table('l_contracts') ->where('owner_acronym', '=', $ownerAcronym) ->whereIn('id', $duplicateRows) ->update([ 'gen_is_duplicate' => 1, 'gen_duplicate_via' => $method, 'gen_duplicate_source_id' => $sourceId, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cleanDuplicates( );", "protected function removeDuplicates(): void\n {\n $this->startTiming();\n\n $this->logInfo('Removing duplicates...');\n\n $this->list = array_unique($this->list);\n\n $this->endTiming();\n }", "public function testWithDuplicates(): void\n {\n /** @var Video $video */\n $video = Video::factory()->create();\n $comments = Comment::factory()->count(3)->create();\n\n $comments[1]->commentable()->associate($video)->save();\n\n $ids = collect($comments)->push($comments[1])->map(fn(Comment $comment) => [\n 'type' => 'comments',\n 'id' => (string) $comment->getRouteKey(),\n ])->all();\n\n $actual = $this->repository\n ->modifyToMany($video, 'comments')\n ->sync($ids);\n\n $this->assertCount(3, $actual);\n $this->assertSame(3, $video->comments()->count());\n $this->assertComments($comments, $actual);\n }", "public function setIds($arrIds);", "private function check_for_duplicate_user_ids() {\n foreach($this->data as $course => $rows) {\n $user_ids = null;\n $d_rows = null;\n // Returns FALSE (as in there is an error) when duplicate IDs are found.\n // However, a duplicate ID does not invalidate a course. Instead, the\n // first enrollment is accepted, the other enrollments are discarded,\n // and the event is logged.\n if (validate::check_for_duplicate_user_ids($rows, $user_ids, $d_rows) === false) {\n foreach($d_rows as $user_id => $userid_rows) {\n $length = count($userid_rows);\n for ($i = 1; $i < $length; $i++) {\n unset($this->data[$course][$userid_rows[$i]]);\n }\n }\n\n $msg = \"Duplicate user IDs detected in {$course} data: \";\n $msg .= implode(\", \", $user_ids);\n $this->log_it($msg);\n }\n }\n\n return true;\n }", "public static function markAsPaids($ids) {\n\n if(!is_array($ids)){\n $ids = array($ids);\n }\n\n $criteria = new CDbCriteria;\n $criteria->addInCondition('id', $ids);\n \n return self::model()->updateAll(array(\n 'status' => parent::STATUS_PAID,\n 'admin_id' => Yii::app()->user->getId(),\n\n //no reason to keep this (cause we will save to history)\n 'decline_reason' => null,\n 'comment' => null,\n\n ), $criteria);\n }", "public function mergeUnique() {}", "public function modifyCommonId(){\n ini_set('memory_limit', '1024M');\n\n $num = 100;\n\n\n DB::table('commons')->orderBy('id')->chunkById($num, function ($queries) use($num) {\n foreach ($queries as $key => $query) {\n\n DB::table('commons')->where('id', $query->id)->update(['id' => $this->add + $key + 1]);\n if(fmod($key,100) == 99 ){\n $this->add = $this->add + 100;\n }\n }\n });\n }", "public static function updateStatusByIDs($ids,$status = self::STATUS_COMMON){\n $numberOfUpdate = static::updateAll(['status'=>$status],['id'=>$ids]);\n return $numberOfUpdate == count($ids);\n }", "public function merge(Collection $source): void\n {\n $ids = $this->getIds();\n\n foreach ($source as $entity) {\n if (!in_array($entity->getId(), $ids)) {\n $this->addEntity($entity);\n }\n }\n }", "function insert_on_duplicate_update_batch($table = '', $set = NULL)\n\t{\n\t\t\n\t\tif ( ! is_null($set))\n\t\t{\n\t\t\t$this->set_insert_batch($set);\n\t\t}\n\n\t\tif (count($this->ar_set) == 0)\n\t\t{\n\t\t\tif ($this->db_debug)\n\t\t\t{\n\t\t\t\t//No valid data array. Folds in cases where keys and values did not match up\n\t\t\t\treturn $this->display_error('db_must_use_set');\n\t\t\t}\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif ($table == '')\n\t\t{\n\t\t\tif ( ! isset($this->ar_from[0]))\n\t\t\t{\n\t\t\t\tif ($this->db_debug)\n\t\t\t\t{\n\t\t\t\t\treturn $this->display_error('db_must_set_table');\n\t\t\t\t}\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$table = $this->ar_from[0];\n\t\t}\n\n\t\t// Batch this baby\n\t\tfor ($i = 0, $total = count($this->ar_set); $i < $total; $i = $i + 100)\n\t\t{\n\n\t\t\t$sql = $this->_insert_on_duplicate_update_batch($this->_protect_identifiers($table, TRUE, NULL, FALSE), $this->ar_keys, array_slice($this->ar_set, $i, 100));\n\n\t\t\t// echo $sql;\n\n\t\t\t$this->query($sql);\n\t\t}\n\n\t\t$this->_reset_write();\n\n\n\t\treturn TRUE;\n\t}", "protected function _clearIds(): void\n {\n $this->_idSuffixes = [];\n }", "function checkForDuplicateUnique(){\n $_ufields_arr = explode(\",\", $this->listSettings->GetItem(\"MAIN\", \"UNIQUE_FIELDS\"));\n $check_fields = true;\n for ($i = 0; $i < sizeof($_ufields_arr); $i ++) {\n list ($_field[$i], $_value[$i]) = explode(\"=\", $_ufields_arr[$i]);\n if (strlen($_value[$i])) {\n $check_fields = false;\n $_query_arr[$_field[$i]] = $_value[$i];\n if ($this->_data[$_field[$i]] == $_value[$i]) {\n $check_fields = true;\n }\n }\n else {\n $_query_arr[$_field[$i]] = $this->_data[$_field[$i]];\n }\n }\n if ($check_fields) {\n $_data = $this->Storage->GetByFields($_query_arr, null);\n }\n else {\n $_data = array();\n }\n if (! empty($_data)) {\n if (($this->item_id != $_data[$this->key_field])) {\n if ($this->Kernel->Errors->HasItem($this->library_ID, \"RECORD_EXISTS\")) {\n $_error_section = $this->library_ID;\n }\n else {\n $_error_section = \"GlobalErrors\";\n }\n $this->validator->SetCustomError($_ufields_arr, \"RECORD_EXISTS\", $_error_section);\n }\n }\n }", "public function duplicated()\r\n {\r\n // Fetch participant users relation before resetting id!\r\n $this->participantUsers;\r\n $this->id = null;\r\n $this->isNewRecord = true;\r\n $this->date = null;\r\n }", "function shiftList() {\n\t\t$rest = array_splice($this->galleysToUpdate, \\dfm\\processor::maxUpdatesAtOnce);\n\t\t$ids = array_map(function($item) {\n\t\t\treturn $item->galley->getId();\n\t\t}, $rest);\n\t\t$this->continue = array(\n\t\t\t'galleyIds' => $ids,\n\t\t\t'updateFrontpages' => $this->updateFrontpages\n\t\t);\n\t}", "abstract public function isDuplicatePIMAddition($id);", "public function setGroupIds(?array $value): void {\n $this->getBackingStore()->set('groupIds', $value);\n }", "public function addIds($value) {\n return $this->_add(1, $value);\n }", "public function adicionarRepetidos($list){\n\n /*echo('<pre>');\n var_dump($list);\n echo('</pre>');*/\n\n for($i = 0; $i < count($list); $i++){\n for($j = $i+1; $j < count($list); $j++){\n if($list[$i][0] -> getIngrediente() == $list[$j][0] -> getIngrediente()){\n $list[$i][1] += $list[$j][1];\n array_splice($list, $j,1);\n }\n }\n }\n return $list;\n }", "function batch_delete_maps ($ids) {\r\n\t\tif (!is_array($ids)) return false;\r\n\t\t$clean = array();\r\n\t\tforeach ($ids as $id) {\r\n\t\t\tif ((int)$id) $clean[] = (int)$id;\r\n\t\t}\r\n\t\tif (empty($clean)) return false;\r\n\t\t$table = $this->get_table_name();\r\n\t\t$res = $this->wpdb->query(\"DELETE FROM {$table} WHERE id IN(\" . join(',', $clean) . \")\", ARRAY_A);\r\n\t\treturn $res ? true : false;\r\n\t}", "private function insertIntoGroup(array $idlist) {\n if (!function_exists('merge_items')) {\n function merge_items(&$item, $key, $toMerge) {\n $item = array(intval($toMerge), intval($item));\n }\n }\n \n $query = \"INSERT INTO tags_group (id, tag_id) VALUES #values#\";\n\n //add group id for each item\n array_walk($idlist, 'merge_items', $this->tagGroupId);\n $ok = $this->db->listInsert($query, $idlist);\n\n return $ok;\n }", "private function _insert_on_duplicate_update_batch($table, $keys, $values)\n\t{\n\t\tforeach($keys as $key)\n\t\t\t$update_fields[] = $key.'=VALUES('.$key.')';\n\n\t\treturn \"INSERT INTO \".$table.\" (\".implode(', ', $keys).\") VALUES \".implode(', ', $values).\" ON DUPLICATE KEY UPDATE \".implode(', ', $update_fields);\n\t}", "public function test_sync_withExistingIds_sameCountAndReturnTrue() {\n\t\t$this->repo->sync(789,91437);\n\t\t\n\t\t$expected = array(\n\t\t\t 'count'=>(integer)$this->repo->count(),\n\t\t\t 'result'=>true\n\t\t);\n\t\t\n\t\t\n\t\t//sync same numbers, count should not change\n\t\t$result = $this->repo->sync(789,91437);\n\t\t\n\t\t$actual = array(\n\t\t\t'count'=>(integer) $this->repo->count(),\n\t\t\t'result'=>$result\n\t\t);\n\t\t\n\t\t$this->assertEquals($expected,$actual);\n\t\t\n\t}", "public function provideEqualButNotIdenticalIds()\n {\n return array(\n array('123', 123),\n array('123', 123.0),\n array('', 0),\n array('0', 0),\n );\n }", "public function sync($ids)\n {\n $ids = is_array($ids) ? $ids : func_get_args();\n $current = $this->pivot()->lists($this->other_key());\n\n foreach ($ids as $id) {\n if (!in_array($id, $current)) {\n $this->attach($id);\n }\n }\n\n $detach = array_diff($current, $ids);\n\n if (count($detach) > 0) {\n $this->detach($detach);\n }\n }", "function _prime_site_caches($ids, $update_meta_cache = \\true)\n {\n }", "public function incrementDuplicates(int $count = 1, bool $incrementAll = false): self\n {\n $this->duplicates += $count;\n if ($incrementAll) {\n $this->incrementAll($count);\n }\n return $this;\n }", "public function delete_duplicates()\n {\n if (empty($this->params['named']['field']))\n {\n echo 'You must enter a field to work with. http://recipe-manager/ingredients/delete_duplicates/field:ingredient';\n exit();\n }\n\n $field = $this->params['named']['field'];\n\n var_dump($field);\n\n $params = array();\n $result = $this->{$this->modelClass}->find('all', $params);\n\n\n foreach ($result as $item)\n {\n $params = array(\n 'conditions' => array($this->modelClass . '.' . $field => $item[$this->modelClass][$field]), //array of conditions\n );\n $r = $this->{$this->modelClass}->find('all', $params);\n\n if (count($r) == 2)\n {\n while (count($r) > 1)\n {\n $t = array_pop($r);\n var_dump($t[$this->modelClass]['_id']);\n $this->{$this->modelClass}->delete($t[$this->modelClass]['_id']);\n }\n }\n }\n\n\n exit('done');\n }", "public function removeFromArchivistIds() {\n $saved = true;\n /** @var modSystemSetting $setting */\n $setting = $this->modx->getObject('modSystemSetting',array('key' => 'archivist.archive_ids'));\n if ($setting) {\n $value = $setting->get('value');\n $archiveKey = $this->object->get('id').':arc_';\n $value = is_array($value) ? $value : explode(',',$value);\n if (in_array($archiveKey,$value)) {\n $newKeys = array();\n foreach ($value as $k => $v) {\n if ($v == $archiveKey) continue;\n $newKeys[] = $v;\n }\n $newKeys = array_unique($newKeys);\n $setting->set('value',implode(',',$newKeys));\n $saved = $setting->save();\n }\n }\n return $saved;\n }", "public function removeFromArchivistIds() {\n $saved = true;\n /** @var modSystemSetting $setting */\n $setting = $this->modx->getObject('modSystemSetting',array('key' => 'archivist.archive_ids'));\n if ($setting) {\n $value = $setting->get('value');\n $archiveKey = $this->object->get('id').':arc_';\n $value = is_array($value) ? $value : explode(',',$value);\n if (in_array($archiveKey,$value)) {\n $newKeys = array();\n foreach ($value as $k => $v) {\n if ($v == $archiveKey) continue;\n $newKeys[] = $v;\n }\n $newKeys = array_unique($newKeys);\n $setting->set('value',implode(',',$newKeys));\n $saved = $setting->save();\n }\n }\n return $saved;\n }", "protected function filterDuplicateAutocompleteSuggestions(array &$suggestions) {\n $added_suggestions = [];\n $added_urls = [];\n /** @var \\Drupal\\search_api_autocomplete\\Suggestion\\SuggestionInterface $suggestion */\n foreach ($suggestions as $key => $suggestion) {\n if (\n !in_array($suggestion->getSuggestedKeys(), $added_suggestions, TRUE) ||\n !in_array($suggestion->getUrl(), $added_urls, TRUE)\n ) {\n $added_suggestions[] = $suggestion->getSuggestedKeys();\n $added_urls[] = $suggestion->getUrl();\n }\n else {\n unset($suggestions[$key]);\n }\n }\n }", "function refresh_all()\r\n\t{\r\n\t\tif ( ! empty($this->all))\r\n\t\t{\r\n\t\t\t$all = array();\r\n\r\n\t\t\tforeach ($this->all as $item)\r\n\t\t\t{\r\n\t\t\t\tif ( ! empty($item->id))\r\n\t\t\t\t{\r\n\t\t\t\t\t$all[] = $item;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$this->all = $all;\r\n\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\r\n\t\treturn FALSE;\r\n\t}", "private function updateItems(array $items, $table)\n {\n foreach (array_chunk($items, $this->itemsPerOperation) as $itemsBunch) {\n $this->attributeResource->getConnection()->insertOnDuplicate(\n $this->attributeResource->getTable($table),\n $itemsBunch,\n ['value']\n );\n }\n }", "function ic_mark_duplicate_titles( $data, $postarr ) {\n\tif ( 'invite_codes' !== $data['post_type'] ) {\n\t\treturn $data;\n\t}\n\n\t$title = $data['post_title'];\n\t$code_exists = get_page_by_title( $title, OBJECT, 'invite_codes' );\n\tif ( $code_exists ) {\n\t\t$data['post_title'] .= '-duplicate';\n\t\t$data['post_status'] = 'draft';\n\t}\n\treturn $data;\n}", "function draft($ids) {\n if (!is_array($ids)) {\n $ids = array(intval($ids));\n }\n $ids = join(', ', $ids);\n $this->query(\"UPDATE {$this->useTable} SET draft = 1 WHERE id IN ($ids)\");\n }", "function Pluf_Model_RemoveDuplicates($array)\n{\n $res = array();\n foreach ($array as $model) {\n if (!Pluf_Model_InArray($model, $res)) {\n $res[] = $model;\n }\n }\n return $res;\n}", "public function testGetListOfSpecificIds()\n {\n $itemIds = [];\n $response = $this->api->create($this->testPayload);\n $this->assertErrors($response);\n $itemIds[] = $response[$this->api->itemName()]['id'];\n $response = $this->api->create($this->testPayload);\n $this->assertErrors($response);\n $itemIds[] = $response[$this->api->itemName()]['id'];\n\n $search = 'ids:'.implode(',', $itemIds);\n\n $response = $this->api->getList($search);\n $this->assertErrors($response);\n $this->assertEquals(count($itemIds), $response['total']);\n\n foreach ($response['lists'] as $item) {\n $this->assertTrue(in_array($item['id'], $itemIds));\n $this->api->delete($item['id']);\n $this->assertErrors($response);\n }\n }", "public function set_id($ids) {\n $this->id = $ids; \n }", "public function save()\n {\n if (!$this->validate()) {\n return false;\n }\n foreach ($this->getIds() as $k => $id) {\n $playlistItem = PlaylistItem::findOne($id);\n if (null !== $playlistItem) {\n $playlistItem->track_number = (int)$k + 1;\n $playlistItem->save();\n }\n }\n Playlist::updateTimestampAttribute($this->playlist_id);\n\n return true;\n }", "public function check_duplicate() {\n $this->db->where ( 'orderID', trim ( $this->input->post ( 'orderID' ) ) );\n\n if ($this->db->count_all_results ( $this->table ))\n echo \"1\"; // duplicate\n else\n echo \"0\";\n }", "function dedupe_using_hollis_id($docs) {\n $deduped_docs = array();\n foreach ($docs as $doc) {\n $in_array = False;\n foreach ($deduped_docs as $deduped_doc) {\n if ($deduped_doc['name'] == $doc['name']) {\n $in_array= True;\n }\n }\n if (!$in_array) {\n $deduped_docs[] = $doc;\n }\n }\n return $deduped_docs;\n }", "public function check_duplicate()\n {\n }", "function produceOId(&$array) {\n for ($i = 0;$i < count($array);$i++) {\n if (!isset($array[$i]->_id)) continue;\n $array[$i]->_id = $array[$i]->_id->__toString();\n }\n\n}", "function pluginDupe($templates) {\n\tglobal $communityPaths;\n\n\t$pluginList = array();\n\tforeach ($templates as $template) {\n\t\tif ( $template['Plugin'] )\n\t\t\t$pluginList[basename($template['Repository'])]++;\n\t}\n\tforeach (array_keys($pluginList) as $plugin) {\n\t\tif ( $pluginList[$plugin] > 1 )\n\t\t\t$dupeList[$plugin]++;\n\t}\n\twriteJsonFile($communityPaths['pluginDupes'],$dupeList);\n}", "public function updateNewDuplicates($high_risk_report_id = false, $high_risk_result_data = array(), $modified_user_id = false)\n\t{\n\t\t\n\t\t$result_ids = (isset($high_risk_result_data['all_ids']['id'])?$high_risk_result_data['all_ids']['id']:array());\n\t\tforeach($high_risk_result_data['HighRiskReport'] as $high_risk_result)\n\t\t{\n\t\t\tif(isset($high_risk_result['HighRiskResult']['new']) and $high_risk_result['HighRiskResult']['new'])\n\t\t\t{\n\t\t\t\tunset($high_risk_result['HighRiskResult']['new']);\n\t\t\t\t\n\t\t\t\tif(isset($high_risk_result['HighRiskResult']['id']))\n\t\t\t\t{\n\t\t\t\t\t$existing_high_risk_result = $this->HighRiskResult->read(null, $high_risk_result['HighRiskResult']['id']);\n\t\t\t\t\t\n\t\t\t\t\tunset($high_risk_result['HighRiskResult']['id']);\n\t\t\t\t\tunset($existing_high_risk_result['HighRiskResult']['id']);\n\t\t\t\t\tunset($existing_high_risk_result['HighRiskResult']['modified']);\n\t\t\t\t\tunset($existing_high_risk_result['HighRiskResult']['modified_user_id']);\n\t\t\t\t\tunset($existing_high_risk_result['HighRiskResult']['high_risk_software_id']);\n\t\t\t\t\t$high_risk_result['HighRiskResult'] = array_merge($existing_high_risk_result['HighRiskResult'], $high_risk_result['HighRiskResult']);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$this->HighRiskResult->create();\n\t\t\t\t$high_risk_result['HighRiskResult']['created'] = date('Y-m-d H:i:s');\n\t\t\t\t$high_risk_result['HighRiskResult']['added_user_id'] = $modified_user_id;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->HighRiskResult->id = $high_risk_result['HighRiskResult']['id'];\n\t\t\t\t$high_risk_result['HighRiskResult']['modified'] = date('Y-m-d H:i:s');\n\t\t\t\t$high_risk_result['HighRiskResult']['modified_user_id'] = $modified_user_id;\n\t\t\t}\n\t\t\t$this->HighRiskResult->data = $high_risk_result;\n\t\t\t$this->HighRiskResult->save($this->HighRiskResult->data);\n\t\t\t$result_ids[$this->HighRiskResult->id] = $this->HighRiskResult->id;\n\t\t}\n\t\t\n\t\t// make sure we have the xref records\n\t\treturn $this->saveAssociatedResults($high_risk_report_id, $result_ids);\n\t}", "public function setMultipleWishlistId($id);", "function _prime_post_caches($ids, $update_term_cache = \\true, $update_meta_cache = \\true)\n {\n }", "public function updateIds(Request $request)\n {\n $authUser = User::find(Auth::user()->id);\n\n $validator = Validator::make($request->all(), [\n 'email' => ['required', 'string', 'email', 'max:255', Rule::unique('users')->ignore($authUser)],\n 'password' => ['required', 'string', 'min:8', 'confirmed'],\n ]);\n\n if ($validator->fails()) {\n return response()->json(['error' => $validator->errors()], 401);\n } else {\n $updateUserIds = $this->userRequest->updateUserIds($authUser);\n return $updateUserIds;\n }\n }", "public function testGetChangeDuplicates()\n {\n }", "public function putMany($ids, $data)\n {\n $sql = \"UPDATE `%s` SET `%s` = ? WHERE `%s` IN (%s)\";\n $column = array_keys($data)[0];\n $placeholders = implode(\", \", array_fill(0, count($ids), \"?\"));\n $this->_sql[] = sprintf($sql, $this->_table, $column, $this->_key, $placeholders);\n $parameters = array(\n array($column => $data[$column])\n );\n foreach ($ids as $id) {\n $parameters[] = array($this->_key => $id);\n }\n $this->_parameters[] = $this->parameterize($parameters);\n return $this->run();\n }", "function delete_duplicates_from_db() {\n //TODO: possibly log or flag the file duplication.\n //it could be 2 physical files in different folders!\n //Somehow signal that case.\n\n $result = $this->pdo->query('DELETE FROM files WHERE rowid NOT IN (\n SELECT MIN(rowid) FROM files GROUP BY filename, md5_sign)');\n $results = $result->rowCount();\n\n return true;\n }", "public function updateMemberId( $oldId, $newId )\n\t{\n\t\t$_likes\t= array();\n\t\t\n\t\t/* We might be merging */\n\t\t$this->DB->build( array( 'select' => 'like_lookup_id', 'from' => 'core_like', 'where' => \"like_member_id=\" . $newId ) );\n\t\t$this->DB->execute();\n\t\t\t\n\t\twhile( $r = $this->DB->fetch() )\n\t\t{\n\t\t\t$_likes[]\t= $r['like_lookup_id'];\n\t\t}\n\t\t/* not done */\n\t\tif ( count( $_likes ) )\n\t\t{\n\t\t\t$this->DB->update( 'core_like'\t\t , array( 'like_member_id' => $newId ), \"like_member_id=\" . $oldId . \" AND like_lookup_id NOT IN('\" . implode( \"','\", array_map( 'addslashes', $_likes ) ) . \"')\" );\n\t\t\t$this->DB->delete( 'core_like_cache' , \"like_cache_id IN('\" . implode( \"','\", array_map( 'addslashes', $_likes ) ) . \"')\" );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->DB->update( 'core_like'\t\t , array( 'like_member_id' => $newId ), \"like_member_id=\" . $oldId );\n\t\t}\n\t\t\n\t\t/* Now remove duplicates */\n\t\t$dupes = array();\n\t\t\n\t\t$this->DB->build( array( 'select' => 'like_id, count(*) as cnt',\n\t\t\t\t\t\t\t\t 'from' => 'core_like',\n\t\t\t\t\t\t\t\t 'where' => 'like_member_id=' . $newId,\n\t\t\t\t\t\t\t\t 'group' => 'like_app, like_area, like_member_id, like_rel_id',\n\t\t\t\t\t\t\t\t 'order' => 'cnt desc' ) );\n\t\t$this->DB->execute();\n\t\t\n\t\twhile( $row = $this->DB->fetch() )\n\t\t{\n\t\t\tif ( $row['cnt'] < 2 )\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$dupes[] = $row['like_id'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Do it? */\n\t\tif ( count( $dupes ) )\n\t\t{\n\t\t\t$this->DB->delete( 'core_like' , \"like_id IN('\" . implode( \"','\", array_map( 'addslashes', $dupes ) ) . \"')\" );\n\t\t}\n\t\t\n\t\t/* Now re-update so that hashes are correct */\n\t\t$update = \"like_id=MD5( CONCAT( like_app, ';', like_area, ';', like_rel_id, ';', like_member_id ) ), \" .\n\t\t\t\t \"like_lookup_area=MD5( CONCAT( like_app, ';', like_area, ';', like_member_id ) )\";\n\t\t\n\t\t$where = \"like_member_id=\" . $newId;\n\t\t\n\t\t$this->DB->update( 'core_like', $update, $where, false, true );\n\t}", "function update_multiple($data) {\n\t\t$query = $this->testimonial_model->_update_multiple('id',$data);\n\t\treturn $query;\n\t}", "protected function storeIdsInSession($data) {\n\t\tif (!count($data)) {\n\t\t\treturn;\n\t\t}\n\t\t$ids = array();\n\t\tforeach ($data as $v) {\n\t\t\tif (isset($v['id'])) {\n\t\t\t\t$ids[] = (int)$v['id'];\n\t\t\t}\n\t\t}\n\t\t$_SESSION[self::SESSION_KEY_IDS] = array_unique($ids);\n\t}", "function checkIDList($table, $fixedQuery, &$IDList)\n{\n\tglobal $sitePosition;\n\n\t$IDs = array();\n\t$rs = query('Select `ID` from `' . $sitePosition . '.' . $table . '` where ' . ($fixedQuery != '' ? ('(' . $fixedQuery . ') and ') : '') . '`ID` in (' . $IDList . ')', false);\n\twhile(true)\n\t{\n\t\t$rsInfo = fetchRow($rs);\n\t\tif($rsInfo === null) break;\n\t\t$IDs[] = $rsInfo[0];\n\t}\n\tfreeResult($rs);\n\t$IDList = implode(',', $IDs);\n}", "public function add_ids(&$log) {\n\tforeach ($this->elements as $name=>$element) {\n\t\t$this->stmt->bindvalue(':'.$name.'_id',$log[$element[1]],db_connect::PARAM_INT);\n\t\t$log[$element[1]] = \"\"; //clear the element_id field\n\t}\n\t$this->stmt->execute();\n\twhile ($row = $this->stmt->fetchObject()) {\n\t\tswitch ($row->table_name) {\n\t\tcase \"a12\":\n\t\t\t$log[$this->elements[\"task\"][1]] .= \" \".$row->value_id;\n\t\t\tbreak;\n\t\tcase \"a14\":\n\t\t\t$log[$this->elements[\"subtask\"][1]] .= \" \".$row->value_id;\n\t\t\tbreak;\n\t\tcase \"a21\":\n\t\t\t$log[$this->elements[\"account\"][1]] .= \" \".$row->value_id;\n\t\t\tbreak;\n\t\tcase \"a30\":\n\t\t\t$log[$this->elements[\"event\"][1]] .= \" \".$row->value_id;\n\t\t\tbreak;\n\t\t}\n\t\tforeach ($this->records as $key=>$value) {\n\t\t\tif ($value[\"value_id\"] == $row->value_id) {\n\t\t\t\t$this->records[$key][\"name_id\"] = 0; //this value appears here\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\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}", "public function hasIds() {\n return $this->_has(1);\n }", "public static function ensureUniqueIds(array $lineItems)\n {\n $uniqueIds = array();\n foreach ($lineItems as $lineItem) {\n $uniqueId = $lineItem->getUniqueId();\n if (empty($uniqueId)) {\n $uniqueId = preg_replace(\"/[^a-z0-9]/\", '', Tools::strtolower($lineItem->getSku()));\n }\n if (empty($uniqueId)) {\n throw new Exception(\"There is an invoice item without unique id.\");\n }\n if (isset($uniqueIds[$uniqueId])) {\n $backup = $uniqueId;\n $uniqueId = $uniqueId . '_' . $uniqueIds[$uniqueId];\n $uniqueIds[$backup] ++;\n } else {\n $uniqueIds[$uniqueId] = 1;\n }\n $lineItem->setUniqueId($uniqueId);\n }\n return $lineItems;\n }", "public function saveAllIds($Model, &$data) {\n\t\t$ids = array();\n\t\tforeach ($data as $i => $row) {\n\t\t\t$Model->create();\n\t\t\tif ($Model->save($row)) {\n\t\t\t\t$ids[] = $data[$i]['id'] = $Model->id;\n\t\t\t} else {\n\t\t\t\tunset($data[$i]);\n\t\t\t}\n\t\t}\n\t\treturn $ids;\n\t}", "public function markAllAsSeen()\n {\n SystemLog::unseen()->update(['seen_at' => now()]);\n }", "function IncrementQuestionFlagCounts($questionIDs)\n {\n try\n {\n if (count($questionIDs) < 1)\n {\n return;\n }\n \n $db = GetDBConnection();\n \n $query = 'UPDATE ' . GetQuestionsIdentifier() . ' SET'\n . ' ' . 'Flagged'\n . ' = '. 'Flagged' . ' + 1' . ' WHERE'\n . ' ' . GetQuestionIdIdentifier()\n . ' = :' . GetQuestionIdIdentifier() . '0';\n \n for($count = 1; $count < count($questionIDs); $count++)\n {\n $query .= ' OR ' . GetQuestionIdIdentifier() . ' = :' . GetQuestionIdIdentifier() . $count;\n }\n \n $query .= ';';\n \n $statement = $db->prepare($query);\n \n for($count = 0; $count < count($questionIDs); $count++)\n {\n $questionID = $questionIDs[$count];\n $statement->bindValue(':' . GetQuestionIdIdentifier() . $count, $questionID);\n }\n \n $statement->execute();\n \n $statement->closeCursor();\n }\n catch (PDOException $ex)\n {\n LogError($ex);\n }\n }", "public function setIDs( array $ids ): self\n {\n $this -> ids = $ids;\n return $this;\n }", "public function testCompareOnlySelectedIndexesFromDupeCheck()\n {\n //create a bean, values, populate and save\n $focus = loadBean('Contacts');\n $focus->first_name = 'first '.date(\"YmdHis\");\n $focus->last_name = 'last '.date(\"YmdHis\");\n $focus->assigned_user_id = '1';\n $focus->save();\n\n\n //create the importDuplicateCheck object and get the list of duplicateCheckIndexes\n $idc = new ImportDuplicateCheck($focus);\n\n //we are going to test agains the first name, last name, full name, and assigned to indexes\n //to prove that only selected indexes are being used.\n\n //lets do a straight dupe check with the same bean on first name, should return true\n $this->assertTrue($idc->isADuplicateRecord(array('idx_cont_last_first::first_name')),'simulated check against first name index (idx_cont_last_first::first_name) failed (returned false instead of true).');\n\n //now lets test on full name index should also return true\n $this->assertTrue($idc->isADuplicateRecord(array('full_name::full_name')),'first simulated check against full name index (full_name::full_name) failed (returned false instead of true). This check means BOTH first AND last name must match.');\n\n //now lets remove the first name and redo the check, should return false\n $focus->first_name = '';\n $idc = new ImportDuplicateCheck($focus);\n $this->assertFalse($idc->isADuplicateRecord(array('idx_cont_last_first::first_name')),'simulated check against first name index (idx_cont_last_first::first_name) failed (returned true instead of false). This is wrong because we removed the first name so there should be no match.');\n\n //lets retest on full name index should return false now as first AND last do not match the original\n $this->assertFalse($idc->isADuplicateRecord(array('full_name::full_name')),'second simulated check against full name index (full_name::full_name) failed (returned true instead of false). This check means BOTH first AND last name must match and is wrong because we removed the first name so there should be no match.');\n\n //now lets rename the contact and test on assigned user, should return true\n $focus->first_name = 'first '.date(\"YmdHis\");\n $focus->last_name = 'last '.date(\"YmdHis\");\n $idc = new ImportDuplicateCheck($focus);\n $this->assertTrue($idc->isADuplicateRecord(array('idx_del_id_user::assigned_user_id')),'simulated check against assigned user index (idx_del_id_user::assigned_user_id) failed (returned false instead of true). This is wrong because we have not changed this field and it should remain a duplicate');\n\n //we're done, lets delete the focus bean now\n $focus->mark_deleted($focus->id);\n\n }", "function seminars_delete_multiple($sids, $delete_categories = FALSE, $delete_masters = FALSE) {\n\n foreach($sids as $sid)\n seminars_delete($sid, $delete_categories, $delete_masters);\n \n}", "public function resetRequestIds()\n {\n foreach ($this->options as $op => $junk) {\n if (preg_match('#ReportRequestIdList#', $op)) {\n unset($this->options[$op]);\n }\n }\n }", "public function isIdSet()\n\t{\n\t\tif (!empty($this->_id) && ($this->_id != -1)) {\n\n\t\t\t\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public function on_duplicate_key_update($on_dup_update){\n\t\tif(is_array($on_dup_update)&&count($on_dup_update)>0){\n\t\t\t$this->dodb['on_dup_update'] = $on_dup_update;\n\t\t}\n\t\treturn $this;\n\t}", "public function testResolveContentToUpdateCollectionItemsWithoutDuplicatesFromCache(): void\n {\n /** @var \\PostmanGenerator\\CollectionGenerator $generator1 */\n [$generator1] = $this->getRestaurantCollection();\n $generator1->generate();\n\n /** @var \\PostmanGenerator\\CollectionGenerator $generator2 */\n [$generator2] = $this->getRestaurantCollection();\n $generator2->add('Restaurant');\n $generator2->add('Restaurant');\n $generator2->add('Managers');\n $generator2->generate();\n\n $items = $generator2->getCollection()->getItem();\n\n self::assertCount(2, $items);\n self::assertEquals('Restaurant', $items[0]->toArray()['name']);\n self::assertEquals('Managers', $items[1]->toArray()['name']);\n\n $generator2->generate();\n }", "function groups_collections_update($item, $selected_groups, $existing_groups, $relationship) {\n\t$add_groups = array_diff($selected_groups , $existing_groups);\n\t$rem_groups = array_diff($existing_groups, $selected_groups);\n\t\n\t$add_groups = array_unique($add_groups);\n\t$add_groups = array_values($add_groups);\n\t$rem_groups = array_unique($rem_groups);\n\t$rem_groups = array_values($rem_groups);\n\t$guid_two = $item->getguid();\n\t\n\tforeach($add_groups as $group){\n\t\t$guid_one = $group;\n\t\tif(!check_entity_relationship($guid_one, $relationship, $guid_two)){\n\t\t\tadd_entity_relationship($guid_one, $relationship, $guid_two);\n\t\t}\t\t\n\t}\n\tforeach($rem_groups as $group){\n\t\t$guid_one = $group;\n\t\tremove_entity_relationship($guid_one, $relationship, $guid_two);\n\t}\n}", "public function updateSortId(Request $request)\n {\n $data = $request->all();\n\n $sortIds = [];\n if($data['old_sort_id'] > $data['new_sort_id']) {\n for ($i = $data['new_sort_id']; $i <= $data['old_sort_id']; $i++) {\n array_push($sortIds, $i);\n }\n } else {\n for ($i = $data['old_sort_id']; $i <= $data['new_sort_id']; $i++) {\n array_push($sortIds, $i);\n }\n }\n\n $colors = Color::whereIn('sort_id', $sortIds)->get();\n foreach ($colors as $color) {\n if ($color->sort_id == $data['old_sort_id']) {\n $color->update(['sort_id' => $data['new_sort_id']]);\n } else {\n $data['old_sort_id'] > $data['new_sort_id'] ? $color->update(['sort_id' => $color->sort_id + 1]) : $color->update(['sort_id' => $color->sort_id - 1]);\n }\n }\n return response()->json('Colors sort ID successfully updated.');\n }", "public static function injectIds( &$data, array &$idMap ) {\n\t\tif ( is_array( $data ) ) {\n\t\t\tforeach ( $data as $key => &$value ) {\n\t\t\t\tself::injectIds( $value, $idMap );\n\n\t\t\t\t$newKey = $key;\n\t\t\t\tself::injectIds( $newKey, $idMap );\n\n\t\t\t\tif ( $newKey !== $key ) {\n\t\t\t\t\t$data[$newKey] = $value;\n\t\t\t\t\tunset( $data[$key] );\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ( is_string( $data ) ) {\n\t\t\t$data = str_replace( array_keys( $idMap ), array_values( $idMap ), $data );\n\t\t}\n\t}", "public function setNotPublic($list_id, $value = TRUE) {\n DB::q('\nINSERT INTO !table\n(list_id, not_public)\nVALUES (%list_id, %not_public)\nON DUPLICATE KEY UPDATE\nnot_public = %not_public\n ', array(\n '!table' => $this->table,\n '%not_public' => $value,\n '%list_id' => $list_id,\n ));\n\n return TRUE;\n }", "function checkDuplicates($array)\n{\n return count($array) !== count(array_unique($array));\n}", "public function updateItemHashes()\n {\n foreach ($this->getItems() as $itemHash => $item) {\n $this->updateItemHash($itemHash);\n }\n }", "public function setUnique($value = TRUE);", "function update_refurls()\n{\n\tglobal $database;\n\n\t// IF URL IS NOT EMPTY\n\t$referring_url = $_SERVER[\"HTTP_REFERER\"];\n\tif(strpos(strtolower($referring_url), strtolower($_SERVER[\"HTTP_HOST\"])) !== FALSE) { return; }\n\n\tif( $referring_url )\n {\n\t // IS URL ALREADY IN DATABASE? IF YES, ADD TO HITS. IF NO, ADD NEW ROW\n\t $referring_url = str_replace(\"http://www.\", \"http://\", $referring_url);\n\t $database->database_query(\"\n INSERT INTO se_statrefs\n (statref_hits, statref_url)\n VALUES\n ('1', '{$referring_url}')\n\t\t\tON DUPLICATE KEY UPDATE\n statref_hits=statref_hits+1\n \");\n \n\t // IF 1000 ROWS REACHED, DELETE ONE TO MAKE ROOM\n\t $refurl_totalrows = $database->database_num_rows($database->database_query(\"SELECT statref_id FROM se_statrefs\"));\n \n\t if( $refurl_totalrows > 1000 )\n $database->database_query(\"DELETE FROM se_statrefs WHERE statref_hits='1' ORDER BY statref_id ASC LIMIT 1\");\n\t}\n}", "function batchAssoc($model_name, $ids)\n {\n $currents = $this->getRelated($model_name);\n foreach ($currents as $cur) {\n $this->delAssoc($cur);\n }\n foreach ($ids as $id) {\n $m = new $model_name($id);\n if ($m->id == $id) {\n $this->setAssoc($m);\n }\n }\n return true;\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 }", "public function entry_order_update()\n {\n $ids = explode(',', $this->input->post('order'));\n\n // Set the count by the offset for\n // paginated lists\n $order_count = $this->input->post('offset')+1;\n\n foreach ($ids as $id)\n {\n $this->db\n ->where('choice_id', $id)\n ->update('choices', array('ordering_count' => $order_count));\n\n ++$order_count;\n }\n }", "protected static function addElementIds(DOMDocument $ir)\n\t{\n\t\t$id = 0;\n\t\tforeach ($ir->getElementsByTagName('element') as $element)\n\t\t{\n\t\t\t$element->setAttribute('id', ++$id);\n\t\t}\n\t}", "function updateAHSIDs(){\n //scrape alpha pages and load into db\n foreach ($this->alpha as $key => $letter) {\n $this->scrapeAlphaPage($letter);\n }\n }", "function collections_update($item, $selected, $existing, $relationship) {\n$display .= 'collections_update ...<br>';\t\n\t$add = array_diff($selected, $existing);\n\t$rem = array_diff($existing, $selected);\n$display .= '$relationship: '.$relationship.'<br>';\n\t\n\t$add = array_unique($add);\n\t$add = array_values($add);\n\t$rem = array_unique($rem);\n\t$rem = array_values($rem);\n\t$guid_two = $item->getguid();\n\t\n\tforeach($add as $i){\n\t\t$guid_one = $i;\n\t\tif(!check_entity_relationship($guid_one, $relationship, $guid_two)){\n\t\t\tadd_entity_relationship($guid_one, $relationship, $guid_two);\n\t\t}\t\t\n\t}\n\tforeach($rem as $i){\n\t\t$guid_one = $i;\n\t\tremove_entity_relationship($guid_one, $relationship, $guid_two);\n\t}\n}", "public function groupIds();", "private function setUsers($ids,$log=false){\n \t$userPermission = $this->getUserPermission();\n \tforeach ($ids as $id)\n \t\tNewDao::getInstance()->insert('user_permissions',array('user_id'=>$id,'permission_id'=>$userPermission),$log);\n }", "public function setDeviceIds(?array $value): void {\n $this->getBackingStore()->set('deviceIds', $value);\n }", "function delete_list($ids)\n\t{\n\t\t$this->db->where_in('skill_id',$ids);\n\t\treturn $this->db->update('skill', array('is_status' => 1));\n\t}", "public function setSharepointIds($val)\n {\n $this->_propDict[\"sharepointIds\"] = $val;\n return $this;\n }", "function resetIDs(){\n resetId(\"data\");\n resetId(\"place\");\n}", "function deleteIds ($ids) {\r\n $this->delete($this->tableName, $this->_id . ' in (' . implode(',', $ids) . ')');\r\n }", "public function setRequestIds($s)\n {\n if (is_string($s)) {\n $this->resetRequestIds();\n $this->options['ReportRequestIdList.Id.1'] = $s;\n } else {\n if (is_array($s)) {\n $this->resetRequestIds();\n $i = 1;\n foreach ($s as $x) {\n $this->options['ReportRequestIdList.Id.'.$i] = $x;\n $i++;\n }\n } else {\n return false;\n }\n }\n }", "private function addIds(array $ids, array $newIds)\n {\n if (! empty($newIds)) {\n return array_merge($ids, $newIds);\n }\n }", "public function markSentItems(array $quotes) {\n $now = date('Y-m-d H:i:s');\n $abcartsTable = Intelivemetrics_Unityreports_Model_Utils::getTableName('unityreports/abcarts');\n try {\n foreach ($quotes as $quote) {\n $query = \"INSERT INTO $abcartsTable (entity_id,sents,last_sent_at) VALUES ({$quote['id']},1,'{$now}')\n ON DUPLICATE KEY UPDATE sents = sents+1,last_sent_at='{$now}';\";\n $this->_getDb()->query($query);\n }\n } catch (Exception $ex) {\n Mage::helper('unityreports')->debug($ex->getMessage());\n }\n }", "public static function setNewOrder($ids)\n {\n if (! is_array($ids))\n {\n throw new SortableException('You must pass an array to setNewOrder');\n }\n\n $newOrder = 1;\n foreach($ids as $id)\n {\n $model = self::find($id);\n $model->setOrder($newOrder++);\n $model->save();\n }\n }", "function duplication2(Array $array) {\n if (empty($array)) {\n return FALSE;\n }\n foreach ($array as $key => $val) {\n if ($key != $val) {\n // not in 0 ~ n-1\n if (!isset($array[ $val ])) {\n return FALSE;\n }\n if ($val == $array[ $val ]) {\n return $val;\n } else {\n $tmp = $array[ $val ];\n $array[ $val ] = $val;\n $array[ $key ] = $tmp;\n }\n }\n }\n\n return 'no duplicate numbers.';\n}", "public function updateBatch(array $attributes, $id);", "function intersperse($songs, $ids, $frequency = 5) \n{\n $result = array();\n $added = 0;\n $id_count=count($ids)-1;\n\n\n\n // Handle the 0 frequency case\n if ($frequency==0)\n {\n // Return only the songs\n return $songs;\n }\n\n // Handle the single ID case\n if ($frequency==1)\n {\n $result=$songs;\n // Prepend a single ID to the front of the array\n array_unshift($result,$ids[0]);\n echo \"intersperse() Added an ID\\n\";\n return $result;\n }\n\n $frequency++; // Fence post error correction\n\n echo \"intersperse() \".count($songs).\" songs and \".count($ids).\" IDs\\n\";\n\n\n for($i = 0; $i < (count($songs)+$added); $i++)\n {\n //echo \"intersperse() Count of songs+added is now \".count($songs)+$added.\"\\n\";\n //echo \"$i,$added\\n\";\n\n if($i%$frequency == 0) // If it's a slot for ID\n { \n //$result[$i] = $ids[rand(0,count($ids)-1)]; \n //Treat the ID array as fixed. Previously randomized, and no repeating allowed.\n if ($id_count>=0) // If there are IDs left\n {\n $result[$i] = $ids[$id_count--];\n $added++;\n echo \"intersperse() Added an ID\\n\";\n }\n\n else \n {\n $result[$i] = $songs[$i-$added];\n echo \"intersperse() Added song because we are finished with IDs\";\n echo $i-$added;\n echo \"\\n\";\n }\n\n\n }\n\n else \n {\n $result[$i] = $songs[$i-$added];\n echo \"intersperse() Added song \";\n echo $i-$added;\n echo \"\\n\";\n }\n }\n\n return $result;\n}", "function agm_array_multi_unique ($array) {\r\n\tif (!is_array($array)) return $array;\r\n\t$ret = array();\r\n\t$hashes = array();\r\n\r\n\tforeach ($array as $k=>$v) {\r\n\t\t$hash = md5(serialize($v));\r\n\t\tif (isset($hashes[$hash])) continue;\r\n\t\t$hashes[$hash] = $hash;\r\n\t\t$ret[] = $v;\r\n\t}\r\n\r\n\treturn $ret;\r\n}", "public function update($models)\n {\n $index = new Index($this->RedisClientInterface, $models->first()->searchableAs());\n\n $models\n ->map(function ($model) {\n $array = $model->toSearchableArray();\n if (empty($array)) {\n return;\n }\n return array_merge(['id' => $model->getKey()], $array);\n })\n ->filter()\n ->values()\n ->each(function ($item) use ($index) {\n $index->add($item);\n });\n }", "public function updateStateByIds() {\n $attributes = array(\n 'state' => 8\n );\n $ids = $this->params(\"ids\");\n $stateText = $this->params(\"stateText\");\n $count = $this->collection->getById($ids)->update($attributes);\n return $attributes;\n }", "private function process_sitelist_addsc(&$site_ids, $sc_id)\n {\n $model = new Site();\n $sites = $model->get(array(\"sc_id\"=>$sc_id));\n foreach($sites as $site) {\n if(!in_array($site->id, $site_ids)) {\n $site_ids[] = $site->id;\n }\n }\n }" ]
[ "0.6089941", "0.5669913", "0.56429535", "0.5314409", "0.5308217", "0.5283567", "0.5275853", "0.5171307", "0.51356965", "0.5090612", "0.50717807", "0.50022185", "0.4994174", "0.4986897", "0.49809968", "0.4975844", "0.49294817", "0.49021614", "0.4878782", "0.4864983", "0.4864631", "0.48394805", "0.48264235", "0.48259518", "0.48218635", "0.4816486", "0.48007283", "0.4791288", "0.47780636", "0.47780636", "0.4764127", "0.47511762", "0.474634", "0.4725021", "0.47235867", "0.47231638", "0.47163585", "0.47155315", "0.47139886", "0.47097236", "0.47083187", "0.47021928", "0.46964934", "0.46811682", "0.46798414", "0.4677913", "0.46773973", "0.46694797", "0.46674043", "0.46632662", "0.46569443", "0.46560404", "0.46540916", "0.46482435", "0.46440652", "0.46398842", "0.46361333", "0.46316183", "0.46250632", "0.46233645", "0.46185791", "0.4598816", "0.45966995", "0.45936364", "0.45928678", "0.45911336", "0.45902672", "0.45849213", "0.45828405", "0.45765355", "0.45728916", "0.45657462", "0.45607942", "0.4558406", "0.45570946", "0.45505065", "0.4536762", "0.4535446", "0.45316058", "0.45303735", "0.45296705", "0.45263788", "0.45160797", "0.45154247", "0.4514634", "0.45139423", "0.45123804", "0.45116296", "0.4508509", "0.45069927", "0.44997248", "0.4497756", "0.44926012", "0.44913727", "0.44847476", "0.44833463", "0.44828075", "0.44816875", "0.44790372", "0.4474909", "0.44715613" ]
0.0
-1
Based on a single contract row, check for duplicates in the rest of the database:
public static function findDuplicateEntries($rowData) { // For all modes, limit to the same department owner_acronym $totalDuplicates = 0; // mode 1: same contract_value, same gen_vendor_normalized, same raw_contract_date $duplicateRows = DB::table('l_contracts') ->where('owner_acronym', '=', $rowData['owner_acronym']) ->where('gen_is_duplicate', '=', 0) ->where('gen_is_error', '=', 0) ->where('contract_value', '=', $rowData['contract_value']) ->where('gen_vendor_normalized', '=', $rowData['gen_vendor_normalized']) ->where('raw_contract_date', '=', $rowData['raw_contract_date']) ->whereNotNull('source_fiscal') ->orderBy('source_fiscal', 'asc') ->orderBy('id', 'asc') ->pluck('id'); if ($duplicateRows->count() > 1) { // Then, there's duplicates based on this method. $totalDuplicates += self::markDuplicateEntries($rowData['owner_acronym'], $duplicateRows, 1); } // mode 2: same contract_value, same gen_vendor_normalized, same reference_number, same gen_start_year // (in case the raw contract dates are formatted inconsistently or missing) $duplicateRows = DB::table('l_contracts') ->where('owner_acronym', '=', $rowData['owner_acronym']) ->where('gen_is_duplicate', '=', 0) ->where('gen_is_error', '=', 0) ->where('contract_value', '=', $rowData['contract_value']) ->where('gen_vendor_normalized', '=', $rowData['gen_vendor_normalized']) ->where('reference_number', '=', $rowData['reference_number']) ->where('gen_start_year', '=', $rowData['gen_start_year']) ->whereNotNull('source_fiscal') ->orderBy('source_fiscal', 'asc') ->orderBy('id', 'asc') ->pluck('id'); if ($duplicateRows->count() > 1) { // Then, there's duplicates based on this method. $totalDuplicates += self::markDuplicateEntries($rowData['owner_acronym'], $duplicateRows, 2); } // mode 3: same gen_vendor_normalized and same reference_number // (in case both the raw contract dates and the vendor names are input inconsistently) $duplicateRows = DB::table('l_contracts') ->where('owner_acronym', '=', $rowData['owner_acronym']) ->where('gen_is_duplicate', '=', 0) ->where('gen_is_error', '=', 0) ->where('contract_value', '=', $rowData['contract_value']) ->where('reference_number', '=', $rowData['reference_number']) ->whereNotNull('source_fiscal') ->orderBy('source_fiscal', 'asc') ->orderBy('id', 'asc') ->pluck('id'); if ($duplicateRows->count() > 1) { // Then, there's duplicates based on this method. $totalDuplicates += self::markDuplicateEntries($rowData['owner_acronym'], $duplicateRows, 3); } return $totalDuplicates; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkForDuplicateCongress($footprintData, $connection, $currentCongressID = 0)\n{\n $result = 0;\n $congresses = getAllCongresses($connection);\n foreach ($congresses as $congress)\n {\n if ($congress['name'] == $footprintData['name'] ||\n $congress['shortName'] == $footprintData['shortName'])\n {\n if ($currentCongressID <= 0 || $currentCongressID != $congress['id'])\n {\n if (!$result)\n {\n $result = array();\n $result['errors'] = array();\n }\n if ($congress['name'] == $footprintData['name'])\n {\n $error = array(\n \"code\" => 20,\n \"data\" => $congress['name']\n );\n array_push($result['errors'], $error);\n }\n if ($congress['shortName'] == $footprintData['shortName'])\n {\n $error = array(\n \"code\" => 21,\n \"data\" => $congress['shortName']\n );\n array_push($result['errors'], $error);\n }\n }\n }\n }\n return $result;\n}", "function checkForDuplicateUnique(){\n $_ufields_arr = explode(\",\", $this->listSettings->GetItem(\"MAIN\", \"UNIQUE_FIELDS\"));\n $check_fields = true;\n for ($i = 0; $i < sizeof($_ufields_arr); $i ++) {\n list ($_field[$i], $_value[$i]) = explode(\"=\", $_ufields_arr[$i]);\n if (strlen($_value[$i])) {\n $check_fields = false;\n $_query_arr[$_field[$i]] = $_value[$i];\n if ($this->_data[$_field[$i]] == $_value[$i]) {\n $check_fields = true;\n }\n }\n else {\n $_query_arr[$_field[$i]] = $this->_data[$_field[$i]];\n }\n }\n if ($check_fields) {\n $_data = $this->Storage->GetByFields($_query_arr, null);\n }\n else {\n $_data = array();\n }\n if (! empty($_data)) {\n if (($this->item_id != $_data[$this->key_field])) {\n if ($this->Kernel->Errors->HasItem($this->library_ID, \"RECORD_EXISTS\")) {\n $_error_section = $this->library_ID;\n }\n else {\n $_error_section = \"GlobalErrors\";\n }\n $this->validator->SetCustomError($_ufields_arr, \"RECORD_EXISTS\", $_error_section);\n }\n }\n }", "public function check_duplicate() {\n $this->db->where ( 'orderID', trim ( $this->input->post ( 'orderID' ) ) );\n\n if ($this->db->count_all_results ( $this->table ))\n echo \"1\"; // duplicate\n else\n echo \"0\";\n }", "function validate_row($srcrow, $table) {\n\n foreach ($table as $dstrow) {\n if ($srcrow['cbsId'] == $dstrow['cbsId']) {\n // print(\"Match found for \" . $srcrow['cbsId'] . \"\\n\");\n return true;\n }\n }\n print(\"No Match found for \" . $srcrow['cbsId'] . \" \" . $srcrow['cbsName'] . \" \\n\");\n return false;\n}", "private function is_duplicate () {\n $email = $this->payload['email'];\n $facebook_id = '0';\n if (!empty($this->payload['facebook_id'])) {\n $facebook_id = $this->payload['facebook_id'];\n }\n $sql = \"SELECT id FROM users WHERE email='$email' OR facebook_id='$facebook_id'\";\n $sql = $this->conn->query($sql);\n\n return $sql->num_rows > 0;\n }", "public function check_duplicate()\n {\n }", "public function check_duplicate()\n {\n // set table\n $this->record->table = $this->table;\n // set where\n $this->record->where['classification'] = trim($this->input->post('classification'));\n // execute retrieve\n $this->record->retrieve();\n \n if (!empty($this->record->field))\n echo \"1\"; // duplicate\n else \n echo \"0\";\n }", "public function checkExistContract($nr_contract){\n $sql = \"SELECT nr_contract from contract WHERE nr_contract = :nr_contract\";\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->bindValue(':nr_contract', $nr_contract);\n $stmt->execute();\n if ($stmt->rowCount()> 0) {\n return true;\n }else{\n return false;\n }\n }", "function check_duplicate_station_ID($station_ID)\n\t{\n\t\t\n\t\t/*$storage = new SplObjectStorage;\n$foo = (object)['foo' => 'bar'];\n$storage->attach($foo, ['room' => 'bar']);\n\nforeach ($storage as $value) {\n $obj = $storage->current(); // current object\n $assoc_key = $storage->getInfo(); // return, if exists, associated with cur. obj. data; else NULL\n\n var_dump($obj);\n var_dump($assoc_key);*/\n\t\tforeach($this->clients as $value){\n\t\t\t\n\t\t\t$connection = $this->clients->current();\n\t\t\tif(isset($connection->station_ID)){\n\t\t\t\techo \"station_id = \".$connection->station_ID.\"\\n\";\n\t\t\t\t//var_dump($this->clients->current());\n\t\t\t\tif($connection->station_ID == $station_ID){\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 chkDuplicate($fileds,$data){\r\n $filedsArr = @explode(',',$fileds);\r\n for($i=0;$i<count($filedsArr);$i++){\r\n $where.= \" AND \".$filedsArr[$i].\" = '\".$data[$filedsArr[$i]].\"'\";\r\n }\r\n $sql = \"SELECT iInvoiceID as ID FROM \".PRJ_DB_PREFIX.\"_inovice_order_heading WHERE 1 $where\";\r\n\t\t$row = $this->_obj->MySqlSelect($sql);\r\n //Prints($row);exit;\r\n if(count($row) > 0){\r\n $dup = $row[0][ID];\r\n }else{\r\n $dup = 0;\r\n }\r\n return $dup;\r\n }", "function checkUnique( $vals ) {\n $c = new Criteria();\n \n foreach ($vals as $key =>$value) {\n $name = \"CreditPeer::\".strtoupper($key);\n eval(\"\\$c->add(\".$name.\",\\$value);\");\n }\n \n $c->setDistinct();\n $Credit = CreditPeer::doSelect($c);\n \n if (count($Credit) >= 1) {\n $this ->Credit = $Credit[0];\n return true;\n } else {\n $this ->Credit = new Credit();\n return false;\n }\n }", "protected function _checkForDupe()\n\t{\n\t\t$this->_oldPre = $this->_pdo->queryOneRow(sprintf('SELECT category, size FROM predb WHERE title = %s', $this->_pdo->escapeString($this->_curPre['title'])));\n\t\tif ($this->_oldPre === false) {\n\t\t\t$this->_insertNewPre();\n\t\t} else {\n\t\t\t$this->_updatePre();\n\t\t}\n\t\t$this->_resetPreVariables();\n\t}", "function createContract( $contract=null ){\n global $mysqli;\n if(!isset($contract) || $contract=='')\n return;\n $contract = $mysqli->real_escape_string($contract);\n $results = $mysqli->query(\"SELECT id FROM index_contracts WHERE contract='{$contract}' LIMIT 1\");\n if($results){\n if($results->num_rows){\n $row = $results->fetch_assoc();\n return $row['id'];\n } else {\n $results = $mysqli->query(\"INSERT INTO index_contracts (contract) values ('{$contract}')\");\n if($results){\n return $mysqli->insert_id;\n } else {\n byeLog('Error while trying to create record in index_contracts table');\n }\n }\n } else {\n byeLog('Error while trying to lookup record in index_contracts table');\n }\n}", "public function testCompareOnlySelectedIndexesFromDupeCheck()\n {\n //create a bean, values, populate and save\n $focus = loadBean('Contacts');\n $focus->first_name = 'first '.date(\"YmdHis\");\n $focus->last_name = 'last '.date(\"YmdHis\");\n $focus->assigned_user_id = '1';\n $focus->save();\n\n\n //create the importDuplicateCheck object and get the list of duplicateCheckIndexes\n $idc = new ImportDuplicateCheck($focus);\n\n //we are going to test agains the first name, last name, full name, and assigned to indexes\n //to prove that only selected indexes are being used.\n\n //lets do a straight dupe check with the same bean on first name, should return true\n $this->assertTrue($idc->isADuplicateRecord(array('idx_cont_last_first::first_name')),'simulated check against first name index (idx_cont_last_first::first_name) failed (returned false instead of true).');\n\n //now lets test on full name index should also return true\n $this->assertTrue($idc->isADuplicateRecord(array('full_name::full_name')),'first simulated check against full name index (full_name::full_name) failed (returned false instead of true). This check means BOTH first AND last name must match.');\n\n //now lets remove the first name and redo the check, should return false\n $focus->first_name = '';\n $idc = new ImportDuplicateCheck($focus);\n $this->assertFalse($idc->isADuplicateRecord(array('idx_cont_last_first::first_name')),'simulated check against first name index (idx_cont_last_first::first_name) failed (returned true instead of false). This is wrong because we removed the first name so there should be no match.');\n\n //lets retest on full name index should return false now as first AND last do not match the original\n $this->assertFalse($idc->isADuplicateRecord(array('full_name::full_name')),'second simulated check against full name index (full_name::full_name) failed (returned true instead of false). This check means BOTH first AND last name must match and is wrong because we removed the first name so there should be no match.');\n\n //now lets rename the contact and test on assigned user, should return true\n $focus->first_name = 'first '.date(\"YmdHis\");\n $focus->last_name = 'last '.date(\"YmdHis\");\n $idc = new ImportDuplicateCheck($focus);\n $this->assertTrue($idc->isADuplicateRecord(array('idx_del_id_user::assigned_user_id')),'simulated check against assigned user index (idx_del_id_user::assigned_user_id) failed (returned false instead of true). This is wrong because we have not changed this field and it should remain a duplicate');\n\n //we're done, lets delete the focus bean now\n $focus->mark_deleted($focus->id);\n\n }", "public function checkDuplicates(){\n\t\t$db = new database();\n\t\t$gebruiker = $db->select(\"*\", \"klant\", 1, ['this'=>\"gebruikersnaam\", \"that\"=>$this->gebruikersnaam]);\n\t\t//var_dump($gebruiker);\n\t\tif(!empty($gebruiker[0])){\n\t\t\treturn true;\n\t\t}\n\n\t}", "private function checkIsExists(): bool\n {\n $where = [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.campaign' => $this->campaign,\n ];\n\n if (!is_null($this->id)) {\n $where[$this->table. '.id !='] = $this->id;\n }\n\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => $where\n ]);\n\n return !is_null($id);\n }", "protected function transactionIDExists(&$record) {\n \n $trxn_id = $record['transmission_number'] . '-' . $record['transaction_number'];\n\n $dao = CRM_Core_DAO::executeQuery(\n \"SELECT id, contact_id FROM civicrm_contribution WHERE trxn_id = %1\",\n array(\n 1 => array($trxn_id, 'String')\n )\n );\n\n if ($dao->fetch()) {\n $message = ts(\n \"Duplicate transaction number (%1) - already exists for contribution id %2 (%3) - KID number '%4' at line %5. %6\",\n array(\n 1 => $record['transaction_number'],\n 2 => $dao->id,\n 3 => $this->getDisplayName($dao->contact_id),\n 4 => $record['kid'],\n 5 => $record['line_no'],\n 6 => $this->test ? ts('Record will not be imported.') : ts('Record was not imported.')\n )\n );\n $this->addReportLine('warning', $message);\n if (!$this->test)\n $this->createFailureTableEntry($record, $message);\n return true;\n }\n \n return false; \n \n }", "function hasDuplicate($g,$r,$p){\n\t//create query\n\t$query = \"SELECT `b_id` FROM `bet` WHERE `g_id`=$g AND `b_round`=$r AND `p_id`=$p\";\n\t$result = @mysql_query($query);\n\tif(mysql_error()) handleError(\"query 0\");\n\t\n\tif(mysql_num_rows($result) > 0){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "public function errorDuplicateEntry()\n {\n return $this->errno == 1062;\n }", "public function uniqueCombi() {\n\t\t\n\t\tif (isset($this->data[$this->alias]['cart_id'])) {\n\t\t\t\n\t\t\t$combi = array(\n\t\t\t\t\"{$this->alias}.cart_id\" => $this->data[$this->alias]['cart_id'],\n\t\t\t\t\"{$this->alias}.variant_id\" => $this->data[$this->alias]['variant_id']\n\t\t\t);\n\t\t\t\n\t\t\treturn $this->isUnique($combi, false);\t\t\t\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "function duplicatePlace($state,$country){\n global $db;\n\n $placeQuery = \"SELECT * FROM place where statename='{$state}' && countryname='{$country}'\";\n $placeResult = $db->query($placeQuery)->fetchAll(PDO::FETCH_ASSOC);\n\n return count($placeResult);\n}", "function checkDuplicates($pdo, $sql, $field)\n {\n $stmt = $pdo->prepare($sql);\n $stmt->bindValue(1, $field);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n return $row;\n }", "function are_there_duplicates_in_db() {\n $result = $this->pdo->query('SELECT filename,md5_sign,count(*) FROM files\n GROUP BY filename, md5_sign\n HAVING COUNT(*) > 1');\n $results = count($result->fetchAll());\n\n if( $results ) {\n return true;\n } else {\n return false;\n }\n }", "function checkForDuplicateCity($name,$id=false)\r\n {\r\n try\r\n {\r\n $sql=\"SELECT city_id \r\n\t\t\t FROM \r\n\t\t\t edms_city \r\n\t\t\t WHERE city_name='$name'\";\r\n \r\n if($id==false)$sql=$sql.\"\";\r\n else $sql=$sql.\" AND city_id!=$id\";\r\n $result=dbQuery($sql);\r\n \r\n if(dbNumRows($result)>0)\r\n {\r\n $resultArray=dbResultToArray($result);\r\n return $resultArray[0][0];\r\n //duplicate found\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n\r\n }\r\n\r\n catch(Exception $e)\r\n {\r\n }\r\n\r\n }", "public function isUserDuplicate(){\n\n\t\t$today = Carbon::today();\n\n\t\t$user = User::on('bk')\n\t\t\t\t\t->where('created_at', '>=', $today)\n\t\t\t\t\t->select('id')\n\t\t\t\t\t->get();\n\n\t\t$str1 = '( ';\n\t\t$str2 = '( ';\n\t\tforeach ($user as $key) {\n\t\t\t// $user_id_arr .= $key->id.\",\";\n\t\t\t$str1 .= 'id = '.$key->id.\" OR \";\n\t\t\t$str2 .= 'u1.id = '.$key->id.\" OR \";\n\t\t}\n\n\t\t$str1 = rtrim($str1, \"OR \");\n\t\t$str2 = rtrim($str2, \"OR \");\n\n\t\t$str1 .= ')';\n\t\t$str2 .= ')';\n\n\t\t$qry_str = \"Select u1.id,\n\t\t\t\t\tif(u1.id in \n\t\t\t\t\t (Select max(u2.id)\n\t\t\t\t\t from users u2\n\t\t\t\t\t where is_ldy = 0\n\t\t\t\t\t and is_plexuss = 0 \n\t\t\t\t\t and email REGEXP '^[A-Z0-9._%-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$'\n\t\t\t\t\t and email not like '%test%'\n\t\t\t\t\t and fname not like '%test'\n\t\t\t\t\t and email not like '%nrccua%'\n\t\t\t\t\t and \".$str1.\"\n\t\t\t\t\t\t group by email)\n\t\t\t\t\t, 0, 1) as 'is_duplicate'\n\t\t\t\t\tfrom users u1\n\t\t\t\t\twhere is_ldy = 0\n\t\t\t\t\tand is_plexuss = 0 \n\t\t\t\t\tand email REGEXP '^[A-Z0-9._%-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$'\n\t\t\t\t\tand email not like '%test%'\n\t\t\t\t\tand fname not like '%test'\n\t\t\t\t\tand email not like '%nrccua%'\n\t\t\t\t\tand \".$str2.\";\";\n\n\t\t$qry = DB::connection('bk')->select($qry_str);\n\n\t\tforeach ($qry as $key) {\n\t\t\tif ($key->is_duplicate == 1) {\n\t\t\t\t$attr = array('user_id' => $key->id);\n\t\t\t\t$val = array('user_id' => $key->id, 'is_duplicate' => $key->is_duplicate);\n\n\t\t\t\tEmailLogicHelper::updateOrCreate($attr, $val);\n\t\t\t}\n\t\t}\n\t}", "public function duplicate() {\n \t\t\n \t\ttry {\n\t\t\t\n\t \t\t// start duplicate\n\t\t\t$class = get_class($this);\n \t\t\t$duplicate = new $class;\n \t\t\t\n\t \t\t// duplicate row fields\n\t \t\t$this->duplicateRow($duplicate);\n\t \t\t\n \t\t\t// duplicate data\n\t \t\t$this->duplicateData($duplicate);\n\t \t\t\n\t \t\t// duplicate items\n\t \t\t$this->duplicateChildren($duplicate);\n\t \t\t\n\t \t\t$duplicate->setDuplicate($this->getId());\n \t\t\n \t\t\treturn $duplicate;\n \t\t\t\n \t\t} catch (Exception $e) {\n \t\t\n \t\t\treturn false;\n \t\t\t\n \t\t}\n \t\t\n \t}", "private function check_for_duplicate_user_ids() {\n foreach($this->data as $course => $rows) {\n $user_ids = null;\n $d_rows = null;\n // Returns FALSE (as in there is an error) when duplicate IDs are found.\n // However, a duplicate ID does not invalidate a course. Instead, the\n // first enrollment is accepted, the other enrollments are discarded,\n // and the event is logged.\n if (validate::check_for_duplicate_user_ids($rows, $user_ids, $d_rows) === false) {\n foreach($d_rows as $user_id => $userid_rows) {\n $length = count($userid_rows);\n for ($i = 1; $i < $length; $i++) {\n unset($this->data[$course][$userid_rows[$i]]);\n }\n }\n\n $msg = \"Duplicate user IDs detected in {$course} data: \";\n $msg .= implode(\", \", $user_ids);\n $this->log_it($msg);\n }\n }\n\n return true;\n }", "public function title_is_unique_update() {\n $sql = \"SELECT * \n FROM `card` ca, `column` co\n WHERE ca.Title=:title AND ca.Column=co.ID AND co.Board=:board_id AND ca.ID<>:card_id\";\n $params = array(\n \"title\"=>$this->get_title(), \n \"board_id\"=>$this->get_board_id(),\n \"card_id\"=>$this->get_id()\n );\n $query = self::execute($sql, $params);\n $data=$query->fetch();\n return $query->rowCount()==0 ;\n }", "function v1_check_dupli_simple($name, $key, $code, $owners, &$error) {\n\t\n\tglobal $checked_data;\n\t\n\t// If such code was found before\n\tif (isset($checked_data[$key][$code])) {\n\t\t// Compare data\n\t\tforeach ($checked_data[$key][$code] as $cmp_data) {\n\t\t\t// Check owners\n\t\t\tforeach ($owners as $owner) {\n\t\t\t\tforeach ($cmp_data['owners'] as $cmp_owner) {\n\t\t\t\t\tif ($owner['id']==$cmp_owner['id']) {\n\t\t\t\t\t\t// Duplication found\n\t\t\t\t\t\t$error=\"&lt;\".$name.\" code=\\\"\".$code.\"\\\" owner=\\\"\".$owner['code'].\"\\\"&gt; is duplicated\";\n\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn TRUE;\n}", "public function transactionDuplicate($request)\n {\n $app = \\XF::app();\n $db = $app->db();\n $query = $db->query(\n \"SELECT COUNT(*) as resultCount FROM xf_rexshop_logs \n WHERE transaction_id ? AND transaction_status = ? \n LIMIT 1\",\n [\n $request['order']['transaction_id'],\n $request['status']\n ]\n );\n\n $result = $query->fetch();\n\n return $result['resultCount'] > 0;\n }", "function duplicateName(){\n $dup = $this->app['db']->fetchColumn('SELECT id from worlds where name=?', array($this->name));\n if($dup == $this->id || !$dup){\n return false;\n }\n $this->validation_errors[] = 'Name is a duplicate';\n return true;\n }", "public function checkTransactionAlreadyExists($data) { \n\t\t$transaction1=new Transaction(); \n $transaction=$transaction1->hasAny(array('trans_date'=>$this->data['Transaction']['trans_date'], 'trans_desc'=>$this->data['Transaction']['trans_desc']));\n\t\tif($transaction == \"1\"){\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\t\t\n }", "function delete_duplicates_from_db() {\n //TODO: possibly log or flag the file duplication.\n //it could be 2 physical files in different folders!\n //Somehow signal that case.\n\n $result = $this->pdo->query('DELETE FROM files WHERE rowid NOT IN (\n SELECT MIN(rowid) FROM files GROUP BY filename, md5_sign)');\n $results = $result->rowCount();\n\n return true;\n }", "function licence_norepeat($conn, $licence) {\n\t$sql = \"SELECT * FROM People WHERE People_Licence = '$licence'\";\n\t$result = mysqli_query($conn, $sql);\n\t// check if there is same one in database or not \n\tif (mysqli_num_rows($result) == 0) {\n\t\treturn True;\n\t} else {\n\t\treturn False;\n\t}\n\t\n}", "public function isDuplicate() {\n\t\t\t$duplicate = false;\n\t\t\t$sql = \"SELECT `emailSectionID` FROM `\".$this->table.\"` WHERE `type` = '\".prep($this->get('type')).\"' AND `name` = '\".prep($this->get('name')).\"'\";\n\t\t\t$result = $this->dbh->query($sql);\n\t\t\tif ($result->rowCount > 0) {\n\t\t\t\t$id = $this->get('emailSectionID');\n\t\t\t\twhile ($row = $result->fetchRow()) {\n\t\t\t\t\tif ($row['emailSectionID'] != $id) {\n\t\t\t\t\t\t$this->addError('There is an existing email section with the same name', 'duplicate');\n\t\t\t\t\t\t$this->addErrorField('type');\n\t\t\t\t\t\t$this->addErrorField('name');\n\t\t\t\t\t\t$duplicate = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $duplicate;\n\t\t}", "protected function checkDuplicate($array){\n $model = Stone::model()->findByAttributes(array('idstonem'=>$array['idstonem'], 'idshape'=>$array['idshape'], 'idstonesize'=>$array['idstonesize'], 'color'=>$array['color'], 'quality'=>$array['quality']));\n if(isset($model)){\n return false;\n }else{\n return true;\n }\n }", "public function joinQuest() {\n $query1 = 'SELECT * FROM user_quest \n WHERE user_id = :userId \n AND quest_id = :questId';\n\n $stmt1 = $this->conn->prepare($query1);\n $stmt1->bindParam(':userId', $this->id);\n $stmt1->bindParam(':questId', $this->quest_id);\n $stmt1->execute();\n\n if($stmt1->rowCount() > 0) {\n return \"Duplicate\";\n }\n else {\n $query2 = 'INSERT INTO user_quest \n SET user_id = :userId, quest_id = :questId';\n\n $stmt2 = $this->conn->prepare($query2);\n $stmt2->bindParam(':userId', $this->id);\n $stmt2->bindParam(':questId', $this->quest_id);\n\n if ($stmt2->execute()) {\n return true;\n } else {\n return false;\n }\n }\n }", "public function checkRefDuplication() {\n $refArray = array();\n foreach ($this->elementData as $data) {\n $value = trim($data['ref']);\n if ($value) {\n array_push($refArray, $value);\n }\n }\n\n $refError = array_diff_assoc($refArray, array_unique($refArray));\n foreach ($refError as $key => $value) {\n $this->error[$key+1][]['message'] = 'Internal Reference duplication. Please check your CSV file.';\n }\n }", "function db_duplicate($table, $id) {\r\n\r\n\t$fieldQuery = db_query(\"DESCRIBE $table\");\r\n\t\r\n\tif (db_numrows($fieldQuery) > 1) {\r\n\t\r\n\t\t$sourceQuery = db_query(\"SELECT * FROM $table WHERE id=\".escapeValue($id));\r\n\t\t\r\n\t\tif (db_numrows($sourceQuery) == 1) {\r\n\t\r\n\t\t\t$sourceResult = db_fetch($sourceQuery);\r\n\t\t\t$sql = \"UPDATE $table SET \";\r\n\t\t\t$first = 1;\r\n\t\r\n\t\t\twhile ($fieldResult = db_fetch($fieldQuery)) {\r\n\t\t\r\n\t\t\t\tif (strtolower($fieldResult[\"Field\"]) != \"id\") {\r\n\t\t\t\t\r\n\t\t\t\t\tif (!$first) $sql .= \",\";\r\n\t\t\t\t\tif (substr(strtolower($fieldResult[\"Type\"]),0,7) == \"varchar\" || strtolower($fieldResult[\"Type\"]) == \"text\")\r\n\t\t\t\t\t\t$sql .= $fieldResult[\"Field\"].\"=\".escapeQuote($sourceResult[$fieldResult[\"Field\"]],0);\r\n\t\t\t\t\telse\t\t\t\t\r\n\t\t\t\t\t\t$sql .= $fieldResult[\"Field\"].\"=\".escapeValue($sourceResult[$fieldResult[\"Field\"]]);\r\n\t\t\t\t\t$first = 0;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//echo $sql;\r\n\t\t\t//exit;\r\n\t\t\t$newId = db_insert($table);\r\n\t\t\tdb_query($sql.\" WHERE id=$newId\");\t\r\n\t\t\treturn $newId;\r\n\r\n\t\t} else return 0;\r\n\r\n\t} else return 0;\r\n\t\r\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 }", "private function checkIsExists(): bool\n {\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => [\n $this->table. '.listId' => $this->listId,\n $this->table. '.campaignId' => $this->campaignId,\n ]\n ]);\n\n return !is_null($id);\n }", "public function is_duplicate() {\n\n\t\t$post = $this->input->post();\n\n\t\t// Filter by name.\n\t\t$this->db->where( 'name', trim( $post['name'] ) );\n\n\t\t// Filter by church.\n\t\t$this->db->where( 'church', (int) $post['church'] );\n\n\t\t// Filter by age.\n\t\tif ( ! empty( $post['age'] ) ) {\n\t\t\t$this->db->where( 'age', (int) $post['age'] );\n\t\t}\n\n\t\t// Filter by gender.\n\t\tif ( ! empty( $post['gender'] ) ) {\n\t\t\t$this->db->where( 'gender', $post['gender'] );\n\t\t}\n\n\t\t$query = $this->db->get( 'registration' );\n\n\t\treturn $query->num_rows() > 0;\n\n\t}", "protected function _isDublicatedData($params){\r\n\t $quoteId = $params['quote_id'];\r\n\t $productId = $params['product_id'];\r\n $qtyRequest = $params['request_qty'];\r\n \r\n\t $collection = Mage::getModel('qquoteadv/requestitem')->getCollection()\r\n \t ->addFieldToFilter('quote_id', $quoteId)\r\n \t ->addFieldToFilter('product_id', $productId)\r\n \t ->addFieldToFilter('request_qty', $qtyRequest)\r\n \t //->load(true)\r\n \t ;\r\n \t \r\n return (count($collection) > 0)?true:false; \r\n\t}", "public function remove_duplicate_partner($data_arr,$type,&$msg){\n \n if($data_arr['partner_id'] == \"\"){\n $msg = \"Please select a \".$type;\n return true;\n }\n //check if this partner id of this type is there in the deal or not\n $q = \"select count(*) as cnt from \".TP.\"transaction_partners where transaction_id='\".$data_arr['transaction_id'].\"' and partner_id='\".$data_arr['partner_id'].\"' and partner_type='\".$type.\"'\";\n $res = mysql_query($q);\n if(!$res){\n return false;\n }\n $row = mysql_fetch_assoc($res);\n if($row['cnt']==0){\n $msg = \"This \".type.\" is not associated with the transaction\";\n return true;\n }\n //also check that if this is duplicated or not. If only one instance found then not a duplicate\n if(1==$row['cnt']){\n $msg = \"This \".type.\" is not duplicated for the transaction\";\n return true;\n }\n //we are removing the duplicate (transaction_id, partner_id). One instance of (transaction_id, partner_id) still remains, \n //so no need to delete from the tombstone_transaction_partner_members\n \n //get the first instance of the tuple (transaction_id, partner_id)\n $q = \"select id from \".TP.\"transaction_partners where transaction_id='\".$data_arr['transaction_id'].\"' and partner_id='\".$data_arr['partner_id'].\"' and partner_type='\".$type.\"' order by id\";\n $res = mysql_query($q);\n if(!$res){\n return false;\n }\n //the first row\n //we already checked that there is data\n $row = mysql_fetch_assoc($res);\n $id_to_keep = $row['id'];\n //now delete the rest of (transaction_id, partner_id), making sure that you keep at least one instance. Delete instances with id different from\n //the id_to_keep\n $q = \"delete from \".TP.\"transaction_partners where transaction_id='\".$data_arr['transaction_id'].\"' and partner_id='\".$data_arr['partner_id'].\"' and partner_type='\".$type.\"' and id!='\".$id_to_keep.\"'\";\n \n $result = mysql_query($q);\n if(!$result){\n //echo mysql_error();\n return false;\n }\n //data deleted, update adjusted values for all the partners of same type for this transaction\n //for that we need the value of the deal and number of partners for this type\n $deal_q = \"select value_in_billion from \".TP.\"transaction where id='\".$data_arr['transaction_id'].\"'\";\n $deal_q_res = mysql_query($deal_q);\n if(!$deal_q_res){\n return false;\n }\n $deal_q_res_row = mysql_fetch_assoc($deal_q_res);\n $value_in_billion = $deal_q_res_row['value_in_billion'];\n //now we need the partners of this type for this deal\n $partner_q = \"select partner_id from \".TP.\"transaction_partners where transaction_id='\".$data_arr['transaction_id'].\"' and partner_type='\".$type.\"'\";\n $partner_q_res = mysql_query($partner_q);\n if(!$partner_q_res){\n return false;\n }\n $num_partners = mysql_num_rows($partner_q_res);\n if($num_partners > 0){\n $partner_adjusted_value_in_billion = $value_in_billion/$num_partners;\n //update all the partners for this deal for this type\n $partner_update_q = \"update \".TP.\"transaction_partners set adjusted_value_in_billion='\".$partner_adjusted_value_in_billion.\"' where transaction_id='\".$data_arr['transaction_id'].\"' and partner_type='\".$type.\"'\";\n $result = mysql_query($partner_update_q);\n if(!$result){\n return false;\n }\n //now that the partners are updated, we need to update the team members for these partners for this deal\n while($partner_q_res_row = mysql_fetch_assoc($partner_q_res)){\n $deal_partner_id = $partner_q_res_row['partner_id'];\n $success = $this->update_deal_team_members_adjusted_value($data_arr['transaction_id'],$deal_partner_id);\n if(!$success){\n return false;\n }\n }\n }\n return true;\n }", "function KM_check_duplicate($options=array())\n\t {\n\t \tif(!empty($options['where']))\n\t\t{\n\t\t\t$this->db->select('*');\n\t\t\t\n\t\t\tif(isset($options['class']))\n\t\t\t{\n\t\t\t\t$table=$this->db->dbprefix.$options['class'];\t\t\t\n\t\t\t} \t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$table= $this->table;\n\t\t\t}\n\t\t\t\n\t\t\t$this->db->from($table);\n\t\t\t$this->db->where($options['where']);\t\t \n\t\t\t$query = $this->db->get();\n\t\t\t$result= $query->result();\t\t\n\t\t\treturn count($result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t }", "private function validateForDuplicate($event_id, $user_id){\n return $this->UpdateEventDetailModel->getJoinStatusByUseridAndEventid($event_id,$user_id);\n }", "public static function findAmendmentEntries($rowData)\n {\n\n $totalAmendments = 0;\n \n // mode 1: same gen_vendor_normalized, same reference_number, different contract_value\n $amendmentRows = DB::table('l_contracts')\n ->where('owner_acronym', '=', $rowData['owner_acronym'])\n // Ensure it's not the exact same row:\n ->where('id', '!=', $rowData['id'])\n // Make sure it's not a duplicate entry\n ->where('gen_is_duplicate', '=', 0)\n // Make sure it's not an error row\n ->where('gen_is_error', '=', 0)\n // Make sure it isn't part of a different amendment group (TODO - review this)\n ->whereNull('gen_amendment_group_id')\n ->whereNotNull('source_fiscal')\n // Make sure it's the same vendor:\n ->where('gen_vendor_normalized', '=', $rowData['gen_vendor_normalized'])\n\n // This is a bit of a complicated combination, but the resulting SQL is,\n // and (\"reference_number\" = ? or (\"original_value\" = ? and \"gen_start_year\" = ?))\n // Because of threshold limits (sole source, NAFTA, etc.), we wouldn't want to just match original and contract values without also matching start years (in case completely different contracts have the same values).\n ->where(function ($query) use ($rowData) {\n return $query->where('reference_number', '=', $rowData['reference_number'])\n ->orWhere(function ($query) use ($rowData) {\n return $query->where('original_value', '=', $rowData['contract_value'])\n ->where('gen_start_year', '=', $rowData['gen_start_year']);\n });\n })\n ->orderBy('source_fiscal', 'asc')\n ->orderBy('contract_value', 'asc')\n // ->orderBy('id', 'asc')\n // ->toSql();\n ->pluck('id');\n\n if ($amendmentRows->count() > 0) {\n // Just 1 row is enough (since it'll be different than the original row)\n // Add back in the original ID (sorted by source_fiscal then ID in the earlier query in findAmendments)\n $amendmentRows->prepend($rowData['id']);\n\n $totalAmendments += self::markAmendmentEntries($rowData['owner_acronym'], $amendmentRows, 1);\n }\n\n return $totalAmendments;\n }", "function alreadyExisting($conn, $pnr, $projectID) {\n $sql = \"SELECT * FROM employeeproject WHERE PNR != ? AND ProjectID != ?;\";\n $stmt = mysqli_stmt_init($conn);\n if(!mysqli_stmt_prepare($stmt, $sql)){\n echo \"SQL Statement failed\";\n header(\"location: ../employeesAndProjects.php?error=stmtfailed\");\n exit();\n }\n mysqli_stmt_bind_param($stmt, \"ss\", $pnr, $projectID);\n mysqli_stmt_execute($stmt);\n\n $resultData = mysqli_stmt_get_result($stmt);\n\n\n if(!mysqli_fetch_assoc($resultData)) {\n $result = true;\n }\n else{\n $result = false;\n }\n return $result;\n mysqli_stmt_close($stmt);\n }", "public function testSingleResultQueryWithDuplicateColumns() {\r\n $record = ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'];\r\n // Write data to the database\r\n\t\t$this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n $query = 'select UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE, STRING_VALUE as UUID from POTEST where UUID = \\'uuid1tRMR2\\'';\r\n $result = $this->getPersistenceAdapter()->executeSingleResultQuery($query);\r\n\t\t$this->assertEquals($record['string'], $result->UUID, 'Uuid should contain the string value but it does not.');\r\n\t\t$this->assertEquals($record['bool'] ? 1 : 0, $result->BOOLEAN_VALUE, 'Boolean value from persistent object differs from the boolean value of the database.');\r\n\t\t$this->assertEquals($record['int'], $result->INT_VALUE, 'Integer value from persistent object differs from the int value of the database.');\r\n\t\t$this->assertEquals($record['string'], $result->STRING_VALUE, 'String value from persistent object differs from the string value of the database.');\r\n }", "public function hasCompositePrimaryKey()\n {\n return count($this->getPrimaryKey()) > 1;\n }", "function plate_norepeat($conn, $plate) {\n\t$sql = \"SELECT * FROM Vehicle WHERE Vehicle_Licence = '$plate'\";\n\t$result = mysqli_query($conn, $sql);\n\t// check if there is same one in database or not \n\tif (mysqli_num_rows($result) == 0) {\n\t\treturn True;\n\t} else {\n\t\treturn False;\n\t}\n}", "function v1_check_dupli_sd_evn($name, $key, $code, $sn_id, $sd_evn_tech, $owners, &$error) {\n\t\n\tglobal $checked_data;\n\t\n\t// If such code was found before\n\tif (isset($checked_data[$key][$code])) {\n\t\t// Compare data\n\t\tforeach ($checked_data[$key][$code] as $cmp_data) {\n\t\t\t// Check sn_id\n\t\t\tif ($cmp_data['sn_id']!=$sn_id) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// Check location technique\n\t\t\tif ($cmp_data['sd_evn_tech']!=$sd_evn_tech) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// Check owners\n\t\t\tforeach ($owners as $owner) {\n\t\t\t\tforeach ($cmp_data['owners'] as $cmp_owner) {\n\t\t\t\t\tif ($owner['id']==$cmp_owner['id']) {\n\t\t\t\t\t\t// Duplication found\n\t\t\t\t\t\t$error=\"&lt;\".$name.\" code=\\\"\".$code.\"\\\" owner=\\\"\".$owner['code'].\"\\\"&gt; is duplicated\";\n\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn TRUE;\n}", "public static function markDuplicateEntries($ownerAcronym, $duplicateRows, $method = 1)\n {\n // Includs the ownerAcronym just to be on the safe side.\n\n // Remove the first entry (so that it isn't also marked as a duplicate, since at least one entry should stay \"valid\")\n $sourceId = $duplicateRows->shift();\n\n $duplicateRows = $duplicateRows->toArray();\n\n return DB::table('l_contracts')\n ->where('owner_acronym', '=', $ownerAcronym)\n ->whereIn('id', $duplicateRows)\n ->update([\n 'gen_is_duplicate' => 1,\n 'gen_duplicate_via' => $method,\n 'gen_duplicate_source_id' => $sourceId,\n ]);\n }", "private static function duplicate_check($parameter) {\n\t\treturn self::$query\n\t\t->select($parameter['table'], array(\n\t\t\t'uid',\n\t\t\t'nama'\n\t\t))\n\t\t->where(array(\n\t\t\t$parameter['table'] . '.deleted_at' => 'IS NULL',\n\t\t\t'AND',\n\t\t\t$parameter['table'] . '.nama' => '= ?'\n\t\t), array(\n\t\t\t$parameter['check']\n\t\t))\n\t\t->execute();\n\t}", "public function hasCommitRow(){\n return $this->_has(3);\n }", "private function getUniqueExists($uniques, $table, $column)\n {\n\n }", "public function title_is_unique() {\n $sql = \"SELECT * \n FROM `card` ca, `column` co\n WHERE ca.Title=:title AND ca.Column=co.ID AND co.Board=:board_id\";\n $params = array(\n \"title\"=>$this->get_title(), \n \"board_id\"=>$this->get_board_id(),\n );\n $query = self::execute($sql, $params);\n $data=$query->fetch();\n return $query->rowCount()==0 ;\n }", "public function isDuplicate() {\r\n\t\treturn ($this->errorNumber === 1062);\r\n\t}", "private function isClientExists(): bool {\n $sql = 'SELECT * FROM clients WHERE phone = :phone LIMIT 1';\n\n $db = static::getDB();\n $stmt = $db->prepare( $sql );\n\n $stmt->bindValue( ':phone', $this->phone, PDO::PARAM_STR );\n\n $stmt->execute();\n\n if ( $result = $stmt->fetch( PDO::FETCH_ASSOC ) ) {\n $this->id = $result['id'];\n\n return true;\n }\n\n return false;\n }", "function exists() {\r\n\t\t$sql_inicio \t= \" select * from \".$this->table.\" where \";\r\n\t\t$sql_fim \t\t= \" \".($this->get($this->pk) ? \" and \".$this->pk.\" <> \".$this->get($this->pk) : \"\").\" limit 1 \";\r\n\t\t\r\n\t\t$sql \t= \"con_id = \".$this->get(\"con_id\").\" and exa_id = \".$this->get(\"exa_id\").\" \";\r\n\t\tif (mysql_num_rows(Db::sql($sql_inicio.$sql.$sql_fim))){\r\n\t\t\t$this->propertySetError (\"con_id\", \"Já existe no banco de dados.\");\r\n\t\t\t$this->propertySetError (\"exa_id\", \"Já existe no banco de dados.\");\r\n\t\t}\r\n\t}", "function v1_check_dupli_species($parent_name, $name, $key, $code, $type, $waterfree, $owners, &$error) {\n\t\n\tglobal $checked_data;\n\t\n\t// If such code was found before\n\tif (isset($checked_data[$key][$code])) {\n\t\t// Compare data\n\t\tforeach ($checked_data[$key][$code] as $cmp_data) {\n\t\t\t// Check owners\n\t\t\tforeach ($owners as $owner) {\n\t\t\t\tforeach ($cmp_data['owners'] as $cmp_owner) {\n\t\t\t\t\tif ($owner['id']==$cmp_owner['id']) {\n\t\t\t\t\t\t// Check type and waterfree\n\t\t\t\t\t\tif ($cmp_data['type']==$type && $cmp_data['waterfree']==$waterfree) {\n\t\t\t\t\t\t\t// Duplication found\n\t\t\t\t\t\t\t$error=\"&lt;\".$parent_name.\" code=\\\"\".$code.\"\\\" owner=\\\"\".$owner['code'].\"\\\"&gt; with &lt;\".$name.\" type=\\\"\".$type.\"\\\"\";\n\t\t\t\t\t\t\tif (!empty($waterfree)) {\n\t\t\t\t\t\t\t\t$error.=\" waterfree=\\\"\".$waterfree.\"\\\"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$error.=\"&gt; is duplicated\";\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\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn TRUE;\n}", "private function insertUnMatched()\n {\n $newElements = $this->unMatchedCollection->map(function ($item) {\n\n //Unset primary key property because it can create Integrity constraint violation: Duplicate ID\n if(!in_array($this->primaryKey,$this->associativeColumns) && !in_array($this->primaryKey,$this->associativePivots))\n unset($item->id);\n\n if(!empty($this->associativeColumns))\n {\n $newItem = new \\stdClass();\n foreach ($this->associativeColumns as $baseColumn => $mergeColumn)\n {\n $newItem->$baseColumn = $item->$mergeColumn;\n }\n foreach ($this->associativePivots as $baseColumn => $mergeColumn)\n {\n $newItem->$baseColumn = $item->$mergeColumn;\n }\n\n $item = $newItem;\n }\n\n\n return get_object_vars($item);\n\n })->toArray();\n\n if (!empty($newElements))\n $this->rowInserted = DB::table($this->baseTable)->insert($newElements);\n }", "function check_incident($conn, $id) {\n\t$sql = \"SELECT * FROM Incident WHERE Incident_ID = '$id'\";\n\t$result = mysqli_query($conn, $sql);\n\t// happen to have one match, i.e. one unique corrosponding vehicle\n\tif (mysqli_num_rows($result)== 1){\n\t\treturn True;\n\t}else {\n\t\treturn False; // no or multiple corrospondence\n\t}\n\t\n}", "abstract public function isDuplicatePIMAddition($id);", "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 }", "function checkDuplicate($value = '', $key = 'name', $condition = '') {\n\t\t$result = $this->select(\"`$key`\",\"`store_id` = '\".$this->store_id.\"' AND `$key` = '$value'\".($condition?\" AND $condition\":''));\n\t\tif($result) return 1;\n\t\treturn 0;\n\t}", "public function checkDuplicateSupplier()\n\t{\n\t\t$is_exist=false;\n\t\tif ($this->isNewRecord) {\n\t\t\tforeach (__Language::$_arr_int__language_id as $var__key =>$var__value)\n\t\t\t{\n\t\t\t\tif($var__key=='en')\n\t\t\t\t\t$var_slug='slug';\n\t\t\t\telse\n\t\t\t\t\t$var_slug='slug_'.$var__key;\n\t\t\t\t$obj__criteria = new CDbCriteria;\n\t\t\t\t$obj__criteria->with=array('category');\n\t\t\t\t$obj__criteria->compare('category.category_id', $_POST['ActivityField']['category_id']);\n\t\t\t\t$obj__criteria->compare($var_slug,$this[$var_slug]);\n\t\t\t\t$obj__criteria->together = true;\n\n\t\t\t\tif(Supplier::model()->exists($obj__criteria))\n\t\t\t\t{\n\t\t\t\t\t$is_exist=true;\n\t\t\t\t}\n\t\t\t\t$arr__result=\n\t\t\t\t[\n\t\t\t\t\t'lang'=>$var__key,\n\t\t\t\t\t'is_exist'=>$is_exist,\n\t\t\t\t];\n\t\t\t\treturn $arr__result;\n\t\t\t}\n\t\t} else {\n\t\t\tforeach (__Language::$_arr_int__language_id as $var__key =>$var__value)\n\t\t\t{\n\t\t\t\tif($var__key=='en')\n\t\t\t\t\t$var_slug='slug';\n\t\t\t\telse\n\t\t\t\t\t$var_slug='slug_'.$var__key;\n\t\t\t\t$obj__criteria = new CDbCriteria;\n\t\t\t\t$obj__criteria->with=array('category');\n\t\t\t\t$obj__criteria->compare('category.category_id', $_POST['ActivityField']['category_id']);\n\t\t\t\t$obj__criteria->compare($var_slug,$this[$var_slug]);\n\t\t\t\t$obj__criteria->addCondition('t.id != '.$this->id);\n\t\t\t\t$obj__criteria->together = true;\n\n\t\t\t\tif(Supplier::model()->exists($obj__criteria))\n\t\t\t\t{\n\t\t\t\t\t$is_exist=true;\n\t\t\t\t}\n\t\t\t\t$arr__result=\n\t\t\t\t\t[\n\t\t\t\t\t\t'lang'=>$var__key,\n\t\t\t\t\t\t'is_exist'=>$is_exist,\n\t\t\t\t\t];\n\t\t\t\treturn $arr__result;\n\t\t\t}\n\t\t}\n\t}", "private static function deleteArchiveDuplicates()\n {\n // Table name is already prefixed\n $currentTable = ArchiveTableCreator::getBlobTable(Date::factory('now'));\n $archiveDuplicateEntries = Db::getReader()->fetchAll('\n SELECT\n MIN(`idarchive`) AS `idarchive`,\n `name`,\n COUNT(*) AS `duplicates`\n FROM\n `' . $currentTable . '`\n WHERE\n `name` LIKE ?\n GROUP BY\n `name`,\n `idsite`,\n `date1`,\n `date2`,\n `period`,\n `value`\n HAVING\n `duplicates` > 1\n ', [self::DATABASE_RECORD_PREFIX . '%']);\n\n if (count($archiveDuplicateEntries) < 1) {\n return 0;\n }\n $archiveDuplicateIds = array_column($archiveDuplicateEntries, 'idarchive');\n $archiveDuplicateNames = array_column($archiveDuplicateEntries, 'name');\n $archiveDuplicateIdPlaceholder = rtrim(str_repeat('?,', count($archiveDuplicateIds)), ',');\n $archiveDuplicateNamePlaceholder = rtrim(str_repeat('?,', count($archiveDuplicateNames)), ',');\n\n return Db::deleteAllRows(\n $currentTable,\n 'WHERE `idarchive` IN (' . $archiveDuplicateIdPlaceholder . ') AND `name` IN (' . $archiveDuplicateNamePlaceholder . ')',\n '`idarchive` ASC',\n 100000,\n array_merge($archiveDuplicateIds, $archiveDuplicateNames)\n );\n }", "public function cleanDuplicates( );", "public function isUnique();", "function createMarket($asset1, $asset2){\n global $mysqli;\n // Check if the market already exists... if not, create it\n $sql = \"SELECT \n m.id\n FROM \n markets m,\n assets a1,\n assets a2\n WHERE \n a1.id=m.asset1_id AND\n a2.id=m.asset2_id AND\n ((a1.asset='{$asset1}' AND a2.asset='{$asset2}') OR\n (a1.asset='{$asset2}' AND a2.asset='{$asset1}'))\";\n $results = $mysqli->query($sql);\n if($results){\n if($results->num_rows){\n $row = $results->fetch_assoc();\n return $row['id'];\n } else {\n $asset1_id = getAssetDatabaseId($asset1);\n $asset2_id = getAssetDatabaseId($asset2); \n $results = $mysqli->query(\"INSERT INTO markets (asset1_id, asset2_id) values ('{$asset1_id}', '{$asset2_id}')\");\n if($results && $mysqli->insert_id){\n return $mysqli->insert_id;\n } else {\n byeLog(\"Error while trying to create market {$asset1} / {$asset2}\");\n }\n }\n } else {\n byeLog(\"Error while trying to check for market {$asset1} / {$asset2}\");\n }\n}", "private function runScript() {\n //return true;\n \n /** This script was used to clean up errant records between the nhc and player rating tables. **/\n $query = \"SELECT nhc.nhc_pin FROM `{$this->db->prefix}nhc` nhc\n JOIN `{$this->db->prefix}nhc_player_rating` pr ON nhc.nhc_pin = pr.nhc_pin\";\n $joinResults = $this->db->get_results($query);\n $uniqueArr = $duplicateArr = array();\n foreach($joinResults as $join) {\n if(in_array($join->nhc_pin, $uniqueArr)) {\n $duplicateArr[] = $join->nhc_pin;\n }\n else {\n $uniqueArr[] = $join->nhc_pin;\n }\n }\n \n \n echo'duplicates: <br><pre>'; print_r($duplicateArr); echo '</pre>';\n \n $dupeString = implode(',', $duplicateArr);\n $query2 = \"SELECT * from `{$this->db->prefix}nhc` where nhc_pin IN ($dupeString)\";\n echo '<br><br>'.$query2;\n $dupResults = $this->db->get_results($query2);\n \n echo'<br><br>duplicate results in nhc table: <br><pre>'; print_r($dupResults); echo '</pre>';\n return true;\n\n }", "function check_vehicle($conn, $id) {\n\t$sql = \"SELECT * FROM Vehicle WHERE Vehicle_ID = '$id'\";\n\t$result = mysqli_query($conn, $sql);\n\t// happen to have one match, i.e. one unique corrosponding vehicle\n\tif (mysqli_num_rows($result)== 1){\n\t\treturn True;\n\t}else {\n\t\treturn False; // no or multiple corrospondence\n\t}\n}", "function validate() {\n\t\t// execute the column validation \n\t\tparent::validate();\n\t\t\n\t\t// connection\t\t\n\t\t$conn = Doctrine_Manager::connection();\n\t\t\n\t\t// query for check if location exists\n\t\t$unique_query = \"SELECT id FROM company WHERE name = '\".$this->getName().\"' AND id <> '\".$this->getID().\"'\";\n\t\t$result = $conn->fetchOne($unique_query);\n\t\t// debugMessage($unique_query);\n\t\t// debugMessage(\"result is \".$result);\n\t\tif(!isEmptyString($result)){ \n\t\t\t$this->getErrorStack()->add(\"unique.name\", \"The name \".$this->getName().\" already exists. Please specify another.\");\n\t\t}\n\t}", "public function deleteDuplicate() {\n\t\t$sql = \"DELETE FROM reestr_distinct\";\n\t\t$this->query_data($sql);\n\t\t$sql = \"INSERT INTO reestr_distinct SELECT DISTINCT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11, col12, col13, col14, col15, col16, col17, now(),NULL,'Бессрочно' FROM reestr\";\n\t\t$this->query_data($sql);\n\t\treturn 0;\n\t}", "public function ajax_checkduplicate()\r\n {}", "public function ajax_checkduplicate()\r\n {}", "function isValidInsert($productItem, $validateDuplicate = true) {\n $message = array();\n\n if(!isset($productItem['product_id'])) {\n $message['product_id'] = 'not set';\n }\n else if(!is_numeric($productItem['product_id']) || $productItem['product_id'] < 0) {\n $message['product_id'] = 'invalid (must be an integer greater than or equals to 0)';\n }\n\n if(!isset($productItem['quantity'])) {\n $message['quantity'] = 'not set';\n }\n else if(!is_numeric($productItem['quantity']) || $productItem['quantity'] < 1 || $productItem['quantity'] > 100) {\n $message['quantity'] = 'invalid (must be an integer between 1 and 100)';\n }\n\n if ($validateDuplicate) {\n $cmd = 'SELECT * FROM product_item WHERE purchase_id = :purchase_id and product_id = :product_id';\n $sql = $GLOBALS['db']->prepare($cmd);\n $sql->bindValue(':purchase_id', $_SESSION[\"PurchaseId\"]);\n $sql->bindValue(':product_id', $productItem[\"product_id\"]);\n $sql->execute();\n\n $items = $sql->fetch(PDO::FETCH_ASSOC);\n\n if ($items) {\n $message['product_id'] = 'invalid (product id already exists)';\n }\n }\n\n if(empty($message)) {\n return true;\n }\n else {\n outputJson(NULL, false, $message); \n return false;\n }\n}", "function insertGithubIntoPlace($output){\n global $db,$allCountries;\n foreach ($output as $row) {\n if (duplicatePlace($row['State'],$row['Country'])>0){\n continue;\n }\n\n if (!empty($row['State'])) { //ked je vyplneny stat tak sa zapise aj stat, inak iba krajina\n $query = \"INSERT INTO place(statename,countryname) VALUES('{$row['State']}','{$row['Country']}')\";\n }\n else {\n $query = \"INSERT INTO place(countryname) VALUES('{$row['Country']}')\";\n }\n array_push($allCountries,$row['Country']);\n $db->exec($query);\n }\n}", "public function delete_duplicates()\n {\n if (empty($this->params['named']['field']))\n {\n echo 'You must enter a field to work with. http://recipe-manager/ingredients/delete_duplicates/field:ingredient';\n exit();\n }\n\n $field = $this->params['named']['field'];\n\n var_dump($field);\n\n $params = array();\n $result = $this->{$this->modelClass}->find('all', $params);\n\n\n foreach ($result as $item)\n {\n $params = array(\n 'conditions' => array($this->modelClass . '.' . $field => $item[$this->modelClass][$field]), //array of conditions\n );\n $r = $this->{$this->modelClass}->find('all', $params);\n\n if (count($r) == 2)\n {\n while (count($r) > 1)\n {\n $t = array_pop($r);\n var_dump($t[$this->modelClass]['_id']);\n $this->{$this->modelClass}->delete($t[$this->modelClass]['_id']);\n }\n }\n }\n\n\n exit('done');\n }", "private function upsert_data() {\n foreach ($this->data as $course => $rows) {\n if (db::upsert($this->semester, $course, $rows) === false) {\n $this->log_it(db::$error);\n }\n }\n\n // Done.\n return true;\n }", "function checkExistInTransaction($fund_id)\n{\n\tglobal $mysqli;\n\t$select_tran = \"select transaction_id from usaid_fund_transaction_detail where ledger_type_id='\".$fund_id.\"'\";\n\t$result_tran = $mysqli->query($select_tran) or die('Error'. $mysqli->error);\n\t$total_record = $result_tran->num_rows;\n\tif($total_record<1) return true;\n\telse return false;\n}", "public function testCreateDuplicateEntry()\n {\n\n $this->call('POST', '/api/role', array(\n 'action' => $this->createAction,\n 'name' => $this->testRoleName,\n 'description' => $this->testRoleDesc\n ));\n\n $this->assertDatabaseHas('roles', [\n 'name' => $this->testRoleName,\n 'description' => $this->testRoleDesc\n ]);\n\n $this->call('POST', '/api/role', array(\n 'action' => $this->createAction,\n 'name' => $this->testRoleName,\n 'description' => \"duplicate\"\n ));\n\n $this->assertDatabaseMissing('roles', [\n 'name' => $this->testRoleName,\n 'description' => \"duplicate\"\n ]);\n\n }", "public function testUniqueComposite()\n {\n $statement = (new CreateTable($this->mockConnection));\n $return = $statement->unique(['column1', 'column2']);\n $array = $statement->toArray();\n\n $this->assertInstanceOf(CreateTable::class, $return);\n $this->assertEquals([\n 'constraints' => [\n [\n 'type' => 'unique',\n 'name' => null,\n 'columns' => ['column1', 'column2']\n ]\n ],\n ], $array);\n }", "function queryInsertRow($insertTable, array $valueArray, $insertMode = self::C_ALLOW_DUPLICATES)\n {\n if(self::C_ALLOW_DUPLICATES===$insertMode){\n $this->query($this->buildSqlInsertRow($insertTable, $valueArray));\n return true;\n }elseif(self::C_IGNORE_DUPLICATES===$insertMode){\n $selectString = \"SELECT count(*) FROM $insertTable WHERE 1 \";\n foreach($valueArray as $var=>$value){\n $selectString .= ($value === NULL) ? \" AND \".$var.\" IS NULL \":\" AND \".$var.\" = '\".$this->conn->real_escape_string($value).\"'\";\n }\n $count = $this->queryValue($selectString); //check for identical rows;\n if ($count===\"0\"){\n $this->query($this->buildSqlInsertRow($insertTable, $valueArray));\n return true;\n }else{\n return false;\n }\n }else{\n trigger_error(\"Wrong parameter for insert mode. Please choose 'C_ALLOW_DUPLICATES' or 'C_IGNORE_DUPLICATES' as third parameter!\", E_USER_ERROR);\n }\n }", "function validateUnequeIndividualFromTable($table, $db, $data, $dbColumnName) {\n $sql = \"SELECT * FROM \" . $table . \" WHERE \" . $dbColumnName . \" = ?\";\n $isUneque = true;\n $statement = $db ->prepare($sql);\n $statement->execute([$data]);\n\n $results = $statement->fetchAll(PDO::FETCH_ASSOC);\n if ($results != []) {\n $isUneque = false;\n }\n return $isUneque;\n}", "function check_if_new($new_photo, $old_photos) {\n foreach ($old_photos as $oldie) {\n if ($oldie->guid == $new_photo['url_m']) {\n //The photo is already in the database!\n return False;\n }\n }\n return True;\n}", "function checkDuplicate($title,$artist){\n\tmysql_query(\"SELECT sid from songs \n\t\t\t\tWHERE title='$title' AND artist='$artist'\");\n}", "function is_rowid_exist($rowid,$db_table='') {\r\n $db_table = $db_table == '' ? $this->db_table : $GLOBALS['dbpre'].$db_table;\r\n $sql = 'select 1 from '.$db_table.' where rowid='.intval($rowid);\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error()); #do to database\r\n return mysql_num_rows($res);\r\n }", "public function storeCommissionData($commissionDataArr) {\r\n $model = Mage::getModel('marketplace/commission');\r\n $duplicateProduct = $model->getCollection()\r\n ->addFieldToSelect('order_id')\r\n ->addFieldToFilter('order_id',$commissionDataArr['order_id'])\r\n ->addFieldToFilter('product_id',$commissionDataArr['product_id'])\r\n ->addFieldToFilter('seller_id',$commissionDataArr['seller_id']);\r\n if($duplicateProduct->getSize()){\r\n return false;\r\n }\r\n else {\r\n $model->setData($commissionDataArr);\r\n $model->save();\r\n return $model->getId();\r\n }\r\n }", "public function testExistentRecord()\n {\n try {\n DAL::beginTransaction();\n $assetidOne = 123;\n $typeid = 'asset';\n $sql = $this->_getInsertQuery($assetidOne, $typeid).';';\n\n $assetidTwo = 124;\n $typeid = 'asset';\n $sql .= $this->_getInsertQuery($assetidTwo, $typeid);\n\n $expected = 'asset';\n DAL::executeQueries($sql);\n\n $type = TestDALSys1::dalTestExecuteOne($assetidOne);\n PHPUnit_Framework_Assert::assertEquals($expected, $type);\n\n $type = TestDALSys1::dalTestExecuteOne($assetidTwo);\n PHPUnit_Framework_Assert::assertEquals($expected, $type);\n DAL::rollBack();\n\n } catch (PDOException $e) {\n DAL::rollBack();\n PHPUnit_Framework_Assert::fail($e->getMessage().$e->getTraceAsString());\n } catch (ChannelException $e) {\n DAL::rollBack();\n PHPUnit_Framework_Assert::fail($e->getMessage().$e->getTraceAsString());\n }\n\n }", "abstract public function hasRow();", "public function unique_order(){\n\t\t\t\n\t\t\t$where = array(\n\t\t\t\t'reference' => $this->input->post('reference'),\n\t\t\t\t'order_description' => $this->input->post('order_description'),\n\t\t\t\t'total_price' => $this->input->post('total_price'),\n\t\t\t\t'num_of_items' => $this->input->post('num_of_items'),\n\t\t\t\t'customer_email' => $this->input->post('customer_email'),\n\t\t\t);\n\t\t\t\n\t\t\tif (!$this->Orders->is_unique($where))\n\t\t\t{\n\t\t\t\t$this->form_validation->set_message('unique_order', 'You already have this order on record!');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}", "private function searchDiffs()\n {\n $this->matchedCollection->each(function ($item) {\n\n $newElement = $this->findMeIn($this->mergeCollection,$item);\n\n //Unset primary key property if it's not in associative pivots because it can create Integrity constraint violation: Duplicate ID\n if(!in_array($this->primaryKey,$this->associativeColumns) && !in_array($this->primaryKey,$this->associativePivots))\n unset($newElement->id);\n\n //If found element\n if($newElement)\n $this->fillReport($newElement,$item);\n });\n }", "function checkDuplicationEdit($oAffiliate)\n\t\t{\n\t\t\t$sSQL_Email\t=\t\"select * from tbl_member \n\t\t\twhere email='\".$oAffiliate->email.\"' and member_id !='\".$oAffiliate->member_id.\"' and isActive !='d'\";\n\t\t\t$rs_Email\t=\t$this->Execute($sSQL_Email);\n\t\t\tif($rs_Email->RecordCount()) {\n\t\t\t\treturn \"email\";\n\t\t\t}\n\t\t\t\n\t\t\treturn \"notfound\";\n\t\t}", "private function checkDuplicate($pdo)\n {\n $sql = \"SELECT UserName, UserEmail\n FROM users\n WHERE UserName = :UserName\n OR UserEmail = :UserEmail\";\n\n $stmt = $pdo->prepare($sql);\n $stmt->bindParam(':UserName', $this->username);\n $stmt->bindParam(':UserEmail', $this->email);\n $stmt->execute();\n\n if ($stmt->fetch() !== false) {\n return false;\n } else {\n return true;\n }\n }", "protected function _checkRowDuplicate($customerId, $addressId)\n {\n if ($this->addressStorage->doesExist(\n (string)$addressId,\n (string)$customerId\n )) {\n if (!isset($this->_importedRowPks[$customerId][$addressId])) {\n $this->_importedRowPks[$customerId][$addressId] = true;\n return false;\n } else {\n return true;\n }\n } else {\n return false;\n }\n }", "function isAlreadyExist(){\n $query = \"SELECT *\n FROM\n \" . $this->db_table . \" \n WHERE\n username='\".$this->username.\"'\";\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 }\n else{\n return false;\n }\n }", "protected function checkDatabase(){\n //echo \"inCheckDatabaseCourseT \";\n $dataArrays = readFromFile('coursesTakenDB.csv');\n $headersArray = $dataArrays['keysArray'];\n $valuesArray = $dataArrays['valuesArray'];\n\n $resultArray = createAssocArray($headersArray,$valuesArray);\n\n // FIX THIS!!!\n foreach($resultArray as $item){\n if($item['Student Number'] == $this->studentNumber && $item['Course Code'] == $this->courseCode && $item['Course Year'] == $this->courseYear && $item['Course Semester'] == $this->courseSemester && $item['Grade'] == $this->grade){\n return TRUE;\n }\n }\n }", "protected function itemIsUnique(array $item) {\n $unique = array_intersect_key($item, $this->uniqueColumns);\n $this->uniqueStatement->execute($unique);\n\n return (bool) $this->uniqueStatement->fetch();\n }" ]
[ "0.62174606", "0.6211915", "0.59374905", "0.59031355", "0.5791158", "0.57821923", "0.57049656", "0.5698443", "0.5698303", "0.5681922", "0.5586908", "0.5582221", "0.5521944", "0.5517507", "0.54370445", "0.5415155", "0.5412063", "0.5404182", "0.538865", "0.53866214", "0.5384303", "0.5382128", "0.53641665", "0.535366", "0.53269565", "0.5320819", "0.5314922", "0.5305349", "0.5303577", "0.5288783", "0.52807987", "0.52623534", "0.5205593", "0.5200722", "0.51863575", "0.5167343", "0.5163123", "0.516193", "0.5145491", "0.5139253", "0.5130275", "0.51023704", "0.50902784", "0.50785875", "0.5072074", "0.5069482", "0.5052662", "0.50517964", "0.5038565", "0.50347126", "0.50344515", "0.5026732", "0.5014027", "0.501081", "0.49935523", "0.49815148", "0.49784493", "0.49766824", "0.49707812", "0.49633983", "0.49628383", "0.49605203", "0.4953009", "0.49486756", "0.49485365", "0.49360853", "0.49339908", "0.49282297", "0.4924033", "0.4913011", "0.49067992", "0.49046284", "0.4897558", "0.48862982", "0.48800164", "0.48737165", "0.48737165", "0.48516646", "0.48420548", "0.4838423", "0.48366162", "0.48334134", "0.4832715", "0.48196143", "0.4816982", "0.4814087", "0.48115706", "0.47999305", "0.4790134", "0.47843266", "0.4773066", "0.47721595", "0.47714946", "0.47679788", "0.47634014", "0.4760487", "0.47601372", "0.4757027", "0.47533488", "0.47444397" ]
0.69457513
0
Includs the ownerAcronym just to be on the safe side.
public static function markAmendmentEntries($ownerAcronym, $amendmentRows, $method = 1) { // Remove the first entry (so that it isn't also marked as a duplicate, since at least one entry should stay "valid") $sourceId = $amendmentRows->shift(); $amendmentRows = $amendmentRows->toArray(); // Update the original (sourceId) entry DB::table('l_contracts') ->where('owner_acronym', '=', $ownerAcronym) ->where('id', '=', $sourceId) ->update([ 'gen_amendment_group_id' => $sourceId, ]); return DB::table('l_contracts') ->where('owner_acronym', '=', $ownerAcronym) ->whereIn('id', $amendmentRows) ->update([ 'gen_is_amendment' => 1, 'gen_amendment_via' => $method, 'gen_amendment_group_id' => $sourceId, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function acronym($acronym) {\n\n if(array_key_exists($acronym, $this->acronyms)) {\n\n $title = $this->_xmlEntities($this->acronyms[$acronym]);\n\n $this->doc .= '<abbr title=\"'.$title\n .'\">'.$this->_xmlEntities($acronym).'</abbr>';\n\n } else {\n $this->doc .= $this->_xmlEntities($acronym);\n }\n }", "function ownerClass()\n\t{\n\t\t$this->m_owner = array('pkowner_id'=>\"\", 'organization_name'=>\"\", 'owner_name'=>\"\", 'owner_address'=>\"\", 'owner_phone_bus'=>\"\", 'owner_phone_res'=>\"\", 'owner_fax'=>\"\", 'email'=>\"\", 'foip'=>\"\", 'owner_type'=>\"\"); \n\t}", "public function getAcronym();", "public function setOwner(\\SetaPDF_Core_Type_Owner $owner) {}", "public function setOwner(\\SetaPDF_Core_Type_Owner $owner) {}", "public function addOwners(): void\n {\n foreach ($this->attributes as $attributeName) {\n $this->linkModelWithOwner($attributeName, $this->owner->{$attributeName});\n }\n }", "private function generateOwnerSchema()\n {\n $owner = $this->generalSettings->get('company_or_person')->value();\n\n if ($owner->value() === 'person') {\n $siteOwner = new Person(\n collect([\n '@id' => $this->site->absoluteUrl() . SchemaIds::PERSON,\n 'name' => $this->generalSettings->get('target_name'),\n 'url' => $this->site->absoluteUrl(),\n 'sameAs' => $this->getSameAs(),\n ])\n );\n } else {\n $siteOwner = new Organization(\n $this->context->get('site'),\n $this->generalSettings\n );\n }\n\n return $siteOwner->generate();\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 $a = 'bark,' . $this->firstname;\n return $a;\n }", "function DOM_find_acronyms () {\r\n\t\t$query = '//' . ReTidy::get_html_namespace() . 'acronym';\r\n\t\t$acronymTags = $this->xpath->query($query);\r\n\r\n\t\tforeach($acronymTags as $acronymTag) {\r\n\t\t\tif($acronymTag->hasAttributes()) {\r\n\t\t\t\tforeach ($acronymTag->attributes as $attribute) {\r\n\t\t\t\t\tif ($attribute->nodeName === \"title\") {\r\n\t\t\t\t\t\t$definition = htmlentities($attribute->nodeValue);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif($acronymTag->hasChildNodes()) {\r\n\t\t\t\tforeach ($acronymTag->childNodes as $child) {\r\n\t\t\t\t\tif ($child->nodeName === \"#text\") {\r\n\t\t\t\t\t\t$acronym = htmlentities($acronymTag->firstChild->nodeValue);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\t// this is a potential acronym so add it to the acronymsarray\r\n\t\t\t$IsADuplicate = false;\r\n\t\t\tforeach($this->acronymsArray as $index => $acronym_tab_definition) {\r\n\t\t\t\t$acronym18 = substr($acronym_tab_definition, 0, strpos($acronym_tab_definition, \"\t\"));\r\n\t\t\t\tif ($acronym18 === $acronym) {\r\n\t\t\t\t\t$IsADuplicate = true;\r\n\t\t\t\t\t// check if this one is better than the existing one?\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif($IsADuplicate != true) {\r\n\t\t\t\t$ToAdd = \"$acronym\t$definition\";\r\n\t\t\t\t$this->acronymsArray[] = $ToAdd;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// now we could look for acronym tables and capitalized words and other things (using DOM \r\n\t\t// to get only nodes that we are interested in).\r\n\t}", "public function GetAcronym() \n {\n return $this->acronym;\n }", "protected function getOwnerName() {\n $owner_name = 'user';\n return $owner_name;\n }", "public function setOwnerNameId($username) {\n $this->_owner = $username;\n }", "public function getOwnerusername() {}", "function the_author_aim()\n {\n }", "function set_owner($owner)\n {\n $this->set_default_property(self :: PROPERTY_OWNER, $owner);\n }", "public function getAuthorname() {}", "protected function setOwner($owner) {\r\n $this->owner = $this->create($owner);\r\n }", "function get_the_author_aim()\n {\n }", "public function getAuthorcompany() {}", "public function getAcronymList() {\n return $this->_get(4);\n }", "public function getAcronymList() {\n return $this->_get(4);\n }", "public function getAcronymList() {\n return $this->_get(4);\n }", "public function getOwner(): string\n {\n return $this->owner;\n }", "public function deleteOwners(): void\n {\n foreach ($this->attributes as $attributeName) {\n $this->removeOwner($this->owner->primaryKey, $this->name, $attributeName);\n }\n }", "public function hasAcronym() {\n return $this->_has(4);\n }", "public function hasAcronym() {\n return $this->_has(4);\n }", "public function hasAcronym() {\n return $this->_has(4);\n }", "public function setOwner($owner)\n {\n parent::setOwner($owner);\n if ($owner) {\n Hacks::addCallbackMethodToInstance(\n $owner,\n 'get'.$this->contentField(),\n function () use ($owner) {\n return $owner->getContentField();\n }\n );\n }\n }", "public function getAcronymList() {\n return $this->_get(3);\n }", "public static function ownerOnly(){\n return TRUE;\n }", "public function getOwner() {}", "public function getOwner() {}", "public function getOwner() {}", "public function getOwner() {}", "final public function addItemOwner() {\n $this->addUserByField('users_id', true);\n }", "public function GetAcronym() {\n\t\t$user = self::GetUserProfile();\n\t\treturn $user['akronym'];\n\t}", "public function hasAcronym() {\n return $this->_has(3);\n }", "protected function _syncAuthor() {}", "public function isOwner()\n {\n return $this->affiliation == self::AFFILIATION_OWNER;\n }", "public function findByOwnerOrderByAcronym(User $user) {\r\n $qb = $this->createQueryBuilder('i');\r\n $qb = $this->qbByOwners($qb, $user);\r\n $qb = $this->qbReachByUser($qb, $user);\r\n $qb = $this->qbOrderByAcronym($qb);\r\n\r\n return $qb->getQuery()->getResult();\r\n }", "function roomify_conversations_add_owner_user_reference_field() {\n field_info_cache_clear();\n\n // \"conversation_owner_user_ref\" field.\n if (field_read_field('conversation_owner_user_ref') === FALSE) {\n $field = array(\n 'field_name' => 'conversation_owner_user_ref',\n 'type' => 'entityreference',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(\n 'target_type' => 'user',\n ),\n );\n field_create_field($field);\n }\n\n // \"conversation_owner_user_ref\" field instance.\n if (field_read_instance('roomify_conversation', 'conversation_owner_user_ref', 'standard') === FALSE) {\n $instance = array(\n 'field_name' => 'conversation_owner_user_ref',\n 'entity_type' => 'roomify_conversation',\n 'label' => 'Owner',\n 'bundle' => 'standard',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'entityreference_autocomplete',\n ),\n );\n field_create_instance($instance);\n }\n}", "public function getOwnerIdentifier();", "final public function getCreatureOwnerName(): string\n {\n return $this->creatureOwner->getName();\n }", "public function action_single_remove_author_box(){\n\t\tif (PostTypeUtil::is_legacy_course_single()){\n\t\t\tThriveThemeUtil::set_option(\"bottom_about_author\", false);\n\t\t}\n\t}", "public function set_owner_id($owner)\n {\n $this->set_default_property(self::PROPERTY_OWNER_ID, $owner);\n }", "public function setOwner($var)\n {\n GPBUtil::checkString($var, True);\n $this->owner = $var;\n\n return $this;\n }", "static public function generateOwnerID($surround = true)\n\t{\n\t\treturn QuickBooks_QWC::ownerID($surround);\n\t}", "public function getOwner()\n {\n return isset($this->owner) ? $this->owner : '';\n }", "function v1_set_owners(&$object) {\n\t\n\t// Global list of general owners\n\tglobal $gen_owners;\n\t\n\t// Loop on owners\n\tforeach ($gen_owners as $owners) {\n\t\tif (!empty($owners)) {\n\t\t\t$object['results']['owners']=$owners;\n\t\t\treturn TRUE;\n\t\t}\n\t}\n\t\n\treturn FALSE;\n}", "protected function getOwnerName() {\n $owner_name = 'site';\n return $owner_name;\n }", "function the_author_nickname()\n {\n }", "abstract protected function getAppOwner(): string;", "public function clearAutotoc()\n {\n unset(self::$tocifiers[$this->owner]);\n }", "protected function get_owner_id()\n {\n return $this->owner_id;\n }", "public function getAuthorName()\n {\n return 'Fightmaster.publication.author.name';\n }", "public function get_author()\n\t{\n\t\treturn '';\n\t}", "public function updateOwners(): void\n {\n foreach ($this->attributes as $attributeName) {\n $this->removeOwner($this->owner->primaryKey, $this->name, $attributeName);\n $this->linkModelWithOwner($attributeName, $this->owner->{$attributeName});\n }\n }", "public function getOwner();", "public function getOwner();", "public function getOwner();", "public function getowner_id()\n {\n return $this->owner_id;\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 }", "function GetAuthor()\n {\n return 'calguy1000';\n }", "function spectra_address_addowner ($owner, $address)\n\t{\n\t\t$prep = $GLOBALS[\"db\"][\"obj\"]->prepare (\"UPDATE `\".$GLOBALS[\"tables\"][\"ledger\"].\"` SET `owner` = ? where `address` = ?\");\n\t\t\n\t\tif (!$prep)\n\t\t{\n\t\t\techo \"Unable To Prepare Statement (\".__FUNCTION__.\": \".__LINE__.\") \".$GLOBALS[\"db\"][\"obj\"]->error;\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$bound = $prep->bind_param (\"ss\", $owner, $address);\n\t\t\n\t\tif (!$bound)\n\t\t{\n\t\t\techo \"Unable To Bind Parameters (\".__FUNCTION__.\": \".__LINE__.\") \".$GLOBALS[\"db\"][\"obj\"]->error;\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$response = $prep->execute ();\n\t\t\n\t\tif ($GLOBALS[\"db\"][\"obj\"]->errno > 0)\n\t\t{\n\t\t\techo \"Unable To Execute Statement (\".__FUNCTION__.\": \".__LINE__.\") \".$GLOBALS[\"db\"][\"obj\"]->error;\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "public static function getAllDepartmentAcronyms()\n {\n\n return DB::table('l_contracts')\n ->select(['owner_acronym'])\n ->orderBy('owner_acronym')\n ->distinct()\n ->pluck('owner_acronym')\n ->toArray();\n }", "public function author();", "public function getOwnerName()\n {\n if (! isset($this->ownerName)) {\n $this->ownerName = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getOwnerNameQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->ownerName;\n }", "function get_author_link($display, $author_id, $author_nicename = '')\n {\n }", "function the_author_yim()\n {\n }", "public function shouldHaveOwnerVisibility()\n {\n $this->makeVisible([\n 'card_brand',\n 'card_last_four',\n 'card_country',\n 'billing_address',\n 'billing_address_line_2',\n 'billing_city',\n 'billing_state',\n 'billing_zip',\n 'billing_country',\n 'extra_billing_information',\n ]);\n }", "function getOwnerIdentifier()\n {\n return $this->ownerIdentifier;\n }", "public function getFullName() {\r\n $authors = $this->getAuthors();\r\n foreach ($authors as $author) {\r\n echo $author->first_name . ' ' . $author->last_name .'<br>';\r\n }\r\n }", "public function getQualifiedOwnerKeyName()\n {\n return $this->related->qualifyColumn($this->ownerKey);\n }", "public function owner(): BelongsTo\n {\n return $this->belongsTo(User::class, 'owner_id');\n }", "function main_acronym($openKeys)\t{\n\t\tglobal $LANG, $BE_USER;\n\n\t\t$content.=$this->doc->startPage(\"RTE acronym\");\n\t\t$RTEtsConfigParts = explode(\":\",t3lib_div::_GP(\"RTEtsConfigParams\"));\n\t\t$RTEsetup = $BE_USER->getTSConfig(\"RTE\",t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));\n\t\t$thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup[\"properties\"],$RTEtsConfigParts[0],$RTEtsConfigParts[2],$RTEtsConfigParts[4]);\n\n\t\t$content.='\n\t<div class=\"title\" id=\"abbrType\">' . $LANG->getLL(\"Acronym\") . '</div>\n\t<fieldset id=\"type\">\n\t\t<legend>' . $LANG->getLL(\"Type_of_abridged_form\") . '</legend>\n\t\t<label for=\"abbreviation\" class=\"checkbox\">' . $LANG->getLL(\"Abbreviation\") . '</label><input type=\"radio\" name=\"type\" id=\"abbreviation\" value=\"abbreviation\" checked=\"checked\" onclick=\"setType();\" />\n\t\t<label for=\"acronym\" class=\"checkbox\">' . $LANG->getLL(\"Acronym\") . '</label><input type=\"radio\" name=\"type\" id=\"acronym\" value=\"acronym\" onclick=\"setType();\" />\n\t</fieldset>\n\t<fieldset id=\"selector\">\n\t\t<legend>' . $LANG->getLL(\"Defined_term\") . '</legend>\n\t\t<label for=\"termSelector\" class=\"fl\" id=\"termSelectorLabel\" title=\"' . $LANG->getLL(\"Select_a_term\") . '\">' . $LANG->getLL(\"Unabridged_term\") . '</label>\n\t\t<select id=\"termSelector\" name=\"termSelector\" title=\"' . $LANG->getLL(\"Select_a_term\") . '\"\n\t\t\tonChange=\"document.acronymForm.acronymSelector.selectedIndex=document.acronymForm.termSelector.selectedIndex; document.acronymForm.title.value=document.acronymForm.termSelector.options[document.acronymForm.termSelector.selectedIndex].value;\">\n\t\t\t<option value=\"\"></option>\n\t\t</select>\n\t\t<label for=\"acronymSelector\" id=\"acronymSelectorLabel\" title=\"' . $LANG->getLL(\"Select_an_acronym\") . '\">' . $LANG->getLL(\"Abridged_term\") . '</label>\n\t\t<select id=\"acronymSelector\" name=\"acronymSelector\" title=\"' . $LANG->getLL(\"Select_an_acronym\") . '\"\n\t\t\tonChange=\"document.acronymForm.termSelector.selectedIndex=document.acronymForm.acronymSelector.selectedIndex; document.acronymForm.title.value=document.acronymForm.termSelector.options[document.acronymForm.termSelector.selectedIndex].value;\">\n\t\t\t<option value=\"\"></option>\n\t\t</select>\n\t</fieldset>\n\t<fieldset>\n\t\t<legend>' . $LANG->getLL(\"Term_to_abridge\") . '</legend>\n\t\t<label for=\"title\" class=\"fl\" title=\"' . $LANG->getLL('Use_this_term_explain') . '\">' . $LANG->getLL('Use_this_term') . '</label>\n\t\t<input type=\"text\" id=\"title\" name=\"title\" size=\"60\" title=\"' . $LANG->getLL('Use_this_term_explain') . '\" />\n\t</fieldset>\n\t<div class=\"buttons\">\n\t\t<button type=\"button\" title=\"' . $LANG->getLL(\"OK\") . '\"onclick=\"return onOK();\">' . $LANG->getLL(\"OK\") . '</button>\n\t\t<button type=\"button\" title=\"' . $LANG->getLL(\"Delete\") . '\" onclick=\"return onDelete();\">' . $LANG->getLL(\"Delete\") . '</button>\n\t\t<button type=\"button\" title=\"' . $LANG->getLL(\"Cancel\") . '\" onclick=\"return onCancel();\">' . $LANG->getLL(\"Cancel\") . '</button>\n\t</div>';\n\t\n\t\t$content.= $this->doc->endPage();\n\t\treturn $content;\n\t}", "function vimport_abonnes_autoriser() {\n}", "public function owner(): BelongsTo\n {\n return $this->belongsTo('PetWatcher\\Models\\User', 'owner');\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 getUOwner()\n {\n return null;\n }", "public function getUOwner()\n {\n return null;\n }", "private function _replaceAcronym( $matches=array() )\n\t{\n\t\treturn $this->_currentAcronym['a_semantic'] ? \"{$matches[1]}<acronym title='{$this->_currentAcronym['a_long']}' class='bbc ipSeoAcronym'>{$matches[2]}</acronym>{$matches[3]}\" : $matches[1] . $this->_currentAcronym['a_long'] . $matches[3];\n\t}", "public function add_owner() {\n $arrPageData['arrSessionData'] = $this->session->userdata;\n $ownerdata = array('owner_name' => trim($this->input->post('owner_name')),\n 'account_id' => $arrPageData['arrSessionData']['objSystemUser']->accountid,\n 'active' => 1,\n 'archive' => 1,\n 'location_id' => $this->input->post('location_id')\n );\n\n foreach ($ownerdata as $key => $value) {\n if ($value == '') {\n unset($ownerdata[$key]);\n }\n }\n\n\n if ($this->checkowner($ownerdata['owner_name'], $ownerdata['account_id']) == 0) {\n $this->db->insert('owner', $ownerdata);\n $id = $this->db->insert_id();\n }\n if ($id) {\n return $id;\n } else {\n return FALSE;\n }\n }", "public function setOwnerId($owner_id)\n {\n $this->owner_id = $owner_id;\n }", "public function setOwnerId($owner_id)\n {\n $this->owner_id = $owner_id;\n }", "function circle_author_biography() {\n\tif ( ! circle_option( 'display_author_bio' ) ) {\n\t\treturn;\n\t}\n\tget_template_part( 'template-parts/biography' );\n}", "public function getOwnerId()\n {\n return $this->owner_id;\n }", "public function getOwnerId()\n {\n return $this->owner_id;\n }", "public function import_owner($ownerdata) {\n\n\n\n foreach ($ownerdata as $key => $value) {\n if ($value == '') {\n unset($ownerdata[$key]);\n }\n }\n\n\n if ($this->checkowner($ownerdata['owner_name'], $ownerdata['account_id']) == 0) {\n $this->db->insert('owner', $ownerdata);\n $id = $this->db->insert_id();\n }\n if ($id) {\n return $id;\n } else {\n return FALSE;\n }\n }", "function v1_get_owners($object, &$error) {\n\n\t// XML functions\n\trequire_once \"php/funcs/xml_funcs.php\";\n\t// DB functions\n\trequire_once \"php/funcs/db_funcs.php\";\n\t// Static list of owners.. to reset owners-array when first called\n\tstatic $owners_list=array();\n\t\n\t// Global list of general owners\n\tglobal $gen_owners, $developer, $user_upload;\n\t\n\t// Prepare result\n\t$owners=array();\n\t$error=array();\n\t\n\t// Array of attributes name\n\t$owner_att_names=array(\"OWNER1\", \"OWNER2\", \"OWNER3\");\n\t\n\t// Get owners\n\tforeach ($owner_att_names as $owner_att_name) {\n\t\t$code=xml_get_att($object, $owner_att_name);\n\t\tif (!empty($code)) {\n\t\t\t$owner=array();\n\t\t\t$owner['code']=$code;\n\t\t\t$found=FALSE;\n\t\t\t// Check if code was already searched before\n\t\t\tforeach ($owners_list as $owner_listed) {\n\t\t\t\tif ($code!=$owner_listed['code']) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Get ID\n\t\t\t\t$id=$owner_listed['id'];\n\t\t\t\t$owner['id']=$id;\n\t\t\t\t$found=TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// If not found in list, query DB\n\t\t\tif (!$found) {\n\t\t\t\t$id=db_get_cc_id($code);\n\t\t\t\tif (empty($id)) {\n\t\t\t\t\t$error['code']=9;\n\t\t\t\t\t$error['message']=\"There is no owner with such code: \\\"\".$code.\"\\\"\";\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t\t$owner['id']=$id;\n\t\t\t\t// Add to list of owners\n\t\t\t\tarray_push($owners_list, $owner);\n\t\t\t}\n\t\t\t// Add to owners array\n\t\t\tarray_push($owners, $owner);\n\t\t}\n\t}\n\n\t// If loader is not a developer, check permission to upload data for these owners\n\tif (!$developer && !empty($owners)) {\n\t\t// Local variables\n\t\t$found=array();\n\t\tforeach ($owners as $owner) {\n\t\t\tarray_push($found, FALSE);\n\t\t}\n\t\t// Loop on array of users who permitted user to upload data for them\n\t\tfor ($i=0; $i<count($user_upload['id']); $i++) {\n\t\t\t// For each owner\n\t\t\tforeach ($owners as $key => $owner) {\n\t\t\t\tif ($user_upload['id'][$i]==$owner) {\n\t\t\t\t\t$found[$key]=TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Check owners were found\n\t\tforeach ($found as $key => $found_owner) {\n\t\t\t// Check boolean\n\t\t\tif (!$found_owner) {\n\t\t\t\t$error['code']=3;\n\t\t\t\t$error['message']=\"You do not have the rights to upload for '\".$owners[$key].\"'. If you wish to be granted this permission, please contact them directly.\";\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// Store owners in list\n\tarray_unshift($gen_owners, $owners);\n\t\n\treturn TRUE;\n}", "function getAuthor() \n\t{\n\t\t$author = array();\n\t\tinclude_once \"./Services/MetaData/classes/class.ilMD.php\";\n\t\t$md =& new ilMD($this->getId(), 0, $this->getType());\n\t\t$md_life =& $md->getLifecycle();\n\t\tif ($md_life)\n\t\t{\n\t\t\t$ids =& $md_life->getContributeIds();\n\t\t\tforeach ($ids as $id)\n\t\t\t{\n\t\t\t\t$md_cont =& $md_life->getContribute($id);\n\t\t\t\tif (strcmp($md_cont->getRole(), \"Author\") == 0)\n\t\t\t\t{\n\t\t\t\t\t$entids =& $md_cont->getEntityIds();\n\t\t\t\t\tforeach ($entids as $entid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$md_ent =& $md_cont->getEntity($entid);\n\t\t\t\t\t\tarray_push($author, $md_ent->getEntity());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn join($author, \",\");\n }", "function GetAuthor()\n {\n return 'texus';\n }", "public function owner($owner = self::PARAM_OWNER_ME, $ownerId = \"\"): XyzSpace\n {\n if ($owner === self::PARAM_OWNER_ID) {\n $this->paramOwner = $owner;\n $this->paramOwnerId = $ownerId;\n } else {\n $this->paramOwner = $owner;\n $this->paramOwnerId = \"\";\n }\n return $this;\n }", "public function getAuthor() {}", "public function attach($owner)\n\t{\n\t\tparent::attach($owner);\n\n\t\t$metadata = $this->owner->getMetadata();\n\n\t\t// Add many-many relation\n\t\t$metadata->addRelation($this->xrefRelationName, array(\n\t\t\tCActiveRecord::MANY_MANY,\n\t\t\t$this->xrefClass,\n\t\t\t$this->modelClass.'('.$this->ownerFkName.','.$this->indexFkName.')',\n\t\t));\n\t}", "protected function getOwnerNameQuery()\n {\n return $this->ownerNameQuery;\n }", "public function getOwnerTermFilter()\n {\n $ownerTermFilter = new \\Elastica\\Filter\\Term();\n $ownerTermFilter->setTerm('doc_owner', $GLOBALS['current_user']->id);\n\n return $ownerTermFilter;\n }", "public function owner(){\n return $this->belongsTo('App\\Models\\User', 'owner_id');\n }", "function print_author_tag() {\n\t\t\n\t\techo \"<meta name='author' content='{$this->options->site_author}' />\\r\\n\";\n\t}" ]
[ "0.5888614", "0.5743649", "0.5540859", "0.5528757", "0.5528757", "0.5527869", "0.5469167", "0.541511", "0.541511", "0.5410004", "0.5390602", "0.5388397", "0.53863543", "0.5385558", "0.5379496", "0.53761625", "0.533497", "0.533177", "0.5268252", "0.5260099", "0.52296096", "0.5229093", "0.5229093", "0.5229093", "0.52260834", "0.5225924", "0.5219483", "0.5219483", "0.5219483", "0.5205588", "0.519739", "0.518394", "0.5170337", "0.5170337", "0.5170337", "0.5168812", "0.51567286", "0.5156656", "0.5149593", "0.5142387", "0.5141793", "0.51328844", "0.5114636", "0.5105843", "0.50586706", "0.5054516", "0.5048328", "0.50354075", "0.50311816", "0.5028915", "0.5025915", "0.5023577", "0.50047433", "0.5001284", "0.49973503", "0.4993212", "0.49897748", "0.49705708", "0.49493545", "0.4948855", "0.4948855", "0.4948855", "0.494621", "0.4939263", "0.4934197", "0.4927273", "0.4924175", "0.4913398", "0.49106935", "0.49005395", "0.48948327", "0.48868755", "0.4884118", "0.4868605", "0.48655885", "0.48653612", "0.48607925", "0.4860038", "0.48532492", "0.48455822", "0.48455822", "0.48408604", "0.48408604", "0.48383924", "0.48380235", "0.48296538", "0.48296538", "0.48184824", "0.48181227", "0.48181227", "0.48124513", "0.4812011", "0.4799882", "0.47970918", "0.47916612", "0.47876257", "0.47830313", "0.4774045", "0.47660926", "0.47636202", "0.47503832" ]
0.0
-1
For all modes, limit to the same department owner_acronym
public static function findAmendmentEntries($rowData) { $totalAmendments = 0; // mode 1: same gen_vendor_normalized, same reference_number, different contract_value $amendmentRows = DB::table('l_contracts') ->where('owner_acronym', '=', $rowData['owner_acronym']) // Ensure it's not the exact same row: ->where('id', '!=', $rowData['id']) // Make sure it's not a duplicate entry ->where('gen_is_duplicate', '=', 0) // Make sure it's not an error row ->where('gen_is_error', '=', 0) // Make sure it isn't part of a different amendment group (TODO - review this) ->whereNull('gen_amendment_group_id') ->whereNotNull('source_fiscal') // Make sure it's the same vendor: ->where('gen_vendor_normalized', '=', $rowData['gen_vendor_normalized']) // This is a bit of a complicated combination, but the resulting SQL is, // and ("reference_number" = ? or ("original_value" = ? and "gen_start_year" = ?)) // Because of threshold limits (sole source, NAFTA, etc.), we wouldn't want to just match original and contract values without also matching start years (in case completely different contracts have the same values). ->where(function ($query) use ($rowData) { return $query->where('reference_number', '=', $rowData['reference_number']) ->orWhere(function ($query) use ($rowData) { return $query->where('original_value', '=', $rowData['contract_value']) ->where('gen_start_year', '=', $rowData['gen_start_year']); }); }) ->orderBy('source_fiscal', 'asc') ->orderBy('contract_value', 'asc') // ->orderBy('id', 'asc') // ->toSql(); ->pluck('id'); if ($amendmentRows->count() > 0) { // Just 1 row is enough (since it'll be different than the original row) // Add back in the original ID (sorted by source_fiscal then ID in the earlier query in findAmendments) $amendmentRows->prepend($rowData['id']); $totalAmendments += self::markAmendmentEntries($rowData['owner_acronym'], $amendmentRows, 1); } return $totalAmendments; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _applyEditableParam()\n {\n if ($this->editable) {\n // Limit the query to only the global sets the user has permission to edit\n $editableSetIds = Craft::$app->getGlobals()->getEditableSetIds();\n $this->subQuery->andWhere(['elements.id' => $editableSetIds]);\n }\n }", "private function _applyEditableParam()\n {\n if ($this->editable) {\n // Limit the query to only the global sets the user has permission to edit\n $editableSetIds = Craft::$app->getGlobals()->getEditableSetIds();\n $this->subQuery->andWhere(['elements.id' => $editableSetIds]);\n }\n }", "public static function getAllDepartmentAcronyms()\n {\n\n return DB::table('l_contracts')\n ->select(['owner_acronym'])\n ->orderBy('owner_acronym')\n ->distinct()\n ->pluck('owner_acronym')\n ->toArray();\n }", "public function setOwner(\\SetaPDF_Core_Type_Owner $owner) {}", "public function setOwner(\\SetaPDF_Core_Type_Owner $owner) {}", "public function restrictByAssociatedManagerId()\n {\n\n if (CommentAssignmentRepository::$availableAssociatedManagerId) {\n $this->where(\n ConfigService::$tableCommentsAssignment . '.user_id',\n CommentAssignmentRepository::$availableAssociatedManagerId\n );\n }\n\n return $this;\n }", "function companyadmin($tab = 0) {\n $this->auth(COMP_ADM_LEVEL); \n $company_id = $this->session->userdata('administer_company_id');\n if($this->session->userdata('role_level') > SUPPORT_ADM_LEVEL && $company_id != ''){\n $data = $this->_getCompanyDataByCompanyId($company_id);\n } else {\n $user_id = $this->session->userdata('user_id');\n $data = $this->_getCompanyDataByUserId($user_id);\n }\n $data['title'] = 'Company admin page';\n $data['tab'] = $tab;\n $this->load->view('include/v_header', $data);\n $this->load->view('admin/company_admin/v_main');\n $this->load->view('include/v_footer');\n }", "public function getFkOrcamentoOrganogramaNiveis()\n {\n return $this->fkOrcamentoOrganogramaNiveis;\n }", "public function viewableByOwnerOnly();", "function applyFilters($q, $au, $roo)\n {\n \n $tn = $this->tableName();\n $this->selectAdd(\"i18n_translate('c' , {$tn}.country, 'en') as country_display_name \");\n \n $tn = $this->tableName();\n //DB_DataObject::debugLevel(1);\n $x = DB_DataObject::factory('core_company');\n $x->comptype= 'OWNER';\n $x->find(true);\n\n if (!empty($q['query']['company_project_id'])) {\n $add = '';\n if (!empty($q['query']['company_include_self'])) {\n $add = \" OR {$tn}.id = {$x->id}\";\n }\n if (!empty($q['query']['company_not_self'])) {\n $add = \" AND {$tn}.id != {$x->id}\";\n }\n \n $pids = array();\n $pid = $q['query']['company_project_id'];\n if (strpos($pid, ',')) {\n $bits = explode(',', $pid);\n foreach($bits as $b) {\n $pids[] = (int)$b;\n }\n } else {\n $pids = array($pid);\n }\n \n \n $pids = implode(',', $pids);\n $this->whereAdd(\"{$tn}.id IN (\n SELECT distinct(company_id) FROM ProjectDirectory where project_id IN ($pids)\n ) $add\" );\n \n }\n if (!empty($q['query']['comptype'])) {\n \n $this->whereAddIn($tn.'.comptype', explode(',', $q['query']['comptype']), 'string');\n \n }\n \n // depricated - should be moved to module specific (texon afair)\n \n if (!empty($q['query']['province'])) {\n $prov = $this->escape($q['query']['province']);\n $this->whereAdd(\"province LIKE '$prov%'\");\n \n \n }\n // ADD comptype_display name.. = for combos..\n $this->selectAdd(\"\n (SELECT display_name\n FROM\n core_enum\n WHERE\n etype='comptype'\n AND\n name={$tn}.comptype\n LIMIT 1\n ) as comptype_display_name\n \");\n \n if(!empty($q['query']['name']) || !empty($q['search']['name'])){\n \n $s = (!empty($q['query']['name'])) ? $this->escape($q['query']['name']) : $this->escape($q['search']['name']);\n \n $this->whereAdd(\"\n {$tn}.name LIKE '%$s%'\n \");\n }\n \n if(!empty($q['query']['name_starts']) || !empty($q['search']['name_starts'])){\n \n $s = (!empty($q['query']['name_starts'])) ? $this->escape($q['query']['name_starts']) : $this->escape($q['search']['name_starts']);\n \n $this->whereAdd(\"\n {$tn}.name LIKE '$s%'\n \");\n }\n }", "public function limitScopesToGrants($limit = false)\n {\n $this->limitScopesToGrants = $limit;\n }", "private function setAccommodations()\n {\n // Localise stuff\n $con = $this->con;\n $ownerId = $this->id;\n\n // Get the accom id from db and create new accom objects\n $stmt = $con->prepare(\"SELECT \" . Accommodation::ID_COLUMN . \" FROM \" . Accommodation::TABLE_NAME . \" WHERE \" . Accommodation::FOREIGN_KEY_COLUMN . \" = $ownerId \");\n try\n {\n if(!$stmt->execute())\n {\n throw new Exception(\"Error getting accommodations for owner $ownerId\", 1);\n }\n $stmt->bindColumn(1, $accId);\n $accommodations = array();\n // Loop through every accommodation\n while($stmt->fetch())\n {\n $acc = new Accommodation($con, 'get', array('id' => $accId));\n if($acc->getError())\n {\n $this->errorMsg .= \" Error with accommodation $accId: \" . $acc->getError();\n continue;\n }\n array_push($accommodations, $acc);\n }\n // Set accom\n $this->accommodations = $accommodations;\n }// try\n catch(Exception $e)\n {\n $this->errorMsg = $e->getMessage();\n }\n }", "protected function doEdicaoPeridoAcesso() {\r\n\t\t$editar = intval($this->system->input['editar']);\r\n\t\tif ($editar) {\t\t\t\r\n\t\t\t$erro_msg = $this->validarPeriodoAcesso();\r\n\t\t\t\r\n\t\t\tif ($erro_msg) {\r\n\t\t\t\t$this->system->view->assign('msg_alert', $erro_msg['msg']);\r\n\t\t\t\t$this->system->view->assign('periodo', $this->system->input);\r\n\t\t\t}else{\r\n\t\t\t\t$this->system->configuracoesgerais->atualizarPeriodoAcesso($this->system->input);\r\n\t\t\t\t$this->system->view->assign('msg_alert', 'Período de Acesso atualizado com sucesso!');\t\t\t\t\r\n\t\t\t\t$this->system->view->assign('periodo', $this->system->input);\r\n\t\t\t}\r\n\t\t} \t\t\r\n\t\t$this->system->view->assign('periodo',$this->system->configuracoesgerais->getPeriodoAcesso());\r\n\t\t\r\n\t\t$this->system->admin->topo(13);\r\n\t\t$this->system->view->display('administrador-geral/configuracoes_perido_acesso.tpl');\r\n\t\t$this->system->admin->rodape();\t\t\r\n\t}", "public function set_restriction_mode( $mode ) {\n\n\t\tif ( array_key_exists( $mode, $this->get_restriction_modes() ) ) {\n\n\t\t\tupdate_option( $this->restriction_mode_option, $mode );\n\n\t\t\t$this->restriction_mode = $mode;\n\t\t}\n\t}", "public function hasEditorACL(){\r\n\t\t$validACLEditPages = array(\r\n\t\t\t'training_title_option_all' => 'training_title_option_all',\r\n\t\t\t'training-category' => 'acl_editor_training_category',\r\n\t\t\t'training-assign-title' => 'acl_editor_training_category',\r\n\t\t\t'people-qual' => 'acl_editor_people_qualifications',\r\n\t\t\t'people-responsibility' => 'acl_editor_people_responsibility',\r\n\t\t\t'people-types' => 'acl_editor_people_trainer',\r\n\t\t\t'people-title' => 'acl_editor_people_titles',\r\n\t\t\t'people-skills' => 'acl_editor_people_trainer_skills',\r\n\t\t\t'people-languages' => 'acl_editor_people_languages',\r\n\t\t\t'people-affiliations' => 'acl_editor_people_affiliations',\r\n\t\t\t'people-suffix' => 'acl_editor_people_suffix',\r\n\t\t\t'people-active' => 'acl_editor_people_active_trainer',\r\n\t\t\t'training-organizer' => 'acl_editor_training_organizer',\r\n\t\t\t'training-topic' => 'acl_editor_training_topic',\r\n\t\t\t'training-level' => 'acl_editor_training_level',\r\n\t\t\t'training-pepfar' => 'acl_editor_pepfar_category',\r\n\t\t\t'training-refreshercourse' => 'acl_editor_refresher_course',\r\n\t\t\t'training-funding' => 'acl_editor_funding',\r\n\t\t\t'training-recommend' => 'acl_editor_recommended_topic',\r\n\t\t\t'training-gotcurriculum' => 'acl_editor_nationalcurriculum',\r\n\t\t\t'training-method' => 'acl_editor_method',\r\n\t\t\t'training-viewing-location' => 'acl_admin_training',\r\n\t\t\t'training-budget-code' => 'acl_admin_training',\r\n\t\t\t'facilities-types' => 'acl_editor_facility_types',\r\n\t\t\t'facilities-sponsors' => 'acl_editor_facility_sponsors',\r\n\t\t\t'preservice-classes' => 'acl_editor_ps_classes',\r\n\t\t\t'preservice-cadres' => 'acl_editor_ps_cadres',\r\n\t\t\t'preservice-degrees' => 'acl_editor_ps_degrees',\r\n\t\t\t'preservice-funding' => 'acl_editor_ps_funding',\r\n\t\t\t'preservice-institutiontypes' => 'acl_editor_ps_institutions',\r\n\t\t\t'preservice-languages' => 'acl_editor_ps_languages',\r\n\t\t\t'preservice-nationalities' => 'acl_editor_ps_nationalities',\r\n\t\t\t'preservice-joindropreasons' => 'acl_editor_ps_joindropreasons',\r\n\t\t\t'preservice-sponsors' => 'acl_editor_ps_sponsors',\r\n\t\t\t'preservice-tutortypes' => 'acl_editor_ps_tutortypes',\r\n\t\t\t'preservice-coursetypes' => 'acl_editor_ps_coursetypes',\r\n\t\t\t'preservice-religion' => 'acl_editor_ps_religions',\r\n\t\t\t'preservice-prior-education' => 'acl_editor_ps_classes',\r\n\t\t\t'users-add' => 'add_edit_users',\r\n\t\t\t'training-settings' => 'acl_admin_training',\r\n\t\t\t'people-settings' => 'acl_admin_people',\r\n\t\t\t'facilities-settings' => 'acl_admin_facilities',\r\n\t\t\t'people-new' => 'facility_and_person_approver',\r\n\t\t\t'facilities-new-facilities' => 'facility_and_person_approver',\r\n\t\t\t'employee-category' => 'employees_module',\r\n\t\t\t'employee-role' => 'employees_module',\r\n\t\t\t'employee-transition' => 'employees_module',\r\n\t\t\t'employee-relationship' => 'employees_module',\r\n\t\t\t'employee-referral' => 'employees_module',\r\n\t\t\t'employee-training-provided' => 'employees_module',\r\n\t\t 'employee-dsdmodel' => 'acl_editor_employee_dsdmodel',//TA:#416\r\n\t\t 'employee-dsdteam' => 'acl_editor_employee_dsdteam',//TA:#416\r\n\t\t\t'tutorspecialty' => 'acl_editor_tutor_specialty', //TA: added 7/22/2014\r\n\t\t\t'tutorcontract' => 'acl_editor_tutor_contract', //TA: added 7/24/2014\r\n\t\t\t'commodityname' => 'acl_editor_commodityname', //TA:17: added 9/19/2014\r\n\t\t\t'commoditytype' => 'acl_editor_commoditytype', //TA:17:12: added 10/03/2014\r\n\t\t);\r\n\r\n\r\n\t\treturn $this->hasACL($validACLEditPages[$this->getRequest()->action]);\r\n\t}", "public static function ownerOnly(){\n return TRUE;\n }", "function ownerClass()\n\t{\n\t\t$this->m_owner = array('pkowner_id'=>\"\", 'organization_name'=>\"\", 'owner_name'=>\"\", 'owner_address'=>\"\", 'owner_phone_bus'=>\"\", 'owner_phone_res'=>\"\", 'owner_fax'=>\"\", 'email'=>\"\", 'foip'=>\"\", 'owner_type'=>\"\"); \n\t}", "public function setOwner($owner)\n {\n parent::setOwner($owner);\n if ($owner) {\n Hacks::addCallbackMethodToInstance(\n $owner,\n 'get'.$this->contentField(),\n function () use ($owner) {\n return $owner->getContentField();\n }\n );\n }\n }", "public function set_owner_id($owner)\n {\n $this->set_default_property(self::PROPERTY_OWNER_ID, $owner);\n }", "public function edit(Owner $owner)\n {\n //\n }", "protected function setOrganization() {}", "public function getFkOrganogramaNiveis()\n {\n return $this->fkOrganogramaNiveis;\n }", "function droit_ajout_agenda_ressource()\r\n{\r\n\tif($_SESSION[\"espace\"][\"droit_acces\"]==2 || ($_SESSION[\"user\"][\"id_utilisateur\"]>0 && option_module(\"ajout_agenda_ressource_admin\")!=true))\r\n\t\treturn true;\r\n}", "public function defaultScope()\n { \n \t// Dont do the scope check for logging in and for admin pages \n \t// **ATTENTION: This will need to be changed in the future\n\n \t// admin page can only show tutor\n \tif ('admin' == Yii::app()->controller->getAction()->getId())\n\t return array( \n\t 'condition'=>'(type=\"tutor\")', \n\t ); \n\n\n\t\tif (null == Yii::app()->user->id) \n\t\t\treturn array();\n\t\telse if ('view' == Yii::app()->controller->getAction()->getId())\n\t\t\treturn array();\n\t\telse \n\t return array( \n\t 'condition'=>'(id='.Yii::app()->user->id.')', \n\t ); \n\n }", "public function get_projects_by_owner ($project_owner_id)\n {\n\n }", "static function lookupOwner()\n {\n static $cache = false;\n if ($cache !== false) {\n return clone($cache); // no updating this object..\n }\n \n $enum = DB_DataObject::Factory('core_enum')->lookup('COMPTYPE', 'OWNER' );\n $companies = DB_DataObject::factory('core_company');\n $companies->comptype_id = $enum;\n if ($companies->find(true)) {\n $cache = clone($companies);\n return $companies;\n }\n return false;\n }", "public function edit_owner($editOwner) {\n\n if (isset($editOwner)) {\n $data = array(\n 'owner_name' => $editOwner['ownername'],\n 'location_id' => $editOwner['location_id']\n );\n $this->db->where('id', $editOwner['adminuser_id']);\n $this->db->update('owner', $data);\n\n return TRUE;\n } else {\n return False;\n }\n }", "public function isModeOwner()\n {\n return $this->isModeOwner;\n }", "public function getOwnerTermFilter()\n {\n $ownerTermFilter = new \\Elastica\\Filter\\Term();\n $ownerTermFilter->setTerm('doc_owner', $GLOBALS['current_user']->id);\n\n return $ownerTermFilter;\n }", "public function refreshAllowedOrganizations()\n {\n // Privilege overrules organizational settings\n if ($this->hasPrivilege('pr.organization-switch')) {\n $orgs = $this->util->getDbLookup()->getOrganizations();\n } else {\n $org = $this->getBaseOrganization();\n\n $orgs = array($org->getId() => $org->getName()) +\n $org->getAllowedOrganizations();\n }\n // \\MUtil_Echo::track($orgs);\n\n $this->_setVar('__allowedOrgs', $orgs);\n\n // Clean this cache\n $this->_unsetVar('__allowedRespOrgs');\n\n return $this;\n }", "public function onDepartment(){\n\t\t\t$sql = \"SELECT * FROM `department` WHERE `status` = 'ON' ORDER BY `id` ASC \";\n\t\t\t$query = $this->execute($sql);\n\t\t\tif($query){\n\t\t\t\treturn $query;\n\t\t\t}\n\t\t}", "public function setOwner($owner) {\n\t\t$this->owner = $owner;\n\t}", "public function setOwner($owner) {\n\t\t$this->owner = $owner;\n\t}", "function set_owner($owner)\n {\n $this->set_default_property(self :: PROPERTY_OWNER, $owner);\n }", "protected function beforeFind()\n {\n $uc = false;\n \n //get defined user positions in companies\n $sql = \" \n SELECT DISTINCT \n cucp_id \n FROM\n AuthItem ai \n INNER JOIN cucp_user_company_position \n ON ai.name = cucp_role \n INNER JOIN AuthAssignment aa \n ON ai.name = aa.itemname \n WHERE aa.userid = \".Yii::app()->user->id.\" \n \";\n $user_def_company_positions = Yii::app()->db->createCommand($sql)->queryAll();\n \n $criteria = false;\n if($user_def_company_positions){\n \n $udcp = array();\n foreach($user_def_company_positions as $v){\n $udcp[] = $v['cucp_id'];\n }\n //get companies, where is user positions\n $sql = \" \n SELECT DISTINCT \n ccuc_ccmp_id \n FROM\n ccuc_user_company \n WHERE ccuc_cucp_id in (\".implode(',',$udcp).\") \n AND ccuc_person_id = \".Yii::app()->getModule('user')->user()->profile->person_id.\" \n AND ccuc_status = '\".CcucUserCompany::CCUC_STATUS_PERSON.\"'\n \";\n $user_companies = Yii::app()->db->createCommand($sql)->queryAll(); \n\n //add to criteria user companies\n $uc = array();\n $uc[] = 0; //for avoiding error if empty user company list\n foreach($user_companies as $v){\n $uc[] = $v['ccuc_ccmp_id'];\n } \n\n }\n \n if(Yii::app()->getModule('d2company')->access){\n \n $user_roles = Authassignment::model()->getUserRoles(Yii::app()->user->id);\n foreach(Yii::app()->getModule('d2company')->access as $access){\n \n //validate roles\n $intersect = array_intersect($user_roles,$access['roles']);\n if(empty($intersect)){\n continue;\n } \n \n //get group companies\n $sql = \" \n SELECT \n ccxg_ccmp_id \n FROM \n ccxg_company_x_group \n WHERE \n ccxg_ccgr_id IN (\".implode(',',$access['ccgr_id']).\")\";\n \n $ccmp_id_list = Yii::app()->db->createCommand($sql)->queryAll(); \n if(!empty($ccmp_id_list)){\n if($uc === false){\n $uc = array();\n $uc[] = 0; //for avoiding error if empty user company list\n } \n foreach($ccmp_id_list as $row){\n $uc[] = $row['ccxg_ccmp_id'];\n }\n }\n }\n \n \n }\n \n if($uc !== false){\n if(!$criteria){\n $criteria = new CDbCriteria;\n } \n $criteria->compare('ccmp_id', $uc);\n }\n \n //filter by syscomapny\n \n if( Yii::app()->hasComponent('sysCompany') && Yii::app()->sysCompany->getActiveCompany()){\n if(!$criteria){\n $criteria = new CDbCriteria;\n }\n $criteria->compare('ccmp_sys_ccmp_id', Yii::app()->sysCompany->getActiveCompany());\n }\n \n if($criteria){\n $this->dbCriteria->mergeWith($criteria);\n }\n \n parent::beforeFind();\n }", "public function getFkOrganogramaDeParaOrgoes()\n {\n return $this->fkOrganogramaDeParaOrgoes;\n }", "function isOwner() {\n if($this->is_owner === null) {\n $company = $this->getCompany();\n $this->is_owner = instance_of($company, 'Company') ? $company->getIsOwner() : false;\n } // if\n return $this->is_owner;\n }", "public function findByOwner($owner);", "protected function restrictForum(){\n\t\t$this->validateForumId();\n \t\t\n \t\t$close = $this->getOption('close');\n \t\t\n \t\tif ($this->isError()) return;\n \t\t\n \t\t$id = $this->getId();\n \t\t\n \t\t$this->setRestricted($id,$close,$this->isDebug());\n\t}", "function parse_instance_owner($actual_owner)\n\t\t{\n\t\t\t//inside the select\n\t\t\t$this->t->set_block('run_activity', 'block_owner_options', 'owner_options');\t\t\t\n\t\t\t//the select\n\t\t\t$this->t->set_block('run_activity', 'block_select_owner', 'wf_select_owner');\n\t\t\t// the whole area\n\t\t\t$this->t->set_block('run_activity', 'block_set_owner_zone', 'set_owner_zone');\n\t\t\tif ( \t(!$this->conf['use_automatic_parsing']) \n\t\t\t\t|| ( empty($this->display_owner) || (!($this->display_owner)) ))\n\t\t\t{\n\t\t\t\t//hide the instance owner zone\n\t\t\t\t$this->t->set_var(array( 'set_owner_zone' => ''));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// a little label before the select box\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->t->set_var(array('set_owner_text' => lang('Owner:')));\n\t\t\t\tif ((!(is_array($this->display_owner))) && ($this->display_owner==1))\n\t\t\t\t{\n\t\t\t\t\t//we will just display the owner\n\t\t\t\t\t$this->t->set_var(array('wf_select_owner' => $this->owner_name));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t//we will display a select\n\n\t\t\t\t\t//prepare retrieval of datas\n\t\t\t\t\t$subset=Array();\n\t\t\t\t\tif (is_array($this->display_owner))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($this->display_owner as $key => $value)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($key=='role')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!(is_array($value)))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$value = explode(';',$value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$subset[wf_role_name]= $value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif ($key=='activity')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!(is_array($value)))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$value = explode(';',$value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$subset[wf_activity_name]= $value;\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//we'll ask the role_manager for it\n\t\t\t\t\t$role_manager =& CreateObject('workflow.workflow_rolemanager');\n\t\t\t\t\t// we expand groups to real users and want users mapped for a subset of the process\n\t\t\t\t\t// which is given by a user defined value\n\t\t\t\t\t$authorized_users = $role_manager->list_mapped_users($this->process_id, true, $subset );\n\t\t\t\t\t//first line of the select\n\t\t\t\t\t$this->t->set_var(array(\n\t\t\t\t\t\t'selected_owner_options_default'=> (!!$actual_owner)? 'selected=\"selected\"' :'',\n\t\t\t\t\t\t'lang_default_owner'\t=> lang('Default owner'),\n\t\t\t\t\t));\n\t\t\t\t\t//other lines\n\t\t\t\t\tforeach ($authorized_users as $user_id => $user_name)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->t->set_var(array(\n\t\t\t\t\t\t\t'owner_option_id'\t\t=> $user_id,\n\t\t\t\t\t\t\t'owner_option_value'\t\t=> $user_name,\n\t\t\t\t\t\t\t'selected_owner_options'\t=> ($user_id == $actual_owner)? 'selected=\"selected\"' :'',\n\t\t\t\t\t\t));\n\t\t\t\t\t\t//show the select line\n\t\t\t\t\t\t$this->t->parse('owner_options','block_owner_options',true);\n\t\t\t\t\t}\n\t\t\t\t\t//show the select\n\t\t\t\t\t$this->t->parse('wf_select_owner','block_select_owner',true);\n\t\t\t\t}\n\t\t\t\t//show the set owner zone\n\t\t\t\t$this->t->parse('set_owner_zone', 'block_set_owner_zone', true);\n\t\t\t}\n\t\t}", "function is_contest_modifiable($cid) {\n if (is_admins())\n return true;\n if (is_manager()) {\n // This is a manager. \n $contest = new ContestsTbl($cid);\n if (!$contest->Get())\n return false;\n if (!$contest->detail['avail'])\n return false;\n $perm = $contest->detail['perm'];\n if ($perm == \"user\" || $perm == 'manager' || $perm == 'temp') {\n global $login_uid;\n return ($contest->detail['owner'] == $login_uid);\n }\n }\n return false;\n}", "function token_ensure_owner( $p_token_id, $p_owner_id ) {\r\n\t\t$c_token_id = db_prepare_int( $p_token_id );\r\n\t\t$t_tokens_table\t= config_get( 'mantis_tokens_table' );\r\n\r\n\t\t$query = \"SELECT owner\r\n\t\t\t\t \tFROM $t_tokens_table\r\n\t\t\t\t \tWHERE id='$c_token_id'\";\r\n\t\t$result = db_query( $query );\r\n\r\n\t\tif( db_result( $result ) != $p_owner_id ) {\r\n\t\t\ttrigger_error( ERROR_GENERIC, ERROR );\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "public function obtenerOrganizador(){\n $sql = \"SELECT uid_agrupamiento FROM \". TABLE_AGRUPAMIENTO .\" WHERE organizador = 1 AND uid_empresa = \". $this->getUID();\n $uid = $this->db->query($sql, 0, 0);\n $uid = ( true === is_countable($uid) && count($uid)>1 ) ? reset($uid) : $uid;\n if( is_numeric($uid) ){\n return new agrupamiento($uid);\n }\n return false;\n }", "public function constrainOnly($flag);", "public function relatorio4(){\n $this->isAdmin();\n }", "function get_department(){\n $this->_db2->where(\"DeleteFlag\",\"A\");\n return $this->_db2->get($this->_tblorg);\n }", "public function use_aplicaciones_usuario(){\n return $this->ci->arixkernel->select_all_content_where('app, controller','config.v_cuenta_app_rol',array('cuenta_id' => $this->ci->session->userdata('usuario'), 'rol_id !='=>4));// rol_id=4 => sin permiso\n }", "public function edit(FangOwner $fangOwner)\n {\n\n }", "public function activeRestrictions()\n\t{\n\t\t$return = array();\n\t\t\n\t\tif ( !$this->member->group['gbw_disable_tagging'] and $this->member->members_bitoptions['bw_disable_tagging'] )\n\t\t{\n\t\t\t$return[] = 'restriction_no_tagging';\n\t\t}\n\t\tif ( !$this->member->group['bw_disable_prefixes'] and $this->member->members_bitoptions['bw_disable_prefixes'] )\n\t\t{\n\t\t\t$return[] = 'restriction_no_prefixes';\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "protected function SQO_forDeptPage_active($idDept) {\n\t$oq = $this->ItemInfoQuery()->SQO_forSale();\n\t//$sroTitle = new fcSQL_TableSource($this->Name(),'t');\n\t$sroTitle = $this->SQO_Source('t');\n\t$sroItOpt = new fcSQL_TableSource('cat_ioptns','io');\n\t$oq->Select()->Source()->AddElements(\n\t array(\n\t new fcSQL_JoinElement($sroTitle,'i.ID_Title=t.ID'),\n\t new fcSQL_JoinElement($sroItOpt,'i.ID_ItOpt=io.ID','LEFT JOIN'),\n\t )\n\t );\n\t$qof = $oq->Select()->Fields();\n\t$qof->ClearFields();\n\t$qof->SetFields($this->Fields_active_forCompile_array());\n\t$oq->Terms()->UseTerm(new fcSQLt_Group(array('i.ID_Title')));\n\t\n\t$oq->Terms()->Filters()->AddCond('ID_Dept='.$idDept);\n\t\t\n\treturn $oq;\n }", "protected function get_owner_id()\n {\n return $this->owner_id;\n }", "public function scopeOwnedBy($query, $ownerId)\n {\n return $query->whereHas('coordinators', function ($q) use ($ownerId) {\n $q->where('user_id', $ownerId);\n });\n }", "public function setEditOnlyMode($value);", "public function getowner_id()\n {\n return $this->owner_id;\n }", "public function owner($owner = self::PARAM_OWNER_ME, $ownerId = \"\"): XyzSpace\n {\n if ($owner === self::PARAM_OWNER_ID) {\n $this->paramOwner = $owner;\n $this->paramOwnerId = $ownerId;\n } else {\n $this->paramOwner = $owner;\n $this->paramOwnerId = \"\";\n }\n return $this;\n }", "public function getAllowSpecific();", "public function getObjectScopeAllowableValues()\r\n {\r\n return [\r\n self::OBJECT_SCOPE_ALL,\r\n self::OBJECT_SCOPE_DATABASE,\r\n self::OBJECT_SCOPE_TABLE,\r\n ];\r\n }", "public function aim_list_mode($mode)\r\n\t{\r\n switch($mode) {\r\n case LIST_PERMIT_ALL:\r\n case LIST_DENY_ALL:\r\n case LIST_PERMIT_SOME:\r\n case LIST_DENY_SOME:\r\n case LIST_ALLOW_BUDDYLIST:\r\n case LIST_BLOCK_AIM:\r\n $this->core->aim_send_raw('toc2_set_pdmode ' . $mode);\r\n break;\r\n default:\r\n $this->core->aim_debug(sprintf('Supplied mode \"\\%s\" to \"%s\" is not a valid buddylist mode', $mode, __FUNCTION__), AIM_WARN);\r\n break;\r\n }\r\n\t}", "public function ownerOthers(): XyzSpace\n {\n return $this->owner(self::PARAM_OWNER_OTHERS);\n }", "public function setDelimitador($delimitador)\n {\n\n if ($delimitador != null && $delimitador != \"auto\") {\n $this->delimitador = $delimitador;\n }\n return $this;\n }", "public function disableDefaultScope() {\n $this->_disabled = true;\n return $this->Owner;\n }", "public function accesiblePara( $usuarioActivo ){\n return $usuarioActivo->accesoElemento( $this );\n }", "public static function ADMIN_AREA_CHECK_AREA_KEEP(){\n\t $SQL_String = \"SELECT ano FROM area_main WHERE area_code=:area_code AND _keep=1\";\n\t return $SQL_String;\n\t}", "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}", "function _partnership_allowed_department_nums() {\n\n return array(\n '100',\n '110',\n '106',\n '131',\n '119',\n '166',\n '114',\n '151'\n );\n}", "public function getComunidadAutonoma()\n {\n return $this->comunidadAutonoma;\n }", "protected function getOwnerName() {\n $owner_name = 'environment';\n return $owner_name;\n }", "function restrict_manage_posts() {\n\t\tglobal $post;\n\t\tif ( 'location' != get_query_var( 'post_type' ) )\n\t\t\treturn;\n\t\t$post_parent = isset( $_GET['post_parent'] ) ? $_GET['post_parent'] : '';\n\t\techo wp_dropdown_pages( array(\n\t\t\t'echo' => 0,\n\t\t\t'name' => 'post_parent',\n\t\t\t'post_type' => 'locationregion',\n\t\t\t'selected' => $post_parent,\n\t\t\t'show_option_none' => __( 'View all locations', 'loc' ),\n\t\t\t'option_none_value' => ''\n\t\t) );\n\t}", "public function getDeptBased()\n { \n $curr_usr = $this->username;\n\n $this->db->select(\"dm_dept_code, dm_dept_code||' - '||dm_dept_desc as dp_code_desc\");\n $this->db->from(\"ims_hris.department_main\");\n $this->db->where(\"COALESCE(dm_status,'INACTIVE') = 'ACTIVE'\");\n $this->db->where(\"dm_level IN (1,2)\");\n $this->db->where(\"dm_dept_code = (select sm_dept_code from ims_hris.staff_main where upper(sm_apps_username) = '$curr_usr')\");\n $this->db->order_by(\"dm_dept_code\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "private function getListaUsuarioAutorizado()\r\n\t {\r\n\t \treturn [\r\n\t \t\t'adminteq',\r\n\t \t\t'pfranco',\r\n\t \t\t'kperez',\r\n\t \t];\r\n\t }", "function palmate_edit_cap_filter( $allcaps, $cap, $args ) {\n if (in_array('edit_others_pages', $cap) && isset($args[2])) :\n $post_objects = get_field('palmate_edit_page_cap', 'user_' . $args[1]);\n if ($post_objects) :\n $has_post_id = count($post_objects) == 0 ? true : false;\n foreach ($post_objects as $post_object) :\n if ($post_object->ID == $args[2]) :\n $has_post_id = true;\n endif;\n endforeach;\n if ($has_post_id == false) :\n foreach ($cap as $c) :\n $allcaps[$c] = false;\n endforeach;\n endif;\n endif;\n endif;\n\n return $allcaps;\n}", "public function defaultScope()\n {\n return array('order' => 'loanId DESC');\n }", "public function add_owner() {\n $arrPageData['arrSessionData'] = $this->session->userdata;\n $ownerdata = array('owner_name' => trim($this->input->post('owner_name')),\n 'account_id' => $arrPageData['arrSessionData']['objSystemUser']->accountid,\n 'active' => 1,\n 'archive' => 1,\n 'location_id' => $this->input->post('location_id')\n );\n\n foreach ($ownerdata as $key => $value) {\n if ($value == '') {\n unset($ownerdata[$key]);\n }\n }\n\n\n if ($this->checkowner($ownerdata['owner_name'], $ownerdata['account_id']) == 0) {\n $this->db->insert('owner', $ownerdata);\n $id = $this->db->insert_id();\n }\n if ($id) {\n return $id;\n } else {\n return FALSE;\n }\n }", "private function get_pmode()\n\t{\n\t\treturn ($this->is_user_order_doctor() ? 'edit' : 'calc');\n\t}", "public function updateRestrictions($options){\n $this->_conf = $options;\n $this->_conf['prefix']=self::$_prefix;\n }", "function main_acronym($openKeys)\t{\n\t\tglobal $LANG, $BE_USER;\n\n\t\t$content.=$this->doc->startPage(\"RTE acronym\");\n\t\t$RTEtsConfigParts = explode(\":\",t3lib_div::_GP(\"RTEtsConfigParams\"));\n\t\t$RTEsetup = $BE_USER->getTSConfig(\"RTE\",t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));\n\t\t$thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup[\"properties\"],$RTEtsConfigParts[0],$RTEtsConfigParts[2],$RTEtsConfigParts[4]);\n\n\t\t$content.='\n\t<div class=\"title\" id=\"abbrType\">' . $LANG->getLL(\"Acronym\") . '</div>\n\t<fieldset id=\"type\">\n\t\t<legend>' . $LANG->getLL(\"Type_of_abridged_form\") . '</legend>\n\t\t<label for=\"abbreviation\" class=\"checkbox\">' . $LANG->getLL(\"Abbreviation\") . '</label><input type=\"radio\" name=\"type\" id=\"abbreviation\" value=\"abbreviation\" checked=\"checked\" onclick=\"setType();\" />\n\t\t<label for=\"acronym\" class=\"checkbox\">' . $LANG->getLL(\"Acronym\") . '</label><input type=\"radio\" name=\"type\" id=\"acronym\" value=\"acronym\" onclick=\"setType();\" />\n\t</fieldset>\n\t<fieldset id=\"selector\">\n\t\t<legend>' . $LANG->getLL(\"Defined_term\") . '</legend>\n\t\t<label for=\"termSelector\" class=\"fl\" id=\"termSelectorLabel\" title=\"' . $LANG->getLL(\"Select_a_term\") . '\">' . $LANG->getLL(\"Unabridged_term\") . '</label>\n\t\t<select id=\"termSelector\" name=\"termSelector\" title=\"' . $LANG->getLL(\"Select_a_term\") . '\"\n\t\t\tonChange=\"document.acronymForm.acronymSelector.selectedIndex=document.acronymForm.termSelector.selectedIndex; document.acronymForm.title.value=document.acronymForm.termSelector.options[document.acronymForm.termSelector.selectedIndex].value;\">\n\t\t\t<option value=\"\"></option>\n\t\t</select>\n\t\t<label for=\"acronymSelector\" id=\"acronymSelectorLabel\" title=\"' . $LANG->getLL(\"Select_an_acronym\") . '\">' . $LANG->getLL(\"Abridged_term\") . '</label>\n\t\t<select id=\"acronymSelector\" name=\"acronymSelector\" title=\"' . $LANG->getLL(\"Select_an_acronym\") . '\"\n\t\t\tonChange=\"document.acronymForm.termSelector.selectedIndex=document.acronymForm.acronymSelector.selectedIndex; document.acronymForm.title.value=document.acronymForm.termSelector.options[document.acronymForm.termSelector.selectedIndex].value;\">\n\t\t\t<option value=\"\"></option>\n\t\t</select>\n\t</fieldset>\n\t<fieldset>\n\t\t<legend>' . $LANG->getLL(\"Term_to_abridge\") . '</legend>\n\t\t<label for=\"title\" class=\"fl\" title=\"' . $LANG->getLL('Use_this_term_explain') . '\">' . $LANG->getLL('Use_this_term') . '</label>\n\t\t<input type=\"text\" id=\"title\" name=\"title\" size=\"60\" title=\"' . $LANG->getLL('Use_this_term_explain') . '\" />\n\t</fieldset>\n\t<div class=\"buttons\">\n\t\t<button type=\"button\" title=\"' . $LANG->getLL(\"OK\") . '\"onclick=\"return onOK();\">' . $LANG->getLL(\"OK\") . '</button>\n\t\t<button type=\"button\" title=\"' . $LANG->getLL(\"Delete\") . '\" onclick=\"return onDelete();\">' . $LANG->getLL(\"Delete\") . '</button>\n\t\t<button type=\"button\" title=\"' . $LANG->getLL(\"Cancel\") . '\" onclick=\"return onCancel();\">' . $LANG->getLL(\"Cancel\") . '</button>\n\t</div>';\n\t\n\t\t$content.= $this->doc->endPage();\n\t\treturn $content;\n\t}", "public function edit(Catowner $catowner)\n {\n //\n }", "public function getForApproval() {\n\n /* Set orWhereIn variables */\n array_push($this->orWhereIn, [\n 'column' => 'id',\n 'array' => $this->user->idp_approvals()->pluck('id')->toArray()\n ]);\n }", "public function asignarOrden($orden)\n {\n $counters= $this->getDoctrine()->getManager()->getRepository('BaseBundle:Empresa')->getCountersOrderedByTimeOfQueue($orden->getEmpresa()->getId(),$orden->getFecha()->format('H:i:s'));\n \n if($orden instanceof Anulacion)\n {\n $emision= $this->getDoctrine()->getManager()->getRepository('EmisionesBundle:Emision')->findOneBy(array('numeroOrden'=>$orden->getTarjet()));\n if($emision instanceof Emision && $emision->getUsuario() instanceof Usuariointerno)\n {\n// print_r(\"entro\");exit;\n if(in_array($emision->getUsuario()->getId(), array_column($counters, 'id')))\n {\n return $emision->getUsuario(); \n }\n }\n// print_r(\"salio\");exit;\n }\n foreach (array_column($counters, 'id') as $id_counter)\n {\n $counter= $this->getDoctrine()->getManager()->getRepository('EmisionesBundle:Usuariointerno')->find($id_counter);\n if($orden->getFecha() < $counter->getInicioAlmuerzo() && $orden->getFecha()>= $counter->getInicioJornada())\n {//horario mannana del counter\n return $counter; \n }\n elseif($orden->getFecha() > $counter->getFinAlmuerzo() && $orden->getFecha() <= $counter->getFinJornada())\n {//horario de la tarde del counter\n return $counter;\n }\n } \n return false;\n }", "public function setAutorizacaoOdonto(array $autorizacaoOdonto)\n {\n $this->autorizacaoOdonto = $autorizacaoOdonto;\n return $this;\n }", "private function current_tab_does_not_need_applicants(){ \n $reply = $this->current_tab_in_array(array(tab_social_events,\n\t\t\t\t\t tab_available_budget,\n\t\t\t\t\t tab_reimbursement_rates,\t\t\t \n\t\t\t\t\t tab_accommodation_options,\n\t\t\t\t\t ));\n $this->dbg(($reply ? 'SKIP' : 'PROCESS'). ' applicants',cnf_dev);\n return $reply;\n }", "function getOwnerFieldFilter()\n{\n if(empty($this->OwnerField)){\n return '';\n }\n $ownerMF = $this->ModuleFields[$this->OwnerField];\n\n if(empty($ownerMF)){\n print \"ModuleField names: ({$this->ModuleID})\\n\";\n print_r(array_keys($this->ModuleFields));\n trigger_error(\"Module->getOwnerFieldFilter found an empty/invalid Owner Field named {$this->OwnerField}.\", E_USER_ERROR);\n }\n\n global $SQLBaseModuleID;\n $SQLBaseModuleID = $this->ModuleID;\n $ownerFieldFilter = $ownerMF->getQualifiedName($this->ModuleID) . ' IN (%s)';\n return $ownerFieldFilter;\n}", "function editCategoryExclusionList($table) {\n\t\t\n\t\t//master account exception\n\t\tif ($_SESSION['userLevel'] == 1) {\n\t\t\t\n\t\t\treturn;\n\t\t\t\n\t\t}\n\t\t\n\t\t$table = sanitize_string($table);\n\n\t\t$result = mysql_query(\"SELECT categoriesUserGroups.category, userGroups.restrictViewing, userGroups.allowEditing FROM categoriesUserGroups LEFT JOIN userGroupsMembers ON userGroupsMembers.groupId = categoriesUserGroups.groupId AND userGroupsMembers.username = '{$_SESSION['username']}' LEFT JOIN userGroups ON userGroups.id = userGroupsMembers.groupId\");\n\t\t\n\t\tif (mysql_num_rows($result) > 0) {\n\t\t\t\n\t\t\twhile ($row = mysql_fetch_object($result)) {\n\n\t\t\t\tif ($row->allowEditing != '1') {\n\n\t\t\t\t\t$return .= \" AND $table.category != '\" . sanitize_string($row->category) . \"'\";\n\n\t\t\t\t}\n\n\t\t\t}\t\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$result = mysql_query(\"SELECT categoriesUserGroups.category FROM categoriesUserGroups\");\n\n\t\t\twhile ($row = mysql_fetch_object($result)) {\n\n\t\t\t\t$return .= \" AND $table.category != '\" . sanitize_string($row->category) . \"'\";\n\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn($return);\n\t\t\n\t}", "function wpse45436_admin_posts_filter_restrict_manage_posts(){\n\tglobal $wpdb;\n $type = 'policy';\n if (isset($_GET['post_type'])) {\n $type = $_GET['post_type'];\n }\n\n //only add filter to post type you want\n if ('policy' == $type){\n //change this to the list of values you want to show\n //in 'label' => 'value' format\n\t\t$values = array();\n\t\t$responsible_offices_data = $wpdb->get_results(\"select * from \".$wpdb->prefix.\"responsible_offices\");\n\t\tforeach($responsible_offices_data as $responsible_office) { \n\t\t\n\t\t\t$values[$responsible_office->name] = $responsible_office->id;\n\t\t}\n /* $values = array(\n 'Finance Office' => '4', \n 'Police Department' => '5'\n );*/\n ?>\n <select name=\"ADMIN_FILTER_FIELD_VALUE\">\n <option value=\"\"><?php _e('Filter By ', 'wose45436'); ?></option>\n <?php\n $current_v = isset($_GET['ADMIN_FILTER_FIELD_VALUE'])? $_GET['ADMIN_FILTER_FIELD_VALUE']:'';\n foreach ($values as $label => $value) {\n printf\n (\n '<option value=\"%s\"%s>%s</option>',\n $value,\n $value == $current_v? ' selected=\"selected\"':'',\n $label\n );\n }\n ?>\n </select>\n <?php\n }\n}", "public function getConflictsMode(): int;", "protected function restrict_fields()\n {\n }", "public function getAbonement_id()\n {\n return $this->abonement_id;\n }", "protected function setOwner($owner) {\r\n $this->owner = $this->create($owner);\r\n }", "protected function _authByOwnerPassword($ownerPassword = '') {}", "public function isOwner()\n {\n return $this->affiliation == self::AFFILIATION_OWNER;\n }", "public function setAUMENTOPERDIDA($AUMENTO_PERDIDA)\r\n {\r\n $this->AUMENTO_PERDIDA = $AUMENTO_PERDIDA;\r\n\r\n return $this;\r\n }", "public function setCountryRestriction()\n\t {\n\t \t throw new OutOfBoundsException(\"Country restriction parameter is not availbale for PaySafeCard CreateDisposition\");\n\t }", "public function owner(): BelongsTo\n {\n return $this->belongsTo(SocialPassport::getAuthProviderModel(), 'owner_id');\n }", "public function filterAdminCollectionsFormTabs($tabs, $args)\n {\n $currentRole = current_user()->role;\n if($currentRole == 'admin' || $currentRole == 'super') {\n $user_table = $this->_db->getTable('User');\n $options = $this->findUserPairsForSelectForm();\n $options = array('0' => 'No owner') + $options;\n $owner = $user_table->find($args['collection']->owner_id);\n $ownerId = $owner ? $owner->id : 0;\n $tabs['Ownership'] = get_view()->partial(\n 'collections/role-magick-owner-form.php',\n array('options' => $options, 'owner_id' => $ownerId)\n );\n }\n return $tabs;\n }", "function olc_set_admin_access($fieldname, $status, $cID) {\n\treturn olc_db_query(SQL_UPDATE . TABLE_ADMIN_ACCESS . \" set \" . $fieldname . \" = '\".$status.\"'\n\twhere customers_id = '\" . $cID . APOS);\n}", "public function limitClientsToScopes($limit = false)\n {\n $this->limitClientsToScopes = $limit;\n }", "private function getAutoScope(){\n $model=$this->model;\n $static=$this->model->subClassOf;\n if(property_exists($static,\"scope\") && array_key_exists(\"auto\",$static->scope)){\n $this->autoScope=$static->scope['auto'];\n }\n if($this->autoScope!==null && !is_array($this->autoScope)){\n $this->autoScope=[$this->autoScope];\n }\n\n $this->scope($this->autoScope,$model);\n\n }", "function canEdit($user) {\n return $user->isCompanyManager($this);\n }", "public function testTenancyScope() {\n $model = new DummyModel();\n $this->assertTrue($model->hasGlobalScope(\"Ngdcorp\\Multitenancy\\Scopes\\MultiTenantScope\"));\n MultitenantScope::disable();\n $this->assertTrue($model->hasGlobalScope(\"Ngdcorp\\Multitenancy\\Scopes\\MultiTenantScope\"));\n }", "public function canEdit()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif( static::restrictionCheck( 'edit' ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif( isset( static::$ownerTypes['member'] ) and static::$ownerTypes['member'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['member'];\n\n\t\t\tif( $this->$column and $this->$column == \\IPS\\Member::loggedIn()->member_id )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\tif( isset( static::$ownerTypes['group'] ) and static::$ownerTypes['group'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['group']['ids'];\n\t\t\n\t\t\t$value = $this->$column;\n\t\t\tif( count( array_intersect( explode( \",\", $value ), \\IPS\\Member::loggedIn()->groups ) ) )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "function onAfterWrite() {\n\t\t$bt = defined('DB::USE_ANSI_SQL') ? \"\\\"\" : \"`\";\n\n\t\tif(!$this->owner->ApproverGroups()->Count() && $this->owner->CanApproveType == 'OnlyTheseUsers') {\n\t\t\t$SQL_group = Convert::raw2sql('site-content-approvers');\n\t\t\t$groupCheckObj = DataObject::get_one('Group', \"{$bt}Code{$bt} = '{$SQL_group}'\");\n\t\t\tif($groupCheckObj) $this->owner->ApproverGroups()->add($groupCheckObj);\n\t\t}\n\t\t\n\t\tif(!$this->owner->PublisherGroups()->Count() && $this->owner->CanPublishType == 'OnlyTheseUsers') {\n\t\t\t$SQL_group = Convert::raw2sql('site-content-publishers');\n\t\t\t$groupCheckObj = DataObject::get_one('Group', \"{$bt}Code{$bt} = '{$SQL_group}'\");\n\t\t\tif($groupCheckObj) $this->owner->PublisherGroups()->add($groupCheckObj);\n\t\t}\n\t}" ]
[ "0.52315277", "0.52315277", "0.49320942", "0.4710645", "0.4710645", "0.46338335", "0.46246937", "0.4617554", "0.4613992", "0.46018186", "0.45874065", "0.45848894", "0.4556027", "0.45220125", "0.45114926", "0.45003697", "0.44856146", "0.4483433", "0.44793963", "0.4456362", "0.44515038", "0.4441996", "0.44213918", "0.43930018", "0.43925795", "0.43924206", "0.43898383", "0.4383174", "0.43672937", "0.43635827", "0.43556738", "0.43489358", "0.43489358", "0.43463778", "0.43448368", "0.43402076", "0.43388385", "0.43383092", "0.43053508", "0.42960066", "0.42817745", "0.42792088", "0.42741555", "0.42740658", "0.42739394", "0.42704153", "0.4255548", "0.42510664", "0.42500356", "0.4245667", "0.42401922", "0.42358723", "0.42204162", "0.4218276", "0.42110184", "0.4204309", "0.42037088", "0.41847897", "0.41833514", "0.41827646", "0.41827077", "0.4175477", "0.41738018", "0.4168394", "0.41682413", "0.41643682", "0.4162917", "0.4161", "0.415728", "0.41570437", "0.41532183", "0.41449815", "0.41393995", "0.4136272", "0.41357183", "0.41332716", "0.41318896", "0.41288978", "0.41264266", "0.41258985", "0.41188315", "0.41186398", "0.411746", "0.41169786", "0.4114903", "0.41117933", "0.41080981", "0.41077834", "0.41009596", "0.4099993", "0.40998515", "0.40982428", "0.40970576", "0.40917218", "0.40907934", "0.40902668", "0.4087974", "0.4085287", "0.4085012", "0.40838233", "0.40823016" ]
0.0
-1
Unlike the Paths version,this one gets it from the database:
public static function getAllDepartmentAcronyms() { return DB::table('l_contracts') ->select(['owner_acronym']) ->orderBy('owner_acronym') ->distinct() ->pluck('owner_acronym') ->toArray(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function getEntityPath();", "function _get_path($pid) {\n\t\t\t\t$set = new NestedSet();\n\t\t\t\t$set->set_table_name($this->mod_tbl);\n\t\t\t\treturn $set->getPath($pid);\n\t\t\t}", "public function getObjectPath() {}", "public static function getByPath($path) {}", "public function getByPath($path);", "function getPath($nim){\n\t\t$query = $this->db->query(\"select PATH_FOTO from KKN_MHS where NIM='$nim'\");\n\t\treturn $query;\n\t}", "public function getPath() {}", "public function getPath() {}", "public function getPath() {}", "public function getPath() {}", "public function getPath() {}", "public function getPath() {}", "public function getPath(){ }", "public function getPath(){ }", "public function getPath() { return $this->_path; }", "public function getPath(){\n\t\treturn $this->path;\n\t}", "public function path() {}", "public function path() {}", "public function path();", "abstract protected static function get_db_file_path();", "abstract public function getSingle(string $path);", "public function get()\n {\n return $this->_sPath->getValue();\n }", "abstract protected function getPath();", "public function get()\n {\n return $this->path;\n }", "function FetchByName($pathname) {\n\t\t$sql = \"select Pathname_ID('\" . pg_escape_string($pathname) . \"') as id\";\n\n\t\tif ($Debug)\techo \"Element::FetchByName sql = '$sql'<BR>\";\n\n\t\t$result = pg_exec($this->dbh, $sql);\n\t\tif ($result) {\n\t\t\t$numrows = pg_numrows($result);\n\t\t\tif ($numrows == 1) {\n\t\t\t\t$myrow = pg_fetch_array ($result, 0);\n\t\t\t\t$this->id = $myrow[\"id\"];\n\t\t\t\tif ($Debug) echo \"id for '$pathname' is $this->id<BR>\";\n\n\t\t\t\tif (IsSet($this->id)) {\n\t\t\t\t\treturn $this->FetchByID($this->id);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\techo 'pg_exec failed: ' . $sql;\n\t\t}\n\t}", "public function getPath(){\n return $this->path;\n }", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getFoundPath() {}", "function getPath() {\n\t\treturn $this->path;\n\t}", "public function path() {\n\t\treturn $this->_path;\n\t}", "private function getPath()\n {\n return $this->path;\n }", "public function getPath() : string;", "public function _getObjectPath(){\n if(null === $this->_path || !$this->_path instanceof Path){\n $this->_path = New Path();\n }\n return $this->_path;\n }", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "function getPath()\n {\n return $this->path;\n }", "protected abstract function getPath();", "public function getRealPath()\n\t{\n\t\t// Unfortunately we'd need to store the fake directory hierarchy\n\t\t// in the database, too...\n\t\tthrow new DatabaseFileException('Obtaining the real path is not supported for database files.');\n\t}", "public function getPathLocation(): string;", "function getPath( )\r\n\t{\r\n\t\treturn $this->path;\r\n\t}", "public function path()\n {\n return $this->_path;\n }", "public function get_path() {\n\t\treturn $this->path;\n\t}", "public function get_path() {\n\t\treturn $this->path;\n\t}", "function getPath(): string;", "public function getMediaPath()\n {\n // should return an array\n $query = $this->query()\n ->join('media_handlers', 'media_handlers.model_id', '=', 'anggota.id')\n ->where('media_handlers.model_id', '=', $this->id)\n ->where('media_handlers.model_name', '=', $this->const_ModelName)\n ->where('media_handlers.deleted_at', '=', null)\n ->get();\n\n // return single object instead of an array\n if (count($query) != 0) {\n // Add new sub attribute about preview and\n $item = $query[0];\n $item->imageUrl = $this->getUrlPath($item->path);\n $item->thumbnail = $this->getThumbnailUrlPath($item->path);\n $item->preview = $this->getPreviewUrlPath($item->path);\n return $item;\n }\n\n return null;\n }", "public function getByFullPath($path) {\r\n\t\t$select = $this->select()\r\n\t\t\t\t\t ->where('area_path = ?', $path);\r\r\n\t $result = $this->_db->fetchAll($select);\t\r\n return ($result == false) ? false : $result = $result;\t\t\r\n\t}", "public function getPath()\n {\n return $this->path;\n }", "public function getPath()\n {\n return $this->path;\n }", "public function getPath()\n {\n return $this->path;\n }", "function tdc_get_filepath($filenode){\n return $filenode->path[0];\n}", "abstract public function retrieve();", "function dbQueryNodePath()\n {\n $nodePath = array();\n $parentId = $this->id;\n while ($parentId != 0)\n {\n $nodePath[] = $parentId;\n $parentId = $this->_dbQueryParent($parentId);\n }\n //$this->dumpVar ('nodePath', $nodePath );\n return $nodePath;\n }", "public function getPath()\n {\n return $this->__get(\"path\");\n }", "public function path()\n {\n return $this->path;\n }", "function LangPathById($language_id) {\n\tglobal $dbconn;\n\n\t$lang_path = \"\";\n\t$strSQL = \"SELECT lang_path FROM \".LANGUAGE_TABLE.\" WHERE id='$language_id'\";\n\t$rs = $dbconn->Execute($strSQL);\n\tif ($rs->RowCount() > 0) {\n\t\t$lang_path = $rs->fields[0];\n\t}\n\treturn $lang_path;\n}", "public function getPath()\r\n {\r\n return $this->path;\r\n }", "public function getPath()\r\n {\r\n return $this->path;\r\n }", "public function getPath(): array;", "public function getPath() {\n\t\treturn $this->path;\n\t}", "public function getPath() {\n\t\treturn $this->path;\n\t}", "public function findByPath($path)\n {\n return $this->model->where('path', $path)->first();\n }", "public function getPath() {\n return $this->path;\n }", "function getpath($path) {\n $findnode = array_shift($path); //pop the first value off the path, we will pass the rest of the path into the delegated object when we find it\n if (isset($findnode)) {\n //each path is a reference into one of our arrays\n if (array_key_exists($findnode, $this->root)) {\n return $this->root[$findnode]->getpath($path);\n } elseif (array_key_exists($findnode, $this->fields)) {\n return $this->fields[$findnode];\n } elseif (array_key_exists($findnode, $this->values)) {\n return $this->values[$findnode]->getpath($path);\n } elseif (array_key_exists($findnode, $this->statements)) {\n return $this->statements[$findnode]->getpath($path);\n }\n //we don't go looking down 'next', that isn't path referenceable for the purpose of getting a text value\n } else {\n //we reached the end of the path, return what we have.\n return \"$this\";\n }\n }", "public function fetch_path()\n\t{\n\t\treturn $this->route_stack[self::SEG_PATH];\n\t}", "public function getPathTranslated() {\n\t\t\n\t}", "public function getPath()\n\t{\n\t\treturn $this->_path;\n\t}", "public function getPath()\n\t{\n\t\treturn $this->_path;\n\t}", "public function getPath()\n {\n return $this->_path;\n }", "public function getPath()\n {\n return $this->_path;\n }", "public function getPath()\n {\n return $this->_path;\n }", "public function fetchPath()\n {\n $path = array();\n foreach ($this->forumNode()->fetchPath() as $item)\n {\n $path[] = array(\n 'url' => $item->urlAlias(),\n 'text' => $item->Name\n );\n }\n \n $path[] = array(\n 'url' => $this->forumNode()->urlAlias(),\n 'text' => $this->forumNode()->Name\n );\n \n $path[] = array(\n 'url' => $this->urlAlias(),\n 'text' => $this->attribute('name')\n );\n \n return $path;\n }", "public function path(): string;", "public function path(): string;", "public function getPath()\n\t{\n\t\t\n\t\t$this->setPath();\n\t\treturn $this->path;\n\t\t\n\t}", "public function getPath()\n\t{\n\t\treturn $this->path;\n\t}", "public function getPath()\n\t{\n\t\treturn $this->path;\n\t}", "public function getPath()\n\t{\n\t\treturn $this->path;\n\t}", "public function getPath()\n\t{\n\t\treturn $this->path;\n\t}", "public function get_path()\n\t{\n\n\t\t$lft_col = $this->left_column;\n\t\t$rgt_col = $this->right_column;\n\t\t\n\t\t//$this->model->where($this->scope_column,$this->get_scope());\n\t\t$this->model->where($lft_col . ' <= '.$this->model->$lft_col . ' AND ' . $rgt_col . ' >=' .$this->model->$rgt_col . ' ORDER BY '.$lft_col);\n\n\t\treturn $this->model->find_all(); \n\n\t}", "public function getPathFile($id){\n $sql = \"SELECT pathFile FROM fanart WHERE id=\".intval($id).\";\";\n $res = mysqli_query($this->link, $sql);\n $path = mysqli_fetch_all($res)[0][0];\n return $path;\n }", "public function getPath()\r\n\t{\r\n\t\treturn $this->path;\r\n\t}", "public function getPath() : Path\n {\n return $this->path;\n }" ]
[ "0.64717185", "0.6399928", "0.6247359", "0.6228643", "0.61967707", "0.6174692", "0.6112609", "0.61114657", "0.61096305", "0.61096305", "0.61096305", "0.61096305", "0.61065936", "0.61065936", "0.6099704", "0.60651636", "0.6049412", "0.60482085", "0.6028152", "0.60117185", "0.6008914", "0.59661686", "0.596295", "0.59401333", "0.5933825", "0.5930791", "0.59082115", "0.59082115", "0.59082115", "0.59082115", "0.59082115", "0.59082115", "0.59082115", "0.59082115", "0.59082115", "0.59082115", "0.59082115", "0.59082115", "0.59082115", "0.59082115", "0.5895847", "0.5889232", "0.58561087", "0.58164495", "0.5813926", "0.5808739", "0.5794354", "0.5794354", "0.5794354", "0.5794354", "0.5794354", "0.5794354", "0.5794354", "0.5794354", "0.57910615", "0.57678413", "0.5758872", "0.5751368", "0.57208955", "0.5718943", "0.56879836", "0.56879836", "0.5670763", "0.56703633", "0.5668805", "0.5664623", "0.5664623", "0.5664623", "0.56543803", "0.564583", "0.5644237", "0.5632543", "0.56181884", "0.5603925", "0.56007755", "0.56007755", "0.5597364", "0.55805403", "0.55805403", "0.55788594", "0.5570918", "0.5570845", "0.55683166", "0.5565962", "0.55548877", "0.55548877", "0.5551431", "0.5551431", "0.5551431", "0.55224043", "0.5515942", "0.5515942", "0.5513279", "0.5503195", "0.5503195", "0.5503195", "0.5503195", "0.5500926", "0.5500743", "0.5497147", "0.5495648" ]
0.0
-1
rowData is a collection of rows that all have the same gen_amendment_group_id
public static function calculateEffectiveAmendmentValues($rowData) { // These are already sorted by ascending source_fiscal foreach ($rowData as $row) { // Fix for situations where the end year is earlier than the start year // use whichever is later of the start year or the source year (when it was published). if ($row->gen_end_year < $row->gen_start_year) { $row->gen_end_year = $row->gen_start_year; if ($row->source_year > $row->gen_end_year) { $row->gen_end_year = $row->source_year; } } } // We're using Collection methods here, which are great: // https://laravel.com/docs/5.6/collections // Step 1: find the earliest and latest years of the contract $earliestYear = $rowData->min('gen_start_year'); // Update: rather than the maximum end year, it should actually be the end year of the *last* row in the (ordered by source_fiscal) array of amendments. // In some cases, the contract gets *shortened* from what was originally planned. // $latestYear = $rowData->max('gen_end_year'); $latestYear = $rowData->last()->gen_end_year; // Edge cases where the end year is earlier than the start year, use the last one's start year instead: if ($rowData->last()->gen_start_year > $rowData->last()->gen_end_year) { $latestYear = $rowData->last()->gen_start_year; } $originalValue = $rowData->min('original_value'); if (! $originalValue) { $originalValue = $rowData->min('contract_value'); } // Step 2: create an array range of each year in this set, and then match each year with the most updated amendment row ID $years = range($earliestYear, $latestYear); $yearMapping = []; $firstRow = 1; $genAmendmentGroupId = null; foreach ($rowData as $row) { // Store this for error tracking later (it's the same for all rows in rowData) if (! $genAmendmentGroupId) { $genAmendmentGroupId = $row->gen_amendment_group_id; } foreach ($years as $year) { if ($firstRow) { // Use the start_year since this is the beginning // even if the source_year is later (if it was retroactively published) if ($row->gen_start_year <= $year && $row->gen_end_year >= $year) { $yearMapping[$year] = $row->id; } } else { // Use the source_year instead of the start_year if ($row->source_year <= $year && $row->gen_end_year >= $year) { $yearMapping[$year] = $row->id; } } } $firstRow = 0; } // dd($yearMapping); // var_dump($yearMapping); // array:3 [ // 2010 => 1251303 // 2011 => 1250608 // 2012 => 1250608 // ] // Step 3: loop through rows again and set effective start and end years $cumulativeTotal = 0; $firstRow = 1; $rowIdsToUpdate = []; foreach ($rowData as $row) { $effectiveStartYear = null; $effectiveEndYear = null; foreach ($yearMapping as $year => $rowId) { if ($rowId == $row->id) { // If they match, update the effective start and end years // echo "Match: " . $row->id . " for " . $year . "\n"; if ($effectiveStartYear == null || $year < $effectiveStartYear) { $effectiveStartYear = $year; } if ($effectiveEndYear == null || $year > $effectiveEndYear) { $effectiveEndYear = $year; } } else { // echo "No match for: " . $row->id . " for " . $year . "\n"; } } if ($effectiveStartYear == null || $effectiveEndYear == null) { // If this row ID isn't in the yearMapping array, skip to the next row. // echo "Skipping... \n"; continue; } $rowIdsToUpdate[] = $row->id; // echo "here for " . $row->id . "\n"; $row->gen_effective_start_year = $effectiveStartYear; $row->gen_effective_end_year = $effectiveEndYear; // Effective total value is, the theoretical yearly value of the contract over the originally planned start and end years if ($firstRow) { $theoreticalYearlyValue = $row->contract_value / ($row->gen_end_year - $row->gen_start_year + 1); } else { // Update 2021-04-03: Subtract the cumulative total from the latest contract value here, before averaging across the years between the row's end year and source year $theoreticalYearlyValue = ($row->contract_value - $cumulativeTotal) / ($row->gen_end_year - $row->source_year + 1); } // dd($effectiveEndYear); $row->gen_effective_total_value = $theoreticalYearlyValue * ($effectiveEndYear - $effectiveStartYear + 1); $row->gen_effective_yearly_value = $row->gen_effective_total_value / ($effectiveEndYear - $effectiveStartYear + 1); $cumulativeTotal += $row->gen_effective_total_value; $firstRow = 0; } $updatesSaved = 0; // Update the rows in the database: foreach ($rowData as $index => $row) { $isFinalValue = 0; if ($index == count($rowData) - 1) { $isFinalValue = 1; } // Make sure there are actually changes if (in_array($row->id, $rowIdsToUpdate)) { DB::table('l_contracts') ->where('owner_acronym', '=', $row->owner_acronym) ->where('id', '=', $row->id) ->update([ 'gen_effective_start_year' => $row->gen_effective_start_year, 'gen_effective_end_year' => $row->gen_effective_end_year, 'gen_effective_total_value' => $row->gen_effective_total_value, 'gen_effective_yearly_value' => $row->gen_effective_yearly_value, 'gen_original_value' => $originalValue, 'gen_is_most_recent_value' => $isFinalValue, ]); $updatesSaved = 1; // echo "Updated " . $row->id . "\n"; } else { // Update the effective total and yearly values, but not the start and end years // these are amendments that were overridden by other amendments in the same year. DB::table('l_contracts') ->where('owner_acronym', '=', $row->owner_acronym) ->where('id', '=', $row->id) ->update([ 'gen_effective_total_value' => 0, 'gen_effective_yearly_value' => 0, ]); } } if ($updatesSaved) { return true; } else { echo "No updates for gen_amendment_group_id " . $genAmendmentGroupId . "\n"; return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function findAmendmentEntries($rowData)\n {\n\n $totalAmendments = 0;\n \n // mode 1: same gen_vendor_normalized, same reference_number, different contract_value\n $amendmentRows = DB::table('l_contracts')\n ->where('owner_acronym', '=', $rowData['owner_acronym'])\n // Ensure it's not the exact same row:\n ->where('id', '!=', $rowData['id'])\n // Make sure it's not a duplicate entry\n ->where('gen_is_duplicate', '=', 0)\n // Make sure it's not an error row\n ->where('gen_is_error', '=', 0)\n // Make sure it isn't part of a different amendment group (TODO - review this)\n ->whereNull('gen_amendment_group_id')\n ->whereNotNull('source_fiscal')\n // Make sure it's the same vendor:\n ->where('gen_vendor_normalized', '=', $rowData['gen_vendor_normalized'])\n\n // This is a bit of a complicated combination, but the resulting SQL is,\n // and (\"reference_number\" = ? or (\"original_value\" = ? and \"gen_start_year\" = ?))\n // Because of threshold limits (sole source, NAFTA, etc.), we wouldn't want to just match original and contract values without also matching start years (in case completely different contracts have the same values).\n ->where(function ($query) use ($rowData) {\n return $query->where('reference_number', '=', $rowData['reference_number'])\n ->orWhere(function ($query) use ($rowData) {\n return $query->where('original_value', '=', $rowData['contract_value'])\n ->where('gen_start_year', '=', $rowData['gen_start_year']);\n });\n })\n ->orderBy('source_fiscal', 'asc')\n ->orderBy('contract_value', 'asc')\n // ->orderBy('id', 'asc')\n // ->toSql();\n ->pluck('id');\n\n if ($amendmentRows->count() > 0) {\n // Just 1 row is enough (since it'll be different than the original row)\n // Add back in the original ID (sorted by source_fiscal then ID in the earlier query in findAmendments)\n $amendmentRows->prepend($rowData['id']);\n\n $totalAmendments += self::markAmendmentEntries($rowData['owner_acronym'], $amendmentRows, 1);\n }\n\n return $totalAmendments;\n }", "function &_returnGroupFromRow(&$row) {\n\t\t$group = $this->newDataObject();\n\t\t$group->setId($row['group_id']);\n\t\t$group->setAboutDisplayed($row['about_displayed']);\n\t\t$group->setPublishEmail($row['publish_email']);\n\t\t$group->setSequence($row['seq']);\n\t\t$group->setContext($row['context']);\n\t\t$group->setAssocType($row['assoc_type']);\n\t\t$group->setAssocId($row['assoc_id']);\n\t\t$this->getDataObjectSettings('group_settings', 'group_id', $row['group_id'], $group);\n\n\t\tHookRegistry::call('GroupDAO::_returnGroupFromRow', array(&$group, &$row));\n\n\t\treturn $group;\n\t}", "public static function findDuplicateEntries($rowData)\n {\n // For all modes, limit to the same department owner_acronym\n\n $totalDuplicates = 0;\n\n // mode 1: same contract_value, same gen_vendor_normalized, same raw_contract_date\n $duplicateRows = DB::table('l_contracts')\n ->where('owner_acronym', '=', $rowData['owner_acronym'])\n ->where('gen_is_duplicate', '=', 0)\n ->where('gen_is_error', '=', 0)\n ->where('contract_value', '=', $rowData['contract_value'])\n ->where('gen_vendor_normalized', '=', $rowData['gen_vendor_normalized'])\n ->where('raw_contract_date', '=', $rowData['raw_contract_date'])\n ->whereNotNull('source_fiscal')\n ->orderBy('source_fiscal', 'asc')\n ->orderBy('id', 'asc')\n ->pluck('id');\n\n if ($duplicateRows->count() > 1) {\n // Then, there's duplicates based on this method.\n $totalDuplicates += self::markDuplicateEntries($rowData['owner_acronym'], $duplicateRows, 1);\n }\n\n\n // mode 2: same contract_value, same gen_vendor_normalized, same reference_number, same gen_start_year\n // (in case the raw contract dates are formatted inconsistently or missing)\n $duplicateRows = DB::table('l_contracts')\n ->where('owner_acronym', '=', $rowData['owner_acronym'])\n ->where('gen_is_duplicate', '=', 0)\n ->where('gen_is_error', '=', 0)\n ->where('contract_value', '=', $rowData['contract_value'])\n ->where('gen_vendor_normalized', '=', $rowData['gen_vendor_normalized'])\n ->where('reference_number', '=', $rowData['reference_number'])\n ->where('gen_start_year', '=', $rowData['gen_start_year'])\n ->whereNotNull('source_fiscal')\n ->orderBy('source_fiscal', 'asc')\n ->orderBy('id', 'asc')\n ->pluck('id');\n\n if ($duplicateRows->count() > 1) {\n // Then, there's duplicates based on this method.\n $totalDuplicates += self::markDuplicateEntries($rowData['owner_acronym'], $duplicateRows, 2);\n }\n\n // mode 3: same gen_vendor_normalized and same reference_number\n // (in case both the raw contract dates and the vendor names are input inconsistently)\n $duplicateRows = DB::table('l_contracts')\n ->where('owner_acronym', '=', $rowData['owner_acronym'])\n ->where('gen_is_duplicate', '=', 0)\n ->where('gen_is_error', '=', 0)\n ->where('contract_value', '=', $rowData['contract_value'])\n ->where('reference_number', '=', $rowData['reference_number'])\n ->whereNotNull('source_fiscal')\n ->orderBy('source_fiscal', 'asc')\n ->orderBy('id', 'asc')\n ->pluck('id');\n\n if ($duplicateRows->count() > 1) {\n // Then, there's duplicates based on this method.\n $totalDuplicates += self::markDuplicateEntries($rowData['owner_acronym'], $duplicateRows, 3);\n }\n\n return $totalDuplicates;\n }", "function AggregateListRow() {\n\t}", "private function groupBy() {\n $this->sql .= 'GROUP BY inv_agent_id ';\n }", "public function mrow_group($r)\n {\n return $r['usergroup'];\n }", "public function getAllGrpIds(){\n\n\t\t$qry=$this->db->select('id');\n\t\t$this->db->from('customer_groups');\n\t\t$qry=$this->db->get();\n\t\t$count=$qry->num_rows();\n\t\t$result= $qry->result_array();\n\t\tfor($i=0;$i<$count;$i++){\n\t\t\t\t$values[$result[$i]['id']]=$result[$i]['id'];\n\t\t\t\t}\n\t\n\t\treturn $values;\n\t\n\t}", "public function duplicateSemesterInfo($data) {\n// $this->db->select('campusName'); \n $qu = $this->db->get_where($this->_table, array('semester' => $data['semester']));\n $reault = $qu->row_array();\n return $reault;\n }", "public function fetchGroupData() {}", "public function fetchGroupData() {}", "protected function _dataMerge( $row )\n\t{\n\t\tif ( $row instanceof Zend_Db_Table_Row )\n\t\t\t$row = $row->toArray();\n\t\t\n\t\t$this->_data = array_merge($this->_data, $row);\n\t\t\n\t\tif (array_key_exists('user_id', $this->_data))\n\t\t\t$this->ownerUserId = $this->_data['user_id'];\n\t}", "function push_usrRowObject($data){\n $id = $data['id'];\n $username = $data['username'];\n $password = \"**********\";\n $email = $data['email'];\n $groupId = $data['group'];\n\n $resultObject = '<tr class=\"even pointer\" id=\"data_row\" name=\"data_row\" role=\"row\">\n <td class=\"a-center \" name=\"table_td-checkbox\">\n <div class=\"icheckbox_flat-green\" style=\"position: relative;\" name=\"data_check\" onClick=\"selected_checkbox(this)\">\n <input id=\"row_check\" type=\"checkbox\" class=\"table-checkbox\" value=\"'.$id.'\" name=\"table_records\">\n <ins class=\"iCheck-helper\" style=\"position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background-color: rgb(255, 255, 255); border: 0px; opacity: 0; background-position: initial initial; background-repeat: initial initial;\"></ins>\n <input id=\"row_index\" type=\"hidden\" value=\"\" name=\"row_index\">\n </div>\n </td>\n <td id=\"id\" class=\" \" name=\"id\" style=\"width:7%; margin-right:5px;\">\n <input id=\"id\" class=\"table_td-input\" name=\"table_input-field\" value=\"'.$id.'\" readonly=\"readonly\"/>\n </td>\n <td id=\"email\" class=\" \" name=\"email\">\n <input id=\"email\" class=\"table_td-input\" name=\"table_input-field\" value=\"'.$username.'\" readonly=\"readonly\"/>\n </td>\n <td id=\"date\" class=\" \" name=\"date\">\n <input id=\"date\" class=\"table_td-input\" name=\"table_input-field\" value=\"'.$password.'\" readonly=\"readonly\"/>\n </td>\n <td id=\"date\" class=\" \" name=\"date\">\n <input id=\"date\" class=\"table_td-input\" name=\"table_input-field\" value=\"'.$email.'\" readonly=\"readonly\"/>\n </td>\n <td id=\"date\" class=\" \" name=\"date\">\n <input id=\"date\" class=\"table_td-input\" name=\"table_input-field\" value=\"'.$groupId.'\" readonly=\"readonly\"/>\n </td>\n <td class=\"table-operation\" name=\"table_td-operation\">\n <a name=\"delete_button\" href=\"#\" onclick=\"select_operation(event, '.$id.')\">\n <i id=\"delete\" class=\"fa fa-trash\" title=\"Delete\"></i>\n </a>\n <a name=\"edit_button\" href=\"#\" onclick=\"select_operation(event, '.$id.')\" >\n <i id=\"edit\" class=\"fa fa-pencil\" title=\"Edit\"></i>\n </a>\n <a name=\"load_button\" class=\"op-not-enable\" href=\"#\" onclick=\"select_operation(event, '.$id.')\">\n <i id=\"load\" class=\"fa fa-play-circle\" title=\"Load\"></i>\n </a>\n </td>\n </tr>';\n return $resultObject;\n}", "function GetApproval($exists){\r\n\t\t\r\n\t\t// get needed items\r\n\t\t$groups = get_import_items($this->sql_group_name,$this->sql_group_id,$this->sql_group_table);\r\n\t\tif (!$exists)\r\n\t\t\treturn $groups;\r\n\t\t\r\n\t\t$items = $this->get_keyed_import_items($this->sql_item_data,$this->sql_item_table);\r\n\t\t\r\n\t\t$item_params = $this->sql_item_data;\r\n\t\tif ($this->sql_order_field != '')\r\n\t\t\t$item_params[] = $this->sql_order_field;\r\n\t\t\r\n\t\t$items_exist = false;\r\n\t\t\r\n\t\t// calculate this only once\r\n\t\t$c = count($this->sql_item_data);\r\n\t\t$i = 0;\r\n\t\t\r\n\t\t//\tfor each group\r\n\t\tforeach($this->imported[$this->import_key] as $node){\r\n\t\t\t$i += 1;\r\n\t\t\t\r\n\t\t\t// sanity check here\r\n\t\t\tif (!keys_exist_in($node, array('name','items'), 'content array')){\r\n\t\t\t\techo \"<tr><td colspan=\\\"5\\\">Row $i failed sanity check!</td></tr>\";\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\t// setup the table here if items exist\r\n\t\t\t\tif (!$items_exist){\r\n\t\t\t\t\techo '<table class=\"highlighted\"><tr style=\"background:#000000;color:#ffffff\"><td>' . ucfirst($this->type) . ' Group Name</td><td>Items</td><td>Change Group</td></tr>';\r\n\t\t\t\t\t$items_exist = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// show group name\r\n\t\t\t\techo '<tr><td>' . htmlentities($node['name']) . '</td><td><table>';\t\r\n\t\t\t\t\r\n\t\t\t\t// for each item\r\n\t\t\t\tforeach($node['items'] as $n_item){\r\n\t\t\t\t\r\n\t\t\t\t\tif (!is_array($n_item) || !keys_exist_in($n_item,$item_params,false)){\r\n\t\t\t\t\t\techo \"<tr><td colspan=\" . ($c + 1) . \"><strong>Invalid item!</strong></td></tr>\";\r\n\t\t\t\t\t}else{\r\n\r\n\t\t\t\t\t\t// create the item key and output the stuff\r\n\t\t\t\t\t\t$ikey = '';\r\n\t\t\t\t\t\techo \"<tr><td>\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor($x = 0;$x < $c; $x++){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// modify the data now\r\n\t\t\t\t\t\t\tif ($x == $this->mount_item)\r\n\t\t\t\t\t\t\t\t$n_item[$this->sql_item_data[$x]] = $this->append_mount_point($n_item[$this->sql_item_data[$x]]);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$t_item = $n_item[$this->sql_item_data[$x]];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo htmlentities($t_item);\r\n\t\t\t\t\t\t\t$ikey .= trim($t_item);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($x + 1 < $c)\r\n\t\t\t\t\t\t\t\t$ikey .= ':';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo \"</td><td>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$ikey = md5($ikey);\r\n\r\n\t\t\t\t\t\t// check to see if the item exists already\r\n\t\t\t\t\t\tif (!array_key_exists($ikey,$items)){\r\n\t\t\t\t\t\t\techo \"<input type=\\\"checkbox\\\" name=\\\"$this->type-appr-\" . $ikey . '\" value=\"yes\" checked />';\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\techo '<strong>X</strong>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\techo '</td></tr>';\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// show the option\r\n\t\t\t\techo \"</table></td><td><input type=\\\"checkbox\\\" name=\\\"$this->type-gappr-\" . md5($node['name']) . '\" value=\"yes\" checked /></td></tr>';\r\n\t\t\t\t\t\r\n\t\t\t\t// the group id doesn't really matter when confirming user input, it just needs to be there\r\n\t\t\t\t$groups[$node['name']] = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo \"</table>\";\r\n\t\t\r\n\t\treturn $groups;\r\n\t}", "public function generateGroup( $row )\n {\n if ( !isset($row) ) return null;\n $Group = new Group();\n $Group->id = (int)$row['id'];\n $Group->name = $row['name'];\n return $Group;\n }", "function getGroupData($chamberId) {\r\n $sql = $this->db->prepare(\"SELECT DISTINCT(g.groupID), g.name, g.mailchimp_list_id, COUNT(gm.groupID) FROM GROUPS AS g LEFT OUTER JOIN GROUPMEMBERS as gm ON g.groupID = gm.groupID WHERE g.chamberID=:chamber_id GROUP BY g.groupID ORDER BY COUNT(gm.groupID) DESC\");\r\n if ($sql->execute(array(\r\n \"chamber_id\" => $chamberId\r\n ))) {\r\n $groups = $sql->fetchAll(PDO::FETCH_ASSOC);\r\n return $groups;\r\n }\r\n return false;\r\n }", "public function afterSave($object)\n {\n \n $websiteId = Mage::app()->getStore($object->getStoreId())->getWebsiteId();\n $isGlobal = $this->getAttribute()->isScopeGlobal() || $websiteId == 0;\n $groupRows = $object->getData($this->getAttribute()->getName());\n \n \n \n if (empty( $groupRows)) {\n $this->_getResource()->deleteGroupData($object->getId());\n return $this;\n }\n \n $old = array();\n $new = array();\n \n $origGroupRows = $object->getOrigData($this->getAttribute()->getName());\n if (!is_array( $origGroupRows )) {\n $origGroupRows = array();\n }\n foreach ( $origGroupRows as $data) {\n if ($data['website_id'] > 0 || ($data['website_id'] == '0' && $isGlobal)) {\n $key = join('-', array_merge(\n array($data['website_id'], $data['cust_group']),\n $this->_getAdditionalUniqueFields($data)\n ));\n $old[$key] = $data;\n }\n }\n \n // prepare data for save\n foreach ($groupRows as $data) {\n $hasEmptyData = false;\n foreach ($this->_getAdditionalUniqueFields($data) as $field) {\n if (empty($field)) {\n $hasEmptyData = true;\n break;\n }\n }\n\n if ($hasEmptyData || !isset($data['cust_group']) || !empty($data['delete'])) {\n continue;\n }\n if ($this->getAttribute()->isScopeGlobal() && $data['website_id'] > 0) {\n continue;\n }\n if (!$isGlobal && (int)$data['website_id'] == 0) {\n continue;\n }\n\n if(!isset($data['website_id'])) $data['website_id'] =0;\n \n $key = join('-', array_merge(\n array($data['website_id'], $data['cust_group']),\n $this->_getAdditionalUniqueFields($data)\n ));\n\n $useForAllGroups = $data['cust_group'] == Mage_Customer_Model_Group::CUST_GROUP_ALL;\n $customerGroupId = !$useForAllGroups ? $data['cust_group'] : 0;\n\n \n $new[$key] = array_merge(array(\n 'website_id' => $data['website_id'],\n 'all_groups' => $useForAllGroups ? 1 : 0,\n 'customer_group_id' => $customerGroupId,\n 'value' => $data['value'],\n ), $this->_getAdditionalUniqueFields($data));\n }\n\n $delete = array_diff_key($old, $new);\n $insert = array_diff_key($new, $old);\n $update = array_intersect_key($new, $old);\n\n $isChanged = false;\n $productId = $object->getId();\n\n if (!empty($delete)) {\n foreach ($delete as $data) {\n $this->_getResource()->deleteGroupData($productId, null, $data['group_id']);\n $isChanged = true;\n }\n }\n\n if (!empty($insert)) {\n foreach ($insert as $data) {\n $group = new Varien_Object($data);\n $group->setEntityId($productId);\n $this->_getResource()->saveGroupData($group);\n\n $isChanged = true;\n }\n }\n\n if (!empty($update)) {\n foreach ($update as $k => $v) {\n \n \n \n if ($old[$k]['value'] != $v['value']) {\n $group = new Varien_Object(array(\n 'value_id' => $old[$k]['value_id'],\n 'value' => $v['value']\n ));\n $this->_getResource()->saveGroupData($group);\n\n $isChanged = true;\n }\n }\n }\n\n if ($isChanged) {\n $valueChangedKey = $this->getAttribute()->getName() . '_changed';\n $object->setData($valueChangedKey, 1);\n }\n \n \n \n \n \n \n \n \n \n \n \n \n \n /*$websiteId = Mage::app()->getStore($object->getStoreId())->getWebsiteId();\n $isGlobal = $this->getAttribute()->isScopeGlobal() || $websiteId == 0;\n\n $priceRows = $object->getData($this->getAttribute()->getName());\n if (empty($priceRows)) {\n if ($isGlobal) {\n $this->_getResource()->deletePriceData($object->getId());\n } else {\n $this->_getResource()->deletePriceData($object->getId(), $websiteId);\n }\n return $this;\n }\n\n $old = array();\n $new = array();\n\n // prepare original data for compare\n $origGroupPrices = $object->getOrigData($this->getAttribute()->getName());\n if (!is_array($origGroupPrices)) {\n $origGroupPrices = array();\n }\n foreach ($origGroupPrices as $data) {\n if ($data['website_id'] > 0 || ($data['website_id'] == '0' && $isGlobal)) {\n $key = join('-', array_merge(\n array($data['website_id'], $data['cust_group']),\n $this->_getAdditionalUniqueFields($data)\n ));\n $old[$key] = $data;\n }\n }\n\n // prepare data for save\n foreach ($priceRows as $data) {\n $hasEmptyData = false;\n foreach ($this->_getAdditionalUniqueFields($data) as $field) {\n if (empty($field)) {\n $hasEmptyData = true;\n break;\n }\n }\n\n if ($hasEmptyData || !isset($data['cust_group']) || !empty($data['delete'])) {\n continue;\n }\n if ($this->getAttribute()->isScopeGlobal() && $data['website_id'] > 0) {\n continue;\n }\n if (!$isGlobal && (int)$data['website_id'] == 0) {\n continue;\n }\n\n $key = join('-', array_merge(\n array($data['website_id'], $data['cust_group']),\n $this->_getAdditionalUniqueFields($data)\n ));\n\n $useForAllGroups = $data['cust_group'] == Mage_Customer_Model_Group::CUST_GROUP_ALL;\n $customerGroupId = !$useForAllGroups ? $data['cust_group'] : 0;\n\n $new[$key] = array_merge(array(\n 'website_id' => $data['website_id'],\n 'all_groups' => $useForAllGroups ? 1 : 0,\n 'customer_group_id' => $customerGroupId,\n 'value' => $data['price'],\n ), $this->_getAdditionalUniqueFields($data));\n }\n\n $delete = array_diff_key($old, $new);\n $insert = array_diff_key($new, $old);\n $update = array_intersect_key($new, $old);\n\n $isChanged = false;\n $productId = $object->getId();\n\n if (!empty($delete)) {\n foreach ($delete as $data) {\n $this->_getResource()->deletePriceData($productId, null, $data['price_id']);\n $isChanged = true;\n }\n }\n\n if (!empty($insert)) {\n foreach ($insert as $data) {\n $price = new Varien_Object($data);\n $price->setEntityId($productId);\n $this->_getResource()->savePriceData($price);\n\n $isChanged = true;\n }\n }\n\n if (!empty($update)) {\n foreach ($update as $k => $v) {\n if ($old[$k]['price'] != $v['value']) {\n $price = new Varien_Object(array(\n 'value_id' => $old[$k]['price_id'],\n 'value' => $v['value']\n ));\n $this->_getResource()->savePriceData($price);\n\n $isChanged = true;\n }\n }\n }\n\n if ($isChanged) {\n $valueChangedKey = $this->getAttribute()->getName() . '_changed';\n $object->setData($valueChangedKey, 1);\n }*/\n\n return $this;\n }", "protected function _prepareDataForUpdate(array $rowData):array\n {\n $multiSeparator = $this->getMultipleValueSeparator();\n $email = strtolower($rowData[self::COLUMN_EMAIL]);\n $customerId = $this->_getCustomerId($email, $rowData[self::COLUMN_WEBSITE]);\n // entity table data\n $entityRowNew = [];\n $entityRowUpdate = [];\n // attribute values\n $attributes = [];\n // customer default addresses\n $defaults = [];\n $newAddress = true;\n // get address id\n if ($rowData[self::COLUMN_ADDRESS_ID]\n && $this->addressStorage->doesExist(\n $rowData[self::COLUMN_ADDRESS_ID],\n (string)$customerId\n )\n ) {\n $newAddress = false;\n $addressId = $rowData[self::COLUMN_ADDRESS_ID];\n } else {\n $addressId = $this->_getNextEntityId();\n }\n $entityRow = [\n 'entity_id' => $addressId,\n 'parent_id' => $customerId,\n 'updated_at' => (new \\DateTime())->format(\\Magento\\Framework\\Stdlib\\DateTime::DATETIME_PHP_FORMAT),\n ];\n $websiteId = $this->_websiteCodeToId[$rowData[self::COLUMN_WEBSITE]];\n\n foreach ($this->_attributes as $attributeAlias => $attributeParams) {\n if (array_key_exists($attributeAlias, $rowData)) {\n $attributeParams = $this->adjustAttributeDataForWebsite($attributeParams, $websiteId);\n\n if (!strlen($rowData[$attributeAlias])) {\n if ($newAddress) {\n $value = null;\n } else {\n continue;\n }\n } elseif ($newAddress && !strlen($rowData[$attributeAlias])) {\n } elseif (in_array($attributeParams['type'], ['select', 'boolean'])) {\n $value = $this->getSelectAttrIdByValue($attributeParams, mb_strtolower($rowData[$attributeAlias]));\n } elseif ('datetime' == $attributeParams['type']) {\n $value = (new \\DateTime())->setTimestamp(strtotime($rowData[$attributeAlias]));\n $value = $value->format(\\Magento\\Framework\\Stdlib\\DateTime::DATETIME_PHP_FORMAT);\n } elseif ('multiselect' == $attributeParams['type']) {\n $ids = [];\n foreach (explode($multiSeparator, mb_strtolower($rowData[$attributeAlias])) as $subValue) {\n $ids[] = $this->getSelectAttrIdByValue($attributeParams, $subValue);\n }\n $value = implode(',', $ids);\n } else {\n $value = $rowData[$attributeAlias];\n }\n if ($attributeParams['is_static']) {\n $entityRow[$attributeAlias] = $value;\n } else {\n $attributes[$attributeParams['table']][$addressId][$attributeParams['id']]= $value;\n }\n }\n }\n foreach (self::getDefaultAddressAttributeMapping() as $columnName => $attributeCode) {\n if (!empty($rowData[$columnName])) {\n /** @var $attribute \\Magento\\Eav\\Model\\Entity\\Attribute\\AbstractAttribute */\n $table = $this->_getCustomerEntity()->getResource()->getTable('customer_entity');\n $defaults[$table][$customerId][$attributeCode] = $addressId;\n }\n }\n // let's try to find region ID\n $entityRow['region_id'] = null;\n if (!empty($rowData[self::COLUMN_REGION])) {\n $countryNormalized = strtolower($rowData[self::COLUMN_COUNTRY_ID]);\n $regionNormalized = strtolower($rowData[self::COLUMN_REGION]);\n\n if (isset($this->_countryRegions[$countryNormalized][$regionNormalized])) {\n $regionId = $this->_countryRegions[$countryNormalized][$regionNormalized];\n $entityRow[self::COLUMN_REGION] = $this->_regions[$regionId];\n $entityRow['region_id'] = $regionId;\n }\n }\n if ($newAddress) {\n $entityRowNew = $entityRow;\n $entityRowNew['created_at'] =\n (new \\DateTime())->format(\\Magento\\Framework\\Stdlib\\DateTime::DATETIME_PHP_FORMAT);\n } else {\n $entityRowUpdate = $entityRow;\n }\n\n return [\n 'entity_row_new' => $entityRowNew,\n 'entity_row_update' => $entityRowUpdate,\n 'attributes' => $attributes,\n 'defaults' => $defaults\n ];\n }", "abstract protected function _buildGroupBy( $group );", "public function run()\n {\n //\n $data = [[\n 'id_group' => '1',\n 'uid' => 'linhluv1',\n 'add_uid' => 'linhluv1',\n 'role' => 2, //2 is admin\n 'join_date' => new DateTime('2018-10-20'),\n\n ], [\n 'id_group' => '1',\n 'uid' => 'linhluv3',\n 'add_uid' => 'linhluv1',\n 'role' => 0,\n 'join_date' => new DateTime('2018-10-20'),\n\n ], [\n 'id_group' => '1',\n 'uid' => 'linhluv4',\n 'add_uid' => 'linhluv1',\n 'role' => 0,\n 'join_date' => new DateTime('2018-10-21'),\n ], [\n 'id_group' => '2',\n 'uid' => 'linhluv5',\n 'add_uid' => 'linhluv5',\n 'role' => 2, //2 is admin\n 'join_date' => new DateTime('2018-10-21'),\n ], [\n 'id_group' => '3',\n 'uid' => 'linhluv3',\n 'add_uid' => 'linhluv3',\n 'role' => 2, //2 is admin\n 'join_date' => new DateTime('2018-10-21'),\n ], [\n 'id_group' => '4',\n 'uid' => 'linhluv4',\n 'add_uid' => 'linhluv4',\n 'role' => 2, //2 is admin\n 'join_date' => new DateTime('2018-10-21'),\n ], [\n 'id_group' => '5',\n 'uid' => 'linhluv2',\n 'add_uid' => 'linhluv2',\n 'role' => 2, //2 is admin\n 'join_date' => new DateTime('2018-10-21'),\n ]];\n\n DB::table('GroupMember')->insert($data);\n }", "protected function _prepareRowForDb(array $rowData)\n {\n $rowData = $this->_customFieldsMapping($rowData);\n\n $rowData = parent::_prepareRowForDb($rowData);\n\n static $lastSku = null;\n\n if (Import::BEHAVIOR_DELETE == $this->getBehavior()) {\n return $rowData;\n }\n\n $lastSku = $rowData[self::COL_SKU];\n\n if ($this->isSkuExist($lastSku)) {\n $newSku = $this->skuProcessor->getNewSku($lastSku);\n $rowData[self::COL_ATTR_SET] = $newSku['attr_set_code'];\n $rowData[self::COL_TYPE] = $newSku['type_id'];\n }\n\n return $rowData;\n }", "public function groupIds();", "private function checkGridRows(array $rowData)\n {\n # Check first if data key exists on passed row data array.\n if (array_key_exists('data', $rowData) === true) {\n $rowArr = $rowData['data'];\n foreach ($rowArr as $column => $cell) {\n # Check if the cell variable is array or not, and then convert the cell value.\n if (is_array($cell) === true and array_key_exists('value', $cell) === true) {\n $cell['value'] = $this->doConvertBrToNl($cell['value']);\n } else {\n $cell = $this->doConvertBrToNl($cell);\n }\n $rowData['data'][$column] = $cell;\n }\n }\n # Return the row data.\n return $rowData;\n }", "private function generateSingleRow(& $data)\n {\n $id=$data['id'];\n\t\t$format=$data['format'];\n\t\tforeach($data['data'] as $key=>$value)\n\t\t{\n\t\t\t$search=\"{\".$id.\":\".$key.\"}\";\n\t\t\t$this->_search[]=$search;\n\n\t\t\t//if it needs formating\n\t\t\tif(isset($format[$key]))\n\t\t\t{\n\t\t\t\tforeach($format[$key] as $ftype=>$f)\n\t\t\t\t{\n\t\t\t\t\t$value=$this->formatValue($value,$ftype,$f);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_replace[]=$value;\n\t\t}\n }", "public static function _prepareSortable() {\n $data = [];\n $sortableGroupField = static::getSortableGroupField();\n $sortableField = static::getSortableField();\n foreach(static::all() as $row) {\n $keyParts = [];\n foreach ($sortableGroupField as $sgf) {\n $keyParts[] = $row->{$sortableGroupField};\n }\n $key = implode('_',$keyParts);\n if ($sortableGroupField) {\n $data[$key][] = $row;\n } else {\n $data[0][$row];\n }\n }\n\n foreach ($data as $group => $groupData ) {\n $i = 0;\n foreach ($groupData as $row) {\n $row->{$sortableField} = ++$i;\n $row->save();\n echo sprintf(\"row %d was orderer<br>\\n\",$row->id);\n }\n }\n }", "private static function fromRow($row){\n $permissions = self::fetchPermissions($row['id']);\n if($permissions === null) return null;\n $output = new Group($row['name'], $permissions);\n $output->setModified($row['modified']);\n $output->setId($row['id']);\n $output->setNew(false);\n return $output;\n }", "protected function _processData() {\n $result = $this->getSelect()->query()->fetchAll();\n if ($mainReportResults = $this->getMainReportResults()) {\n $toReturn = array();\n $list = $this->_helper()->getList($mainReportResults, $this->_compareAttribute);\n foreach ($result as $row) {\n $toReturn[array_search($row[$this->_compareAttribute], $list)] = $row;\n }\n $result = $toReturn;\n }\n return $result;\n }", "protected function filter_row(&$row) {}", "public function get_app_user_id_for_group_message($group_message_id)\n\t{\n\t\t$return_array=array();\n\t\t$i=0;\n\t\t\n\t\t$query=$this->db->get_where('app_user',array('ref_app_user_device_type_id'=>ANDROID_DEVICE_TYPE_ID,'app_user_activation'=>1));\n\t\t$app_user_id_array=$query->result_array();\n\t\tforeach($app_user_id_array as $app_user_id_1)\n\t\t{\n\t\t\t$app_user_id=$app_user_id_1['app_user_id'];\n\t\t$sql_group_message_or_gate=\"SELECT * FROM (SELECT group_message_id FROM group_message where group_message_id=$group_message_id and is_condition_or_gate=1 AND (\n CASE WHEN is_condition_birth_year=1 then condition_birth_year=(SELECT YEAR(app_user_birth_date) FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id) \n ELSE FALSE\n END \n OR\n CASE WHEN is_condition_birth_month=1 then condition_birth_month=(SELECT MONTH(app_user_birth_date) FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id)\n ELSE FALSE\n END \n OR\n CASE WHEN is_condition_age_range=1 then (SELECT FLOOR(DATEDIFF (CURRENT_DATE, `app_user_birth_date`)/365) AS age FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id) BETWEEN condition_age_starting_range AND condition_age_ending_range\n ELSE FALSE\n END \n OR\n CASE WHEN is_condition_sex=1 then condition_sex=(SELECT app_user_sex FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id)\n ELSE FALSE\n END \n OR\n CASE WHEN is_condition_city=1 then LOWER(condition_city_name) LIKE (SELECT LOWER(app_user_city) FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id)\n ELSE FALSE\n END \n OR\n CASE WHEN is_condition_post_code=1 then condition_post_code=(SELECT app_user_post_code FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id)\n ELSE FALSE\n END \n )\n ) as group_message_or_gate \";\n\t\t$sql_group_message_and_gate=\"SELECT group_message_id FROM (SELECT * FROM group_message where group_message_id=$group_message_id and is_condition_and_gate=1 AND \n\t\tCASE WHEN is_condition_birth_year=1 then condition_birth_year=(SELECT YEAR(app_user_birth_date) FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id) \n\t\tELSE TRUE \n\t\tEND \n\t\tAND \n\t\tCASE WHEN is_condition_birth_month=1 then condition_birth_month=(SELECT MONTH(app_user_birth_date) FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id) \n\t\tELSE TRUE \n\t\tEND \n\t\tAND \n\t\tCASE WHEN is_condition_age_range=1 then (SELECT FLOOR(DATEDIFF (CURRENT_DATE, `app_user_birth_date`)/365) AS age FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id) BETWEEN condition_age_starting_range AND condition_age_ending_range \n\t\tELSE TRUE \n\t\tEND \n\t\tAND \n\t\tCASE WHEN is_condition_sex=1 then condition_sex=(SELECT app_user_sex FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id) \n\t\tELSE TRUE \n\t\tEND \n\t\tAND \n\t\tCASE WHEN is_condition_city=1 then LOWER(condition_city_name) LIKE (SELECT LOWER(app_user_city) FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id) \n\t\tELSE TRUE \n\t\tEND \n\t\tAND \n\t\tCASE WHEN is_condition_post_code=1 then condition_post_code=(SELECT app_user_post_code FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id) \n\t\tELSE TRUE \n\t\tEND \n\t\t) as group_message_and_gate\";\n\t\t\n\t\t\n\t\t$sql_final=\"SELECT * FROM (SELECT * FROM message JOIN \n\t\t(SELECT * FROM group_message where group_message_id in( \".$sql_group_message_or_gate.\" \n\t\tUNION \".$sql_group_message_and_gate.\" \n\t\t)) as group_message_or_and ON (message.message_id=group_message_or_and.ref_group_message_message_id) \n\t\t \n\t\t ) as final_message\n\t\tWHERE final_message.message_active=1 \";\n\t\t$query=$this->db->query($sql_final);\n\t\tif($query->num_rows()==1)\n\t\t{\n\t\t\t$return_array[$i]=$app_user_id_1['app_user_device_id'];;\n\t\t\t$i++;\n\t\t}\n\t\t}\n\t\treturn $return_array;\n\n\t}", "public function changeRowData(&$row){}", "public static function regroup ($data, $regroupByColumn, $removeGroupColumn = true, $regroupedColumnKnownUnique = false)\r\n\t{\r\n\t\t# Return the data unmodified if not an array or empty\r\n\t\tif (!is_array ($data) || empty ($data)) {return $data;}\r\n\t\t\r\n\t\t# Rearrange the data\r\n\t\t$rearrangedData = array ();\r\n\t\tforeach ($data as $key => $values) {\r\n\t\t\t$grouping = $values[$regroupByColumn];\r\n\t\t\tif ($removeGroupColumn) {\r\n\t\t\t\tunset ($data[$key][$regroupByColumn]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t# Add the data; if the regroup-by column is known to be unique, then don't create a nested array\r\n\t\t\tif ($regroupedColumnKnownUnique) {\r\n\t\t\t\t$rearrangedData[$grouping] = $data[$key];\r\n\t\t\t} else {\r\n\t\t\t\t$rearrangedData[$grouping][$key] = $data[$key];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t# Return the data\r\n\t\treturn $rearrangedData;\r\n\t}", "public function distributeInquiriesToAgents(){\n \t$college_id = 6731;\n \t$org_branch_id = 254;\n \t$arr = array(292, 293, 294, 295, 296, 298 );\n\n \t$qry = Recruitment::on('bk')->where('college_id', $college_id)->select('user_id')->get();\n\n \t$arr_cnt = count($arr);\n\n \t$counter = 0;\n \tforeach ($qry as $key) {\n \t\tif ($counter > $arr_cnt -1) {\n \t\t\t$counter = 0;\n \t\t}\n\n \t\t//print_r(\"user_id \". $key->user_id. \" college_id 6731 org_portal_id \". $arr[$counter] . \"<br>\");\n\n \t\t$attr = array(\"user_id\" => $key->user_id, \"college_id\" => $college_id, \"org_portal_id\" => $arr[$counter]);\n \t\t$val = array(\"user_id\" => $key->user_id, \"college_id\" => $college_id, \"org_portal_id\" => $arr[$counter]);\n\n \t\tRecruitmentTag::updateOrCreate($attr, $val);\n \t\t$counter++;\n \t}\n\n \treturn \"success\";\n }", "function AggregateListRowValues() {\n\t}", "function AggregateListRowValues() {\n\t}", "function AggregateListRowValues() {\n\t}", "function AggregateListRowValues() {\n\t}", "public function populateId($groupId){\n\t\t\t$sql = \"SELECT * FROM usergroup WHERE groupId = '\".mysql_real_escape_string($groupId).\"'\";\n\t\t\t$row = $this->conn->getDataRow($sql);\n\t\t\tif($row == null)\n\t\t\t\treturn false;\n\t\t\t$this->getRow($row);\n\t\t}", "public function aggregateListRowValues()\n\t{\n\t}", "public function aggregateListRowValues()\n\t{\n\t}", "function groupByHeader(&$conf,$GBCode,$menuRow,&$groupBy,&$lastgroupBy,&$evalGroupBy,$GrpByField,&$lc,&$gc,&$i,&$pagejump,&$sql,$end=false,&$DEBUG,$nbrow) {\n\t\t// group by field handling\n\t\t//if ($end) return;\n\t\t$GBmarkerArray=array();\n\t\t$groupByFields=\"\";\n\t\t$gbflag=0;\n\t\t$newGroupBy=array();\n\t\tif ($conf['list.']['groupByFieldBreaks']) {\n\t\t\t$fNA=t3lib_div::trimexplode(',',$conf['list.']['groupByFieldBreaks']);\n\t\t\tforeach($fNA as $fN) {\n\t\t\t\t$fN2=t3lib_div::trimexplode(':',$fN);\n\t\t\t\t$fN=$fN2[0];\n\t\t\t\t//if ($conf['list.']['hiddenGroupByField.'][$fN]) continue;\n\n\t\t\t\t$GBmarkerArray['###GROUPBY_'.$fN.'###']=\"\";\n\t\t\t\t//error_log(__METHOD__.\": -\".$groupBy[$fN].\"!==\".$this->metafeeditlib->transformGroupByData($fN,$menuRow[$GrpByField[$fN]?$GrpByField[$fN]:$fN],$conf));\n\t\t\t\tif (($groupBy[$fN]!==$this->metafeeditlib->transformGroupByData($fN,$menuRow[$GrpByField[$fN]?$GrpByField[$fN]:$fN],$conf) || $end) && !$conf['list.']['hiddenGroupByField.'][$fN]) {\n\t\t\t\t\t// Group by field change !\n\t\t\t\t\t$GBmarkerArray['###FOOTERSUM_'.$fN.'_FIELD_metafeeditnbelts###']='';\n\t\t\t\t\t//error_log(__METHOD__.\": aa- $nbrow : \".$evalGroupBy[$fN]);\n\t\t\t\t\tif ($nbrow>1) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$GBmarkerArray['###GROUPBYFOOTER_'.$fN.'###']=$evalGroupBy[$fN]; \n\t\t\t\t\t\t$this->metafeeditlib->getGroupByFooterSums($conf,'FOOTERSUM',$GBmarkerArray,$fN,$sql,$lastgroupBy,$end,$DEBUG);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$GBCode=$this->cObj->substituteSubpart($GBCode, '###GROUPBYFOOTERFIELD_'.$fN.'###','');\n\t\t\t\t\t}\n\t\t\t\t\t$std=$menuRow[$fN];\n\n\t\t\t\t\t// Default we get value from std group by field ...\n\t\t\t\t\tif ($GrpByField[$fN]) {\n\t\t\t\t\t $std=$menuRow[$GrpByField[$fN]];\n\t\t\t\t\t if ($menuRow['EVAL_'.str_replace('.','_',$GrpByField[$fN])]) $std=$menuRow['EVAL_'.str_replace('.','_',$GrpByField[$fN])];\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t// stdWrap on group by.\t\t\n\t\t\t\t\t$_fN=str_replace('.','_',$fN);\n\t\t\t\t\tif ($conf['list.']['groupByFields.']['stdWrap.'][$_fN.'.']) {\n\t\t\t\t\t $this->cObj->start($menuRow,$this->theTable);\n\t\t\t\t\t $std=$this->cObj->stdWrap($std,$conf['list.']['groupByFields.']['stdWrap.'][$_fN.'.']);\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t// ??? \t\n\t\t\t\t\t\n\t\t\t\t\tif ($GrpByField[$fN]) {\n\t\t\t\t\t\t$newGroupBy[$fN]=$menuRow[$GrpByField[$fN]];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$newGroupBy[$fN]=$menuRow[$fN];\n\t\t\t\t\t\tif ($menuRow['EVAL_'.$_fN]) $std=$menuRow['EVAL_'.$_fN];\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\t\t// we set group by flag\n\t\t\t\t\t$gbflag=1;\n\t\t\t\t\t$GBmarkerArray['###GROUPBY_'.$fN.'###']=$std;\n\t\t\t\t\t$evalGroupBy[$fN]=$std;\n\t\t\t\t\t// We have to reset all son groupbys so that the headers will be regenerated...\n\t\t\t\t\t$resetgbf=FALSE;\n\t\t\t\t\tif (is_array($groupBy)) foreach ($groupBy as $gbf=>$val) {\n\t\t\t\t\t\tif ( $resetgbf) unset($groupBy[$gbf]);\n\t\t\t\t\t\tif ($gbf==$fN) $resetgbf=TRUE;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// we clear unused group bys \n\t\t\t\t\t$GBCode=$this->cObj->substituteSubpart($GBCode, '###GROUPBYFIELD_'.$fN.'###','');\n\t\t\t\t\t$GBCode=$this->cObj->substituteSubpart($GBCode, '###GROUPBYFOOTERFIELD_'.$fN.'###','');\n\t\t\t\t}\n\t\t\t\t// We clear next group by if end of list is reached\n\t\t\t\tif ($end) $GBCode=$this->cObj->substituteSubpart($GBCode, '###GROUPBYFIELD_'.$fN.'###','');\n\t\t\t}\n\t\t\tforeach($newGroupBy as $fN=>$val) {\n\t\t\t\t$groupBy[$fN]=$this->metafeeditlib->transformGroupByData($fN,$val,$conf);\n\t\t\t\t//$lastgroupBy[$fN]=$menuRow[$GrpByField[$fN]?$GrpByField[$fN]:$fN];\n\t\t\t\t$lastgroupBy[$fN]=$this->metafeeditlib->transformGroupByData($fN,$menuRow[$GrpByField[$fN]?$GrpByField[$fN]:$fN],$conf);\n\t\t\t}\n\t\t}\n\t\tif ($gbflag) {\n\t\t\t$groupByFields=$this->cObj->substituteMarkerArray($GBCode, $GBmarkerArray);\n\t\t\t$gc++;\n\t\t\t// Jump page on group by\n\t\t\tif ($gc>1 && $conf['list.']['jumpPageOnGroupBy']) {\n\t\t\t $pagejump=1;\n\t\t\t}\n\t\t\tif ($conf['list.']['groupBySize']) {\n\t\t\t\t$lc=$lc+$conf['list.']['groupBySize'];\n\t\t\t}\n\t\t\tif ($conf['list.']['no_detail']) $lc++; //MMM\n\n\t\t\tif ($gc>1 && $dispDir=='Right') $lc++;\n\t\t\t$i=0; // pour fin de ligne\n\t\t}\n\t\t//error_log(__METHOD__.\"end: -\".print_r($groupByFields,true)); \n\t\treturn $groupByFields;\n\t}", "function group_data($data_awal_perolehan, $data_akhir_perolehan, $data_hapus_awal, $tgl_akhir = \"\", $tgl_awal = \"\")\n{\n\n //tes\n $data_awal = array();\n\n foreach ($data_awal_perolehan as $arg) {\n $data_awal[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'Kelompok' ] = $arg[ 'kelompok' ];\n\n $data_awal[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'TahunPenyusutan' ] = $arg[ 'TahunPenyusutan' ];\n $data_awal[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'Aset_ID' ] = $arg[ 'Aset_ID' ];\n $data_awal[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'Tahun' ] = $arg[ 'Tahun' ];\n\n $data_awal[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'TglPembukuan' ] = $arg[ 'TglPembukuan' ];\n $data_awal[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'Aset_ID' ] = $arg[ 'Aset_ID' ];\n $data_awal[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'kodeSatker' ] = \"{$arg['kodeSatker']}\";\n $data_awal[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'kodeKelompok' ] = \"{$arg['kelompok']}\";\n\n\n $data_awal[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'Uraian' ] = $arg[ 'Uraian' ];\n $data_awal[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'nilai' ] += $arg[ 'nilai' ];\n $data_awal[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'PP' ] += $arg[ 'PP' ];\n $data_awal[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'AP' ] += $arg[ 'AP' ];\n $data_awal[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'NB' ] += $arg[ 'NB' ];\n $data_awal[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'jml' ] += 1;\n }\n\n $data_akhir = array();\n\n foreach ($data_akhir_perolehan as $arg) {\n $data_akhir[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'Kelompok' ] += $arg[ 'kelompok' ];\n\n $data_akhir[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'TahunPenyusutan' ] = $arg[ 'TahunPenyusutan' ];\n $data_akhir[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'Aset_ID' ] = $arg[ 'Aset_ID' ];\n $data_akhir[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'Tahun' ] = $arg[ 'Tahun' ];\n\n $data_akhir[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'TglPembukuan' ] = $arg[ 'TglPembukuan' ];\n $data_akhir[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'Aset_ID' ] = $arg[ 'Aset_ID' ];\n $data_akhir[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'kodeSatker' ] = \"{$arg['kodeSatker']}\";\n $data_akhir[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'kodeKelompok' ] = \"{$arg['kelompok']}\";\n\n $data_akhir[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'Uraian' ] = $arg[ 'Uraian' ];\n $data_akhir[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'nilai' ] += $arg[ 'nilai' ];\n $data_akhir[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'PP' ] += $arg[ 'PP' ];\n $data_akhir[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'AP' ] += $arg[ 'AP' ];\n $data_akhir[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'NB' ] += $arg[ 'NB' ];\n $data_akhir[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'jml' ] += 1;\n }\n\n $data_hapus_tmp = array();\n\n foreach ($data_hapus_awal as $arg) {\n $data_hapus_tmp[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'Kelompok' ] += $arg[ 'kelompok' ];\n $data_hapus_tmp[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'Uraian' ] += $arg[ 'Uraian' ];\n $data_hapus_tmp[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'nilai' ] += $arg[ 'nilai' ];\n $data_hapus_tmp[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'PP' ] += $arg[ 'PP' ];\n $data_hapus_tmp[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'AP' ] += $arg[ 'AP' ];\n $data_hapus_tmp[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'NB' ] += $arg[ 'NB' ];\n\n $data_hapus_tmp[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'Aset_ID' ] = $arg[ 'Tahun' ];\n $data_hapus_tmp[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'TglPembukuan' ] = $arg[ 'TglPembukuan' ];\n $data_hapus_tmp[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'Aset_ID' ] = $arg[ 'Aset_ID' ];\n $data_hapus_tmp[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'kodeSatker' ] = \"{$arg['kodeSatker']}\";\n $data_hapus_tmp[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'kodeKelompok' ] = \"{$arg['kelompok']}\";\n\n $data_hapus_tmp[ $arg[ 'kelompok' ] . '.' . $arg[ 'Tahun' ] . '-' . $arg[ 'noRegister' ] . '-' . $arg[ 'Aset_ID' ] ][ 'jml' ] += 1;\n }\n\n\n $result = array_intersect ($data_awal, $data_akhir);\n//memasukan nilai selisih\n $data_gabungan = array();\n foreach ($result as $key => $value) {\n $tipe = $key;\n $selisih_nilai = $data_akhir[ $tipe ][ 'nilai' ] - $data_awal[ $tipe ][ 'nilai' ];\n $selisih_jml = $data_akhir[ $tipe ][ 'jml' ] - $data_awal[ $tipe ][ 'jml' ];\n $selisih_ap = $data_akhir[ $tipe ][ 'AP' ] - $data_awal[ $tipe ][ 'AP' ];\n $selisih_pp = $data_akhir[ $tipe ][ 'PP' ] - $data_awal[ $tipe ][ 'PP' ];\n $selisih_nb = $data_akhir[ $tipe ][ 'NB' ] - $data_awal[ $tipe ][ 'NB' ];\n\n\n $selisih_nilai_tambah = 0;\n $selisih_nilai_kurang = 0;\n $selisih_jml_tambah = 0;\n $selisih_jml_kurang = 0;\n $selisih_ap_tambah = 0;\n $selisih_ap_kurang = 0;\n $selisih_nb_tambah = 0;\n $selisih_nb_kurang = 0;\n $bp = 0;\n\n /*$selisih_pp_tambah=0;\n $selisih_pp_kurang=0;*/\n if($data_akhir[ $tipe ][ kodeSatker ] == \"\") {\n $data_selisih = $data_awal;\n $selisih_nilai_tambah = 0;\n $selisih_nilai_kurang = $data_awal[ $tipe ][ 'nilai' ];\n $selisih_jml_tambah = 0;\n $selisih_jml_kurang = 1;\n $selisih_ap_tambah = 0;\n $selisih_ap_kurang = $data_awal[ $tipe ][ 'AP' ];\n $selisih_nb_tambah = 0;\n $selisih_nb_kurang = $data_awal[ $tipe ][ 'NB' ];\n $bp = 0;\n\n } else {\n $data_selisih = $data_akhir;\n $kodesatker = $data_selisih[ $tipe ][ kodeSatker ];\n $aset_id = $data_selisih[ $tipe ][ Aset_ID ];\n $kodeKelompok = $data_selisih[ $tipe ][ 'kodeKelompok' ];\n $tglperolehan = $tgl_akhir;\n\n $tglpembukuan = $data_selisih[ $tipe ][ 'TglPembukuan' ];\n list($bp, $selisih_nilai_tambah, $selisih_nilai_kurang, $selisih_ap_tambah, $selisih_ap_kurang) =\n history_aset ($kodesatker, $aset_id, $tglperolehan, $tgl_awal, $tglpembukuan, $kodeKelompok);\n }\n\n\n /*if($selisih_nilai<0)\n $selisih_nilai_kurang=abs($selisih_nilai);\n else $selisih_nilai_tambah=$selisih_nilai;*/\n\n if($selisih_jml < 0)\n $selisih_jml_kurang = abs ($selisih_jml);\n else $selisih_jml_tambah = $selisih_jml;\n\n\n /* if($data_akhir[$tipe]['nilai']!=0 && $data_awal[$tipe]['nilai']!=0 && $selisih_nilai!=0){\n if($selisih_ap<0)\n $selisih_ap_kurang=abs($selisih_ap);\n else $selisih_ap_tambah=$selisih_ap;\n }\n\n if($data_akhir[$tipe]['AP']==\"\"||$data_akhir[$tipe]['AP']==0)\n $selisih_ap_kurang=abs($selisih_ap);\n else if($data_awal[$tipe]['AP']==\"\"||$data_awal[$tipe]['AP']==0)\n $selisih_ap_tambah=$selisih_ap;\n\n $data_gabungan[$tipe]['bp']=$selisih_ap-$selisih_ap_tambah+$selisih_ap_kurang;\n\n if($selisih_nb<0)\n $selisih_nb_kurang=abs($selisih_nb);\n else\n $selisih_nb_tambah=$selisih_nb;\n\n if($selisih_pp<0)\n $selisih_pp_kurang=$selisih_pp;\n else\n $selisih_pp_tambah=$selisih_pp;*/\n\n $data_gabungan[ $tipe ][ 'Kelompok' ] = $tipe;\n $data_gabungan[ $tipe ][ 'Uraian' ] = $data_awal[ $tipe ][ 'Uraian' ];\n $data_gabungan[ $tipe ][ 'nilai' ] = $data_awal[ $tipe ][ 'nilai' ];\n $data_gabungan[ $tipe ][ 'jml' ] = $data_awal[ $tipe ][ 'jml' ];\n $data_gabungan[ $tipe ][ 'ap' ] = $data_awal[ $tipe ][ 'AP' ];\n $data_gabungan[ $tipe ][ 'pp' ] = $data_awal[ $tipe ][ 'PP' ];\n $data_gabungan[ $tipe ][ 'nb' ] = $data_awal[ $tipe ][ 'NB' ];\n\n $data_gabungan[ $tipe ][ 'mutasi_jml_tambah' ] = $selisih_jml_tambah;\n $data_gabungan[ $tipe ][ 'mutasi_jml_kurang' ] = $selisih_jml_kurang;\n\n $data_gabungan[ $tipe ][ 'mutasi_ap_tambah' ] = $selisih_ap_tambah;\n $data_gabungan[ $tipe ][ 'mutasi_ap_kurang' ] = $selisih_ap_kurang;\n\n /* $data_gabungan[$tipe]['mutasi_pp_tambah']=$selisih_pp_tambah;\n $data_gabungan[$tipe]['mutasi_pp_kurang']=$selisih_pp_kurang;*/\n\n $data_gabungan[ $tipe ][ 'mutasi_nb_tambah' ] = $selisih_nb_tambah;\n $data_gabungan[ $tipe ][ 'mutasi_nb_kurang' ] = $selisih_nb_kurang;\n\n $data_gabungan[ $tipe ][ 'bp' ] = $bp;\n\n\n $data_gabungan[ $tipe ][ 'mutasi_nilai_tambah' ] = $selisih_nilai_tambah;\n $data_gabungan[ $tipe ][ 'mutasi_nilai_kurang' ] = $selisih_nilai_kurang;\n\n $data_gabungan[ $tipe ][ 'nilai_akhir' ] = $data_akhir[ $tipe ][ 'nilai' ];\n $data_gabungan[ $tipe ][ 'jml_akhir' ] = $data_akhir[ $tipe ][ 'jml' ];\n $data_gabungan[ $tipe ][ 'ap_akhir' ] = $data_akhir[ $tipe ][ 'AP' ];\n $data_gabungan[ $tipe ][ 'pp_akhir' ] = $data_akhir[ $tipe ][ 'PP' ];\n $data_gabungan[ $tipe ][ 'nb_akhir' ] = $data_akhir[ $tipe ][ 'NB' ];\n\n\n }\n//echo \"array gabungan:<br/><pre>\";\n//print_r($result);\n\n//hitung yang tidak masuk dalam intersection\n $data_awal_alone = array_diff_assoc ($data_awal, $data_gabungan);\n//echo \"array awal sendiri:<br/><pre>\";\n//print_r($data_awal_alone);\n\n $data_awal = array();\n foreach ($data_awal_alone as $tipe => $value) {\n $data_awal[ $tipe ][ 'Kelompok' ] = $tipe;\n $data_awal[ $tipe ][ 'Uraian' ] = $value[ 'Uraian' ];\n $data_awal[ $tipe ][ 'nilai' ] = $value[ 'nilai' ];\n $data_awal[ $tipe ][ 'jml' ] = $value[ 'jml' ];\n $data_awal[ $tipe ][ 'ap' ] = $value[ 'AP' ];\n $data_awal[ $tipe ][ 'pp' ] = $value[ 'PP' ];\n $data_awal[ $tipe ][ 'nb' ] = $value[ 'NB' ];\n $data_awal[ $tipe ][ 'mutasi_nilai_tambah' ] = 0;\n $data_awal[ $tipe ][ 'mutasi_jml_tambah' ] = 0;\n $data_awal[ $tipe ][ 'mutasi_ap_tambah' ] = 0;\n $data_awal[ $tipe ][ 'mutasi_pp_tambah' ] = 0;\n $data_awal[ $tipe ][ 'mutasi_nb_tambah' ] = 0;\n /*\n $data_awal[$tipe]['mutasi_nilai_kurang']=0;\n $data_awal[$tipe]['mutasi_jml_kurang']=0;\n $data_awal[$tipe]['mutasi_ap_kurang']=0;\n $data_awal[$tipe]['mutasi_pp_kurang']=0;\n $data_awal[$tipe]['mutasi_nb_kurang']=0;\n\n $data_awal[$tipe]['nilai_akhir']=$value['nilai'];\n $data_awal[$tipe]['jml_akhir']=$value['jml'];\n $data_awal[$tipe]['ap_akhir']=$value['AP'];\n $data_awal[$tipe]['pp_akhir']=$value['PP'];\n $data_awal[$tipe]['nb_akhir']=$value['NB'];*/\n\n $data_awal[ $tipe ][ 'mutasi_nilai_kurang' ] = $value[ 'nilai' ];\n $data_awal[ $tipe ][ 'mutasi_jml_kurang' ] = $value[ 'jml' ];\n $data_awal[ $tipe ][ 'mutasi_ap_kurang' ] = $value[ 'AP' ];\n $data_awal[ $tipe ][ 'mutasi_pp_kurang' ] = $value[ 'PP' ];\n $data_awal[ $tipe ][ 'mutasi_nb_kurang' ] = $value[ 'NB' ];\n\n $data_awal[ $tipe ][ 'bp' ] = 0;\n\n $data_awal[ $tipe ][ 'nilai_akhir' ] = 0;\n $data_awal[ $tipe ][ 'jml_akhir' ] = 0;\n $data_awal[ $tipe ][ 'ap_akhir' ] = 0;\n $data_awal[ $tipe ][ 'pp_akhir' ] = 0;\n $data_awal[ $tipe ][ 'nb_akhir' ] = 0;\n\n\n }\n\n\n $data_akhir_alone = array_diff_assoc ($data_akhir, $data_gabungan);\n//echo \"array akhir sendiri:<br/><pre>\";\n//print_r($data_akhir_alone);\n\n $data_akhir = array();\n foreach ($data_akhir_alone as $tipe => $value) {\n\n $Aset_ID = $value[ 'Aset_ID' ];\n $TahunPenyusutan = $value[ 'TahunPenyusutan' ];\n $kelompok = $value[ 'Kelompok' ];\n $Tahun = $value[ 'Tahun' ];\n /*$akumulasi_sblm=get_akumulasi_sblm($Aset_ID, $TahunPenyusutan, $kelompok);\n\n if($Tahun==$TahunPenyusutan){\n //pengadaan di tahun berjalan\n $akumulasi_sblm=0;\n $bp=$value['AP'];\n }\n else{\n //transfer dari tempat lain\n if($akumulasi_sblm==0){\n //barang inventarisasi\n $bp=$value['AP'];\n $akumulasi_sblm=0;\n }\n $bp=$value['AP']-$akumulasi_sblm;\n //bila tidak penyusutan lagi\n if($bp==$value['AP'])\n {\n $bp=0;\n $akumulasi_sblm=$value['AP'];\n }\n }*/\n\n $data_akhir[ $tipe ][ 'Kelompok' ] = $tipe;\n $data_akhir[ $tipe ][ 'Uraian' ] = $value[ 'Uraian' ];\n\n $data_akhir[ $tipe ][ 'nilai' ] = 0;\n $data_akhir[ $tipe ][ 'jml' ] = 0;\n $data_akhir[ $tipe ][ 'ap' ] = 0;\n $data_akhir[ $tipe ][ 'pp' ] = 0;\n $data_akhir[ $tipe ][ 'nb' ] = 0;\n\n $selisih_nilai_tambah = 0;\n $selisih_nilai_kurang = 0;\n $selisih_jml_tambah = 0;\n $selisih_jml_kurang = 0;\n $selisih_ap_tambah = 0;\n $selisih_ap_kurang = 0;\n $selisih_nb_tambah = 0;\n $selisih_nb_kurang = 0;\n $bp = 0;\n\n /*$selisih_pp_tambah=0;\n $selisih_pp_kurang=0;*/\n\n $kodesatker = $value[ 'kodeSatker' ];\n $aset_id = $value[ 'Aset_ID' ];\n $kodekelompok = $value[ 'kodeKelompok' ];\n $tglperolehan = $tgl_akhir;\n $tglpembukuan = $value[ 'TglPembukuan' ];\n /* echo \"<pre>\";\n print_r($data_akhir);\n print_r($value);\n echo \"Aset=$tglperolehan==$tipe==$Aset_ID==$tglpembukuan==$kodekelompok<br/>\";\n // exit();*/\n list($bp, $selisih_nilai_tambah, $selisih_nilai_kurang, $selisih_ap_tambah, $selisih_ap_kurang) =\n history_aset ($kodesatker, $Aset_ID, $tglperolehan, $tgl_awal, $tglpembukuan, $kodekelompok);\n if($bp == 0) {\n $selisih_jml_tambah = $value[ 'jml' ];\n $selisih_ap_tambah = $value[ 'AP' ];\n $selisih_nilai_tambah = $value[ 'nilai' ];\n }\n\n /* $data_akhir[$tipe]['mutasi_jml_tambah']=$value['jml'];\n $data_akhir[$tipe]['mutasi_nilai_tambah']=$value['nilai'];\n $data_akhir[$tipe]['mutasi_ap_tambah']=$akumulasi_sblm;//$value['AP'];\n $data_akhir[$tipe]['mutasi_pp_tambah']=$value['PP'];\n $data_akhir[$tipe]['mutasi_nb_tambah']=$value['NB'];\n\n $data_akhir[$tipe]['mutasi_nilai_kurang']=0;\n $data_akhir[$tipe]['mutasi_jml_kurang']=0;\n $data_akhir[$tipe]['mutasi_ap_kurang']=0;\n $data_akhir[$tipe]['mutasi_pp_kurang']=0;\n $data_akhir[$tipe]['mutasi_nb_kurang']=0;\n\n $data_akhir[$tipe]['bp']=$bp;//$value['AP'];*/\n $data_akhir[ $tipe ][ 'mutasi_jml_tambah' ] = $selisih_jml_tambah;\n $data_akhir[ $tipe ][ 'mutasi_jml_kurang' ] = $selisih_jml_kurang;\n\n $data_akhir[ $tipe ][ 'mutasi_ap_tambah' ] = $selisih_ap_tambah;\n $data_akhir[ $tipe ][ 'mutasi_ap_kurang' ] = $selisih_ap_kurang;\n\n /* $data_gabungan[$tipe]['mutasi_pp_tambah']=$selisih_pp_tambah;\n $data_gabungan[$tipe]['mutasi_pp_kurang']=$selisih_pp_kurang;*/\n\n $data_akhir[ $tipe ][ 'mutasi_nilai_tambah' ] = $selisih_nilai_tambah;\n $data_akhir[ $tipe ][ 'mutasi_nilai_kurang' ] = 0;\n\n $data_akhir[ $tipe ][ 'mutasi_nb_tambah' ] = $selisih_nb_tambah;\n $data_akhir[ $tipe ][ 'mutasi_nb_kurang' ] = $selisih_nb_kurang;\n\n $data_akhir[ $tipe ][ 'bp' ] = $bp;\n\n $data_akhir[ $tipe ][ 'nilai_akhir' ] = $value[ 'nilai' ];\n $data_akhir[ $tipe ][ 'jml_akhir' ] = $value[ 'jml' ];\n $data_akhir[ $tipe ][ 'ap_akhir' ] = $value[ 'AP' ];\n $data_akhir[ $tipe ][ 'pp_akhir' ] = $value[ 'PP' ];\n $data_akhir[ $tipe ][ 'nb_akhir' ] = $value[ 'NB' ];\n\n\n }\n\n $data_hapus = array();\n foreach ($data_hapus_tmp as $tipe => $value) {\n $data_hapus[ $tipe ][ 'Kelompok' ] = $tipe;\n $data_hapus[ $tipe ][ 'Uraian' ] = $value[ 'Uraian' ];\n\n $data_hapus[ $tipe ][ 'nilai' ] = 0;\n $data_hapus[ $tipe ][ 'jml' ] = 0;\n $data_hapus[ $tipe ][ 'ap' ] = 0;\n $data_hapus[ $tipe ][ 'pp' ] = 0;\n $data_hapus[ $tipe ][ 'nb' ] = 0;\n $data_hapus[ $tipe ][ 'mutasi_jml_tambah' ] = $value[ 'jml' ];\n $data_hapus[ $tipe ][ 'mutasi_nilai_tambah' ] = $value[ 'nilai' ];\n $data_hapus[ $tipe ][ 'mutasi_ap_tambah' ] = $value[ 'AP' ];\n $data_hapus[ $tipe ][ 'mutasi_pp_tambah' ] = $value[ 'PP' ];\n $data_hapus[ $tipe ][ 'mutasi_nb_tambah' ] = $value[ 'NB' ];\n\n $data_hapus[ $tipe ][ 'mutasi_jml_kurang' ] = $value[ 'jml' ];\n $data_hapus[ $tipe ][ 'mutasi_nilai_kurang' ] = $value[ 'nilai' ];\n $data_hapus[ $tipe ][ 'mutasi_ap_kurang' ] = $value[ 'AP' ];\n $data_hapus[ $tipe ][ 'mutasi_pp_kurang' ] = $value[ 'PP' ];\n $data_hapus[ $tipe ][ 'mutasi_nb_kurang' ] = $value[ 'NB' ];\n\n $data_hapus[ $tipe ][ 'bp' ] = 0;//$value['AP'];\n\n $data_hapus[ $tipe ][ 'nilai_akhir' ] = 0;\n $data_hapus[ $tipe ][ 'jml_akhir' ] = 0;\n $data_hapus[ $tipe ][ 'ap_akhir' ] = 0;\n $data_hapus[ $tipe ][ 'pp_akhir' ] = 0;\n $data_hapus[ $tipe ][ 'nb_akhir' ] = 0;\n\n\n }\n\n\n /*echo \"array akhir:<br/><pre>\";\n print_r($data_akhir);//data-sub-sub\n exit;*/\n $data_gabungan = array_merge ($data_awal, $data_gabungan, $data_akhir, $data_hapus);\n\n//echo \"array gabungan:<br/><pre>\";\n//print_r($data_gabungan);//data-sub-sub\n//\n $data_level5 = array();\n foreach ($data_gabungan as $key => $value) {\n $tmp = explode (\".\", $key);\n $key_baru = \"{$tmp[0]}.{$tmp[1]}.{$tmp[2]}.{$tmp[3]}.{$tmp[4]}\";\n $URAIAN = get_uraian ($key_baru, 5);\n\n $data_level5[ $key_baru ][ 'Uraian' ] = $URAIAN;\n $data_level5[ $key_baru ][ 'Kelompok' ] = $key_baru;\n $data_level5[ $key_baru ][ 'nilai' ] += round($data_gabungan[ $key ][ 'nilai' ],2);\n $data_level5[ $key_baru ][ 'jml' ] += round($data_gabungan[ $key ][ 'jml' ],2);\n $data_level5[ $key_baru ][ 'ap' ] += round($data_gabungan[ $key ][ 'ap' ],2);\n $data_level5[ $key_baru ][ 'pp' ] += round($data_gabungan[ $key ][ 'pp' ],2);\n $data_level5[ $key_baru ][ 'nb' ] += round($data_gabungan[ $key ][ 'nb' ],2);\n $data_level5[ $key_baru ][ 'mutasi_jml_tambah' ] += $data_gabungan[ $key ][ 'mutasi_jml_tambah' ];\n $data_level5[ $key_baru ][ 'mutasi_nilai_tambah' ] += $data_gabungan[ $key ][ 'mutasi_nilai_tambah' ];\n $data_level5[ $key_baru ][ 'mutasi_ap_tambah' ] += $data_gabungan[ $key ][ 'mutasi_ap_tambah' ];\n $data_level5[ $key_baru ][ 'mutasi_pp_tambah' ] += $data_gabungan[ $key ][ 'mutasi_pp_tambah' ];\n $data_level5[ $key_baru ][ 'mutasi_nb_tambah' ] += $data_gabungan[ $key ][ 'mutasi_nb_tambah' ];\n\n $data_level5[ $key_baru ][ 'bp' ] += $data_gabungan[ $key ][ 'bp' ];\n\n $data_level5[ $key_baru ][ 'mutasi_jml_kurang' ] += $data_gabungan[ $key ][ 'mutasi_jml_kurang' ];\n $data_level5[ $key_baru ][ 'mutasi_nilai_kurang' ] += $data_gabungan[ $key ][ 'mutasi_nilai_kurang' ];\n $data_level5[ $key_baru ][ 'mutasi_ap_kurang' ] += $data_gabungan[ $key ][ 'mutasi_ap_kurang' ];\n $data_level5[ $key_baru ][ 'mutasi_pp_kurang' ] += $data_gabungan[ $key ][ 'mutasi_pp_kurang' ];\n $data_level5[ $key_baru ][ 'mutasi_nb_kurang' ] += $data_gabungan[ $key ][ 'mutasi_nb_kurang' ];\n\n $data_level5[ $key_baru ][ 'nilai_akhir' ] += round($data_gabungan[ $key ][ 'nilai_akhir' ],2);\n $data_level5[ $key_baru ][ 'jml_akhir' ] += round($data_gabungan[ $key ][ 'jml_akhir' ],2);\n $data_level5[ $key_baru ][ 'ap_akhir' ] += round($data_gabungan[ $key ][ 'ap_akhir' ],2);\n $data_level5[ $key_baru ][ 'pp_akhir' ] += round($data_gabungan[ $key ][ 'pp_akhir' ],2);\n $data_level5[ $key_baru ][ 'nb_akhir' ] += round($data_gabungan[ $key ][ 'nb_akhir' ],2);\n\n\n }\n //$data_level5 = $data_gabungan;\n $data_level4 = array();\n//Buat array gabungan --> level 4\n foreach ($data_level5 as $key => $value) {\n $tmp = explode (\".\", $key);\n $key_baru = \"{$tmp[0]}.{$tmp[1]}.{$tmp[2]}.{$tmp[3]}\";\n $URAIAN = get_uraian ($key_baru, 4);\n\n $data_level4[ $key_baru ][ 'Uraian' ] = $URAIAN;\n $data_level4[ $key_baru ][ 'Kelompok' ] = $key_baru;\n $data_level4[ $key_baru ][ 'nilai' ] += $data_level5[ $key ][ 'nilai' ];\n $data_level4[ $key_baru ][ 'jml' ] += $data_level5[ $key ][ 'jml' ];\n $data_level4[ $key_baru ][ 'ap' ] += $data_level5[ $key ][ 'ap' ];\n $data_level4[ $key_baru ][ 'pp' ] += $data_level5[ $key ][ 'pp' ];\n $data_level4[ $key_baru ][ 'nb' ] += $data_level5[ $key ][ 'nb' ];\n $data_level4[ $key_baru ][ 'mutasi_jml_tambah' ] += $data_level5[ $key ][ 'mutasi_jml_tambah' ];\n $data_level4[ $key_baru ][ 'mutasi_nilai_tambah' ] += $data_level5[ $key ][ 'mutasi_nilai_tambah' ];\n $data_level4[ $key_baru ][ 'mutasi_ap_tambah' ] += $data_level5[ $key ][ 'mutasi_ap_tambah' ];\n $data_level4[ $key_baru ][ 'mutasi_pp_tambah' ] += $data_level5[ $key ][ 'mutasi_pp_tambah' ];\n $data_level4[ $key_baru ][ 'mutasi_nb_tambah' ] += $data_level5[ $key ][ 'mutasi_nb_tambah' ];\n\n $data_level4[ $key_baru ][ 'bp' ] += $data_level5[ $key ][ 'bp' ];\n\n $data_level4[ $key_baru ][ 'mutasi_jml_kurang' ] += $data_level5[ $key ][ 'mutasi_jml_kurang' ];\n $data_level4[ $key_baru ][ 'mutasi_nilai_kurang' ] += $data_level5[ $key ][ 'mutasi_nilai_kurang' ];\n $data_level4[ $key_baru ][ 'mutasi_ap_kurang' ] += $data_level5[ $key ][ 'mutasi_ap_kurang' ];\n $data_level4[ $key_baru ][ 'mutasi_pp_kurang' ] += $data_level5[ $key ][ 'mutasi_pp_kurang' ];\n $data_level4[ $key_baru ][ 'mutasi_nb_kurang' ] += $data_level5[ $key ][ 'mutasi_nb_kurang' ];\n\n $data_level4[ $key_baru ][ 'nilai_akhir' ] += $data_level5[ $key ][ 'nilai_akhir' ];\n $data_level4[ $key_baru ][ 'jml_akhir' ] += $data_level5[ $key ][ 'jml_akhir' ];\n $data_level4[ $key_baru ][ 'ap_akhir' ] += $data_level5[ $key ][ 'ap_akhir' ];\n $data_level4[ $key_baru ][ 'pp_akhir' ] += $data_level5[ $key ][ 'pp_akhir' ];\n $data_level4[ $key_baru ][ 'nb_akhir' ] += $data_level5[ $key ][ 'nb_akhir' ];\n $data_level4[ $key_baru ][ 'SubSub' ][ $key ] = $data_level5[ $key ];\n\n }\n\n//echo \"array level 4:<br/><pre>\";\n//print_r($data_level4);//data-sub\n\n\n $data_level3 = array();\n//Buat array gabungan --> level 3\n foreach ($data_level4 as $key => $value) {\n $tmp = explode (\".\", $key);\n $key_baru = \"{$tmp[0]}.{$tmp[1]}.{$tmp[2]}\";\n $URAIAN = get_uraian ($key_baru, 3);\n\n $data_level3[ $key_baru ][ 'Uraian' ] = $URAIAN;\n $data_level3[ $key_baru ][ 'Kelompok' ] = $key_baru;\n $data_level3[ $key_baru ][ 'nilai' ] += $data_level4[ $key ][ 'nilai' ];\n $data_level3[ $key_baru ][ 'jml' ] += $data_level4[ $key ][ 'jml' ];\n $data_level3[ $key_baru ][ 'ap' ] += $data_level4[ $key ][ 'ap' ];\n $data_level3[ $key_baru ][ 'pp' ] += $data_level4[ $key ][ 'pp' ];\n $data_level3[ $key_baru ][ 'nb' ] += $data_level4[ $key ][ 'nb' ];\n\n $data_level3[ $key_baru ][ 'mutasi_jml_tambah' ] += $data_level4[ $key ][ 'mutasi_jml_tambah' ];\n $data_level3[ $key_baru ][ 'mutasi_nilai_tambah' ] += $data_level4[ $key ][ 'mutasi_nilai_tambah' ];\n $data_level3[ $key_baru ][ 'mutasi_ap_tambah' ] += $data_level4[ $key ][ 'mutasi_ap_tambah' ];\n $data_level3[ $key_baru ][ 'mutasi_pp_tambah' ] += $data_level4[ $key ][ 'mutasi_pp_tambah' ];\n $data_level3[ $key_baru ][ 'mutasi_nb_tambah' ] += $data_level4[ $key ][ 'mutasi_nb_tambah' ];\n\n $data_level3[ $key_baru ][ 'bp' ] += $data_level4[ $key ][ 'bp' ];\n\n $data_level3[ $key_baru ][ 'mutasi_jml_kurang' ] += $data_level4[ $key ][ 'mutasi_jml_kurang' ];\n $data_level3[ $key_baru ][ 'mutasi_nilai_kurang' ] += $data_level4[ $key ][ 'mutasi_nilai_kurang' ];\n $data_level3[ $key_baru ][ 'mutasi_ap_kurang' ] += $data_level4[ $key ][ 'mutasi_ap_kurang' ];\n $data_level3[ $key_baru ][ 'mutasi_pp_kurang' ] += $data_level4[ $key ][ 'mutasi_pp_kurang' ];\n $data_level3[ $key_baru ][ 'mutasi_nb_kurang' ] += $data_level4[ $key ][ 'mutasi_nb_kurang' ];\n\n\n $data_level3[ $key_baru ][ 'nilai_akhir' ] += $data_level4[ $key ][ 'nilai_akhir' ];\n $data_level3[ $key_baru ][ 'jml_akhir' ] += $data_level4[ $key ][ 'jml_akhir' ];\n $data_level3[ $key_baru ][ 'ap_akhir' ] += $data_level4[ $key ][ 'ap_akhir' ];\n $data_level3[ $key_baru ][ 'pp_akhir' ] += $data_level4[ $key ][ 'pp_akhir' ];\n $data_level3[ $key_baru ][ 'nb_akhir' ] += $data_level4[ $key ][ 'nb_akhir' ];\n $data_level3[ $key_baru ][ 'Sub' ][ $key ] = $data_level4[ $key ];\n\n }\n\n//echo \"array level 3:<br/><pre>\";\n//print_r($data_level3);//data-sub-sub\n\n\n $data_level2 = array();\n//Buat array gabungan --> level 2\n foreach ($data_level3 as $key => $value) {\n $tmp = explode (\".\", $key);\n $key_baru = \"{$tmp[0]}.{$tmp[1]}\";\n $URAIAN = get_uraian ($key_baru, 2);\n\n $data_level2[ $key_baru ][ 'Uraian' ] = $URAIAN;\n $data_level2[ $key_baru ][ 'Kelompok' ] = $key_baru;\n $data_level2[ $key_baru ][ 'nilai' ] += $data_level3[ $key ][ 'nilai' ];\n $data_level2[ $key_baru ][ 'jml' ] += $data_level3[ $key ][ 'jml' ];\n $data_level2[ $key_baru ][ 'ap' ] += $data_level3[ $key ][ 'ap' ];\n $data_level2[ $key_baru ][ 'pp' ] += $data_level3[ $key ][ 'pp' ];\n $data_level2[ $key_baru ][ 'nb' ] += $data_level3[ $key ][ 'nb' ];\n\n $data_level2[ $key_baru ][ 'mutasi_jml_tambah' ] += $data_level3[ $key ][ 'mutasi_jml_tambah' ];\n $data_level2[ $key_baru ][ 'mutasi_nilai_tambah' ] += $data_level3[ $key ][ 'mutasi_nilai_tambah' ];\n $data_level2[ $key_baru ][ 'mutasi_ap_tambah' ] += $data_level3[ $key ][ 'mutasi_ap_tambah' ];\n $data_level2[ $key_baru ][ 'mutasi_pp_tambah' ] += $data_level3[ $key ][ 'mutasi_pp_tambah' ];\n $data_level2[ $key_baru ][ 'mutasi_nb_tambah' ] += $data_level3[ $key ][ 'mutasi_nb_tambah' ];\n\n $data_level2[ $key_baru ][ 'bp' ] += $data_level3[ $key ][ 'bp' ];\n\n $data_level2[ $key_baru ][ 'mutasi_jml_kurang' ] += $data_level3[ $key ][ 'mutasi_jml_kurang' ];\n $data_level2[ $key_baru ][ 'mutasi_nilai_kurang' ] += $data_level3[ $key ][ 'mutasi_nilai_kurang' ];\n $data_level2[ $key_baru ][ 'mutasi_ap_kurang' ] += $data_level3[ $key ][ 'mutasi_ap_kurang' ];\n $data_level2[ $key_baru ][ 'mutasi_pp_kurang' ] += $data_level3[ $key ][ 'mutasi_pp_kurang' ];\n $data_level2[ $key_baru ][ 'mutasi_nb_kurang' ] += $data_level3[ $key ][ 'mutasi_nb_kurang' ];\n\n $data_level2[ $key_baru ][ 'nilai_akhir' ] += $data_level3[ $key ][ 'nilai_akhir' ];\n $data_level2[ $key_baru ][ 'jml_akhir' ] += $data_level3[ $key ][ 'jml_akhir' ];\n $data_level2[ $key_baru ][ 'ap_akhir' ] += $data_level3[ $key ][ 'ap_akhir' ];\n $data_level2[ $key_baru ][ 'pp_akhir' ] += $data_level3[ $key ][ 'pp_akhir' ];\n $data_level2[ $key_baru ][ 'nb_akhir' ] += $data_level3[ $key ][ 'nb_akhir' ];\n $data_level2[ $key_baru ][ 'Kel' ][ $key ] = $data_level3[ $key ];\n // echo \"<pre>\";print_r($data_level3[$key]);\n }\n\n//echo \"array level 2:<br/><pre>\";\n//print_r($data_level2);//data-sub-sub\n\n\n $data_level = array();\n//Buat array gabungan --> level 1\n foreach ($data_level2 as $key => $value) {\n $tmp = explode (\".\", $key);\n $key_baru = \"{$tmp[0]}\";\n $URAIAN = get_uraian ($key_baru, 1);\n\n $data_level[ $key_baru ][ 'Uraian' ] = $URAIAN;\n $data_level[ $key_baru ][ 'Kelompok' ] = $key_baru;\n $data_level[ $key_baru ][ 'nilai' ] += $data_level2[ $key ][ 'nilai' ];\n $data_level[ $key_baru ][ 'jml' ] += $data_level2[ $key ][ 'jml' ];\n $data_level[ $key_baru ][ 'ap' ] += $data_level2[ $key ][ 'ap' ];\n $data_level[ $key_baru ][ 'pp' ] += $data_level2[ $key ][ 'pp' ];\n $data_level[ $key_baru ][ 'nb' ] += $data_level2[ $key ][ 'nb' ];\n\n $data_level[ $key_baru ][ 'mutasi_jml_tambah' ] += $data_level2[ $key ][ 'mutasi_jml_tambah' ];\n $data_level[ $key_baru ][ 'mutasi_nilai_tambah' ] += $data_level2[ $key ][ 'mutasi_nilai_tambah' ];\n $data_level[ $key_baru ][ 'mutasi_ap_tambah' ] += $data_level2[ $key ][ 'mutasi_ap_tambah' ];\n $data_level[ $key_baru ][ 'mutasi_pp_tambah' ] += $data_level2[ $key ][ 'mutasi_pp_tambah' ];\n $data_level[ $key_baru ][ 'mutasi_nb_tambah' ] += $data_level2[ $key ][ 'mutasi_nb_tambah' ];\n\n $data_level[ $key_baru ][ 'bp' ] += $data_level2[ $key ][ 'bp' ];\n\n $data_level[ $key_baru ][ 'mutasi_jml_kurang' ] += $data_level2[ $key ][ 'mutasi_jml_kurang' ];\n $data_level[ $key_baru ][ 'mutasi_nilai_kurang' ] += $data_level2[ $key ][ 'mutasi_nilai_kurang' ];\n $data_level[ $key_baru ][ 'mutasi_ap_kurang' ] += $data_level2[ $key ][ 'mutasi_ap_kurang' ];\n $data_level[ $key_baru ][ 'mutasi_pp_kurang' ] += $data_level2[ $key ][ 'mutasi_pp_kurang' ];\n $data_level[ $key_baru ][ 'mutasi_nb_kurang' ] += $data_level2[ $key ][ 'mutasi_nb_kurang' ];\n\n $data_level[ $key_baru ][ 'nilai_akhir' ] += $data_level2[ $key ][ 'nilai_akhir' ];\n $data_level[ $key_baru ][ 'jml_akhir' ] += $data_level2[ $key ][ 'jml_akhir' ];\n $data_level[ $key_baru ][ 'ap_akhir' ] += $data_level2[ $key ][ 'ap_akhir' ];\n $data_level[ $key_baru ][ 'pp_akhir' ] += $data_level2[ $key ][ 'pp_akhir' ];\n $data_level[ $key_baru ][ 'nb_akhir' ] += $data_level2[ $key ][ 'nb_akhir' ];\n $data_level[ $key_baru ][ 'Bidang' ][ $key ] = $data_level2[ $key ];\n\n }\n\n//echo \"array level :<br/><pre>\";\n//print_r($data_level);//data-sub-sub\n\n return $data_level;\n}", "public function groupCallback($group, $mode, $field, $objModelRow);", "public function actionRemove()\n {\n if (Yii::$app->getRequest()->Post('gid') && Yii::$app->getRequest()->Post('iid')) {\n $landingPageId = (int)Yii::$app->getRequest()->Post('gid');\n $groupingId = (int)Yii::$app->getRequest()->Post('iid');\n $model = LandingPageGrouping::find()->andWhere(['landing_page_id' => $landingPageId])->\n andWhere(['grouping_id' => $groupingId])->one();\n if ($model) {\n $model->delete();\n }\n\n $groupings = Grouping::find()->onlandingpage($landingPageId)->active()->\n orderBy(['Name' => 'ASC'])->asArray()->all();\n } else {\n $groupings = false;\n }\n \n \\Yii::$app->response->format = 'json';\n return $groupings;\n }", "private function _cleanGroupName($row)\n {\n if ($row->group_name) {\n return;\n }\n\n $_names = [];\n foreach ($row->members as $member) {\n if ($member->member_id !== __me()->id || count($row->members) == 1) {\n $_names[] = $member->full_name;\n }\n }\n\n if (count($_names)) {\n $row->group_name = implode(\", \", $_names);\n $row->group_name = str_limit($row->group_name, 32);\n }\n }", "protected function _prepareArrayRow(\\Magento\\Framework\\DataObject $row)\n {\n $optionExtraAttr = [];\n $optionExtraAttr['option_' . $this->_getGroupRenderer()->calcOptionHash($row->getData('customer_group_id'))] =\n 'selected=\"selected\"';\n $row->setData(\n 'option_extra_attrs',\n $optionExtraAttr\n );\n }", "function get_group_array()\n{\n\tglobal $db_raid, $table_prefix, $db_raid;\n\tglobal $db_allgroups_id, $db_allgroups_name, $db_table_allgroups ;\n\n\t$group = array();\n\t\n\t$sql = sprintf(\"SELECT \" . $db_allgroups_id . \" , \". $db_allgroups_name .\n\t\t\t\" FROM \" . $table_prefix . $db_table_allgroups .\n\t\t\t\" ORDER BY \". $db_allgroups_id);\n\t\n\t$result_group = $db_raid->sql_query($sql) or print_error($sql, $db_raid->sql_error(), 1);\n\twhile ($data_wrm = $db_raid->sql_fetchrow($result_group,true))\n\t{\n\t\t$group[$data_wrm[$db_allgroups_id]] = $data_wrm[$db_allgroups_name];\n\t}\n\n\treturn $group;\n}", "public function onMenuInitialize_SitegroupSubgroupGutterCreate($row) {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n $subject = Engine_Api::_()->core()->getSubject();\n if ($subject->getType() !== 'sitegroup_group') {\n return false;\n }\n \n if (!empty($subject->subgroup)) {\n\t\t\treturn false;\n }\n \n // Must be able to view Sitegroups\n if (!Engine_Api::_()->authorization()->isAllowed('sitegroup_group', $viewer, 'view')) {\n return false;\n }\n\n $subgroupCreate = Engine_Api::_()->sitegroup()->isManageAdmin($subject, 'sspcreate');\n if (empty($subgroupCreate) ){\n\t\t\treturn false;\n }\n \n\t\t$isGroupOwnerAllow = Engine_Api::_()->sitegroup()->isGroupOwnerAllow($subject, 'sspcreate');\n\t\tif (empty($isGroupOwnerAllow)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (Engine_Api::_()->sitegroup()->hasPackageEnable()) {\n\t\t\treturn array(\n 'label' => $row->label,\n 'route' => 'sitegroup_packages',\n 'action' => 'index',\n 'class' => 'buttonlink item_icon_sitegroup',\n 'params' => array(\n 'parent_id' => $subject->getIdentity()\n ),\n );\n\t\t} else {\n\t\t\treturn array(\n 'label' => $row->label,\n 'route' => 'sitegroup_general',\n 'action' => 'create',\n 'class' => 'buttonlink item_icon_sitegroup',\n 'params' => array(\n 'parent_id' => $subject->getIdentity()\n ),\n );\n\t\t}\n }", "function GetGroupArray($iGroupID)\n{\n //Get the Properties assigned to this Group\n $sSQL = \"SELECT pro_Name, pro_ID, pro_Prompt, r2p_Value, prt_Name, pro_prt_ID\n\t\t FROM record2property_r2p\n\t\t LEFT JOIN property_pro ON pro_ID = r2p_pro_ID\n\t\t LEFT JOIN propertytype_prt ON propertytype_prt.prt_ID = property_pro.pro_prt_ID\n\t\t WHERE pro_Class = 'g' AND r2p_record_ID = \".$iGroupID.\n ' ORDER BY prt_Name, pro_Name';\n $rsAssignedProperties = RunQuery($sSQL);\n\n // Get the group's role list ID\n $sSQL = 'SELECT grp_RoleListID,grp_hasSpecialProps FROM group_grp WHERE grp_ID ='.$iGroupID;\n $aTemp = mysqli_fetch_array(RunQuery($sSQL));\n $iRoleListID = $aTemp[0];\n $bHasSpecialProps = ($aTemp[1] == 'true');\n\n // Get the roles\n $sSQL = 'SELECT * FROM list_lst WHERE lst_ID = '.$iRoleListID.' ORDER BY lst_OptionSequence';\n $rsRoles = RunQuery($sSQL);\n $numRoles = mysqli_num_rows($rsRoles);\n\n // Get the members of the groups along with their family data\n $sSQL = \"SELECT per_ID, per_FirstName, per_MiddleName, per_LastName, per_Title,\n per_Suffix, per_Address1, per_Address2, per_City, per_State, \n per_Zip, per_HomePhone, per_Country, per_Email, per_BirthMonth, per_BirthDay, per_BirthYear, \n fam_ID, fam_Address1, fam_Address2, fam_City, fam_State, fam_Zip, fam_Country, fam_HomePhone, \n fam_Email, lst_OptionName\n\t\t\t FROM person_per\n\t\t\t LEFT JOIN person2group2role_p2g2r ON per_ID = p2g2r_per_ID\n\t\t\t LEFT JOIN list_lst ON p2g2r_rle_ID = lst_OptionID AND lst_ID = $iRoleListID\n\t\t\t LEFT JOIN group_grp ON grp_ID = p2g2r_grp_ID\n\t\t\t LEFT JOIN family_fam ON per_fam_ID = family_fam.fam_ID\n\t\t WHERE p2g2r_grp_ID = \".$iGroupID.' ORDER BY per_LastName, per_FirstName';\n $rsGroupMembers = RunQuery($sSQL);\n $row = 0;\n while ($aGroupMember = mysqli_fetch_array($rsGroupMembers)) {\n $ret[$row++] = $aGroupMember;\n }\n\n return $ret;\n}", "public function import_group_ids_array()\n\t{\n\t\t$vendors = $this->_vendors_array('all');\n\t\t\n\t\t$ids = array();\n\t\t\n\t\tforeach ($vendors as $vendor)\n\t\t{\n\t\t\t$ids[] = $vendor->import_group_id;\n\t\t}\n\t\t\n\t\tif (empty($ids))\n\t\t\treturn NULL;\n\t\telse\n\t\t\treturn $ids;\n\t}", "public function onItemgroup(){\n\t\t$sql = \"SELECT * FROM `itemgroup` WHERE `status` = 'ON'\";\n\t\t$query = $this->execute($sql);\n\t\tif($query){\n\t\t\treturn $query;\n\t\t}\n\t}", "protected function onFetch($aRow)\n\t{\n\t\tif ( !empty($aRow) && !empty($this->mOrgList) ) {\n\t\t\t$this->mOrgList->addListOfIds($aRow->org_ids);\n\t\t}\n\t\treturn parent::onFetch($aRow);\n\t}", "public function prepareSave($row, $postData)\n { if ($this->getSave() === false || $this->getInternalSave() === false) return;\n\n $new = $this->_getIdsFromPostData($postData);\n\n// $avaliableKeys = array(6,20,17);\n //foreach ($this->_getFields() as $field) {\n// $avaliableKeys[] = $field->getKey();\n// }\n\n $relModel = $row->getModel()->getDependentModel($this->getRelModel());\n $ref = $relModel->getReference($this->getRelationToValuesRule());\n $valueKey = $ref['column'];\n\n $s = $this->getChildRowsSelect();\n if (!$s) $s = array();\n foreach ($row->getChildRows($this->getRelModel(), $s) as $savedRow) {\n $id = $savedRow->$valueKey;\n if (true || in_array($id, $avaliableKeys)) {\n if (!in_array($id, $new)) {\n $savedRow->delete();\n } else {\n unset($new[array_search($id, $new)]);\n }\n }\n }\n\n foreach ($new as $id) {\n if (true || in_array($id, $avaliableKeys)) {\n $i = $row->createChildRow($this->getRelModel());\n $i->$valueKey = $id;\n }\n }\n\n }", "private function _make_row($data) {\n $options = array(\n \"id\" => $data->fid_cust\n );\n\n $query = $this->Master_Customers_model->get_details($options)->row();\n $value = $this->Sales_Invoices_model->get_invoices_total_summary($data->id);\n $originalDate = $data->inv_date;\n $newDate = date(\"d-M-Y\", strtotime($originalDate));\n $row_data = array(\n \n anchor(get_uri(\"sales/s_invoices/view/\" . $data->id.\"/\".str_replace(\"/\", \"-\", $data->code)), \"#\".$data->code),\n modal_anchor(get_uri(\"master/customers/view/\" . $data->fid_cust), $query->name, array(\"class\" => \"view\", \"title\" => \"Customers \".$query->name, \"data-post-id\" => $data->fid_cust)),\n $this->_get_invoices_status_label($data),\n $data->email_to,\n $newDate,\n $data->currency,\n to_currency($value->invoice_total)\n\n );\n\n if($data->status != \"posting\"){\n $row_data[] = anchor(get_uri(\"sales/s_invoices/edit/\".$data->id), \"<i class='fa fa-pencil'></i>\", array(\"class\" => \"edit\", \"title\" => lang('edit_client')))\n . js_anchor(\"<i class='fa fa-times fa-fw'></i>\", array('title' => lang('delete_client'), \"class\" => \"delete\", \"data-id\" => $data->id, \"data-action-url\" => get_uri(\"sales/s_invoices/delete\"), \"data-action\" => \"delete\"));\n\n }\n $row_data[] = anchor(get_uri(\"sales/s_invoices/view/\").$data->id, \"<i class='fa fa-eye'></i>\", array(\"class\" => \"view\", \"title\" => lang('view'), \"data-post-id\" => $data->id));\n\n return $row_data;\n }", "function fillGroups() \n\t{\n\t\t$this->groups[] = array(-1,\"<\".\"Admin\".\">\");\n\t\t$this->groupFullChecked[] = true;\n\t\t\n\t\t$trs = db_query(\"select , from `uggroups` order by \",$this->conn);\n\t\twhile($tdata = db_fetch_numarray($trs))\n\t\t{\n\t\t\t$this->groups[] = array($tdata[0],$tdata[1]);\n\t\t\t$this->groupFullChecked[] = true;\n\t\t}\n\t}", "private function formatStockDataForRow(array $rowData): array\n {\n $sku = $rowData[self::COL_SKU];\n $row['product_id'] = $this->skuProcessor->getNewSku($sku)['entity_id'];\n $row['website_id'] = $this->stockConfiguration->getDefaultScopeId();\n $row['stock_id'] = $this->stockRegistry->getStock($row['website_id'])->getStockId();\n\n $stockItemDo = $this->stockRegistry->getStockItem($row['product_id'], $row['website_id']);\n $existStockData = $stockItemDo->getData();\n\n $row = array_merge(\n $this->defaultStockData,\n array_intersect_key($existStockData, $this->defaultStockData),\n array_intersect_key($rowData, $this->defaultStockData),\n $row\n );\n\n if ($this->stockConfiguration->isQty($this->skuProcessor->getNewSku($sku)['type_id'])) {\n $stockItemDo->setData($row);\n $row['is_in_stock'] = isset($row['is_in_stock']) && $stockItemDo->getBackorders()\n ? $row['is_in_stock']\n : $this->stockStateProvider->verifyStock($stockItemDo);\n if ($this->stockStateProvider->verifyNotification($stockItemDo)) {\n $date = $this->dateTimeFactory->create('now', new \\DateTimeZone('UTC'));\n $row['low_stock_date'] = $date->format(DateTime::DATETIME_PHP_FORMAT);\n }\n $row['stock_status_changed_auto'] = (int)!$this->stockStateProvider->verifyStock($stockItemDo);\n } else {\n $row['qty'] = 0;\n }\n\n return $row;\n }", "public function getGroupDataById($group_id)\n\t{\n if($group_id != '')\n {\n\t\t$data = $this->fetchRow(\"id = \".$group_id)->toArray();\n\t\treturn $data;\n }\n else \n return array();\n\t}", "public static function getAll(){\n $conn = DataManager::getInstance()->getConnection();\n if(!$conn || $conn->connect_error) exit();\n $statement = $conn->prepare('SELECT `id` FROM `groups` WHERE 1');\n if(!$statement || !$statement->execute()) exit();\n $result_set = $statement->get_result();\n $group_ids = array();\n while($row = $result_set->fetch_assoc()){\n array_push($group_ids, $row['id']);\n }\n $output = array();\n foreach($group_ids as $id){\n array_push($output, self::fromId($id));\n }\n return $output;\n }", "public function get_my_employee_by_group($group_id){\n $master_wiw_id = $this->m_who_is_where->getWiwId($this->session->userdata('id') , $group_id) ;\n $data = $this->m_parent->getUserByMasterWiwId($master_wiw_id) ;\n \n $answer = array() ;\n foreach ($data as $key => $val){\n $answer[$val->prt_id] = $val->usr_fname . \" \" . $val->usr_lname ; \n }\n \n echo json_encode($answer) ;\n }", "private function _prepareRow($array){\n return array_merge($this->_blankRow, $array);\n }", "function prevent_duplication_file_tb_approval($file_mgo) {\n $query = \"\n SELECT\n tbl_tender_board_approval.tb_approval_id,\n tbl_tender_board_approval.tb_approval_mgo_ref,\n tbl_tender_board_approval.tb_approval_date\n FROM\n tbl_tender_board_approval\n WHERE tb_approval_mgo_ref='$file_mgo'\n \";\n $query_result = $this->mDbm->setData($query);\n return $query_result;\n }", "public function &getGroupBy();", "function update_group_memberships()\n {\n if (! is_null($this->group_id))\n {\n $group_users_arr = $this->viewer->get_group_users($this->group_id);\n $group_users = array();\n \n foreach ($group_users_arr as $user)\n {\n $group_users[$user->get_id()] = $user->get_id();\n }\n \n $values = $this->exportValue(Manager::PARAM_GROUP_USERS);\n \n foreach ($values as $type => $elements)\n {\n foreach ($elements as $id)\n {\n if ($type == self::PARAM_USER)\n {\n // type = user\n if (! in_array($id, $group_users))\n {\n if (! $this->viewer->user_is_enrolled_in_group($id))\n {\n $this->viewer->add_user_to_group($id, $this->group_id); // user can be enrolled in one\n // PA-group/publication\n }\n else\n {\n $user = \\Chamilo\\Core\\User\\Storage\\DataManager::retrieve_by_id(\n \\Chamilo\\Core\\User\\Storage\\DataClass\\User::class_name(), \n $id);\n $already_enrolled[] = $user->get_firstname() . ' ' . $user->get_lastname();\n }\n }\n else\n {\n unset($group_users[$id]);\n }\n }\n // type = group\n elseif ($type == self::PARAM_GROUP)\n {\n $context_group_users = $this->viewer->get_context_group_users($id);\n \n foreach ($context_group_users as $user)\n {\n if (! in_array($user->get_id(), $group_users))\n {\n if (! $this->viewer->user_is_enrolled_in_group($user->get_id()))\n {\n $this->viewer->add_user_to_group($user->get_id(), $this->group_id); // user can be\n // enrolled in\n // one\n // PA-group/publication\n }\n else\n {\n $already_enrolled[] = $user->get_firstname() . ' ' . $user->get_lastname();\n }\n }\n else\n {\n unset($group_users[$id]);\n }\n }\n }\n }\n }\n \n // remove remaining users\n foreach ($group_users as $user_id)\n {\n $this->viewer->remove_user_from_group($user_id, $this->group_id);\n }\n }\n \n if (count($already_enrolled) > 0)\n $this->enroll_errors = implode(',', $already_enrolled) . ' ' . Translation::get('AlreadyEnrolled');\n }", "private function mapToEmailCampaignsTable($row) { $firstSectionOpen = $this->getFirstItem($row->esp_first_open_datetimes, null);\n $lastSectionOpen = $this->getFirstItem($row->esp_last_open_datetimes, null);\n\n $firstSectionClick = $this->getFirstItem($row->esp_first_click_datetimes, null);\n $lastSectionClick = $this->getFirstItem($row->esp_last_click_datetimes, null);\n\n if (null === $firstSectionOpen) {\n $firstSectionOpen = $firstSectionClick;\n }\n\n return [\n 'email_id' => $row->email_id,\n 'campaign_id' => $row->deploy_id,\n 'last_status' => $this->getFirstItem($row->statuses, ''),\n 'esp_first_open_datetime' => $firstSectionOpen,\n 'esp_last_open_datetime' => $lastSectionOpen,\n 'esp_total_opens' => $row->opens_counted,\n 'esp_first_click_datetime' => $firstSectionClick,\n 'esp_last_click_datetime' => $lastSectionClick,\n 'esp_total_clicks' => $row->clicks_counted,\n 'unsubscribed' => ((int)$row->unsubscribed > 0 ? 1 : 0)\n ];\n }", "public function smadata($module_id,$status){\r\n $smaquery = $this->db->get_where('app_modules_actions',array('module_id'=>$module_id));\r\n $smaquery = $smaquery->result_array();\r\n foreach ($smaquery as $smaquery) {\r\n $smadata = array(\r\n 'action_id' => $smaquery['action_id'],\r\n 'sch_id' => $_SESSION['sch_id'],\r\n 'status' => $status\r\n );\r\n $this->db->on_duplicate('school_modules_actions', $smadata);\r\n //Pdata is the array of data I will dump inside Users Permission Table\r\n $pdata = array(\r\n 'dashboard' => $smaquery['dashboard'],\r\n 'access_user_id' => $smaquery['usertype'],\r\n 'access_user_type' => 'group',\r\n 'action_id' => $smaquery['action_id'],\r\n 'sch_id' => $_SESSION['sch_id'],\r\n 'status' => $status\r\n );\r\n $this->db->on_duplicate('users_permissions_actions', $pdata);\r\n\r\n }\r\n if ($this->db->trans_status() === FALSE){\r\n $this->db->trans_rollback();\r\n return FALSE;\r\n }else{\r\n $this->db->trans_commit();\r\n return TRUE;\r\n }\r\n // print_r($pdata);\r\n //$this->db->on_duplicate('database_table', $array);\r\n }", "function get_grouping_fields() {\n //field that is used to compare one record from the next\n $compare_field = sql_concat('user.lastname', \"'_'\", 'user.firstname', \"'_'\", 'user.id');\n\n //field used to order for groupings\n $order_field = sql_concat('lastname', \"'_'\", 'firstname', \"'_'\", 'userid');\n\n $cluster_label = get_string('grouping_cluster', 'rlreport_course_completion_by_cluster');\n $cluster_grouping = new table_report_grouping('cluster', 'cluster.id', $cluster_label, 'ASC',\n array('cluster.name'), 'above', 'path');\n \n $user_grouping_fields = array(\n 'user.idnumber AS useridnumber', 'user.firstname');\n $user_grouping = new table_report_grouping('groupuseridnumber', $compare_field, '', 'ASC', \n $user_grouping_fields, 'below', $order_field);\n\n //these groupings will always be used\n $result = array(\n $cluster_grouping, $user_grouping);\n\n //determine whether or not we should use the curriculum grouping\n $preferences = php_report_filtering_get_active_filter_values($this->get_report_shortname(),\n 'columns'.'_curriculum', $this->filter);\n\n $show_curriculum = true;\n if (isset($preferences['0']['value'])) {\n $show_curriculum = $preferences['0']['value'];\n }\n\n if ($show_curriculum) {\n $curriculum_label = get_string('grouping_curriculum', 'rlreport_course_completion_by_cluster');\n $result[] = new table_report_grouping('groupcurriculumid', 'curriculum.id', $curriculum_label, 'ASC', array(),\n 'below', 'curriculumname, curriculumid');\n }\n\n return $result;\n }", "public function actionlistallescrowsinitiatedbymember(){\n \n $member_id = Yii::app()->user->id;\n \n $criteria = new CDbCriteria();\n $criteria->select = '*';\n $criteria->condition='escrow_initiated_by=:id';\n $criteria->params = array(':id'=>$member_id);\n $escrow= Escrow::model()->findAll($criteria);\n \n if($escrow===null) {\n http_response_code(404);\n $data['error'] ='No record found';\n echo CJSON::encode($data);\n } else {\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"escrow\" => $escrow)\n );\n \n }\n }", "public static function getGroupData($gid);", "public function addDataReturnsRecordTitleForGroupTypeDataProvider() {}", "public static function getMemberCollection($groupId) {\n $result1 = DB::select(\"SELECT V.user_id, V.participant_id, V.participant_type, \" .\n \"V.name, V.street, V.neighborhood, V.pic_small, V.pic_large, V.description \" . \n \"FROM group_member INNER JOIN view_participant V ON group_member.person_id = V.participant_id \" .\n \"INNER JOIN member ON member.member_id = V.participant_id \" .\n \"WHERE group_member.group_id = ? \" . \n \"AND group_member.watching_only = 0 \" . \n \"AND group_member.approved = 1\", array($groupId));\n $result2 = DB::select(\"SELECT V.user_id, V.participant_id, V.participant_type, \" .\n \"V.name, V.street, V.neighborhood, V.pic_small, V.pic_large, V.description \" . \n \"FROM group_member INNER JOIN view_participant V ON group_member.person_id = V.participant_id \" .\n \"INNER JOIN member ON member.member_id = V.participant_id \" .\n \"WHERE group_member.group_id = ? \" . \n \"AND group_member.watching_only = 1 \" . \n \"\", array($groupId));\n $result3 = DB::select(\"SELECT V.user_id, V.participant_id, V.participant_type, \" .\n \"V.name, V.street, V.neighborhood, V.pic_small, V.pic_large, V.description \" . \n \"FROM group_member INNER JOIN view_participant V ON group_member.person_id = V.participant_id \" .\n \"INNER JOIN member ON member.member_id = V.participant_id \" .\n \"WHERE group_member.group_id = ? \" . \n \"AND group_member.watching_only = 0 \" . \n \"AND group_member.approved = 0\", array($groupId));\n $result = array_merge($result1, $result2, $result3);\n return $result;\n }", "public static function markAmendmentEntries($ownerAcronym, $amendmentRows, $method = 1)\n {\n\n // Remove the first entry (so that it isn't also marked as a duplicate, since at least one entry should stay \"valid\")\n $sourceId = $amendmentRows->shift();\n\n $amendmentRows = $amendmentRows->toArray();\n\n // Update the original (sourceId) entry\n DB::table('l_contracts')\n ->where('owner_acronym', '=', $ownerAcronym)\n ->where('id', '=', $sourceId)\n ->update([\n 'gen_amendment_group_id' => $sourceId,\n ]);\n\n return DB::table('l_contracts')\n ->where('owner_acronym', '=', $ownerAcronym)\n ->whereIn('id', $amendmentRows)\n ->update([\n 'gen_is_amendment' => 1,\n 'gen_amendment_via' => $method,\n 'gen_amendment_group_id' => $sourceId,\n ]);\n }", "public function getRow($row){\n\t\t\t$this->groupId = $row['groupId'];\n\t\t\t$this->name = $row['name'];\n\t\t\t$this->description = $row['description'];\n\t\t\t\n\t\t\t$this->isLoaded = true;\n\t\t}", "protected function getGroupByAttribute()\n {\n return $this->fetchData[self::GROUP_CLAUSE];\n }", "function generateGridWithJoin($sTable, $sIndexColumn, $aColumns, $action_prefix , $jTable, $bColumns) {\n \t\n ini_set('memory_limit', '-1');\n $dbObj = $this->dbclass;\n \n // For export functionality\n unset($_SESSION['setSearchTrue']);\n unset($_SESSION['grid_columns']);\n\n $_SESSION['grid_columns'] = $aColumns;\n $_SESSION['grid_columns'] = $bColumns;\n \n /*echo '<pre>' ;\n print_r($aColumns) ;\n echo '<pre>' ;\n print_r($bColumns) ;\n exit;*/\n \n /* condition whose feedback does not zero */\n $sWhere = \"\";\n if($sTable == 'equipment')\n {\n $e = 'e';\n $c = 'u';\n \n\t\t\t$sWhere .= \" WHERE $e.company_id = '\".$_SESSION['sees_id'].\"'\";\n \n foreach ($aColumns as $key => $value) {\n\n $aColumns[$key] = \"$e.$value\";\n\n }\n \n foreach ($bColumns as $key => $value) {\n\t\t\t\tif($value==\"name\")\n\t\t\t\t{\n\t\t\t\t\t$bColumns[$key] = \"$c.$value as username\";\n\t\t\t\t}\n\t else\n\t { \n\t \t$bColumns[$key] = \"$c.$value\";\n\t }\n }\n \n } \n \n \t\t \n if($sTable == 'user' && $jTable == 'report_damage'){\n \t\t\n \t\t$e = 'el';\n $c = 'u';\n \n $sWhere .= \" WHERE $e.user_id = $c.id AND $e.equipment_id = '\".$_GET['id'].\"'\";\n \n foreach ($aColumns as $key => $value) {\n\n $aColumns[$key] = \"$c.$value\";\n\n }\n \n foreach ($bColumns as $key => $value) {\n\n $bColumns[$key] = \"$e.$value\";\n\n }\n }\n if($sTable == 'user' && $jTable != 'report_damage'){\n \t\t\n \t\t$e = 'el';\n $c = 'u';\n \n $sWhere .= \" WHERE $e.user_id = $c.id AND $e.equipment_id = '\".$_GET['id'].\"' AND $e.take_away_date != '0000-00-00' \";\n \n foreach ($aColumns as $key => $value) {\n\n $aColumns[$key] = \"$c.$value\";\n\n }\n \n foreach ($bColumns as $key => $value) {\n\n $bColumns[$key] = \"$e.$value\";\n\n }\n }\n \n /* print_r($aColumns);\n exit;*/\n \n \n /*\n * Paging\n */\n $sLimit = \"\";\n if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') {\n $sLimit = \"LIMIT \" . mysql_real_escape_string($_GET['iDisplayStart']) . \", \" .\n mysql_real_escape_string($_GET['iDisplayLength']);\n }\n\n\n /*\n * Ordering\n */\n $sOrder = \"\";\n if (isset($_GET['iSortCol_0'])) {\n $sOrder = \"ORDER BY \";\n for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) {\n if ($_GET['bSortable_' . intval($_GET['iSortCol_' . $i])] == \"true\") {\n $sOrder .= $aColumns[intval($_GET['iSortCol_' . $i])] . \"\n \" . mysql_real_escape_string($_GET['sSortDir_' . $i]) . \", \";\n }\n }\n\n $sOrder = substr_replace($sOrder, \"\", -2);\n if ($sOrder == \"ORDER BY\") {\n $sOrder = \"\";\n }\n }\n\n\t\tif($sTable == 'user' && $jTable == 'equipment_log'){\n\t\t\t\n\t\t\t$sOrder = \"ORDER BY el.id DESC\";\n\t\t}\n\t\tif($sTable == 'user' && $jTable == 'report_damage'){\n\t\t\t\n\t\t\t$sOrder = \"ORDER BY el.created DESC\";\n\t\t}\n /*\n * Filtering\n * NOTE this does not match the built-in DataTables filtering which does it\n * word by word on any field. It's possible to do here, but concerned about efficiency\n * on very large tables, and MySQL's regex functionality is very limited\n */\n\n if (isset($_GET['sSearch']) && $_GET['sSearch'] != \"\" && $sTable == 'equipment' && $jTable=='user') {\n \t$_SESSION['setSearchTrue'] = $sLimit;\n $sWhere .= \"AND (\";\n //$sWhere .= $_GET['search_by'] . \" LIKE '%\" . mysql_real_escape_string($_GET['sSearch']) . \"%' OR \";\n $sWhere .= $_GET['search_by'] . \" LIKE '%\" . mysql_real_escape_string($_GET['sSearch']) . \"%' OR \";\n $sWhere = substr_replace($sWhere, \"\", -3);\n $sWhere .= ')';\n }\n else if (isset($_GET['sSearch']) && $_GET['sSearch'] != \"\") {\n \t$_SESSION['setSearchTrue'] = $sLimit;\n $sWhere .= \"AND (\";\n // for ($i = 0; $i < count($bColumns) - 1; $i++) {\n \t\tif($sTable=='equipment' && $jTable=='company'){\n \t\t\t$sWhere .= $aColumns['1'] . \" LIKE '%\" . mysql_real_escape_string($_GET['sSearch']) . \"%' OR \";\n \t\t}else{\n \t$sWhere .= $bColumns['0'] . \" LIKE '%\" . mysql_real_escape_string($_GET['sSearch']) . \"%' OR \";\n \t\t}\n //}\n $sWhere = substr_replace($sWhere, \"\", -3);\n $sWhere .= ')';\n }\n \n //echo $sWhere; exit;\n\n /* Individual column filtering */\n for ($i = 0; $i < count($aColumns) - 1; $i++) {\n if (isset($_GET['bSearchable_' . $i]) && $_GET['bSearchable_' . $i] == \"true\" && $_GET['sSearch_' . $i] != '') {\n if ($sWhere == \"\") {\n $sWhere = \"WHERE \";\n } else {\n $sWhere .= \" AND \";\n }\n $sWhere .= $aColumns[$i] . \" LIKE '%\" . mysql_real_escape_string($_GET['sSearch_' . $i]) . \"%' \";\n }\n }\n \n \n \n /*\n * SQL queries\n * Get data to display\n */\n\n //unset($aColumns[count($aColumns)-1]);\n unset($aColumns[count($aColumns)]);\n \n \n if($sTable == 'user'){ \n \t\n \t $sQuery = \"SELECT SQL_CALC_FOUND_ROWS \" . str_replace(\" , \", \" \", implode(\", \", $aColumns)) .','.str_replace(\" , \", \" \", implode(\", \", $bColumns)). \"\n FROM $sTable as $c , $jTable as $e \n $sWhere\n $sOrder\n $sLimit\n \";\n } else if($sTable == 'equipment'){ \n \t\t$sQuery = \"SELECT SQL_CALC_FOUND_ROWS \" . str_replace(\" , \", \" \", implode(\", \", $aColumns)) .','.str_replace(\" , \", \" \", implode(\", \", $bColumns)). \"\n FROM $sTable as $e \n LEFT JOIN `$jTable` as $c ON($e.user_id = $c.id) \n $sWhere\n $sOrder\n $sLimit\n \";\n \t\t\n }else{\n \t\n \n $sQuery = \"SELECT SQL_CALC_FOUND_ROWS \" . str_replace(\" , \", \" \", implode(\", \", $aColumns)) .','.str_replace(\" , \", \" \", implode(\", \", $bColumns)). \"\n FROM $sTable as $e , $jTable as $c \n $sWhere\n $sOrder\n $sLimit\n \";\n }\n//echo $sQuery ; exit; \n $rResult = $dbObj->select($sQuery);\n \t//print_r($rResult); exit;\n if ($_SESSION['grid_query'] != \"\") {\n unset($_SESSION['grid_query']);\n }\n $_SESSION['grid_query'] = $sQuery;\n \n /* Data set length after filtering */\n $sQuery = \"SELECT FOUND_ROWS()\";\n $rResultFilterTotal = $dbObj->select($sQuery);\n $iFilteredTotal = $rResultFilterTotal[0]['FOUND_ROWS()'];\n\n /* Total data set length */\n $sQuery = \"SELECT COUNT(\" . $sIndexColumn . \") FROM $sTable \";\n $rResultTotal = $dbObj->select($sQuery);\n $iTotal = $rResultTotal[0]['COUNT(id)'];\n\n\n /*\n * Output\n */\n $output = array(\n \"sEcho\" => intval($_GET['sEcho']),\n \"iTotalRecords\" => $iTotal,\n \"iTotalDisplayRecords\" => $iFilteredTotal,\n \"aaData\" => array()\n );\n \n /*echo '<pre>'; print_r($output); exit;*/\n foreach ($aColumns as $key => $value) {\n\t\t\t\t$value=str_replace(\"e.\",\"\",$value);\n\t\t\t\t$value=str_replace(\"u.\",\"\",$value);\n $aColumns[$key] = $value;\n\n }\n // print_r($bColumns);\n //exit;\n \n \n foreach ($bColumns as $key => $value) {\n \t//echo $key.\"=>\".$value.\"<br>\";\n\t\t\t\t$value=str_replace(\"u.\",\"\",$value);\n\t\t\t\t$value=str_replace(\"el.\",\"\",$value);\n\t\t\t\tif($value==\"name as username\")\n\t\t\t\t{\n\t\t\t\t\t$bColumns[$key] = \"username\";\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n \t\t$bColumns[$key] = \"$value\";\n\t\t\t\t}\n\t\t\t}\n \n\n //echo \"<pre>\";\n //print_r($rResult);\n //echo \"<br>\";\n //exit;\n for($aRowi=0; $aRowi < count($rResult); $aRowi++){\t\n\t\t\t\t\n\t\t\t\t$aRow = $rResult[$aRowi];\n\t\t\t\t//print_r($aRow); exit;\n\t\t\t\t$row = array();\n\t\t\t\t\n\t\t\t\t$a1Columns=array();\n\t\t\t\t\n\t\t\t\t//$a1Columns=array_merge($aColumns,$bColumns);\n\t\t\t\tif($sTable == 'user' && $jTable == 'report_damage'){\n\t\t\t\t\t$a1Columns[0] = 'id';\n\t\t\t\t\t$a1Columns[1] = 'created';\n\t\t\t\t\t$a1Columns[2] = 'name';\n\t\t\t\t\t$a1Columns[3] = 'phone';\n\t\t\t\t\t$a1Columns[4] = 'status';\n\t\t\t\t\t$a1Columns[5] = 'image';\n\t\t\t\t}else{\n\t\t\t\t\t$a1Columns=array_merge($aColumns,$bColumns);\n\t\t\t\t}\n\t\t\t\t//echo count($aColumns).\"===\"; exit;\n\t\t\t\t//print_r($a1Columns); exit;\n\t\t\t\tfor ( $i=0 ; $i<=count($a1Columns) ; $i++ )\n\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif ( $a1Columns[$i] == \"version\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t/* Special output formatting for 'version' column */\n\t\t\t\t\t\t$row[] = ($aRow[ $a1Columns[$i] ]==\"0\") ? '-' : $aRow[ $a1Columns[$i] ];\n\t\t\t\t\t}else if($a1Columns[$i] == \"id\"){\n\t\t\t\t\t\tif($sTable == 'user' && $jTable == 'report_damage'){\n\t\t\t\t\t\t\t$user_id = $aRow[$a1Columns[$i]]; \n\t\t\t\t\t\t\t$status = $aRow[$a1Columns[$i+4]] ;\n\t\t\t\t\t\t\tif($status == 'Closed'){\n\t\t\t\t\t\t\t\t$row[] = \"<input type='checkbox' disabled onclick='isChecked(this.checked);' value='\".$user_id.\"' name='cid[]' id='cb\".$aRowi.\"'>\";\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$row[] = \"<input type='checkbox' onclick='isChecked(this.checked);' value='\".$user_id.\"' name='cid[]' id='cb\".$aRowi.\"'>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if($sTable == 'user' && $jTable == 'equipment_log'){\n\t\t\t\t\t\t\t$user_id = $aRow[$a1Columns[$i]];\n\t\t\t\t\t\t\t//$row[] = 'View Details';\n\t\t\t\t\t\t}else if($sTable == 'equipment' && $jTable == 'user'){\n\t\t\t\t\t\t\t$row[] = $aRow[$a1Columns[$i]];\n\t\t\t\t\t\t\t$user_id = $aRow[$a1Columns[$i]];\n\t\t\t\t\t\t}else if($jTable == 'user' ){\n\t\t\t\t\t\t\t$row[] = \"<input type='checkbox' onclick='isChecked(this.checked);' value='\".$user_id.\"' class='chkstatus' name='cid[]' id='cb\".$aRowi.\"'>\";\n\t\t\t\t\t\t\t$user_id = $aRow[$a1Columns[$i]];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$user_id = $aRow[$a1Columns[$i]];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if($a1Columns[$i] == \"name\"){\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($sTable == 'user' && $jTable == 'equipment_log'){\n\t\t\t\t\t\t\t$user_id = $aRow[\"id\"];\n\t\t\t\t\t\t\t$row[] = \"<a href='index.php?file=equipmentlogdetail&id=\".$user_id.\"&equip_id=\".$_GET['id'].\"'>\".$aRow[$a1Columns[$i]].\"</a>\";\n\t\t\t\t\t\t}else if($sTable == 'equipment' && $jTable == 'user'){\n\t\t\t\t\t\t\t$user_id = $aRow[\"id\"];\n\t\t\t\t\t\t\t$row[] = \"<a href='index.php?file=equipmentaddedit&id=\".$user_id.\"'>\".$aRow[$a1Columns[$i]].\"</a>\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$row[] = $aRow[$a1Columns[$i]];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if ( $a1Columns[$i] == \"image\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$row[] = '<a href=\"'.$aRow[$a1Columns[$i]].'\" target=\"_blank\">View image</a>';\n\t\t\t\t\t}\n\t\t\t\t\telse if ( $a1Columns[$i] == \"created\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($sTable == 'user' && $jTable == 'report_damage'){\n\t\t\t\t\t\t\t$row[] = '<a href=\"index.php?file=reportdamagedetail&id='.$user_id.'&equip_id='.$_GET['id'].'\">'.$aRow[$a1Columns[$i]].'</a>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if ( $a1Columns[$i] == \"latitude\" )\n\t\t\t\t\t{\n\t\t\t\t\t\tif($sTable == 'user' && $jTable == 'equipment_log'){\n\t\t\t\t\t\t\t$lat = $aRow[$a1Columns[$i]];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if ( $a1Columns[$i] == \"longitude\" )\n\t\t\t\t\t{\n\t\t\t\t\t\tif($sTable == 'user' && $jTable == 'equipment_log'){\n\t\t\t\t\t\t\t$long = $aRow[$a1Columns[$i]];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if ( $a1Columns[$i] == \"location\" )\n\t\t\t\t\t{\n\t\t\t\t\t\tif($sTable == 'user' && $jTable == 'equipment_log'){\n\t\t\t\t\t\t\tif($lat != '0' && $long != '0'){\n\t\t\t\t\t\t\t\t$row[] = '<a href=\"https://maps.google.com/maps?q='.$lat.','.$long.'\" target=\"_blank\">'.$aRow[$a1Columns[$i]].'</a>';\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$row[] = $aRow[$a1Columns[$i]];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if($sTable == 'equipment' && $jTable == 'user'){\n\t\t\t\t\t\t\t$euipmentLog = 'SELECT latitude, longitude FROM equipment_log WHERE equipment_id = \"'.$user_id.'\" ORDER BY id DESC LIMIT 1' ;\n\t\t\t\t\t\t\t$euipmentLogRes = $dbObj->select($euipmentLog);\n\t\t\t\t\t\t\t$lat = $euipmentLogRes[0]['latitude'];\n\t\t\t\t\t\t\t$long = $euipmentLogRes[0]['longitude'];\n\t\t\t\t\t\t\t$row[] = '<a href=\"https://maps.google.com/maps?q='.$lat.','.$long.'\" target=\"_blank\">'.$aRow[$a1Columns[$i]].'</a>';\n\t\t\t\t\t\t} else{\n\t\t\t\t\t\t\t$row[] = $aRow[$a1Columns[$i]];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if ( $a1Columns[$i] != ' ' ) {\n\t\t\t\t\t\tif($a1Columns[$i] == \"id\"){\n\t\t\t\t\t\t\t$user_id = $aRow[$a1Columns[$i]];\n\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\t/* General output */\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($i==count($a1Columns)){\n\t\t\t\t\t\t\tif($sTable == 'equipment' && $jTable == 'user'){\n\t\t\t\t\t\t\t\t$row[] = \"<a href='index.php?file=equipmentloglistview&id=\".$user_id.\"'><img src='images/book-icon.png' title='Equipment Log' alt='Equipment Log' /><a/>\" ;\n\t\t\t\t\t\t\t\t$row[] .= \"<a href='index.php?file=reportdamageview&id=\".$user_id.\"'><img src='images/mark.png' title='Report Damage' alt='Report Damage' /><a/>\";\n\t\t\t\t\t\t\t\t$row[] .= \"<a class='remove' href='javascript:deleteEquipment(/\".$user_id.\"/)'><img src='images/remove_user1.png' title='Remove' alt='Remove' /></a><input type='hidden' id='id\".$aRowi.\"' name='equipId' class='equipId' value='\".$user_id.\"' />\";\n\t\t\t\t\t\t\t}else if($sTable == 'user' && $jTable == 'equipment_log'){\n\t\t\t\t\t\t\t\t$sql = 'SELECT id FROM `external_users` WHERE equip_log_id = \"'.$user_id.'\" ORDER BY id desc LIMIT 1' ;\n\t\t\t\t\t\t\t\t$res = $dbObj->select($sql);\n\t\t\t\t\t\t\t\tif($res) {\n\t\t\t\t\t\t\t\t\t$row[] = '<a href=\"index.php?file=externaluserview&id='.$res[0]['id'].'\">View Details</a>' ;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$row[] = '' ;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$row[]= \"<a class='remove' href='javascript:deletePhoto(\".$user_id.\")'><img src='images/remove_user1.png' width='20' title='Remove' alt='Remove' /></a>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\t\n\t\t\t\t\t\t\tif($a1Columns[$i] == $action_prefix){\n\t\t\t\t\t\t\t\t$row[] = \"<a href='index.php?file=\".$sTable.\"addview&id=\".$user_id.\"' >\".$aRow[$a1Columns[$i]].\"</a>\";\n\t\t\t\t\t\t\t}else if($a1Columns[$i] == \"published\" && $action_prefix != ''){\n\t\t\t\t\t\t\t\tif($aRow[$a1Columns[$i]] == 1){\n\t\t\t\t\t\t\t\t\t$row[] = \"<a class='published' href='index.php?file=\".$sTable.\"actions&task=published&id=\".$user_id.\"' >\n\t\t\t\t\t\t\t\t\t<img src='images/published.png' height='20' width='20' title='Published' alt='Published' /></a>\";\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$row[] = \"<a class='unpublished' href='index.php?file=\".$sTable.\"actions&task=published&id=\".$user_id.\"' >\n\t\t\t\t\t\t\t\t\t<img src='images/unpublished.png' height='20' width='20' title='Unpublished' alt='Unpublished' /></a>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else if($a1Columns[$i] == \"id\" ){\n\t\t\t\t\t\t\t\t//if($sTable == 'user' && $jTable == 'report_damage'){\n\t\t\t\t\t\t\t\t\t$row[] = \"<input type='checkbox' onclick='isChecked(this.checked);' value='\".$user_id.\"' name='cid[]' id='cb\".$aRowi.\"'>\";\n\t\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t\t}else{\t\n\t\t\t\t\t\t\t\t//echo 'test'\t; exit;\n\t\t\t\t\t\t\t\t//echo $aRow[$a1Columns[$i]] ; exit;\n\t\t\t\t\t\t\t\t$row[] = $aRow[$a1Columns[$i]];\n\t\t\t\t\t\t\t\t///print_r($row) ; \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}\n\t\t\t\t//print_r($row) ; exit;\n\t\t\t\t//for ( $j=0 ; $j<=count($bColumns) ; $j++ )\n\t\t\t\t//{\n\t\t\t\t//\t$row[] = $aRow[$bColumns[$j]];\t\t\t\t\t\n\t\t\t\t//}\t\n\t\t\t\t//print_r($row);\n\t\t\t\t//exit;\n\t\t\t\t$output['aaData'][] = $row;\n\t\t\t}\n\t\t\t//print_r($output['aaData']);\n\t\t\t//exit;\n $output['tablename'] = $sTable;\n echo json_encode($output);\n \n \n }", "private function cObjData_updateRow( $uid )\n {\n static $firstVisit = true;\n\n // RETURN: empty row\n if ( empty( $this->rows[ $uid ] ) )\n {\n return;\n }\n // RETURN: empty row\n // Add each element of the row to cObj->data\n foreach ( ( array ) $this->rows[ $uid ] as $key => $value )\n {\n $this->pObj->cObj->data[ $key ] = $value;\n }\n\n // Add the field uid with the uid of the current row\n $key = $this->sql_filterFields[ $this->curr_tableField ][ 'uid' ];\n $value = $this->rows[ $uid ][ $key ];\n $this->pObj->cObj->data[ 'uid' ] = $value;\n\n // Add the field value with the value of the current row\n $key = $this->sql_filterFields[ $this->curr_tableField ][ 'value' ];\n $value = $this->rows[ $uid ][ $key ];\n $this->pObj->cObj->data[ 'value' ] = $value;\n\n // Add the field hits with the hits of the filter item\n $key = $this->sql_filterFields[ $this->curr_tableField ][ 'hits' ];\n $value = $this->rows[ $uid ][ $key ];\n $this->pObj->cObj->data[ 'hits' ] = $value;\n//$this->pObj->dev_var_dump( $this->pObj->cObj->data['hits'] );\n // Add the field rowNumber with the number of the current row\n $key = $this->pObj->prefixId . '.rowNumber';\n $value = $this->itemsPerHtmlRow[ 'currItemNumberInRow' ];\n\n // DRS\n if ( $firstVisit && $this->pObj->b_drs_cObjData )\n {\n foreach ( ( array ) $this->pObj->cObj->data as $key => $value )\n {\n $arr_prompt[] = '\\'' . $key . '\\' => \\'' . $value . '\\'';\n }\n $prompt = 'cObj->data of the first row: ' . implode( '; ', ( array ) $arr_prompt );\n t3lib_div::devlog( '[OK/COBJ] ' . $prompt, $this->pObj->extKey, -1 );\n }\n // DRS\n\n $firstVisit = false;\n }", "public function getEventdata($event_unique_id){\r\n $this->db->select('events.*,courses.course_name,states.state,organisations.organisation_name,centers.center,GROUP_CONCAT(DISTINCT tbl_batchs.batch_name SEPARATOR \", \") as batch_names');\r\n $this->db->join('states','states.id=events.state_id');\r\n $this->db->join('organisations','organisations.id=events.organisation_id');;\r\n $this->db->join('centers','centers.id=events.center_id');\r\n $this->db->join('courses','courses.id=events.course_id','left');\r\n $this->db->join('tbl_batchs', 'FIND_IN_SET(tbl_batchs.id, tbl_events.batch_ids)', '', FALSE); \r\n $this->db->where('event_unique_id',$event_unique_id); \r\n $this->db->from('events');\r\n $this->db->group_by('events.id');\r\n $query=$this->db->get();\r\n // echo $this->db->last_query();\r\n $result=$query->row_array();\r\n\r\n return $result;\r\n }", "private function grouping_group_assigned($event) {\n global $DB;\n $groupid = $event->other['groupid'];\n $members = groups_get_members($groupid, 'userid');\n $group = groups_get_group($groupid, 'courseid');\n $courseid = $group->courseid;\n $course = $DB->get_record('course', array('id' => $courseid), 'visible');\n $coursecontext = context_course::instance($courseid);\n $coursemodinfo = get_fast_modinfo($courseid, -1);\n $cms = $coursemodinfo->get_cms();\n\n $insertcalls = array();\n $deletecalls = array();\n\n foreach ($cms as $cm) {\n $cmid = $cm->id;\n $cmcontext = context_module::instance($cmid);\n $fileids = $this->get_fileids($cmid);\n if ($fileids) {\n foreach ($fileids as $fileid) {\n foreach ($members as $member) {\n $gmail = $this->get_google_authenticated_users_gmail($member->userid);\n if (has_capability('moodle/course:view', $coursecontext, $member->userid)) {\n // Manager; do nothing.\n } elseif (is_enrolled($coursecontext, $member->userid, null, true) && has_capability('moodle/course:manageactivities', $cmcontext, $member->userid)) {\n // Teacher (enrolled) (active); do nothing.\n } elseif (is_enrolled($coursecontext, $member->userid, null, true)) {\n // Student (enrolled) (active); continue checks.\n if ($course->visible == 1) {\n // Course is visible, continue checks.\n rebuild_course_cache($courseid, true);\n $modinfo = get_fast_modinfo($courseid, $member->userid);\n $cminfo = $modinfo->get_cm($cmid);\n $sectionnumber = $this->get_cm_sectionnum($cmid);\n $secinfo = $modinfo->get_section_info($sectionnumber);\n if ($cminfo->uservisible && $secinfo->available && is_enrolled($coursecontext, $member->userid, '', true)) {\n // Course module and section are visible and available.\n // Insert reader permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'reader';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n } else {\n // User cannot access course module; delete permission.\n try {\n $permissionid = $this->service->permissions->getIdForEmail($gmail);\n $permission = $this->service->permissions->get($fileid, $permissionid->id);\n if ($permission->role != 'owner') {\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->permissionid = $permissionid->id;\n $deletecalls[] = $call;\n if (count($deletecalls) == 1000) {\n $this->batch_delete_permissions($deletecalls);\n $deletecalls = array();\n }\n }\n } catch (Exception $e) {\n debugging($e);\n }\n }\n }\n // Course is not visible; do nothing.\n }\n // User is not enrolled in course; do nothing.\n }\n }\n }\n }\n\n // Call any remaining batch requests.\n if (count($insertcalls) > 0) {\n $this->batch_insert_permissions($insertcalls);\n }\n\n if (count($deletecalls) > 0) {\n $this->batch_delete_permissions($deletecalls);\n }\n }", "function get_group( $id ) {\r\n global $wpdb;\r\n return $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$wpdb->prefix}wpc_client_groups WHERE group_id = %d\", $id ), \"ARRAY_A\");\r\n }", "private function normalize()\n {\n $field_id = isset($this->columns[0]) ? $this->columns[0] : 'id';\n\n $field_text = isset($this->columns[1]) ? $this->columns[1] : $field_id;\n\n $groups = [];\n\n $has_empty_groups = false;\n\n foreach ($this->data as $key => $datum) {\n $has_empty_groups = !is_numeric($key);\n }\n\n foreach ($this->data as $key => $datum) {\n if (is_array($datum) && isset($datum['id']) && isset($datum['text'])) {\n $this->push($datum);\n\n continue;\n }\n\n if (is_numeric($key)) {\n if (is_string($datum)) {\n $datum = [$datum];\n }\n\n $id = multi_dot_call($datum, $field_id);\n $id = $id === null ? (string) multi_dot_call($datum, '0') : (string) $id;\n\n $text = multi_dot_call($datum, $field_text);\n if (is_array($text)) {\n $lang = App::getLocale();\n $text = $text[$lang] ?? implode($this->separator, $text);\n }\n $text = $text === null ? (string) multi_dot_call($datum, '0') : (string) $text;\n\n if ($id && $text) {\n $text = $id . \") \" . $text;\n }\n\n foreach (array_slice($this->columns, 2) as $part) {\n $t = multi_dot_call($datum, $part);\n if ($t) {\n $text .= $this->separator.$t;\n }\n }\n\n $item = ['id' => $id, 'text' => $text];\n\n if ($id == $this->value) {\n $item['selected'] = true;\n }\n\n if (!$has_empty_groups) {\n $this->push($item);\n } else {\n $groups['Other'][] = $item;\n }\n } else {\n $groups[ucfirst($key)] = $datum;\n }\n }\n\n foreach ($groups as $group_name => $group) {\n $this->push([\n 'text' => $group_name,\n 'children' => collect($group)->map(function ($datum) use ($field_id, $field_text) {\n if (is_string($datum)) {\n $datum = [$field_id => $datum, $field_text => $datum];\n }\n\n $id = (string) multi_dot_call($datum, $field_id);\n\n $text = (string) multi_dot_call($datum, $field_text);\n\n foreach (array_slice($this->columns, 2) as $part) {\n $t = multi_dot_call($datum, $part);\n\n if ($t) {\n $text .= ' '.$t;\n }\n }\n\n $item = ['id' => $id, 'text' => $text];\n\n if ($id == $this->value) {\n $item['selected'] = true;\n }\n\n return $item;\n })->toArray()\n ]);\n }\n }", "public function populate($data)\n {\n $set_data = [];\n\n foreach ((array)$data as $row_key => $row_value) {\n if (is_array($row_value) && isset($this->groups[$row_key])) {\n foreach ($row_value as $row_subkey => $row_subvalue) {\n $set_data[$row_key . '_' . $row_subkey] = $row_subvalue;\n }\n } else {\n $set_data[$row_key] = $row_value;\n }\n }\n\n foreach ($set_data as $field_name => $field_value) {\n if (isset($this->fields[$field_name])) {\n $field = $this->fields[$field_name];\n $field->setValue($field_value);\n }\n }\n }", "public function get_std_ids_accro_batch($seme_code,$dept_info,$batch_info){\n $this->db->order_by('std_batch','DESC')->group_by('std_id');\n $query = $this->db->get_where('msit_tb_result', array('semester_code' => $seme_code, 'std_dept' => $dept_info, 'std_batch' => $batch_info));\n return $query->result();\n\n }", "public function actionAdd()\n {\n if (Yii::$app->getRequest()->Post('gid') && Yii::$app->getRequest()->Post('iid')) {\n $landingPageId = (int)Yii::$app->getRequest()->Post('gid');\n $groupingId = (int)Yii::$app->getRequest()->Post('iid');\n $model = LandingPageGrouping::find()->andWhere(['landing_page_id' => $landingPageId])->\n andWhere(['grouping_id' => $groupingId])->one();\n if (!$model) {\n $model = new LandingPageGrouping();\n $model->landing_page_id = $landingPageId;\n $model->grouping_id = $groupingId;\n if ($model->validate()) {\n $model->save();\n }\n }\n\n $groupings = Grouping::find()->onLandingPage($landingPageId)->active()->\n asArray()->all();\n } else {\n $groupings = false;\n }\n \n \\Yii::$app->response->format = 'json';\n return $groupings;\n }", "public function get_rows()\n\t{\n//\t\t$rows = new object_list($this->connections_from(array(\"type\" => \"RELTYPE_CHILD\", \"to.class_id\" => crm_bill_row_obj::CLID)));\n\t\t$rows = new object_list(array(\n\t\t\t\"class_id\" => crm_bill_row_obj::CLID,\n\t\t\t\"CL_CRM_BILL_ROW.RELTYPE_CHILD(CL_CRM_BILL_ROW_GROUP).oid\" => $this->id(),\n\t\t\tnew obj_predicate_sort(array(\"jrk\" => \"asc\")),\n\t\t));\n\t\treturn $rows;\n\t}", "public function aggregateListRow()\n\t{\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "public function aggregateListRow()\n\t{\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "function genSMGrp($empId) {\n $select = ['employe_table_employe_id', 'employe_table_employe_name', 'employe_table_employe_hierarchy'];\n $this->db->select($select);\n $this->db->order_by('employe_table_employe_name', 'ASC');\n\n $empInfo = $this->db->get_where('employe_table', array('under_SM_EmpId' => $empId))->result_array();\n foreach ($empInfo as $value) {\n $empArr[$value['employe_table_employe_name']] = $value;\n }\n return $empInfo;\n }", "function ItemsTableDataGroupWithAddRow($title,$group,$cgiupdatevar,$cgiprekey,$newitem,$postmethod=FALSE,$updatekey=\"AddRow\",$nempties=0)\n {\n $this->ItemData();\n \n $datas=$this->ItemDataGroups[ $group ][ \"Data\" ];\n $added=FALSE;\n if ($this->GetPOST($cgiupdatevar)==1 && $this->GetPOST($updatekey)==1)\n {\n $newitem=$this->UpdateAddRow($cgiprekey,$newitem,$datas,$updatekey);\n }\n\n $this->MyMod_Items_Read(\"\",$datas,TRUE,FALSE,2);\n \n if ($postmethod)\n {\n $newitem=$this->$postmethod($newitem);\n }\n\n\n $table=$this->MyMod_Data_Group_Table\n (\n $title,\n 1,\n $group,\n $this->ItemHashes,\n array(),\n $cgiupdatevar\n );\n\n array_push\n (\n $table,\n $this->AddRow($cgiprekey,$newitem,$datas,!$added,$nempties)\n );\n\n return $table;\n }", "function AggregateListRow() {\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "function AggregateListRow() {\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "function AggregateListRow() {\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}", "public function get_app_user_id_for_ios_group_message($group_message_id)\n\t{\n\t\t$return_array=array();\n\t\t$i=0;\n\t\t\n\t\t$sql=\"SELECT * FROM app_user JOIN app_user_ios ON (app_user.app_user_id=app_user_ios.ref_app_user_ios_app_user_id) where app_user.ref_app_user_device_type_id=\".IOS_DEVICE_TYPE_ID.\" and app_user_activation=1 \";\n\t\t$query=$this->db->query($sql);\n\t\t$app_user_id_array=$query->result_array();\n\t\tforeach($app_user_id_array as $app_user_id_1)\n\t\t{\n\t\t\t$app_user_id=$app_user_id_1['app_user_id'];\n\t\t$sql_group_message_or_gate=\"SELECT * FROM (SELECT group_message_id FROM group_message where group_message_id=$group_message_id and is_condition_or_gate=1 AND (\n CASE WHEN is_condition_birth_year=1 then condition_birth_year=(SELECT YEAR(app_user_birth_date) FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id) \n ELSE FALSE\n END \n OR\n CASE WHEN is_condition_birth_month=1 then condition_birth_month=(SELECT MONTH(app_user_birth_date) FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id)\n ELSE FALSE\n END \n OR\n CASE WHEN is_condition_age_range=1 then (SELECT FLOOR(DATEDIFF (CURRENT_DATE, `app_user_birth_date`)/365) AS age FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id) BETWEEN condition_age_starting_range AND condition_age_ending_range\n ELSE FALSE\n END \n OR\n CASE WHEN is_condition_sex=1 then condition_sex=(SELECT app_user_sex FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id)\n ELSE FALSE\n END \n OR\n CASE WHEN is_condition_city=1 then LOWER(condition_city_name) LIKE (SELECT LOWER(app_user_city) FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id)\n ELSE FALSE\n END \n OR\n CASE WHEN is_condition_post_code=1 then condition_post_code=(SELECT app_user_post_code FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id)\n ELSE FALSE\n END \n )\n ) as group_message_or_gate \";\n\t\t$sql_group_message_and_gate=\"SELECT group_message_id FROM (SELECT * FROM group_message where group_message_id=$group_message_id and is_condition_and_gate=1 AND \n\t\tCASE WHEN is_condition_birth_year=1 then condition_birth_year=(SELECT YEAR(app_user_birth_date) FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id) \n\t\tELSE TRUE \n\t\tEND \n\t\tAND \n\t\tCASE WHEN is_condition_birth_month=1 then condition_birth_month=(SELECT MONTH(app_user_birth_date) FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id) \n\t\tELSE TRUE \n\t\tEND \n\t\tAND \n\t\tCASE WHEN is_condition_age_range=1 then (SELECT FLOOR(DATEDIFF (CURRENT_DATE, `app_user_birth_date`)/365) AS age FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id) BETWEEN condition_age_starting_range AND condition_age_ending_range \n\t\tELSE TRUE \n\t\tEND \n\t\tAND \n\t\tCASE WHEN is_condition_sex=1 then condition_sex=(SELECT app_user_sex FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id) \n\t\tELSE TRUE \n\t\tEND \n\t\tAND \n\t\tCASE WHEN is_condition_city=1 then LOWER(condition_city_name) LIKE (SELECT LOWER(app_user_city) FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id) \n\t\tELSE TRUE \n\t\tEND \n\t\tAND \n\t\tCASE WHEN is_condition_post_code=1 then condition_post_code=(SELECT app_user_post_code FROM app_user_details WHERE ref_app_user_details_app_user_id=$app_user_id) \n\t\tELSE TRUE \n\t\tEND \n\t\t) as group_message_and_gate\";\n\t\t\n\t\t\n\t\t$sql_final=\"SELECT * FROM (SELECT * FROM message JOIN \n\t\t(SELECT * FROM group_message where group_message_id in( \".$sql_group_message_or_gate.\" \n\t\tUNION \".$sql_group_message_and_gate.\" \n\t\t)) as group_message_or_and ON (message.message_id=group_message_or_and.ref_group_message_message_id) \n\t\t \n\t\t ) as final_message\n\t\tWHERE final_message.message_active=1 \";\n\t\t$query=$this->db->query($sql_final);\n\t\tif($query->num_rows()==1)\n\t\t{\n\t\t\t$return_array[$i]=$app_user_id_1['ios_device_token'];\n\t\t\t$i++;\n\t\t}\n\t\t}\n\t\treturn $return_array;\n\n\t}", "function push_subscribersRowObject($data){\n $id = $data['id'];\n $email = $data['email'];\n $date = $data['date'];\n\n $resultObject = '<tr class=\"even pointer\" id=\"data_row\" name=\"data_row\" role=\"row\">\n <td class=\"a-center \" name=\"table_td-checkbox\">\n <div class=\"icheckbox_flat-green\" style=\"position: relative;\" name=\"data_check\" onClick=\"selected_checkbox(this)\">\n <input id=\"row_check\" type=\"checkbox\" class=\"table-checkbox\" value=\"'.$id.'\" name=\"table_records\">\n <ins class=\"iCheck-helper\" style=\"position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background-color: rgb(255, 255, 255); border: 0px; opacity: 0; background-position: initial initial; background-repeat: initial initial;\"></ins>\n <input id=\"row_index\" type=\"hidden\" value=\"\" name=\"row_index\">\n </div>\n </td>\n <td id=\"id\" class=\" \" name=\"id\" style=\"width:7%; margin-right:5px;\">\n <input id=\"id\" class=\"table_td-input\" name=\"table_input-field\" value=\"'.$id.'\" readonly=\"readonly\"/>\n </td>\n <td id=\"email\" class=\" \" name=\"email\">\n <input id=\"email\" class=\"table_td-input\" name=\"table_input-field\" value=\"'.$email.'\" readonly=\"readonly\"/>\n </td>\n <td id=\"date\" class=\" \" name=\"date\">\n <input id=\"date\" class=\"table_td-input\" name=\"table_input-field\" value=\"'.$date.'\" readonly=\"readonly\"/>\n </td>\n <td class=\"table-operation\" name=\"table_td-operation\">\n <a name=\"delete_button\" href=\"#\" onclick=\"select_operation(event, '.$id.')\">\n <i id=\"delete\" class=\"fa fa-trash\" title=\"Delete\"></i>\n </a>\n <a name=\"edit_button\" href=\"#\" onclick=\"select_operation(event, '.$id.')\" >\n <i id=\"edit\" class=\"fa fa-pencil\" title=\"Edit\"></i>\n </a>\n <a name=\"load_button\" class=\"op-not-enable\" href=\"#\" onclick=\"select_operation(event, '.$id.')\">\n <i id=\"load\" class=\"fa fa-play-circle\" title=\"Load\"></i>\n </a>\n </td>\n </tr>';\n return $resultObject;\n}", "function validate_row($srcrow, $table) {\n\n foreach ($table as $dstrow) {\n if ($srcrow['cbsId'] == $dstrow['cbsId']) {\n // print(\"Match found for \" . $srcrow['cbsId'] . \"\\n\");\n return true;\n }\n }\n print(\"No Match found for \" . $srcrow['cbsId'] . \" \" . $srcrow['cbsName'] . \" \\n\");\n return false;\n}", "function parseRow($data) {\n global $colCount, $schema;\n $num = count($data);\n if($num != $colCount) {\n echo \"ERROR: Column count does not match schema\". \"<br />\\n\" . $data . \"<br />\\n<br />\\n\";\n }\n \n $params_contr = array(\n 'version' => 3,\n 'sequential' => 1,\n );\n\n // convert indices to names from first row and translate values to id values\n for ($c=0; $c < $num; $c++) {\n $params_contr[($schema[$c])] = translate2id($data[$c]);\n }\n\n\n// print_r($params_contr);\n// print \"<br>\\n\";\n $result_contr = civicrm_api('Contribution', 'create', $params_contr);\n// print_r($result_contr);\n// print \"<br>\\n\";\n\n if($result_contr['is_error']) {\n print_r($result_contr);\n print \"<br>\\n<br>\\n\";\n return false;\n }\n\n $params_mem = array(\n 'version' => 3,\n 'sequential' => 1,\n 'membership_id' => $params_contr['membership_id'], \n 'contribution_id' => $result_contr['id'],\n );\n \n $result_mem = civicrm_api('MembershipPayment', 'create', $params_mem);\n// print_r($result_mem);\n// print \"<br>\\n\";\n if($result_mem['is_error']) {\n print_r($result_mem);\n print \"<br>\\n<br>\\n\";\n return false;\n }\n\n return true;\n}", "private function generateRepeatingRowsWithGrouping(& $data, $repeatRange)\n {\n $rowCounter=0;\n\t\t$groupCounter=0;\n\t\t$footerCount=0;\n\t\t$repeatTemplateArray=$this->objWorksheet->rangeToArray($repeatRange,null,true,true,true);\n\t\t//insert repeating rows but first check for minimum number of rows\n\t\tif(isset($data['minRows']))\n\t\t{\n\t\t\t$minRows=(int)$data['minRows'];\n\t\t}\n\t\telse\n\t\t\t$minRows=0;\n\n $templateKeys=array_keys($repeatTemplateArray);\n\t\t$lastRowFoundAt=end($templateKeys);\n\t\t$firstRowFoundAt=reset($templateKeys);\n\t\t$rowsFound=count($repeatTemplateArray);\n\n\t\tlist($rangeStart,$rangeEnd) = PHPExcel_Cell::rangeBoundaries($repeatRange);\n\t\t$firstCol=PHPExcel_Cell::stringFromColumnIndex($rangeStart[0]-1);\n\t\t$lastCol=PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0]-1);\n\n\t\t$mergeCells=$this->objWorksheet->getMergeCells();\n\t\t$needMerge=array();\n\t\tforeach($mergeCells as $mergeCell)\n\t\t{\n\t\t\tif($this->isSubrange($mergeCell, $repeatRange))\n\t\t\t{\n\t\t\t\t//contains merged cells, save for later\n\t\t\t\t$needMerge[]=$mergeCell;\n\t\t\t}\n\t\t}\n\n\t\t//group array should have header, rows and summary elements\n\t\tforeach($this->_group['rows'] as $name=>$rows)\n\t\t{\n\t\t\t$groupCounter++;\n\t\t\t$caption=$this->_group['caption'][$name];\n\t\t\t$newRowIndex=$firstRowFoundAt+$rowCounter*$rowsFound+$footerCount*$rowsFound+$groupCounter;\n\t\t\t//insert header for the group\n\t\t\t$this->objWorksheet->insertNewRowBefore($newRowIndex,1);\n\t\t\t$this->objWorksheet->setCellValue($firstCol.$newRowIndex,$caption);\n\t\t\t$this->objWorksheet->mergeCells($firstCol.$newRowIndex.\":\".$lastCol.$newRowIndex);\n\n\t\t\t//add style for the header\n\n\t\t\t$this->objWorksheet->getStyle($firstCol.$newRowIndex)->applyFromArray($this->_headerGroupStyleArray);\n\n\t\t\t//add data for the group\n\t\t\tforeach ($rows as $row)\n\t\t\t{\n\t\t\t\t$value=$data['data'][$row];\n\t\t\t\t$rowCounter++;\n\t\t\t\t$skip=$rowCounter*$rowsFound+$footerCount*$rowsFound+$groupCounter;\n\t\t\t\t$newRowIndex=$firstRowFoundAt+$skip;\n\n\t\t\t\t//insert one or more rows if needed\n\t\t\t\tif($minRows<$rowCounter)\n\t\t\t\t\t$this->objWorksheet->insertNewRowBefore($newRowIndex,$rowsFound);\n\n\t\t\t\t//copy merge definitions\n\t\t\t\tforeach($needMerge as $nm)\n\t\t\t\t{\n\t\t\t\t\t$nm=PHPExcel_Cell::rangeBoundaries($nm);\n\t\t\t\t\t$newMerge=PHPExcel_Cell::stringFromColumnIndex($nm[0][0]-1).($nm[0][1]+$skip).\":\".PHPExcel_Cell::stringFromColumnIndex($nm[1][0]-1).($nm[1][1]+$skip);\n\n\t\t\t\t\t$this->objWorksheet->mergeCells($newMerge);\n\t\t\t\t}\n\n\t\t\t\t//generate row of data\n\t\t\t\t$this->generateSingleRepeatingRow($value, $repeatTemplateArray, $rowCounter, $skip, $data['id'], $data['format'], $data['step']);\n\t\t\t}\n\n\t\t\t//include the footer if defined\n\t\t\tif(isset($this->_group['summary']) && isset($this->_group['summary'][$name]))\n\t\t\t{\n\t\t\t\t$footerCount++;\n\t\t\t\t$skip=$groupCounter+$rowCounter*$rowsFound+$footerCount*$rowsFound;\n\t\t\t\t$newRowIndex=$firstRowFoundAt+$skip;\n\n\t\t\t\t$this->objWorksheet->insertNewRowBefore($newRowIndex,$rowsFound);\n\t\t\t\t$this->generateSingleRepeatingRow($this->_group['summary'][$name], $repeatTemplateArray, '', $skip, $data['id'], $data['format'], $data['step']);\n\t\t\t\t//add style for the footer\n\n\t\t\t\t$this->objWorksheet->getStyle($firstCol.$newRowIndex.\":\".$lastCol.$newRowIndex)->applyFromArray($this->_footerGroupStyleArray);\n\t\t\t}\n\n\t\t\t//remove merge on template, BUG fix\n\t\t\tforeach($needMerge as $nm)\n\t\t\t{\n\t\t\t\t$this->objWorksheet->unmergeCells($nm);\n\t\t\t}\n\t\t}\n }", "private function build_item_data($groupie, $rows) {\n\t\t$rendered='';\n\t\t$item_count=0;\n\t\t$item_count_total=0;\n\t\t$rows_current=array();\n\t\t// process the item template (lowest levels only)\n\t\tif (($rows!=null) && ($groupie->item_template!=null)) {\n\t\t\t\n\t\t\t// if there is a field map defined, map the values from the row\n\t\t\t// into the control->attributes array\n\t\t\tif($groupie->control_attribute_map) {\n\t\t\t\t$map_items = $groupie->control_attribute_map->items;\n\n\t\t\t\tforeach($map_items as $item)\n\t\t\t\t{\t\n\t\t\t\t\tforeach($item->items as $attribute => $mapping)\n\t\t\t\t\t\t$this->attributes[$attribute] = $rows[0][$mapping];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\ttry {\n\t\t\t\t$template=$this->get_template($groupie->item_template);\n\t\t\t} catch (Exception $e) { \n\t\t\t\t// The only exception currently thrown is if the item template file isn't there\n\t\t\t\t// (in this case, we'll look for item.php in the same location)\n\t\t\t\t$item_segments = explode(\"/\", $groupie->item_template);\n\t\t\t\tarray_pop($item_segments); // ditch original file name\n\t\t\t\t$item_segments[] = \"item\"; // add default file \n\t\t\t\t$template=new Template(implode(\"/\", $item_segments));\n\t\t\t}\n\n\t\t\t$total_rows = count($rows);\n\t\t\tforeach($rows as $row) {\n\t\t\t\t$rendered.=$template->render(array('item' => $row, 'control' => $this, 'count' => $this->count, 'total_count' => $this->total_count, 'item_count' => $item_count, 'total_rows' => $total_rows));\n\t\t\t\t\n\t\t\t\t$this->current=&$row;\n\t\t\t\t\n\t\t\t\tif ($this->selected_id==$row['id'])\n\t\t\t\t\t$this->current_index=$this->count;\n\t\t\t\t\n\t\t\t\t$this->count++;\n\t\t\t\t$item_count++;\n\t\t\t\t$item_count_total++;\n\t\t\t}\n\t\t\t$rows_current=$rows;\n\t\t} else {\n\t\t\t//Keep on recursing as no item_templates present\n\t\t\t$out = $this->build_item($groupie, $rows);\n\t\t\t$rendered.=$out['content'];\n\t\t\t$item_count_total+=$out['count'];\n\t\t\t$rows_current+=$out['rows'];\n\t\t}\n\t\t\n\t\t// process the container if present, passing in all rendered content\n\t\tif ($groupie->container_template!=null) {\n\t\t\t$view=$this->get_template($groupie->container_template); //View($this->parent,$groupie->container_template); // shitloads faster to use Template\n\t\t\t$rendered=$view->render(array('current_index' => $this->current_index, 'total_count' => $this->total_count, 'count' => $this->count, 'control' => $this, 'content' => $rendered, 'item_count' => $item_count, 'item_count_total' => $item_count_total, 'items' => $rows_current, 'config' => $groupie));\n\t\t}\n\t\t\n\t\t$out = array('content'=>$rendered, 'count'=>$item_count_total, 'rows'=>$rows_current);\n\t\treturn $out;\n\t}", "function GetPackageGroupDataById($id_package) {\n \n $data = $this->db\n ->where('is_delete',0)\n ->where('id_status',1)\n ->where('id_package_group',$id_package)\n ->order_by('position','asc')\n ->get('package_group')\n ->row_array();\n \n if($data){\n // foreach ($data as $key=>$package_combo) {\n $data['item'] = $this->db\n ->where('id_package_group',$data['id_package_group'])\n ->get('package_group_item')\n ->result_array();\n\n //for christmas discount\n $real_price = $data['price'];\n $total_diskon_10 = floor( ( $real_price / 100) * 10 );\n \n $harga_natal = $real_price - $total_diskon_10; // 10% off for discount\n $data['real_price'] = $real_price;\n $data['price_diskon_10percent'] = $total_diskon_10;\n //$data['price_natal'] = $harga_natal;\n $data['price'] = $harga_natal; //final price\n\n foreach ($data['item'] as $key2 => $value) {\n $detail = $this->GetPackageByIdDataGroup($value['id_package'],$value['type']);\n $data['item'][$key2]['name'] = $detail['name'];\n $data['item'][$key2]['price'] = $detail['price'];\n }\n \n /*echo '<pre>';\n print_r($data);\n die();*/\n\n //}\n \n }\n \n \n return $data;\n }", "public function run()\n\t{\n\t\t\\DB::table('customers_groups')->truncate();\n \n\t\t\\DB::table('customers_groups')->insert(array (\n\t\t\t0 => \n\t\t\tarray (\n\t\t\t\t'customers_groups_id' => 1,\n\t\t\t\t'groupname' => 'Allianz',\n\t\t\t\t'default' => 0,\n\t\t\t\t'created_at' => '2014-04-19 04:02:36',\n\t\t\t\t'updated_at' => '2014-05-04 13:56:55',\n\t\t\t),\n\t\t\t1 => \n\t\t\tarray (\n\t\t\t\t'customers_groups_id' => 2,\n\t\t\t\t'groupname' => 'Deleted',\n\t\t\t\t'default' => 0,\n\t\t\t\t'created_at' => '2014-07-04 14:23:41',\n\t\t\t\t'updated_at' => '2014-07-04 14:23:41',\n\t\t\t),\n\t\t\t2 => \n\t\t\tarray (\n\t\t\t\t'customers_groups_id' => 3,\n\t\t\t\t'groupname' => 'Existing Customers',\n\t\t\t\t'default' => 0,\n\t\t\t\t'created_at' => '2014-07-07 05:52:11',\n\t\t\t\t'updated_at' => '2014-07-07 05:52:11',\n\t\t\t),\n\t\t\t3 => \n\t\t\tarray (\n\t\t\t\t'customers_groups_id' => 4,\n\t\t\t\t'groupname' => 'General',\n\t\t\t\t'default' => 0,\n\t\t\t\t'created_at' => '2014-07-07 06:02:35',\n\t\t\t\t'updated_at' => '2014-07-07 06:02:35',\n\t\t\t),\n\t\t\t4 => \n\t\t\tarray (\n\t\t\t\t'customers_groups_id' => 5,\n\t\t\t\t'groupname' => 'Gesperrt',\n\t\t\t\t'default' => 0,\n\t\t\t\t'created_at' => '2014-07-07 06:18:46',\n\t\t\t\t'updated_at' => '2014-07-07 06:18:46',\n\t\t\t),\n\t\t\t5 => \n\t\t\tarray (\n\t\t\t\t'customers_groups_id' => 6,\n\t\t\t\t'groupname' => 'Keine E-Mails',\n\t\t\t\t'default' => 0,\n\t\t\t\t'created_at' => '2014-07-07 06:21:25',\n\t\t\t\t'updated_at' => '2014-07-08 09:59:05',\n\t\t\t),\n\t\t\t6 => \n\t\t\tarray (\n\t\t\t\t'customers_groups_id' => 7,\n\t\t\t\t'groupname' => 'Retailer',\n\t\t\t\t'default' => 1,\n\t\t\t\t'created_at' => '2014-07-07 06:36:18',\n\t\t\t\t'updated_at' => '2014-07-07 06:36:18',\n\t\t\t),\n\t\t\t7 => \n\t\t\tarray (\n\t\t\t\t'customers_groups_id' => 8,\n\t\t\t\t'groupname' => 'TopCustomer',\n\t\t\t\t'default' => 0,\n\t\t\t\t'created_at' => '2014-07-07 10:08:00',\n\t\t\t\t'updated_at' => '2014-07-07 10:08:00',\n\t\t\t),\n\t\t\t8 => \n\t\t\tarray (\n\t\t\t\t'customers_groups_id' => 9,\n\t\t\t\t'groupname' => 'Wholesale',\n\t\t\t\t'default' => 0,\n\t\t\t\t'created_at' => '2014-07-07 10:08:00',\n\t\t\t\t'updated_at' => '2014-07-07 10:08:00',\n\t\t\t),\n\t\t));\n\t}", "public function getProductAttributesGroups()\n {\n $colors = array();\n $groups = array();\n $combinations = array();\n\n $attributes_groups = $this->product->getAttributesGroups($this->context->language->id);\n\n if (is_array($attributes_groups) && $attributes_groups) {\n foreach ($attributes_groups as $row) {\n // Color management\n if (isset($row['is_color_group'])\n && $row['is_color_group']\n && (isset($row['attribute_color']) && $row['attribute_color'])\n || (file_exists(_PS_COL_IMG_DIR_ . $row['id_attribute'] . '.jpg'))) {\n $colors[$row['id_attribute']]['value'] = $row['attribute_color'];\n $colors[$row['id_attribute']]['name'] = $row['attribute_name'];\n if (!isset($colors[$row['id_attribute']]['attributes_quantity'])) {\n $colors[$row['id_attribute']]['attributes_quantity'] = 0;\n }\n $colors[$row['id_attribute']]['attributes_quantity'] += (int)$row['quantity'];\n }\n if (!isset($groups[$row['id_attribute_group']])) {\n $groups[$row['id_attribute_group']] = array(\n 'group_name' => $row['group_name'],\n 'name' => $row['public_group_name'],\n 'group_type' => $row['group_type'],\n 'default' => -1,\n );\n }\n\n $attr_g = $row['id_attribute_group'];\n $groups[$attr_g]['attributes'][$row['id_attribute']] = $row['attribute_name'];\n if ($row['default_on'] && $groups[$row['id_attribute_group']]['default'] == -1) {\n $groups[$row['id_attribute_group']]['default'] = (int)$row['id_attribute'];\n }\n if (!isset($groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']])) {\n $groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']] = 0;\n }\n $r_attr = $row['id_attribute_group'];\n $groups[$r_attr]['attributes_quantity'][$row['id_attribute']] += (int)$row['quantity'];\n\n $combinations[$row['id_product_attribute']]['attributes'][] = (int)$row['id_attribute'];\n\n //calculate full price for combination\n $priceDisplay = Product::getTaxCalculationMethod(0); //(int)$this->context->cookie->id_customer\n if (!$priceDisplay || $priceDisplay == 2) {\n $combination_price = $this->product->getPrice(true, $row['id_product_attribute']);\n } else {\n $combination_price = $this->product->getPrice(false, $row['id_product_attribute']);\n }\n $combinations[$row['id_product_attribute']]['price'] = $this->formatPrice($combination_price);\n $combinations[$row['id_product_attribute']]['float_price'] = $combination_price;\n $combinations[$row['id_product_attribute']]['quantity'] = (int)$row['quantity'];\n $combinations[$row['id_product_attribute']]['minimal_quantity'] = (int)$row['minimal_quantity'];\n }\n\n // wash attributes list (if some attributes are unavailables and if allowed to wash it)\n if (!Product::isAvailableWhenOutOfStock($this->product->out_of_stock)\n && Configuration::get('PS_DISP_UNAVAILABLE_ATTR') == 0) {\n foreach ($groups as &$group) {\n foreach ($group['attributes_quantity'] as $key => &$quantity) {\n if ($quantity <= 0) {\n unset($group['attributes'][$key]);\n }\n }\n }\n\n foreach ($colors as $key => $color) {\n if ($color['attributes_quantity'] <= 0) {\n unset($colors[$key]);\n }\n }\n }\n foreach ($combinations as $id_product_attribute => $comb) {\n $attribute_list = '';\n foreach ($comb['attributes'] as $id_attribute) {\n $attribute_list .= '\\'' . (int)$id_attribute . '\\',';\n }\n $attribute_list = rtrim($attribute_list, ',');\n $combinations[$id_product_attribute]['list'] = $attribute_list;\n }\n }\n\n return array(\n 'groups' => $groups,\n 'colors' => (count($colors)) ? $colors : false,\n 'combinations' => $combinations\n );\n }", "function insert_userGroup($data){\n $user = array();\n $user_group = array();\n\n // Insert user\n $user['id'] = $data['id'];\n $user['username'] = $data['username'];\n $user['password'] = md5($data['password']);\n $user['email'] = $data['email'];\n insertRecord(TAB_USERS, $user);\n\n // Insert user-role\n $group = $data['group'];\n $data['group'] = selectRecord(TAB_GROUPS, \"role = '$group'\")['id'];\n $user_group['userId'] = $data['id'];\n $user_group['groupId'] = $data['group'];\n insertRecord(TAB_USR_ROLE, $user_group);\n if($group['id'] == 1){\n $data_info = array();\n $data_info['employment'] = \"-\";\n $data_info['img_address'] = \"upload/user/user-default.png\";\n $data_info['user'] = $data['id'];\n insertRecord(TAB_PERSONALINFO, $data_info);\n }\n}", "function globalUniqueShoeGenRefs(){\n\t\t\n\t\t$global_parents_data=array();\n\t\t$global_parents_data_file=array();\n\t\t$global_parents_xls_file=array();\n\t\t$genData=CepClLahalleShoeGen::select('lahs_nomod','lahs_reference','lahs_reference_folder','lahs_export_filename')\n\t\t\t\t\t\t\t\t\t ->where('lahs_status','=',1)->get();\n\t\t\n\t\t//echo \"<pre>\"; print_r($genData);\n\t\tforeach ($genData as $key => $value) {\n\t\t\t$global_parents_data[]=$value['lahs_nomod'];\n\t\t\t$global_parents_data_file[$value['lahs_nomod']]=$value['lahs_reference'];\n\t\t\t$global_parents_xls_file[$value['lahs_nomod']]=$value['lahs_export_filename'];\n\t\t}\n\t\t\t\n\t\t\n\t\t//$res=mysql_fetch_array($res);\n\t\treturn array($global_parents_data,$global_parents_data_file,$global_parents_xls_file);\n\t}", "function populate($rowid='',$merge=False, $sql='') {\r\n if ($sql == '')\r\n $sql = $this->create_sql_select($rowid);\r\n #~ echo \"\\n<br>\".$sql;\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error());\r\n $this->db_count = mysql_num_rows($res);\r\n $i = 0;\r\n while ($row = mysql_fetch_row($res)) {\r\n foreach ($this->_mapping_index as $idx=>$colvar) {\r\n # bugs! in case colvar has no column name (Virtual), then it's not available in mapping_index!!!\r\n # case found at subscriber case\r\n $value = $row[$idx];\r\n if ($rowid != '' and $merge and $this->properties[$colvar]->updatable and isset($_REQUEST['field'][$colvar][$i])) {\r\n $value = $_REQUEST['field'][$colvar][$i];\r\n }\r\n $this->ds->{$colvar}[] = $value;\r\n }\r\n $i += 1;\r\n }\r\n $this->_populated = True;\r\n }" ]
[ "0.5957105", "0.5507267", "0.54892516", "0.5171704", "0.5128485", "0.5044327", "0.5043565", "0.49736753", "0.49367654", "0.49367654", "0.49228874", "0.490096", "0.48835528", "0.48523474", "0.4783132", "0.47780377", "0.47698572", "0.4762013", "0.4756047", "0.47501367", "0.47397357", "0.47332472", "0.47190452", "0.47076625", "0.47026744", "0.46861944", "0.4674716", "0.46728608", "0.46542323", "0.4652017", "0.46448588", "0.4641186", "0.4641186", "0.4641186", "0.4641186", "0.46246976", "0.46099916", "0.46099916", "0.46057543", "0.46025357", "0.4578559", "0.4571474", "0.45634913", "0.45609528", "0.45567924", "0.45501345", "0.45484817", "0.45471135", "0.4540567", "0.45403644", "0.45385066", "0.45212662", "0.45206928", "0.4516147", "0.45132425", "0.45108688", "0.45033157", "0.4502398", "0.45000672", "0.449894", "0.44908738", "0.44906247", "0.4485233", "0.44802454", "0.44781613", "0.4475753", "0.44692037", "0.44676504", "0.4466741", "0.44637093", "0.4458783", "0.44583607", "0.44569793", "0.44563362", "0.44373104", "0.44350535", "0.4428113", "0.44190308", "0.44181266", "0.4417209", "0.4416229", "0.44034734", "0.44034734", "0.43942204", "0.43900564", "0.43852895", "0.43852895", "0.43852895", "0.4383862", "0.43828994", "0.43804225", "0.4375974", "0.43730947", "0.43721735", "0.43691024", "0.43689322", "0.43675184", "0.43629566", "0.43622303", "0.43606913" ]
0.44623297
70
Deprecated by the renormalizeVendorNames function below
public static function updateCleanVendorNames($updateExport = 1) { $vendorData = VendorData::getInstance(); foreach ($vendorData->vendorTable as $rawName => $cleanName) { echo "Replacing <" . $rawName . "> with <" . $cleanName . ">\n"; // Update the source contracts table // This may not do as precise of matches as the original vendor cleanup function - it'll catch new additions to the table, but not updates to the $charactersToRemove array. DB::table('l_contracts') ->where('gen_vendor_clean', '=', VendorData::cleanupVendorName($rawName)) ->update([ 'gen_vendor_normalized' => $cleanName, ]); if ($updateExport) { // DB::table('exports_v1') // ->where('vendor_clean', '=', $rawName) // ->update([ // 'vendor_clean' => $cleanName, // ]); DB::table('exports_v1') ->where('gen_vendor_clean', '=', VendorData::cleanupVendorName($rawName)) ->update([ 'gen_vendor_normalized' => $cleanName, ]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getVendorName(): string;", "public function getVendorName(): string\n {\n return 'local';\n }", "protected function _setVendor()\n {\n // use as the vendor name. e.g., './scripts/solar' => 'solar'\n $path = explode(DIRECTORY_SEPARATOR, $this->_argv[0]);\n $this->_vendor = end($path);\n \n // change vendor name to a class name prefix:\n // 'foo' => 'Foo'\n // 'foo-bar' => 'FooBar'\n // 'foo_bar' => 'FooBar'\n $this->_vendor = str_replace(array('-', '_'), ' ', $this->_vendor);\n $this->_vendor = ucwords($this->_vendor);\n $this->_vendor = str_replace(' ', '', $this->_vendor);\n }", "function getVendorname(){\r\n return $this->vendorname;\r\n }", "public function name(): string\n {\n return 'deprecated';\n }", "public function wrongNamesDataProvider() {}", "function apply_filters_deprecated($hook_name, $args, $version, $replacement = '', $message = '')\n {\n }", "public function setVendor(string $vendor)\n {\n }", "public function vendors()\n {\n return $this->morphedByMany('App\\Models\\Event\\Person\\EventVendor', 'persona', 'pivot_persona_org', 'organization_id', 'persona_id');\n }", "private function endonuclease_vendors() {\r\n\r\n $vendors = array(\r\n \"AarI\" => \"F\",\r\n \"AasI\" => \"F\",\r\n \"AatI\" => \"O\",\r\n \"AatII\" => \"AFGIKMNORV\",\r\n \"AbsI\" => \"I\",\r\n \"AccI\" => \"ABGJKMNORSUWX\",\r\n \"AccII\" => \"AJK\",\r\n \"AccIII\" => \"GJKRW\",\r\n \"Acc16I\" => \"IV\",\r\n \"Acc36I\" => \"I\",\r\n \"Acc65I\" => \"FGINRVW\",\r\n \"AccB1I\" => \"IV\",\r\n \"AccB7I\" => \"IRV\",\r\n \"AccBSI\" => \"IV\",\r\n \"AciI\" => \"N\",\r\n \"AclI\" => \"INV\",\r\n \"AclWI\" => \"I\",\r\n \"AcoI\" => \"I\",\r\n \"AcsI\" => \"IMV\",\r\n \"AcuI\" => \"IN\",\r\n \"AcvI\" => \"QX\",\r\n \"AcyI\" => \"JM\",\r\n \"AdeI\" => \"F\",\r\n \"AfaI\" => \"AK\",\r\n \"AfeI\" => \"IN\",\r\n \"AfiI\" => \"V\",\r\n \"AflII\" => \"AJKNO\",\r\n \"AflIII\" => \"GMNSW\",\r\n \"AgeI\" => \"JNR\",\r\n \"AhdI\" => \"N\",\r\n \"AhlI\" => \"IV\",\r\n \"AjiI\" => \"F\",\r\n \"AjnI\" => \"I\",\r\n \"AjuI\" => \"F\",\r\n \"AleI\" => \"N\",\r\n \"AlfI\" => \"F\",\r\n \"AloI\" => \"F\",\r\n \"AluI\" => \"ABFGHIJKMNOQRSUVWXY\",\r\n \"AluBI\" => \"I\",\r\n \"AlwI\" => \"N\",\r\n \"Alw21I\" => \"F\",\r\n \"Alw26I\" => \"FR\",\r\n \"Alw44I\" => \"FJMORS\",\r\n \"AlwNI\" => \"N\",\r\n \"Ama87I\" => \"IV\",\r\n \"Aor13HI\" => \"K\",\r\n \"Aor51HI\" => \"AK\",\r\n \"ApaI\" => \"ABFGIJKMNOQRSUVWX\",\r\n \"ApaLI\" => \"AKNU\",\r\n \"ApeKI\" => \"N\",\r\n \"ApoI\" => \"N\",\r\n \"AscI\" => \"GNW\",\r\n \"AseI\" => \"JNO\",\r\n \"AsiGI\" => \"IV\",\r\n \"AsiSI\" => \"N\",\r\n \"AspI\" => \"M\",\r\n \"Asp700I\" => \"M\",\r\n \"Asp718I\" => \"M\",\r\n \"AspA2I\" => \"IV\",\r\n \"AspEI\" => \"M\",\r\n \"AspLEI\" => \"IV\",\r\n \"AspS9I\" => \"IV\",\r\n \"AssI\" => \"U\",\r\n \"AsuC2I\" => \"I\",\r\n \"AsuHPI\" => \"IV\",\r\n \"AsuNHI\" => \"IV\",\r\n \"AvaI\" => \"ABGJMNORSUWX\",\r\n \"AvaII\" => \"AGJKMNRSWY\",\r\n \"AviII\" => \"M\",\r\n \"AvrII\" => \"N\",\r\n \"AxyI\" => \"J\",\r\n \"BaeI\" => \"N\",\r\n \"BalI\" => \"AJKR\",\r\n \"BamHI\" => \"ABFGHIJKMNOQRSUVWXY\",\r\n \"BanI\" => \"NORU\",\r\n \"BanII\" => \"AGKMNOQRSWX\",\r\n \"BanIII\" => \"O\",\r\n \"BarI\" => \"I\",\r\n \"BasI\" => \"U\",\r\n \"BauI\" => \"F\",\r\n \"BbeI\" => \"AK\",\r\n \"BbrPI\" => \"MO\",\r\n \"BbsI\" => \"N\",\r\n \"BbuI\" => \"R\",\r\n \"BbvI\" => \"N\",\r\n \"Bbv12I\" => \"IV\",\r\n \"BbvCI\" => \"N\",\r\n \"BccI\" => \"N\",\r\n \"BceAI\" => \"N\",\r\n \"BcgI\" => \"N\",\r\n \"BciVI\" => \"N\",\r\n \"BclI\" => \"FGJMNORSUWY\",\r\n \"BcnI\" => \"FK\",\r\n \"BcuI\" => \"F\",\r\n \"BdaI\" => \"F\",\r\n \"BfaI\" => \"N\",\r\n \"BfiI\" => \"F\",\r\n \"BfmI\" => \"F\",\r\n \"BfrI\" => \"MO\",\r\n \"BfuI\" => \"F\",\r\n \"BfuAI\" => \"N\",\r\n \"BfuCI\" => \"N\",\r\n \"BglI\" => \"AFGHIJKMNOQRSUVWXY\",\r\n \"BglII\" => \"ABFGHIJKMNOQRSUVWXY\",\r\n \"BisI\" => \"I\",\r\n \"BlnI\" => \"AKMS\",\r\n \"BlpI\" => \"N\",\r\n \"BlsI\" => \"I\",\r\n \"BmcAI\" => \"V\",\r\n \"Bme18I\" => \"IV\",\r\n \"Bme1390I\" => \"F\",\r\n \"Bme1580I\" => \"N\",\r\n \"BmeRI\" => \"V\",\r\n \"BmeT110I\" => \"K\",\r\n \"BmgBI\" => \"N\",\r\n \"BmgT120I\" => \"K\",\r\n \"BmiI\" => \"V\",\r\n \"BmrI\" => \"N\",\r\n \"BmrFI\" => \"V\",\r\n \"BmtI\" => \"INV\",\r\n \"BmuI\" => \"I\",\r\n \"BoxI\" => \"F\",\r\n \"BpiI\" => \"F\",\r\n \"BplI\" => \"F\",\r\n \"BpmI\" => \"IN\",\r\n \"Bpu10I\" => \"FINV\",\r\n \"Bpu14I\" => \"IV\",\r\n \"Bpu1102I\" => \"AFK\",\r\n \"BpuAI\" => \"M\",\r\n \"BpuEI\" => \"N\",\r\n \"BpuMI\" => \"V\",\r\n \"BpvUI\" => \"V\",\r\n \"BsaI\" => \"N\",\r\n \"Bsa29I\" => \"I\",\r\n \"BsaAI\" => \"N\",\r\n \"BsaBI\" => \"N\",\r\n \"BsaHI\" => \"N\",\r\n \"BsaJI\" => \"N\",\r\n \"BsaMI\" => \"GR\",\r\n \"BsaWI\" => \"N\",\r\n \"BsaXI\" => \"N\",\r\n \"Bsc4I\" => \"I\",\r\n \"Bse1I\" => \"IV\",\r\n \"Bse8I\" => \"IV\",\r\n \"Bse21I\" => \"IV\",\r\n \"Bse118I\" => \"IV\",\r\n \"BseAI\" => \"CM\",\r\n \"BseBI\" => \"C\",\r\n \"BseCI\" => \"C\",\r\n \"BseDI\" => \"F\",\r\n \"Bse3DI\" => \"IV\",\r\n \"BseGI\" => \"F\",\r\n \"BseJI\" => \"F\",\r\n \"BseLI\" => \"F\",\r\n \"BseMI\" => \"F\",\r\n \"BseMII\" => \"F\",\r\n \"BseNI\" => \"F\",\r\n \"BsePI\" => \"IV\",\r\n \"BseRI\" => \"N\",\r\n \"BseSI\" => \"F\",\r\n \"BseXI\" => \"F\",\r\n \"BseX3I\" => \"IV\",\r\n \"BseYI\" => \"N\",\r\n \"BsgI\" => \"N\",\r\n \"Bsh1236I\" => \"F\",\r\n \"Bsh1285I\" => \"F\",\r\n \"BshFI\" => \"C\",\r\n \"BshNI\" => \"F\",\r\n \"BshTI\" => \"F\",\r\n \"BshVI\" => \"V\",\r\n \"BsiEI\" => \"N\",\r\n \"BsiHKAI\" => \"N\",\r\n \"BsiHKCI\" => \"QX\",\r\n \"BsiSI\" => \"C\",\r\n \"BsiWI\" => \"MNO\",\r\n \"BsiYI\" => \"M\",\r\n \"BslI\" => \"GNW\",\r\n \"BslFI\" => \"I\",\r\n \"BsmI\" => \"JMNOSW\",\r\n \"BsmAI\" => \"N\",\r\n \"BsmBI\" => \"N\",\r\n \"BsmFI\" => \"N\",\r\n \"BsnI\" => \"V\",\r\n \"Bso31I\" => \"IV\",\r\n \"BsoBI\" => \"N\",\r\n \"Bsp13I\" => \"IV\",\r\n \"Bsp19I\" => \"IV\",\r\n \"Bsp68I\" => \"F\",\r\n \"Bsp119I\" => \"F\",\r\n \"Bsp120I\" => \"F\",\r\n \"Bsp143I\" => \"F\",\r\n \"Bsp1286I\" => \"JKNR\",\r\n \"Bsp1407I\" => \"FK\",\r\n \"Bsp1720I\" => \"IV\",\r\n \"BspACI\" => \"I\",\r\n \"BspANI\" => \"X\",\r\n \"BspCNI\" => \"N\",\r\n \"BspDI\" => \"N\",\r\n \"BspEI\" => \"N\",\r\n \"BspFNI\" => \"I\",\r\n \"BspHI\" => \"N\",\r\n \"BspLI\" => \"F\",\r\n \"BspLU11I\" => \"M\",\r\n \"BspMI\" => \"N\",\r\n \"BspMAI\" => \"X\",\r\n \"BspOI\" => \"F\",\r\n \"BspPI\" => \"F\",\r\n \"BspQI\" => \"N\",\r\n \"BspTI\" => \"F\",\r\n \"BspT104I\" => \"K\",\r\n \"BspT107I\" => \"K\",\r\n \"BspTNI\" => \"QX\",\r\n \"BspXI\" => \"GW\",\r\n \"BsrI\" => \"N\",\r\n \"BsrBI\" => \"N\",\r\n \"BsrDI\" => \"N\",\r\n \"BsrFI\" => \"N\",\r\n \"BsrGI\" => \"N\",\r\n \"BsrSI\" => \"R\",\r\n \"BssAI\" => \"C\",\r\n \"BssECI\" => \"I\",\r\n \"BssHII\" => \"AJKMNOQRSX\",\r\n \"BssKI\" => \"N\",\r\n \"BssMI\" => \"V\",\r\n \"BssNI\" => \"V\",\r\n \"BssNAI\" => \"IV\",\r\n \"BssSI\" => \"N\",\r\n \"BssT1I\" => \"IV\",\r\n \"Bst6I\" => \"IV\",\r\n \"Bst98I\" => \"R\",\r\n \"Bst1107I\" => \"FKM\",\r\n \"BstACI\" => \"I\",\r\n \"BstAPI\" => \"IN\",\r\n \"BstAUI\" => \"IV\",\r\n \"BstBI\" => \"N\",\r\n \"Bst2BI\" => \"IV\",\r\n \"BstBAI\" => \"IV\",\r\n \"Bst4CI\" => \"IV\",\r\n \"BstC8I\" => \"I\",\r\n \"BstDEI\" => \"IV\",\r\n \"BstDSI\" => \"IV\",\r\n \"BstEII\" => \"GHJMNORSUW\",\r\n \"BstENI\" => \"IV\",\r\n \"BstF5I\" => \"IV\",\r\n \"BstFNI\" => \"IV\",\r\n \"BstH2I\" => \"IV\",\r\n \"BstHHI\" => \"IV\",\r\n \"BstKTI\" => \"I\",\r\n \"BstMAI\" => \"IV\",\r\n \"BstMBI\" => \"IV\",\r\n \"BstMCI\" => \"IV\",\r\n \"BstMWI\" => \"I\",\r\n \"BstNI\" => \"N\",\r\n \"BstNSI\" => \"IV\",\r\n \"BstOI\" => \"R\",\r\n \"BstPI\" => \"K\",\r\n \"BstPAI\" => \"IV\",\r\n \"BstSCI\" => \"I\",\r\n \"BstSFI\" => \"I\",\r\n \"BstSLI\" => \"I\",\r\n \"BstSNI\" => \"IV\",\r\n \"BstUI\" => \"N\",\r\n \"Bst2UI\" => \"IV\",\r\n \"BstV1I\" => \"I\",\r\n \"BstV2I\" => \"IV\",\r\n \"BstXI\" => \"AFGHIJKMNOQRVWX\",\r\n \"BstX2I\" => \"IV\",\r\n \"BstYI\" => \"N\",\r\n \"BstZI\" => \"R\",\r\n \"BstZ17I\" => \"N\",\r\n \"Bsu15I\" => \"F\",\r\n \"Bsu36I\" => \"NR\",\r\n \"BsuRI\" => \"FI\",\r\n \"BsuTUI\" => \"X\",\r\n \"BtgI\" => \"N\",\r\n \"BtgZI\" => \"N\",\r\n \"BtrI\" => \"IV\",\r\n \"BtsI\" => \"N\",\r\n \"BtsCI\" => \"N\",\r\n \"BtuMI\" => \"V\",\r\n \"BveI\" => \"F\",\r\n \"Cac8I\" => \"N\",\r\n \"CaiI\" => \"F\",\r\n \"CciNI\" => \"IV\",\r\n \"CelII\" => \"M\",\r\n \"CfoI\" => \"MRS\",\r\n \"CfrI\" => \"F\",\r\n \"Cfr9I\" => \"FO\",\r\n \"Cfr10I\" => \"FGKO\",\r\n \"Cfr13I\" => \"AFO\",\r\n \"Cfr42I\" => \"F\",\r\n \"ClaI\" => \"ABHKMNRSU\",\r\n \"CpoI\" => \"AFK\",\r\n \"CseI\" => \"F\",\r\n \"CspI\" => \"OR\",\r\n \"Csp6I\" => \"F\",\r\n \"Csp45I\" => \"OR\",\r\n \"CspAI\" => \"C\",\r\n \"CspCI\" => \"N\",\r\n \"CviAII\" => \"N\",\r\n \"CviJI\" => \"QX\",\r\n \"CviKI-1\" => \"N\",\r\n \"CviQI\" => \"N\",\r\n \"DdeI\" => \"BGMNORSW\",\r\n \"DinI\" => \"V\",\r\n \"DpnI\" => \"BEFGMNRSW\",\r\n \"DpnII\" => \"N\",\r\n \"DraI\" => \"ABFGIJKMNOQRSUVWXY\",\r\n \"DraII\" => \"GMW\",\r\n \"DraIII\" => \"GIMNVW\",\r\n \"DrdI\" => \"N\",\r\n \"DriI\" => \"I\",\r\n \"DseDI\" => \"IV\",\r\n \"EaeI\" => \"AKMN\",\r\n \"EagI\" => \"GNW\",\r\n \"Eam1104I\" => \"F\",\r\n \"Eam1105I\" => \"FK\",\r\n \"EarI\" => \"N\",\r\n \"EciI\" => \"N\",\r\n \"Ecl136II\" => \"F\",\r\n \"EclHKI\" => \"R\",\r\n \"EclXI\" => \"MS\",\r\n \"Eco24I\" => \"F\",\r\n \"Eco31I\" => \"F\",\r\n \"Eco32I\" => \"F\",\r\n \"Eco47I\" => \"FO\",\r\n \"Eco47III\" => \"FGMORW\",\r\n \"Eco52I\" => \"FKO\",\r\n \"Eco57I\" => \"F\",\r\n \"Eco72I\" => \"F\",\r\n \"Eco81I\" => \"AFKO\",\r\n \"Eco88I\" => \"F\",\r\n \"Eco91I\" => \"F\",\r\n \"Eco105I\" => \"FO\",\r\n \"Eco130I\" => \"F\",\r\n \"Eco147I\" => \"F\",\r\n \"EcoICRI\" => \"IRV\",\r\n \"Eco57MI\" => \"F\",\r\n \"EcoNI\" => \"N\",\r\n \"EcoO65I\" => \"K\",\r\n \"EcoO109I\" => \"AFJKN\",\r\n \"EcoP15I\" => \"N\",\r\n \"EcoRI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"EcoRII\" => \"FJMOS\",\r\n \"EcoRV\" => \"ABCGHIJKMNOQRSUVWXY\",\r\n \"EcoT14I\" => \"K\",\r\n \"EcoT22I\" => \"AKO\",\r\n \"EcoT38I\" => \"J\",\r\n \"EgeI\" => \"I\",\r\n \"EheI\" => \"FO\",\r\n \"ErhI\" => \"IV\",\r\n \"Esp3I\" => \"F\",\r\n \"FaeI\" => \"I\",\r\n \"FalI\" => \"I\",\r\n \"FaqI\" => \"F\",\r\n \"FatI\" => \"IN\",\r\n \"FauI\" => \"IN\",\r\n \"FauNDI\" => \"IV\",\r\n \"FbaI\" => \"AK\",\r\n \"FblI\" => \"IV\",\r\n \"Fnu4HI\" => \"N\",\r\n \"FokI\" => \"AGIJKMNQRVWX\",\r\n \"FriOI\" => \"IV\",\r\n \"FseI\" => \"AN\",\r\n \"FspI\" => \"JNO\",\r\n \"FspAI\" => \"F\",\r\n \"FspBI\" => \"F\",\r\n \"Fsp4HI\" => \"I\",\r\n \"GlaI\" => \"I\",\r\n \"GluI\" => \"I\",\r\n \"GsuI\" => \"F\",\r\n \"HaeII\" => \"GJKMNORSW\",\r\n \"HaeIII\" => \"ABGHIJKMNOQRSUWXY\",\r\n \"HapII\" => \"AK\",\r\n \"HgaI\" => \"IN\",\r\n \"HhaI\" => \"ABFGJKNORUWY\",\r\n \"Hin1I\" => \"FKO\",\r\n \"Hin1II\" => \"F\",\r\n \"Hin4I\" => \"F\",\r\n \"Hin6I\" => \"F\",\r\n \"HinP1I\" => \"N\",\r\n \"HincII\" => \"ABFGHJKNOQRUWXY\",\r\n \"HindII\" => \"IMSV\",\r\n \"HindIII\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"HinfI\" => \"ABCFGHIJKMNOQRUVWXY\",\r\n \"HpaI\" => \"ABCGHIJKMNOQRSUVWX\",\r\n \"HpaII\" => \"BFGIMNOQRSUVWX\",\r\n \"HphI\" => \"FN\",\r\n \"Hpy8I\" => \"F\",\r\n \"Hpy99I\" => \"N\",\r\n \"Hpy188I\" => \"N\",\r\n \"Hpy188III\" => \"N\",\r\n \"HpyAV\" => \"N\",\r\n \"HpyCH4III\" => \"N\",\r\n \"HpyCH4IV\" => \"N\",\r\n \"HpyCH4V\" => \"N\",\r\n \"HpyF3I\" => \"F\",\r\n \"HpyF10VI\" => \"F\",\r\n \"Hsp92I\" => \"R\",\r\n \"Hsp92II\" => \"R\",\r\n \"HspAI\" => \"IV\",\r\n \"ItaI\" => \"M\",\r\n \"KasI\" => \"N\",\r\n \"KpnI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"Kpn2I\" => \"F\",\r\n \"KspI\" => \"MS\",\r\n \"Ksp22I\" => \"IV\",\r\n \"Ksp632I\" => \"M\",\r\n \"KspAI\" => \"F\",\r\n \"Kzo9I\" => \"I\",\r\n \"LguI\" => \"F\",\r\n \"LweI\" => \"F\",\r\n \"MabI\" => \"I\",\r\n \"MaeI\" => \"M\",\r\n \"MaeII\" => \"M\",\r\n \"MaeIII\" => \"M\",\r\n \"MalI\" => \"I\",\r\n \"MamI\" => \"M\",\r\n \"MbiI\" => \"F\",\r\n \"MboI\" => \"ABCFGKNQRUWXY\",\r\n \"MboII\" => \"AFGIJKNOQRVWX\",\r\n \"MfeI\" => \"N\",\r\n \"MflI\" => \"K\",\r\n \"MhlI\" => \"IV\",\r\n \"MlsI\" => \"F\",\r\n \"MluI\" => \"ABFGHIJKMNOQRSUVWX\",\r\n \"MluNI\" => \"MS\",\r\n \"MlyI\" => \"N\",\r\n \"Mly113I\" => \"I\",\r\n \"MmeI\" => \"NX\",\r\n \"MnlI\" => \"FGINQVWX\",\r\n \"Mph1103I\" => \"F\",\r\n \"MreI\" => \"F\",\r\n \"MroI\" => \"MO\",\r\n \"MroNI\" => \"IV\",\r\n \"MroXI\" => \"IV\",\r\n \"MscI\" => \"BNO\",\r\n \"MseI\" => \"BN\",\r\n \"MslI\" => \"N\",\r\n \"MspI\" => \"AFGHIJKMNOQRSUVWXY\",\r\n \"Msp20I\" => \"IV\",\r\n \"MspA1I\" => \"INRV\",\r\n \"MspCI\" => \"C\",\r\n \"MspR9I\" => \"I\",\r\n \"MssI\" => \"F\",\r\n \"MunI\" => \"FKM\",\r\n \"MvaI\" => \"AFGKMOSW\",\r\n \"Mva1269I\" => \"F\",\r\n \"MvnI\" => \"M\",\r\n \"MvrI\" => \"U\",\r\n \"MwoI\" => \"N\",\r\n \"NaeI\" => \"ACKMNORU\",\r\n \"NarI\" => \"GJMNOQRUWX\",\r\n \"NciI\" => \"GJNORSW\",\r\n \"NcoI\" => \"ABCFGHJKMNOQRSUWXY\",\r\n \"NdeI\" => \"ABFGJKMNQRSWXY\",\r\n \"NdeII\" => \"GJMRSW\",\r\n \"NgoMIV\" => \"NR\",\r\n \"NheI\" => \"ABFGJKMNORSUW\",\r\n \"NlaIII\" => \"GNW\",\r\n \"NlaIV\" => \"GNW\",\r\n \"NmeAIII\" => \"N\",\r\n \"NmuCI\" => \"F\",\r\n \"NotI\" => \"ABCFGHJKMNOQRSUWXY\",\r\n \"NruI\" => \"ABCGIJKMNOQRSUWX\",\r\n \"NsbI\" => \"FK\",\r\n \"NsiI\" => \"BGHJMNRSUW\",\r\n \"NspI\" => \"MN\",\r\n \"NspV\" => \"JO\",\r\n \"OliI\" => \"F\",\r\n \"PacI\" => \"GNOW\",\r\n \"PaeI\" => \"F\",\r\n \"PaeR7I\" => \"N\",\r\n \"PagI\" => \"F\",\r\n \"PalAI\" => \"I\",\r\n \"PasI\" => \"F\",\r\n \"PauI\" => \"F\",\r\n \"PceI\" => \"IV\",\r\n \"PciI\" => \"IN\",\r\n \"PciSI\" => \"I\",\r\n \"PctI\" => \"IV\",\r\n \"PdiI\" => \"F\",\r\n \"PdmI\" => \"F\",\r\n \"PfeI\" => \"F\",\r\n \"Pfl23II\" => \"F\",\r\n \"PflFI\" => \"N\",\r\n \"PflMI\" => \"N\",\r\n \"PfoI\" => \"F\",\r\n \"PhoI\" => \"N\",\r\n \"PinAI\" => \"BM\",\r\n \"PleI\" => \"N\",\r\n \"Ple19I\" => \"I\",\r\n \"PmaCI\" => \"AK\",\r\n \"PmeI\" => \"GNW\",\r\n \"PmlI\" => \"N\",\r\n \"PpiI\" => \"F\",\r\n \"PpsI\" => \"I\",\r\n \"Ppu21I\" => \"F\",\r\n \"PpuMI\" => \"NO\",\r\n \"PscI\" => \"F\",\r\n \"PshAI\" => \"AKN\",\r\n \"PshBI\" => \"K\",\r\n \"PsiI\" => \"IN\",\r\n \"Psp5II\" => \"F\",\r\n \"Psp6I\" => \"I\",\r\n \"Psp1406I\" => \"FK\",\r\n \"Psp124BI\" => \"IV\",\r\n \"PspCI\" => \"IV\",\r\n \"PspEI\" => \"IV\",\r\n \"PspGI\" => \"N\",\r\n \"PspLI\" => \"I\",\r\n \"PspN4I\" => \"I\",\r\n \"PspOMI\" => \"INV\",\r\n \"PspPPI\" => \"I\",\r\n \"PspXI\" => \"IN\",\r\n \"PsrI\" => \"I\",\r\n \"PstI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"PsuI\" => \"F\",\r\n \"PsyI\" => \"F\",\r\n \"PvuI\" => \"ABFGKMNOQRSUWXY\",\r\n \"PvuII\" => \"ABCFGHIJKMNORSUVWXY\",\r\n \"RcaI\" => \"M\",\r\n \"RgaI\" => \"I\",\r\n \"RigI\" => \"I\",\r\n \"RsaI\" => \"BCFGHIJMNOQRSVWXY\",\r\n \"RsaNI\" => \"I\",\r\n \"RseI\" => \"F\",\r\n \"RsrII\" => \"MNQX\",\r\n \"Rsr2I\" => \"IV\",\r\n \"SacI\" => \"AFGHJKMNOQRSUWX\",\r\n \"SacII\" => \"AGHJKNOQRWX\",\r\n \"SalI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"SanDI\" => \"E\",\r\n \"SapI\" => \"N\",\r\n \"SatI\" => \"F\",\r\n \"Sau96I\" => \"GJMNOUW\",\r\n \"Sau3AI\" => \"AGHJKMNOQRSUWX\",\r\n \"SbfI\" => \"INV\",\r\n \"ScaI\" => \"ABCFGJKMNOQRSWX\",\r\n \"SchI\" => \"F\",\r\n \"ScrFI\" => \"JMNOS\",\r\n \"SdaI\" => \"F\",\r\n \"SduI\" => \"F\",\r\n \"SetI\" => \"I\",\r\n \"SexAI\" => \"MN\",\r\n \"SfaNI\" => \"INV\",\r\n \"SfcI\" => \"N\",\r\n \"SfiI\" => \"ACFGIJKMNOQRSUVWX\",\r\n \"SfoI\" => \"N\",\r\n \"Sfr274I\" => \"IV\",\r\n \"Sfr303I\" => \"IV\",\r\n \"SfuI\" => \"M\",\r\n \"SgfI\" => \"R\",\r\n \"SgrAI\" => \"MN\",\r\n \"SgrBI\" => \"C\",\r\n \"SgrDI\" => \"F\",\r\n \"SgsI\" => \"F\",\r\n \"SinI\" => \"GQRWX\",\r\n \"SlaI\" => \"C\",\r\n \"SmaI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"SmiI\" => \"FIKV\",\r\n \"SmiMI\" => \"IV\",\r\n \"SmlI\" => \"N\",\r\n \"SmoI\" => \"F\",\r\n \"SmuI\" => \"F\",\r\n \"SnaBI\" => \"ACKMNR\",\r\n \"SpeI\" => \"ABGHJKMNOQRSUWX\",\r\n \"SphI\" => \"ABCGHIJKMNOQRSVWX\",\r\n \"SrfI\" => \"EO\",\r\n \"Sse9I\" => \"IV\",\r\n \"Sse8387I\" => \"AK\",\r\n \"SseBI\" => \"C\",\r\n \"SsiI\" => \"F\",\r\n \"SspI\" => \"ABCFGIJKMNOQRSUVWX\",\r\n \"SstI\" => \"BC\",\r\n \"SstII\" => \"B\",\r\n \"StrI\" => \"U\",\r\n \"StuI\" => \"ABJKMNQRSUX\",\r\n \"StyI\" => \"CJMNRS\",\r\n \"StyD4I\" => \"N\",\r\n \"SwaI\" => \"GJMNSW\",\r\n \"TaaI\" => \"F\",\r\n \"TaiI\" => \"F\",\r\n \"TaqI\" => \"ABCFGIJKMNOQRSUVWXY\",\r\n \"TaqII\" => \"QX\",\r\n \"TasI\" => \"F\",\r\n \"TatI\" => \"F\",\r\n \"TauI\" => \"F\",\r\n \"TfiI\" => \"N\",\r\n \"TliI\" => \"N\",\r\n \"Tru1I\" => \"F\",\r\n \"Tru9I\" => \"GIMRVW\",\r\n \"TseI\" => \"N\",\r\n \"TsoI\" => \"F\",\r\n \"Tsp45I\" => \"N\",\r\n \"Tsp509I\" => \"N\",\r\n \"TspDTI\" => \"X\",\r\n \"TspEI\" => \"O\",\r\n \"TspGWI\" => \"X\",\r\n \"TspMI\" => \"N\",\r\n \"TspRI\" => \"N\",\r\n \"TstI\" => \"F\",\r\n \"Tth111I\" => \"GIKNQRVWX\",\r\n \"Van91I\" => \"AFKM\",\r\n \"Vha464I\" => \"IV\",\r\n \"VneI\" => \"IV\",\r\n \"VpaK11BI\" => \"K\",\r\n \"VspI\" => \"FIRV\",\r\n \"XagI\" => \"F\",\r\n \"XapI\" => \"F\",\r\n \"XbaI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"XceI\" => \"F\",\r\n \"XcmI\" => \"N\",\r\n \"XhoI\" => \"ABFGHJKMNOQRSUWXY\",\r\n \"XhoII\" => \"GMRW\",\r\n \"XmaI\" => \"INRUV\",\r\n \"XmaCI\" => \"M\",\r\n \"XmaJI\" => \"F\",\r\n \"XmiI\" => \"F\",\r\n \"XmnI\" => \"GNRUW\",\r\n \"XspI\" => \"K\",\r\n \"ZraI\" => \"INV\",\r\n \"ZrmI\" => \"I\",\r\n \"Zsp2I\" => \"IV\"\r\n );\r\n return $vendors;\r\n }", "public function unknownVendor() {\r\n\t\t$data = array();\r\n\t\t\t$data['name'] = 'Unknown';\r\n\t\t\t$data['link'] = '';\r\n\t\t\t$data['tax_id'] = 'Unknown';\r\n\t\t\t$data['address'] = 'Unknown';\r\n\t\t\t$data['address2'] = 'Unknown';\r\n\t\t\t$data['city'] = 'Unknown';\r\n\t\t\t$data['state'] = 'Unknown';\r\n\t\t\t$data['zip'] = 'Unknown';\r\n\t\t\t$data['country'] = 'Unknown';\r\n\t\t\t$data['has_ship'] = 0;\r\n\t\t\t$data['ship_contact'] = 'Unknown';\r\n\t\t\t$data['ship_phone'] = 'Unknown';\r\n\t\t\t$data['ship_address'] = 'Unknown';\r\n\t\t\t$data['ship_address2'] = 'Unknown';\r\n\t\t\t$data['ship_city'] = 'Unknown';\r\n\t\t\t$data['ship_state'] = 'Unknown';\r\n\t\t\t$data['ship_zip'] = 'Unknown';\r\n\t\t\t$data['ship_country'] = 'Unknown';\r\n\t\t\t$data['first_name'] = 'Unknown';\r\n\t\t\t$data['last_name'] = 'Unknown';\r\n\t\t\t$data['phone'] = 'Unknown';\r\n\t\t\t$data['alt_phone'] = 'Unknown';\r\n\t\t\t$data['fax'] = 'Unknown';\r\n\t\t\t$data['email'] = 'Unknown';\r\n\t\t\t$data['notes'] = 'Unknown';\r\n\t\t\t$data['active'] = 0;\r\n\t\t\t$data['legacy_vendor_code'] = 'Unknown';\r\n\t\t\t$data['legacy_vendor_id'] = 0;\r\n\t\t\t$data['mailing_list'] = 0;\r\n\r\n\t\treturn $data; //array\r\n\t}", "abstract protected function getOldName();", "public static function getOtherSupportVendor($specifiedVendorName, $shortName)\n {\n $ret = array_filter(static::getSupportVendorByShortName($shortName), function ($vendor) use ($specifiedVendorName) {\n if ($vendor !== $specifiedVendorName) {\n return $vendor;\n }\n });\n\n return array_values($ret);\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 }", "public function testDestiny2GetVendor()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function deprecatedMethod () {}", "protected function normalize_package_name( $name ) {\n\t\t$name = strtolower( $name );\n\t\treturn preg_replace( '/[^a-z0-9_\\-\\.]+/i', '', $name );\n\t}", "public static function getSupportVendorByShortName($shortName)\n {\n $sn = trim($shortName, '|');\n if (isset(EmojiTable::$all[$sn])) {\n return EmojiTable::$all[$sn]['supportVendor'];\n }\n\n if (isset(EmojiTable::$mappingOfShortName[$sn])) {\n $name = EmojiTable::$mappingOfShortName[$sn];\n return EmojiTable::$all[$name]['supportVendor'];\n }\n\n return [];\n }", "public function normalize($name);", "function acf_add_deprecated_filter($deprecated, $version, $replacement)\n{\n}", "public function getVendorList() {\n $vendors = $this->couponServices_model->fetchVendors();\n\n $vendor_options = array();\n $vendor_options[\"\"] = \"-- Select vendor --\";\n foreach ($vendors as $company) {\n $vendor_options[$company['vendorId']] = $company['vendorName'];\n }\n return $vendor_options;\n }", "protected function normalizeName($name){\n \n // canary...\n if(is_numeric($name)){\n throw new InvalidArgumentException(sprintf('an all numeric $name like \"%s\" is not allowed',$name));\n }//if\n \n $ret_mix = null;\n \n if(is_array($name)){\n \n $ret_mix = array();\n \n foreach($name as $key => $val){\n $ret_mix[$key] = mb_strtolower((string)$val);\n }//foreach\n \n }else{\n \n // get rid of any namespaces...\n $ret_mix = str_replace('\\\\','_',$name);\n $ret_mix = mb_strtolower((string)$ret_mix);\n \n }//if/else\n \n return $ret_mix;\n \n }", "function upgrade_old_slugs()\n {\n }", "abstract function normalizedName();", "protected function getVendorList()\n {\n $directoryIterator = new \\DirectoryIterator($this->getAppCodeAbsolutePath());\n if (!$directoryIterator->isReadable()) {\n throw new \\Exception('Impossible to read the app/ directory');\n }\n $vendorList = [];\n\n foreach ($directoryIterator as $element) {\n if ($element->isDir()\n && !in_array($element->getBasename(), $this->untrackedVendors)\n && $this->isBaseNameValid($element->getBasename())\n ) {\n $vendorList[] = $element->getBasename();\n }\n }\n\n return $vendorList;\n }", "function normaliseNames($names) { //{{{\n $normalised = array();\n $maxNames = 3;\n \n $n = 0;\n foreach ($names as $i => $name) {\n // skip names after third\n if (++ $n > $maxNames) {\n continue;\n }\n \n // split name into surname and forenames and split up forenames\n list ($surname, $forenames) = explode(', ', $name, 2);\n $forenames = explode(' ', $forenames);\n $fullname = '';\n \n // check that first letter of forename is uppercase\n foreach ($forenames as $fn) {\n $i = substr($fn, 0, 1);\n // add to full name as initial\n if (IntlChar::isupper($i)) {\n $fullname .= sprintf('%s. ', $i);\n }\n }\n \n // add surname and add to normalised\n $fullname .= $surname;\n $normalised[] = $fullname;\n }\n \n // join names\n $presentation = implode(', ', $normalised);\n \n // check whether to add et al\n if ($n > $maxNames) {\n $presentation .= ' et al';\n }\n \n return $presentation;\n}", "public function flagDeprecated() {\n\t\t$oldFilters = [\n\t\t\t'aioseop_title_format',\n\t\t\t'aioseop_canonical_url',\n\t\t\t'aioseop_description',\n\t\t\t'aioseop_keywords',\n\t\t\t'aioseop_title',\n\t\t\t'aioseop_home_page_title',\n\t\t\t'aioseop_title_page',\n\t\t\t'aioseop_attachment_title',\n\t\t\t'aioseop_title_single',\n\t\t\t'aioseop_archive_title',\n\t\t\t'aiosp_generate_descriptions_from_content',\n\t\t\t'aioseop_canonical_url_pagination',\n\t\t\t'aioseop_pre_tax_types_setting',\n\t\t\t'aiosp_disable',\n\t\t\t'aioseop_wp_head_priority',\n\t\t\t'aioseop_amp_schema',\n\t\t\t'aioseop_amp_description',\n\t\t\t'aioseop_amp_description_full',\n\t\t\t'aioseop_amp_description_attributes',\n\t\t\t'aioseop_description_full',\n\t\t\t'aioseop_description_attributes',\n\t\t\t'aioseop_keywords_attributes',\n\t\t\t'aioseop_prev_link',\n\t\t\t'aioseop_next_link',\n\t\t\t'aioseop_disable_schema',\n\t\t\t'aioseop_description_override',\n\t\t\t'aioseop_canonical_protocol',\n\t\t\t'aioseo_custom_menu_order',\n\t\t\t'manage_aiosp',\n\t\t\t'aioseop_add_post_metabox',\n\t\t\t'aiosp_bad_robots_botlist',\n\t\t\t'aiosp_bad_robots_badbotlist',\n\t\t\t'aiosp_bad_robots_badreferlist',\n\t\t\t'aiosp_bad_robots_allow_bot',\n\t\t\t'aioseop_export_settings_exporter_post_types',\n\t\t\t'aioseop_export_settings_exporter_choices',\n\t\t\t'aioseop_thumbnail_size',\n\t\t\t'aioseop_attachment_size',\n\t\t\t'aioseop_post_metabox_context',\n\t\t\t'aioseop_post_metabox_piority',\n\t\t\t'aioseop_helper_set_help_text',\n\t\t\t'aioseop_module_list',\n\t\t\t'aioseop_get_options',\n\t\t\t'aioseop_localize_script_data',\n\t\t\t'aioseop_home_url',\n\t\t\t'aioseo_include_images_in_sitemap',\n\t\t\t'aioseop_format_date',\n\t\t\t'aioseop_update_check_time',\n\t\t\t'aioseop_admin_flyout_menu',\n\t\t\t'aioseop_disable_twitter_plugin_card',\n\t\t\t'aioseop_robots_meta',\n\t\t\t'aioseop_register_schema_objects',\n\t\t\t'aioseop_schema_layout',\n\t\t\t'aioseop_module_info',\n\t\t\t'aioseop_export_settings',\n\t\t\t'aioseop_opengraph_display',\n\t\t\t'aioseop_opengraph_placeholder',\n\t\t\t'aiosp_opengraph_default_image_type',\n\t\t\t'aiosp_opengraph_default_image',\n\t\t\t'aiosp_opengraph_meta',\n\t\t\t'aioseop_enable_amp_social_meta',\n\t\t\t'aioseop_sitemap_admin_enqueue_selectize',\n\t\t\t'aioseop_gtm_container_id',\n\t\t\t'aioseop_disable_google_tag_manager',\n\t\t\t'aioseop_image_attribute_columns',\n\t\t\t'aioseop_image_seo_title',\n\t\t\t'aioseop_image_seo_alt_tag',\n\t\t\t'aiosp_sitemap_extra',\n\t\t\t'aioseo_news_sitemap_post_types',\n\t\t\t'aisop_woocommerce_hide_hidden_products',\n\t\t\t'aioseop_pro_options',\n\t\t\t'aioseo_video_sitemap_default_thumbnail',\n\t\t\t'aiosp_sitemap_extra_sitemaps',\n\t\t\t'aioseop_robotstxt_sitemap_url',\n\t\t\t'aioseop_sitemap_add_post_types_taxonomy_terms_args',\n\t\t\t'aiosp_sitemap_filename',\n\t\t\t'aiosp_sitemap_custom_*',\n\t\t\t'aiosp_sitemap_data',\n\t\t\t'aioseo_sitemap_ping_urls',\n\t\t\t'aioseop_sitemap_index_filenames',\n\t\t\t'aioseop_sitemap_xsl_url',\n\t\t\t'aiosp_sitemap_rss_latest_limit',\n\t\t\t'aiosp_sitemap_xml_namespace',\n\t\t\t'aiosp_sitemap_addl_pages_only',\n\t\t\t'aiosp_addl_pages',\n\t\t\t'aiosp_sitemap_include_post_types_archives',\n\t\t\t'aioseo_sitemap_author',\n\t\t\t'aiosp_sitemap_prio_item_filter',\n\t\t\t'aioseo_include_images_in_wp_gallery',\n\t\t\t'aioseop_gallery_shortcodes',\n\t\t\t'aioseop_clean_url',\n\t\t\t'aioseop_allowed_image_extensions',\n\t\t\t'aioseop_images_allowed_from_hosts',\n\t\t\t'aioseop_sitemap_exclude_tax_terms',\n\t\t\t'aiosp_sitemap_show_taxonomy',\n\t\t\t'aiosp_sitemap_term_counts',\n\t\t\t'aiosp_sitemap_post_counts',\n\t\t\t'aiosp_sitemap_modify_post_params',\n\t\t\t'aioseop_sitemap_include_password_posts',\n\t\t\t'aiosp_sitemap_post_filter',\n\t\t\t'aiosp_sitemap_post_query',\n\t\t\t'aioseo_news_sitemap_enabled',\n\t\t\t'aiosp_video_sitemap_remove_taxonomy',\n\t\t\t'aioseop_video_sitemap_scan_posts_limit',\n\t\t\t'aiosp_video_sitemap_count_videos_only',\n\t\t\t'aioseop_pro_supported_video_links',\n\t\t\t'aioseop_video_shortcodes',\n\t\t\t'aiosp_video_sitemap_thumbnail',\n\t\t\t'aiosp_video_sitemap_add_videos',\n\t\t\t'aioseop_noindex_rss',\n\t\t\t'aioseop_ga_enable_autotrack',\n\t\t\t'aiosp_google_autotrack',\n\t\t\t'aiosp_google_analytics',\n\t\t\t'aioseop_ga_extra_options',\n\t\t\t'aioseop_pro_gtm_enabled',\n\t\t\t'aioseop_ga_attributes',\n\t\t\t'aioseo_social_meta_tags'\n\t\t];\n\n\t\t$inUse = [];\n\t\tforeach ( $oldFilters as $filter ) {\n\t\t\tif ( has_filter( $filter ) ) {\n\t\t\t\t$inUse[] = $filter;\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $inUse ) ) {\n\t\t\t// We've updated our notification so let's remove the old one if it exists.\n\t\t\t$notification = Models\\Notification::getNotificationByName( 'deprecated-filters' );\n\t\t\tif ( $notification->exists() ) {\n\t\t\t\tModels\\Notification::deleteNotificationByName( 'deprecated-filters' );\n\t\t\t}\n\n\t\t\t$notification = Models\\Notification::getNotificationByName( 'deprecated-filters-v2' );\n\t\t\tif ( ! $notification->exists() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tModels\\Notification::deleteNotificationByName( 'deprecated-filters-v2' );\n\t\t\treturn;\n\t\t}\n\n\t\taioseo()->notices->deprecatedFilters( $inUse );\n\t}", "function getMetadataAdapterNames() {\r\n\t\t// must be implemented by sub-classes\r\n\t\tassert(false);\r\n\t}", "public function getLowerName(): string\n {\n return strtolower($this->packageName);\n }", "function ajan_core_add_illegal_names() {\n\tupdate_site_option( 'illegal_names', get_site_option( 'illegal_names' ), array() );\n}", "function vip_allow_title_orphans() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "protected function sanitizePluginsArray() {\n $response = [];\n\n foreach ($this->plugins as $vendorName => $version) {\n\n list($vendor,$name) = explode('@',$vendorName,2);\n\n $response[] = [\n \"vendor\" => $vendor,\n \"name\" => $name,\n \"filename\" => ltpm()->getFileName($vendor,$name,$version)\n ];\n }\n\n return $response;\n }", "public static function update_1_0_6_shorten_table_names() {\n\t\tglobal $wpdb;\n\t\t// old table names format => new table names format.\n\t\t$table_rename_map = array(\n\t\t\t\"{$wpdb->prefix}woocommerce_postfinancecheckout_attribute_options\" => \"{$wpdb->prefix}wc_postfinancecheckout_attribute_options\",\n\t\t\t\"{$wpdb->prefix}woocommerce_postfinancecheckout_completion_job\" => \"{$wpdb->prefix}wc_postfinancecheckout_completion_job\",\n\t\t\t\"{$wpdb->prefix}woocommerce_postfinancecheckout_method_configuration\" => \"{$wpdb->prefix}wc_postfinancecheckout_method_config\",\n\t\t\t\"{$wpdb->prefix}woocommerce_postfinancecheckout_refund_job\" => \"{$wpdb->prefix}wc_postfinancecheckout_refund_job\",\n\t\t\t\"{$wpdb->prefix}woocommerce_postfinancecheckout_token_info\" => \"{$wpdb->prefix}wc_postfinancecheckout_token_info\",\n\t\t\t\"{$wpdb->prefix}woocommerce_postfinancecheckout_transaction_info\" => \"{$wpdb->prefix}wc_postfinancecheckout_transaction_info\",\n\t\t\t\"{$wpdb->prefix}woocommerce_postfinancecheckout_void_job\" => \"{$wpdb->prefix}wc_postfinancecheckout_void_job\",\n\t\t);\n\n\t\t// rollback table rename if there are issues.\n\t\t$wpdb->query( 'START TRANSACTION' );\n\n\t\tforeach ( $table_rename_map as $key => $value ) {\n\t\t\t// check old table exists.\n\t\t\t// phpcs:ignore\n\t\t\t$old_table_result = $wpdb->get_row( \"SHOW TABLES WHERE Tables_in_{$wpdb->dbname} = '{$key}'\" );\n\n\t\t\tif ( $old_table_result ) {\n\t\t\t\t// check new table doesn't exist, if it does there's a problem!\n\t\t\t\t// phpcs:ignore\n\t\t\t\t$new_table_result = $wpdb->get_row( \"SHOW TABLES WHERE Tables_in_{$wpdb->dbname} = '{$value}'\" );\n\n\t\t\t\tif ( ! $new_table_result ) {\n\t\t\t\t\t// phpcs:ignore\n\t\t\t\t\t$result = $wpdb->query( \"RENAME TABLE {$key} TO {$value}\" );\n\t\t\t\t\tif ( false === $result ) {\n\t\t\t\t\t\tthrow new Exception( $wpdb->last_error );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$wpdb->query( 'COMMIT' );\n\t}", "public function testDestiny2GetVendors()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function egsr_change_roles_names() {\n global $wp_roles;\n \n if ( ! isset( $wp_roles ) )\n $wp_roles = new WP_Roles();\n \n $wp_site_roles = egsr_default_wp_site_roles();\n foreach ($wp_site_roles as $key => $value) {\n // Change role name\n $wp_roles->roles[$key]['name'] = $wp_roles->roles[$key]['name'] .' (Deprecated)';\n $wp_roles->role_names['contributor'] = $wp_roles->role_names[$key] .'$wp_roles->roles[$key]'; \n }\n}", "protected function cleanTableNames() {}", "protected function normalize() {}", "function sanitize_backend_name($name) {\n\t\tif ($name == 's3') $name = 'Amazon S3';\n\t\treturn $name;\n\t}", "public function getDeprecated();", "function pkg_remove_prefix(&$pkg_name) {\n\tglobal $g;\n\n\tif (substr($pkg_name, 0, strlen(g_get('pkg_prefix'))) ==\n\t g_get('pkg_prefix')) {\n\t\t$pkg_name = substr($pkg_name, strlen(g_get('pkg_prefix')));\n\t}\n}", "public function updateVendor() {\n try {\n if (!($this->vendor instanceof Base_Model_ObtorLib_App_Core_Catalog_Entity_Vendor)) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception(\" Vendor Entity not initialized\");\n } else {\n $objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor();\n $objVendor->vendor = $this->vendor;\n return $objVendor->updateVendor();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($ex);\n }\n }", "private function _cleanGroupName($row)\n {\n if ($row->group_name) {\n return;\n }\n\n $_names = [];\n foreach ($row->members as $member) {\n if ($member->member_id !== __me()->id || count($row->members) == 1) {\n $_names[] = $member->full_name;\n }\n }\n\n if (count($_names)) {\n $row->group_name = implode(\", \", $_names);\n $row->group_name = str_limit($row->group_name, 32);\n }\n }", "public static function normalizeName($name, $make_lowercase = true)\r\n {\r\n // Warn user of deprecation\r\n trigger_error(\r\n 'Use the normalization options and the other normalization methods instead.',\r\n E_USER_DEPRECATED\r\n );\r\n\r\n /**\r\n * Lowercasing header names allows for a more uniform appearance,\r\n * however header names are case-insensitive by specification\r\n */\r\n if ($make_lowercase) {\r\n $name = strtolower($name);\r\n }\r\n\r\n // Do some formatting and return\r\n return str_replace(\r\n array(' ', '_'),\r\n '-',\r\n trim($name)\r\n );\r\n }", "protected function sanatizeItemName($name) {\n\t\t$name = str_replace(\"'\", '', $name);\n\t\t$name = str_replace('\"', '', $name);\n\t\treturn $name;\n\t}", "function cleanNamefromERMObject(array $array, string $name){\n $basicname=$name;\n $i=1;\n while(checkredundantNamefromERMObjects($array, $name)) {\n $i++;\n $name = $basicname . $i;\n }\n return $name;\n\n}", "function shDiscoverUserLanguage()\n{\n\tShlSystem_Log::debug('sh404sef', 'Using deprecated ' . __FUNCTION__ . ', removed as not applicable anymore');\n}", "function handle_sanitise_name($name, $is_surname) {\n $array_names = array_map(function ($item_name) use ($is_surname) {\n //Remove whitespace character from every item inside exploded name array\n if ($is_surname) {\n return remove_whitespace_characters(handle_capitalise_surname($item_name));\n } else {\n return remove_whitespace_characters(ucfirst(strtolower($item_name)));\n }\n }, explode(\" \", trim($name)));\n return implode(\" \", array_filter($array_names, function ($item_name) {\n //Combine all entries from exploded name array if string length is greater than zero\n return strlen($item_name) > 0;\n }));\n}", "function phpgwapi_upgrade0_9_14_500()\n\t{\n\t\t$GLOBALS['phpgw_setup']->oProc->RenameTable('lang','phpgw_lang');\n\t\t$GLOBALS['phpgw_setup']->oProc->RenameTable('languages','phpgw_languages');\n\n\t\t$GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.14.501';\n\t\treturn $GLOBALS['setup_info']['phpgwapi']['currentver'];\n\t}", "public function unformatName($name);", "public function getActivatedVendors();", "public function errorIfOldCustomDrivers(): void\n {\n $driversPath = VALET_HOME_PATH.'/Drivers';\n\n if (! $this->files->isDir($driversPath)) {\n return;\n }\n\n foreach ($this->files->scanDir($driversPath) as $driver) {\n if (! ends_with($driver, 'ValetDriver.php')) {\n continue;\n }\n\n if (! str_contains($this->files->get($driversPath.'/'.$driver), 'namespace')) {\n warning('Please make sure all custom drivers have been upgraded for Valet 4.');\n warning('See the upgrade guide for more info:');\n warning('https://github.com/laravel/valet/blob/master/UPGRADE.md');\n exit;\n }\n }\n }", "private function getOldSkuFieldsForSelect()\n {\n return ['type_id', 'attribute_set_id'];\n }", "public function provideValidReplacementNames()\n {\n return [\n ['firstname'], // original faker property\n ['lastname'], // original faker property\n ];\n }", "protected function getNameWithoutPrefix() {}", "function wpcom_sitemap_namespaces() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n\n\treturn array();\n}", "protected function toInternalEventName($event_name)\n {\n return strtolower(str_replace('.', '', $event_name));\n }", "function namedentries($flip=false){\n trigger_error('deprecated namedentries called',E_USER_WARNING);\n}", "private function removeSuffixes($distroName)\r\n {\r\n return str_replace(array(' Linux', ' GNU/Linux'), '' , $distroName);\r\n }", "protected function formatUses(array $new, array $old)\n {\n if (isset($old['namespace']) && \\is_string($new['uses']) && \\strpos($new['uses'], '\\\\') !== 0) {\n return $old['namespace'].'\\\\'.$new['uses'];\n }\n\n return $new['uses'];\n }", "public function testIsVendorClassReturnsFalseIfNameOfInternalClassIsPassed()\n {\n $this->assertFalse(VendorResources::isVendorClass('\\stdClass'));\n }", "private function cleanupFieldNames($data)\r\n\t{\r\n\t\tforeach ($data as $key => $value)\r\n\t\t{\r\n\t\t\t// Translate field name to lower case\r\n\t\t\t$newKey = $this->makeLowerCaseName($key);\r\n\t\t\tif ($newKey != $key)\r\n\t\t\t{\r\n\t\t\t\t$data[$newKey] = $value;\r\n\t\t\t\tunset($data[$key]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "function make_tags_local() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "public function useAlternativeName(): void\n {\n $this->useAlternateName = true;\n }", "private function reservedNames() {\n\t\t\t\treturn array(\n\t\t\t\t\t\t'theme',\n\t\t\t\t\t\t'site_name',\n\t\t\t\t\t\t'language',\n\t\t\t\t\t\t'cache',\n\t\t\t\t\t\t'owner_email',\n\t\t\t\t\t\t'notification_email',\n\t\t\t\t\t\t'upgrades',\n\t\t\t\t\t\t'display_errors',\n\t\t\t\t\t\t'site_key',\n\t\t\t\t\t\t'last_cache',\n\t\t\t\t\t\t'site_version'\n\t\t\t\t);\n\t\t}", "function get_vendors($debug = false) {\n\t\t$q = (new QueryBuilder())->table('vendors');\n\t\t$q->where('shipfrom', '');\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\t$sql->setFetchMode(PDO::FETCH_CLASS, 'Vendor');\n\t\t\treturn $sql->fetchAll();\n\t\t}\n\t}", "function testForNormalizer() {\n if( !function_exists( 'normalizer_normalize' ) ) {\n?>\n<div class=\"error notice\">\n <p>\n <?php echo __( 'It seems that <strong>PHP Intl</strong> is missing on the server. International file names are not sanitized on upload.', 'port-f' ); ?>\n </p>\n</div>\n<?php\n }\n}", "function wpcom_invite_force_matching_email_address() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "public function upgrade_strings()\n {\n }", "public function upgrade_strings()\n {\n }", "public function upgrade_strings()\n {\n }", "public function upgrade_strings()\n {\n }", "function wac_vendor_name($user){\n\t$firstname = get_user_meta($user->ID,'first_name',true);\n\t$lastname = get_user_meta($user->ID,'last_name',true);\n\t\n\t$fullName = $user->data->user_nicename;\n\tif(!empty($firstname)){\n\t\t$fullName = trim($firstname.' '.$lastname);\n\t}\n\treturn $fullName;\n}", "function normalize_dn($dn){\n $dn = preg_replace('/,/',', ',$dn);\n $dn = preg_replace('/,\\s+/',', ',$dn);\n return $dn;\n}", "public function vendors2()\n {\n return $this->morphedByMany('Vendor', 'taggable', 'Taggable');\n }", "function vip_disable_tag_suggest() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "public function getVendorId() {}", "function wooadmin_rename_admin_menu_items( $menu ) {\n $menu = str_ireplace( 'Woocommerce', 'Eshopbox', $menu );\n // return $menu array\n return $menu;\n}", "public static function vendorItemsArr(){\n\t\treturn array(\"IANS\"=>array(array(\"name\"=>\"1 slice of cheese or pepperoni pizza\",\"cost\"=>5,\"code\"=>\"IANSSLICE1_\"),array(\"name\"=>\"Small Salad\",\"cost\"=>5,\"code\"=>\"IANSSALAD1_\"),array(\"name\"=>\"Premium Slice\",\"cost\"=>10,\"code\"=>\"IANSSLICE2_\")));\n\t}", "function rectifyNames($names){\r\n return array_map(\"rectifyName\",$names);\r\n}", "function hook_uuid_entities_pre_rebuild($plan_name) {\n\n}", "function hook_uuid_entities_pre_rebuild($plan_name) {\n\n}", "public function getDeviceManufacturer() {}", "public function getDriverNames(): array;", "function setSyncProdName()\n {\n }", "function normalize_driver_types()\n\t{\n\t\t\\Config::load('auth', true);\n\n\t\t$drivers = \\Config::get('auth.driver', array());\n\t\tis_array($drivers) or $drivers = array($drivers);\n\n\t\t$results = array();\n\n\t\tforeach ($drivers as $driver)\n\t\t{\n\t\t\t// determine the driver classname\n\t\t\t$class = \\Inflector::get_namespace($driver).'Auth_Login_'.\\Str::ucwords(\\Inflector::denamespace($driver));\n\n\t\t\t// Auth's Simpleauth\n\t\t\tif ($class == 'Auth_Login_Simpleauth' or $class == 'Auth\\Auth_Login_Simpleauth')\n\t\t\t{\n\t\t\t\t$driver = 'Simpleauth';\n\t\t\t}\n\n\t\t\t// Auth's Ormauth\n\t\t\telseif ($class == 'Auth_Login_Ormauth' or $class == 'Auth\\Auth_Login_Ormauth')\n\t\t\t{\n\t\t\t\t$driver = 'Ormauth';\n\t\t\t}\n\t\t\telseif (class_exists($class))\n\t\t\t{\n\t\t\t\t// Extended fromm Auth's Simpleauth\n\t\t\t\tif (get_parent_class($class) == 'Auth\\Auth_Login_Simpleauth')\n\t\t\t\t{\n\t\t\t\t\t$driver = 'Simpleauth';\n\t\t\t\t}\n\n\t\t\t\t// Extended fromm Auth's Ormauth\n\t\t\t\telseif (get_parent_class($class) == 'Auth\\Auth_Login_Ormauth')\n\t\t\t\t{\n\t\t\t\t\t$driver = 'Ormauth';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// store the normalized driver name\n\t\t\tin_array($driver, $results) or $results[] = $driver;\n\t\t}\n\n\t\treturn $results;\n\t}", "function fix_names($firstName, $lastName) {\n\t$n[0] = ucfirst(strtolower($firstName));\n\t$n[1] = ucfirst(strtolower($lastName));\n\treturn $n;\n}", "function alm_filters_sanitize_license( $new ) {\n \t$old = get_option( 'alm_filters_license_key' );\n \tif( $old && $old != $new ) {\n \t\tdelete_option( 'alm_filters_license_status' ); // new license has been entered, so must reactivate\n \t}\n \treturn $new;\n }", "function system_get_all_unames()\n{\n\t$retv[id1]=100;\n\t$retv[uname1]=\"tt\";\n\treturn($retv);\n}", "function sanitize_locale_name($locale_name)\n {\n }", "public function isFromVendor(): bool;", "function get_subdirectory_reserved_names()\n {\n }", "function wpcom_disable_mobile_app_promotion() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "public function getAllVendorProducts() {\n\n $query = $this->db->prepare(\"SELECT * FROM `products` WHERE `vendor_id` <> 28 AND `product_removed` = 0\");\n\n try {\n\n $query->execute();\n\n $result = $query->fetchAll();\n return $result;\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n\n }", "function GetProperUSN($usn){\r\n\t$formattedusn = preg_replace('/\\s+/', '', $usn);\r\n\t$formattedusn = strtolower($formattedusn);\r\n\treturn $formattedusn;\r\n}", "protected function migrateLegacyImportRecords() {}", "public function testDestiny2GetPublicVendors()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function getNames()\n {\n return array_keys(self::$availableManufacturers);\n }", "function wpcom_vip_load_helper_wpcom() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "function resolve_namespaces(array $pathes, $vendor = null)\n { \n $namespaces = [];\n\n foreach ((array) $pathes as $namespace => $path) { \n $namespace = studly_case($namespace); \n $vendor = studly_case($vendor ?? app()->getNamespace());\n // register classes with namespaces\n $namespaces[\"{$vendor}\\\\{$namespace}\\\\\"] = $path; \n } \n\n \\Helper::resolvePsr4($namespaces);\n }", "function wpcom_vip_enable_term_order_functionality() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n\n return false;\n}" ]
[ "0.6208851", "0.55763763", "0.55318815", "0.5431639", "0.5357439", "0.53371686", "0.52724415", "0.5271765", "0.5200153", "0.51787835", "0.51627636", "0.5161855", "0.515724", "0.5150761", "0.51237714", "0.51178396", "0.505705", "0.5047539", "0.5040993", "0.50276005", "0.5025621", "0.5019761", "0.5008698", "0.5005444", "0.49781704", "0.49458653", "0.4944843", "0.49410775", "0.4927329", "0.49128386", "0.4883422", "0.48668715", "0.4858368", "0.4856067", "0.48352847", "0.4833674", "0.48039472", "0.47986308", "0.47910482", "0.47708768", "0.47695738", "0.47617772", "0.47615373", "0.47597393", "0.47539335", "0.47459877", "0.4742457", "0.47313645", "0.47224882", "0.47145125", "0.4713718", "0.47112614", "0.47044003", "0.4703563", "0.46974218", "0.469468", "0.46942326", "0.4693401", "0.4687911", "0.46841896", "0.46841076", "0.46735364", "0.46609035", "0.46604767", "0.4659505", "0.4652265", "0.46515214", "0.4649939", "0.4649939", "0.46498585", "0.46486363", "0.46458074", "0.4644418", "0.46436036", "0.46419117", "0.46334743", "0.46291935", "0.46177328", "0.46175763", "0.46135202", "0.46135202", "0.46112192", "0.4605336", "0.4596925", "0.4579126", "0.45762187", "0.45742938", "0.45679688", "0.45661598", "0.45624167", "0.45616692", "0.45597085", "0.4559478", "0.455364", "0.4553255", "0.45528322", "0.4551549", "0.453865", "0.45383966", "0.45372242" ]
0.54108953
4
constructor function used to insert middleware
public function __construct() { $this->middleware('SancofaAuth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this -> middleware('auth');\n $this -> middleware('check_block');\n }", "public function __construct()\n {\n $middlewareGroup = new MiddlewareGroup();\n $middlewareGroup->user();\n $middlewareGroup->handle();\n }", "public function __construct()\n {\n $this->middleware(backpack_middleware());\n }", "public function __construct()\n {\n $this->setApp();\n\n $this->middleware(function ($request, $next)\n {\n $this->setUserInfo();\n\n return $next($request);\n });\n }", "public function __construct()\n {\n // Sets site_domain (gafe) and site_id in DatabaseConnection\n // calls SetDatabase\n $this->middleware('auth.connection');\n\n // User has a user type in token\n // calls CheckSitePermission\n $this->middleware('auth.permission');\n\n $this->middleware('auth.noaccess');\n\n // Checks to see if token is expired or invalid\n $this->middleware('jwt.auth');\n }", "public function __construct() {\n\t\t$this -> middleware('inventory');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t\t$this->middleware('lock');\n\t\t//$this->middleware('is_admin');\n\t}", "function __construct() {\n $this->middleware( 'permission:list_contact_msg_types', [ 'only' => [ 'index' ] ] );\n $this->middleware( 'permission:add_contact_msg_types', [ 'only' => [ 'create','store'] ] );\n $this->middleware( 'permission:replay_contacts', [ 'only' => [ 'edit','update'] ] );\n $this->middleware( 'permission:delete_contact_msg_types', [ 'only' => [ 'destory'] ] );\n }", "public function __construct()\n {\n $this->middleware([\n 'identify-website',\n 'identify-resource',\n ]);\n }", "private function setupMiddleware()\n {\n $this->getSlim()->add(new Model\\Middleware( $this ));\n }", "public function __construct()\n {\n $this->middleware(config('material.middleware'));\n }", "public function __construct() {\n\n\t\t$this->middleware( 'auth' );\n\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('token_auth', [\n\t\t\t'except' => [\n\t\t\t\t'register',\n\t\t\t\t'login',\n\t\t\t\t'token',\n\t\t\t\t'showToken',\n\t\t\t\t'refreshToken',\n\t\t\t\t'update',\n\t\t\t\t'delete'\n\t\t\t]\n\t\t]);\n\t\t$this->middleware('credentials_auth', [\n\t\t\t'except' => [\n\t\t\t\t'register',\n\t\t\t\t'show',\n\t\t\t\t'showOptions',\n\t\t\t\t'updateOptions',\n\t\t\t\t'exportAll_deprecated',\n\t\t\t\t'exportAll',\n\t\t\t\t'importAll_deprecated',\n\t\t\t\t'importAll'\n\t\t\t]\n\t\t]);\n\t}", "public function __construct()\n {\n $this->middleware(function ($request, $next) {\n $this->admin = Auth::user()->authorizeRoles(['admin']);\n return $next($request);\n });\n }", "public function __construct()\n {\n // Forces to be authenticated.\n // $this->middleware('auth');\n // $this->middleware('check_role:admin');\n // $this->middleware('fetch_objective');\n }", "public function __construct() \n {\n $this->middleware('auth', ['only' => [\n 'sendmessage',\n 'reportuser',\n 'reportcorporate',\n 'reportcar',\n 'reportpart',\n 'addcorporate',\n 'pusherauthenticate',\n 'iscorpuser',\n 'hascorpuserrole',\n 'addcorporateform',\n 'addcorporate',\n ]]);\n\n $this->middleware('corpuser', ['only' => [\n 'corporatedashboard',\n 'corporatemembers',\n 'corporatesettings',\n ]]);\n }", "public function __construct()\n {\n $this->middleware(\"acl:admin|moderator\");\n }", "public function __construct()\n {\n //$this->middleware('auth');\n $this->middleware('auth-admin');\n $this->middleware('signed')->only('verify');\n $this->middleware('throttle:6,1')->only('verify', 'resend');\n }", "public function __construct()\n {\n $this->middleware(function ($request, $next) {\n\n if (Gate::allows('manage-spp')) return $next($request);\n abort(403, 'Anda tidak memiliki cukup hak akses');\n });\n }", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t\t$this->middleware('admin');\n\n\t}", "public function __construct()\n {\n $this->middleware(function($request, $next){\n if(Gate::allows('manage-users')) return $next($request);\n abort(404);\n }) ;\n }", "public function __construct()\n {\n\n $this->middleware('auth');\n\n // $this->middleware(function($request, $next){\n\n // if(Gate::allows('manage-order')) return $next($request);\n // abort(403, 'Anda tidak memiliki cukup hak akses');\n // });\n }", "public function __construct() {\n $this->middleware('admin');\n $this->middleware('acl:privilege_add', ['only' => ['create', 'store']]);\n $this->middleware('acl:privilege_edit', ['only' => ['edit', 'update']]);\n $this->middleware('acl:privilege_delete', ['only' => ['destroy']]);\n $this->middleware('acl:privilege_list', ['only' => ['index']]);\n }", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t\t$this->middleware('active');\n\t}", "public function __construct(){\n\t\t$this->middleware( 'auth' );\n\t}", "public function __construct()\n {\n\t\t$this->middleware('auth');\n\t\t$this->middleware(function ($request, $next) {\n\t\t\t$this->user = Auth::user();\n\t\t\tif($this->user->role != 'admin') return redirect('web/404');\n\t\t\telse \n\t\t\t{\n\t\t\t\t$this->flag = array('products'=>1,'solutions'=>2);\n\t\t\t\treturn $next($request);\n\t\t\t}\n\t\t});\n }", "public function __construct() {\n\t\t$this->middleware( 'demo', [ 'only' => [ 'destroy' ] ] );\n\t\t$this->perpage = config( 'constants.per_page', '10' );\n\n\t\t$this->middleware( 'permission:ride-history',\n\t\t\t[ 'only' => [ 'index' ] ] );\n\t\t$this->middleware( 'permission:ride-delete',\n\t\t\t[ 'only' => [ 'destroy' ] ] );\n\t\t$this->middleware( 'permission:schedule-rides',\n\t\t\t[ 'only' => [ 'scheduled' ] ] );\n\t}", "public function __construct() {\n\t\t$this->middleware( 'demo', [ 'only' => [ 'destroy' ] ] );\n\t\t$this->perpage = config( 'constants.per_page', '10' );\n\n\t\t$this->middleware( 'permission:ride-history',\n\t\t\t[ 'only' => [ 'index' ] ] );\n\t\t$this->middleware( 'permission:ride-delete',\n\t\t\t[ 'only' => [ 'destroy' ] ] );\n\t\t$this->middleware( 'permission:schedule-rides',\n\t\t\t[ 'only' => [ 'scheduled' ] ] );\n\t}", "public function __construct()\n {\n // $this->middleware('admin');\n // $this->middleware('compAdmin');\n }", "public function __construct() {\n $this->middleware(['admin', 'checkSA', 'auth:admin']);\n }", "public function __construct() {\n\t\t$this->middleware('admin');\n\t}", "public function __construct() {\n\t\t$this->middleware ( 'auth' );\n\t}", "public function __construct()\n {\n // check the authentication\n $this->middleware('auth');\n // check the user_type\n $this->middleware('setter');\n }", "public function __construct()\n {\n $this->middleware('blogger');\n }", "public function __construct() {\n\t\t$this->middleware(function ($request, $next) {\n\t\t\t$route = $request->route()->getName();\n\t\t\t$action = @explode('.', $route)[1];\n\n\t\t\t$actions = ['index', 'show', 'edit', 'update', 'destroy', 'grant-rights'];\n\t\t\t$forbidd = [];\n\n\t\t\t$user = \\Auth::user();\n\t\t\tswitch (true) {\n\t\t\t\tcase !$user: {\n\t\t\t\t\t$forbidd = array_diff($actions, ['show']);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase !$user->isModerator(): {\n\t\t\t\t\t$forbidd = array_diff($actions, ['show', 'edit', 'update']);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (in_array($action, $forbidd)) {\n\t\t\t\treturn $this->forbiddenResponse();\n\t\t\t}\n\n\t\t\treturn $next($request);\n\t\t});\n\t}", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware(function($request, $next){\n if(Gate::allows('manage-MasterData')) return $next($request);\n abort(403, 'Anda tidak memiliki cukup hak akses');\n });\n }", "public function __construct()\n {\n $this->middleware('basicauth');\n $this->middleware('SuperadminRole');\n }", "public function __construct()\n {\n $this->middleware('basicauth');\n $this->middleware('SuperadminRole');\n }", "function __construct()\n {\n $this->middleware('permission:meta-list');\n $this->middleware('permission:meta-create', ['only' => ['create', 'store']]);\n $this->middleware('permission:meta-edit', ['only' => ['edit', 'update']]);\n $this->middleware('permission:meta-delete', ['only' => ['destroy']]);\n }", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n $this->middleware('parameter');\n\t}", "public function middleware()\n {\n // TODO: Implement middleware() method.\n }", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t\t$this->middleware('tipo_secretaria');\n\t}", "public function __construct() {\n $this->middleware('admin');\n $this->middleware('acl:user_add', ['only' => ['create', 'store']]);\n $this->middleware('acl:user_edit', ['only' => ['edit', 'update']]);\n $this->middleware('acl:user_delete', ['only' => ['destroy']]);\n $this->middleware('acl:user_list', ['only' => ['index']]);\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('signed')->only('verify');\n $this->middleware('throttle:6,1')->only('verify', 'resend');\n\n /**\n * Start SEO\n */\n $settings = Setting::find(1);\n //SEOMeta::setTitle('Email Verification - ' . (empty($settings->setting_site_name) ? config('app.name', 'Laravel') : $settings->setting_site_name));\n SEOMeta::setTitle(__('seo.auth.email-verification', ['site_name' => empty($settings->setting_site_name) ? config('app.name', 'Laravel') : $settings->setting_site_name]));\n SEOMeta::setDescription('');\n SEOMeta::setCanonical(URL::current());\n SEOMeta::addKeyword($settings->setting_site_seo_home_keywords);\n /**\n * End SEO\n */\n }", "public function __construct()\n {\n $this->req = new Request();\n $this->middleware('auth');\n }", "public function __construct(){\n $this-> middleware('auth:admin');\n }", "public function __construct() {\n $this->middleware( TokenAuth::class );\n }", "function __construct()\n {\n $this->middleware('permission:admins-list|admins-create|admins-edit|admins-delete', ['only' => ['index','store']]);\n $this->middleware('permission:admins-create', ['only' => ['create','store']]);\n $this->middleware('permission:admins-edit', ['only' => ['edit','update']]);\n $this->middleware('permission:admins-delete', ['only' => ['destroy']]);\n }", "public function __construct()\n {\n $this->middleware(Authenticate::class);\n }", "public function __construct()\n {\n $this->middleware(function ($request, $next) {\n $this->user = Auth::user();\n\n return $next($request);\n });\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('admin', ['only' => ['index', 'add']]);\n }", "public function __construct()\n {\n $this->middleware('sentinel.auth');\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('signed')->only('verify');\n $this->middleware('throttle:6,1')->only('verify', 'resend');\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('signed')->only('verify');\n $this->middleware('throttle:6,1')->only('verify', 'resend');\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('signed')->only('verify');\n $this->middleware('throttle:6,1')->only('verify', 'resend');\n }", "public function __construct() {\n $this->middleware(function ($request, $next) {\n // fetch session and use it in entire class with constructor\n $this->language_id = checknotsessionlang();\n\n return $next($request);\n });\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('client');\n }", "public function __construct(Middleware $middleware)\n {\n $this->middleware = $middleware;\n }", "public function __construct() {\n $this->middleware(function ($request, $next) {\n $loginUser = Auth::guard('web')->user();\n if(is_object($loginUser)){\n return $next($request);\n }\n return Redirect::to('/');\n });\n }", "public function __construct() {\n $this->middleware(function ($request, $next) {\n $loginUser = Auth::guard('web')->user();\n if(is_object($loginUser)){\n return $next($request);\n }\n return Redirect::to('/');\n });\n }", "public function __construct() {\n $this->middleware(function ($request, $next) {\n $loginUser = Auth::guard('web')->user();\n if(is_object($loginUser)){\n return $next($request);\n }\n return Redirect::to('/');\n });\n }", "public function __construct()\n {\t \n\t $this->middleware('admin'); \n }", "public function __construct()\n\t {\n\t \t//$this->middleware(\"is_admin\");\n\t \t$this->middleware('is_admin', ['except' => ['index']]);\n\t }", "public function __construct()\n {\n $this->middleware('App\\Http\\Middleware\\IDPs\\ImportIDPMiddleware', ['only' => ['import']]);\n }", "public function __construct()\n {\n $this->middleware(function ($request, $next) {\n\n if(Gate::denies('checkIsAdmin', [Contact::class])) return redirect()->back();\n\n return $next($request);\n });\n }", "function __construct()\n {\n $this->middleware('permission:admin-list|admin-create|admin-edit|admin-delete', ['only' => ['index','store']]);\n $this->middleware('permission:admin-create', ['only' => ['create','store']]);\n $this->middleware('permission:admin-edit', ['only' => ['edit','update']]);\n $this->middleware('permission:admin-delete', ['only' => ['destroy']]);\n }", "public function __construct()\n {\n // $this->middleware('auth'); // TODO: Make it admin only or something... Maybe not due to the sponsors and stuff\n }", "public function __construct()\n {\n if (setting('private_site')) {\n $this->middleware('auth');\n }\n }", "public function __construct()\r\n {\r\n $this->middleware('consultant');\r\n $this->middleware(function ($request, $next) {\r\n $this->consultant = Consultant::find(Session::get('user_id'));\r\n\r\n return $next($request);\r\n });\r\n }", "public function __construct()\n {\n $this->repo = new PageRepository();\n $this->middleware('auth', ['except' => ['index', 'show']]);\n $this->middleware('slugify', ['only' => ['store', 'update']]);\n $this->middleware('page.redirects', ['only' => ['show']]);\n }", "public function __construct(){\n // $this->middleware('admin', ['except' => ['delete','trash','restore','permanentDelete']]);\n\n $this->middleware('author', ['only' => ['create','store','edit','update']]);\n $this->middleware('admin', ['only' => ['delete','trash','restore','permanentDelete']]);\n }", "public function __construct()\n {\n \t$this->middleware('admin');\n }", "public\n\n\tfunction __construct() {\n\t\t$this->middleware( 'auth' );\n\t}", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('super-admin');\n }", "public function __construct()\n {\n $this->middleware('identify-website');\n }", "public function __construct()\n {\n // TODO: Determine if teachers and students need to see all Users, if they do we need policies.\n // middleware = for all class, policy = can differ for some actions\n // TODO: add missing actions (see LessonController)\n $this->middleware('admin');\n }", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t\t$this->middleware('verified');\n\t}", "public function __construct()\n {\n $this->middleware(\"login\");\n }", "public function __construct()\n\t\t{\n\t\t\t$this->middleware('auth:client');\n\t\t}", "public function __construct()\n {\n $this->middleware('isadmin');\n $this->middleware('auth');\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('producer');\n }", "public function __construct()\n {\n $this->middleware('permisos:GET.496E646963|POST.369646E694|PUT.369646E694|DELETE.369646E694');\n }", "public function __construct()\n {\n $this->middleware('checkauth', ['only' => ['getUser', 'setname', 'setemail', 'setpassword']]);\n// $this->middleware('checkuser', ['only' => ['setname', 'setemail', 'setpassword']]);\n }", "public function __construct()\n {\n $this->middleware(function($request, $next) {\n $this->user = (Auth::user() === NULL) ? new Guest() : Auth::user();\n\n return $next($request);\n });\n }", "public function __construct()\n {\n $this->middleware(function ($request, $next) {\n $requestUri = $request->getRequestUri();\n if (session()->has('user') && ($requestUri !== '/logout')) {\n return redirect(route('index'));\n }\n return $next($request);\n });\n }", "public function __construct() {\n\t\t$this->middleware('auth:api');\n\t}", "public function __construct()\n {\n $this->middleware('check.signature');\n $this->helper_url = env('HTTP_API_URL');\n }", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t\t$this->middleware('role');\n\t}", "public function __construct()\n {\n $this->middleware(function($request, $next){\n if(Gate::allows('manage-books')){\n return $next($request);\n }\n abort (403, \"Anda Tidak Memiliki Akses Melakukan Ini\");\n });\n }", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t\t$this->middleware('tipo_usuario');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t\n\t}", "public function __construct()\n {\n $this->middleware('auth:api');\n $this->middleware(\"VerifyRankToken:$this->USER_LEVEL_3\", [\n 'only' => ['permanentDestroy','batchPermanentDestroy']\n ]);\n }", "public function __construct()\n\t{\n//\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t//$this->middleware('admin');\n\t}", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('verified');\n $this->middleware('checkrole');\n }", "public function __construct()\n {\n $this->middleware('auth:api')->only('resend');\n $this->middleware('signed')->only('verify');\n $this->middleware('throttle:6,1')->only('verify', 'resend');\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('activated');\n \t$this->middleware('admin');\n }", "public function __construct()\n {\n\t\tdate_default_timezone_set(\"Asia/Kolkata\");\n $this->middleware('auth.basic');\n $this->middleware(function ($request, $next) {\n $this->user= Auth::user();\n $this->admin = Auth::guard('admin')->user();\n $this->employee = Auth::guard('employee')->user();\n $this->dealer = Auth::guard('dealer')->user();\n return $next($request);\n });\n }", "public function __construct()\n {\n $this->middleware('auth');\n // $this->middleware('mCheck', ['except' => ['index', 'enable', 'disable', 'edit', 'update', 'delete']]);\n $this->middleware('admin');\n }", "public function __construct() {\n $this->middleware(function ($request, $next) {\n $adminUser = Auth::guard('admin')->user();\n if(is_object($adminUser)){\n if($adminUser->hasRole('admin')){\n return $next($request);\n }\n }\n return Redirect::to('admin/home');\n });\n }", "public function __construct() {\n $this->middleware(function ($request, $next) {\n $adminUser = Auth::guard('admin')->user();\n if(is_object($adminUser)){\n if($adminUser->hasRole('admin')){\n return $next($request);\n }\n }\n return Redirect::to('admin/home');\n });\n }" ]
[ "0.7918249", "0.7828829", "0.76440424", "0.7577852", "0.7523472", "0.7505965", "0.74646103", "0.74549204", "0.7441405", "0.7411816", "0.73964274", "0.7368868", "0.73661655", "0.73047435", "0.7304375", "0.7298311", "0.72967213", "0.72899944", "0.7283466", "0.72737044", "0.7267202", "0.72549397", "0.7253111", "0.7252031", "0.72395176", "0.72338223", "0.7216228", "0.7216228", "0.72112596", "0.7206079", "0.72060305", "0.7204913", "0.72043777", "0.7199322", "0.71987206", "0.7196692", "0.7189765", "0.7189765", "0.71837515", "0.71763885", "0.7174738", "0.7169057", "0.71669626", "0.71652406", "0.7164716", "0.71632445", "0.71518576", "0.7151133", "0.7141718", "0.71363324", "0.7134687", "0.7127535", "0.71248037", "0.71248037", "0.71248037", "0.712389", "0.7122652", "0.7120652", "0.71150464", "0.71150464", "0.71150464", "0.7114148", "0.71130925", "0.71112293", "0.7109778", "0.7104291", "0.70936733", "0.70928043", "0.709124", "0.708598", "0.7080965", "0.70760024", "0.7073054", "0.7066627", "0.70650685", "0.7061927", "0.70591706", "0.70591134", "0.7057226", "0.7047883", "0.70467985", "0.70446205", "0.7044616", "0.70390874", "0.7036281", "0.70362246", "0.70346975", "0.7031863", "0.70311034", "0.7030474", "0.70271736", "0.70271564", "0.7025819", "0.70244825", "0.7021065", "0.70183104", "0.70123076", "0.70122445", "0.7011243", "0.70105225", "0.70105225" ]
0.0
-1
function used to display home
public function index() { return view('home'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Home()\n {\n $this->requestSessionInfo();\n\n // muestra solo 2\n $recent_artworks = $this->modelArtwork->GetFrontArtworks(2);\n $this->view->ShowHome($recent_artworks);\n }", "public function route_home() {\n\t\techo '<h1>It wurks!</h1>';\n\t}", "public function userHome() {\n\n $this->page->getPage('userhome.tpl');\n }", "public function getShowInHome();", "public function home() {\n\n\t\t$alphabets = array('a'=>'A',\n\t\t'b'=>'B',\n\t\t'c'=>'C',\n\t\t'd'=>'D',\n\t\t'e'=>'E',\n\t\t'f'=>'F',\n\t\t'g'=>'G',\n\t\t'h'=>'H',\n\t\t'i'=>'I',\n\t\t'j'=>'J',\n\t\t'k'=>'K',\n\t\t'l'=>'L',\n\t\t'm'=>'M',\n\t\t'n'=>'N',\n\t\t'o'=>'O',\n\t\t'p'=>'P',\n\t\t'q'=>'Q',\n\t\t'r'=>'R',\n\t\t's'=>'S',\n\t\t't'=>'T',\n\t\t'u'=>'U',\n\t\t'v'=>'V',\n\t\t'w'=>'W',\n\t\t'x'=>'X',\n\t\t'y'=>'Y',\n\t\t'z'=>'Z');\n\t\t$alpha_links = array();\n\t\t$i=0;\n\t\tforeach ($alphabets as $k=>$v) {\n\t\t\t$alpha_links[$i][\"link\"] = $this->request->createURL(\"Listing\", \"browseCategory\", \"search=$k\");\n\t\t\t$alpha_links[$i][\"text\"] = $v;\n\t\t\t$i++;\n\t\t}\n\t\t$this->page->assign(\"alpha_links\",$alpha_links);\t\n\t\t\n\t\t//Add Meta Tags\n\t\t$this->page->addMetaDescription(\"Pink Pages is a local search and business directory that provides truly local results for services and products\");\n\t\t$this->page->addMetaKeywords(\"pink pages, truly local, business directory, products, services\");\t\t\n\t\t\t\n $this->page->assign(\"do\", \"Listing\");\n $this->page->assign(\"action\", \"search\");\n\t\t$this->page->assign(\"home\",$this->request->createURL(\"Affiliate\", \"showhomePageAffiliate\"));\n $this->page->assign(\"SearchAction\",$this->request->createURL(\"Listing\", \"search\"));\n\t\t//dev_log::write(\"home() F1\");\n\t\t$this->page->assign(\"browse_by_category\",$this->request->createURL(\"Listing\", \"browseCategory\"));\n\t\t$this->page->assign(\"searchStreetAction\",$this->request->createURL(\"Listing\", \"searchStreet\"));\n\t\t$this->page->assign(\"searchStreetForm\",$this->request->createURL(\"Listing\", \"searchStreetForm\"));\n\t\t$this->page->assign(\"faq\",$this->request->createURL(\"Content\", \"faq\"));\n\t\t$this->page->assign(\"contactUs\",$this->request->createURL(\"Content\",\"contactUs\"));\n\t\t\n $this->page->addJsFile(\"bsn.AutoSuggest_2.1.3.js\");\n $this->page->addJsFile(\"default_values.js\");\t\t\n $this->page->addCssStyle(\"autosuggest_inquisitor.css\");\n\t\t$bannerArray=$this->CommonFacade->getBanner(\"0\");\n\t\t//dev_log::write(\"home() F2\");\n\t\t$this->page->assign(\"viewdemo\",$this->request->createURL(\"Listing\", \"demoAddListing\"));\n\t\t//dev_log::write(\"home() F2.1\");\n\t\t$this->page->assign(\"bannerArray\",$bannerArray);\n\t\t//dev_log::write(\"home() F2.2\");\n\t\t//$resip=$this->CommonFacade->addIp(); // Hereward 20121003 - remove redundant code\n\t\t//dev_log::write(\"home() F2.5\");\n\t\t//$this->CommonFacade->popularPageCount(\"1\"); // Hereward 20121003 - remove redundant code\n\t\t//dev_log::write(\"home() F3\");\n $this->page->getPage('home.tpl');\n }", "public function home()\n\t{\n\t\t$header = $this->loaded_module(0);\n\t\t$footer = $this->loaded_module(1);\n\t\t\n\t\t$data = $this->settings();\n\t\t\n\t\t$product = $this->loaded_module(7);\n\t\t$data[\"product_special\"] = $product->special_product_list(8);\n\t\t$data[\"latest_product\"] = $product->latest_product_list(6);\n\t\t$data[\"latest_product2\"] = $product->latest_product_list(6);\n\t\t$data[\"latest_product3\"] = $product->latest_product_list(6);\n\t\t\n\t\t$banner = $this->loaded_module_admin(7)->get_active_banner();\n\t\t$data[\"banner\"] = $banner;\n\t\t\n\t\t$header->header_view();\n\t\t$this->load->view(\"Home_v\", $data);\n\t\t$footer->footer_view();\n\t}", "public function home () {\n\t\t//deteccion\n\t\tif(Agent::isMobile()){\n\t\t\treturn View::make(\"movil.home\");\n\t\t} else {\n\t\t\treturn View::make(\"desktop.pre\");\n\t\t}\n\t}", "public function home(){\n $itemsHome = $this->itemsModel->listenerItems(); // Recupération des items de ma bdd ( par default les 8 permier items)\n include(\"home.php\"); // Chargement de la view (page home.php)\n }", "public function home()\n\t{\n\t\t$this->sidebar_template = 'news';\n\t\t$this->news = R::dispense('news', 5);\n\t\t$this->render();\n\t}", "function print_home() {\n\techo '\n\t<p class=\"alert alert-info\">\n\t\tWelcome <b>'.$_SESSION['username']. '</b> you can\n\t\t<a href=\"play_trivia.php\">play trivia</a> or <a href=\"insert_question.php\">insert questions</a>. \n\t\tUse the main menu above to select additional options or to logout.\n\t</p>\n\t';\t\n}", "private function home() {\n // busca as categorias do bd\n $categorias = $this->model->visualizarCategorias();\n // seta as categorias para a view\n $this->view->setCategorias($categorias);\n // passa o arquivo home\n $file = $this->templates . 'home.php';\n \n // retorna o conteudo da tela home para o usuario\n $this->telaUser = $this->view->retornaTela($file);\n }", "function print_home(){\n $home = new HomeView();\n $home->print_home();\n }", "public function home()\n {\n $params = [\n 'name' => 'xEiBi'\n ];\n\n return $this->render('home', $params);\n }", "public static function showHomePage()\n {\n $vd = new ViewDescriptor();\n $vd->setTitolo(\"SardiniaInFood: Profilo\");\n $vd->setLogoFile(\"../view/in/logo.php\");\n $vd->setMenuFile(\"../view/in/menu_home_azienda.php\");\n $vd->setContentFile(\"../view/in/azienda/home_page_azienda.php\");\n $vd->setErrorFile(\"../view/in/error_in.php\");\n $vd->setFooterFile(\"../view/in/footer_empty.php\");\n \n require_once \"../view/Master.php\";\n }", "public function home()\n\t{\n\t\tView::show(\"home.php\", \"Accueil !\");\n\t}", "function user_home()\n\t{\n\n $this->secure_page();\n\n // Very important.\n\t\tglobal $site_globals;\n\n\t\t// To eliminate typing...\n\t\t$link = $site_globals['link'];\n\n\t\t$_REQUEST['item_type'] == 'found' ? $lost_flag = '1' : $lost_flag = '0';\n\n\t\t$sql = \"SELECT item_id,description,item_comment,reward,address,city,state,zip,lost_found_flag,DATE_FORMAT(lost_found_date,'%M %e, %Y') as lfd, DATE_FORMAT(date_posted,'%M %e, %Y') as dp, user_id, photo_path FROM {$site_globals['ITEMS_TABLE']} WHERE user_id='{$_SESSION['user_id']}' AND lost_found_flag='$lost_flag'\";\n\n $qryObj = new QueryObject($sql, $link);\n\n\t\t// The $content template that will be inserted into and displayed with\n\t\t// the master template...\n\t\t$content = $site_globals['TEMPLATE_PATH'].\"/user_home.template.php\";\n\t\tinclude $site_globals['TEMPLATE_PATH'].\"/master.template.php\";\n\t}", "public function actionHome(){\n\t\t\n\t\t$this->getContent('home');\n\t\t\n\t}", "public function showHome()\n {\n //user authentication\n $user = UserAccountController::getCurrentUser();\n if ($user === null) {\n return;\n }\n $view = new View(\"userHome\");\n $view->addData(\"userName\", $user->getNickName());\n echo $view->render();\n }", "function warquest_home_welcome() {\r\n\r\n\t/* input */\r\n\tglobal $player;\r\n\tglobal $mid;\r\n\tglobal $sid;\r\n\tglobal $config;\r\n\t\r\n\t/* output */\r\n\tglobal $page;\r\n\tglobal $output;\r\n\t\r\n\t$output->title = t('HOME_OVERVIEW_TITLE');\r\n\t\t\r\n\t$page .= '<div class=\"subparagraph\">'.t('HOME_OVERVIEW_TITLE').'</div>';\r\n\t\r\n\t$page .= '<div class=\"box\">';\r\n\r\n\tif ($player->lid <= 5) {\r\n\t\r\n\t\t$page .= '<br/>';\r\n\t\r\n\t\t$query1 = 'select ugid from unit_group where type=2 and planet='.$player->planet;\r\n\t\t$result1 = warquest_db_query($query1);\r\n\t\t$data1 = warquest_db_fetch_object($result1);\r\n\r\n\t\t$query2 = 'select bgid from building_group where planet='.$player->planet.' order by bgid limit 1';\r\n\t\t$result2 = warquest_db_query($query2);\r\n\t\t$data2 = warquest_db_fetch_object($result2);\r\n\t\r\n\t\t$page .= warquest_image('other/commander.jpg', ' align=\"left\" width=\"160\" height=\"120\" ');\r\n\t\t\r\n\t\t$page .= t('HOME_WELCOME', warquest_rank($player->lid), player_format($player->pid, $player->name, $player->country));\r\n\t\t$page .= '<br/><br/>';\r\n\t\r\n\t\t$page .= t('HOME_INTRO_MISSIONS', warquest_link('mid='.MENU_MISSIONS.'&sid='.PAGE_MISSION_PLAYER.'&ssid='.warquest_get_default_mission($player->planet),t('LINK_MISSIONS'), 'mission1'));\r\n\t\t$page .= t('HOME_INTRO_BATTLES', warquest_link('mid='.MENU_BATTLE.'&sid='.PAGE_ENEMIES,t('LINK_BATTLES'), 'battle1'));\r\n\t\t$page .= t('HOME_INTRO_UNITS', warquest_link('mid='.MENU_UNITS.'&sid='.PAGE_UNIT_PLAYER.'&ssid='.$data1->ugid, t('LINK_UNITS'), 'unit1'));\r\n\t\t$page .= t('HOME_INTRO_BUILDINGS', warquest_link('mid='.MENU_BUILDINGS.'&sid='.$data2->bgid, t('LINK_BUILDINGS'), 'building1'));\r\n\t\t\r\n\t\t$page .= '<br/>';\t\t\t\r\n\t\t\r\n\t} else {\r\n\t\r\n\t\t/*$query1 = 'select count(pid) as count, sum(won) as won from player';\r\n\t\t$result1 = warquest_db_query($query1); \r\n\t\t$data1 = warquest_db_fetch_object($result1);*/\r\n\t\t\r\n\t\t/*$query = 'select distinct(country) from player';\r\n\t\t$result = warquest_db_query($query); \r\n\t\t$count = warquest_db_num_rows($result);*/\r\n\t\t\t\r\n\t\t$query2 = 'select pid from player where country=\"'.$player->country.'\" and experience>='.$player->experience;\r\n\t\t$result2 = warquest_db_query($query2);\r\n\t\t$count2 = warquest_db_num_rows($result2);\r\n\t\t\r\n\t\t$query3 = 'select pid from player where experience>='.$player->experience.' and country!=\"EU\"';\r\n\t\t$result3 = warquest_db_query($query3);\r\n\t\t$count3 = warquest_db_num_rows($result3);\r\n\t\r\n\t\t/*$yesterday = mktime(date(\"H\"), date(\"i\"), date(\"s\"), date(\"m\"), date(\"d\")-1, date(\"Y\"));\r\n\t\t$query4 = 'select count(pid) as count from member where last_login > \"'.date(\"Y-m-d H:i:s\", $yesterday).'\" ';\t\t\r\n\t\t$result4 = warquest_db_query($query4);\r\n\t\t$data4 = warquest_db_fetch_object($result4);*/\r\n\t\r\n\t\t/*$query5 = 'select sum(requests) as requests from views';\r\n\t\t$result5 = warquest_db_query($query5); \r\n\t\t$data5 = warquest_db_fetch_object($result5);*/\n\t\r\n\t\t$page .= '<div class=\"right\">';\r\n\t\t$page .= warquest_rank_image($player->lid);\r\n\t\t$page .= '</div>';\n\t\r\n\t\t$page .= t('HOME_WELCOME', warquest_rank($player->lid), player_format($player->pid, $player->name, $player->country));\r\n\t\t\r\n\t\t$page .= '<br/><br/>';\n\t\r\n\t\t$member = warquest_db_member($player->pid);\r\n\t\tif ($member->prev_login!=0) {\r\n\t\t\t$page .= t('HOME_LAST_LOGIN', warquest_ui_ago($member->prev_login)).'<br/>';\r\n\t\t}\r\n\t\t$page .= '<br/>';\r\n\t\t\r\n\t\t$page .= t('HOME_INTRO_PLACE1', \r\n\t\t\t\t\t\twarquest_link('mid='.MENU_PLAYERS.'&sid='.PAGE_LEADERBOARD.'&ssid='.PAGE_BEST_PLAYER, warquest_place($count3)));\r\n\t\t\r\n\t\t$code = sprintf(\"%03d%03d\",ord($player->country[0]),ord($player->country[1]));\r\n\t\t$page .= t('HOME_INTRO_PLACE2', \r\n\t\t\t\t\t\twarquest_link('mid='.MENU_PLAYERS.'&sid='.PAGE_LEADERBOARD.'&ssid='.PAGE_BEST_COUNTRY2.'&uid='.$code, warquest_place($count2)), warquest_landcode($player->country));\r\n\t\t$page .= '<br/>';\r\n\t\t\r\n\t\t/*$page .= '<br/>';\t\t\r\n\t\t$page .= t('HOME_INTRO_PLAYERS', energy_format($data1->count), country_format($count));\r\n\t\t$page .= t('HOME_INTRO_FIGHTS', health_format($data1->won));\r\n\t\t$page .= t('HOME_INTRO_REQUESTS', money_format1($data5->requests));\r\n\t\t$page .= t('HOME_PLAYERS_ONLINE',energy_format($data4->count));\t\t\t\r\n\t\t$page .= '<br/>';*/\r\n\t}\r\n\t\t\r\n\t$page .= warquest_view_awards();\r\n\t\r\n\tif ($player->lid > 4) {\r\n\t\t$page .= warquest_poll_teaser();\t\r\n\t}\r\n\r\n\t/* Show tip */\r\n\t$page .= warquest_ui_tip();\t\n\t$page .= '<div class=\"spacer\"></div>';\t\r\n\t\r\n\t$page .= '</div>';\t\r\n}", "public function index() \n\t{\n\t\t$this->_render_hod_view('home');\n\t}", "public function home()\n {\n $listItem = $this->Item->getAll();\n $this->set(['title' => 'Home', 'items' => $listItem]);\n $this->render('home');\n }", "public function showHomePage()\n\t{\n\t\t# call the API\n\t\tif($accessKey = getAccessKey()) {\n\t\t\t$headers = ['accessKey' => $accessKey];\n\t\t}\n\t\telse {\n\t\t\t$headers = [];\n\t\t}\n\n\t\t$response = App::make(\"ApiClient\")->get(\"home\", [], $headers);\n\n\t\t# if we got some data back successfully then do something with it\n\t\tif($response['success'])\n\t\t{\n\t\t\t# short cut the data response\n\t\t\t$data = $response['success']['data'];\n\n\t\t\t# if we don't have the nav stored in the session then store it\n\t\t\tif (! Session::has('nav') ) {\n\t\t\t Session::put('nav', $data['channels']);\n\t\t\t}\n\n\t\t\t# set the browser page title\n\t\t\t$data['pageTitle'] = \"Bristol news, what's on, food and drink, lifestyle\";\n\n\t\t\t# set the pages meta description value\n\t\t\t$data['metaDescription'] = \"Bristol news, comprehensive what's on listings, reviews and special offers online, on mobile, in print - check out our FREE app and monthly magazine\";\n\n\t\t\t# make the view\n\t\t\treturn View::make('home.index', $data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// do something here!!!\n\t\t}\n\t}", "public function home() {\n //We could set this as guest and then get it from SESSION once a user has logged in\n $first_name = 'Lisa';\n $last_name = 'Simpson';\n require_once('views/pages/home.php');\n }", "public function home() {\n $_SESSION['kviz_end'] = 0;\n $this->prikaz(\"igrac\", []);\n }", "public function is_home()\n {\n }", "public function show(home $home)\n {\n //\n }", "public function is_home();", "public function home()\n {\n session_start();\n $posts = new PostManager;\n $resultat = $posts->getPosts(4);\n echo $this->getRender()->render('homeView.twig', [\n 'resultat' => $resultat,\n 'session' => $this->getSuperglobals()->get_SESSION()\n ]);\n }", "public function getShowHomePage()\n {\n include(__DIR__.\"/../../001_pages/000_Site_Pages/home.php\"); \n }", "public function home()\n {\n\t\tif(!$_SESSION['logged_in'])\n\t\t\tredirect('administrator');\n\t\t\n $data = array(\n 'admin' => $_SESSION['username']\n );\n $this->page('administrator/home',$data);\n }", "public function home()\n {\n $this->privateAccess(true);\n //Set content type as html page\n $this->contentType(\n 'html',\n 'Management Proof',\n [\n $this->_assets_path . 'js/Core/datatables.min.js',\n $this->_assets_path . 'js/Apps/ManagementResults/home.js'\n ], [\n $this->_assets_path . 'css/Core/datatables.min.css'\n ]\n );\n\n //add management subject view\n include 'Apps/ManagementResults/view/home.php';\n\n }", "function home()\n\t{\n\t\t$data['active_page'] = 'home';\n\t\t$data['cart_items_count'] = $this->m_cart->get_cart_count();\n\t\t$data['settings'] = $this->m_settings->get_all();\n\t\t$this->load->view('frontend/templates/header',$data);\n\t\t$this->load->view('frontend/templates/main_home_top_bg');\n\t\t$this->load->view('frontend/pages/boss/home');\n\t\t$this->load->view('frontend/templates/footer', $data);\n\n\t}", "public function home()\n\t{\n\n\t\tView::show(\"home.php\", \"Accueil Mon MVC !\");\n\t}", "public function actionKnprHome()\n { \n return $this->render('knpr/knpr-home');\n }", "public function home()\n {\n global $user;\n\n // Example data to use in the home page.\n $context['user'] = $user;\n $context['allPosts'] = Post::tenMostRecent();\n $context['allComments'] = Comment::tenMostRecent();\n $context['allImages'] = Image::tenMostRecent();\n return render('views/pages/home.php', $context);\n }", "public function home() {\n require_once($_SERVER['DOCUMENT_ROOT'] . '/../PHPIncludes/pageLinkScriptsCSS.php');\n\n //Make an object of the pageLinkScriptsCSS class for storing the CSS requirements for the header:\n $pageRequirements = new pageLinkScriptsCSS();\n \n $pageRequirements->add(\"css\", ['DashStyles.css','animate.min.css']);\n\n $pageRequirements->add(\"title\", 'DashBorad');\n\n $pageRequirements->add(\"js\", ['assets/JS/dashHome.js']);\n\n\n\n callStructural('header','stdBS2',$pageRequirements);\n\n require_once('views/dash/home.php');\n\n //Render the page footer:\n callStructural(\"footer\", 'stdBS2', $pageRequirements); \n\n\n }", "public function home()\r\n {\r\n\r\n $view = new Template();\r\n echo $view->render('views/home.html');\r\n }", "public function actionHome()\n\t{\n $this->setMetaTag();\n \n $user_id = Yii::$app->user->getId();\n $issue = isset($_GET['issue']) ? $_GET['issue'] : null;\n $service = $this->serviceFactory->getService(ServiceFactory::SITE_SERVICE);\n $home = $service->getHomeInfo($user_id, $issue, new SiteVoBuilder());\n $create_thread_form = new CreateThreadForm();\n $selected = $home->getHomeSelected();\n return $this->render('home', ['home' => $home,\n 'feed_selected' => $selected,\n 'change_email_form' => new ResendChangeEmailForm(),\n 'create_thread_form' => $create_thread_form]);\n\t}", "public function home()\n\t{\n\t // show the form\n\t return $this->homeRepository->home();\n\t}", "function home() {\r\n\t\tloadView('head/head1.php');\r\n\t\t$path=loadModel(\"users\",\"getProfilePic\",array('id'=>$_SESSION['id']));\r\n\t\t$userName=loadModel(\"users\",\"fetchName\",array(\"id\"=>$_SESSION['id']));\r\n\t\tloadView('navigation/usernavigation.php',array('profile_pic_path'=>\"$path\",\"user_name\"=>$userName));\r\n\t\t\r\n\t\t$arrData=loadModel(\"personalprofile\",\"loadProfile\",array(\"id\"=>$_SESSION['id']));\r\n\t\tloadView('midpanel/bigmid.php',$arrData);\r\n\t\t/*$arrData=loadModel(\"personalprofile\",\"loadProfile\",array(\"id\"=>$_SESSION['id']));\r\n\t\tloadView('midpanel/bigmid.php',$arrData);\r\n\t\t*/loadView('footer/footer.php'); \r\n\t}", "public function home()\n {\n $lastUpdates = ArticleManager::findLastUpdates();\n\n $this->renderView('home.twig',\n [\n 'articleList' => $this->articleList,\n 'lastUpdates' => $lastUpdates, \n ]\n );\n }", "public function index() {\n $this->home(); \n }", "public\tfunction\tpanelHome() {\n\t\t\t//Load the panel matching the home slug.\n\t\t\tself::panel('FrozenPlugin-home');\n\t\t}", "public function showHome()\n {\n if(!isset($_GET['people']))\n {\n $arr=$this->model->getList();\n include 'view_home.php';\n } else\n {\n $val = $this->model->getPerson($_GET['people']);\n include 'view2.php';\n }\n }", "function get_homeurl() {\n return '/hospital-system';\n}", "public function home()\n {\n $this->render('home/content');\n }", "public function renderHomepage() {\n\t\tif ($this->logged)\n\t\t\t$this->template->invites = CourseListModel::getMyInvites();\n\t}", "public function Home()\n {\n $this->template->set('global_setting', $this->global_setting);\n $this->template->set('page', 'home');\n $this->template->set_theme('default_theme');\n $this->template->set_layout('frontend')\n ->title($this->global_setting['site_title'] . ' | Home')\n ->set_partial('header', 'partials/header')\n ->set_partial('footer', 'partials/footer');\n $this->template->build('frontpages/homepage');\n }", "public function actionMultiregionalHome() {\n return $this->render('multiregional/multiregional-home');\n }", "function get_home_path()\n {\n }", "public function videoconferenciaHome( ) {\n $this->setComando(\"HOME\");\n }", "public function home($data){\r\n if(!$this->isLogged()){\r\n header(\"Location:\".url(\"admin/login\"));\r\n }\r\n echo $this->view->render(\"home.php\",[\r\n \"title\"=> \"Admin Home | \". SITE,\r\n ]);\r\n }", "public function home()\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$data['username']\t\t\t= $this->session->userdata('username');\n\t\t\t\t$this->load->view('admin/home', $data);\n\t\t\t}", "public function homePage()\n {\n return $this->render(\"homePage.html.twig\");\n }", "public function home(){\n\n\t\t# this will be the home of the teacher this session is now global\n\t\t$data['title_page'] ='Teacher| Home';\n\t\t$id = $this->session->userdata('teach_id');\n\n\t\tif ($id != 0) {\n\n\t\t\t$data['teach_dat'] = $this->teach_F->get_teach_dat($id);\n\t\t\t$this->load->view('teach/teach_home', $data);\n\t\t}\n\t\telse{\n\n\t\t\tredirect(site_url('teacher'));\n\t\t}\n\t\t\n\t}", "function listing_home () {\n\n\t\t$this->authentication->is_admin_logged_in (true);\n\t\tisAdminSection();\n\n\t\t$this->mcontents['page_title'] = $this->mcontents['page_heading']\t= 'Users by Roles';\n\n\t\t$this->_requireUserRolesDropdown();\n\n\t\tloadAdminTemplate('user/listing_home', $this->mcontents);\n\t}", "public function homePage()\n\t{\n $data[\"base_url\"] = $this->config->item(\"base_url\");\n $data['header'] = $this->load->view('user/header', $data, TRUE);\n\t\t$data['footer'] = $this->load->view('user/footer', $data, TRUE);\n\t\t$this->load->view('user/home',$data,true);\n }", "public function homePageAction(Application $app){\n \n $spectacles = $app['dao.spectacle']->LastNineArticles();\n $archives= $app['dao.spectacle']->ArchiveShow();\n $presses = $app['dao.press']->findAll();\n return $app['twig']->render('index.html.twig', array('spectacles'=>$spectacles,\n 'archives'=>$archives,\n 'presses'=>$presses));\n }", "function homeURL() {\n return 'mist.ac.bd';\n }", "function home(){\n\n\t\tredirect('home');\n\t}", "public function home() {\n $posts = $this->postManager->getPosts();\n $view = new View(\"Home\");\n $view->generate(array('posts' => $posts));\n }", "public function userHome()\n {\n $isLoggedin = $this->sessionManager->isLoggedIn();\n $username = $this->sessionManager->usernameFromSession();\n require_once __DIR__ . '/../templates/userHome.php';\n }", "public function get_home(){\n\n\t\t$bannerimages = DB::table('banner_images')\n\t\t\t\t\t->orderBy('created_at','desc')->get();\n\n\t\t$aboutus = DB::table('pages')\n\t\t\t\t\t->where('page_title', '=', 'About Us')\n\t\t\t\t\t->where('page_isPublished', '=', '1')\n\t\t\t\t\t->where('page_isDeleted', '=', '0')->get();\n\n\t\t$this->layout->content = View::make('home.home')\n\t\t\t->with('banner_images', $bannerimages)\n\t\t\t->with('aboutus', $aboutus);\n\t}", "public function hookDisplayHome($params){\r\n\t\treturn $this->hookSpecialproduct($params);\r\n\t}", "public function home($params)\n {\n session_start();\n $data[\"tag_name\"] = \"Home\";\n $data[\"page_title\"] = \"Pagina principal\";\n $data[\"page_name\"] = \"home\";\n $arrData = $this->proyecto->getProyectosHome();\n $data[\"proyectos\"] = $arrData;\n $arrData = $this->articulo->getArticulosHome();\n $data[\"articulos\"] = $arrData;\n // dep($data);\n $this->getView(\"Home/homes\", $data);\n }", "public static function show()\n {\n//You could get fancy with the homepage and check for the userID in the session and hide/show the login / registration links when no session\n//If there is a session then you should show the user profile link\n//the template is an HTML page with PHP inserted in it. just put an if/else statement to check for the session and show correct links\n\n\n $templateData['site_name'] = 'mysite';\n\n//template data contains what will show up in the $data variable in the homepage template\n//the name of the template 'homepage' becomes 'homepage.php' in the pages directory\n\n self::getTemplate('homepage', $templateData);\n }", "private function indexAction()\n {\n $page = isset($_GET['page']) ? substr($_GET['page'],0,-1) : \"home\" ;\n $this->reg->pages->getPageContent(strtolower($page));\n }", "public function index()\n\t{\n\t\t$data['logo'] = \"/img/ilih.png\";\n\t\t$data['users'] = $this->User->getAll();\n\n\t\t$this->parser->parse('home', $data);\n\t}", "public function index() {\n\n\t\t$data['content'] = 'Homepage';\n\t\t$this->flexi->title('Homepage')\n\t\t\t\t\t->make('home', $data);\n\n\t}", "public function home() {\n require_once($_SERVER['DOCUMENT_ROOT'] . '../PHPIncludes/pageLinkScriptsCSS.php');\n\n //Make an object of the pageLinkScriptsCSS class for storing the CSS requirements for the header:\n $pageRequirements = new pageLinkScriptsCSS();\n\n $pageRequirements->add(\"css\", ['screen.css', 'Animate.css']);\n\n $pageRequirements->add(\"title\", 'Skater Wave');\n\n $pageRequirements->add(\"js\", ['assets/JS/js.js' ]);\n\n\n\n callStructural('header','std',$pageRequirements);\n\n\n require_once('models/Devices.php');\n\n require_once('views/pages/home.php');\n\n //Render the page footer:\n callStructural(\"footer\", 'std', $pageRequirements); \n\n\n }", "public function actionProvHome()\n {\n return $this->render('prov/prov-home');\n }", "public function index()\n {\n $this->render('home/home');\n }", "function Home($crumbTrail) {\n global $roster;\n\n if (DEBUG) {\n\n RegisterDebug('Called Home()');\n\n }\n\n page_header($GLOBALS['site']['title'].' :: '.gettext('Home'),\n '',\n $crumbTrail);\n\n $executor = $roster->SearchPosition('WARD');\n\n print '<p>Scum,</p>'\n .'<p>I am <a href=\"mailto:'.$executor[0]->GetEmail().'\">Warden '\n .$executor[0]->GetName().'</a>, '\n .'and this is the Citadel. It is here, high above the landscape of '\n .'<a href=\"http://lyarna.thebhg.org/#2\" target=\"_blank\">Sol\\'rahl</a>, '\n .'that you will spend many of your days in training. What? You expected '\n .'life as a bounty hunter to be exiciting all of the time? A constant rush '\n .'of adrenaline and easy credits? What kind of dream world are you living '\n .'in? If you want to make it through your first hunt alive, you\\'ll want '\n .'to put in a little time training first.</p>'\n .'<p>And now for you old and dying veterans with your sore bones. I know '\n .'what you\\'re saying. \"This is just for the damn trainees.\" Well you are '\n .'wrong, <u>damn wrong</u>. Just because you don\\'t have a blaster wound '\n .'in your chest yet, it doesn\\'t mean you aren\\'t just lucky. Take a few '\n .'of our advanced courses and then you can brag.</p>';\n\n $news = new News('citadel-38learn');\n\n if ($news->LoadConfig('news.ini')) {\n\n $news->Render();\n\n } else {\n\n print 'Could not load News configuration file...<br>'\n .$news->Error().'<br>';\n\n }\n\n page_footer();\n\n}", "function home()\n\t{\n\t\t$data = $this->model->user_info();\n\t\t$this->load->view('mainView.php', $data);\n\t}", "function home(){\n\n $this->view(\"home_index\",[\"page\"=>\"list_image\",\n \"hinhanh\"=>$this->doituong->getAllImage(),\n \"listroom\"=>$this->home1->getListRoom()]);\n }", "public function home() {\n\n\t\t// echo $user = User::find(1)->username;\n\t\t// echo '<pre>', print_r($user), '</pre>';\n\t\t\n\t\treturn View::make('home', array('new'=>'You are in Home'));\n\t}", "public function home()\n\t{\n\t\t//Se valida la existencia de los datos del usuario que inicio sesion dentro de la session\n\t\tif($this->session->userdata('id_usuario_prueba') != null){\n\t\t\t$data = [\n\t\t\t\t\"page\" => \"Home\"\n\t\t\t];\n\t\t\t$this->load->view('layout/layout_open');\n\t\t\t$this->load->view('layout/layout_menu', $data);\n\t\t\t$this->load->view('home');\n\t\t\t$this->load->view('layout/layout_close');\n\t\t}else{\n\t\t\theader(\"Location:\" . base_url());\n\t\t}\n\t}", "public function show(Home $home)\n {\n //\n }", "public function show(Home $home)\n {\n //\n }", "public function home()\n\t{\n\t\treturn View::make('newhome');\n\t}", "function adelle_theme_home_page_menu( $args ) {\r\n $args['show_home'] = true;\r\n return $args;\r\n }", "abstract public function getHomePage(): string;", "public function home()\n\t{\n\t\tSession::put('lang','EN');\n\t\treturn $this->homeblade();\n\t}", "public function homeAction()\n {\n View::render('Pages/home.html.twig');\n }", "public function index () {\n\n return $this->app->render('home.tpl.php');\n \n }", "public function home()\n\t{\n\t\t$page = 'home';\n\t\treturn view('dashboard.home', compact('page'));\n\t}", "public function home()\n {\n \n if (!isset($_SESSION)) { \n session_start(); \n }\n \n $homeService = new HomeService;\n \n $script = $homeService->getHomeScripts();\n \n $scriptHead = $script[0];\n $scriptBody = $script[1];\n $metal = $script[2];\n\n if (isset($_GET[\"notif\"])){\n $notification = $homeService->notification($_GET[\"notif\"]);\n }\n\n $resetDate = json_decode(file_get_contents(__DIR__.'/../../deposit/ResetDate.json'), true);\n $datetime1 = new DateTime();\n $datetime2 = new DateTime('@'.$resetDate);\n $interval = $datetime1->diff($datetime2);\n $elapsed = $interval->format('Fin de partie : %a jours, <span id=\"timerJS\">%h:%i:%S</span>');\n $resetTimeLeft = $elapsed;\n\n $customStyle = $this->setCustomStyle('panel'); \n $title = 'Home';\n \n if (isset($_SESSION['auth'])){\n if (file_exists(\"../deposit/User_Avatar/\".$_SESSION['auth'].\".jpg\")){\n $avatar = $_SESSION['auth'].\".jpg\";\n } else {\n $avatar = $_SESSION['auth'].\".png\";\n }\n }\n \n if (isset($_GET['logout'])) {\n session_destroy(); \n header('Location: ?p=home');\n }\n \n if ($_SESSION) {\n require('../src/View/HomeView.php');\n } else {\n require('../src/View/VisitorHomeView.php');\n }\n \n }", "public function index()\n\t{\n\t\t$data = array(\n\t\t\t'title' => 'Home',\n\t\t\t'item' => $this->m_home->getData(),\n\t\t\t'contents' => 'v_home',\n\t\t);\n\t\t$this->load->view('layout/v_wrapper_frontend', $data, false);\n\t}", "public function homePage()\n {\n return cq()->homePage();\n }", "public function displayContent(){\n\t\t\tinclude('/includes/homepage.inc.php');\t\n\t\t}", "public function action_home()\n\t{\n\t\tglobal $txt, $context, $settings;\n\n\t\t// We need a little help\n\t\trequire_once(SUBSDIR . '/Membergroups.subs.php');\n\n\t\t// You have to be able to do at least one of the below to see this page.\n\t\tisAllowedTo(array('admin_forum', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_boards', 'manage_smileys', 'manage_attachments'));\n\n\t\t// Find all of this forum's administrators...\n\t\tif (listMembergroupMembers_Href($context['administrators'], 1, 32) && allowedTo('manage_membergroups'))\n\t\t{\n\t\t\t// Add a 'more'-link if there are more than 32.\n\t\t\t$context['more_admins_link'] = '<a href=\"' . getUrl('moderate', ['action' => 'moderate', 'area' => 'viewgroups', 'sa' => 'members', 'group' => 1]) . '\">' . $txt['more'] . '</a>';\n\t\t}\n\n\t\t// This makes it easier to get the latest news with your time format.\n\t\t$context['time_format'] = urlencode($this->user->time_format);\n\t\t$context['forum_version'] = FORUM_VERSION;\n\n\t\t// Get a list of current server versions.\n\t\t$context['current_versions'] = getServerVersions($this->_checkFor);\n\t\t$context['can_admin'] = allowedTo('admin_forum');\n\t\t$context['sub_template'] = 'admin';\n\t\t$context['page_title'] = $txt['admin_center'];\n\t\t$context[$context['admin_menu_name']]['tab_data'] = array(\n\t\t\t'title' => $txt['admin_center'],\n\t\t\t'help' => '',\n\t\t\t'description' => '\n\t\t\t\t<span class=\"bbc_strong\">' . $txt['hello_guest'] . ' ' . $context['user']['name'] . '!</span>\n\t\t\t\t' . sprintf($txt['admin_main_welcome'], $txt['admin_control_panel']),\n\t\t);\n\n\t\t// Load in the admin quick tasks\n\t\t$context['quick_admin_tasks'] = getQuickAdminTasks();\n\t}", "public function home()\n\t{\n\t\t$data = $this->Service->get_latest_blogs();\n\n\t\t// Get the only one latest blog among all the categories.\n\t\t$data['latest_blog'] = $this->Blogs_model->get_latest_blog();\n\n\t\t// load the view\n\t\t$this->load->view('templates/header', $data);\n\t\t$this->load->view('blogs/home', $data);\n\t\t$this->load->view('templates/footer');\n\t}", "function set_homepage() {\n\tif($_SESSION['cgfirst']!=\"\"){\n\t\t$cgfirst=$_SESSION['cgfirst'];\n\t\t$cglast=$_SESSION['cglast'];\n\t\t$home = \"caregiverhome_v2.php\";\n\t}else{\n\t\t$cgfirst=$_SESSION['adminfirst'];\n\t\t$cglast=$_SESSION['adminlast'];\n\t\t$home = \"adminhome.php\";\n\t}\n}", "function homepage_display() {\n add_meta_box('shiba2_homepage', 'オプション', 'func_ishomepage', 'page', 'normal', 'default');\n}", "public function home()\n\t{\n\t\t\n\t\t$data = $this->data;\n\t\t$this->load->view('admin/index.php',$data);\n\t}", "public function index()\n {\n// $pageData = $this->_pageService->getPage(PageConstant::HOME_PAGE);\n return $this->renderView($this->getView('home.welcome'), [], 'Home');\n }", "public function index()\r\n {\r\n View::render('home');\r\n }", "public function homePage() {\n #$this->view->loadTemplate( 'elements_example');\n $this->view->loadTemplate( LNG . '/centercontent');\n $this->commitReplace($this->view->render(), '#two', true);\n }", "function home()\n {\n $data=$this->model->getProfes();\n $this->addData($data);\n //rebuilding with new data\n $this->view->__construct($this->dataView,$this->dataTable);\n $this->view->show();\n \t\t}", "public function goHome()\n {\n $this->redirect(url($this->getHomeUrl()));\n }", "public function home()\n\t{\n\t\treturn view('e_shop.landing');\n\t}" ]
[ "0.77371264", "0.7717973", "0.7572559", "0.7558468", "0.7551558", "0.7544596", "0.7533615", "0.75168365", "0.75090516", "0.7502538", "0.746737", "0.7438322", "0.74308497", "0.739617", "0.7382344", "0.73743004", "0.73552626", "0.7346734", "0.7296992", "0.72769505", "0.727096", "0.7264568", "0.72142375", "0.7190782", "0.717031", "0.7158243", "0.71403253", "0.7138136", "0.7137871", "0.71254283", "0.71211445", "0.71156836", "0.71078366", "0.7092849", "0.7077445", "0.70743316", "0.70693916", "0.70662224", "0.706499", "0.70638555", "0.7052838", "0.7032218", "0.70227855", "0.7021749", "0.7006566", "0.7001246", "0.6991828", "0.6977452", "0.6970995", "0.69257855", "0.69226295", "0.6916732", "0.69134164", "0.690821", "0.69018865", "0.68865466", "0.6880989", "0.6878665", "0.68730253", "0.6872871", "0.68670946", "0.6856643", "0.68474275", "0.68461436", "0.683743", "0.6835507", "0.68275106", "0.682646", "0.6821071", "0.6820064", "0.68102217", "0.681014", "0.68077636", "0.6801175", "0.6779325", "0.67731017", "0.6759548", "0.6754402", "0.6754402", "0.6747295", "0.6726977", "0.67262983", "0.6709182", "0.6699537", "0.66901845", "0.6686558", "0.6679919", "0.6667941", "0.6659854", "0.6646647", "0.66465753", "0.66370666", "0.66359645", "0.66339135", "0.662297", "0.66222423", "0.66121894", "0.6607702", "0.6592501", "0.6590323", "0.658373" ]
0.0
-1
Print a filter based on the given $templateFile which points to a Twig template
public function printFilter($templateFile= 'filterInTable.tpl'){ $template = Template::getTwig()->loadTemplate($templateFile); return $template->render( array( 'name' => $this->name, 'values' => $this->printValues() ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function twig_raw_filter($string)\n{\n return $string;\n}", "public function renderFile(Environment $twig): string;", "private function filterPHP($file) {\n ob_start();\n\n // The variable $template can be used in the script as $this is used here\n $template = $this;\n require $file;\n\n // Return the script's output\n return ob_get_clean();\n }", "public function render($templateFile, $twigLoaderFileSystem = './') \n {\n $output = '';\n\n if (! (file_exists($templateFile) && is_readable($templateFile)))\n throw new \\InvalidArgumentException(\"File '$templateFile' not exist or It isn't readable\", 1); \n\n $loader = new \\Twig_Loader_Filesystem($twigLoaderFileSystem); \n $twig = new \\Twig_Environment($loader);\n\n if (! empty($this->versions)) {\n ob_start();\n echo $twig->render($templateFile, array('versions' => $this->versions));\n $output = ob_get_contents();\n ob_end_clean();\n } \n\n return $output; \n }", "private function filterSmarty($file) {\n $smarty = SmartyWrapper::getInstance();\n\n // Set a few global template vars\n $smarty->assign('subtemplate', $this->output);\n $smarty->assign('pathclasses', $this->cfgReader->getPathClasses());\n $smarty->assign('cfg', $this->cfgReader->getResolved());\n\n // Return the template's output\n return $smarty->fetch($file);\n }", "public function filter_timber_twig_add_basic_filters( $twig ) {\n $function_names = [\n // PHP Functions\n 'addslashes', // http://php.net/manual/en/function.addslashes.php\n 'nl2br', // http://php.net/manual/en/function.nl2br.php\n\n // WordPress functions\n 'antispambot', // https://developer.wordpress.org/reference/functions/antispambot/\n 'esc_attr', // https://developer.wordpress.org/reference/functions/esc_attr/\n 'esc_html', // https://developer.wordpress.org/reference/functions/esc_html/\n 'esc_url', // https://developer.wordpress.org/reference/functions/esc_url/\n 'esc_js', // https://developer.wordpress.org/reference/functions/esc_js/\n 'esc_textarea', // https://developer.wordpress.org/reference/functions/esc_textarea/\n 'sanitize_email', // https://developer.wordpress.org/reference/functions/sanitize_email/\n ];\n foreach ( $function_names as $func ) {\n if ( function_exists( $func ) ) {\n $twig->addFilter( new \\Twig_SimpleFilter( $func, $func ) );\n }\n }\n return $twig;\n }", "public function print_template()\n {\n }", "public function print_template()\n {\n }", "function _preview_theme_template_filter()\n {\n }", "function twig_safe_filter($string)\n{\n return $string;\n}", "public final function print_template()\n {\n }", "function show_template() {\n\tglobal $template;\n\tprint_r($template);\n}", "function checkfront_comments_template_filter($file) {\n return dirname(__FILE__).'/xcomments.html';\n}", "public static function filter($tpl_source, $smarty) {\n \tif(strstr($tpl_source, \"{{sf_view\")===false && strstr($tpl_source, \"{sf_view\")===false) {\n \t\treturn $tpl_source;\n \t}\n\n $single_delim = !(strstr($tpl_source, \"{{sf_view\")!==false);\n\n if($single_delim) {\n $s = $tpl_source;\n $pattern=\"/\\{sf_view(.*)\\}/\";\n $replacement=\"<sf_view$1>\";\n $s = preg_replace($pattern, $replacement, $s);\n $s = str_replace(\"{/sf_view}\",\"</sf_view>\",$s);\n } else {\n $s = $tpl_source;\n $s = str_replace(\"{{\", \"<\", $s);\n $s = str_replace(\"}}\", \">\", $s);\n }\n\n if(property_exists($smarty, \"source\")) {\n\t $current_file = $smarty->source->filepath;\n\t $current_file = realpath($current_file);\n } else {\n $current_file = $smarty->compiler_object->template->resource_name;\n }\n $template_dir=SmartyFaces::resolvePath(SmartyFaces::$config['view_dir']);\n $file_name=str_replace($template_dir.DIRECTORY_SEPARATOR, \"\", $current_file);\n\n require_once(dirname(__FILE__).\"/FileUtils.php\");\n $subview_dir=SmartyFaces::resolvePath(SmartyFaces::$config['tmp_dir']).\"/subview\";\n if(!file_exists($subview_dir)) @mkdir($subview_dir,0777,true);\n $file = $subview_dir.DIRECTORY_SEPARATOR.$file_name;\n $file_dir = dirname($file);\n \n \t$files=FileUtils::getFilesFromDir($file_dir);\n \tforeach($files as $file){\n \t\tif(substr($file, -5)==\".view\"){\n \t\t\t@unlink($file);\n \t\t}\n \t}\n \t// clear sessions\n \t$state=SmartyFacesContext::getState();\n \tunset($state[$file_name]);\n \tSmartyFacesContext::setState($state);\n \n $create_file = str_replace($template_dir, \"\", $current_file);\n $create_file = $subview_dir.$create_file.\".source\";\n $dir=dirname($create_file);\n if(!file_exists($dir)) {\n\t @mkdir($dir,0777,true);\n }\n @file_put_contents($create_file, $s);\n \n return $tpl_source;\n }", "private function renderTemplate(){\n\t\trequire($this->TemplateFile);\n\t}", "function template( $file, $args ){\n if ( !file_exists( $file ) ) {\n return '';\n }\n // Make values in the associative array easier to access by extracting them\n if ( is_array( $args ) ){\n extract( $args );\n }\n // buffer the output (including the file is \"output\")\n ob_start();\n include $file;\n return ob_get_clean();\n }", "public function filterTemplateInclude($file)\n {\n $view = $this->fileFinder\n ->getPossibleViewNameFromPath($file = realpath($file));\n\n $view = trim($view, '\\\\/.');\n\n /** Gather data to be passed to view */\n $data = array_reduce(get_body_class(), function ($data, $class) use ($view, $file) {\n return apply_filters(\"sage/template/{$class}/data\", $data, $view, $file);\n }, []);\n\n $this->app['sage.view'] = $this->view->exists($view) ? $view : $file;\n $this->app['sage.data'] = $data;\n\n return get_template_directory() . '/index.php';\n }", "function twigRender($template_name, $data, $options) {\n $loader = new \\Twig_Loader_Filesystem(TERMINUS_ROOT . '/templates');\n $twig = new \\Twig_Environment($loader);\n $rendered_template = $twig->render(\n $template_name,\n array(\n 'data' => $data,\n 'template_name' => $template_name,\n 'options' => $options,\n )\n );\n return $rendered_template;\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 }", "function test_function_filter() {\n\t\t$var = new LiquidVariable('var | test_function_filter');\n\t\t$this->context->set('var', 1000);\n\t\t$this->context->add_filters('test_function_filter');\n\t\t$this->assertIdentical('worked', $var->render($this->context));\t\t\n\t\t\n\t}", "function show_template($template) {\n\treturn templates . '/' . $template . '.php';\n}", "function render_template($template, $settings) {\n $text = file_get_contents($template); \n $text = transform_text($text, $settings);\n return $text;\n }", "public function loadTemplate($file) {\n $file = FilesystemUtils::getFullPath($file, CONTENT_DIR);\n $type = FilesystemUtils::getFileExtension($file);\n\n switch ($type) {\n case 'tpl':\n // Smarty template\n $this->output = $this->filterSmarty($file);\n break;\n\n case 'md':\n // Static Markdown file\n $this->output = $this->filterMarkdown($file);\n break;\n\n case 'tplmd':\n // Smarty template, with the output run through the Markdown parser\n $this->output = $this->filterMarkdown($this->filterSmarty($file), TRUE);\n break;\n\n case 'php':\n // PHP script\n $this->output = $this->filterPHP($file);\n break;\n\n case 'html':\n default:\n // HTML or other unsupported file; passed through unchanged\n $this->output = file_get_contents($file);\n break;\n }\n }", "public function print_templates()\n {\n }", "public static function renderTemplate($template, $argumentos = array()) {\n \n if(self::$twig === null) {\n $loader = new \\Twig_Loader_Filesystem(VISTAS_PATH);\n self::$twig = new \\Twig_Environment($loader);\n }\n \n echo self::$twig->render($template, $argumentos);\n }", "public function provideTemplateTwigObjects(FilterControllerEvent $event)\n { $repository = $this->doctrine->getRepository('EMSCoreBundle:ContentType');\n $contentTypes = $repository->findBy([\n 'deleted' => false,\n// 'rootContentType' => true,\n ], [\n 'orderKey' => 'ASC'\n ]);\n\n $this->twig->addGlobal('contentTypes', $contentTypes);\n \n $envRepository = $this->doctrine->getRepository('EMSCoreBundle:Environment');\n $contentTypes = $envRepository->findBy([\n 'inDefaultSearch' => true,\n ]);\n \n $defaultEnvironments = [];\n foreach ($contentTypes as $contentType) {\n $defaultEnvironments[] = $contentType->getName();\n }\n\n $this->twig->addGlobal('defaultEnvironments', $defaultEnvironments);\n }", "function display_template($template) {\n\n $file_name = $template;\n\n if ( locate_template( $file_name ) ) :\n $template = locate_template( $file_name );\n else :\n $template = dirname( __FILE__ ) . '/../templates/' . $file_name;\n endif;\n\n if ( $template ) :\n load_template( $template, false );\n endif;\n}", "public function displayFile($template_name)\n\t{\n\t\t$this->render($template_name);\n\t\texit();\n\t}", "static protected function twig(string $template, array $arguments = [])\n {\n $loader = new \\Twig_Loader_Filesystem(__DIR__ . '/../../templates/');\n $twig = new \\Twig_Environment($loader, []);\n\n $app = [\n 'SESSION_USER' => $_SESSION['user'] ?? [],\n 'MESSAGES_ERREUR' => Message::show(),\n '_FRONT' => App::URL,\n 'SESSION' => $_SESSION\n ];\n\n $arguments = array_merge($arguments, $app);\n\n $twig->display($template, $arguments);\n }", "public function templateFile() {\n return $this->_templateFile($this->intendedTemplate());\n }", "public function parse($template, $defaultExtension = false): string\n {\n return $this->twigEnv->render($template . ($defaultExtension ? self::DEFAULT_EXTENSION : ''), $this->variables);\n }", "function guestbook_render_template($template_file, $variables) {\n // Extract the variables to a local namespace\n extract($variables, EXTR_SKIP);\n\n // Start output buffering\n ob_start();\n\n // Include the template file\n include GUESTBOOK_ROOT . '/' . $template_file;\n\n // End buffering and return its contents\n return ob_get_clean();\n}", "public function getTemplateFile();", "function visitTwigFile(\\SplFileInfo $file, MessageCatalogue $catalogue, \\Twig_Node $ast)\r\n {\r\n // TODO: Implement visitTwigFile() method.\r\n }", "public function renderTemplate();", "function twig_template(string $source): \\Twig\\TemplateWrapper\n{\n global $twig_env_html;\n return $twig_env_html->createTemplate(macro_convert($source));\n}", "public function processTemplateFromFileProcessesTemplateFromFile() {\n\t\t$this->subject->processTemplateFromFile(\n\t\t\t'EXT:oelib/Tests/Unit/Fixtures/oelib.html'\n\t\t);\n\n\t\t$this->assertSame(\n\t\t\t'Hello world!' . LF,\n\t\t\t$this->subject->render()\n\t\t);\n\t}", "function add_to_twig($twig){\n\t\t$twig->addExtension(new Twig_Extension_StringLoader());\n\t\t// $twig->addFilter('myfoo', new Twig_Filter_Function('myfoo'));\n\t\treturn $twig;\n\t}", "public function onPageRendering(Twig_Environment &$twig, array &$twigVariables, &$templateName)\n {\n $templateNameInfo = pathinfo($templateName) + array('extension' => '');\n\n // the template name hasn't had a file extension in API v0\n $templateName = $templateNameInfo['filename'];\n\n $this->triggerEvent('before_render', array(&$twigVariables, &$twig, &$templateName));\n\n // recover original file extension\n // we assume that all templates of a theme use the same file extension\n $templateName = $templateName . '.' . $templateNameInfo['extension'];\n }", "function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}", "function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}", "function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}", "public function testRenderTemplate() {\n\t\t$this->View->set(['aVariable' => 123]);\n\t\t$result = $this->View->render('simple');\n\t\t$expected = \"The value of aVariable is: 123.\\n\";\n\n\t\t$this->assertSame($expected, $result, 'variables in Twig tags should be evaluated');\n\t}", "public function filter_timber_twig_add_functions( $twig ) {\n // Function to check if doing email and alternate strings\n $twig->addFunction( new \\Twig_SimpleFunction( 'if_email', function( $email_str, $standard_str ) {\n if ( $this->is_email() ) {\n return $email_str;\n }\n return $standard_str;\n } ) );\n\n // Get the current Unix epoch time in milliseconds\n $twig->addFunction( new \\Twig_SimpleFunction( 'now', function() {\n return round( microtime( true ) * 1000 );\n } ) );\n\n // Add WordPress' checked() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'checked', function( $checked, $current = true ) {\n return checked( $checked, $current );\n } ) );\n\n // Add WordPress' selected() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'selected', function( $selected, $current = true ) {\n return selected( $selected, $current );\n } ) );\n\n // Add WordPress' disabled() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'disabled', function( $disabled, $current = true ) {\n return disabled( $disabled, $current );\n } ) );\n\n return $twig;\n }", "private function addTwigFunctions() : void {\n\t\t$msgFunc = new Twig_SimpleFunction( 'msg', function ( $key, $params = [] ) {\n\t\t\t$params = is_array( $params ) ? $params : [];\n\t\t\treturn $this->i18n->msg(\n\t\t\t\t$key, [ 'domain' => 'popular-pages', 'variables' => $params ]\n\t\t\t);\n\t\t} );\n\t\t$this->twig->addFunction( $msgFunc );\n\n\t\t// Fetching assessments info, case-insensitive.\n\t\t$assessmentFunc = new Twig_SimpleFunction(\n\t\t\t'assessments', function (\n\t\t\t\tstring $type, string $value\n\t\t\t) {\n\t\t\t\t$dataset = $this->api->getAssessmentConfig()[$type];\n\t\t\t\tforeach ( $dataset as $key => $values ) {\n\t\t\t\t\tif ( strtolower( $value ) === strtolower( $key ) ) {\n\t\t\t\t\t\treturn $values;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $dataset['Unknown'];\n\t\t\t} );\n\t\t$this->twig->addFunction( $assessmentFunc );\n\n\t\t// Add ucfirst() (Twig's capitalize() will make the other chars lowercase).\n\t\t$ucfirstFunc = new Twig_SimpleFilter( 'ucfirst', function ( string $value ) {\n\t\t\treturn ucfirst( $value );\n\t\t} );\n\t\t$this->twig->addFilter( $ucfirstFunc );\n\t}", "public static function renderTemplate()\n {\n echo self::$template;\n }", "static function render($twig,$templatePath,$content)\n {\n\n $template = $twig->loadTemplate($templatePath);\n echo $template->render($content);\n return false;\n }", "protected function renderDebug($file, $arrVars)\n {\n $loader = new \\Twig_Loader_Filesystem(__DIR__ . \"/../Resources/views\");\n $env = new \\Twig_Environment($loader);\n\n $template = $env->loadTemplate($file);\n echo $template->render($arrVars);\n }", "function add_to_twig( $twig ) {\n\t\t// $twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t// $twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}", "public function setTemplate($file);", "function parseTemplateText()\r\n\t{\r\n\t\t$buf = '';\r\n\t\t// we only need this if we are going to use JSP tags for wrapping\r\n\t\t// scriptlet blocks\r\n\t\t//if ($this->reader->matches('<' . '\\\\%'))\r\n\t\t//{\r\n\t\t//\t$buf .= '<' . '%';\r\n\t\t//}\r\n\r\n\t\t$buf .= $this->reader->nextContent();\r\n\r\n\t\t// don't output meaningless whitespace\r\n\t\tif (trim($buf) == '')\r\n\t\t{\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\telseif ($this->ctxt->options->isElIgnored() || strpos($buf, '${') === false)\r\n\t\t{\r\n\t\t\treturn $buf;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn '<?php echo $pageContext->evaluateTemplateText(' . StringUtils::quote($buf) . ');?>';\r\n\t\t}\r\n\t}", "function bp_gtm_load_template_filter($found_template, $templates) {\n global $bp;\n\n if ($bp->current_action == $bp->gtm->slug || $bp->current_component == $bp->gtm->slug) {\n foreach ((array) $templates as $template) {\n $path = is_child_theme() ? TEMPLATEPATH : STYLESHEETPATH; // different path to themes files\n if (file_exists($path . '/' . $template)) {\n $filtered_templates[] = $path . '/' . $template;\n } else if (file_exists(STYLESHEETPATH . '/gtm/' . $template)) {\n $filtered_templates[] = STYLESHEETPATH . '/gtm/' . $template;\n } else {\n if (($position = strpos($template, '/')) !== false)\n $template = substr($template, $position + 1);\n $filtered_templates[] = plugin_dir_path(__FILE__) . 'templates/gtm/' . $template;\n }\n }\n $found_template = $filtered_templates[0];\n\n return apply_filters('bp_gtm_load_template_filter', $found_template);\n } else {\n return $found_template;\n }\n}", "public function run()\n {\n $this->runAction();\n\n $this->view->setTemplate($this->request->getRequestedResource() . DIRECTORY_SEPARATOR . $this->getTemplateName() . '.twig');\n }", "private function render_template() {\n\t\t$template = $this->template;\n\n\t\tif ( ! is_readable( $template ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tinclude $template;\n\t}", "public function render(string $sourceFile, array $variables = []): string\n {\n $sourceFile = realpath($sourceFile);\n\n if (! is_file($sourceFile)) {\n throw new \\InvalidArgumentException(\"Unable to render template : `$sourceFile` because this file does not exist\");\n }\n // We'll evaluate the contents of the view inside a try/catch block so we can\n // flush out any stray output that might get out before an error occurs or\n // an exception is thrown. This prevents any partial views from leaking.\n try {\n ob_start();\n call_user_func(function () {\n extract(func_get_arg(0), EXTR_OVERWRITE); // EXTR_SKIP\n include func_get_arg(1);\n }, $variables, $sourceFile);\n $content = ob_get_clean();\n } catch (\\Throwable $e) {\n ob_end_clean();\n\n throw $e;\n }\n\n return $content;\n }", "function Generate($template)\n {\n $template = RtfStripTags($template);\n $parts = FieldExplode($template,\"<part>\",\"</part>\");\n $partslist = \"\"; \n\n for ($i = 1; $i < count($parts); $i += 2)\n {\n $part = $parts[$i];\n $source = strtolower(RtfStrip($this->RtfField($part,\"source\")));\n\n if ($source == '')\n {\n $field = strtolower(RtfStrip($part));\n $parts[$i] = $this->PrepareHtml(\"<part>$field</part>\");\n $this->debugtext .= \"field=$field<br/>\\n\";\n }\n else if (array_key_exists($source,$this->fielddata))\n {\n $partslist = \"$part<default></default>$partslist\";\n $parts[$i] = $this->RtfSubst($partslist,$source);\n \n if (!RtfIsValid('{'.$parts[$i].'}'))\n die(\"RTF invalid source=$source rtf=$parts[$i]\");\n }\n else\n {\n $parts[$i] = \"{\\\\b !!$source!!}\";\n $this->debugtext .= \"Invalid field $source<br/>\\n\";\n } \n }\n\n $parts = FieldExplode(FieldImplode($parts),\"INCLUDEPICTURE \",\"\\\\\\\\d\");\n for ($i = 1; $i < count($parts); $i += 2)\n $parts[$i] = \"INCLUDEPICTURE \" . $parts[$i];\n \n SetField($this->con,'debug',addslashes($this->debugtext),'Debug');\n \n return FieldImplode($parts);\n }", "function templateFile() {\n return 'CRM/Press/Form/Search/CRM/Muntpunt/PressSearch.tpl';\n }", "public function renderTwig($page='index.html', $array=array()){\r\n\t\t$array['curUser'] = self::$user->fields;\r\n\t\techo self::$twig->render($page, $array);\r\n\t}", "public function render($file);", "protected function getTwigFilters()\n\t{\n\t\t$filters = [];\n\n\t\t// rex_i18n::translate\n\t\t$filters[] = new Twig_SimpleFilter('translate', function ($string) {\n \t\treturn rex_i18n::translate($string);\n\t\t});\n\n\t\t// rex_i18n::msg\n\t\t$filters[] = new Twig_SimpleFilter('msg', function ($string, array $arguments = []) {\n\t\t\treturn call_user_func_array(array('rex_i18n', 'msg'), array_merge(array($string), $arguments));\n\t\t}, array('is_variadic' => true));\n\n\t\t// any rexXXX::getYYY() method\n\t\t$filters[] = new Twig_SimpleFilter('get*', function ($name, $class = null) {\n\t\t\t$method = 'get' . $name;\n\n\t\t\tif(is_object($class) && substr(get_class($class), 0, 3) == 'rex')\n\t\t\t{\n\t\t\t\tif(method_exists($class, $method))\n\t\t\t\t{\n\t\t\t\t\t$arguments = func_get_args() > 2 ? array_slice(func_get_args(), 2) : [];\n\n\t\t\t\t\treturn call_user_func_array(array($class, $method), $arguments);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t});\n\n\t\t// any rexXXX::hasYYY() method\n\t\t$filters[] = new Twig_SimpleFilter('has*', function ($name, $class = null) {\n\t\t\t$method = 'has' . $name;\n\n\t\t\tif(is_object($class) && substr(get_class($class), 0, 3) == 'rex')\n\t\t\t{\n\t\t\t\tif(method_exists($class, $method))\n\t\t\t\t{\n\t\t\t\t\t$arguments = func_get_args() > 2 ? array_slice(func_get_args(), 2) : [];\n\n\t\t\t\t\treturn call_user_func_array(array($class, $method), $arguments);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t});\n\n\t\treturn array_merge($filters, $this->twig_filter);\n\t}", "function dunkdog_template_filter( $template_path ) { \n\tif(is_search()){\n\t\treturn $template_path;\n\t}\n\n\t$type = get_post_type(); \n if ( ( $type == 'dd-player' ) || ( $type == 'dd-team' ) || ( $type == 'dd-player-ranking' ) || ($type == 'dd-team-ranking' ) ){\n if ( is_single() ) {\n \t$prefix = 'single';\n }\n if ( is_archive()){\n \t$prefix = 'archive';\n }\n if ( is_tax()){\n \t$prefix = 'taxonomy';\n\n \t// if(get_query_var('taxonomy')=='dd-conference'){\n \t// \t$type = 'dd-team';\n \t// }else{\n \t\t$type = 'dd-player'; // forcing tax to be player; no other need for team or ranking taxonomy\n \t// }\n }\n\n $template_path = dunkdog_template_function($prefix . '-' . $type, false);\n \n }\n \n if(DD_DEBUG){global $wp_query; krumo('template_path', $template_path, $prefix, $type, $wp_query);}\n\treturn $template_path;\n}", "public function listTemplates($templatefilter) {\n\t\t$data = array (\n\t\t\t\t\"apiKey\" => $this->apiKey,\n\t\t\t\t\"command\" => \"listTemplates\",\n\t\t\t\t\"response\" => \"json\",\n\t\t\t\t\"templatefilter\" => $templatefilter\n\t\t);\n\t\t$url = $this->getSignatureUrl ( $data );\n\t\treturn $this->curlGet ( $url );\n\t}", "public function render($template)\n {\n $filter = $this->escape;\n $delims = $this->delimiters();\n\n // The substitution handler:\n $callback = function ($matches) use ($filter) {\n $key = trim($matches[1]);\n if (substr($key, 0, 1) == '&') {\n $key = trim(substr($key, 1));\n $content = $this->node($key)->toString();\n } else {\n $content = $filter($this->node($key)->toString());\n }\n return $content;\n };\n\n // Substitute the template\n $start = preg_quote($delims[0]);\n $end = preg_quote($delims[1]);\n $content = preg_replace_callback(\"/{$start}(.+?){$end}/s\", $callback, (string) $template);\n\n return $content;\n }", "public function renderTwig($config = false, $template = false, $templatePath = false)\n {\n $template = $template ? $template : $this->config['template'];\n $templatePath = $templatePath ? $templatePath : $this->config['template_path'];\n $config = $config ? $config : $this->config;\n\n // Loading and Rendering Twig\n $loader = new \\Twig_Loader_Filesystem($templatePath); \n $twig = new \\Twig_Environment($loader);\n $template = $twig->loadTemplate($template);\n\n return $template->render($config);\n }", "static private function render($file, $data){\n extract($data);\n // Extract data retreived from the Sharer\n if(Sharer::get() !== null){\n extract(Sharer::get());\n }\n\n // Merge data into the hive\n self::$hive = array_merge(self::$hive, get_defined_vars());\n unset($data);\n\n ob_start();\n include($file);\n $input = ob_get_contents();\n ob_end_clean();\n\n $output = preg_replace_callback('!\\{\\{(.*?)\\}\\}!', 'Viewer::replace', $input);\n\n\n echo($output);\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 }", "protected function _parseTemplate() {}", "function display(string $template, int $status = 200, array $headers = [])\n{\n $content = app('twig')->render('templates' . DS . $template);\n response($content, $status, $headers);\n}", "public function render($template)\n {\n $charset = $this->getCharset();\n $contentType = $this->getContentType();\n\n header('Content-Type: '.$contentType.'; charset='.$charset);\n\n // first see if what we've been given is a file\n $templateFile = $this->getViewDir().'/'.$template.'.php';\n\n // run through our properties and filter\n foreach ($this->_properties as $index => $value) {\n $this->_properties[$index] = $this->filter->filter($index,$value);\n }\n\n if (is_file($templateFile)) {\n\n // scope in the tempate extraction\n $result = function($file,array $data=array()) {\n ob_start();\n extract($data, EXTR_SKIP);\n try {\n include $file;\n } catch(\\Exception $e) {\n ob_end_clean();\n throw $e;\n }\n return ob_get_clean();\n };\n\n return $result($templateFile, $this->_properties);\n\n } else {\n // it's just a string! fall back on str_replace\n foreach ($this->_properties as $name => $value) {\n $template = str_replace('['.$name.']', $value, $template);\n }\n\n // replace any leftovers\n $template = preg_replace('#\\[.*?\\]#', '', $template);\n return $template;\n }\n }", "function display ( $template, $data = array() ) {\r\n $template = $this->_twig->loadTemplate( $template );\r\n\r\n // elapsed_time and memory_usage\r\n $data[ 'elapsed_time' ] = $this->CI->benchmark->elapsed_time( 'total_execution_time_start', 'total_execution_time_end' );\r\n $memory = ( !function_exists( 'memory_get_usage' ) ) ? '0' : round( memory_get_usage() / 1024 / 1024, 2 ) . 'MB';\r\n $data[ 'memory_usage' ] = $memory;\r\n $template->display( $data );\r\n }", "public function render(string $template, array $scope = []): string\n {\n $path = sprintf(\"%s/%s/%s.php\", $this->path, $this->mode, $template);\n if (!is_file($path)) {\n throw new InvalidArgumentException(sprintf(\n \"Template \\\"%s\\\" not found\",\n sprintf(\"%s/%s.php\", $this->mode, $template)\n ));\n }\n if (!is_readable($path)) {\n throw new RuntimeException(sprintf(\n \"Template \\\"%s\\\" not readable\",\n sprintf(\"%s/%s.php\", $this->mode, $template)\n ));\n }\n ob_start();\n require $path;\n $rendered = ob_get_contents();\n ob_end_clean();\n\n return $rendered;\n }", "public function render()\n\t{\n\t\tif ($this->file == null) { // intentionally ==\n\t\t\tthrow new Nette\\InvalidStateException('Template file name was not specified.');\n\t\t}\n\n\t\tif (!$this->getFilters()) {\n\t\t\t$this->onPrepareFilters($this);\n\t\t}\n\n\t\tif ($latte = $this->getLatte()) {\n\t\t\treturn $latte->setLoader(new Latte\\Loaders\\FileLoader)->render($this->file, $this->getParameters());\n\t\t}\n\n\t\t$cache = new Caching\\Cache($storage = $this->getCacheStorage(), 'Nette.FileTemplate');\n\t\tif ($storage instanceof Caching\\Storages\\PhpFileStorage) {\n\t\t\t$storage->hint = str_replace(dirname(dirname($this->file)), '', $this->file);\n\t\t}\n\t\t$cached = $compiled = $cache->load($this->file);\n\n\t\tif ($compiled === null) {\n\t\t\ttry {\n\t\t\t\t$compiled = \"<?php\\n\\n// source file: $this->file\\n\\n?>\" . $this->compile();\n\n\t\t\t} catch (CompileException $e) {\n\t\t\t\tthrow $e->setSource(file_get_contents($this->file), $e->sourceLine, $this->file);\n\t\t\t}\n\n\t\t\t$cache->save($this->file, $compiled, array(\n\t\t\t\tCaching\\Cache::FILES => $this->file,\n\t\t\t\tCaching\\Cache::CONSTS => 'Nette\\Framework::REVISION',\n\t\t\t));\n\t\t\t$cached = $cache->load($this->file);\n\t\t}\n\n\t\t$isFile = $cached !== null && $storage instanceof Caching\\Storages\\PhpFileStorage;\n\t\tself::load($isFile ? $cached['file'] : $compiled, $this->getParameters(), $isFile);\n\t}", "private static function _render (string $template, array $data) : string {\n\t\tself::$request_uri = $template;\n\n\t\tself::$controller->template ()->default_filter = 'Wires::filter';\n\t\t$out = self::$controller->template ()->render ($template, $data);\n\t\tself::$controller->template ()->default_filter = 'Template::sanitize';\n\n\t\t$out .= self::_setup ($data);\n\n\t\treturn $out;\n\t}", "function templateFile() {\n return 'CRM/Contact/Form/Search/Custom.tpl';\n }", "function templateFile() {\n return 'CRM/Contact/Form/Search/Custom.tpl';\n }", "function ks_acf_template_filter_setting($field) {\n acf_render_field_setting($field, array(\n 'label'\t=> 'Filter by Page Template',\n 'name' => 'filter_template',\n 'type' => 'select',\n 'choices' => array_flip(get_page_templates()),\n 'multiple' => 1,\n 'ui' => 1,\n 'allow_null' => 1,\n 'placeholder' => 'All page templates'\n ));\n}", "function customize_themes_print_templates()\n {\n }", "public function actionGetTemplate(){\n $post = Yii::$app->getRequest()->post();\n echo file_get_contents(dirname(\\Yii::getAlias('@webroot')).'/frontend/views/templates/'.$post['template']);\n }", "function getRenderedTemplate($file,$data=array())\n {\n $this->compile($file);\n ob_start();\n extract($data);\n include $this->getCompiledTemplate();\n $ret = ob_get_contents();\n ob_end_clean();\n \n return $ret;\n }", "protected function display($templateData) {\n }", "public function template();", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "public function twig_filter_fcache()\n\t{\n\t\treturn new \\Twig_SimpleFilter('fcache', function ($string)\n\t\t{\n\t\t\tif(file_exists($string))\n\t\t\t{\n\t\t\t\treturn $string.'?'.filemtime($string);\n\t\t\t}\n\t\t});\n\t}", "public function render()\n {\n $page = $this->twig->load($this->template);\n $this->prepareFlashMessages();\n $html = $page->render($this->vars);\n Router::sendResponse($html);\n }", "public function view_project_template( $template ) {\n\n global $post;\n\n if ( !isset( $post ) ) return $template;\n\n if ( ! isset( $this->templates[ get_post_meta( $post->ID, '_wp_page_template', true ) ] ) ) {\n return $template;\n } // end if\n\n $template_loader = new Uou_Atmf_Load_Template();\n\n if( is_page_template( 'atmf-search.php' ) ){\n $file = $template_loader->locate_template( 'atmf-search.php' );\n }\n\n\n // $file = plugin_dir_path( __FILE__ ) . 'templates/' . get_post_meta( $post->ID, '_wp_page_template', true );\n\n if( file_exists( $file ) ) {\n return $file;\n } // end if\n\n return $template;\n\n }", "public function run ()\n\t{\n\t\t$dump = template::dump ();\n\n\t\t$head = '';\n\t\tforeach ( $dump ['css'] as $file )\n\t\t{\n\t\t\t$head .= $this->twig->render ( 'system/html/web/snippets/css.twig', [ 'file' => $file, 'defer' => substr ( $file, 0, 2 ) == '//' ] );\n\t\t}\n\n\t\tforeach ( $dump ['js'] as $file )\n\t\t{\n\t\t\t$head .= $this->twig->render ( 'system/html/web/snippets/js.twig', [ 'file' => $file, 'defer' => substr ( $file, 0, 2 ) == '//' ] );\n\t\t}\n\n\t\t$body = '';\n\t\tforeach ( $dump ['templates'] as $template )\n\t\t{\n\t\t\t$body .= $this->twig->render ( $template ['path'], $template ['environment'] );\n\t\t}\n\n\t\t// We do not use die incase some modules need to run after the layout have been generated\n\t\techo $this->twig->render ('system/html/web/base.twig', [\n\t\t\t'head' => $head,\n\t\t\t'body' => $body\n\t\t] );\n\t}", "public function getTemplate()\n {\n return 'Components/renderRapport.html.twig';\n }", "public function display($templateFile='',$charset='',$contentType='',$content='',$prefix='') {\n G('viewStartTime');\n // View of the start tag\n tag('view_begin',$templateFile);\n // Parse and get the template content\n $content = $this->fetch($templateFile,$content,$prefix);\n // Output template content\n $this->render($content,$charset,$contentType);\n // View closing tag\n tag('view_end');\n }", "function read_template_file (){\n\n\t// Generate an error if the template file does not exist and return 'false'.\n if (! file_exists($this->template_file)) {\n print 'Template file does not exist: ['.$this->template_file.']';\n\t return false;\n }\n\t// We use templates and the template file exists\n\t// Capture the template, this way we can use php code inside templates\n\t\n\t$this->start_capture (); // Start capture to buffer\n\trequire $this->template_file; // Includes the template, this way php code can be used in templates\n\t$this->stop_capture ('template_html');\n\treturn true;\n }", "public function view_project_template($template) {\r\n global $post;\r\n \r\n if( !isset($post->ID) \r\n\t\t\t|| !isset($this->templates[get_post_meta($post->ID, '_wp_page_template', TRUE)]) )\r\n return $template;\r\n \r\n $file = plugin_dir_path(__FILE__) . get_post_meta($post->ID, '_wp_page_template', TRUE);\r\n \r\n // Just to be safe, we check if the file exist first\r\n if (file_exists($file))\r\n return $file;\r\n else\r\n echo $file;\r\n \r\n return $template;\r\n }", "public static function renderTemplate($template,$args = array())\n {\n // append logged in as a default parameter for the array.\n $logged_in = Misc::checkUserLoggedIn();\n\n if ($logged_in) {\n $logged_in = true;\n } else {\n $logged_in = false;\n }\n\n $args[\"logged_in\"] = $logged_in;\n array_push($args,$logged_in);\n\n static $twig = NULL;\n\n if ($twig === NULL) {\n $loader = new \\Twig_Loader_Filesystem(\"../application/views\");\n $twig = new \\Twig_Environment($loader);\n }\n\n echo $twig->render($template,$args);\n }", "function render( $template_name ) {\n\tglobal $context;\n\tTimber::render( 'resources/views/components/' . $template_name . '.twig', $context );\n\t$context['fields'] = [];\n}", "function template_path($file, $data = [])\n{\n return sage('blade')->compiledPath($file, $data);\n}", "function template_path($file, $data = [])\n{\n return sage('blade')->compiledPath($file, $data);\n}", "public function renderTwigFile($template, $target, array $parameters, $sourceDir)\n {\n if (!is_dir(dirname($target))) {\n mkdir(dirname($target), 0777, true);\n }\n\n return file_put_contents($target, $this->renderTwig($template, $parameters, $sourceDir));\n }", "function default_template_filter_active_name()\r\n{\r\n $template = '{foreach from=$element_list item=element}\n{if $element[\"filter\"][\"is_active\"] == 1}\n{foreach from=$element[\"filter\"][\"values_attribute\"] item=value}\r\n{if $value[\"val\"] == 1}\n{$element[\"filter\"][\"name_attribute\"]} {$value[\"name\"]}\n{/if}\n{/foreach}\r\n{/if}\n{/foreach}';\n\n\t$template = str_replace(\"\\r\\n\", \"\", $template);\r\n\t$template = str_replace(\"\\n\", \"\", $template);\n\t\r\n return $template;\r\n}", "public function view(string $template, array $data = []): string\n {\n\n return $this->twig->render($template, $data);\n }" ]
[ "0.6113867", "0.6056232", "0.5937417", "0.5924085", "0.59157926", "0.57483596", "0.56511116", "0.56497365", "0.5554979", "0.55074346", "0.5492174", "0.5479007", "0.53762245", "0.5374541", "0.5355738", "0.5327672", "0.5319593", "0.53074265", "0.530409", "0.529241", "0.52806795", "0.52728355", "0.52728224", "0.5269027", "0.5259385", "0.5246004", "0.5243083", "0.5236526", "0.52345926", "0.5229385", "0.51985836", "0.5190977", "0.5188769", "0.5188338", "0.5185905", "0.5176684", "0.51695937", "0.5156501", "0.5156487", "0.51515144", "0.51515144", "0.51515144", "0.51422834", "0.5127717", "0.5115593", "0.51095057", "0.51031244", "0.50909144", "0.5088567", "0.5078361", "0.5074728", "0.5072011", "0.5069953", "0.50557905", "0.50483066", "0.5036954", "0.5020854", "0.5012849", "0.50076646", "0.5007268", "0.49929893", "0.49849373", "0.496613", "0.4955475", "0.49489033", "0.49482742", "0.4945472", "0.49448743", "0.49379045", "0.49327353", "0.49314377", "0.49290442", "0.49285975", "0.4927263", "0.4927263", "0.49255872", "0.49227124", "0.49200112", "0.49181414", "0.49177617", "0.49090543", "0.49032807", "0.49005213", "0.49005213", "0.49005213", "0.49000368", "0.489237", "0.48895577", "0.4884405", "0.4882505", "0.4877299", "0.48755237", "0.48725963", "0.48712313", "0.48704025", "0.4858618", "0.4858618", "0.48577365", "0.4855252", "0.48517475" ]
0.76564646
0
Create where statement by the given value which depends on the implementor class. It can be a valueId, or the given value.
public function createWhere($value) { return $this->createWhereByValue( $this->findValueById($valueId) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createWhereByValue($value){\n $filterDbOfValue = $value->getFilterDB();\n if(is_null($filterDbOfValue)){\n $filterDbOfValue = $this->id .\"='\".$value->getId().\"'\";\n }\n return $filterDbOfValue;\n }", "public function createWhere($valueId){\n return $this->createWhereByValue( $this->findValueById($valueId) );\n }", "public function where($key, $operatorOrValue, $value=null);", "public function where($field, $value, $comparison = '==', $logical = 'and');", "public function where($field, $value) {\n\t$this->parseQuery->where($field, $value);\n }", "public function where($field, $operator, $value);", "public static function where($column, $value, $operator = '=');", "public function findBy($value);", "public function where($column, $operator, $value);", "public function where($clause, $value = null, $type = PDO::PARAM_STR)\n\t{\n\t\t$this->wheres[] = array(\n\t\t\t'clause' => $clause,\n\t\t\t'value' => $value,\n\t\t\t'type' => $type\n\t\t);\n\t}", "public function whereName($value) {\n return $this->addSearchParam('searchFor', $value);\n }", "public function where(string $key, $value);", "function value2sqlWhere( $type, $value )\n\t\t{\n\t\tif( $type == \"VARCHAR\" || $type == \"varchar\" || $type == \"char\" )\n\t\t\t{\n\t\t\tif( $value == \"\") return \" is null\" ;\n\t\t\treturn \"='\" . $value . \"'\" ;\n\t\t\t}\n\t\telse if( $type == \"DATETIME\" )\n\t\t\t{\n\t\t\tif( $value == \"\") return \" is null\" ;\n\t\t\treturn \"=#\" . $value . \"#\" ;\n\t\t\t}\n\t\treturn \"=\".$value ;\n\t\t}", "public function where($column, $value, $operator = '=')\n {\n }", "public function findWhere(String $column, $value, String $operator = '=');", "public function where($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "public function whereOr($value) {\n\t$this->parseQuery->where('$or', $value);\n }", "public function val( string $value, string $valueType = self::VAL_TYPE_SQL ): WhereCondition\n {\n\n $this->_val = $value;\n $this->_valType = $valueType;\n\n return $this;\n\n }", "final public static function where($field = '', $operator = '', $value = '', bool $valueIsFunction = false)\n {\n //add the condition\n if ($field == '' || $operator == '' || $value == '') {\n self::$query .= (self::$where == false ? ' WHERE ' : '');\n } else {\n if (!$valueIsFunction)\n self::$bindParams[] = [$field => $value];\n\n self::$query .= (self::$where == false ? ' WHERE ' : '') . $field . ' ' . $operator . ' ' . ($valueIsFunction ? $value : self::prepareBind([$field], true));\n }\n if (self::$where == false) {\n self::$where = true;\n }\n\n return (new static);\n }", "public function findOneBy($column, $value, array $where = array());", "public function andWhereEq($name,$value)\r\n {\r\n $qb = $this;\r\n \r\n // Handle array\r\n if (is_array($value))\r\n {\r\n // Filter empty\r\n if (!count($value)) return;\r\n \r\n // Use IN, assume for now array contains scaler values\r\n if (count($value) > 1)\r\n {\r\n return $qb->andWhere($qb->expr()->in($name, $value));\r\n }\r\n $value = array_shift($value); //$value[0];\r\n }\r\n // Just a plain old scaler\r\n if (is_object($value)) $value = $value->getId();\r\n \r\n return $qb->andWhere($qb->expr()->eq($name,$qb->expr()->literal($value)));\r\n }", "public function isValue(): WhereCondition\n {\n\n $this->_op = self::OP_TYPE_IS;\n\n return $this;\n\n }", "public function find_by($field = null, $value = null, $type = 'and')\n {\n\n return parent::find_by($field, $value, $type);\n }", "protected function user_where_clause() {}", "public function Where($key, $value)\n {\n $this->where = \"WHERE $key = '$value'\";\n }", "public static function whereEqualValue($parameter, $value);", "public function where( array $value )\n {\n $this->query('where', $value);\n }", "public function where(string $column, string $operator, $value, string $type = null)\n {\n $type = (!isset($type)) ? \"basic\" : $type;\n\n /**\n * If the last method call is the \"not\" method\n * then toggle the not variable to true and remove\n * the call from the call stack.\n */\n $not = (!empty($this->not)) ? array_pop($this->not) : null;\n\n /**\n * If it is not the first where statement and no and(), or() method\n * was called right before this call then the logic operator will be AND\n * Else pop the first item from the queue of the logic operators.\n */\n if (!empty($this->where) && $this->logicQueue == null) {\n $this->logicQueue = 'and';\n }\n\n $logic = (empty($this->where)) ? null : $this->logicQueue;\n\n /**\n * If the value passed is an array traverse each element \n * Then pass the contents of the array to the parameters and\n * call the syntax method to build the query of the operation.\n */\n if (is_array($value)) {\n /**\n * check if any element of the array is a Builder instance\n * and unpack its contents.\n */\n $prepared_values = array_map(\n function ($value) {\n \n if ($value instanceof Builder) {\n $this->parameters = array_merge($this->parameters, $value->getParameters());\n return \"(\".$this->syntax->selectSyntax(get_object_vars($value)).\")\";\n }\n \n array_push($this->parameters, $value);\n return \"?\";\n },\n $value\n );\n $this->{\"where\".ucfirst($type)}($column, $not, $operator, $prepared_values, $type, $logic);\n return $this;\n }\n\n /**\n * If the value is an instance of Builder class\n * unpack its contents and call the syntax method to build\n * the query of the operation and then pass the parameters property\n * of the Builder object to the parameters array.\n */\n if ($value instanceof Builder) {\n $this->{\"where\".ucfirst($type)}($column, $not, $operator, \"(\".$this->syntax->selectSyntax(get_object_vars($value)).\")\", $type, $logic);\n $this->parameters = array_merge($this->parameters, $value->getParameters());\n return $this;\n }\n\n /**\n * If the value is a scalar variable then call the syntax method\n * to build the query of the operation and pass the value to the parameters.\n */\n $this->whereBasic($column, $not, $operator, \"?\", $type, $logic);\n array_push($this->parameters, $value);\n\n $this->logicQueue = null;\n\n return $this;\n }", "public function findBy($field, $value);", "public function where($field, $value, $operand = '=', $logic = 'AND', $valueType = 'int', $new = false) {\n if ($new) {\n $this->clearWhere();\n }\n\n switch ($valueType) {\n case 'string':\n $val = \"'{$value}'\";\n $f = $field;\n break;\n case 'date':\n $val = \"'{$value}'\";\n $f = \"DATE_FORMAT({$field}, '%Y-%m-%d')\";\n break;\n case 'datetime':\n $val = \"'{$value}'\";\n $f = \"DATE_FORMAT({$field}, '%Y-%m-%dT%TZ')\";\n break;\n case 'int':\n default:\n $val = $value;\n $f = $field;\n break;\n }\n $v = (strtolower($operand) == 'in' || strtolower($operand) == 'not in') ? '(\"' . implode('\",\"', $value) . '\")' : $val;\n $this->where = (empty($this->where)) ? \" WHERE {$f} {$operand} {$v}\" : $this->where . \" {$logic} {$f} {$operand} {$v}\";\n return $this;\n }", "public function whereEqualTo($field, $value) {\n\t$this->parseQuery->whereEqualTo($field, $value);\n }", "public function setViaTableCondition($value);", "public static function equal(string $field, $value): Where {\n $w = new Where();\n\n $w->addFilter($field, Where::OperatorEq, $value);\n\n return $w;\n }", "public function findBy($value, $field = 'id')\n {\n return call_user_func_array([$this->modelClass, 'where'], [$field, $value])->first();\n }", "public function where($column, $operator = null, $value = null, $connector = 'AND')\n\t{\n\t\t// If a Closure is passed into the method, it means a nested where\n\t\t// clause is being initiated, so we will take a different course\n\t\t// of action than when the statement is just a simple where.\n\t\tif ($column instanceof \\Closure)\n\t\t{\n\t\t\treturn $this->whereNested($column, $connector);\n\t\t}\n\n\t\t// If passing an expression, it means we are actually doing a Raw where\n\t\tif ($column instanceof Expression)\n\t\t{\n\t\t\treturn $this->rawWhere($column->get(), $value, $connector);\n\t\t}\n\n\t\t$type = 'where';\n\n\t\tswitch ($operator = strtoupper($operator))\n\t\t{\n\t\t\tcase '=':\n\t\t\t\t// Check if we are searching for null values\n\t\t\t\tif ($value === null)\n\t\t\t\t{\n\t\t\t\t\t$type = 'whereNull';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\tcase '!=':\n\t\t\tcase '<>':\n\t\t\tcase 'LIKE':\n\t\t\tcase 'NOT LIKE':\n\t\t\t\t// Check if we are searching for null values\n\t\t\t\tif ($value === null)\n\t\t\t\t{\n\t\t\t\t\t$type = 'whereNotNull';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$this->bindings[] = $value;\n\t\t\t\tbreak;\n\n\t\t\tcase 'NOT BETWEEN':\n\t\t\t\tif ( ! is_array($value) or count($value) != 2)\n\t\t\t\t{\n\t\t\t\t\tthrow new \\Core\\DatabaseException('The value in WHERE NOT BETWEEN must be an array with 2 elements!');\n\t\t\t\t}\n\n\t\t\t\t$type = 'whereNotBetween';\n\t\t\t\t$this->bindings = array_merge($this->bindings, $value);\n\t\t\t\tbreak;\n\n\t\t\tcase 'BETWEEN':\n\t\t\t\tif ( ! is_array($value) or count($value) != 2)\n\t\t\t\t{\n\t\t\t\t\tthrow new \\Core\\DatabaseException('The value in WHERE BETWEEN must be an array with 2 elements!');\n\t\t\t\t}\n\n\t\t\t\t$type = 'whereBetween';\n\t\t\t\t$this->bindings = array_merge($this->bindings, $value);\n\t\t\t\tbreak;\n\n\t\t\tcase 'IN':\n\t\t\t\tif ( ! is_array($value))\n\t\t\t\t{\n\t\t\t\t\tthrow new \\Core\\DatabaseException('The value in WHERE IN must be an array!');\n\t\t\t\t}\n\n\t\t\t\t$type = 'whereIn';\n\t\t\t\t$this->bindings = array_merge($this->bindings, $value);\n\t\t\t\tbreak;\n\n\t\t\tcase 'NOT IN':\n\t\t\t\tif ( ! is_array($value))\n\t\t\t\t{\n\t\t\t\t\tthrow new \\Core\\DatabaseException('The value in WHERE NOT IN must be an array!');\n\t\t\t\t}\n\n\t\t\t\t$type = 'whereNotIn';\n\t\t\t\t$this->bindings = array_merge($this->bindings, $value);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->bindings[] = $value;\n\t\t}\n\n\t\t$this->wheres[] = compact('type', 'column', 'operator', 'value', 'connector');\n\n\t\treturn $this;\n\t}", "function _get_by($field, $value = array())\r\n\t{\r\n\t\tif (isset($value[0]))\r\n\t\t{\r\n\t\t\t$this->where($field, $value[0]);\r\n\t\t}\r\n\r\n\t\treturn $this->get();\r\n\t}", "public function planFindByField($field,$condition,$value,$orderBy= 'asc');", "protected function getBy($value, $type) {\n $where = \"\";\n if ($type == \"id\") {\n $where = \"id=\".mysql_real_escape_string($value);\n } else if ($type == \"name\") {\n $where = \"name='\".mysql_real_escape_string($value).\"'\";\n } else {\n throw new Exception(\"Undefined type of the getBy\");\n }\n return $this->db->queryObject(\n \t\"select \n \t\tid as _id, name as _name, uri as _uri, enabled as _enabled,\n \t\tlastChecked as _lastChecked, ovalId as _ovalId \n from \n \tOvalSourceDef \n where\n \t$where\"\n , \"OvalSourceDef\");\n }", "public function whereId($value)\n {\n if (!is_scalar($value)) {\n throw new \\Exception(\"WHEREID argument must be a scalar\", 100);\n }\n $this->clauses[] = array('whereid', $value);\n return $this;\n }", "protected function addWhereFilter($field, $value) {\n if($this->filterType == 'orWhere') {\n $this->builder = $this->builder->orWhere($field, $value);\n }else {\n $this->builder = $this->builder->where($field, $value);\n $this->filterType = 'orWhere';\n }\n }", "public function where($column, $operator = null, $value = null, $boolean = 'and');", "public function generateWhereClausePart($fieldName, $value) {\n\n $condition = $this->getWhereClauseCondition();\n\n if($condition == '<'){\n return $whereClausePart = $fieldName . \" \" . $this->getWhereClauseCondition() . \" \" . $value['value1'];\n }else if($condition == '>'){\n return $whereClausePart = $fieldName . \" \" . $this->getWhereClauseCondition() . \" \" . $value['value1'];\n }else if($condition == 'BETWEEN'){\n return \"( \" . $fieldName . \" \" . $this->getWhereClauseCondition() . \" '\" . $value['value1'] . \"' AND '\" . $value['value2'] . \"' )\";\n }\n\n return null;\n }", "public function findBy($field, $value, $operator = '=');", "public static function where($field,$sign,$value) {\n $tabName = strtolower(get_called_class());\n $className = get_called_class();\n\n $sPDO = SingletonPDO::getInstance();\n $oPDOStatement = $sPDO->prepare(\"SELECT * FROM $tabName \" .self::$joins. \" WHERE $field $sign:val \". self::$groupBy.self::$orderBy );\n $oPDOStatement->bindValue(':val',$value); \n $oPDOStatement->execute();\n\n self::$joins = \"\"; self::$groupBy = \"\"; self::$orderBy = \"\";\n\n $elmsClass = new Collection; $ind = 0;\n foreach($oPDOStatement->fetchAll(PDO::FETCH_ASSOC) as $data){\n\n $elmClass = new $className($data);\n $elmsClass->{$ind}=$elmClass; $ind++;\n \n }\n\n return $elmsClass; \n \n }", "public function setValueCompare($value): ConditionInterface;", "protected function filteringWhereComparison($query, $value)\n {\n $compares = $this->explodeCompare($value);\n $query = $query->orWhere(function ($subquery) use ($compares) {\n foreach ($compares as $compare) {\n $function = $compare->function;\n $subquery = $subquery->$function(\n $this->isDate($compare->value)\n ? DB::raw(\"{$this->fieldName}\")\n : DB::raw(\"LOWER(\" . $this->fieldName . \")\"),\n $compare->compare,\n $this->transformValueForFilter($compare->value)\n );\n }\n });\n }", "function MyMod_Data_Fields_Sql_Where($data,$value)\n {\n $where=array();\n if (!empty($this->SqlWhere[ $data ]))\n {\n $where[ $data ]=$this->SqlWhere[ $data ];\n }\n return $where;\n }", "public static function where($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n return self::$PDO->where($prop,$value,$operator,$cond);\r\n }", "public function whereFieldValue(Field $field, LaramoreBuilder $builder, OperatorElement $operator, $value=null, ...$args);", "public static function in(string $field, $value): Where {\n $w = new Where();\n\n $w->addFilter($field, Where::OperatorIN, $value);\n\n return $w;\n }", "public function whereEqual($column, $value)\n {\n if (is_int($value)) {\n $this->where_clause .= \"$column = $value\";\n } else {\n $this->where_clause .= \" $column = \" . \"'\" . $value . \"'\";\n }\n }", "public function where($column, $operator = null, $value = null, $boolean = 'and')\n {\n return parent::where(...Factory::resolve(func_get_args()));\n }", "public function orWhere($column, $operator = null, $value = null);", "public function findByWhere($field, $value)\n {\n return static::findUserPermissionByWhere($field, $value);\n }", "public function where($where_col_array = NULL, $value = NULL)\n {\n if(isset($where_col_array))\n {\n if (!is_array($where_col_array) && is_null($value)) {\n $this->_database->where(array($this->table.'.'.$this->primary => $where_col_array));\n } elseif (isset($value) && !is_array($value)) {\n $this->_database->where($where_col_array, $value);\n }\n elseif (isset($value) && is_array($value))\n {\n $this->_database->where_in($where_col_array,$value);\n }\n elseif (is_array($where_col_array)) {\n $this->_database->where($where_col_array);\n }\n }\n if($this->soft_deletes===TRUE)\n {\n $this->_where_trashed();\n }\n return $this;\n }", "public function setWhere($sql, $value, $type, $check_blank = false, $throw_exception = false) {\n\t\t$this->logDebugInfo(debug_backtrace());\n\t\treturn $this->set($sql, $value, $type, 'where', $check_blank, $throw_exception);\n\t}", "public static function where($column, $value)\n {\n self::select(self::tableName(), $column .'='. $value);\n if (!self::$instance) {\n self::$instance = new AbstractModel();\n }\n return self::$instance;\n }", "abstract public function findBy($attributes, $value);", "public function findAllBy( $value = NULL, $field = NULL, array $columns = ['*'] );", "private function setWhereQuery(string $method, $column, $operatorOrValue = null, $value = null)\n {\n $this->__QUERY__ = $this->__QUERY__ ?? [];\n $query = (!isset($operatorOrValue) && !isset($value)) ? ($column instanceof SubQuery ? $column->json() : $column) : (isset($operatorOrValue) && !isset($value) ? [$column, '=', $operatorOrValue] : [$column, $operatorOrValue, $value]);\n // Add the % prefix and suffix if query operator is a `like` or `match` query\n if (isset($query[1]) && (('like' === $query[1]) || ('match' === $query[1])) && isset($query[2])) {\n $query[2] = str_contains((string) $query[2], '%') ? $query[2] : '%' . (string) $query[2] . '%';\n }\n $this->appendQuery($method, $query);\n }", "public function where($table,$column,$data = \"\");", "public function where($field, $operator, $value){\n array_push($this->wheres, $field.\" \".$operator.\" ?\");\n array_push($this->bindings, $value);\n return $this;\n }", "public function getByKey($value){\n $adapter = $this->createAdapter();\n $sql = $this -> getSelectStatement().\"where\".$this->getKeyName().\"=?\";\n return $adapter -> query($sql, $value);\n $adapter = null;\n\n }", "protected function getWhereClause() {}", "public function findAllBy($value, $field = 'id')\n {\n return call_user_func_array([$this->modelClass, 'where'], [$field, $value])->get();\n }", "public function orSql($fieldCondition, $value) {\r\n $this->where($fieldCondition, $value, 'OR');\r\n return $this;\r\n }", "private function whereElementStandard ($key, $value) {\n \n // Add the second part of the $value array (the value) to $this->_bindArray[]\n $this->_bindArray[] .= $value[1];\n\n // Append the first part of the $value array (the operator) to the table and return it\n return '`'.$this->table.'`'.'.'.'`'.$key .'`'. ' ' . $value[0]. ' ?';\n\n }", "public static function apply(Builder $builder, $value)\n {\n switch($value) {\n case 1:\n return $builder->where('listing_class_id', 1);\n break;\n case 2:\n return $builder->where('listing_class_id', 2);\n break;\n default:\n return $builder->where('listing_class_id', 2);\n break;\n }\n }", "public function orWhere($table,$column,$data = \"\");", "public function orWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "private function addWhere(&$query, $column, $operator, $value)\n {\n if ($operator == 'in') {\n\n $is_null = false;\n foreach ($value as $key => $val) {\n if ($val === null) {\n $is_null = true;\n unset($value[$key]);\n }\n }\n\n if ($is_null) {\n $query->whereNull($column)->orWhereIn($column, $value);\n } else {\n $query->whereIn($column, $value);\n }\n\n } elseif ($operator == 'not in') {\n $is_null = false;\n foreach ($value as $key => $val) {\n if ($val === null) {\n $is_null = true;\n unset($value[$key]);\n }\n }\n\n $value = array_values($value);\n if ($is_null) {\n $query->whereNotNull($column)->whereNotIn($column, $value);\n } else {\n $query->whereNotIn($column, $value);\n }\n\n } elseif ($operator == 'search') {\n\n $input = mb_strtolower($value);\n $input = Transliterator::transliterate($input, ' ');\n $input = explode(' ', $input);\n $input = array_filter($input);\n\n foreach ($input as $word) {\n $query = $query->where('search', 'LIKE', '%' . $word . '%');\n }\n\n } else {\n $query->where($column, $operator, $value);\n }\n return $query;\n }", "public function condition()\n {\n $op = $this->getDefaultOperator();\n $params = func_get_args();\n \n switch (count($params)) {\n case 1:\n if (is_string($params[0])) {\n $this->addCondition('literal', [$params[0]]);\n } elseif (is_array($params[0])) {\n $combination = $this->getDefaultOperator();\n \n /**\n * The code within the foreach is an extraction of Zend\\Db\\Sql\\Select::where()\n */\n foreach ($params[0] as $pkey => $pvalue) {\n if (is_string($pkey) && strpos($pkey, '?') !== false) {\n # ['id = ?' => 1]\n # ['id IN (?, ?, ?)' => [1, 3, 4]]\n $predicate = new ZfPredicate\\Expression($pkey, $pvalue);\n } elseif (is_string($pkey)) {\n if ($pvalue === null) {\n # ['name' => null] -> \"ISNULL(name)\"\n $predicate = new ZfPredicate\\IsNull($pkey, $pvalue);\n } elseif (is_array($pvalue)) {\n # ['id' => [1, 2, 3]] -> \"id IN (1, 2, 3)\"\n $predicate = new ZfPredicate\\In($pkey, $pvalue);\n } else {\n # ['id' => $id] -> \"id = 15\"\n $predicate = new ZfPredicate\\Operator($pkey, ZfPredicate\\Operator::OP_EQ, $pvalue);\n }\n } elseif ($pvalue instanceof ZfPredicate\\PredicateInterface) {\n $predicate = $pvalue;\n } else {\n # ['id = ?'] -> \"id = ''\"\n # ['id = 1'] -> literal.\n $predicate = (strpos($pvalue, Expression::PLACEHOLDER) !== false)\n ? new ZfPredicate\\Expression($pvalue) : new ZfPredicate\\Literal($pvalue);\n }\n $this->getCurrentPredicate()->addPredicate($predicate, $combination);\n }\n }\n break;\n \n case 2:\n # $rel->where('foo = ? AND id IN (?) AND bar = ?', [true, [1, 2, 3], false]);\n # If passing a non-array value:\n # $rel->where('foo = ?', 1);\n # But if an array is to be passed, must be inside another array\n # $rel->where('id IN (?)', [[1, 2, 3]]);\n if (!is_array($params[1])) {\n $params[1] = [$params[1]];\n }\n $this->expandPlaceholders($params[0], $params[1]);\n $this->addCondition('expression', [$params[0], $params[1]]);\n break;\n \n case 3:\n # $rel->where('id', '>', 2);\n $this->getCurrentPredicate()->addPredicate(\n new ZfPredicate\\Operator($params[0], $params[1], $params[2])\n );\n break;\n \n default:\n throw new Exception\\BadMethodCallException(\n sprintf(\n \"One to three arguments are expected, %s passed\",\n count($params)\n )\n );\n }\n \n return $this;\n }", "public function orHavingLessThanOrEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '<=', $value);\n }", "public static function where($variable, $operator, $value, $logicOperator = TExpression::AND_OPERATOR): TRepository\n {\n return parent::where($variable, $operator, $value, $logicOperator);\n }", "public function inValue(): WhereCondition\n {\n\n $this->_op = self::OP_TYPE_IN;\n\n return $this;\n\n }", "protected function _query($value)\n {\n /**\n * Check for an adapter being defined. if not, fetch the default adapter.\n */\n if ($this->_adapter === null) {\n $this->_adapter = Zend_Db_Table_Abstract::getDefaultAdapter();\n if (null === $this->_adapter) {\n // require_once 'Zend/Validate/Exception.php';\n throw new Zend_Validate_Exception('No database adapter present');\n }\n }\n\n /**\n * Build select object\n */\n $select = new Zend_Db_Select($this->_adapter);\n $select->from($this->_table, array($this->_field), $this->_schema)\n ->where($this->_adapter->quoteIdentifier($this->_field).' = ?', $value);\n if ($this->_exclude !== null) {\n if (is_array($this->_exclude)) {\n $select->where($this->_adapter->quoteIdentifier($this->_exclude['field']).' != ?', $this->_exclude['value']);\n } else {\n $select->where($this->_exclude);\n }\n }\n $select->limit(1);\n\n /**\n * Run query\n */\n $result = $this->_adapter->fetchRow($select, array(), Zend_Db::FETCH_ASSOC);\n\n return $result;\n }", "public function orWhere($field, $operator, $value);", "public static function get_data_by($field, $value)\n {\n }", "public function where($field, $op = null, $value = null) {\n return $this->_modifyPredicate($this->_where, Predicate::ALSO, $field, $op, $value);\n }", "public function findOneBy($column, $value, array $where = array()) {\n\t\t$where[$column] = $value;\n\t\treturn static::findOne($where);\n\t}", "public function createConditionSql($field, $operator, $value)\n {\n $sqlOperator = $this->getSqlOperator($operator);\n $connection = $this->getConnection();\n\n $condition = '';\n switch ($operator) {\n case '{}':\n case '!{}':\n if (is_array($value)) {\n if (!empty($value)) {\n $sqlOperator = $operator == '{}' ? 'IN' : 'NOT IN';\n $condition = $connection->quoteInto($field . ' ' . $sqlOperator . ' (?)', $value);\n }\n } else {\n $condition = $connection->quoteInto($field . ' ' . $sqlOperator . ' ?', '%' . $value . '%');\n }\n break;\n case 'between':\n $condition = $field . ' ' . sprintf(\n $sqlOperator,\n $connection->quote($value['start']),\n $connection->quote($value['end'])\n );\n break;\n default:\n $condition = $connection->quoteInto($field . ' ' . $sqlOperator . ' ?', $value);\n break;\n }\n\n return $condition;\n }", "public function where($column, $operator = null, $value = null, $boolean = 'and')\n {\n if ($column === '_id') {\n $column = $this->grammar->getMetaIdExpression($this);\n }\n\n return parent::where($column, $operator, $value, $boolean);\n }", "public function findOneBy( $value = NULL, $field = 'id', array $columns = ['*'] );", "public function orHavingEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '=', $value);\n }", "public function where($field=null,$operator=null,$value=null,$model=null){\n if(is_callable($field)){\n if($operator!==null){\n $this->model=$operator;\n }\n call_user_func_array($field,[$this->model]);\n }\n else{\n\n if($this->model==null){\n $this->model=$model;\n }\n\n if($field!==null && $operator!==null && $value!==null){\n $this->where['field'][]=$field;\n $this->where['operator'][]=$operator;\n if(is_callable($value)){\n $value=call_user_func($value);\n $jsonValCheck=json_decode(json_encode($value),1);\n if(is_array($jsonValCheck)){\n $this->where['value'][]=null;\n }\n else{\n $this->where['value'][]=$value;\n }\n\n }\n elseif(is_array($value)){\n $this->where['value']=''.$value[0]::where($value[1][0],\"=\",$value[1][1])->data()->$value[2];\n }\n else{\n $this->where['value'][]=$value;\n }\n\n }\n\n\n }\n\n return $this;\n }", "public function findBy($column, $value)\n\t{\n\t\t$arr = array();\n\t\tforeach($this as $item) {\n\t\t\tif($item->$column == $value) $arr[] = $item;\n\t\t}\n\t\treturn new DataTable($arr);\n\t}", "public function entitySearch($type, $field, $value) {\n return $this->typeManager->getStorage($type)\n ->getQuery()\n ->condition($field, $value)\n ->accessCheck(FALSE)\n ->execute();\n }", "public function getFilterQuery($key, $condition, $value, $originalValue, $type = 'normal')\n\t{\n\t\t$originalValue = trim($value, \"'\");\n\t\t$this->encryptFieldName($key);\n\t\t$str = ' (' . $key . ' ' . $condition . ' ' . $value . ' OR ' . $key . ' LIKE \\'%\"' . $originalValue . '\"%\\')';\n\t\treturn $str;\n\t}", "public function where($fieldCondition, $value = null, $joiner = 'AND', $quotes = true) {\r\n if( $value === null ) {\r\n $this->sqlTmpField = $fieldCondition;\r\n } else {\r\n $joiner = strtoupper($joiner);\r\n if( $value === false ) {\r\n $value = $fieldCondition;\r\n $fieldCondition = ' ';\r\n }\r\n if( $quotes ) {\r\n $value = $this->addQuotes($value);\r\n }\r\n if( count($this->sqlConditions) ) {\r\n $this->sqlConditions[] = sprintf('%s %s %s', $joiner, $fieldCondition, $value);\r\n } else {\r\n $this->sqlConditions[] = sprintf('%s %s', $fieldCondition, $value);\r\n }\r\n }\r\n return $this;\r\n }", "function _where($key, $value = NULL, $type = 'AND ', $escape = NULL)\r\n\t{\r\n\t\tif ( ! is_array($key))\r\n\t\t{\r\n\t\t\t$key = array($key => $value);\r\n\t\t}\r\n\r\n\t\t// Check if this is a related object\r\n\t\tif ( ! empty($this->parent))\r\n\t\t{\r\n\t\t\tforeach ($key as $k => $v)\r\n\t\t\t{\r\n\t\t\t\t$key[$this->table . '.' . $k] = $v;\r\n\t\t\t\tunset($key[$k]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->db->_where($key, $value, $type, $escape);\r\n\r\n\t\t// For method chaining\r\n\t\treturn $this;\r\n\t}", "public function andWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "public function whereEquals($table, $column, $value);", "abstract public function where(array $where);", "public function findFirstWhere(String $column, $value, String $operator = '=');", "public function findBy(string $column, $value)\n {\n return CustomField::where($column, $value)->get();\n }", "public function where($column, $operator = null, $value = null, $boolean = 'and')\n {\n // First we check whether the operator is 'IN' so that we call whereIn() on it\n // as a helping hand and centralization strategy, whereIn knows what to do with the IN operator.\n if (mb_strtolower($operator) == 'in') {\n return $this->whereIn($column, $value, $boolean);\n }\n\n // If the column is an array, we will assume it is an array of key-value pairs\n // and can add them each as a where clause. We will maintain the boolean we\n // received when the method was called and pass it into the nested where.\n if (is_array($column)) {\n return $this->whereNested(function (IlluminateQueryBuilder $query) use ($column) {\n foreach ($column as $key => $value) {\n $query->where($key, '=', $value);\n }\n }, $boolean);\n }\n\n if (func_num_args() == 2) {\n list($value, $operator) = [$operator, '='];\n } elseif ($this->invalidOperatorAndValue($operator, $value)) {\n throw new \\InvalidArgumentException('Value must be provided.');\n }\n\n // If the columns is actually a Closure instance, we will assume the developer\n // wants to begin a nested where statement which is wrapped in parenthesis.\n // We'll add that Closure to the query then return back out immediately.\n if ($column instanceof Closure) {\n return $this->whereNested($column, $boolean);\n }\n\n // If the given operator is not found in the list of valid operators we will\n // assume that the developer is just short-cutting the '=' operators and\n // we will set the operators to '=' and set the values appropriately.\n if (!in_array(mb_strtolower($operator), $this->operators, true)) {\n list($value, $operator) = [$operator, '='];\n }\n\n // If the value is a Closure, it means the developer is performing an entire\n // sub-select within the query and we will need to compile the sub-select\n // within the where clause to get the appropriate query record results.\n if ($value instanceof Closure) {\n return $this->whereSub($column, $operator, $value, $boolean);\n }\n\n // If the value is \"null\", we will just assume the developer wants to add a\n // where null clause to the query. So, we will allow a short-cut here to\n // that method for convenience so the developer doesn't have to check.\n if (is_null($value)) {\n return $this->whereNull($column, $boolean, $operator != '=');\n }\n\n // Now that we are working with just a simple query we can put the elements\n // in our array and add the query binding to our array of bindings that\n // will be bound to each SQL statements when it is finally executed.\n $type = 'Basic';\n\n $property = $column;\n\n // When the column is an id we need to treat it as a graph db id and transform it\n // into the form of id(n) and the typecast the value into int.\n if ($column == 'id') {\n $column = 'id('.$this->modelAsNode().')';\n $value = intval($value);\n }\n // When it's been already passed in the form of NodeLabel.id we'll have to\n // re-format it into id(NodeLabel)\n elseif (preg_match('/^.*\\.id$/', $column)) {\n $parts = explode('.', $column);\n $column = sprintf('%s(%s)', $parts[1], $parts[0]);\n $value = intval($value);\n }\n // Also if the $column is already a form of id(n) we'd have to type-cast the value into int.\n elseif (preg_match('/^id\\(.*\\)$/', $column)) {\n $value = intval($value);\n }\n\n $binding = $this->prepareBindingColumn($column);\n\n $this->wheres[] = compact('type', 'binding', 'column', 'operator', 'value', 'boolean');\n\n $property = $this->wrap($binding);\n\n if (!$value instanceof Expression) {\n $this->addBinding([$property => $value], 'where');\n }\n\n return $this;\n }", "public function getValueAsWhereClause(): ?array;", "public function getQueryBy($param, $value)\r\n {\r\n return $this->db\r\n ->select('*')\r\n ->from('semestre s')\r\n ->where($param, $value)\r\n ->get();\r\n }", "public function findBy(string $field, string $value)\n {\n return $this->makeQuery()->where(\"$field = :field\")->params(['field' => $value])->fetchOrException();\n }", "private static function genPrimaryKeyWhereClause() {\n return \"WHERE \" . self::ID_KEY . \"=\" . self::transformForPreparedStatement(self::ID_KEY);\n }" ]
[ "0.7251644", "0.6701346", "0.6478626", "0.644625", "0.64044714", "0.6368244", "0.6313666", "0.6309462", "0.6287369", "0.62851363", "0.62437606", "0.6237217", "0.62060475", "0.61912864", "0.61772203", "0.6133428", "0.6099568", "0.6094826", "0.6043162", "0.60377264", "0.60234636", "0.6012747", "0.5995232", "0.5987909", "0.5983726", "0.5971699", "0.59643817", "0.59589434", "0.5938176", "0.5924363", "0.59221476", "0.5917963", "0.5900872", "0.58993626", "0.5885382", "0.58812743", "0.58573806", "0.58184904", "0.581506", "0.58030176", "0.57931525", "0.57908165", "0.5786174", "0.5768525", "0.5751194", "0.5744554", "0.57275075", "0.57273775", "0.5720216", "0.5702949", "0.56995183", "0.56445646", "0.56436104", "0.5634154", "0.5622916", "0.56191736", "0.55980474", "0.5597012", "0.5596652", "0.5587316", "0.5583459", "0.55813426", "0.5572147", "0.55700666", "0.5549956", "0.55488294", "0.5545347", "0.55453336", "0.55272645", "0.55161476", "0.55128676", "0.5507467", "0.55060315", "0.5501053", "0.5471927", "0.54716223", "0.5448605", "0.54482627", "0.54399174", "0.5438636", "0.5433315", "0.5431682", "0.542762", "0.54268324", "0.5416727", "0.5411513", "0.5401674", "0.5394861", "0.53818446", "0.53795683", "0.5370932", "0.53595906", "0.535581", "0.53524685", "0.5352231", "0.5348807", "0.53481674", "0.53375536", "0.5326843", "0.53233707" ]
0.73254764
0
Handle an incoming request.
public function handle($request, Closure $next, $type="super") { $this->typetest=$type; $ret=false; if(USER_ADMIN){ if($type=="super" && USER_PETSHOP == false){ $ret=true; } if($type=="petshop" && USER_PETSHOP!=false){ $ret=true; } if($type=="all"){ $ret=true; } if( $type=="superOrPetowner" && ( USER_PETSHOP_ID==$request->petshop_id || USER_PETSHOP==false || $request->petshop_id=='0' || $request->petshop_id=="" ) ){ $ret=true; } } return $ret ? $next($request, $type) : response('', 403); }
{ "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
Set up page defaults.
public function initializeDefaults() { $page = $this->getCollectionObject(); Loader::helper('clov_page', 'clov'); // Show non-draft expenses and draft expenses owned by the user. ClovPageHelper::addBlockByHandle($page, 'clov_expense_list'); ClovPageHelper::addBlockByHandle($page, 'clov_expense_list', array( 'uID' => '0', 'activePages' => '0', )); ClovPageHelper::addBlockByHandle($page, 'clov_relative_link', array( 'action' => 'clov/expenses/-/add', 'text' => t('Add A New Expense'), 'class' => 'clov-action-link clov-add-link', )); $this->initializePermissions(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setupPage() {}", "private static function initialize_defaults() {\r\n\t\t\tself::$default_settings['credentials'] = array();\r\n\r\n\t\t\tself::$default_settings['has_first_question'] = 'no';\r\n\r\n\t\t\t// We want the Urtaks to appear by default, so let's append them\r\n\t\t\tself::$default_settings['placement'] = 'append';\r\n\r\n\t\t\t// We want to default post types to 'post' and 'page'\r\n\t\t\tself::$default_settings['post-types'] = array('page', 'post');\r\n\r\n\t\t\t// We want users to be able to start Urtaks by default\r\n\t\t\tself::$default_settings['user-start'] = 'yes';\r\n\r\n\t\t\t// We want Urtaks to support community moderation by default so that we get more questions and responses\r\n\t\t\tself::$default_settings['moderation'] = 'community';\r\n\r\n\t\t\t// Auto height and width\r\n\t\t\tself::$default_settings['height'] = '';\r\n\t\t\tself::$default_settings['width'] = '';\r\n\r\n\t\t\t// Counter settings\r\n\t\t\tself::$default_settings['counter-icon'] = 'yes';\r\n\t\t\tself::$default_settings['counter-responses'] = 'yes';\r\n\r\n\t\t\t// Profanity\r\n\t\t\tself::$default_settings['blacklisting'] = 'no';\r\n\t\t\tself::$default_settings['blacklist_override'] = 'no';\r\n\t\t\tself::$default_settings['blacklist_words'] = '';\r\n\t\t}", "public function init_settings_page()\n\t\t{\n\n\t\t\t$this->template_header();\n\t\t\t$this->template_body();\n\t\t\t$this->template_footer();\n\n\t\t}", "public function initPage() {}", "public function initPage() {}", "public function page_init() {\n }", "protected function setupPage()\n {\n // Yes, hardcoded on purpose\n $this->pageRenderer->setXmlPrologAndDocType('<!DOCTYPE html>');\n $this->pageRenderer->setCharSet('utf-8');\n $this->pageRenderer->setLanguage($GLOBALS['LANG']->lang);\n $this->pageRenderer->addMetaTag('<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">');\n }", "public function initialize_settings_page()\n {\n }", "public function settings_page_init() {\n $this->registration();\n $this->sections();\n }", "function _setDefaults() {}", "function setDefaults()\n {\n }", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->fixHTML5();\n $output .= $this->registerCustomResources();\n $output .= '</head><body>';\n echo $output;\n }", "public function initializePage()\n\t{\n\t\tadd_menu_page('Thema opties', 'Thema opties', 'manage_options', 'theme-options');\n\t}", "private function add_default_options_page() {\n\n\t\tadd_menu_page(\n\t\t\tself::OPTIONS_TITLE,\n\t\t\tself::OPTIONS_MENU_TITLE,\n\t\t\tself::OPTIONS_USER_CAP,\n\t\t\tself::OPTIONS_MENU_SLUG,\n\t\t\t[ $this, 'print_default_options_page' ]\n\t\t);\n\t}", "protected function page_default () {\n\t\t$skeleton = make::tpl ('skeleton.basic');\n\t\t/**\n\t\t * Fetch the body content template\n\t\t */\n\t\t$body = make::tpl ('body.login-widget');\n\n\n\t\t/**\n\t\t * Fetch the translated terms\n\t\t */\n\t\t$query = \"SELECT \";\n\t\t$query.= \"`html` \";\n\t\t$query.= \"FROM \";\n\t\t$query.= \"`page_widget_translations` \";\n\t\t$query.= \"WHERE \";\n\t\t$query.= \"`locale`='\".config::get('locale').\"' \";\n\t\t$query.= \"LIMIT 1\";\n\n\t\t$result = database::query($query);\n\n\t\tif($result && mysql_error()=='' && mysql_num_rows($result) > 0) {\n\t\t\t$row\t\t= mysql_fetch_assoc($result);\n\t\t\t$date\t\t= date('d/m/Y');\n\t\t\t$content\t= str_replace('{{ date }}',$date,stripslashes($row['html']));\n\t\t}\n\n\t\t$body->assign('content',$content);\n\n\t\t/**\n\t\t * Fetch the page details\n\t\t */\n\t\t /*\n\t\t$page = new page('terms');\n\t\t*/\n\n\t\t/**\n\t\t * Build the output\n\t\t */\n\t\t$skeleton->assign (\n\t\t\tarray (\n\t\t\t\t'title'\t\t\t=> /*$page->title()*/'Login Widget',\n\t\t\t\t'keywords'\t\t=> /*$page->keywords()*/'',\n\t\t\t\t'description'\t=> /*$page->description()*/'',\n\t\t\t\t'body'\t\t\t=> $body\n\t\t\t)\n\t\t);\n\n\t\toutput::as_html($skeleton,true);\n\n\t}", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->registerResource('css', $this->cssResource);\n $output .= $this->registerResource('js', $this->jsResource);\n $output .= $this->fixHTML5();\n $output .= '</head><body>';\n echo $output;\n }", "public function populateDefaults() {\n\t\t$this->owner->ShowInMenus = false;\n\t\t$this->owner->ShowInSearch = false;\n\t\t$this->owner->SubmitButtonText = \"Show my results\";\n \t}", "public function page_init()\n { \n register_setting(\n 'firebird_grupo',\n 'firebird_name',\n array( $this, 'sanitize' )\n );\n\n add_settings_section(\n 'setting_section_id',\n 'Configurações',\n array( $this, 'print_section_info' ),\n 'integracao-firebird-admin'\n ); \n\n add_settings_field(\n 'chave_token_api',\n 'Chave a ser utilizada no acesso a API de Importação',\n array( $this, 'chave_token_api_callback' ),\n 'integracao-firebird-admin',\n 'setting_section_id'\n );\n }", "public function initSettingsPage()\n {\n // admin sections\n $this->_addSection('schemas', __('Schemas', 'my_seo_settings'));\n $this->_addSection('special', __('Thematic Schemas', 'my_seo_settings'));\n $this->_addSection('front_page', __('General Settings', 'my_seo_settings'));\n $this->_addSection('compatibility', __('Compatibility', 'my_seo_settings'));\n\n /*\n * Adds fields to default section\n */\n $this->_addSchemaTagLocation('generate_json_ld_fpwebpage_hook_short_code', __('Schema Tag Location', 'my_seo_settings'), 'front_page');\n $this->_addInputField('generate_json_ld_fpwebpage_name', __('Website Title', 'my_seo_settings'), 'front_page');\n\t\t$this->_addInputField('generate_json_ld_fpwebpage_inlanguage', __('Website Language', 'my_seo_settings'), 'front_page');\n // Schemas\n $this->_addCheckboxField('generate_json_ld_fpwebpage', __('WebPage Schema for Home Page', 'my_seo_settings'), 'schemas');\n $this->_addCheckboxField('generate_json_ld_webpage', __('WebPage Schema for Pages', 'my_seo_settings'), 'schemas');\n $this->_addCheckboxField('generate_json_ld_posts', __('WebPage Schema for Posts', 'my_seo_settings'), 'schemas');\n $this->_addMenuDropbox('generate_json_ld_fpwebpage_menu', __('WPHeader Schema', 'my_seo_settings'), 'schemas');\n $this->_addMenuDropbox('generate_json_ld_fpwebpage_fmenu', __('WPFooter Schema', 'my_seo_settings'), 'schemas');\n\t\t$this->_addInputField('generate_json_ld_logo_url', __( 'Logo URL', 'my_seo_settings'), 'schemas');\n\n // Special\n $recipeHint = 'On individual post editing page Recipe specific fields will appear. When filled in they would show up in a Recipe schema on the page.';\n $faqHint = 'FAQ questions and answers are being added manually. go to the each page/post editor you would like to add - this schema must be enabled to take effect';\n\n $this->_addCheckboxField('generate_json_ld_recipe', __('Recipe Schema', 'my_seo_settings'), 'special', $recipeHint);\n $this->_addCheckboxField('generate_json_ld_faq', __('FAQ Schema', 'my_seo_settings'), 'special', $faqHint);\n $this->_addCustomField('generate_json_ld_person_schema', __('Person Schema', 'my_seo_settings'), [$this, '_renderPersonSchemaField'], 'special');\n $this->_addCustomField('generate_json_ld_product_schema', __('Product Schema', 'my_seo_settings'), [$this, '_renderProductSchemaField'], 'special');\n $this->_addCustomField('generate_json_ld_contact_page_schema', __('Contact Page Schema', 'my_seo_settings'), [$this, '_renderContactPageSchemaField'], 'special');\n $this->_addCustomField('generate_json_ld_about_page_schema', __('About Page Schema', 'my_seo_settings'), [$this, '_renderAboutPageSchemaField'], 'special');\n\t\t$this->_addCheckboxField('search_bar', __('Search Bar - Does the website have a search bar?', 'my_seo_settings'), 'compatibility');\n\t\t$this->_addCheckboxField('generate_json_ld_author', __( 'Author Schema', 'my_seo_settings'), [$this, '_renderAuthorPageSchemaField'], 'special' );\n $this->_addCheckboxField('yoast_disable', __('Yoast schema Off', 'my_seo_settings'), 'compatibility');\n }", "public function __construct() {\n\t\t\tparent::__construct();\n\t\t\t\n\t\t\t$this->assignPageVar('strPageTitle', $strSiteTitle = AppConfig::get('SiteTitle'));\n\t\t\t$this->assignPageVar('strSiteTitle', $strSiteTitle);\n\t\t\t$this->assignPageVar('strTheme', $strTheme = AppConfig::get('Theme'));\n\t\t\t\n\t\t\t$this->strThemeDir = ($strTheme ? \"themes/{$strTheme}/\" : '');\n\t\t\t$this->strThemeCssDir = '/css/' . ($this->strThemeDir ? $this->strThemeDir : null);\n\t\t\t$this->strThemeJsDir = '/js/' . ($this->strThemeDir ? $this->strThemeDir : null);\n\t\t}", "public function initializeDefaults()\n {\n }", "public function page_init()\n {\n register_setting(\n 'sepw_option_group', // Option group\n 'sepw_settings', // Option name\n array($this, 'sanitize') // Sanitize\n );\n\n add_settings_section(\n 'info_section_id',\n __('Guide', 'sepw'),\n array($this, 'print_info_section_info'),\n 'sepw-setting-admin'\n );\n\n add_settings_section(\n 'setting_section_id', // ID\n __('Settings', 'sepw'), // Title\n array($this, 'print_settings_section_info'), // Callback\n 'sepw-setting-admin' // Page\n );\n\n add_settings_section(\n 'generate_section_id',\n __('Create Pricelist', 'sepw'),\n array($this, 'print_generate_section_info'),\n 'sepw-setting-admin'\n );\n\n add_settings_field(\n 'product_fields',\n __('Filters', 'sepw'),\n array($this, 'product_fields_callback'),\n 'sepw-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'images_size',\n __('Thumbnail size', 'sepw'),\n array($this, 'images_size_callback'),\n 'sepw-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'cache_lifetime',\n __('Update Frequency', 'sepw'),\n array($this, 'cache_lifetime_callback'),\n 'sepw-setting-admin',\n 'setting_section_id'\n );\n }", "public function initialize()\n {\n // set base template\n $this->view->setTemplateBefore('default');\n }", "function initDefaults()\n\t{\n\t\tglobal $ninespot_admin;\n\t\n\t\t$ninespot_admin->addNewLayout( 'nines-layout-default',\n\t\t\tarray(\n\t\t\t\t'spots' => array(\n\t\t\t\t\t'head' => array(\n\t\t\t\t\t\t1 => 8,\n\t\t\t\t\t\t2 => 8,\n\t\t\t\t\t\t3 => 0,\n\t\t\t\t\t\t4 => 0,\n\t\t\t\t\t),\n\t\t\t\t\t'nav' => array(\n\t\t\t\t\t\t1 => 16,\n\t\t\t\t\t\t2 => 0,\n\t\t\t\t\t\t3 => 0,\n\t\t\t\t\t\t4 => 0,\n\t\t\t\t\t),\n\t\t\t\t\t'avant-body' => array(\n\t\t\t\t\t\t1 => 0,\n\t\t\t\t\t\t2 => 0,\n\t\t\t\t\t\t3 => 0,\n\t\t\t\t\t\t4 => 0,\n\t\t\t\t\t),\n\t\t\t\t\t'body' => array(\n\t\t\t\t\t\t1 => 4,\n\t\t\t\t\t\t2 => 8,\n\t\t\t\t\t\t3 => 4,\n\t\t\t\t\t\t4 => 0,\n\t\t\t\t\t),\n\t\t\t\t\t'apres-body' => array(\n\t\t\t\t\t\t1 => 0,\n\t\t\t\t\t\t2 => 0,\n\t\t\t\t\t\t3 => 0,\n\t\t\t\t\t\t4 => 0,\n\t\t\t\t\t),\n\t\t\t\t\t'foot' => array(\n\t\t\t\t\t\t1 => 16,\n\t\t\t\t\t\t2 => 0,\n\t\t\t\t\t\t3 => 0,\n\t\t\t\t\t\t4 => 0,\n\t\t\t\t\t),\n\t\t\t\t\t'apres-foot' => array(\n\t\t\t\t\t\t1 => 16,\n\t\t\t\t\t\t2 => 0,\n\t\t\t\t\t\t3 => 0,\n\t\t\t\t\t\t4 => 0,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'widgets' => array(\n\t\t\t\t\t'head' => array(\n\t\t\t\t\t\t'text' => array( 'title' => 'This is a text widget' , 'text' => 'Edit me in the dashboard' ),\n\t\t\t\t\t),\n\t\t\t\t\t'body-1' => array(\n\t\t\t\t\t\t'pages' => array( 'expandtree' => 1 , 'homelink' => 'Home' ),\n\t\t\t\t\t),\n\t\t\t\t\t'body-2' => array(\n\t\t\t\t\t\t'breadcrumbs' => array( 'homelink' => get_option('name') , 'maxchars' => 35 ),\n\t\t\t\t\t\t'categorydescription' => array( 'title' => '%term_name% Archives' ),\n\t\t\t\t\t\t'pagednav' => array(),\n\t\t\t\t\t\t'postloop' => array( 'title' => 'Primary Post Loop', 'what' => 'normal', 'template' => 'a_default_full.php', ),\n\t\t\t\t\t\t'pagednav' => array(),\n\t\t\t\t\t),\n\t\t\t\t\t'body-3' => array(\n\t\t\t\t\t\t'postloop' => array( 'title' => 'Around the site', 'title_show' => 1, 'what' => 'post', 'age_bool' => 'newer' , 'age_num' => 2 , 'age_unit' => 'year' , 'count' => 3 , 'order' => 'rand', 'template' => 'c_default_tiny.php', ),\n\t\t\t\t\t\t'text' => array( 'title' => 'Above this is a post loop widget' , 'text' => 'Use multiple post loop widgets to feature stories anywhere on the page. This widget shows stories published in the past year, but you can select stories by category, tag, or other criteria.' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}", "protected function page_default () {\r\n\t\t$skeleton = new xhtml ('skeleton.basic');\r\n\t\t$skeleton->load();\r\n\t\t$content=\"\";\r\n\t\t/**\r\n\t\t * Fetch the body content template\r\n\t\t */\r\n\t\tif(config::get('locale')!='') {\r\n\t\t\t$body = new xhtml ('body.vidtuts.'.config::get('locale'));\r\n\t\t} else {\r\n\t\t\t$body = new xhtml ('body.vidtuts');\r\n\t\t}\r\n\t\t$body->load();\r\n\r\n\t\t/**\r\n\t\t * Fetch the translated terms\r\n\t\t */\r\n\t\t$query = \"SELECT \";\r\n\t\t$query.= \"`html` \";\r\n\t\t$query.= \"FROM \";\r\n\t\t$query.= \"`page_terms_translations` \";\r\n\t\t$query.= \"WHERE \";\r\n\t\t$query.= \"`locale`='\".config::get('locale').\"' \";\r\n\t\t$query.= \"LIMIT 1\";\r\n\r\n\t\t$result = database::query($query);\r\n\r\n\t\tif($result && mysql_error()=='' && mysql_num_rows($result) > 0) {\r\n\t\t\t$row = mysql_fetch_assoc($result);\r\n\r\n\t\t\t$date = date('d/m/Y');\r\n\r\n\t\t\t$content = str_replace('{{ date }}',$date,stripslashes($row['html']));\r\n\t\t}\r\n\r\n\t\t$body->assign('content',$content);\r\n \r\n\t\t/**\r\n\t\t * Fetch the page details\r\n\t\t */\r\n\t\t$page = new page('terms');\r\n\r\n\t\t/**\r\n\t\t * Build the output\r\n\t\t */\r\n\t\t$skeleton->assign (\r\n\t\t\tarray (\r\n\t\t\t\t'title'\t\t\t=> /*$page->title()*/'Video Tutorials',\r\n\t\t\t\t'keywords'\t\t=> $page->keywords(),\r\n\t\t\t\t'description'\t=> $page->description(),\r\n\t\t\t\t'body'\t\t\t=> $body\r\n\t\t\t)\r\n\t\t);\r\n \r\n\t\toutput::as_html($skeleton,true);\r\n \r\n\t}", "public function setDefaultPage($page) {\n $this->values->put('DefaultPage', $page);\n }", "public function setPages() {\n $this->pages = array(\n array(\n 'page_title' => 'Open Badge',\n 'menu_title' => 'Open Badge',\n 'capability' => 'manage_options',\n 'menu_slug' => self::SLUG_PLUGIN,\n 'callback' => array(DashboardTemp::class, 'main'),\n 'icon_url' => 'dashicons-awards',\n 'position' => '110'\n )\n );\n }", "private function _setDefaults() {\r\n\t\t$checked = $selected = '';\r\n\t\t$isAdmin = $hasCart = false;\r\n\t\tif($this->isAdmin()) {\r\n\t\t\t$isAdmin = true;\r\n\t\t}\r\n\t\tif($this->Session->check('Order.id')) {\r\n\t\t\t$hasCart = true;\r\n\t\t}\r\n\t\t$this->set(compact('checked', 'selected', 'isAdmin', 'hasCart'));\r\n\t\t\r\n\t\t$this->layout = 'shop';\r\n\t\tif(isset($this->params['admin'])) {\r\n\t\t\t$this->layout = 'admin';\r\n\t\t}\r\n\t}", "protected function _init()\n {\n $this->setLayoutTemplate(App::getConfig('Help','layout/default'));\n\n # set navbar template .phtml\n $this->getNavbar()->setTemplate('help/html/navbar.phtml');\n\n #set sidebar template .phtml\n $this->getSidebar()->setTemplate('help/html/sidebar.phtml');\n }", "function setDefaults() {\r\n\t\t$this->requiredBold=true;\r\n\t\t$this->saveButton=true;\r\n\t\t$this->backButton=false;\r\n\t\t$this->actionFrameName='form_actionFrame_'.self::$instances;\r\n\t\t$this->target=$this->actionFrameName;\r\n\t\t$this->triggerFile=$_SERVER['SCRIPT_NAME'];\r\n\r\n\t\t$this->showCaption=true;\r\n\t\t$this->showDescription=true;\r\n\r\n\t\t$this->method=\"POST\";\r\n\t\t$this->jsFiles=array(\r\n\t\t\tLIB_PATH.'jsfunc.validateform.js',\r\n\t\t\tLIB_PATH.'jsfunc.tooltip.js',\r\n\t\t);\r\n\t}", "function load_defaults(){\n\t\t\n\t\t$this->choices = array(\n\t\t\t'yes' => __('Enable', 'wa_wcc_txt'),\n\t\t\t'no' => __('Disable', 'wa_wcc_txt')\n\t\t);\n\n\t\t$this->loading_places = array(\n\t\t\t'header' => __('Header', 'wa_wcc_txt'),\n\t\t\t'footer' => __('Footer', 'wa_wcc_txt')\n\t\t);\n\n\t\t$this->tabs = array(\n\t\t\t'general-settings' => array(\n\t\t\t\t'name' => __('General', 'wa_wcc_txt'),\n\t\t\t\t'key' => 'wa_wcc_settings',\n\t\t\t\t'submit' => 'save_wa_wcc_settings',\n\t\t\t\t'reset' => 'reset_wa_wcc_settings',\n\t\t\t),\n 'configuration' => array(\n 'name' => __('Advanced', 'wa_wcc_txt'),\n 'key' => 'wa_wcc_configuration',\n 'submit' => 'save_wa_wcc_configuration',\n 'reset' => 'reset_wa_wcc_configuration'\n )\n\t\t);\n\t}", "public function page_setup($baseurl) {\n global $PAGE, $SITE;\n\n // Set up the basic page info.\n $PAGE->set_url($baseurl);\n $displaystring = get_string('configuretitle', 'rlipexport_version1elis');\n $PAGE->set_title($SITE->shortname.': '.$displaystring);\n $PAGE->set_heading($SITE->fullname);\n\n // Use the default admin layout.\n $PAGE->set_pagelayout('admin');\n }", "public function populateDefaults()\n {\n // Populate Defaults (from parent):\n \n parent::populateDefaults();\n \n // Populate Defaults:\n \n $this->Title = _t(__CLASS__ . '.DEFAULTTITLE', 'Share via Email');\n }", "public function page_init()\r\n {\r\n register_setting(\r\n 'tapatalk_general_group', \r\n 'tapatalk_general',\r\n array($this, 'sanitize')\r\n );\r\n\r\n $this->add_default_value('tapatalk_general', array(\r\n 'mobile_welcome_screen' => false,\r\n 'mobile_smart_banner' => true,\r\n 'facebook_twitter_deep_link' => true,\r\n ));\r\n\r\n add_settings_section(\r\n 'tapatalk_general', // ID\r\n 'Tapatalk-General', // Title\r\n array($this, 'print_section_info'), // Callback\r\n 'tapatalk_general_admin' // Page\r\n );\r\n\r\n add_settings_field(\r\n 'mobile_welcome_screen', // ID\r\n 'Mobile Welcome Screen', // Title \r\n array($this->page_common, 'create_section_for_checkbox'), // Callback\r\n 'tapatalk_general_admin', // Page\r\n 'tapatalk_general', // Section\r\n array( //Callback function parameter\r\n \"id\" => \"mobile_welcome_screen\",\r\n \"group\" => \"tapatalk_general\",\r\n \"options\" => array(\r\n \"desc\" => 'Tapatalk will show a one-time welcome screen to mobile web users informing them to download and view your site in the free app.',\r\n ),\r\n )\r\n );\r\n\r\n add_settings_field(\r\n 'mobile_smart_banner',\r\n 'Mobile Smart Banner',\r\n array($this->page_common, 'create_section_for_checkbox'), \r\n 'tapatalk_general_admin',\r\n 'tapatalk_general',\r\n array(\r\n \"id\" => \"mobile_smart_banner\",\r\n \"group\" => \"tapatalk_general\",\r\n \"options\" => array(\r\n \"desc\" => 'Tapatalk will show a smart banner to mobile users, when your site is viewed by a mobile web browser.',\r\n ),\r\n )\r\n );\r\n\r\n add_settings_field(\r\n 'facebook_twitter_deep_link',\r\n 'Facebook and Twitter Deep Linking',\r\n array($this->page_common, 'create_section_for_checkbox'), \r\n 'tapatalk_general_admin',\r\n 'tapatalk_general',\r\n array(\r\n \"id\" => \"facebook_twitter_deep_link\",\r\n \"group\" => \"tapatalk_general\",\r\n \"options\" => array(\r\n \"desc\" => 'Allow your members to open the same blog in Tapatalk from your Facebook post / Twitter tweet.',\r\n ),\r\n )\r\n );\r\n\r\n add_settings_field(\r\n 'api_key',\r\n 'Tapatalk Key',\r\n array($this->page_common, 'create_section_for_text'),\r\n 'tapatalk_general_admin',\r\n 'tapatalk_general',\r\n array(\r\n \"desc\" => \"This field is mandatory. Please input the key provided in tapatalk site owner account.\",\r\n \"id\" => \"api_key\",\r\n \"group\" => \"tapatalk_general\",\r\n \"title\" => 'Tapatalk API Key',\r\n \"std\" => '',\r\n )\r\n );\r\n }", "function default_options() {\r\n\t\t$this->version = BF_VERSION;\r\n\t\t\r\n\t\t$this->footer_message = sprintf( __('<strong>&copy; %s</strong>. All Rights Reserved.'), get_bloginfo('name') );\r\n\t\t\r\n\t\t$this->home_link = __('Home', 'buffet');\r\n\t\t$this->blog_link = __('Blog', 'buffet');\r\n\t\t$this->topnav_linkcat = 0;\r\n\t\t\r\n\t\t$this->index_news_thumbs = true;\r\n\t\t\r\n\t\t$this->archive_news_thumbs = true;\r\n\r\n\t\t$this->hooks = array();\r\n\t}", "public function setup_settings() {\n\t\t$this->init_sections();\n\t\t$this->init_fields();\n\t\t$this->settings_fields();\n\t}", "public function set_up(): void {\n\t\tparent::set_up();\n\n\t\t$this->stylesheet = get_stylesheet();\n\n\t\t// Set stylesheet from one of the supported themes.\n\t\tupdate_option( 'stylesheet', 'twentytwentyone' );\n\t\tupdate_option( Customizer::STORY_OPTION, [ 'show_stories' => true ] );\n\n\t\t$this->instance = $this->injector->make( Testee::class );\n\t}", "function _setDefaults()\n {\n $this->type = $this->rs['type'] = \"unknown\";\n $this->parent = $this->rs['parent'] = 0;\n $this->lecture_id = $this->rs['lecture_id'] = SessionDataBean::getLectureId();\n $this->title = $this->rs['title'] = \"\";\n $this->mtitle = $this->rs['mtitle'] = \"\";\n $this->text = $this->rs['text'] = \"<p></p>\";\n $this->position = $this->rs['position'] = 0;\n $this->redirect = $this->rs['redirect'] = \"\";\n $this->ival1 = $this->rs['ival1'] = 0;\n $this->copy_parent = $this->rs['copy_parent'] = false;\n }", "public function initPage( OutputPage $out ) {\n parent::initPage( $out );\n }", "protected function setDefaults()\n {\n return;\n }", "public function page_init() { \n\n\t\t\tif (!get_option('dls_settings_site_id')) {\n\t\t\t\tadd_option('dls_settings_site_id');\n\t\t\t}\n\n\t\t\tif (!get_option('dls_settings_enabled_post_types')) {\n\t\t\t\tadd_option('dls_settings_enabled_post_types');\n\t\t\t}\n\n\t\t\tif (!get_option('dls_settings_replace_host_list')) {\n\t\t\t\tadd_option('dls_settings_replace_host_list');\n }\n\n\t\t\tif (!get_option('dls_settings_auto_redirect_to_admin_page')) {\n\t\t\t\tadd_option('dls_settings_auto_redirect_to_admin_page');\n }\n\n\t\t\tif (!get_option('dls_overwrite_viewable_permalink')) {\n\t\t\t\tadd_option('dls_overwrite_viewable_permalink');\n }\n\n \t\t\tif (!get_option('dls_overwrite_viewable_permalink_host')) {\n\t\t\t\tadd_option('dls_overwrite_viewable_permalink_host');\n\t\t\t}\n \n register_setting( 'my_option_group', 'dls_settings_site_id', array( $this, 'sanitize' ) );\n register_setting( 'my_option_group', 'dls_settings_enabled_post_types', array( $this, 'sanitize' ) );\n register_setting( 'my_option_group', 'dls_settings_replace_host_list', array( $this, 'sanitize' ) );\n register_setting( 'my_option_group', 'dls_settings_auto_redirect_to_admin_page', array( $this, 'sanitize' ) );\n register_setting( 'my_option_group', 'dls_overwrite_viewable_permalink', array( $this, 'sanitize' ) );\n register_setting( 'my_option_group', 'dls_overwrite_viewable_permalink_host', array( $this, 'sanitize' ) );\n\n add_settings_section( 'settings_site_id', 'Site ID', array( $this, 'print_site_id' ), 'my-setting-admin' ); \n\t\t\tadd_settings_field( 'dls-settings', 'Set the site id for this site', array( $this, 'site_id_callback'), 'my-setting-admin', 'settings_site_id' ); \n\n add_settings_section( 'setting_section_id', 'Post types settings', array( $this, 'print_post_types_info' ), 'my-setting-admin' ); \n\t\t\tadd_settings_field( 'dls-settings', 'Select post types', array( $this, 'post_type_callback'), 'my-setting-admin', 'setting_section_id' ); \n\n add_settings_section( 'settings_replace_hosts', 'Hosts to replace', array( $this, 'print_replace_hosts_info' ), 'my-setting-admin' ); \n\t\t\tadd_settings_field( 'dls-settings', 'List of hosts', array( $this, 'replace_hosts_callback'), 'my-setting-admin', 'settings_replace_hosts' ); \n\n add_settings_section( 'settings_auto_redirect_to_admin', 'Auto redirect to admin page', array( $this, 'print_auto_redirect_to_admin' ), 'my-setting-admin' ); \n\t\t\tadd_settings_field( 'dls-settings', 'Auto redirect to admin page', array( $this, 'auto_redirect_to_admin_callback'), 'my-setting-admin', 'settings_auto_redirect_to_admin' ); \n\n add_settings_section( 'settings_overwrite_viewable_permalink', 'Overwrite the viewable permalink', array( $this, 'print_overwrite_viewable_permalink' ), 'my-setting-admin' ); \n\t\t\tadd_settings_field( 'dls-settings', 'Overwrite the viewable permalink', array( $this, 'overwrite_viewable_permalink_callback'), 'my-setting-admin', 'settings_overwrite_viewable_permalink' ); \n\t\t\tadd_settings_field( 'dls-settings-overwrite_viewable_permalink_host', 'Overwrite the viewable permalink host', array( $this, 'overwrite_viewable_permalink_host_callback'), 'my-setting-admin', 'settings_overwrite_viewable_permalink' ); \n\n\t\t}", "public function setUp() {\r\n //$this->setRootMenuPage( 'sdfgfgdfg' ); # set the top-level page, ie add a page to the Settings page\r\n $this->setRootMenuPageBySlug(self::MENU_ROOT_MENU_PAGE); //add submenu page under hoangweb theme options\r\n #add sub-menu pages\r\n $this->addSubMenuItem(\r\n array(\r\n 'title' => 'Menu',\r\n 'page_slug' => self::page_setting_slug,\r\n )\r\n );\r\n\r\n //modify apf hwskin fieldtype\r\n //add_filter('apf_hwskin', array($this, '_apf_hwskin'),10,2);\r\n add_filter('hwskin_field_output', array($this, '_apf_hwskin_field_output'),10,3); //hack field output\r\n add_filter('renderOptionField_APF', array($this, '_apf_renderOptionField'), 10,2); //before output skin options\r\n }", "public function setting_page() {\n\n\t\techo '<div class=\"wrap\">';\n\t\tsettings_errors();\n\n\t\t$this->setting->show_navigation();\n\t\t$this->setting->show_forms();\n\n\t\techo '</div>';\n\t}", "public function page_init()\n { \n register_setting(\n 'ccgr_extras_options', // Group name. Must match the settings_fields function call\n 'cc_restricted_email_domains', // Option name\n array( $this, 'sanitize' ) // Callback function for validation.\n );\n\n add_settings_section(\n 'ccgr_extras_options', // ID for the section\n 'Registration Extras', // Title\n array( $this, 'print_section_info' ), // Callback function. Outputs section description.\n 'ccgr_extras' // Page name. Must match do_settings_section function call.\n ); \n\n add_settings_field(\n 'restricted_domains', // ID for the field\n 'Restricted Email Domains', // Title \n array( $this, 'print_domain_form_field' ), // Callback function. Outputs form field inputs.\n 'ccgr_extras', // Page name. Must match do_settings_section function call.\n 'ccgr_extras_options' // ID of the settings section that this goes into (same as the first argument of add_settings_section). \n );\n\n }", "public function populateDefaults()\n {\n // Populate Defaults (from parent):\n \n parent::populateDefaults();\n \n // Populate Defaults:\n \n $this->FeedTitle = _t(\n __CLASS__ . '.DEFAULTFEEDTITLE',\n 'Latest News Articles'\n );\n \n $this->FeedDescription = _t(\n __CLASS__ . '.DEFAULTFEEDDESCRIPTION',\n 'The latest news articles from our site.'\n );\n }", "public function init()\n\t{\n\t\t$this->_helper->layout()->setLayout('home');\n\t}", "public function set_default_view_variables()\n\t{\n\t\t$langfile = substr(ee()->router->class, 0, strcspn(ee()->router->class, '_'));\n\n\t\t// Javascript Path Constants\n\t\tdefine('PATH_JQUERY', PATH_THEMES_GLOBAL_ASSET.'javascript/'.PATH_JS.'/jquery/');\n\t\tdefine('PATH_JAVASCRIPT', PATH_THEMES_GLOBAL_ASSET.'javascript/'.PATH_JS.'/');\n\t\tdefine('JS_FOLDER', PATH_JS);\n\n\t\tee()->load->library('javascript', array('autoload' => FALSE));\n\n\t\tee()->load->model('member_model'); // for screen_name, quicklinks\n\n\t\tee()->lang->loadfile($langfile, '', FALSE);\n\n\t\t// Meta-refresh tag\n\t\tif ($refresh = ee()->session->flashdata('meta-refresh'))\n\t\t{\n\t\t\tee()->view->set_refresh($refresh['url'], $refresh['rate']);\n\t\t}\n\n\t\t$cp_table_template = array(\n\t\t\t'table_open' => '<table class=\"mainTable\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">'\n\t\t);\n\n\t\t$cp_pad_table_template = array(\n\t\t\t'table_open' => '<table class=\"mainTable padTable\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">'\n\t\t);\n\n\t\t$member = ee('Model')->get('Member', ee()->session->userdata('member_id'))->first();\n\n\t\tif ( ! $member)\n\t\t{\n\t\t\t$member = ee('Model')->make('Member');\n\t\t}\n\n\t\t$notepad_content = ($member->notepad) ?: '';\n\n\t\t// Global view variables\n\t\t$vars =\tarray(\n\t\t\t'cp_homepage_url' => $member->getCPHomepageURL(),\n\t\t\t'cp_page_onload'\t\t=> '',\n\t\t\t'cp_page_title'\t\t\t=> '',\n\t\t\t'cp_breadcrumbs'\t\t=> array(),\n\t\t\t'cp_right_nav'\t\t\t=> array(),\n\t\t\t'cp_messages'\t\t\t=> array(),\n\t\t\t'cp_notepad_content'\t=> $notepad_content,\n\t\t\t'cp_table_template'\t\t=> $cp_table_template,\n\t\t\t'cp_pad_table_template'\t=> $cp_pad_table_template,\n\t\t\t'cp_theme_url'\t\t\t=> $this->cp_theme_url,\n\t\t\t'cp_current_site_label'\t=> ee()->config->item('site_name'),\n\t\t\t'cp_screen_name'\t\t=> $member->screen_name,\n\t\t\t'cp_avatar_path'\t\t=> ($member->avatar_filename) ? ee()->config->slash_item('avatar_url') . $member->avatar_filename : '',\n\t\t\t'cp_avatar_width'\t\t=> ($member->avatar_filename) ? $member->avatar_width : '',\n\t\t\t'cp_avatar_height'\t\t=> ($member->avatar_filename) ? $member->avatar_height : '',\n\t\t\t'cp_quicklinks'\t\t\t=> $this->_get_quicklinks($member->quick_links),\n\n\t\t\t'EE_view_disable'\t\t=> FALSE,\n\t\t\t'is_super_admin'\t\t=> (ee()->session->userdata['group_id'] == 1) ? TRUE : FALSE,\t// for conditional use in view files\n\t\t);\n\n\t\t// global table data\n\t\tee()->session->set_cache('table', 'cp_template', $cp_table_template);\n\t\tee()->session->set_cache('table', 'cp_pad_template', $cp_pad_table_template);\n\n\t\t// we need these paths again in my account, so we'll keep track of them\n\t\t// kind of hacky, but before it was accessing _ci_cache_vars, which is worse\n\n\t\tee()->session->set_cache('cp_sidebar', 'cp_avatar_path', $vars['cp_avatar_path'])\n\t\t\t->set_cache('cp_sidebar', 'cp_avatar_width', $vars['cp_avatar_width'])\n\t\t\t->set_cache('cp_sidebar', 'cp_avatar_height', $vars['cp_avatar_height']);\n\n\t\t// The base javascript variables that will be available globally through EE.varname\n\t\t// this really could be made easier - ideally it would show up right below the main\n\t\t// jQuery script tag - before the plugins, so that it has access to jQuery.\n\n\t\t// If you use it in your js, please uniquely identify your variables - or create\n\t\t// another object literal:\n\t\t// Bad: EE.test = \"foo\";\n\t\t// Good: EE.unique_foo = \"bar\"; EE.unique = { foo : \"bar\"};\n\n\t\t$js_lang_keys = array(\n\t\t\t'logout'\t\t\t\t=> lang('logout'),\n\t\t\t'search'\t\t\t\t=> lang('search'),\n\t\t\t'session_idle'\t\t\t=> lang('session_idle'),\n\t\t\t'btn_fix_errors'\t\t=> lang('btn_fix_errors'),\n\t\t\t'btn_fix_errors'\t\t=> lang('btn_fix_errors'),\n\t\t\t'check_all'\t\t\t\t=> lang('check_all'),\n\t\t\t'clear_all'\t\t\t\t=> lang('clear_all'),\n\t\t\t'keyword_search'\t\t=> lang('keyword_search'),\n\t\t\t'loading'\t\t\t\t=> lang('loading'),\n\t\t\t'searching'\t\t\t\t=> lang('searching')\n\t\t);\n\n\t\tee()->javascript->set_global(array(\n\t\t\t'BASE' => str_replace(AMP, '&', BASE),\n\t\t\t'XID' => CSRF_TOKEN,\n\t\t\t'CSRF_TOKEN' => CSRF_TOKEN,\n\t\t\t'PATH_CP_GBL_IMG' => PATH_CP_GBL_IMG,\n\t\t\t'CP_SIDEBAR_STATE' => ee()->session->userdata('show_sidebar'),\n\t\t\t'username' => ee()->session->userdata('username'),\n\t\t\t'router_class' => ee()->router->class, // advanced css\n\t\t\t'lang' => $js_lang_keys,\n\t\t\t'THEME_URL' => $this->cp_theme_url,\n\t\t\t'hasRememberMe' => (bool) ee()->remember->exists(),\n\t\t\t'cp.updateCheckURL' => ee('CP/URL', 'settings/general/version-check')->compile(),\n\t\t));\n\n\t\tif (ee()->session->flashdata('update:completed'))\n\t\t{\n\t\t\tee()->javascript->set_global('cp.updateCompleted', TRUE);\n\t\t}\n\n\t\t// Combo-load the javascript files we need for every request\n\n\t\t$js_scripts = array(\n\t\t\t'ui'\t\t=> array('core', 'widget', 'mouse', 'position', 'sortable', 'dialog', 'button'),\n\t\t\t'plugin'\t=> array('ee_interact.event', 'ee_broadcast.event', 'ee_notice', 'ee_txtarea', 'tablesorter', 'ee_toggle_all', 'nestable'),\n\t\t\t'file'\t\t=> array('react/react.min', 'react/react-dom.min', 'json2',\n\t\t\t'underscore', 'cp/global_start', 'cp/form_validation', 'cp/sort_helper', 'cp/form_group',\n\t\t\t'cp/modal_form', 'cp/confirm_remove', 'cp/fuzzy_filters',\n\t\t\t'components/no_results', 'components/loading', 'components/filters',\n\t\t\t'components/filterable', 'components/toggle', 'components/select_list',\n\t\t\t'fields/select/select', 'fields/select/mutable_select', 'fields/dropdown/dropdown')\n\t\t);\n\n\t\t$modal = ee('View')->make('ee:_shared/modal_confirm_remove')->render([\n\t\t\t'name'\t\t=> 'modal-default-confirm-remove',\n\t\t\t'form_url'\t=> '#',\n\t\t\t'hidden'\t=> [\n\t\t\t\t'bulk_action'\t=> 'remove',\n\t\t\t\t'content_id' => ''\n\t\t\t]\n\t\t]);\n\t\tee('CP/Modal')->addModal('default-remove', $modal);\n\n\t\t$this->add_js_script($js_scripts);\n\t\t$this->_seal_combo_loader();\n\n\t\tforeach ($vars as $key => $value)\n\t\t{\n\t\t\tee()->view->$key = $value;\n\t\t}\n\n\t\tee()->load->vars($vars);\n\t}", "public function page_init()\n {\n register_setting(\n 'mj_groups_fields', // group name\n 'mj_option_theme',\n array($this, 'sanitize') // sanitize\n );\n\n add_settings_section(\n 'section_default',\n '',\n '',\n 'config-theme-options'\n );\n\n foreach ($this->formRenderInputs as $key => $value) {\n add_settings_field(\n $value['args']['atributos']['name'],\n $value['titulo'],\n array($this, 'render_field_input'),\n 'config-theme-options',\n 'section_default',\n array('valores' => $value)\n );\n }\n }", "private function setDefaultView() {\r\n $page = 'index';\r\n\r\n if($this->getRouter()->getController() != null) {\r\n $page = $this->getRouter()->getController();\r\n }\r\n\r\n $template = Globals::getConfig()->template->path . $page;\r\n $this->_view = new View($template,null, true);\r\n\r\n try {\r\n $this->setJs();\r\n $this->setCss();\r\n } catch (Exception $e) {\r\n $this->defaultAction();\r\n }\r\n }", "public function page_init()\n {\n register_setting(\n 'my_option_group', // Option group\n 'linkedin_api_option', // Option name\n array( $this, 'sanitize' ) // Sanitize\n );\n\n add_settings_section(\n 'setting_section_id', // ID\n 'Request Settings', // Title\n array(), // Callback\n 'my-setting-admin' // Page\n );\n\n add_settings_field(\n 'redirect_url', // ID\n 'Redirect URL', // Title\n array( $this, 'redirect_url_callback' ), // Callback\n 'my-setting-admin', // Page\n 'setting_section_id' // Section\n );\n\n add_settings_field(\n 'client_id',\n 'Client ID',\n array( $this, 'client_id_callback' ),\n 'my-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'client_secret',\n 'Client Secret',\n array( $this, 'client_secret_callback' ),\n 'my-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'authorization_code',\n 'Authorization Code For An Access Token',\n array( $this, 'authorization_code_callback' ),\n 'my-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'access_token',\n 'Access Token',\n array( $this, 'access_token_callback' ),\n 'my-setting-admin',\n 'setting_section_id'\n );\n\n }", "private function setDefaultArgs()\n {\n $args = [\n 'title' => get_bloginfo('name'),\n 'url' => get_bloginfo('url'),\n 'desc' => get_bloginfo('description'),\n ];\n\n if (is_page() || is_singular()) {\n $args = [\n 'title' => get_the_title(),\n 'url' => get_permalink(),\n 'desc' => $this->getPostExcerpt(),\n ];\n }\n\n $this->setArgs(apply_filters('cgit_socialize_default_args', $args));\n }", "public function init()\n {\n\t\t$this->view->headTitle(Zend_Registry::get('Default Page Title'));\n\t\t$this->view->headTitle()->prepend('Partners');\n }", "function index()\n {\n\t$data = $this->page_settings('default', NULL, NULL, 'Users', 'users');\n\t$this->templates->backend($data);\n }", "function applyDefaults()\n {\n list($page, $action) = $this->controller->getActionName();\n $fe =& PEAR_PackageFileManager_Frontend::singleton();\n $fe->log('debug',\n str_pad($this->getAttribute('id') .'('. __LINE__ .')', 20, '.') .\n \" applyDefaults ActionName=($page,$action)\"\n );\n }", "protected function setUp()\n\t{\n\t\t$view = new \\Aimeos\\MW\\View\\Standard();\n\n\t\t$config = array(\n\t\t\t'page' => 'test',\n\t\t\t'sub' => array(\n\t\t\t\t'subpage' => 'test2',\n\t\t\t),\n\t\t);\n\n\t\t$conf = new \\Aimeos\\MW\\Config\\PHPArray( $config );\n\t\t$this->object = new \\Aimeos\\MW\\View\\Helper\\Config\\Standard( $view, $conf );\n\t}", "function set_page_properties(&$page){\n $page->add_css($page->skin_dir.'/../allpages/style.css');\n $page->add_css($page->skin_dir.'/style.css');\n }", "public function setPages() {\n $this->pages = array(\n array(\n 'page_title' => 'PM Plugin',\n 'menu_title' => 'PM',\n 'capability' => 'manage_options',\n 'menu_slug' => 'pm_plugin',\n 'callback' => array($this->callbacks, 'adminDashboard'),\n 'icon_url' => 'dashicons-store',\n 'position' => 110,\n ),\n );\n\n }", "public function init() {\n\t\t//theme needs to be set TWO times...\n\t\t$theme = Session::get(\"theme\"); if(!$theme) {$theme = \"main\";}SSViewer::set_theme($theme);\n\t\tparent::init();\n\t\tif($theme == \"main\") {\n\t\t\t$this->addBasicMetatagRequirements();\n\t\t}\n\t\t$theme = Session::get(\"theme\"); if(!$theme) {$theme = \"main\";}SSViewer::set_theme($theme);\n\t}", "public function init_admin_page() {\n\t\t$this->print_header();\n\t\t$this->load_template( WPEXPANSE_Blog_Styles_Pro::$plugin_data[\"this-dir\"].'templates/admin-area' );\n\t}", "public function options_page_init(){\n\t\t\tadd_options_page(__('Breaking News options', 'text-domain'), __('Breaking News', 'text-domain'), 'manage_options', 'breakingnews', [ $this, 'options_page_content']);\n\t\t}", "function adminDefault() {\n\t\t\n\t\t// load intro and options\n\t\t$this->content = new BlogPostIntro();\n\t\t$this->content->loadContent($GLOBALS['objPage']->id);\n\t\t\n\t\t// load confirmation\n\t\t$this->confirm = new CmsContent();\n\t\t$this->confirm->loadContent($GLOBALS['objPage']->id, 'confirm');\n\t\t\n\t\t// load no access message\n\t\t$this->noaccess = new CmsContent();\n\t\t$this->noaccess->loadContent($GLOBALS['objPage']->id, 'noaccess');\n\t\t\n\t\tif ($GLOBALS['confModule']['blog_post']['editor_full']) {\n\t\t\t$this->content->initAdmin('full',2);\n\t\t\t$this->confirm->initAdmin('full',2);\n\t\t\t$this->noaccess->initAdmin('full',2);\n\t\t} else {\n\t\t\t$this->content->initAdmin('Default',1);\n\t\t\t$this->confirm->initAdmin('Default',1);\n\t\t\t$this->noaccess->initAdmin('Default',1);\n\t\t}\n\t\t\n\t\t$this->data = new ContentBlogPost();\n\t\t$this->data->loadPostsList(true);\n\t\t\n\t\t// only if on page\n\t\t$GLOBALS['objCms']->initSubmitting(1,2); // save and save and close\n\n\t\t$this->baseLink = CMS_WWW_URI.'admin/special.php?module=blog';\n\t\t$this->setView('admin');\n\t\t\n\t}", "protected function assignDefaults() {\n\t\t$this->view->assignMultiple(\n\t\t\tarray(\n\t\t\t\t'timestamp'\t\t\t=> time(),\n\t\t\t\t'submission_date'\t=> date('d.m.Y H:i:s', time()),\n\t\t\t\t'randomId'\t\t\t=> Tx_Formhandler_Globals::$randomID,\n\t\t\t\t'fieldNamePrefix'\t=> Tx_Formhandler_Globals::$formValuesPrefix,\n\t\t\t\t'ip'\t\t\t\t=> t3lib_div::getIndpEnv('REMOTE_ADDR'),\n\t\t\t\t'pid'\t\t\t\t=> $GLOBALS['TSFE']->id,\n\t\t\t\t'currentStep'\t\t=> Tx_FormhandlerFluid_Util_Div::getSessionValue('currentStep'),\n\t\t\t\t'totalSteps'\t\t=> Tx_FormhandlerFluid_Util_Div::getSessionValue('totalSteps'),\n\t\t\t\t'lastStep'\t\t\t=> Tx_FormhandlerFluid_Util_Div::getSessionValue('lastStep'),\n\t\t\t\t// f:url(absolute:1) does not work correct :(\n\t\t\t\t'baseUrl'\t\t\t=> t3lib_div::locationHeaderUrl('')\n\t\t\t)\n\t\t);\n\t\t\n\t\tif ($this->gp['generated_authCode']) {\n\t\t\t$this->view->assign('authCode', $this->gp['generated_authCode']);\n\t\t}\n\t\t\n\t\t/*\n\t\tStepbar currently removed - probably this should move in a partial\n\t\t$markers['###step_bar###'] = $this->createStepBar(\n\t\t\tTx_FormhandlerFluid_Session::get('currentStep'),\n\t\t\tTx_FormhandlerFluid_Session::get('totalSteps'),\n\t\t\t$prevName,\n\t\t\t$nextName\n\t\t);\n\t\t*/\n\t\t\n\t\t/*\n\t\tNot yet realized\n\t\t$this->fillCaptchaMarkers($markers);\n\t\t$this->fillFEUserMarkers($markers);\n\t\t$this->fillFileMarkers($markers);\n\t\t*/\n\t}", "public function set_up() {\n\t\tparent::set_up();\n\n\t\t// Mock page objects.\n\t\t$this->pages = array(\n\t\t\t0 => (object) array(\n\t\t\t\t'ID' => 100,\n\t\t\t\t'post_parent' => 0,\n\t\t\t),\n\t\t\t1 => (object) array(\n\t\t\t\t'ID' => 101,\n\t\t\t\t'post_parent' => 100,\n\t\t\t),\n\t\t\t2 => (object) array(\n\t\t\t\t'ID' => 102,\n\t\t\t\t'post_parent' => 100,\n\t\t\t),\n\t\t\t3 => (object) array(\n\t\t\t\t'ID' => 103,\n\t\t\t\t'post_parent' => 101,\n\t\t\t),\n\n\t\t\t// Not in the tree.\n\t\t\t4 => (object) array(\n\t\t\t\t'ID' => 104,\n\t\t\t\t'post_parent' => 9898989898,\n\t\t\t),\n\n\t\t\t5 => (object) array(\n\t\t\t\t'ID' => 105,\n\t\t\t\t'post_parent' => 100,\n\t\t\t),\n\t\t\t6 => (object) array(\n\t\t\t\t'ID' => 106,\n\t\t\t\t'post_parent' => 102,\n\t\t\t),\n\t\t\t7 => (object) array(\n\t\t\t\t'ID' => 107,\n\t\t\t\t'post_parent' => 106,\n\t\t\t),\n\t\t\t8 => (object) array(\n\t\t\t\t'ID' => 108,\n\t\t\t\t'post_parent' => 107,\n\t\t\t),\n\t\t);\n\t}", "function publicDefault() {\n\t\t// initialize object content\n\t\t$this->content = new ContentFck();\n\t\t\n\t\t// load content corresponding to page\n\t\t$this->content->loadContent($GLOBALS['objPage']->id);\n\t\t\n\t\t// check options\n\t\t$this->content->initPublic();\n\t\t\n\t}", "public function page_setup(){\n add_menu_page( PLUGIN_NAME, PLUGIN_NAME, 'manage_options', sanitize_key(PLUGIN_NAME), array($this, 'admin_page'), $this->icon, 3 );\n }", "public function getDefaultSettings();", "public function init() {\n\t\tAnnuaire_User::mustBeConnected();\n\t\t$this->view->setLayout(\"default\");\n\t\t$this->view->addLayoutVar(\"onglet\", 4);\n\t}", "public function setup() {\n\t\t// set static properties in Kopa_Admin_Settings class\n\t\tKopa_Admin_Settings::get_settings_pages();\n\n\t\t/*\n\t\t * Make this theme available for translation.\n\t\t *\n\t\t * Translations can be added to the /languages/ directory.\n\t\t * If you're building a theme based on this theme,\n\t\t * change KOPA_DOMAIN constant value to the name \n\t\t * of your theme in functions.php\n\t\t */\n\t\tload_theme_textdomain( KOPA_DOMAIN, get_template_directory() . '/languages' );\n\n\t\t/**\n\t\t * Add custom layout feature\n\t\t * By default, just built-in post types and taxonomies have this feature\n\t\t * Built-in post types: post, page\n\t\t * Built-in taxonomies: category, post_tag\n\t\t * Use this filter hook 'kopa_custom_layout_arguments' to customize\n\t\t * this feature for custom post types and custom taxonomies\n\t\t */\n\t\tadd_theme_support( 'kopa_custom_layout', apply_filters( 'kopa_custom_layout_arguments', array(\n\t\t\tarray(\n\t\t\t\t'screen' => 'post',\n\t\t\t\t'taxonomy' => false,\n\t\t\t\t'layout' => 'post-layout',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'screen' => 'page',\n\t\t\t\t'taxonomy' => false,\n\t\t\t\t'layout' => 'page-layout',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'screen' => 'category',\n\t\t\t\t'taxonomy' => true,\n\t\t\t\t'layout' => 'blog-layout',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'screen' => 'post_tag',\n\t\t\t\t'taxonomy' => true,\n\t\t\t\t'layout' => 'blog-layout',\n\t\t\t),\n\t\t) ) );\n\t}", "public function initPageHeaders()\n\t{\n\t\tinclude_once('view/main_page_header.php');\n\t}", "protected function setupDefaults()\n {\n $this->addHandler('select', new SelectQueryHandler());\n $this->addHandler('search', new SearchQueryHandler());\n $this->addHandler('random', new RandomQueryHandler());\n $this->addHandler('first', new FirstQueryHandler());\n $this->addHandler('latest', new LatestQueryHandler());\n $this->addHandler('nativesearch', new NativeSearchHandler());\n $this->addHandler('namedselect', new IdentifiedSelectHandler());\n\n $this->addDirectiveHandler('getquery', new GetQueryDirective());\n $this->addDirectiveHandler('hydrate', new HydrateDirective());\n $this->addDirectiveHandler('limit', new LimitDirective());\n $this->addDirectiveHandler('order', new OrderDirective());\n $this->addDirectiveHandler('page', new OffsetDirective());\n $this->addDirectiveHandler('paging', new PagingDirective());\n $this->addDirectiveHandler('printquery', new PrintQueryDirective());\n $this->addDirectiveHandler('returnsingle', new ReturnSingleDirective());\n }", "public function saveDefaultValues() {\n\n\t\tforeach ( $this->getOptionsList() as $option_page ) {\n\t\t\t$option_page->setDefaultValue();\n\t\t}\n\t}", "public function define_settings_page() {\n\t\t$this->hook_suffix = add_options_page(\n\t\t\t__( 'Top Story Options', 'top-story' ),\n\t\t\t__( 'Top Story', 'top-story' ),\n\t\t\t'manage_options',\n\t\t\t$this->menu_slug,\n\t\t\tarray( $this, 'option_page' )\n\t\t);\n\t}", "function requireDefaultRecords() {\n\t\tif(!SiteTree::get_by_link(\"home\")){\n\t\t\t$homepage = new HomePage();\n\t\t\t$$homepage->Title = \"Home\";\n\t\t\t$homepage->URLSegment = \"home\";\n\t\t\t$homepage->Sort = 1;\n\t\t\t$homepage->write();\n\t\t\t$homepage->publish('Stage', 'Live');\n\t\t\t$homepage->flushCache();\n\t\t\tDB::alteration_message('Home Page created', 'created');\n\t\t} else {\n\t\t\t$homepage = SiteTree::get_by_link(\"home\");\n\t\t\tif($homepage->ClassName != \"HomePage\") {\n\t\t\t\t$homepage = $homepage->newClassInstance(\"HomePage\");\n\t\t\t\t$homepage->write();\n\t\t\t\t$homepage->publish('Stage', 'Live');\n\t\t\t\t$homepage->flushCache();\n\t\t\t\tDB::alteration_message('Home changed to HomePage', 'changed');\n\t\t\t}\n\t\t}\n\t\n\t\tparent::requireDefaultRecords();\n\t}", "public function init() {\n\t\tAnnuaire_User::mustBeConnected();\n\t\t$this->view->setLayout('default');\n\t}", "public function config_page() {\n\t\trequire HS_DOCS_API_DIR_PATH . 'admin/views/admin-page.php';\n\t}", "public function init()\n {\n $this->view->pageTitle = 'Sender:';\n $this->view->fullUrl = $this->view->serverUrl() . $this->view->baseUrl();\n }", "function adminDefault() {\n\t\t// decide submit modes\n\t\t$GLOBALS['objCms']->initSubmitting(1,2); // save and save and close\n\t\n\t\t// initialize object content\n\t\t$this->content = new ContentFck();\n\t\t\n\t\t// load content corresponding to page\n\t\t$this->content->loadContent($GLOBALS['objPage']->id);\n\t\n\t\t// set script for form\n\t\t$this->content->initAdmin('full', 2);\n\t\t\n\t\t$this->setView('admin_form');\n\t\t\n\t}", "public function page_init()\n { \n add_settings_section(\n 'setting_section_id', // ID\n 'My Custom Settings', // Title\n array( $this, 'print_section_info' ), // Callback\n 'my-setting-admin' // Page\n ); \n\n add_settings_field(\n 'id_number', // ID\n 'ID Number', // Title \n array( $this, 'id_number_callback' ), // Callback\n 'my-setting-admin', // Page\n 'setting_section_id' // Section \n ); \n\n add_settings_field(\n 'title', \n 'Title', \n array( $this, 'title_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n );\n add_settings_field(\n 'checkbox', \n 'Checkbox', \n array( $this, 'checkbox_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n add_settings_field(\n 'radio', \n 'Radio', \n array( $this, 'radio_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n add_settings_field(\n 'textarea', \n 'Textarea', \n array( $this, 'textarea_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n );\n add_settings_field(\n 'select', \n 'Select', \n array( $this, 'select_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n }", "public function loadDefaults(): void;", "public function initPage( OutputPage $out ) {\n\t\tglobal $wgLocalStylePath;\n\t\tparent::initPage( $out );\n\t\t//TODO add responsive viewport\t$out->addHeadItem()\n\t\t\n\t\t$out->addScriptFile( '/skins/smoothwiki/js/bootstrap.js' );\n\t}", "public function set_defaults() {\n\n\t\t// Retrieve the stylesheet option to set the proper defaults\n\t\t$style_option = tribe_get_option( 'stylesheetOption', 'tribe' );\n\n\t\tswitch ( $style_option ) {\n\t\t\tcase 'full': // Full styles\n\t\t\t\t$this->defaults = array(\n\t\t\t\t\t'table_bg_color' => '#fff',\n\t\t\t\t\t'highlight_color' => '#666',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'skeleton': // Skeleton styles\n\t\t\tdefault: // tribe styles is the default so add full and theme (tribe)\n\t\t\t\t$this->defaults = array(\n\t\t\t\t\t'table_bg_color' => '#f9f9f9',\n\t\t\t\t\t'highlight_color' => '#21759b',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function page_init()\n { \n register_setting(\n 'program_manager_option_group', // Option group\n 'program_manager_option', // Option name\n array( $this, 'sanitize' ) // Sanitize\n );\n\n add_settings_section(\n 'program_manager_section_id', // ID\n 'Program generator options', // Title\n array( $this, 'print_section_info' ), // Callback\n 'program_manager_admin' // Page\n ); \n\n add_settings_field(\n 'pre_days', // ID\n 'PRE conference days (separated by ,)', // Title \n array( $this, 'pre_days_callback' ), // Callback\n 'program_manager_admin', // Page\n 'program_manager_section_id' // Section \n ); \n\n add_settings_field(\n 'main_days', \n 'MAIN conference days (separated by ,)', \n array( $this, 'main_days_callback' ), \n 'program_manager_admin', \n 'program_manager_section_id'\n ); \n \n\tadd_settings_field(\n 'pre_days_file', // ID\n 'PRE conference xlsx file', // Title \n array( $this, 'pre_days_file_callback' ), // Callback\n 'program_manager_admin', // Page\n 'program_manager_section_id' // Section \n ); \n\n add_settings_field(\n 'main_days_file', \n 'MAIN conference xlsx file', \n array( $this, 'main_days_file_callback' ), \n 'program_manager_admin', \n 'program_manager_section_id'\n ); \n \n }", "public function page_init()\n { \n register_setting(\n 'my_option_group', // Option group\n 'my_option_name', // Option name\n array( $this, 'sanitize' ) // Sanitize\n );\n\n add_settings_section(\n 'setting_section_id', // ID\n 'CLAS DEPT Theme Settings', // Title\n array( $this, 'print_section_info' ), // Callback\n 'my-setting-admin' // Page\n ); \n\n add_settings_field(\n 'dept_address', // ID\n 'Department Address', // Title \n array( $this, 'dept_address_callback' ), // Callback\n 'my-setting-admin', // Page\n 'setting_section_id' // Section \n ); \n\n add_settings_field(\n 'title', \n 'Footer Title', \n array( $this, 'title_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'fb', \n 'Facebook Link', \n array( $this, 'fb_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'twitter', \n 'Twitter Link', \n array( $this, 'twitter_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'instagram', \n 'Instagram Link', \n array( $this, 'instagram_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'youtube', \n 'Youtube Link', \n array( $this, 'youtube_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'rss', \n 'RSS Link', \n array( $this, 'rss_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n \n }", "public function settingsPage() {\n require_once 'form.phtml';\n }", "function __construct($ptitle)\r\n {\r\n $this->_htmlpage = new HTMLPage($ptitle);\r\n $this->setPageDefaults();\r\n $this->setDynamicDefaults();\r\n }", "public function initialize_settings() {\n\n\t\t$default_settings = array();\n\n\t\tforeach ($this->settings as $id => $setting) {\n\t\t\tif ($setting['type'] != 'heading')\n\t\t\t\t$default_settings['$id'] = $setting['std'];\n\t\t}\n\n\t\tupdate_option('eaboot_options', $default_settings);\n\t}", "abstract protected function loadDefaults();", "public function initPage( OutputPage $out ) {\n\t\t$out->addMeta( 'viewport',\n\t\t\t'width=device-width, initial-scale=1.0, ' .\n\t\t\t'user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0'\n\t\t);\n\n\t\t$out->addModuleStyles( [\n\t\t\t// 'mediawiki.skinning.interface',\n\t\t\t// 'mediawiki.skinning.content.externallinks',\n\t\t\t'skins.ims'\n\t\t] );\n\t\t$out->addModules( [\n\t\t\t'skins.ims.js'\n\t\t] );\n\t}", "public function defaultAction(){\n\t\t$pseudo = \"Test\";\n\n\t\t//Affiche moi la vue home;\n\t\t$installer = new installer;\n\t\tif(!$installer->checkInstall() xor file_exists('.env.prod')){\n\t\t\theader('location: /installer');\n\t\t}else{\n\t\t$page = new Page();\n\t\t$acceuil = $page->getpageaccueil();\n\t\tif(!empty($acceuil)){\n\t\t\t$view = new View(\"page\", \"front\");\n\t\t\t$view->assign(\"page\",$acceuil[0]);\n\t\t\t$articles = $page->getArticleByIdPage($acceuil[0][\"id\"]);\n\t\t\t$view->assign('articles',$articles);\n\t\t\t$view->assign(\"title\",$acceuil[0]['slug']);\n\t\t}\n\t\telse{\n\t\t\t$view = new View();\n\t\t\t$view->assign(\"title\",\"Votre site\");\n\t\t}\n\t\t\n\t}\n\n\t\t//envoyer le pseudo à la vue\n\t}", "function fillWithDefaultValues() {\n\t\t$this->newIdt = \"default\"; \n\n\t\t$this->description = \"default template\";\n\t\t$this->postsHeader = \"<h2><%title%></h2><p><%description%></p><%navigation%><ul class=\\\"miniforum\\\">\"; \n\t\t$this->postBody = \"<li><%name%> [ <%date%> | <%time%> ] <br /><%body%></li>\";\n\t\t$this->postsFooter = \"</ul><br /><%navigation%>\";\n\t\t$this->formLogged = \"<textarea class='formfield' name='BODY' rows='3' cols='20'></textarea><br /><input type='submit' value='Send' />\\n\";\n\t\t$this->form = \"<label>name<input class='formfield' type='text' name='uname' value='<%name%>'/></label><br />\\n\".\n\t\t\t\t\t\t\t \"<label>e-mail<input class='formfield' type='text' name='email' value='<%email%>'/></label><br />\\n\".\n \t\t\t\t\t \"<label>url<input class='formfield' type='text' name='url' value='<%url%>'/></label><br />\\n\".\n\t\t\t\t\t\t\t \"<label>remember me<input class='formfield' type='checkbox' name='remember'/></label><br />\\n\".\n\t\t\t\t\t\t\t \"<textarea class='formfield' name='BODY' rows='3' cols='20'></textarea><br />\\n\".\n\t\t\t\t\t\t\t \"<input class='formbutton' type='submit' value='Send' />\";\n\t\t$this->navigation = \"<div class=\\\"forum\\\">[<%first-page%>][<%prev-page%>] (Page: <%cur-page%> from <%page-count%>) [<%next-page%>][<%last-page%>]</div>\";\n\t\t$this->name = \"<strong><%user-name%></strong> (<%user-email%>)\";\n\t\t$this->nameLin = \"<a href='<%user-link%>'><%user-name%></a>\";\n\t\t$this->memberName = \"<a class='member' href='<%user-link%>'><%user-name%></a>\";\n\t\t$this->date = \"d. m. y\";\n\t\t$this->time = \"H:i\"; \n\t\t$this->nextPage = \"Next\";\n\t\t$this->previousPage =\"Previous\";\n\t\t$this->firstPage = \"First\";\n\t\t$this->lastPage = \"Last\";\t\n\t\t$this->emoToImg = \t false;\n\t\t$this->urlToLink=\t true;\n\t\t$this->gravSize =\t 40; \n\t\t\n\t}", "public function init() {\n $this->registerScript();\n $this->registerCss();\n $classes = array();\n $validAlignments = array(self::ALIGNMENT_CENTER, self::ALIGNMENT_RIGHT);\n\n if (in_array($this->alignment, $validAlignments))\n $classes[] = 'pagination-' . $this->alignment;\n\n if (!empty($classes)) {\n $classes = implode(' ', $classes);\n if (isset($this->htmlOptions['class']))\n $this->htmlOptions['class'] = ' ' . $classes;\n else\n $this->htmlOptions['class'] = $classes;\n }\n if($this->nextPageLabel===null)\n $this->nextPageLabel=Yii::t('yii','&gt;');\n if($this->prevPageLabel===null)\n $this->prevPageLabel=Yii::t('yii','&lt;');\n if($this->firstPageLabel===null)\n $this->firstPageLabel=Yii::t('yii','&lt;&lt;');\n if($this->lastPageLabel===null)\n $this->lastPageLabel=Yii::t('yii','&gt;&gt;');\n if($this->header===null)\n $this->header=Yii::t('yii','Go to page: ');\n\n parent::init();\n }", "public function init() {\n\t\tadd_action( 'init', array( $this, 'new_page' ) );\n\t}", "public function startup() {\n\t\tA('AdminInterface')->bind('GatherAdminPages', array(\n\t\t\t'Core Settings' => array(\n\t\t\t\t'config' => $this->config,\n\t\t\t\t'fields' => array(\n\t\t\t\t\tSETTING_DEFAULT_BASE_PATH => array( \n\t\t\t\t\t\t'title' => 'Base Path',\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'value' => $this->config->getConfigValue(SETTING_DEFAULT_BASE_PATH)),\n\t\t\t\t\tSETTING_SITE_URL => array(\n\t\t\t\t\t\t'title' => 'Base URL',\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'value' => $this->config->getConfigValue(SETTING_SITE_URL, '')),\t\n\t\t\t\t\tSETTING_ENVIRONMENT => array(\n\t\t\t\t\t\t'title' => 'Environment',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'values' => array(\"Development\" => ENV_DEVELOPMENT, \"Test\" => ENV_TEST, \"Production\" => ENV_PRODUCTION),\n\t\t\t\t\t\t'selected' => $this->config->getConfigValue(SETTING_ENVIRONMENT)),\n\t\t\t\t),\n\t\t\t)\n\t\t));\n\t}", "protected function defaultdata()\n {\n // create one page with 2 columns and some content\n $page = array('title' => $this->__('Content introduction page'),\n 'urlname' => $this->__('content-introduction-page'),\n 'layout' => 'Column2d6238',\n 'setLeft' => '0',\n 'setRight' => '1',\n 'language' => ZLanguage::getLanguageCode());\n\n // Insert the default page\n if (!($obj = DBUtil::insertObject($page, 'content_page'))) {\n LogUtil::registerStatus($this->__('Warning! Could not create the default Content introductory page.'));\n } else {\n // create the contentitems for this page\n $content = array();\n $content[] = array('pageId' => $obj['id'],\n 'areaIndex' => '0',\n 'position' => '0',\n 'module' => 'Content',\n 'type' => 'Heading',\n 'data' => serialize(array('text' => $this->__('A Content page consists of various content items in a chosen layout'),\n 'headerSize' => 'h3')));\n $content[] = array('pageId' => $obj['id'],\n 'areaIndex' => '1',\n 'position' => '0',\n 'module' => 'Content',\n 'type' => 'Html',\n 'data' => serialize(array('text' => $this->__('<p>Each created page has a specific layout, like 1 column with and without a header, 2 columns, 3 columns. The chosen layout contains various content areas. In each area you can place 1 or more content items of various kinds like:</p> <ul> <li>HTML text;</li> <li>YouTube videos;</li> <li>Google maps;</li> <li>Flickr photos;</li> <li>RSS feeds;</li> <li>Computer Code;</li> <li>the output of another Zikula module.</li> </ul> <p>Within these content areas you can sort the content items by means of drag & drop.<br /> You can make an unlimited number of pages and structure them hierarchical. Your page structure can be displayed in a multi level menu in your website.</p>'),\n 'inputType' => 'text')));\n $content[] = array('pageId' => $obj['id'],\n 'areaIndex' => '1',\n 'position' => '1',\n 'module' => 'Content',\n 'type' => 'Html',\n 'data' => serialize(array('text' => $this->__('<p><strong>This is a second HTML text content item in the left column</strong><br /> Content is an extendible module. You can create your own content plugins and layouts and other Zikula modules can also offer content items. The News published module for instance has a Content plugin for a list of the latest articles.</p>'),\n 'inputType' => 'text')));\n $content[] = array('pageId' => $obj['id'],\n 'areaIndex' => '2',\n 'position' => '0',\n 'module' => 'Content',\n 'type' => 'Quote',\n 'data' => serialize(array('text' => $this->__('No matter what your needs, Zikula can provide the solution.'),\n 'source' => 'http://zikula.org', 'desc' => 'Zikula homepage')));\n $content[] = array('pageId' => $obj['id'],\n 'areaIndex' => '2',\n 'position' => '1',\n 'module' => 'Content',\n 'type' => 'ComputerCode',\n 'data' => serialize(array('text' => $this->__('$this->doAction($var); // just some code'))));\n $content[] = array('pageId' => $obj['id'],\n 'areaIndex' => '2',\n 'position' => '2',\n 'module' => 'Content',\n 'type' => 'Html',\n 'data' => serialize(array('text' => $this->__('<p>So you see that you can place all kinds of content on the page in your own style and liking. This makes Content a really powerful module.</p> <p>This page uses the <strong>2 column (62|38) layout</strong> which has a header, 2 colums with 62% width on the left and 38% width on the right and a footer</p>'),\n 'inputType' => 'text')));\n $content[] = array('pageId' => $obj['id'],\n 'areaIndex' => '3',\n 'position' => '0',\n 'module' => 'Content',\n 'type' => 'Html',\n 'data' => serialize(array('text' => $this->__('This <strong>footer</strong> finishes of this introduction page. Good luck with using Content. The <a href=\"index.php?module=content&type=admin\">Edit Contents</a> interface lets you edit or delete this introduction page. In the <a href=\"index.php?module=content&type=admin\">administration</a> interface you can further control the Content module.'),\n 'inputType' => 'text')));\n\n // write the items to the dbase\n foreach ($content as $contentitem) {\n DBUtil::insertObject($contentitem, 'content_content');\n }\n }\n }", "function index() {\n\t\t$this->theme = $this->passedArgs['theme'];\n\t\t$this->layout = $this->passedArgs['layout'];\n\t}", "protected function initPageRenderer() {}", "protected function initPageRenderer() {}", "public static function init() {\n\t\tif (self::$_initialized) {\n\t\t\treturn;\n\t\t}\n\t\tparent::setInstance(new Page());\n\t\tself::$_initialized = true;\n\t}", "private function setDefaultValues()\n {\n // Set default payment action.\n if (empty($this->paymentAction)) {\n $this->paymentAction = 'Sale';\n }\n\n // Set default locale.\n if (empty($this->locale)) {\n $this->locale = 'en_US';\n }\n\n // Set default value for SSL validation.\n if (empty($this->validateSSL)) {\n $this->validateSSL = false;\n }\n }", "public function config()\n\t{\n\t\tparent::config();\n\n\t\t// change inpu\n\t\tif(self::done_step('username'))\n\t\t{\n\t\t\t// if user go to this page from username page\n\t\t\t$this->data->mobile_username = 'eusername';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// if user go to this page from mobile page\n\t\t\t$this->data->mobile_username = 'emobile';\n\t\t}\n\n\t\t// load temp username in username field\n\t\tif(self::get_session('username', 'temp_username'))\n\t\t{\n\t\t\t$this->data->get_username = self::get_session('username', 'temp_username');\n\t\t}\n\n\t\t$this->data->page['title'] = T_('Password');\n\t\t$this->data->page['desc'] = T_('Please enter password to enter');\n\n\t\tswitch (\\lib\\router::get_url(1))\n\t\t{\n\t\t\tcase 'recovery':\n\t\t\t\t$this->data->page['title'] = T_('Recovery Password');\n\t\t\t\t$this->data->page['desc'] = T_('If forget your password, Please enter new password. after pass verification your new password is usable.');\n\t\t\t\tbreak;\n\n\t\t\tcase 'signup':\n\t\t\tcase 'set':\n\t\t\t\t$this->data->page['title'] = T_('Set Password');\n\t\t\t\t$this->data->page['desc'] = T_('Please set your password to secure signup.'). ' '. T_('Next time we only need your mobile and this password to enter');\n\t\t\t\tbreak;\n\n\t\t\tcase 'change':\n\t\t\t\t$this->data->page['title'] = T_('Change to new Password');\n\t\t\t\t$this->data->page['desc'] = T_('Please set your old and new password to change it');\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}" ]
[ "0.7362204", "0.7002553", "0.69986475", "0.69279706", "0.69279706", "0.6767306", "0.67425966", "0.67388934", "0.6633468", "0.6548153", "0.6546395", "0.65377283", "0.6498041", "0.6494784", "0.64900386", "0.6463835", "0.64476943", "0.6428139", "0.64153785", "0.6392683", "0.63925505", "0.6385813", "0.6385141", "0.63536984", "0.6345126", "0.6339872", "0.63290066", "0.63219506", "0.63008034", "0.6299508", "0.6295494", "0.62953866", "0.6286503", "0.6277382", "0.6271093", "0.6266504", "0.62547", "0.625208", "0.6247633", "0.62470514", "0.61885464", "0.6173124", "0.61376816", "0.6131929", "0.61273247", "0.6127083", "0.611746", "0.6108352", "0.6097721", "0.60976756", "0.60970795", "0.6085834", "0.60817486", "0.60799015", "0.60762733", "0.60554594", "0.60553604", "0.60527456", "0.6051252", "0.6047608", "0.60379314", "0.6037126", "0.60360277", "0.6030643", "0.6026307", "0.60259414", "0.6021496", "0.6018223", "0.60165495", "0.6015821", "0.6006138", "0.6002323", "0.5995576", "0.5987868", "0.59851456", "0.5982782", "0.59784365", "0.597711", "0.59752804", "0.5960708", "0.59601355", "0.5959827", "0.5952552", "0.59519595", "0.59487677", "0.5948443", "0.5945388", "0.594426", "0.59424853", "0.5938931", "0.59347695", "0.5927066", "0.592483", "0.5920329", "0.59176636", "0.59140825", "0.5913014", "0.59120375", "0.591183", "0.5910237" ]
0.6752894
6
Set up default permissions.
public function initializePermissions() { Loader::helper('clov_permissions', 'clov'); $page = $this->getCollectionObject(); ClovPermissionsHelper::setBaselinePermissions($page); // Project managers and employees can add new expenses. $clovGroups = Loader::package('clov')->getGroups(); $page->assignPermissions($clovGroups[ClovPackage::PROJECT_MANAGERS], array('add_subpage')); $page->assignPermissions($clovGroups[ClovPackage::EMPLOYEES], array('add_subpage')); // Only allow clov_expense pages under this one. ClovPermissionsHelper::restrictSubpageType($page, CollectionType::getByHandle('clov_expense')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDefaultPermissions()\n {\n $this->allow('guest', 'default_error');\n $this->allow('guest', 'default_uploader');\n $this->allow('guest', 'default_lang');\n $this->allow('guest', 'people_auth');\n $this->allow('guest', 'api_auth');\n $this->allow('guest', 'api_search');\n $this->allow('guest', 'api_company');\n $this->allow('guest', 'api_entidad');\n $this->allow('guest', 'frontend_index');\n $this->allow('guest', 'frontend_auth');\n $this->allow('guest', 'frontend_account');\n $this->allow('guest', 'frontend_auction');\n $this->allow('guest', 'frontend_search');\n $this->allow('guest', 'frontend_product');\n $this->allow('guest', 'frontend_page');\n /**\n * User Access Level Permissions\n */\n $this->allow('user', 'default_index');\n $this->allow('user', 'default_error');\n $this->allow('user', 'default_uploader');\n $this->allow('user', 'default_lang');\n $this->allow('user', 'people_auth');\n $this->allow('user', 'search_index');\n $this->allow('user', 'frontend_search');\n $this->allow('user', 'frontend_product');\n $this->allow('user', 'frontend_page');\n $this->allow('user', 'people_user', array(\n 'my', // View My Details Page\n 'view', // View User Details Page\n 'changepassword', // Change Password Page\n 'updateavatar', // Update Avatar Lightbox\n 'getavatar', // Get Avatar JSON Call\n 'get-addr-avatar','setavatar', // Set Avatar JSON Call\n 'removeavatar' // Remove Avatar JSON Call\n ));\n\n /* $this->allow('user', 'company_manage', array(\n 'index', // Company List Page\n 'view' // Company View Page\n ));*/\n }", "protected function assignPermissions()\n {\n $role = Role::whereName(config('system.default_role.admin'))->first();\n $role->syncPermissions(config('system.default_permission'));\n }", "protected function configurePermissions()\n {\n Jetstream::defaultApiTokenPermissions(['read']);\n\n Jetstream::permissions([\n 'create',\n 'read',\n 'update',\n 'delete',\n ]);\n }", "protected function setApplicationPermissions()\n\t{\n\t\t$base = $this->app['path.base'].'/';\n\t\t$app = str_replace($base, null, $this->app['path']);\n\t\t$storage = str_replace($base, null, $this->app['path.storage']);\n\t\t$public = str_replace($base, null, $this->app['path.public']);\n\n\t\t$this->setPermissions($app.'/database/production.sqlite');\n\t\t$this->setPermissions($storage);\n\t\t$this->setPermissions($public);\n\t}", "protected function configurePermissions()\n {\n Jetstream::defaultApiTokenPermissions(['read']);\n\n Jetstream::role('admin', __('Administrator'), [\n 'create',\n 'read',\n 'update',\n 'delete',\n ])->description(__('Administrator users can perform any action.'));\n\n Jetstream::role('editor', __('Editor'), [\n 'read',\n 'create',\n 'update',\n ])->description(__('Editor users have the ability to read, create, and update.'));\n }", "public function setPermissions() {\r\n\t\tif ($this->canSave) {\r\n\t\t\t$this->canSave = $this->resource->checkPolicy('save');\r\n\t\t}\r\n\t\t$this->canEdit = $this->modx->hasPermission('edit_document');\r\n\t\t$this->canCreate = $this->modx->hasPermission('new_document');\r\n\t\t$this->canPublish = $this->modx->hasPermission('publish_document');\r\n\t\t$this->canDelete = ($this->modx->hasPermission('delete_document') && $this->resource->checkPolicy(array('save' => true, 'delete' => true)));\r\n\t\t$this->canDuplicate = $this->resource->checkPolicy('save');\r\n\t}", "protected function configurePermissions()\n {\n Jetstream::defaultApiTokenPermissions(['read']);\n\n Jetstream::role('admin', __('Yonetici'), [\n 'create',\n 'read',\n 'update',\n 'delete',\n ])->description(__('Şirket hakkındaki herşeyi yapabilir'));\n\n Jetstream::role('editor', __('İlan Yöneticisi'), [\n 'read',\n 'create',\n 'update',\n ])->description(__('Sadece ilanları yönetebilir'));\n Jetstream::role('operasyon', __('Operasyon Yöneticisi'), [\n 'read',\n 'create',\n 'update',\n ])->description(__('Sadece operasyonları yönetebilir'));\n\n }", "protected function getDefaultPermissions(): int\n {\n return 0666;\n }", "public function defaultPermissions(): array\n {\n return [];\n }", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function RegisterRolesAndPermissions()\n {\n //create role by defined default data in config->permission.php\n //if don't exist in database\n if (Role::where('name', config('permission.default_roles')[0])->count() <1){\n foreach (config('permission.default_roles') as $role){\n Role::create([\n 'name' => $role,\n ]);\n }\n }\n\n //create permission by defined default data in config->permission.php\n //if don't exist in database\n if (Permission::where('name', config('permission.default_permission')[0])->count() <1) {\n foreach (config('permission.default_permission') as $permission) {\n Permission::create([\n 'name' => $permission,\n ]);\n }\n }\n }", "public function run()\n {\n Permission::insert(config('permissions', true));\n }", "public function setPermissions($permissions) {}", "public function setPermissions()\n\t{\n\t\treturn [\n\t\t\t'product.create',\n\t\t 'issue.create',\n\t\t 'issue.edit'\n\t\t];\n\t}", "public function __construct()\n {\n parent::__construct();\n\n $this->permissions = config('xmake.createEverything');\n }", "public function init() {\n $config_array = $this->config->toArray();\n $prev_role = null;\n\n foreach ($config_array as $role => $permissions) {\n $prev_role = $this->addUserRole($role, $prev_role);\n \n if(empty($permissions) || !is_array($permissions)) {\n continue;\n }\n \n foreach($permissions as $controller => $actionList) {\n $controller = $this->addController($controller);\n $priviliges = $this->getPriviliges($actionList);\n \n $this->allow($role, $controller, $priviliges);\n } \n }\n }", "function _gizra_access_user_default_permissions() {\n $permissions = array();\n\n // Exported permission: create profile content\n $permissions[] = array(\n 'name' => 'create profile content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: edit own profile content\n $permissions[] = array(\n 'name' => 'edit own profile content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: view field_hidden_field\n $permissions[] = array(\n 'name' => 'view field_hidden_field',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n return $permissions;\n}", "function _hippel_discussions_user_default_permissions() {\n $permissions = array();\n\n // Exported permission: create discuss content\n $permissions[] = array(\n 'name' => 'create discuss content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: create reply content\n $permissions[] = array(\n 'name' => 'create reply content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: edit own discuss content\n $permissions[] = array(\n 'name' => 'edit own discuss content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: edit own reply content\n $permissions[] = array(\n 'name' => 'edit own reply content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: use PHP for title patterns\n $permissions[] = array(\n 'name' => 'use PHP for title patterns',\n 'roles' => array(),\n );\n\n // Exported permission: use vote up/down\n $permissions[] = array(\n 'name' => 'use vote up/down',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: use vote up/down on nodes\n $permissions[] = array(\n 'name' => 'use vote up/down on nodes',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: view vote up/down count on nodes\n $permissions[] = array(\n 'name' => 'view vote up/down count on nodes',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n return $permissions;\n}", "function _scholar_polls_user_default_permissions() {\n $permissions = array();\n\n // Exported permission: create poll content\n $permissions[] = array(\n 'name' => 'create poll content',\n 'roles' => array(\n '0' => 'scholar admin',\n ),\n );\n\n // Exported permission: delete own poll content\n $permissions[] = array(\n 'name' => 'delete own poll content',\n 'roles' => array(\n '0' => 'scholar admin',\n ),\n );\n\n // Exported permission: edit own poll content\n $permissions[] = array(\n 'name' => 'edit own poll content',\n 'roles' => array(\n '0' => 'scholar admin',\n ),\n );\n\n // Exported permission: override poll promote to front page option\n $permissions[] = array(\n 'name' => 'override poll promote to front page option',\n 'roles' => array(\n '0' => 'scholar admin',\n ),\n );\n\n // Exported permission: override poll published option\n $permissions[] = array(\n 'name' => 'override poll published option',\n 'roles' => array(\n '0' => 'scholar admin',\n ),\n );\n\n // Exported permission: override poll revision option\n $permissions[] = array(\n 'name' => 'override poll revision option',\n 'roles' => array(),\n );\n\n // Exported permission: override poll sticky option\n $permissions[] = array(\n 'name' => 'override poll sticky option',\n 'roles' => array(\n '0' => 'scholar admin',\n ),\n );\n\n // Exported permission: vote on polls\n $permissions[] = array(\n 'name' => 'vote on polls',\n 'roles' => array(\n '0' => 'anonymous user',\n '1' => 'authenticated user',\n ),\n );\n\n return $permissions;\n}", "public function testAllPermissionSets()\n {\n }", "protected function _setupPrivileges()\n {\n $this->_acl\t->allow( 'guest', 'index', 'index' )\n ->allow( 'guest', 'auth' , array('index', 'login', 'logout') )\n ->allow( 'guest', 'register', 'index');\n\n $this->_acl\t->allow( 'user', 'index', 'index' )\n ->allow( 'user', 'auth' , array('index', 'login', 'logout') )\n ->allow( 'user', 'register', 'index')\n ->allow( 'user', 'dashboard', 'index');\n }", "function initialize_forge_management_permissions()\n {\n //ROLES\n $manageForge = role_first_or_create('manage-forge');\n $student = role_first_or_create('student');\n $teacher = role_first_or_create('teacher');\n\n initialize_groups_management_permissions();\n give_permission_to_role($teacher, 'list-groups');\n give_permission_to_role($teacher, 'list-groups');\n give_permission_to_role($teacher, 'list-groups');\n\n //ASSIGNMENT\n permission_first_or_create('show-assignment');\n give_permission_to_role($teacher, 'show-assignment');\n permission_first_or_create('list-assignment');\n give_permission_to_role($teacher, 'list-assignment');\n permission_first_or_create('store-assignment');\n give_permission_to_role($teacher, 'store-assignment');\n permission_first_or_create('update-assignment');\n give_permission_to_role($teacher, 'update-assignment');\n permission_first_or_create('destroy-assignment');\n give_permission_to_role($teacher, 'destroy-assignment');\n permission_first_or_create('assign-users-to-assignments');\n give_permission_to_role($teacher, 'assign-users-to-assignments');\n permission_first_or_create('assign-groups-to-assignments');\n give_permission_to_role($teacher, 'assign-groups-to-assignments');\n\n //MANAGE FORGE ROLE\n permission_first_or_create('list-user-servers');\n permission_first_or_create('store-user-servers');\n permission_first_or_create('ask-server-permissions');\n permission_first_or_create('validate-server-permissions');\n permission_first_or_create('create-server-sites');\n permission_first_or_create('install-git-repositories');\n permission_first_or_create('install-ssh-keys');\n permission_first_or_create('enable-auto-deploy');\n permission_first_or_create('disable-auto-deploy');\n permission_first_or_create('obtain-lets-encrypt-certificate');\n permission_first_or_create('activate-certificate');\n permission_first_or_create('list-certificates');\n permission_first_or_create('deploy-site');\n permission_first_or_create('list-mysql');\n permission_first_or_create('show-mysql');\n permission_first_or_create('create-mysql');\n permission_first_or_create('list-mysql-users');\n permission_first_or_create('show-mysql-user');\n permission_first_or_create('create-mysql-user');\n\n permission_first_or_create('show-deployment-script');\n permission_first_or_create('update-deployment-script');\n\n\n give_permission_to_role($manageForge, 'list-user-servers');\n give_permission_to_role($manageForge, 'store-user-servers');\n give_permission_to_role($manageForge, 'ask-server-permissions');\n give_permission_to_role($manageForge, 'validate-server-permissions');\n give_permission_to_role($manageForge, 'create-server-sites');\n give_permission_to_role($manageForge, 'install-git-repositories');\n give_permission_to_role($manageForge, 'install-ssh-keys');\n give_permission_to_role($manageForge, 'enable-auto-deploy');\n give_permission_to_role($manageForge, 'disable-auto-deploy');\n give_permission_to_role($manageForge, 'obtain-lets-encrypt-certificate');\n give_permission_to_role($manageForge, 'activate-certificate');\n give_permission_to_role($manageForge, 'list-certificates');\n give_permission_to_role($manageForge, 'deploy-site');\n give_permission_to_role($manageForge, 'list-mysql');\n give_permission_to_role($manageForge, 'show-mysql');\n give_permission_to_role($manageForge, 'create-mysql');\n give_permission_to_role($manageForge, 'list-mysql-users');\n give_permission_to_role($manageForge, 'show-mysql-user');\n give_permission_to_role($manageForge, 'create-mysql-user');\n\n give_permission_to_role($manageForge, 'show-deployment-script');\n give_permission_to_role($manageForge, 'update-deployment-script');\n\n\n //STUDENT ROLE\n permission_first_or_create('todo');\n give_permission_to_role($student, 'todo');\n\n app(PermissionRegistrar::class)->registerPermissions();\n }", "public function run()\n {\n Permission::factory(SC::PERMISSIONS_COUNT)->create();\n }", "public function run()\n {\n App\\Role::find(1)->attachPermission(1);\n App\\Role::find(1)->attachPermission(2);\n App\\Role::find(1)->attachPermission(3);\n }", "protected function fixPermission() {}", "public function setPermissions($permissions);", "protected function setupPermissionFields()\n {\n $tab = 'Permission';\n\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_STAFF))->setLabel('Manage Staff')->setTabGroup($tab)\n// ->setNotes('Add/Edit Staff user accounts');\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_STUDENT))->setLabel('Manage Students')->setTabGroup($tab)\n// ->setNotes('Add/Edit Student user accounts');\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_SUBJECT))->setLabel('Manage Subjects')->setTabGroup($tab)\n// ->setNotes('Add/Edit subject and student enrollments');\n }", "public function setAdminPermissions(array $permissions): void;", "public function testPermissionSet()\n {\n }", "private function registerPermissions(): void\n {\n Gate::before(static function (Authorizable $user, string $ability) {\n if (method_exists($user, 'checkPermissionTo')) {\n return $user->checkPermissionTo($ability) ?: NULL;\n }\n });\n }", "public function testAllPermissions()\n {\n }", "public function run()\n {\n Permission::create([\n 'name' => 'company',\n 'guard_name' => 'web',\n ]);\n\n Permission::create([\n 'name' => 'customer',\n 'guard_name' => 'web',\n ]);\n }", "function SettingsController_DefineAdminPermissions_Handler(&$Sender) {\n if (isset($Sender->RequiredAdminPermissions)) {\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Settings.Manage';\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Categories.Manage';\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Spam.Manage';\n }\n }", "public function run()\n {\n Permission::create([\n 'name' => 'create_labels',\n ]);\n\n Permission::create([\n 'name' => 'update_labels',\n ]);\n\n Permission::create([\n 'name' => 'delete_labels',\n ]);\n\n Permission::create([\n 'name' => 'generate_language_files',\n ]);\n\n // Site Admin\n $site_admin_role = Role::create([\n 'name' => 'site_admin',\n ]);\n\n // Client Admin\n $client_admin_role = Role::create([\n 'name' => 'client_admin',\n ]);\n\n // Customer\n $customer_role = Role::create([\n 'name' => 'customer',\n ]);\n\n $site_admin_role->givePermissionTo([\n 'create_labels',\n 'update_labels',\n 'delete_labels',\n ]);\n }", "public function run()\n\t{\n\t\tModel::unguard();\n\n\t\tPermission::create(['role' => 'Root']);\n\t\tPermission::create(['role' => 'Administrador']);\n\t\tPermission::create(['role' => 'Usuário']);\n\t}", "public function SetPermissions ($permissions);", "public function registerPermissions()\n {\n return [];\n }", "public function registerPermissions()\n {\n return [];\n }", "public function __construct()\n\t{\n\t\tparent::__construct('fuel_permissions');\n\t}", "public function testCreatePermissionSet()\n {\n }", "public function create()\n\t{\n\t\t//Permissions are created via code\n\t}", "function wpms_classifieds_build_permissions() {\n\tdo_action(\"wpms_build_premissions\");\n\tif (function_exists('get_role')) {\n\t\t$role = array(get_role('administrator'), get_role('editor'), get_role('author'));\n\t\tforeach ($role as $r) {\n\t\t\tif ($r != null && !$role->has_cap('use_accueil')) {\n\t\t\t\t$r->add_cap('use_accueil');\n\t\t\t}\n\t\t\tif ($r != null && !$role->has_cap('admin_accueil')) {\n\t\t\t\t$r->add_cap('admin_accueil');\n\t\t\t}\n\t\t\tunset($r);\n\t\t}\n\t}\n}", "public function givePermission($permissions);", "public function registerPermissions()\n {\n // Remove this line and uncomment block to activate\n return [\n 'IgniterLabs.Shipday.ManageSettings' => [\n 'description' => 'lang:igniterlabs.shipday::default.help_permission',\n 'group' => 'module',\n ],\n ];\n }", "public function run()\n {\n Permission::create(array(\n 'name' => 'manage-user',\n 'display_name' => 'User Management',\n 'description' => 'System User Manger'\n ));\n\n Permission::create(array(\n 'name' => 'manage-role',\n 'display_name' => 'Role Management',\n 'description' => 'Site Role Manager'\n ));\n\n Permission::create(array(\n 'name' => 'manage-permission',\n 'display_name' => 'Permission Management',\n 'description' => 'Site Permission Manager'\n ));\n\n }", "public function setPrivilages()\n {\n // $this->acl->allow('guest',null, array('view', 'index'));\n // $this->acl->allow('editor',array('view','edit'));\n // $this->acl->allow('admin');\n \n // Setting privilages for actions as per particular controller\n // $this->acl->allow('<role>','<controller>', <array of controller actions>);\n // You can also fetch it from DB.\n \n// // $this->acl->deny('guest','news', 'index');\n// $this->acl->allow('guest','news', array( 'demo1', 'view', 'index'));\n// $this->acl->allow('guest','job-board', array('index'));\n//\n// $this->acl->allow('editor','news', array( 'edit', 'view', 'index')); \n// $this->acl->allow('editor','job-board', array('edit', 'index'));\n//\n// $this->acl->allow('admin');\n //$this->acl->allow('guest');\n //Guest ACL\n $this->acl->deny('guest',array('user','shop','admin'));\n $this->acl->allow('guest','index');\n \n //User ACL\n $this->acl->deny('user',array('shop','admin'));\n $this->acl->allow('user','user');\n $this->acl->allow('user','index',array('logout','notfound'));\n \n \n // Shop ACL\n $this->acl->deny('shop',array('user','admin'));\n $this->acl->allow('shop',array('index','shop'));\n \n //Admin ACL\n //$this->acl->deny('admin',array('user','shop'));\n //$this->acl->allow('admin',array('index','admin'));\n $this->acl->allow('admin');\n // Note that the actions which are not mentioned above i.e. inside array of\n // controller-action - becomes access-denied automatically\n // as in above example, news controller also have one more action demo2,\n // but demo2 is not mentioned in above allow actions, so \n // when guest tries to access the action - demo2, it would not show the \n // content of demo2, rather It would show content of error/index.phtml\n }", "public function __construct()\n {\n $this->setPermissions(array(\n 'create' => 'blog',\n 'store' => 'blog',\n 'edit' => 'blog',\n 'update' => 'blog',\n 'destroy' => 'blog',\n ));\n\n parent::__construct();\n }", "function custom_permissions() {\n\t\tif ($this->dx_auth->is_logged_in()) {\n\t\t\techo 'My role: '.$this->dx_auth->get_role_name().'<br/>';\n\t\t\techo 'My permission: <br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('edit') != NULL AND $this->dx_auth->get_permission_value('edit')) {\n\t\t\t\techo 'Edit is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Edit is not allowed';\n\t\t\t}\n\t\t\t\n\t\t\techo '<br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('delete') != NULL AND $this->dx_auth->get_permission_value('delete')) {\n\t\t\t\techo 'Delete is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Delete is not allowed';\n\t\t\t}\n\t\t}\n\t}", "public function run()\n {\n $permissions = CorePermission::all();\n $permissionSlugFieldName = CorePermission::getSlugField();\n\n //!!!! DO NOT MOVE THE ORDER.\n //Permissions.\n if ( ! $permissions->contains($permissionSlugFieldName, CorePermissionContract::CAN_SIGN_IN) ) {\n CorePermission::factory()\n ->createOne([ 'name_en' => 'Can sign-in into client side', 'slug' => CorePermissionContract::CAN_SIGN_IN ]);\n\n CoreRole::factory()\n ->createOne([ 'name_en' => 'Can sign-in into client side', 'slug' => CoreRoleContract::CAN_SIGN_IN ])\n ->permissions()\n ->sync([ 1 ]);\n }\n\n if ( ! $permissions->contains($permissionSlugFieldName, CorePermissionContract::CAN_BACKEND_SIGN_IN) ) {\n CorePermission::factory()\n ->createOne([ 'name_en' => 'Can sign-in into Admin panel', 'slug' => CorePermissionContract::CAN_BACKEND_SIGN_IN ]);\n\n CoreRole::factory()\n ->createOne([ 'name_en' => 'Can sign-in into Admin panel', 'slug' => CoreRoleContract::CAN_BACKEND_SIGN_IN ])\n ->permissions()\n ->sync([ 2 ]);\n }\n\n if ( ! $permissions->contains($permissionSlugFieldName, CorePermissionContract::CAN_USER_ACCESS) ) {\n CorePermission::factory()\n ->createOne([ 'name_en' => 'Can have user access', 'slug' => CorePermissionContract::CAN_USER_ACCESS ]);\n\n CoreRole::factory()->createOne([ 'name_en' => 'User Access', 'slug' => CoreRoleContract::CAN_USER ])\n ->permissions()->sync([ 3 ]);\n }\n\n if ( ! $permissions->contains($permissionSlugFieldName, CorePermissionContract::CAN_ADMIN_ACCESS) ) {\n CorePermission::factory()\n ->createOne([ 'name_en' => 'Can have super admin access', 'slug' => CorePermissionContract::CAN_ADMIN_ACCESS ]);\n\n CoreRole::factory()->createOne([ 'name_en' => 'Super Admin access', 'slug' => CoreRoleContract::CAN_ADMIN ])\n ->permissions()->sync([ 4 ]);\n }\n\n if ( ! $permissions->contains($permissionSlugFieldName, CorePermissionContract::CAN_ADMIN_ACCESS) ) {\n CorePermission::factory()\n ->createOne([ 'name_en' => 'Can have manager access into Admin panel', 'slug' => CorePermissionContract::CAN_OPERATOR_ACCESS ]);\n\n CoreRole::factory()->createOne([ 'name_en' => 'Manager Access', 'slug' => CoreRoleContract::CAN_OPERATOR ])\n ->permissions()->sync([ 5 ]);\n }\n\n\n // Update main admin.\n if ( $user = CoreUser::byEmail(config('kit-auth.start-user.email'))->first() ) {\n $user->actAs([\n CoreRoleContract::CAN_SIGN_IN, CoreRoleContract::CAN_BACKEND_SIGN_IN, CoreRoleContract::CAN_ADMIN,\n ]);\n }\n }", "public function run()\n {\n $permission = new Permission();\n $permAdmin = $permission->create([\n 'name' => 'admin',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage administrators'\n ]);\n $permission = new Permission();\n $permInstAdmin = $permission->create([\n 'name' => 'instadmin',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage institution administrators'\n ]);\n $permission = new Permission();\n $permInstSubAdmins = $permission->create([\n 'name' => 'instsubadmins',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage institution sub-administrators'\n ]);\n $permission = new Permission();\n $permInstructors = $permission->create([\n 'name' => 'instructors',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage instructors'\n ]);\n $permission = new Permission();\n $permOwnInstructors = $permission->create([\n 'name' => 'owninstructors',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage own instructors'\n ]);\n $permission = new Permission();\n $permStudents = $permission->create([\n 'name' => 'students',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage students'\n ]);\n $permission = new Permission();\n $permOwnStudents = $permission->create([\n 'name' => 'ownstudents',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage own students'\n ]);\n $permission = new Permission();\n $permInstitution = $permission->create([\n 'name' => 'institution',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage institutions'\n ]);\n $permission = new Permission();\n $permOwnInstitution = $permission->create([\n 'name' => 'owninstitution',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage own institution'\n ]);\n $permission = new Permission();\n $permAssignments = $permission->create([\n 'name' => 'assignments',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage assignments'\n ]);\n $permission = new Permission();\n $permInstAssignments = $permission->create([\n 'name' => 'instassignments',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage inst assignments'\n ]);\n $permission = new Permission();\n $permOwnAssignments = $permission->create([\n 'name' => 'ownassignments',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage own assignments'\n ]);\n $permission = new Permission();\n $permCourses = $permission->create([\n 'name' => 'courses',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage course'\n ]);\n $permission = new Permission();\n $permInstCourses = $permission->create([\n 'name' => 'instcourses',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage inst course'\n ]);\n $permission = new Permission();\n $permOwnCourses = $permission->create([\n 'name' => 'owncourses',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage own courses'\n ]);\n $permission = new Permission();\n $permSchedule = $permission->create([\n 'name' => 'schedule',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage schedule'\n ]);\n $permission = new Permission();\n $permInstSchedule = $permission->create([\n 'name' => 'instschedule',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage inst schedule'\n ]);\n $permission = new Permission();\n $permOwnSchedule = $permission->create([\n 'name' => 'ownschedule',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage own schedule'\n ]);\n $permission = new Permission();\n $permScores = $permission->create([\n 'name' => 'scores',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage scores'\n ]);\n $permission = new Permission();\n $permInstScores = $permission->create([\n 'name' => 'instscores',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage inst scores'\n ]);\n $permission = new Permission();\n $permOwnScores = $permission->create([\n 'name' => 'ownscores',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage own scores'\n ]);\n $permission = new Permission();\n $permGraders = $permission->create([\n 'name' => 'graders',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage graders'\n ]);\n $permission = new Permission();\n $permObserservers = $permission->create([\n 'name' => 'observers',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage observers'\n ]);\n $permission = new Permission();\n $permGuests = $permission->create([\n 'name' => 'guests',\n 'slug' => [ // pass an array of permissions.\n 'create' => true,\n 'view' => true,\n 'update' => true,\n 'delete' => true,\n 'view.phone' => true\n ],\n 'description' => 'manage guests'\n ]);\n\n }", "public function init() {\n \n $this->_helper->acl->allow('public',null);\n }", "public function run()\n {\n $permission = Permission::create([\n 'name' => 'administrador'\n ]);\n\n $permission = Permission::create([\n 'name' => 'cliente'\n ]);\n }", "public function run(): void\n {\n foreach ($this->getDefault() as $role) {\n if (!Role::whereName($role['name'])->exists()) {\n unset($role['permissions']);\n\n Role::create($role);\n }\n }\n\n foreach (Role::all() as $role) {\n $defaultRoles = array_filter($this->getDefault(), fn($r) => $r['name'] === $role->name);\n\n foreach ($defaultRoles as $defaultRole) {\n foreach ($defaultRole['permissions'] as $permission) {\n\n if ($role->permissions->map(fn ($p) => $p->name)->contains($permission)) {\n continue;\n }\n\n $role->givePermissionTo(Permission::whereName($permission)->first());\n }\n }\n }\n }", "function sf_group_def_perms()\n{\n\tglobal $wpdb;\n\n\t# grab the \"default\" permissions if they exist\n\t$noaccess = $wpdb->get_var(\"SELECT role_id FROM \".SFROLES.\" WHERE role_name='No Access'\");\n\tif (!$noaccess) $noaccess = -1;\n\t$readonly = $wpdb->get_var(\"SELECT role_id FROM \".SFROLES.\" WHERE role_name='Read Only Access'\");\n\tif (!$readonly) $readonly = -1;\n\t$standard = $wpdb->get_var(\"SELECT role_id FROM \".SFROLES.\" WHERE role_name='Standard Access'\");\n\tif (!$standard) $standard = -1;\n\t$moderator = $wpdb->get_var(\"SELECT role_id FROM \".SFROLES.\" WHERE role_name='Moderator Access'\");\n\tif (!$moderator) $moderator = -1;\n\n\t$usergroups = $wpdb->get_results(\"SELECT * FROM \".SFUSERGROUPS);\n\t$groups = $wpdb->get_results(\"SELECT group_id FROM \".SFGROUPS);\n\tif ($groups && $usergroups)\n\t{\n\t\tforeach ($groups as $group)\n\t\t{\n\t\t\tforeach ($usergroups as $usergroup)\n\t\t\t{\n\t\t\t\tif ($usergroup->usergroup_name == 'Guests')\n\t\t\t\t{\n\t\t\t\t\t$rid = $readonly;\n\t\t\t\t} else if ($usergroup->usergroup_name == 'Members')\n\t\t\t\t{\n\t\t\t\t\t$rid = $standard;\n\t\t\t\t} else if ($usergroup->usergroup_name == 'Moderators')\n\t\t\t\t{\n\t\t\t\t\t$rid = $moderator;\n\t\t\t\t} else {\n\t\t\t\t\t$rid = $noaccess;\n\t\t\t\t}\n\t\t\t\t$wpdb->query(\"\n\t\t\t\t\tINSERT INTO \".SFDEFPERMISSIONS.\"\n\t\t\t\t\t(group_id, usergroup_id, permission_role)\n\t\t\t\t\tVALUES\n\t\t\t\t\t($group->group_id, $usergroup->usergroup_id, $rid)\");\n\t\t\t}\n\t\t}\n\t}\n}", "public function run()\n {\n app()[PermissionRegistrar::class]->forgetCachedPermissions();\n\n // Create default permissions\n Permission::create(['name' => 'list categories']);\n Permission::create(['name' => 'view categories']);\n Permission::create(['name' => 'create categories']);\n Permission::create(['name' => 'update categories']);\n Permission::create(['name' => 'delete categories']);\n\n Permission::create(['name' => 'list posts']);\n Permission::create(['name' => 'view posts']);\n Permission::create(['name' => 'create posts']);\n Permission::create(['name' => 'update posts']);\n Permission::create(['name' => 'delete posts']);\n\n Permission::create(['name' => 'list comments']);\n Permission::create(['name' => 'view comments']);\n Permission::create(['name' => 'create comments']);\n Permission::create(['name' => 'update comments']);\n Permission::create(['name' => 'delete comments']);\n\n // Create user role and assign existing permissions\n $currentPermissions = Permission::all();\n $userRole = Role::create(['name' => 'user']);\n $userRole->givePermissionTo($currentPermissions);\n\n // Create admin exclusive permissions\n Permission::create(['name' => 'list roles']);\n Permission::create(['name' => 'view roles']);\n Permission::create(['name' => 'create roles']);\n Permission::create(['name' => 'update roles']);\n Permission::create(['name' => 'delete roles']);\n\n Permission::create(['name' => 'list permissions']);\n Permission::create(['name' => 'view permissions']);\n Permission::create(['name' => 'create permissions']);\n Permission::create(['name' => 'update permissions']);\n Permission::create(['name' => 'delete permissions']);\n\n Permission::create(['name' => 'list users']);\n Permission::create(['name' => 'view users']);\n Permission::create(['name' => 'create users']);\n Permission::create(['name' => 'update users']);\n Permission::create(['name' => 'delete users']);\n\n // Create admin role and assign all permissions\n $allPermissions = Permission::all();\n $adminRole = Role::create(['name' => 'super-admin']);\n $adminRole->givePermissionTo($allPermissions);\n\n $user = \\App\\Models\\User::whereEmail('[email protected]')->first();\n\n if ($user) {\n $user->assignRole($adminRole);\n }\n }", "public function defaultMemberPermissions()\n {\n return $this->request('get', '/api/teams/'.Helpers::config('team').'/default-member-permissions');\n }", "public function run()\n {\n $permissions = [\n 'view',\n 'edit',\n 'edit-election'\n ];\n\n\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n }", "public function registerPermissions() {\n\n return [\n 'elearning.system.some_permission' => [\n 'tab' => 'elearning',\n 'label' => 'Some permission'\n ],\n ];\n }", "public function run()\n {\n Permission::create([\n \t'name'\t\t\t=>\t'Inventario',\n \t'slug'\t\t\t=>\t'inventario.read',\n \t'description'\t=>\t'Listar y navegar inventario del sistema',\n ]);\n //EDIT\n Permission::create([\n 'name' => 'Inventario',\n 'slug' => 'inventario.edit',\n 'description' => 'Edita inventario del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>\t'Configuracion',\n \t'slug'\t\t\t=>\t'configuracion.read',\n \t'description'\t=>\t'Listar y navegar configuracion del sistema',\n ]);\n //EDIT\n Permission::create([\n 'name' => 'Configuracion',\n 'slug' => 'configuracion.edit',\n 'description' => 'Edita configuracion del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>\t'Avanzado',\n \t'slug'\t\t\t=>\t'avanzado.read',\n \t'description'\t=>\t'Listar y navegar avanzado del sistema',\n ]);\n //EDIT\n Permission::create([\n 'name' => 'Avanzado',\n 'slug' => 'avanzado.edit',\n 'description' => 'Edita avanzado del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>\t'Ventas',\n \t'slug'\t\t\t=>\t'ventas.read',\n \t'description'\t=>\t'Listar y navegar ventas del sistema',\n ]);\n //EDIT\n Permission::create([\n 'name' => 'Ventas',\n 'slug' => 'ventas.edit',\n 'description' => 'Edita ventas del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>\t'Clientes',\n \t'slug'\t\t\t=>\t'clientes.read',\n \t'description'\t=>\t'Listar y navegar clientes del sistema',\n ]);\n //EDIT\n Permission::create([\n 'name' => 'Clientes',\n 'slug' => 'clientes.edit',\n 'description' => 'Edita clientes del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>\t'Compras',\n \t'slug'\t\t\t=>\t'compras.read',\n \t'description'\t=>\t'Listar y navegar compras del sistema',\n ]);\n //EDIT\n Permission::create([\n 'name' => 'Compras',\n 'slug' => 'compras.edit',\n 'description' => 'Edita compras del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>\t'Pedidos',\n \t'slug'\t\t\t=>\t'pedidos.read',\n \t'description'\t=>\t'Listar y navegar pedidos del sistema',\n ]);\n //EDIT\n Permission::create([\n 'name' => 'Pedidos',\n 'slug' => 'pedidos.edit',\n 'description' => 'Edita pedidos del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>\t'Mesas',\n \t'slug'\t\t\t=>\t'mesas.read',\n \t'description'\t=>\t'Listar y navegar mesas del sistema',\n ]);\n //EDIT\n Permission::create([\n 'name' => 'Mesas',\n 'slug' => 'mesas.edit',\n 'description' => 'Edita mesas del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>\t'Reportes',\n \t'slug'\t\t\t=>\t'reportes.read',\n \t'description'\t=>\t'Listar y navegar reportes del sistema',\n ]);\n //EDIT\n Permission::create([\n 'name' => 'Reportes',\n 'slug' => 'reportes.edit',\n 'description' => 'Edita reportes del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>\t'Cortes',\n \t'slug'\t\t\t=>\t'cortes.read',\n \t'description'\t=>\t'Listar y navegar cortes del sistema',\n ]);\n //EDIT\n Permission::create([\n 'name' => 'Cortes',\n 'slug' => 'cortes.edit',\n 'description' => 'Edita cortes del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>\t'Cobros',\n \t'slug'\t\t\t=>\t'cobros.read',\n \t'description'\t=>\t'Listar y navegar cobros del sistema',\n ]);\n //EDIT\n Permission::create([\n 'name' => 'Cobros',\n 'slug' => 'cobros.edit',\n 'description' => 'Edita cobros del sistema',\n ]);\n }", "public function run()\n {\n\n /*\n * Add Permissions\n *\n */\n\n //-----------User Management\n\n if (Permission::where('name', '=', 'Can View Users')->first() === null) {\n Permission::create([\n 'name' => 'Can View Users',\n 'slug' => 'view.users',\n 'description' => 'Can view users',\n 'model' => 'Permission',\n ]);\n }\n\n if (Permission::where('name', '=', 'Can Create Users')->first() === null) {\n Permission::create([\n 'name' => 'Can Create Users',\n 'slug' => 'create.users',\n 'description' => 'Can create new users',\n 'model' => 'Permission',\n ]);\n }\n\n if (Permission::where('name', '=', 'Can Edit Users')->first() === null) {\n Permission::create([\n 'name' => 'Can Edit Users',\n 'slug' => 'edit.users',\n 'description' => 'Can edit users',\n 'model' => 'Permission',\n ]);\n }\n\n if (Permission::where('name', '=', 'Can Delete Users')->first() === null) {\n Permission::create([\n 'name' => 'Can Delete Users',\n 'slug' => 'delete.users',\n 'description' => 'Can delete users',\n 'model' => 'Permission',\n ]);\n }\n\n //-----------Post\n \n if (Permission::where('name', '=', 'Can Create Post')->first() === null) {\n Permission::create([\n 'name' => 'Can Create Post',\n 'slug' => 'create.post',\n 'description' => 'Can create post',\n 'model' => 'Permission',\n ]);\n }\n\n if (Permission::where('name', '=', 'Can Edit Post')->first() === null) {\n Permission::create([\n 'name' => 'Can Edit Post',\n 'slug' => 'edit.post',\n 'description' => 'Can edit post',\n 'model' => 'Permission',\n ]);\n }\n\n if (Permission::where('name', '=', 'Can Delete Post')->first() === null) {\n Permission::create([\n 'name' => 'Can Delete Post',\n 'slug' => 'delete.post',\n 'description' => 'Can delete post',\n 'model' => 'Permission',\n ]);\n }\n\n \n }", "public function run()\n {\n Permission::create([\n 'name' => 'Navegar usuarios',\n 'slug' => 'users.index',\n 'description' => 'Lista y navega todos los usuarios del sistema',\n ]);\n Permission::create([\n 'name' => 'Ver detalle del usuario',\n 'slug' => 'users.show',\n 'description' => 'Ver el detalle de cada usuario del sistema',\n ]);\n Permission::create([\n 'name' => 'Edicion de usuarios',\n 'slug' => 'users.edit',\n 'description' => 'Editar cualquier dato de un usuario del sistema',\n ]);\n Permission::create([\n 'name' => 'Eliminar Usuarios',\n 'slug' => 'users.destroy',\n 'description' => 'Eliminar cualquier usuario del sistema',\n ]);\n /* ROles */\n Permission::create([\n 'name' => 'Navegar roles',\n 'slug' => 'roles.index',\n 'description' => 'Eliminar cualquier rol del sistema',\n ]);\n Permission::create([\n 'name' => 'Ver detalle de los roles',\n 'slug' => 'roles.show',\n 'description' => 'Ver cualquier rol del sistema',\n ]);\n Permission::create([\n 'name' => 'Crear roles',\n 'slug' => 'roles.create',\n 'description' => 'Crear cualquier rol del sistema',\n ]);\n Permission::create([\n 'name' => 'Editar roles',\n 'slug' => 'roles.edit',\n 'description' => 'Eliminar cualquier rol del sistema',\n ]);\n Permission::create([\n 'name' => 'Eliminar roles',\n 'slug' => 'roles.destroy',\n 'description' => 'Eliminar cualquier rol del sistema',\n ]);\n /* Productos */\n Permission::create([\n 'name' => 'Navegar productos',\n 'slug' => 'products.index',\n 'description' => 'Eliminar cualquier producto del sistema',\n ]);\n Permission::create([\n 'name' => 'Ver detalle de los productos',\n 'slug' => 'products.show',\n 'description' => 'Ver cualquier producto del sistema',\n ]);\n Permission::create([\n 'name' => 'Crear productos',\n 'slug' => 'products.create',\n 'description' => 'Crear cualquier producto del sistema',\n ]);\n Permission::create([\n 'name' => 'Editar productos',\n 'slug' => 'products.edit',\n 'description' => 'Eliminar cualquier producto del sistema',\n ]);\n Permission::create([\n 'name' => 'Eliminar productos',\n 'slug' => 'products.destroy',\n 'description' => 'Eliminar cualquier producto del sistema',\n ]);\n }", "public function run()\n {\n Permission::create([\n 'name' => 'gestion usuarios'\n ]);\n\n Permission::create([\n 'name' => 'gestion roles'\n ]);\n\n Permission::create([\n 'name' => 'gestion permisos'\n ]);\n\n Permission::create([\n 'name' => 'gestion votacion'\n ]);\n\n Permission::create([\n 'name' => 'autogestion'\n ]);\n\n Permission::create([\n 'name' => 'votar'\n ]);\n\n }", "public function actionPermissions()\n {\n FileHelper::createDirectory(Yii::getAlias('@webroot/css'));\n FileHelper::createDirectory(Yii::getAlias('@webroot/js'));\n\n foreach (['@webroot/assets', '@webroot/uploads', '@runtime'] as $path) {\n try {\n chmod(Yii::getAlias($path), 0777);\n } catch (\\Exception $e) {\n $this->stderr(\"Failed to change permissions for directory \\\"{$path}\\\": \" . $e->getMessage());\n $this->stdout(PHP_EOL);\n }\n }\n }", "public function installFallbackAcl();", "public function run()\n {\n //Permisos de Users\n Permission::create([\n \t'name'\t\t\t=>'Navegar usuarios',\n \t'slug'\t\t\t=>'users.index',\n \t'description'\t=>'Lista y navega todos los usuarios del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Ver detalle de usuario',\n \t'slug'\t\t\t=>'users.show',\n \t'description'\t=>'Ver en detalle cada usuario del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Edición de usuario',\n \t'slug'\t\t\t=>'users.edit',\n \t'description'\t=>'Editar cualquier dato del usuario del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Eliminar usuario',\n \t'slug'\t\t\t=>'users.destroy',\n \t'description'\t=>'Eliminar cualquier usuario del sistema',\n ]);\n\n //Permisos de Roles\n Permission::create([\n \t'name'\t\t\t=>'Navegar roles',\n \t'slug'\t\t\t=>'roles.index',\n \t'description'\t=>'Lista y navega todos los roles del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Ver detalle de rol',\n \t'slug'\t\t\t=>'roles.show',\n \t'description'\t=>'Ver en detalle cada rol del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Creación de roles',\n \t'slug'\t\t\t=>'roles.create',\n \t'description'\t=>'Crear rol del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Edición de roles',\n \t'slug'\t\t\t=>'roles.edit',\n \t'description'\t=>'Editar cualquier dato del rol del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Eliminar rol',\n \t'slug'\t\t\t=>'roles.destroy',\n \t'description'\t=>'Eliminar cualquier rol del sistema',\n ]);\n\n //Permisos de Categorias\n Permission::create([\n \t'name'\t\t\t=>'Navegar categorias',\n \t'slug'\t\t\t=>'categorias.index',\n \t'description'\t=>'Lista y navega todos los categorias del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Ver detalle de categoría',\n \t'slug'\t\t\t=>'categorias.show',\n \t'description'\t=>'Ver en detalle cada categoría del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Creación de categorias',\n \t'slug'\t\t\t=>'categorias.create',\n \t'description'\t=>'Crear categoría del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Edición de categorias',\n \t'slug'\t\t\t=>'categorias.edit',\n \t'description'\t=>'Editar cualquier dato del categoría del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Eliminar categoría',\n \t'slug'\t\t\t=>'categorias.destroy',\n \t'description'\t=>'Eliminar cualquier categoría del sistema',\n ]);\n\n //Permisos de empresas\n Permission::create([\n \t'name'\t\t\t=>'Navegar empresas',\n \t'slug'\t\t\t=>'empresas.index',\n \t'description'\t=>'Lista y navega todos los empresas del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Ver detalle de empresa',\n \t'slug'\t\t\t=>'empresas.show',\n \t'description'\t=>'Ver en detalle cada empresa del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Creación de empresas',\n \t'slug'\t\t\t=>'empresas.create',\n \t'description'\t=>'Crear empresa del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Edición de empresas',\n \t'slug'\t\t\t=>'empresas.edit',\n \t'description'\t=>'Editar cualquier dato del empresa del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Eliminar empresa',\n \t'slug'\t\t\t=>'empresas.destroy',\n \t'description'\t=>'Eliminar cualquier empresa del sistema',\n ]);\n\n //Permisos de productos\n Permission::create([\n \t'name'\t\t\t=>'Navegar productos',\n \t'slug'\t\t\t=>'productos.index',\n \t'description'\t=>'Lista y navega todos los productos del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Ver detalle de producto',\n \t'slug'\t\t\t=>'productos.show',\n \t'description'\t=>'Ver en detalle cada producto del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Creación de productos',\n \t'slug'\t\t\t=>'productos.create',\n \t'description'\t=>'Crear producto del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Edición de productos',\n \t'slug'\t\t\t=>'productos.edit',\n \t'description'\t=>'Editar cualquier dato del producto del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Eliminar producto',\n \t'slug'\t\t\t=>'productos.destroy',\n \t'description'\t=>'Eliminar cualquier producto del sistema',\n ]);\n\n //Permisos de compras\n Permission::create([\n \t'name'\t\t\t=>'Navegar compras',\n \t'slug'\t\t\t=>'compras.index',\n \t'description'\t=>'Lista y navega todos los compras del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Ver detalle de compra',\n \t'slug'\t\t\t=>'compras.show',\n \t'description'\t=>'Ver en detalle cada compra del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Creación de compras',\n \t'slug'\t\t\t=>'compras.create',\n \t'description'\t=>'Crear compra del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Edición de compras',\n \t'slug'\t\t\t=>'compras.edit',\n \t'description'\t=>'Editar cualquier dato del compra del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Eliminar compra',\n \t'slug'\t\t\t=>'compras.destroy',\n \t'description'\t=>'Eliminar cualquier compra del sistema',\n ]);\n\n\n //Permisos de ingredientes\n Permission::create([\n \t'name'\t\t\t=>'Navegar ingredientes',\n \t'slug'\t\t\t=>'ingredientes.index',\n \t'description'\t=>'Lista y navega todos los ingredientes del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Ver detalle de ingrediente',\n \t'slug'\t\t\t=>'ingredientes.show',\n \t'description'\t=>'Ver en detalle cada ingrediente del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Creación de ingredientes',\n \t'slug'\t\t\t=>'ingredientes.create',\n \t'description'\t=>'Crear ingrediente del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Edición de ingredientes',\n \t'slug'\t\t\t=>'ingredientes.edit',\n \t'description'\t=>'Editar cualquier dato del ingrediente del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Eliminar ingrediente',\n \t'slug'\t\t\t=>'ingredientes.destroy',\n \t'description'\t=>'Eliminar cualquier ingrediente del sistema',\n ]);\n\n //Permisos de proveedores\n Permission::create([\n \t'name'\t\t\t=>'Navegar proveedores',\n \t'slug'\t\t\t=>'proveedores.index',\n \t'description'\t=>'Lista y navega todos los proveedores del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Ver detalle de proveedor',\n \t'slug'\t\t\t=>'proveedores.show',\n \t'description'\t=>'Ver en detalle cada proveedor del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Creación de proveedores',\n \t'slug'\t\t\t=>'proveedores.create',\n \t'description'\t=>'Crear proveedor del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Edición de proveedores',\n \t'slug'\t\t\t=>'proveedores.edit',\n \t'description'\t=>'Editar cualquier dato del proveedor del sistema',\n ]);\n Permission::create([\n \t'name'\t\t\t=>'Eliminar proveedor',\n \t'slug'\t\t\t=>'proveedores.destroy',\n \t'description'\t=>'Eliminar cualquier proveedor del sistema',\n ]);\n\n //permisos de proveedores\n Permission::create([\n 'name' =>'Navegar usuarios con permisos',\n 'slug' =>'asignar.index',\n 'description' =>'Gestiones de todos los usuarios vinculados a empresas',\n ]);\n\n //permisos ver pedidos\n Permission::create([\n 'name' =>'Navegar pedidos pendientes a evaluar',\n 'slug' =>'orders.index',\n 'description' =>'Lista de pedidos realizados y listos para ser gestionados',\n ]);\n Permission::create([\n 'name' =>'Navegar todos los pedidos',\n 'slug' =>'allorders.index',\n 'description' =>'Mostrar todos los pedidos',\n ]);\n }", "public function run()\n {\n $manageRoles = new Permission();\n $manageRoles->slug = 'manage-roles';\n $manageRoles->name = 'Manage Roles';\n $manageRoles->save();\n\n $managePermissions = new Permission();\n $managePermissions->slug = 'manage-permissions';\n $managePermissions->name = 'Manage Permissions';\n $managePermissions->save();\n }", "public function run()\n {\n $text = Route::getRoutes()->getRoutes();\n foreach ($text as $route) {\n if (array_key_exists('as', $route->action)) {\n Permission::create([\n 'name' => $route->action['as'],\n ]);\n }\n }\n Permission::create([\n 'name' => 'admins_page',\n ]);\n Permission::create([\n 'name' => 'category_page',\n ]);\n Permission::create([\n 'name' => 'createPost_page',\n ]);\n Permission::create([\n 'name' => 'fileManager_page',\n ]);\n Permission::create([\n 'name' => 'rolePermissions_page',\n ]);\n Permission::create([\n 'name' => 'postList_page',\n ]);\n Permission::create([\n 'name' => 'siteindex_page',\n ]);\n Permission::create([\n 'name' => 'dashboard_page',\n ]);\n }", "public function __construct()\n {\n parent::__construct('BaseMtc_permissions');\n }", "public function setup()\n {\n CRUD::setModel(\\App\\Models\\Setting::class);\n CRUD::setRoute(config('backpack.base.route_prefix').'/setting');\n CRUD::setEntityNameStrings('paramètre', 'paramètres');\n\n if (User::min('id') !== backpack_user()->id) {\n CRUD::denyAccess(['delete', 'create']);\n }\n }", "public function run()\n {\n $this->disableForeignKeys();\n\n // Create Roles\n $admin = Role::create(['name' => config('access.users.admin_role')]);\n $executive = Role::create(['name' => 'executive']);\n $user = Role::create(['name' => config('access.users.default_role')]);\n\n // Create Permissions\n Permission::create(['name' => 'view backend']);\n // Create Permission For Inventory Module\n Permission::create(['name' => 'view inventory']);\n Permission::create(['name' => 'create item']);\n Permission::create(['name' => 'store item']);\n Permission::create(['name' => 'edit item']);\n Permission::create(['name' => 'update item']);\n Permission::create(['name' => 'delete item']);\n Permission::create(['name' => 'restore item']);\n Permission::create(['name' => 'force delete item']);\n // Create Permission For Inventory Module\n Permission::create(['name' => 'view sizes']);\n Permission::create(['name' => 'store size']);\n Permission::create(['name' => 'update size']);\n Permission::create(['name' => 'delete size']);\n Permission::create(['name' => 'restore size']);\n Permission::create(['name' => 'force delete size']);\n\n // ALWAYS GIVE ADMIN ROLE ALL PERMISSIONS\n $admin->givePermissionTo('view backend');\n // Give all Permission for Inventory to Admin\n $admin->givePermissionTo('view inventory');\n $admin->givePermissionTo('create item');\n $admin->givePermissionTo('store item');\n $admin->givePermissionTo('edit item');\n $admin->givePermissionTo('update item');\n $admin->givePermissionTo('delete item');\n $admin->givePermissionTo('restore item');\n $admin->givePermissionTo('force delete item');\n // Give all Permission for Size to Admin\n $admin->givePermissionTo('view sizes');\n $admin->givePermissionTo('store size');\n $admin->givePermissionTo('update size');\n $admin->givePermissionTo('delete size');\n $admin->givePermissionTo('restore size');\n $admin->givePermissionTo('force delete size');\n\n // Assign Permissions to other Roles\n $executive->givePermissionTo('view backend');\n\n $this->enableForeignKeys();\n }", "public function run()\n {\n DB::table('permissions');\n Artisan::call('permission:cache-reset');\n\n Permission::updateOrCreate(['name' => 'settings.create']);\n Permission::updateOrCreate(['name' => 'settings.view']);\n Permission::updateOrCreate(['name' => 'settings.update']);\n Permission::updateOrCreate(['name' => 'settings.delete']);\n\n Permission::updateOrCreate(['name' => 'crm_talent.create']);\n Permission::updateOrCreate(['name' => 'crm_talent.view']);\n Permission::updateOrCreate(['name' => 'crm_talent.update']);\n Permission::updateOrCreate(['name' => 'crm_talent.delete']);\n\n Permission::updateOrCreate(['name' => 'crm_client.create']);\n Permission::updateOrCreate(['name' => 'crm_client.view']);\n Permission::updateOrCreate(['name' => 'crm_client.update']);\n Permission::updateOrCreate(['name' => 'crm_client.delete']);\n\n Permission::updateOrCreate(['name' => 'weeklydoses.view']);\n\n Permission::updateOrCreate(['name' => 'library_books.create']);\n Permission::updateOrCreate(['name' => 'library_books.view']);\n Permission::updateOrCreate(['name' => 'library_books.update']);\n Permission::updateOrCreate(['name' => 'library_books.delete']);\n\n Permission::updateOrCreate(['name' => 'library_book_category.create']);\n Permission::updateOrCreate(['name' => 'library_book_category.view']);\n Permission::updateOrCreate(['name' => 'library_book_category.update']);\n Permission::updateOrCreate(['name' => 'library_book_category.delete']);\n }", "public function registerPermissions()\n {\n return [\n 'vojtasvoboda.shopaholic_feeds.settings' => [\n 'tab' => 'Feeds for Shopaholic',\n 'label' => 'Manage feeds',\n ],\n ];\n }", "public function syncPermissions(): void {\n\t\t$FinalPermissions = discover_permissions( false );\n\t\t$RolesExists = Permission::query()->whereIn( 'name', $FinalPermissions )->get();\n\t\tif ( $RolesExists->count() > 0 ) {\n\t\t\t$FinalPermissionsCollection = collect( $FinalPermissions )->filter( static function ( $item ) use ( $RolesExists ) {\n\t\t\t\treturn ! $RolesExists->contains( 'name', '=', $item );\n\t\t\t} );\n\t\t\t$CreateRoles = [];\n\t\t\tforeach ( $FinalPermissionsCollection as $finalPermission ) {\n\t\t\t\t$CreateRoles[] = [\n\t\t\t\t\t'name' => $finalPermission,\n\t\t\t\t\t'guard_name' => 'admin',\n\t\t\t\t\t'updated_at' => Carbon::now(),\n\t\t\t\t\t'created_at' => Carbon::now(),\n\t\t\t\t];\n\t\t\t}\n\t\t\tif ( ! empty( $CreateRoles ) ) {\n\t\t\t\tPermission::query()->insert( $CreateRoles );\n\t\t\t}\n\t\t} else {\n\t\t\t$CreateRoles = [];\n\t\t\tforeach ( $FinalPermissions as $finalPermission ) {\n\t\t\t\t$CreateRoles[] = [\n\t\t\t\t\t'name' => $finalPermission,\n\t\t\t\t\t'guard_name' => 'admin',\n\t\t\t\t\t'updated_at' => Carbon::now(),\n\t\t\t\t\t'created_at' => Carbon::now(),\n\t\t\t\t];\n\t\t\t}\n\t\t\tPermission::query()->insert( $CreateRoles );\n\t\t}\n\t}", "public function run()\n {\n Permission::create([\n 'name' => 'User Management',\n 'code' => 'user_management'\n ]);\n\n Permission::create([\n 'name' => 'Role Management',\n 'code' => 'role_manage'\n ]);\n\n Permission::create([\n 'name' => 'Master Management',\n 'code' => 'master_manage'\n ]);\n\n Permission::create([\n 'name' => 'Permission Management',\n 'code' => 'permission_management'\n ]);\n }", "public function init() {\n $readActions = array('handbook', 'handbookbypbl', 'proceduralskills', 'patientdoctor');\n $this->_helper->_acl->allow('student', $readActions);\n }", "public function shouldAttachAllPermissionsToAdminRole()\n {\n Permission::insert([\n ['name' => 'books.read', 'guard_name' => ''],\n ['name' => 'books.create', 'guard_name' => ''],\n ['name' => 'books.delete', 'guard_name' => ''],\n ]);\n\n $this->assertEmpty(Role::first()->permissions);\n\n $this->artisan('authorization:refresh-admin-permissions')->assertExitCode(0);\n\n $this->assertCount(3, Role::first()->permissions);\n }", "public function run()\n {\n $manageUser = new Permission();\n $manageUser->name = 'Manage users';\n $manageUser->slug = 'manage-users';\n $manageUser->save();\n\n $createAnons = new Permission();\n $createAnons->name = 'Create Anons';\n $createAnons->slug = 'create-anons';\n $createAnons->save();\n }", "function __construct()\n {\n parent::__construct();\n $this->config->load('permissions/dati_permissions');\n }", "public function registerPermissions()\n {\n return []; // Remove this line to activate\n\n return [\n 'milo.food.some_permission' => [\n 'tab' => 'Food',\n 'label' => 'Some permission'\n ],\n ];\n }", "private function loadPermissions(): void\n {\n $permissions = Cache::get($this->cacheKey());\n\n $this->isPayor = $permissions['isPayor'];\n $this->isAgencyBankAccountSetup = $permissions['isAgencyBankAccountSetup'];\n $this->canViewDocumentation = $permissions['canViewDocumentation'];\n }", "public function registerPermissions()\n {\n return []; // Remove this line to activate\n\n return [\n 'jc91715.music.some_permission' => [\n 'tab' => 'music',\n 'label' => 'Some permission'\n ],\n ];\n }", "protected function _initPermissions () {\r\n\r\n\t\t$bFreshData = false;\r\n\r\n\t\tif (self::$_bUseCache) {\r\n\t\t\t$oCacheManager = Kwgl_Cache::getManager();\r\n\t\t\t$oAclCache = $oCacheManager->getCache('acl');\r\n\r\n\t\t\tif (($aPermissionListing = $oAclCache->load(self::CACHE_IDENTIFIER_PERMISSIONS)) === false) {\r\n\t\t\t\t// Not Cached or Expired\r\n\r\n\t\t\t\t$bFreshData = true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$bFreshData = true;\r\n\t\t}\r\n\r\n\t\tif ($bFreshData) {\r\n\t\t\t// Get Privileges from the Database\r\n\t\t\t$oDaoRoleResourcePrivilege = Kwgl_Db_Table::factory('System_Role_Resource_Privilege');\r\n\t\t\t//$aPermissionListing = $oDaoRoleResource->fetchAll();\r\n\t\t\t$aPermissionListing = $oDaoRoleResourcePrivilege->getPermissions();\r\n\r\n\t\t\tif (self::$_bUseCache) {\r\n\t\t\t\t$oAclCache->save($aPermissionListing, self::CACHE_IDENTIFIER_PERMISSIONS);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tforeach ($aPermissionListing as $aPermissionDetail) {\r\n\t\t\t$sRoleName = $aPermissionDetail['role_name'];\r\n\t\t\t$sResourceName = $aPermissionDetail['resource_name'];\r\n\t\t\t$sPrivilegeName = null;\r\n\t\t\tif (!is_null($aPermissionDetail['privilege_name'])) {\r\n\t\t\t\t$sPrivilegeName = $aPermissionDetail['privilege_name'];\r\n\t\t\t}\r\n\t\t\t$sPermissionType = $aPermissionDetail['permission'];\r\n\r\n\t\t\t// Check the Permission to see if you should allow or deny the Resource/Privilege to the Role\r\n\t\t\tswitch ($sPermissionType) {\r\n\t\t\t\tcase self::PERMISSION_TYPE_ALLOW:\r\n\t\t\t\t\t$this->allow($sRoleName, $sResourceName, $sPrivilegeName);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase self::PERMISSION_TYPE_DENY:\r\n\t\t\t\t\t$this->deny($sRoleName, $sResourceName, $sPrivilegeName);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function setRequiredPermissions($permissions = array())\n {\n $this->requiredPermissions = $permissions;\n }", "public function registerUserPermissions()\n {\n return array(\n 'accessAmFormsExports' => array(\n 'label' => Craft::t('Access to exports')\n ),\n 'accessAmFormsFields' => array(\n 'label' => Craft::t('Access to fields')\n ),\n 'accessAmFormsForms' => array(\n 'label' => Craft::t('Access to forms')\n ),\n 'accessAmFormsSettings' => array(\n 'label' => Craft::t('Access to settings')\n )\n );\n }", "public function run()\n {\n Permission::create(['name' => 'Administer roles & permissions', 'label' => 'Administer roles & permissions', 'item_order' => 1, 'groupings' => 'Gates & Policies', 'groupings_order' => 1]);\n Permission::create(['name' => 'frontend_reader', 'label' => 'Front-end Reader', 'item_order' => 2, 'groupings' => 'Basic', 'groupings_order' => 2]);\n\t\t\t\tPermission::create(['name' => 'sample_browse', 'label' => 'Browse', 'item_order' => 3, 'groupings' => 'Sampling', 'groupings_order' => 1]);\n\t\t\t\tPermission::create(['name' => 'sample_read', 'label' => 'Read', 'item_order' => 3, 'groupings' => 'Sampling', 'groupings_order' => 2]);\n\t\t\t\tPermission::create(['name' => 'sample_edit', 'label' => 'Edit', 'item_order' => 3, 'groupings' => 'Sampling', 'groupings_order' => 3]);\n\t\t\t\tPermission::create(['name' => 'sample_add', 'label' => 'Add', 'item_order' => 3, 'groupings' => 'Sampling', 'groupings_order' => 4]);\n\t\t\t\tPermission::create(['name' => 'sample_delete', 'label' => 'Delete', 'item_order' => 3, 'groupings' => 'Sampling', 'groupings_order' => 5]);\n }", "function __construct() {\n\n $this->addRole(new Zend_Acl_Role('guests'));\n $this->addRole(new Zend_Acl_Role('admins'), 'guests');\n\n // >>>>>>>>>>>> Adding Resources <<<<<<<<<<<<<<<\n \n // **** Resources for module Default *****\n\n $this->add(new Zend_Acl_Resource('default'));\n $this->add(new Zend_Acl_Resource('default:index'), 'default');\n \n\n // **** Resources for module Admin *****\n\n $this->add(new Zend_Acl_Resource('admin'));\n $this->add(new Zend_Acl_Resource('admin:index'), 'admin');\n $this->add(new Zend_Acl_Resource('admin:devis'), 'admin');\n\n // >>>>>>>>>>>> Affecting Resources <<<<<<<<<<<<<<<\n \n // ------- >> module Default << -------\n $this->allow('guests', 'default:index');\n \n \n // ------- >> module Admin << -------\n $this->allow('guests', 'admin:index');\n $this->allow('guests', 'admin:devis');\n \n \n }", "public function run()\n {\n \t//users\n Permission::create([\n \t'name' \t\t\t=> 'Navegar Usuarios',\n \t'slug' \t\t\t=> 'users.index',\n \t'description' => 'Lista y Navega todos los usuarios del sistema',\n ]);\n\n Permission::create([\n \t'name' \t\t\t=> 'Crear Usuario',\n \t'slug' \t\t\t=> 'register',\n \t'description' => 'Registra un usuario del sistema',\n ]);\n\n Permission::create([\n \t'name' \t\t\t=> 'Ver detalle Usuario',\n \t'slug' \t\t\t=> 'users.edit',\n \t'description' => 'Editar dar role a cada usuario del sistema',\n ]); \n\n Permission::create([\n 'name' => 'Actualizar contraseña',\n 'slug' => 'users.reset',\n 'description' => 'Actualizar la contraseña de los usuarios',\n ]); \n\n //Roles\n\n Permission::create([\n \t'name' \t\t\t=> 'Navegar Roles',\n \t'slug' \t\t\t=> 'roles.index',\n \t'description' => 'Lista y Navega todos los roles del sistema',\n ]);\n\n Permission::create([\n \t'name' \t\t\t=> 'Crear Roles',\n \t'slug' \t\t\t=> 'roles.create',\n \t'description' => 'Crear un rol del sistema',\n ]);\n\n Permission::create([\n \t'name' \t\t\t=> 'Ver detalle de Roles',\n \t'slug' \t\t\t=> 'roles.show',\n \t'description' => 'Ver en detalle cada rol del sistema',\n ]);\n\n Permission::create([\n \t'name' \t\t\t=> 'Edición de Roles',\n \t'slug' \t\t\t=> 'roles.edit',\n \t'description' => 'Editar cualquier dato de un rol del sistema',\n ]);\n\n Permission::create([\n \t'name' \t\t\t=> 'Eliminar Roles',\n \t'slug' \t\t\t=> 'roles.destroy',\n \t'description' => 'Editar cualquier dato de un rol del sistema',\n ]);\n\n //Carreras\n\n Permission::create([\n \t'name' \t\t\t=> 'Navegar Carreras',\n \t'slug' \t\t\t=> 'carreras.index',\n \t'description' => 'Lista y Navega todos los roles del sistema',\n ]);\n\n Permission::create([\n \t'name' \t\t\t=> 'Crear Carreras',\n \t'slug' \t\t\t=> 'carreras.create',\n \t'description' => 'Crear un carrera del sistema',\n ]);\n\n Permission::create([\n \t'name' \t\t\t=> 'Ver detalle de Carreras',\n \t'slug' \t\t\t=> 'carreras.show',\n \t'description' => 'Ver en detalle cada carrera del sistema',\n ]);\n\n Permission::create([\n \t'name' \t\t\t=> 'Edición de Carreras',\n \t'slug' \t\t\t=> 'carreras.edit',\n \t'description' => 'Editar cualquier dato de un carrera del sistema',\n ]);\n\n Permission::create([\n \t'name' \t\t\t=> 'Eliminar Carreras',\n \t'slug' \t\t\t=> 'carreras.destroy',\n \t'description' => 'Editar cualquier dato de un carrera del sistema',\n ]);\n\n //Archivos\n\n Permission::create([\n 'name' => 'Navegar Archivos',\n 'slug' => 'archivos.index',\n 'description' => 'Lista y Navega todos los roles del sistema',\n ]);\n\n Permission::create([\n 'name' => 'Crear Archivos',\n 'slug' => 'archivos.store',\n 'description' => 'Crear un archivo del sistema',\n ]);\n\n Permission::create([\n 'name' => 'Edición de Archivo',\n 'slug' => 'archivos.update',\n 'description' => 'Editar cualquier dato de un archivo del sistema',\n ]);\n\n Permission::create([\n 'name' => 'Eliminar Archivo',\n 'slug' => 'archivos.destroy',\n 'description' => 'Editar cualquier dato de un archivo del sistema',\n ]);\n\n Permission::create([\n 'name' => 'Ver detalle de Archivo',\n 'slug' => 'archivos.show',\n 'description' => 'Ver en detalle cada archivo del sistema',\n ]);\n\n\n //Gavetas\n\n Permission::create([\n 'name' => 'Navegar Gavetas',\n 'slug' => 'gavetas.index',\n 'description' => 'Lista y Navega todos los gavetas del sistema',\n ]);\n\n Permission::create([\n 'name' => 'Crear Gavetas',\n 'slug' => 'gavetas.store',\n 'description' => 'Crear una gaveta en el sistema',\n ]);\n\n Permission::create([\n 'name' => 'Edición de Gaveta',\n 'slug' => 'gavetas.update',\n 'description' => 'Editar cualquier dato de una gaveta en el sistema',\n ]);\n\n Permission::create([\n 'name' => 'Eliminar Gaveta',\n 'slug' => 'gavetas.destroy',\n 'description' => 'Editar cualquier dato de una gaveta en el sistema',\n ]);\n\n Permission::create([\n 'name' => 'Ver detalle de Gaveta',\n 'slug' => 'gavetas.show',\n 'description' => 'Ver en detalle cada estudiante del sistema',\n ]);\n\n //Estudiantes\n\n Permission::create([\n 'name' => 'Navegar Estudiantes',\n 'slug' => 'estudiantes.index',\n 'description' => 'Lista y Navega todos los estudiantes del sistema',\n ]);\n\n Permission::create([\n 'name' => 'Registra Estudiantes',\n 'slug' => 'estudiantes.store',\n 'description' => 'Registra una estudiante en el sistema',\n ]);\n\n Permission::create([\n 'name' => 'Edición de Estudiante',\n 'slug' => 'estudiantes.update',\n 'description' => 'Editar cualquier dato de una estudiante en el sistema',\n ]);\n\n Permission::create([\n 'name' => 'Ver detalle de Estudiante',\n 'slug' => 'estudiantes.show',\n 'description' => 'Ver en detalle cada estudiante del sistema',\n ]);\n\n //Expedientes\n\n Permission::create([\n 'name' => 'Navegar Expedientes',\n 'slug' => 'expedientes.index',\n 'description' => 'Lista y Navega todos los expedientes del sistema',\n ]);\n\n Permission::create([\n 'name' => 'Registra Expedientes',\n 'slug' => 'expedientes.store',\n 'description' => 'Registra una estudiante en el sistema',\n ]);\n\n Permission::create([\n 'name' => 'Edición de Expediente',\n 'slug' => 'expedientes.update',\n 'description' => 'Editar cualquier dato de una estudiante en el sistema',\n ]);\n\n Permission::create([\n 'name' => 'Ver detalle de Expediente',\n 'slug' => 'expedientes.show',\n 'description' => 'Ver en detalle cada estudiante del sistema',\n ]);\n }", "public function registerPermissions()\n {\n return [\n 'xitara.nexus.mainmenu' => [\n 'tab' => 'Xitara Nexus',\n 'label' => 'xitara.nexus::permissions.mainmenu',\n ],\n 'xitara.nexus.settings' => [\n 'tab' => 'Xitara Nexus',\n 'label' => 'xitara.nexus::permissions.settings',\n ],\n 'xitara.nexus.dashboard' => [\n 'tab' => 'Xitara Nexus',\n 'label' => 'xitara.nexus::permissions.dashboard',\n ],\n 'xitara.nexus.menu' => [\n 'tab' => 'Xitara Nexus',\n 'label' => 'xitara.nexus::permissions.menu',\n ],\n 'xitara.nexus.custommenus' => [\n 'tab' => 'Xitara Nexus',\n 'label' => 'xitara.nexus::permissions.custommenus',\n ],\n ];\n }", "public function checkPermissions();", "abstract public function getPermissions();", "public function run()\n {\n $keys = [\n 'browse_admin',\n 'browse_bread',\n 'browse_database',\n 'browse_media',\n 'browse_compass',\n ];\n\n foreach ($keys as $key) {\n Permission::firstOrCreate([\n 'key' => $key,\n 'table_name' => null,\n ]);\n }\n\n Permission::generateFor('menus');\n\n Permission::generateFor('roles');\n\n Permission::generateFor('users');\n\n Permission::generateFor('settings');\n }", "public function run()\n {\n //create new permission and assign new permission to roles\n\n $permissions_data = [\n [\n 'permission_name' => 'read-logviewer',\n 'roles' => [\n 'administrator',\n ],\n 'guards' => [\n 'web',\n ],\n ],\n [\n 'permission_name' => 'read-passport',\n 'roles' => [\n 'administrator',\n ],\n 'guards' => [\n 'web',\n ],\n ],\n [\n 'permission_name' => 'create-user',\n 'roles' => [\n 'administrator',\n ],\n 'guards' => [\n 'web',\n 'api',\n ],\n ],\n [\n 'permission_name' => 'read-user',\n 'roles' => [\n 'administrator',\n ],\n 'guards' => [\n 'web',\n 'api',\n ],\n ],\n [\n 'permission_name' => 'update-user',\n 'roles' => [\n 'administrator',\n ],\n 'guards' => [\n 'web',\n 'api',\n ],\n ],\n [\n 'permission_name' => 'delete-user',\n 'roles' => [\n 'administrator',\n ],\n 'guards' => [\n 'web',\n 'api',\n ],\n ],\n [\n 'permission_name' => 'create-role',\n 'roles' => [\n 'administrator',\n ],\n 'guards' => [\n 'web',\n 'api',\n ],\n ],\n [\n 'permission_name' => 'read-role',\n 'roles' => [\n 'administrator',\n ],\n 'guards' => [\n 'web',\n 'api',\n ],\n ],\n [\n 'permission_name' => 'update-role',\n 'roles' => [\n 'administrator',\n ],\n 'guards' => [\n 'web',\n 'api',\n ],\n ],\n [\n 'permission_name' => 'delete-role',\n 'roles' => [\n 'administrator',\n ],\n 'guards' => [\n 'web',\n 'api',\n ],\n ],\n [\n 'permission_name' => 'create-permission',\n 'roles' => [\n 'administrator',\n ],\n 'guards' => [\n 'web',\n 'api',\n ],\n ],\n [\n 'permission_name' => 'read-permission',\n 'roles' => [\n 'administrator',\n ],\n 'guards' => [\n 'web',\n 'api',\n ],\n ],\n [\n 'permission_name' => 'update-permission',\n 'roles' => [\n 'administrator',\n ],\n 'guards' => [\n 'web',\n 'api',\n ],\n ],\n [\n 'permission_name' => 'delete-permission',\n 'roles' => [\n 'administrator',\n ],\n 'guards' => [\n 'web',\n 'api',\n ],\n ],\n ];\n\n if (!empty($permissions_data)) {\n foreach ($permissions_data as $permission_data) {\n\n $permission_name = $permission_data['permission_name'];\n $permission_guards = array_get($permission_data, 'guards', []);\n $roles = array_get($permission_data, 'roles', []);\n\n if (!empty($permission_guards)) {\n foreach ($permission_guards as $permission_guard) {\n\n if ($permission_guard == 'api') {\n $permission = ApiPermission::firstByName($permission_name);\n } else {\n if ($permission_guard == 'web') {\n $permission = WebPermission::firstByName($permission_name);\n }\n }\n\n if ($permission) {\n\n //assign permission to role\n\n if (!empty($roles)) {\n foreach ($roles as $role_name) {\n\n if ($permission_guard == 'api') {\n $role = ApiRole::firstByName($role_name);\n } else {\n if ($permission_guard == 'web') {\n $role = WebRole::firstByName($role_name);\n }\n }\n\n if ($role) {\n\n //assign permission to role\n\n $role_has_permission = $role->hasPermissionTo($permission);\n\n if (!$role_has_permission) {\n $role->givePermissionTo($permission);\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }", "public static function uses_permissions(): bool;", "private function savePermissions(): void\n {\n $this->client->isPayor = $this->isPayor;\n $this->client->isAgencyBankAccountSetup = $this->isAgencyBankAccountSetup;\n $this->client->canViewDocumentation = $this->canViewDocumentation;\n }", "public function run()\n {\n DB::table('model_has_permissions')->truncate();\n DB::table('model_has_roles')->truncate();\n DB::table('roles')->truncate();\n DB::table('permissions')->truncate();\n DB::table('role_has_permissions')->truncate();\n\n app()['cache']->forget('spatie.permission.cache');\n\n // view = listing, view detail\n // manage = create, edit, delete\n Permission::create(['name' => 'view dashboard']);\n\n Permission::create(['name' => 'view admin']);\n Permission::create(['name' => 'manage admin']);\n\n Permission::create(['name' => 'view user']);\n Permission::create(['name' => 'manage user']);\n\n Permission::create(['name' => 'view product']);\n Permission::create(['name' => 'manage product']);\n\n Permission::create(['name' => 'view post']);\n Permission::create(['name' => 'manage post']);\n\n Permission::create(['name' => 'view subscriber']);\n Permission::create(['name' => 'manage subscriber']);\n\n Permission::create(['name' => 'manage setting']);\n Permission::create(['name' => 'view log']);\n\n Permission::create(['name' => 'manage package']);\n Permission::create(['name' => 'manage class category']);\n Permission::create(['name' => 'manage campaign']);\n Permission::create(['name' => 'manage bill']);\n\n // create roles an d assign created permissions\n $role = Role::create(['name' => 'Root']);\n $role->givePermissionTo(Permission::all());\n\n $role = Role::create(['name' => 'Admin']);\n $role->givePermissionTo([\n 'view dashboard',\n 'view admin',\n 'view user',\n 'manage user',\n 'view product',\n 'manage product',\n 'view post',\n 'manage post',\n 'view subscriber',\n 'manage subscriber',\n 'manage setting',\n 'view log',\n 'manage package',\n 'manage class category',\n 'manage campaign',\n 'manage bill',\n ]);\n\n $role = Role::create(['name' => 'Manager']);\n $role->givePermissionTo([\n 'view dashboard',\n 'view user',\n// 'manage user',\n 'view product',\n 'manage product',\n 'view post',\n 'manage post',\n 'view subscriber',\n 'manage subscriber',\n ]);\n\n $role = Role::create(['name' => 'Viewer']);\n $role->givePermissionTo([\n 'view dashboard',\n 'view user',\n 'manage user',\n 'view product',\n 'view post',\n 'view subscriber',\n ]);\n\n $role = Role::create(['name' => 'Writer']);\n $role->givePermissionTo([\n 'view dashboard',\n 'view post',\n 'manage post',\n ]);\n\n $user = User::find(1);\n\n if (!$user) {\n dd('user.id = 1 not found');\n }\n\n $user->assignRole('Root');\n\n $user = User::find(2);\n\n if (!$user) {\n dd('user.id = 2 not found');\n }\n\n $user->assignRole('Admin');\n }", "public function run()\n {\n $availablePermission=['read','write','delete','update'];\n\n for ($i=0; $i<4; $i++){\n Permission::create([\n 'name'=> $availablePermission[$i],\n 'guard_name'=> 'api'\n ]);\n }\n }" ]
[ "0.82586575", "0.79242224", "0.74304485", "0.7417947", "0.7224578", "0.7102657", "0.70275515", "0.6897554", "0.6891287", "0.68890446", "0.68890446", "0.68890446", "0.68890446", "0.68890446", "0.68613964", "0.6754806", "0.6694697", "0.6676938", "0.6670931", "0.66610813", "0.66244346", "0.6586646", "0.65432996", "0.65422016", "0.6498132", "0.6494058", "0.6420346", "0.64025694", "0.64023495", "0.6393278", "0.63829947", "0.63396615", "0.63289505", "0.63183707", "0.6313927", "0.63133806", "0.62819535", "0.62819153", "0.62781876", "0.6266064", "0.6257282", "0.6257282", "0.62468326", "0.62394583", "0.62215024", "0.62191635", "0.6208288", "0.6188804", "0.6178984", "0.61663705", "0.61634165", "0.61341935", "0.61279094", "0.61181957", "0.611678", "0.61008", "0.6087823", "0.6080494", "0.60637456", "0.60408485", "0.6033487", "0.60283405", "0.60150355", "0.6004026", "0.599501", "0.5991494", "0.5979783", "0.59786403", "0.5970288", "0.5969587", "0.5964904", "0.5964529", "0.595714", "0.5955194", "0.59535825", "0.5950094", "0.594993", "0.5940369", "0.59343636", "0.5934299", "0.59296274", "0.59077984", "0.5906648", "0.5905718", "0.5896664", "0.5895811", "0.5890767", "0.58901393", "0.58758086", "0.58738303", "0.5869325", "0.58658785", "0.5862576", "0.5862222", "0.5858673", "0.58570856", "0.58441657", "0.58416146", "0.58322513", "0.5828224" ]
0.64157367
27
Action to allow a user to add a new expense.
public function add() { $entry = $this->getEntryToAdd('clov_expense'); // Default to the logged-in user. $loggedInUser = new User; $entry->setAttribute('clov_expense_payer', $loggedInUser->getUserID()); // If the user got here from a project page, pre-fill the project // attribute. Loader::helper('clov_url', 'clov'); if($project = ClovUrlHelper::loadReferrerPage('clov_project')) { $entry->setAttribute('clov_expense_project', $project->getCollectionID()); } $this->set('entry', $entry); $this->set('showSaveDraft', true); $this->render('clov/default/add'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addExpenseAction()\n\t{\n\t\t$expense = new Expense($_POST);\n\t\t\n\t\tif ($expense->addExpense()) {\n\t\t\tFlash::addMessage('Add expense successful!');\n\t\t\t\n\t\t\t$this->redirect('/profile/expenseForm');\n\t\t} else {\n\t\t\tFlash::addMessage('Add expense unsuccessful, please try again!', Flash::WARNING);\n\t\t\t\n\t\t\tView::renderTemplate('Expense/addExpense.html', [\n\t\t\t'date' => $expense->date,\n\t\t\t'payments' => Payment::getPaymentsCategories(),\n\t\t\t'expenses' => Expense::getExpensesCategories(),\n\t\t\t'expense' => $expense\n\t\t]);\n\t\t}\n\t}", "public function newAction()\n {\n $securityContext = $this->get('security.context');\n if ($securityContext->isGranted('IS_AUTHENTICATED_REMEMBERED')) {\n $userEntity = $securityContext->getToken()->getUser();\n } else {\n return $this->redirect($this->generateUrl('fos_user_security_login'));\n }\n\n $entity = new Expense();\n $entity->setUser($userEntity);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function postCreateExpense(){\n\t\t$rules = array(\n\t\t\t\"date\" =>\"required|date\",\n\t\t\t\"user_id\" =>\"required|integer\",\n\t\t\t\"amount\" =>\"required|integer|min:1\",\n\t\t\t\"description\" =>\"required\"\n\t\t\t);\n\t\t\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\tif ($validator->fails()) {\n\t\t\techo \"Validator fails\";\n\t\t} else {\n\t\t\t$expense = New Expense();\n\t\t\t$expense->date = Input::get('date');\n\t\t\t$expense->user_id = Input::get('user_id');\n\t\t\t$expense->amount = Input::get('amount');\n\t\t\tif (Input::get('approved')) $expense->status = 1;\n\t\t\telse $expense->status = 0;\n\t\t\t$expense->description = Input::get('description');\n\t\t\t$expense->save();\n\t\t\tSession::put('notification_expense', 'Expense has been created successful!!');\n\t\t\treturn Redirect::to('expense/create-expense');\n\t\t}\n\t}", "public function expenseFormAction()\n\t{\n\t\tView::renderTemplate('Expense/addExpense.html', [\n\t\t\t'date' => date('Y-m-d'),\n\t\t\t'payments' => Payment::getPaymentsCategories(),\n\t\t\t'expenses' => Expense::getExpensesCategories()\n\t\t]);\n\t}", "public function newAction()\n {\n $userId = $this->user->id;\n \n $userDefinedPaymentMethods = Expenses::getUserDefinedPaymentMethods($userId);\n $userDefinedCategories = Expenses::getUserAssignedCategories($userId);\n \n View::renderTemplate('Expense/new.html',[\n 'paymentMethods' => $userDefinedPaymentMethods,\n 'expenseCategories' => $userDefinedCategories\n ]);\n }", "public function addIncomeAction()\n\t{\n\t\t$income = new Income($_POST);\n\t\t\n\t\tif ($income->addIncome()) {\n\t\t\tFlash::addMessage('Add income successful!');\n\t\t\t\n\t\t\t$this->redirect('/profile/incomeForm');\n\t\t} else {\n\t\t\tFlash::addMessage('Add income unsuccessful, please try again!', Flash::WARNING);\n\t\t\t\n\t\t\tView::renderTemplate('Income/addIncome.html', [\n\t\t\t'date' => $income->date,\n\t\t\t'incomes' => Income::getIncomesCategories(),\n\t\t\t'income' => $income\n\t\t]);\n\t\t}\n\t}", "public function store(Request $request)\n {\n $input = \\Request::all();\n $expense = new Expense($input);\n \\Auth::user()->expenses()->save($expense);\n \n return redirect('home');\n }", "public function store( Request $request )\n {\n $expense = new Expense;\n $expense->name = 'Expense';\n $expense->category_id = 0;\n $expense->monthly = true;\n $expense->amount = 0;\n $expense->user_id = Auth::user()->id;\n $expense->save();\n\n Session::flash( 'success', \"Expense added\" );\n $message = View::make( 'partials/flash-messages' );\n $view = View::make( 'partials/expense-row' )\n ->with( 'expense', $expense );\n\n return response()->json(\n [\n 'message' => $message->render(),\n 'view' => $view->render(),\n ], 200 );\n }", "public function created(Expense $expense)\n {\n //\n }", "public function createAction(Request $request)\n {\n $entity = new Expense();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('expense'));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function expenseLedgerEntry()\n {\n $items = $this->getVoucherItems();\n \n $financeLedger = new Core_Model_Finance_Ledger;\n $expenseLedgerRecord = $financeLedger->fetchByName('Indirect expense');\n \n $totalPrice = 0;\n for($i = 0; $i <= sizeof($items)-1; $i += 1) {\n $price = $items[$i]['unit_price'] * $items[$i]['quantity'];\n $totalPrice = $totalPrice + $price;\n }\n $notes = 'Purchase with Purchase Id = '.$this->_purchaseId; \n \n $dataToInsert = array(\n 'debit' => $amount,\n 'credit' => \"0\",\n 'notes' => $notes,\n 'transaction_timestamp' => $this->_transactionTime,\n 'fa_ledger_id' => $expenseLedgerRecord['fa_ledger_id']\n );\n $ledgerEntryModel = new Core_Model_Finance_Ledger_Entry;\n $ledgerEntryId = $ledgerEntryModel->create($dataToInsert);\n return $ledgerEntryId;\n }", "public function store(Request $request)\n {\n $user=auth()->user();\n $restaurant=$user->restaurant_profile;\n \n $data=$request->validate([\n 'name'=>'required',\n 'description'=>'required',\n 'amount'=>'required|integer'\n ]);\n $expense=new Expense;\n $expense->name=$request->name;\n $expense->description = $request->description;\n $expense->restaurant_profile_id=$restaurant->id;\n $expense->amount=$request->amount;\n $expense->user=auth()->user()->name;\n $expense->save();\n\n return redirect()->route('expenses')->with('success','Expense added successfully');\n }", "public function store()\n\t{\n\t\t$data = Input::all();\n\t\t\n\t\t$validation = Validator::make($data, [\n\t\t\t'description'\t=>\t'required|min:3',\n\t\t\t'memo'\t\t\t=>\t'',\n\t\t\t'amount'\t\t=>\t'required|numeric',\n\t\t\t'quantity'\t\t=>\t'required|numeric'\n\t\t]);\n\t\t\n\t\t$errorMessages = new MessageBag;\n\t\t\n\t\tif($validation->fails()){\n\t\t\t$errorMessages->merge($validation->errors()->toArray());\n\t\t}\n\t\t\n\t\t//$cash = new Expense;\n\t\t\n\t\t$cashInHand = Expense::cashInHand();\n\t\t\n\t\t$ex = ($data['amount'] * $data['quantity']);\n\t\t\n\t\tif($ex > $cashInHand){\n\t\t\t$errorMessages->add('amount', 'You cannot make an expense exceeding cash in hand');\n\t\t}\n\t\t\n\t\t//return dd($errorMessages);\n\t\t//die;\n\t\t\n\t\tif(count($errorMessages) > 0){\n\t\t\treturn Redirect::route('getAddExpense')\n\t\t\t\t\t->withInput()\n\t\t\t\t\t->withErrors($errorMessages);\n\t\t} else {\n\t\t\t$expense = Expense::create([\n\t\t\t\t'description'\t=> \t$data['description'],\n\t\t\t\t'amount'\t\t=>\t$data['amount'],\n\t\t\t\t'memo'\t\t\t=>\t$data['memo'],\n\t\t\t\t'quantity'\t\t=>\t$data['quantity']\n\t\t\t]);\n\t\t\t\n\t\t\tif($expense){\n\t\t\t\treturn Redirect::route('getExpenses')->with('success','Expense added successfully');\n\t\t\t} else {\n\t\t\t\treturn Redirect::route('getExpenses')->with('fail','An error occured while saving the expense');\n\t\t\t}\n\t\t}\n\t}", "public function add()\n {\n if($this->Auth->user('level') != \"Officer\" && $this->Auth->user('level') != \"Admin\")\n $this->redirect(\n array('controller' => 'Users', 'action' => 'profilehub/' . $this->Auth->user('id')));\n \n if($this->request->is('post'))\n {\n $this->Event->create();\n \n if($this->Event->save($this->request->data))\n {\n $this->redirect('announcements');\n }\n }\n \n $this->loadModel('User');\n $users = $this->User->find('all');\n\n $this->set('user', $users);\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Hub');\n }", "public function testStoreExpense()\n {\n $attributes = array(\n 'amount' => 432424,\n 'merchant_id' => 1,\n 'category_id' => 1,\n 'notes' => 'Lorem ipsum set amet.',\n 'attachment_id' => 1,\n 'created_at' => date('Y-m-d H:i:s')\n );\n\n $response = $this->call('POST', 'v1/expenses', $attributes);\n $data = json_decode($response->getContent());\n\n $this->assertFalse($data->error);\n $this->assertEquals('Expense has been created.', $data->message);\n }", "public function store(Request $request)\n {\n $expenseData = ['name' => $request->name,\n 'category_id' => $request->category_id,\n 'due_date' => $request->due_date,\n 'repeat' => $request->repeat,\n 'note' => $request->note,\n 'amount' => $request->amount, ];\n\n $expense = new Expense($expenseData);\n $expense->createdBy()->associate(Auth::user());\n $expense->updatedBy()->associate(Auth::user());\n $expense->save();\n\n if ($request->due_date <= Carbon::today()->format('Y-m-d')) {\n $expense->paid = \\constPaymentStatus::Paid;\n } else {\n $expense->paid = \\constPaymentStatus::Unpaid;\n }\n\n $expense->createdBy()->associate(Auth::user());\n\n $expense->save();\n flash()->success('Expense was successfully added');\n\n return redirect('expenses/all');\n }", "public function addExpense($table, $data)\n {\n\n if (isset($data)) {\n $result=$this->dynamicInsert($table, $data);\n }\n }", "public function store(Request $request)\n {\n \n $requestData = $request->all();\n \n Expense::create($requestData);\n\n return redirect('admin/expense')->with('flash_message', 'Expense added!');\n }", "public function create()\n\t{\t\n\n\t\treturn View::make('admin.expense.add')->with('cashInHand', Expense::cashInHand());\n\t}", "public function store( Request $request ) {\n $property_id = $request->input( 'property_id' );\n $expense_title = ucwords( $request->input( 'expense_title' ) );\n $expense_amount = $request->input( 'expense_amount' );\n\n $expense = new Expenses();\n $expense->exp_property_id = $property_id;\n $expense->expense_title = $expense_title;\n $expense->expense_amount = $expense_amount;\n\n $expense->save();\n\n Toastr::success( 'Expense added successfully' );\n return back();\n }", "public function create() {\n\t\t$employees = User::whereBetween('access_label', [2, 3])\n\t\t\t->where('deletion_status', 0)\n\t\t\t->select('id', 'name')\n\t\t\t->orderBy('id', 'DESC')\n\t\t\t->get()\n\t\t\t->toArray();\n\t\treturn view('administrator.hrm.expence.add_expence', compact('employees'));\n\t}", "public function edit(Expense $expense)\n {\n //\n }", "public function edit(Expense $expense)\n {\n //\n }", "public function create()\n {\n if (!Sentinel::hasAccess('expenses.create')) {\n Flash::warning(\"Permission Denied\");\n return redirect('/');\n }\n $types = array();\n foreach (ExpenseType::all() as $key) {\n $types[$key->id] = $key->name;\n }\n //get custom fields\n $custom_fields = CustomField::where('category', 'expenses')->get();\n return view('expense.create', compact('types', 'custom_fields'));\n }", "public function newAction()\n {\n View::renderTemplate('Expense/new.html', [\n 'categories' => Expense::getCategories(),\n 'methods' => Payment::getCategories()\n ]);\n }", "public function expense()\n {\n\n $self='expense';\n if (\\Auth::user()->user_name!=='admin'){\n $get_perm=permission::permitted($self);\n\n if ($get_perm=='access denied'){\n return redirect('permission-error')->with([\n 'message'=>language_data('You do not have permission to view this page'),\n 'message_important'=>true\n ]);\n }\n }\n\n\n $expense = Expense::all();\n $employee = Employee::where('user_name', '!=', 'admin')->get();\n return view('admin.expense', compact('expense', 'employee'));\n }", "public function addExpense($amount)\n {\n $account = Account::findOne([\n 'username' => $this->getCurrentUser()->username,\n ]);\n\n $account->balance -= $amount;\n\n $account->update(true, ['balance']);\n }", "public function store( Request $request )\n {\n $request->validate( [\n 'details' => 'required',\n 'amount' => 'required|numeric',\n ] );\n\n $expense = new Expense();\n $expense->details = $request->details;\n $expense->amount = $request->amount;\n $expense->date = date( 'Y-m-d' );\n $expense->save();\n }", "function expense_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'expense_add';\n $page_data['page_title'] = get_phrase('add_expense');\n $this->load->view('backend/index', $page_data);\n }", "public function insertExpensesInfo($user_id, $expenses) {\n\n//\t\t$user_id = '1';\n $userExpensesInfoSql = \"INSERT into expenses VALUES ('',$user_id,$expenses->exp_rent,$expenses->exp_utilities,$expenses->exp_groceries,$expenses->exp_gas,$expenses->exp_entertainment,$expenses->exp_household,$expenses->exp_health,$expenses->exp_travel,$expenses->exp_emi,$expenses->exp_cc_month,$expenses->exp_others,'','')\";\n\n $connection = Yii::app()->db3;\n $command = $connection->createCommand($userExpensesInfoSql)->execute();\n\n return 1;\n }", "public function edit( Expenses $expenses ) {\n //\n }", "public function action_add()\r\n\t{\t\tif ( ! $this->user->can('event_add'))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.add.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// Valid csrf\r\n\t\tif ($this->valid_post())\r\n\t\t{\r\n\t\t\t// Extract event data from $_POST\r\n\t\t\t$event_post = Arr::get($this->request->post(), 'event', array());\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\t// Create new event object\r\n\t\t\t\t$event = ORM::factory('event')->create_event($this->user, $event_post);\r\n\t\t\t\t\r\n\t\t\t\t// Notification\r\n\t\t\t\tNotices::success('event.add.success');\r\n\t\t\t\t\r\n\t\t\t\t$event->enroll($this->user, $event_post['character'], Model_Status::READY, 'Event leader');\r\n\t\t\t\tNotices::success('event.enroll.success');\r\n\t\t\t\t\r\n\t\t\t\t// Display created event\r\n\t\t\t\t$this->request->redirect(Route::url('event').'#'.$event->id);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tcatch(ORM_Validation_Exception $e)\r\n\t\t\t{\r\n\t\t\t\t\tNotices::error('event.add.fail');\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->view->errors = $e->errors('validation');\r\n\t\t\t\t\t$this->view->values = $event_post;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t//Notices::error('event.enroll.on_create_failed');\r\n\t\t\t\t\t//$this->request->redirect(Route::url('event').'#'.$event->id);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Pass user to view object for character list, etc.\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function store(Request $request)\n {\n\t\t$request->validate([\n 'expense_name' => 'required',\n\t\t\t'expense_date' => 'required',\n\t\t\t'expense_amount' => 'required',\n ]);\n \n $expenses = new Expenses;\n\t\t$expenses->name = strip_tags($request->expense_name);\n $expenses->expense_category_id = $request->expense_category;\n $expenses->expense_amount = $request->expense_amount;\n $expenses->expense_date = date(\"Y-m-d\", strtotime($request->expense_date));\n $expenses->expense_notes = strip_tags($request->notes);\n $expenses->customer_id = $request->customer;\n $expenses->vendor_id = $request->vendor_id;\n \n $expenses->user_id = auth()->user()->id;\n\t\t$expenses->company_id = auth()->user()->company->id;\n $expenses->save();\n \n return redirect()->route('expenses.index')->withStatus(__('Expense successfully created!'));\n }", "public function store(Request $request)\n {\n $expense = new Expense();\n $expense->expense_type = $request->expense_type;\n $expense->amount = $request->amount;\n $expense->date = $request->date;\n $expense->employee_id = $request->employee_id;\n $expense->branch_id = $request->branch_id;\n\n $expense->save();\n return back();\n }", "public function actionAdd() {\n\t\treturn $this->txSave ( \"app\\models\\User\" );\n\t}", "public function create()\n {\n\t\tif(auth()->user() && auth()->user()->hasRole('admin') || auth()->user() && auth()->user()->hasRole('owner')){\n\t\t\t$company_id = auth()->user()->company->id;\n\t\t\t$categories = ExpenseCategories::where(['company_id' => $company_id])->where(['is_active' => 1])->get();\n\t\t\t$customers = Customers::where(['company_id' => $company_id])->get();\n return view('expenses.create',compact('categories', 'customers'));\n }else return redirect()->route('login');\n }", "public function add()\n\t{\n\t\t// Initialize variables.\n\t\t$app = &JFactory::getApplication();\n\n\t\t// Clear the level edit information from the session.\n\t\t$app->setUserState('com_users.edit.user.id', null);\n\t\t$app->setUserState('com_users.edit.user.data', null);\n\n\t\t// Redirect to the edit screen.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_users&view=user&layout=edit', false));\n\t}", "public function new_expense()\n {\n \n $data['categories']=$this->Expense_model->get_categories();\n\n if ( $this->input->is_ajax_request() ) { // user is requesting page from left navigation\n $this->load->view('app/new_expense', $data);\n } else {\n\n if ( $this->input->post('submitBtn') ) { // form is submitted\n\n $this->form_validation->set_rules('amount', 'Amount', 'trim|required|is_natural_no_zero|integer|min_length[3]|max_length[11]');\n $this->form_validation->set_rules('expense_date', 'Date', 'trim|required');\n $this->form_validation->set_rules('description', 'Description', 'trim');\n $this->form_validation->set_rules('category', 'Category', 'trim|required');\n\n if ($this->form_validation->run() == FALSE) { //invalid/missing values in one or more input fields\n \n $data['error_message'] = validation_errors();\n $data['main_content'] = 'app/new_expense';\n $this->load->view('app/includes/template', $data);\n \n } else { // insert user's expense\n \n $amount = trim(strip_tags(htmlentities($this->input->post('amount'))));\n $expense_date = trim(strip_tags(htmlentities($this->input->post('expense_date'))));\n $description = trim(strip_tags(htmlentities($this->input->post('description'))));\n $category = trim(strip_tags(htmlentities($this->input->post('category'))));\n $user_id = $this->ion_auth->get_user_id();\n \n $expense_date = strtotime($expense_date)? $expense_date : date('Y-m-d');\n \n $user_data = array(\n 'user_id' => $user_id,\n 'amount' => $amount,\n 'description' => $description,\n 'category_id' => $category,\n 'expense_date' => $expense_date,\n 'created_date' => date('Y-m-d H:i:S')\n );\n\n $insert = $this->Expense_model->insert_expense($user_id,$user_data);\n \n if ($insert) {\n $data['success_message'] = 'Expense Added Succesfully';\n } else {\n $data['error_message'] = 'Sorry there was an error. Please try again';\n }\n \n \n $data['main_content'] = 'app/new_expense';\n $this->load->view('app/includes/template', $data);\n\n }\n\n } else { // user is accessing page directly from url\n \n $data['main_content'] = 'app/new_expense';\n $this->load->view('app/includes/template', $data);\n \n }\n \n }\n }", "public function create()\n {\n $users = User::all();\n return view('admin.expense.create',compact('users'));\n }", "public function create(){\n\t\treturn view('driver.expense.create');\n }", "public function add(){\r\n\t\t//$this->auth->set_access('add');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function index()\n {\n $data['title'] = \"Insert Personal Expense\";\n return view(\"admincontrol.personalexpenses.create\",$data);\n }", "function addNew()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n else\n {\n $this->load->model('user_model');\n $data['roles'] = $this->user_model->getUserRoles();\n \n $this->global['pageTitle'] = 'Garuda Informatics : Add New User';\n\n $this->loadViews($this->view.\"addNew\", $this->global, $data, NULL);\n }\n }", "function edit($expenses_id)\n { \n\t\tif ($this->auth->loggedin()) {\n\t\t\t$id = $this->auth->userid();\n\t\t\t\n\t\t\tif(!($this->User_model->hasPermission('update',$id)&&($this->User_model->hasPermission('accounts',$id)||$this->User_model->hasPermission('WILD_CARD',$id)))){\n\t\t\t\tshow_error('You Don\\'t have permission to perform this operation.');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// check if the expense exists before trying to edit it\n\t\t\t$this->data['expense'] = $this->acc_expenses_model->get_acc_expense($expenses_id);\n\t\t\t$this->data['location'] = $this->Location_model->get_all_location();\n\t\t\t\n\t\t\tif(isset($this->data['expense']['id']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$this->form_validation->set_rules('expenseItem_id', '<b>Item</b>', 'trim|required|integer|min_length[1]|max_length[100]');\n\t\t\t\t$this->form_validation->set_rules('amount', '<b>Amount</b>', 'trim|required|integer|min_length[1]|max_length[10]');\n\t\t\t\t\t\n\t\t\t\tif(isset($_POST) && count($_POST) > 0 && $this->form_validation->run()) \n\t\t\t\t{ \n\t\t\t\t\t$params = array(\n\t\t\t\t\t\t\n\t\t\t\t\t\t'acc_expense_item_id' => $this->input->post('expenseItem_id'),\n\t\t\t\t\t\t'expense' => $this->input->post('amount'),\n\t\t\t\t\t\t'remark' => $this->input->post('remark'),\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$this->acc_expenses_model->update_acc_expense($expenses_id,$params); \n\t\t\t\t\tredirect('acc_expenses/index');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$user = $this->User_model->get('person_id', $id);\n\t\t\t\t\tunset($user['password']);\n\t\t\t\t\t$user_role = $this->User_model->loadRoles($user['person_id']);\n\t\t\t\t\t\n\t\t\t\t\t$this->data['user'] = $user['username'];\n\t\t\t\t\t$this->data['urole'] = $user_role;\n\t\t\t\t\t$specialPerm = $this->User_model->loadSpecialPermission($id);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$this->data['pp'] = $specialPerm;\n\t\t\t\t\t$this->data['p_role'] = $this->Person_role_model->get_person_role($id);\n\t\t\t\t\t$this->data['expenseItem'] = $this->acc_expensesItem_model->get_all_acc_expense_items();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$this->template\n\t\t\t\t\t\t->title('Welcome','My Aapp')\n\t\t\t\t\t\t->build('acc_expenses/edit',$this->data);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\tshow_error('The expense you are trying to edit does not exist.');\n\t\t}\n\t\telse{\n\t\t\t$this->template\n\t\t\t\t\t->title('Login Admin','Login Page')\n\t\t\t\t\t->set_layout('access')\n\t\t\t\t\t->build('access/login');\n\t\t}\n }", "public function action_add()\r\n\t{\r\n\t\tif ( Request::current()->method() == Request::POST )\r\n\t\t{\r\n\t\t\treturn $this->_add();\r\n\t\t}\r\n\t\t\r\n\t\t$this->template->title = __('Add user');\r\n\t\t$this->breadcrumbs\r\n\t\t\t->add($this->template->title);\r\n\r\n\t\t// check if user have already enter something\r\n\t\t$data = Flash::get( 'post_data', array() );\r\n\r\n\t\t$user = new User( $data );\r\n\r\n\t\t$this->template->content = View::factory( 'user/edit', array(\r\n\t\t\t'action' => 'add',\r\n\t\t\t'user' => $user,\r\n\t\t\t'permissions' => Model_Permission::get_all()\r\n\t\t) );\r\n\t}", "function addnewuser() {\n \t\t\t$this->set('GetUserQ', $this->Users->GetUsers(0));\n \t\t\t$this->set('GetLevelsQ', $this->AccessLevels->index());\n \t\t}", "public function testUpdateExpense()\n {\n $attributes = array(\n 'amount' => 24344,\n 'merchant_id' => 1,\n 'category_id' => 1,\n 'created_at' => date('Y-m-d H:i:s')\n );\n\n $response = $this->call('PUT', 'v1/expenses/1', $attributes);\n $data = json_decode($response->getContent());\n\n $this->assertFalse($data->error);\n $this->assertEquals('Expense has been updated.', $data->message);\n }", "function addNew()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $data['roles'] = $this->user_model->getUserRoles();\n\n $this->global['pageTitle'] = '添加人员';\n\n $this->loadViews(\"addNew\", $this->global, $data, NULL);\n }\n }", "public function additionExpenses()\n {\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `expenses`(`idem`, `billex`, `dateex`, `priceex`, `discountex`, `totalex`, `notsex`, `deletex`)\n VALUES ('$this->idem' ,'$this->billex' ,'$this->dateex' ,'$this->priceex' ,'$this->discountex' ,'$this->totalex' ,'$this->notsex' ,'$this->deletex')\");\n $result = $sql->execute();\n $idex = $dbh->lastInsertId();\n return array ($result,$idex);\n }", "public function addExperience(Request $request){\n $experience = new Experience();\n $experience->position = $request->position;\n $experience->org_name = $request->org_name;\n $experience->year_of_experience = $request->year_of_experience;\n $experience->cv_id = $request->cv_id;\n if ($experience->save()){\n return redirect()->back()->with('message','Experience Added Successfully');\n }\n }", "public function submit(Request $request){\n\t\t// dd($request->all());\n\t\t// added some validation for form values. \n\t\t$request->validate([\n\t\t\t'type' => 'required|string',\n\t\t\t'amount' => 'required|numeric',\n\t\t\t'title' => 'required|string'\n\t\t]);\n\t\t\n\t\tDB::beginTransaction(); // starting transaction for runtime db error.\n\t\t// if one query executed and other gives error then both will be roll backed. \n\t\ttry {\n\t\t\t// dd($request->all()); // debugging method die dump.\n $transaction = new Expense;\n $transaction->type = $request->type;\n $transaction->title = $request->title;\n $transaction->amount = $request->amount;\n $transaction->driver_id = auth()->user()->id;\n\t\t\t$transaction->save();\n\n\n\n\t\t} catch (\\Throwable $th) {\n\t\t\tdd($th);\n\t\t\tDB::rollback();\n\t\t\tToastr::error('Server side error');\n\t\t\treturn redirect()->back();\n\t\t}\n\n\t\tDB::commit();\n\t\tToastr::success('transaction created successfully', 'Created!');\n return redirect()->back();\n\t}", "function addExpense($week, $money){\n global $db;\n \n $get = getRecentPurchaseId();\n $idPurchase=$get['idPurchase'];\n $stmt =$db->prepare(\"INSERT INTO invoices (week, expense, idPurchase) VALUES (:week, :expense, :idPurchase)\");\n \n $binds= array(\n \":week\"=> $week,\n \":expense\"=> $money,\n \":idPurchase\"=>$idPurchase\n );\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n return true;\n }\n else{\n return false;\n }\n }", "public function postExpense(Request $request)\n {\n\n $self='add-new-expense';\n if (\\Auth::user()->user_name!=='admin'){\n $get_perm=permission::permitted($self);\n\n if ($get_perm=='access denied'){\n return redirect('permission-error')->with([\n 'message'=>language_data('You do not have permission to view this page'),\n 'message_important'=>true\n ]);\n }\n }\n\n\n $v = \\Validator::make($request->all(), [\n 'item_name' => 'required', 'purchase_from' => 'required', 'emp_name' => 'required', 'amount' => 'required', 'purchase_date' => 'required', 'status' => 'required'\n ]);\n\n if ($v->fails()) {\n return redirect('expense')->withErrors($v->errors());\n }\n\n $item_name = Input::get('item_name');\n $purchase_from = Input::get('purchase_from');\n $emp_name = Input::get('emp_name');\n $purchase_date = Input::get('purchase_date');\n $purchase_date=date('Y-m-d',strtotime($purchase_date));\n $amount = Input::get('amount');\n $status = Input::get('status');\n $bill_copy = Input::file('bill_copy');\n\n if ($bill_copy != '') {\n $destinationPath = public_path() . '/assets/bill_copy/';\n $bill_copy_name = $bill_copy->getClientOriginalName();\n Input::file('bill_copy')->move($destinationPath, $bill_copy_name);\n } else {\n $bill_copy_name = '';\n }\n\n $expense = new Expense();\n $expense->item_name = $item_name;\n $expense->purchase_from = $purchase_from;\n $expense->purchase_date = $purchase_date;\n $expense->purchase_by = $emp_name;\n $expense->amount = $amount;\n $expense->status = $status;\n $expense->bill_copy = $bill_copy_name;\n $expense->save();\n\n return redirect('expense')->with([\n 'message' => language_data('Expense Added Successfully')\n ]);\n\n }", "public function manage(ManageExpencesRequest $request)\n {\n // get all the request params \n $params = $request->all();\n $expence = new Expence;\n $user = Auth::id();\n\n $message = trans('app.something_went_wrong');\n $code = 500;\n\n // add request\n if($request->action === \"add\"){\n $expence = $expence->add($user, $params);\n $message = trans('expence.expence_added');\n $code = 201;\n\n }else if($request->action === \"update\"){ // update request\n $expence = $expence->edit($params['expence'], $params);\n $message = trans('expence.expence_updated');\n $code = 200;\n\n }else if($request->action === \"delete\"){ // delete request\n $expence = $expence->softDelete($params['expence']);\n $message = trans('expence.expence_deleted');\n $code = 200;\n\n }\n\n if(!empty($expence->id)){\n return response()->json([\n 'expence' => $expence,\n 'message' => $message\n ], $code);\n }else{\n return response()->json([\n 'expence' => $expence,\n 'message' => $message\n ], $code);\n }\n }", "public function create()\n {\n $isAdmin = $this->getIsAdmin();\n $list_company = $this->getListCompany();\n $collectDataForExpense = app('request')->data_collect_for_expense;\n\n return view('finance.expense.create', [\n 'isAdmin' => $isAdmin,\n 'list_company' => $list_company,\n 'expense_reference_number' => $collectDataForExpense['expense_reference_number'],\n ]);\n }", "public function addAction ()\n {\n $em = $this->getDoctrine()->getManager();\n\n $evaluation = new Evaluation();\n $evaluation->setSupervisor($this->getSupervisor());\n\n // Liste des tests accessibles par l'utilisateur\n $tests = $em->getRepository('PeerassessCoreBundle:Test')->findAll();\n $form = $this->createForm(new EvaluationType($tests), $evaluation);\n\n $form->handleRequest($this->getRequest());\n if ($form->isValid()) {\n $em->persist($evaluation);\n $em->flush();\n\n $tr = $this->get('translator');\n $message = $tr->trans('evaluation.add.success',array(),'SiteSupervisorBundle');\n\n $this->get('session')->getFlashBag()->add('notice',$message);\n return $this->redirectRoute(\n 'site_supervisor_evaluation-session_add-single',\n array(\n 'id' => $evaluation->getId()\n )\n );\n }\n\n return $this->render('SiteSupervisorBundle:Evaluation/Add:add.html.twig', array(\n 'form' => $form->createView(),\n 'languages' => Languages::getList(),\n 'tests' => $tests\n ));\n }", "public function edit(Expense $expense)\n { \n //check for correct user\n if(auth()->user()->id !== $expense->user_id){\n return redirect('/operations')->with('error','Unauthorized Page');\n }\n else\n {\n $title = \"Edit expense\";\n\n $accounts = Account::where('user_id', auth()->user()->id)->get();\n $categories_ex = Category::where('type','expense')->where(function ($query) { $query->where('user_id', auth()->user()->id)->orWhere('user_id', NULL);})->get();\n\n return view('pages.editexpense')->with('title', $title)\n ->with('expense', $expense)\n ->with('accounts', $accounts)\n ->with('categories_ex', $categories_ex);\n } \n }", "function add()\n\t{\n\t\t$companies = $this->company_model->get_many_by(array('active_status' => 1));\n\t\t$violation_levels = $this->violation_level_model->get_many_by(array('active_status' => 1));\n\t\t$violation_types = $this->violation_type_model->get_many_by(array('active_status' => 1));\n\t\t\n\t\t$this->data = array(\n 'page_header' \t=> 'Add New Violation',\n 'notification' \t=> array(\"sound\"=>false),\n\t\t\t'companies'\t\t=> $companies,\n\t\t\t'violation_levels'\t=>$violation_levels,\n\t\t\t'violation_types'\t=>$violation_types\n );\n\t\t$this->load_view('forms/violation-add');\n\t}", "public function create()\n {\n return view('expenses.create');\n }", "public function create()\n {\n return view('expenses.create');\n }", "public function store(Request $request) {\n\t\t// return ($request->all());\n\t\t$expence_manages = $this->validate($request, [\n\t\t\t'employee_id' => 'required',\n\t\t\t'opening_blance' => 'required',\n\t\t\t'recovery_amount_on_cash' => 'required',\n\t\t\t'recovery_amount_by_cheque' => 'required',\n\t\t\t'bank_deposit_amount' => 'required',\n\t\t\t'expenses_amount' => 'required',\n\t\t\t'balance_amount' => 'required',\n\t\t\t'remarks_if_any' => 'required',\n\n\t\t]);\n\t\t$result = ExpenceManagement::create($expence_manages + ['created_by' => auth()->user()->id]);\n\t\t$inserted_id = $result->id;\n\t\tif (!empty($inserted_id)) {\n\t\t\treturn redirect('/hrm/expence/manage-expence')->with('message', 'Add successfully.');\n\t\t}\n\t\treturn redirect('/hrm/expence/manage-expence')->with('exception', 'Operation failed !');\n\n\t}", "public function experiencesAction() {\n $id = $this->_getParam('expid');\n $ses = new Application_Model_Session();\n $ses->startSession();\n if ($ses->getSessionParameter('view') == 1) {\n $ses->unsetSessionParameter('view');\n $this->view->msg = \"Thank you for sharing your views\";\n }\n $request = $this->getRequest();\n $form = new Campuswisdom_Form_Exps();\n $this->view->form = $form;\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($request->getPost())) {\n $mapper = new Campuswisdom_Model_ExpMapper();\n $Category = $this->_getParam('Category');\n $Name = $this->_getParam(\"Name\");\n $Views = $this->_getparam('Views');\n $dbTable = new Campuswisdom_Model_DbTable_Exps();\n $mapper->setDbTable($dbTable);\n $mapper->simplesave($Category, $Name, $Views);\n $ses->setSessionParameter('msg', \"Your Experience has been added\");\n $this->_helper->_redirector(array('controller' => 'experiences', 'action' => 'getexperiences'));\n }\n }\n \n }", "public function add() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['password'] = AuthComponent::password($this->request->data['User']['password']);\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('The user has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t} else {\n\t\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t\t$lookupSupported = isset($queryURL) && \"\" <> $queryURL;\r\n\t\t\t$this->set('lookupSupported', $lookupSupported);\n\t\t\t$this->set('userType', $user['User']['type']);\n\t\t}\n\t}", "public function store(CreateExpensesRequest $request)\n {\n $this->validate($request,[\n 'amount'=>'required|numeric|min:0'\n ]);\n $input = $request->all();\n $expenses = $this->expensesRepository->create($input);\n if(! empty($input['profile'])){\n // store the image\n $profilePicture = File::getFileByPath($input['profile']);\n $expenses->files()->attach($profilePicture,['is_profile'=>1]);\n }\n else{\n // set a place holder\n $expenses->files()->attach(File::getFileByPath(config('ifm.buildings.image_placeholder')));\n }\n\n Flash::success('Expenses saved successfully.');\n\n return redirect(route('expenses.index'));\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'date' => 'required',\n 'name' => 'required',\n 'total' => 'required'\n ]);\n\n $expence = new Expence();\n $expence->date = $request->date;\n $expence->name = $request->name;\n $expence->details = $request->details;\n $expence->total = $request->total;\n $expence->save();\n return redirect()->route('expences.index')->with('success', 'Expence added successfully');\n }", "public function addAction() {\n\t\t$form = new Default_Form_UserGroup ();\n\t\t$userGroup = new Default_Model_UserGroup ();\n\t\t$userGroupMapper = new Default_Model_Mapper_UserGroup ();\n\t\t$this->_save ( $form, self::$ADD_MODE );\n\t\tunset($form->getElement('modules')->required);\n\t\t$this->view->form = $form;\n\t\t$this->render ( \"add-edit\" );\n\t}", "public function store(ExpertiseRequest $request)\n {\n\n $data = $request->getData();\n Expertise::create($data);\n return redirect('jobseeker/expertise');\n }", "public function add_income()\n {\n if ( $this->input->is_ajax_request() ) { // user is requesting page from left navigation\n $data['result']=$this->Expense_model->get_income($this->ion_auth->get_user_id());\n $this->load->view('app/create_income', $data);\n } else {\n\n if ( $this->input->post('submitBtn') ) { // form is submitted\n $this->form_validation->set_rules('income', 'Income', 'trim|required|is_natural_no_zero|integer|min_length[3]|max_length[11]');\n $this->form_validation->set_rules('bonus', 'Bonus', 'trim|is_natural_no_zero|integer|min_length[3]|max_length[11]');\n $this->form_validation->set_rules('allowance', 'Allowance', 'trim|is_natural_no_zero|integer|min_length[3]|max_length[11]');\n\n if ($this->form_validation->run() == FALSE) { //invalid values in one or more input fields\n \n $data['result']=$this->Expense_model->get_income($this->ion_auth->get_user_id());\n $data['error_message'] = validation_errors();\n $data['main_content'] = 'app/create_income';\n $this->load->view('app/includes/template', $data);\n \n } else { // insert/update user's income record\n \n $income = trim(strip_tags(htmlentities($this->input->post('income'))));\n $bonus = trim(strip_tags(htmlentities($this->input->post('bonus'))));\n $allowance = trim(strip_tags(htmlentities($this->input->post('allowance'))));\n $user_id = $this->ion_auth->get_user_id();\n \n $user_data = array(\n 'user_id' => $user_id,\n 'income' => $income,\n 'bonus' => $bonus,\n 'additional_allowance' => $allowance,\n 'created_date' => date('Y-m-d H:i:S')\n );\n\n $insert = $this->Expense_model->insert_income($user_id,$user_data);\n \n if ($insert) {\n $data['result']=$this->Expense_model->get_income($this->ion_auth->get_user_id());\n $data['success_message'] = 'Income Added Succesfully';\n } else {\n $data['result']=$this->Expense_model->get_income($this->ion_auth->get_user_id());\n $data['success_message'] = 'Income Updated Succesfully';\n }\n \n \n $data['main_content'] = 'app/create_income';\n $this->load->view('app/includes/template', $data);\n\n }\n\n } else { // user is accessing page directly from url\n \n $data['result']=$this->Expense_model->get_income($this->ion_auth->get_user_id());\n $data['main_content'] = 'app/create_income';\n $this->load->view('app/includes/template', $data);\n \n }\n \n }\n }", "public function add()\n\t{\n\t\t// TODO\n\t\t// if(user has permissions){}\n\t\t$this -> loadModel('User');\n\t\tif($this -> request -> is('post') && !$this -> User -> exists($this -> request -> data['SgaPerson']['user_id']))\n\t\t{\n\t\t\t$this -> Session -> setFlash(\"Please select a valid JacketPages user to add.\");\n\t\t\t$this -> redirect(array('action' => 'index',$id));\n\t\t}\n\t\t$this -> loadModel('User');\n\t\tif ($this -> request -> is('post'))\n\t\t{\n\t\t\t$this -> SgaPerson -> create();\n\t\t\tif ($this -> SgaPerson -> save($this -> data))\n\t\t\t{\n\t\t\t\t$user = $this -> User -> read(null, $this -> data['SgaPerson']['user_id']);\n\t\t\t\t$this -> User -> set('level', 'sga_user');\n\t\t\t\t$this -> User -> set('sga_id', $this -> SgaPerson -> getInsertID());\n\t\t\t\t$this -> User -> save();\n\t\t\t\t$this -> Session -> setFlash(__('The user has been added to SGA.', true));\n\t\t\t\t$this -> redirect(array('action' => 'index'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this -> Session -> setFlash(__('Invalid user. User may already be assigned a role in SGA. Please try again.', true));\n\t\t\t}\n\t\t}\n\t}", "public function annimalAddAction()\n {\n }", "public function postAddToEmployee()\n { \n $rules = array(\n 'name' => 'required',\n 'level' => 'required'\n );\n\n $validator = Validator::make(Input::all(), $rules);\n \n if ($validator->fails())\n {\n Session::put('error_messages', $validator->messages());\n Session::put('input_values', Input::all());\n Session::flash('add_skill_failed', 1);\n }\n else\n {\n $values = Input::all();\n \n $skill = new Skill;\n foreach ($values as $key => $value)\n {\n $skill->{$key} = $value;\n }\n $skill->save();\n \n Session::flash('add_skill_success', 1);\n }\n return Redirect::to('admin/employee/qualification/'.Input::get('employee_id'));\n }", "public function create()\n {\n return view('admin.master.expense_type.add');\n }", "public function update(Request $request, Expense $expense)\n {\n //\n }", "public function addAction() {\r\n\t\tif ($this->request->isPost ()) {\r\n\t\t\t$user = new Users ();\r\n\t\t\t$user->firstname = $this->request->get ( \"first_name\" );\r\n\t\t\t$user->lastname = $this->request->get ( \"last_name\" );\r\n\t\t\t$user->bithday = $this->request->get ( \"date\" );\r\n\t\t\t$user->save ();\r\n\t\t}\r\n\t}", "function addsubmit() \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\n \n // Use the add action's post form variables and the current precise time to insert an article.\n // validate all post variables before inserting them to avoid a\n // SQL Injection attack and ensure that we've working with clean data. \n\t\t$email=$_POST['email'];\n\t\t$password=$_POST['password'];\n\t\ttry\n\t\t{\n\t\t if (!empty($_POST['username'])&& !empty($_POST['firstname'])&& !empty( $_POST['role']) && !empty($_POST['email']) && !empty($_POST['password']))\n\t\t { \n\t\t\t$result= UserModel::Create()->InsertUser($_POST['username'],$_POST['email'], $password, $_POST['firstname'],$_POST['middlename'],$_POST['lastname'],$_POST['role'], $_POST['phoneres'], $_POST['phonecell'], $_POST['status'], $_POST['comments']);\n\t\t\t\n\t\t\tif(empty($result))\n\t\t\t{\n\t\t\t\t$this->viewData['module']=\"Add User\";\n\t\t\t\t$this->viewData['error']= \"Failed to Add the user\";\n\t\t\t\t$this->renderWithTemplate('common/error', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t\telse // invite the user by sending email \n\t\t\t{\n\t\t\t\tMailModel::SendInvitation($_POST['email'], $_POST['firstname'],$result);\n\t\t\t\t$this->renderWithTemplate('users/addsubmit', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t }\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\t\t\t$this->viewData['module']=\"Add User\";\n\t\t\t$this->viewData['error']= $ex->getMessage();\n\t\t\t$this->renderWithTemplate('common/error', 'AdminPageBaseTemplate');\n\t\t}\n\t\t\n\t}", "public function add(){\n if ($_POST) {\n if ($_POST[\"operation\"] == 'egreso'){\n $_POST[\"amount\"] = $_POST[\"amount\"]*(-1);\n }\n if ($this->transactions->save(\"transactions\", $_POST)) {\n $this->redirect(array(\"controller\"=>\"transactions\"));\n }else{\n $this->redirect(array(\"controller\"=>\"transactions\", \"method\"=>\"add\"));\n }\n }\n \n $this->set(\"accounts\", $this->transactions->find(\"accounts\"));\n $this->set(\"categories\", $this->transactions->find(\"categories\"));\n $this->_view->setView(\"add\");\n /* }else{\n $this->redirect(array(\"controller\"=>\"transactions\"));\n }*/\n }", "function addActivity($name, $earning) {\n var_dump($name, $earning);\n try {\n $query = \"INSERT INTO activityModel (id, name, dkpEarn) VALUES (NULL, ?, ?)\";\n $items = $this->perform_query_two_param($query, \"ss\", $name, $earning);\n } catch(Exception $ex) {\n $this->print_error_message(\"Unable to Add Activity\");\n }\n }", "public function create()\n {\n return view('bsd-admin.expences.create');\n }", "public function admin_add()\n {\n if ($this->request->is('post')) {\n $this->User->create();\n\n $this->request->data['Impi']['auth_scheme'] = 127;\n\n if ($this->User->saveAll($this->request->data)) {\n $this->Session->setFlash(__('The user has been saved'));\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n }\n }\n $utilityFunctions = $this->User->UtilityFunction->find('list');\n\n $this->set(compact('utilityFunctions', 'utilityFunctionsParameters'));\n }", "public function add() {\n\t\t// then redirect them to the edit page\n\t\t\n\t\t$article = new Article;\n\t\t\n\t\t$article->title = 'Untitled';\n\t\t$article->user_id = current_user()->id;\n\t\t$article->section_id = 1;\n\t\t$article->content = 'Content goes here';\n\t\t$article->is_approved = 0;\n\t\t$article->status = 'draft';\t\t\n\t\t\n\t\tif($article->save() == FALSE) {\n\t\t\t$this->session->set_flashdata('error', 'Unable to create new article');\n\t\t\tredirect('admin/articles/');\n\t\t}\n\t\t\n\t\t// Remove content forced in to satisfy TinyMapper validation\n\t\t$this->db->where('id', $article->id);\n\t\t$this->db->update('articles', array(\n\t\t\t'title' => 'Untitled '.$article->id,\n\t\t\t'content' => 'Content goes here'\n\t\t));\n\t\t\n\t\t// Set success message\n\t\t$this->session->set_flashdata('success', 'New article successfully created');\n\t\t\n\t\tredirect('admin/articles/edit/id/'.$article->id);\n\t}", "public function add_employee(){\n\n //If not allowed to add redirect;\n if (!isAllowedWriteModule()){\n redirect(base_url(\"employees\"));\n }\n\n $this->load->helper('form');\n\n $this->subViewFolder = \"add\";\n $viewData = array(\n \"viewFolder\" => $this->viewFolder,\n \"subViewFolder\" => $this->subViewFolder,\n \"title\" => \"Add New Employee\"\n );\n $this->load->view(\"{$this->viewFolder}/{$this->subViewFolder}/index\", $viewData);\n }", "function expense_tracker_add()\n{\n\tif($this->RequestHandler->isAjax()){\n\t$this->layout='blank';\n\t}else{\n\t$this->layout='session';\n\t}\n\t\n\t\t$this->ath();\n\t\t$this->check_user_privilages();\t\n\t\t\t\n\t$s_role_id=$this->Session->read('role_id');\n\t$s_society_id = (int)$this->Session->read('society_id');\n\t$s_user_id=$this->Session->read('user_id');\n\n\t\t$this->set('s_role_id',$s_role_id);\n\n\t\t\t$this->loadmodel('financial_year');\n\t\t\t$conditions=array(\"society_id\" => $s_society_id, \"status\"=>1);\n\t\t\t$cursor=$this->financial_year->find('all',array('conditions'=>$conditions));\n\t\t\tforeach($cursor as $collection)\n\t\t\t{\n\t\t\t\t$date_from = @$collection['financial_year']['from'];\n\t\t\t\t$date_to = @$collection['financial_year']['to'];\n\n\t\t\t\t$date_from1 = date('Y-m-d',$date_from->sec);\n\t\t\t\t$date_to1 = date('Y-m-d',$date_to->sec);\n\n\t\t\t$datef[] = $date_from1;\n\t\t\t$datet[] = $date_to1;\n\t\t\t}\n\t\t\t\tif(!empty($datef))\n\t\t\t\t{\n\t\t\t\t$datef1 = implode(',',$datef);\n\t\t\t\t$datet1 = implode(',',$datet);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t$count = sizeof(@$datef);\n\t\t\t\t\t$this->set('datef1',@$datef1);\n\t\t\t\t\t$this->set('datet1',@$datet1);\n\t\t\t\t\t$this->set('count',$count);\n\n\t\t\t$this->loadmodel('expense_tracker');\n\t\t\t$conditions=array(\"society_id\" => $s_society_id);\n\t\t\t$order=array('expense_tracker.receipt_id'=> 'DESC');\n\t\t\t$cursor=$this->expense_tracker->find('all',array('conditions'=>$conditions,'order' =>$order,'limit'=>1));\n\t\t\tforeach ($cursor as $collection) \n\t\t\t{\n\t\t\t$last=$collection['expense_tracker']['receipt_id'];\n\t\t\t}\n\t\t\tif(empty($last))\n\t\t\t{\n\t\t\t$zz=0;\n\t\t\t}\t\n\t\t\telse\n\t\t\t{\t\n\t\t\t$zz=$last;\n\t\t\t}\n\t\t\t$this->set('zz',$zz); \n\n\t\t\t\t$this->loadmodel('accounts_group');\n\t\t\t\t$conditions=array(\"accounts_id\" => 4);\n\t\t\t\t$cursor1=$this->accounts_group->find('all',array('conditions'=>$conditions));\n\t\t\t\t$this->set('cursor1',$cursor1);\n\n\t\tif(isset($this->request->data['kkk']))\n\t\t{\n\t\t\t$name = $this->request->data['cat_name'];\n\t\t\t$this->loadmodel('ledger_sub_account');\n\t\t\t$order=array('ledger_sub_account.auto_id'=> 'DESC');\n\t\t\t$cursor=$this->ledger_sub_account->find('all',array('order' =>$order,'limit'=>1));\n\t\t\tforeach ($cursor as $collection) \n\t\t\t{\n\t\t\t$last=$collection['ledger_sub_account'][\"auto_id\"];\n\t\t\t}\n\t\t\tif(empty($last))\n\t\t\t{\n\t\t\t$i=0;\n\t\t\t}\t\n\t\t\telse\n\t\t\t{\t\n\t\t\t$i=$last;\n\t\t\t}\n\t\t\t$i++;\n\t\t\t$this->loadmodel('ledger_sub_account');\n\t\t\t$multipleRowData = Array( Array(\"auto_id\" => $i, \"ledger_id\" => 15, \"name\" => $name, \"society_id\" => $s_society_id,\"delete_id\"=>0));\n\t\t\t$this->ledger_sub_account->saveAll($multipleRowData);\n\t\t}\n\n\t\t\t$this->loadmodel('ledger_sub_account');\n\t\t\t$conditions=array(\"ledger_id\" => 15,\"society_id\"=>$s_society_id);\n\t\t\t$cursor2=$this->ledger_sub_account->find('all',array('conditions'=>$conditions));\n\t\t\t$this->set('cursor2',$cursor2);\n\n\t\tif(isset($this->request->data['ext_addxfdfg']))\n\t\t{\n\t\t\t$posting_date = $this->request->data['posting_date'];\n\t\t\t$posting_date = date(\"Y-m-d\", strtotime($posting_date));\n\t\t\t$file_name = $_FILES['uploaded']['name'];\n\t\t\t$expense_head = (int)$this->request->data['ex_head'];\n\t\t\t$invoice_date = $this->request->data['invoice_date'];\n\t\t\t$invoice_amount = (int)$this->request->data['invoice_amount']; \n\t\t\t$due_date = $this->request->data['due_date'];\n\t\t\t$party_head = (int)$this->request->data['party_head'];\n\n\t\t\t\t$description = $this->request->data['description'];\n\t\t\t\t$current_date = date(\"d-m-Y\");\n\t\t\t\t$invoice_reference = $this->request->data['invoice_reference'];\n\t\t\t\t$invoice_date = date(\"Y-m-d\", strtotime($invoice_date));\n\t\t\t\t$due_date = date(\"Y-m-d\", strtotime($due_date));\n\t\t\t\t$current_date = date(\"Y-m-d\", strtotime($current_date));\n\n\t\t\t$target = \"expenset/\";\n\t\t\t$target = $target . basename( $_FILES['uploaded']['name']) ;\n\t\t\t$ok=1;\n\t\t\tmove_uploaded_file($_FILES['uploaded']['tmp_name'], $target);\n\n\t\t\t\t$p = 1;\n\t\t\t\twhile($p < 3)\n\t\t\t\t{\n\t\t\t\tif($p == 1)\n\t\t\t\t{\n\n\t\t\t\t\t$this->loadmodel('expense_tracker');\n\t\t\t\t\t$conditions=array(\"society_id\" => $s_society_id);\n\t\t\t\t\t$order=array('expense_tracker.auto_id'=> 'DESC','expense_tracker.receipt_id'=>'DESC');\n\t\t\t\t\t$cursor=$this->expense_tracker->find('all',array('conditions'=>$conditions,'order' =>$order,'limit'=>1));\n\t\t\t\t\tforeach ($cursor as $collection) \n\t\t\t\t\t{\n\t\t\t\t\t$last=$collection['expense_tracker'][\"auto_id\"];\n\t\t\t\t\t$r_last = $collection['expense_tracker']['receipt_id']; \n\t\t\t\t\t}\n\t\tif(empty($last) && empty($r_last))\n\t\t{\n\t\t$i=0;\n\t\t$r = 1000;\n\t\t}\t\n\t\telse\n\t\t{\t\n\t\t$i=$last;\n\t\t$r = $r_last;\n\t\t}\n\t\t\t$i++;\n\t\t\t$r++;\n\t\t\t$this->loadmodel('expense_tracker');\n\t\t\t$multipleRowData = Array( Array(\"auto_id\" => $i, \"receipt_id\" => $r, \"society_id\" => $s_society_id, \"current_date\" => $current_date, \n\t\t\t\"approver\" => $s_user_id, \"expense_head\" => $expense_head, \"invoice_date\" => $invoice_date, \n\t\t\t\"due_date\" => $due_date, \"party_head\" => $party_head, \"description\" => $description, \"posting_date\" => $posting_date,\n\t\t\t\"amount\" => $invoice_amount, \"amount_category_id\" => 1 , \"invoice_reference\" => $invoice_reference,\"file_name\"=>$file_name));\n\t\t\t$this->expense_tracker->saveAll($multipleRowData); \n\t\t}\n\n\t\t\tif($p == 2)\n\t\t\t{\n\t\t\t\t\t/*$this->loadmodel('expense_tracker');\n\t\t\t\t\t$conditions=array(\"society_id\" => $s_society_id);\n\t\t\t\t\t$order=array('expense_tracker.auto_id'=> 'DESC','expense_tracker.receipt_id'=>'DESC');\n\t\t\t\t\t$cursor=$this->expense_tracker->find('all',array('conditions'=>$conditions,'order' =>$order,'limit'=>1));\n\t\t\t\t\tforeach ($cursor as $collection) \n\t\t\t\t\t{\n\t\t\t\t\t$last=$collection['expense_tracker'][\"auto_id\"];\n\t\t\t\t\t$r_last = $collection['expense_tracker']['receipt_id']; \n\t\t\t\t\t}\n\t\t\t\t\tif(empty($last) && empty($r_last))\n\t\t\t\t\t{\n\t\t\t\t\t$i=0;\n\t\t\t\t\t$r = 1000;\n\t\t\t\t\t}\t\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t$i=$last;\n\t\t\t\t\t$r = $r_last;\n\t\t\t\t\t}\n\t\t\t\t\t$i++;\n\t\t\t\t\t$r++;\n\t\t\t\t\t$this->loadmodel('expense_tracker');\n\t\t\t\t\t$multipleRowData = Array( Array(\"auto_id\" => $i, \"receipt_id\" => $r, \"society_id\" => $s_society_id, \"current_date\" => $current_date, \n\t\t\t\t\t\"approver\" => $s_user_id, \"expense_head\" => $expense_head, \"invoice_date\" => $invoice_date, \n\t\t\t\t\t\"due_date\" => $due_date, \"party_head\" => $party_head, \"description\" => $description, \"posting_date\" => $posting_date,\n\t\t\t\t\t\"amount\" => $invoice_amount, \"amount_category_id\" => 2, \"invoice_reference\" => $invoice_reference));\n\t\t\t\t\t$this->expense_tracker->saveAll($multipleRowData); \n\t\t\t\t\t*/\n\t\t\t}\n\t\t\t\t$p++;\n\t\t\t}\n\n\t\t$sub_account_id_p = $party_head;\n\t\t$this->loadmodel('ledger');\n\t\t$order=array('ledger.auto_id'=> 'DESC');\n\t\t$cursor=$this->ledger->find('all',array('order' =>$order,'limit'=>1));\n\t\tforeach ($cursor as $collection) \n\t\t{\n\t\t$last=$collection['ledger'][\"auto_id\"]; \n\t\t}\n\t\tif(empty($last))\n\t\t{\n\t\t$k=0;\n\t\t}\t\n\t\telse\n\t\t{\t\n\t\t$k=$last;\n\t\t}\n\t\t$k++;\n\t\t$this->loadmodel('ledger');\n\t\t$multipleRowData = Array( Array(\"auto_id\" => $k, \"receipt_id\" => $r, \n\t\t\"amount\" => $invoice_amount, \"amount_category_id\" => 2, \"table_name\" => \"expense_tracker\", \"account_type\" => 1, \"account_id\" => $sub_account_id_p, \n\t\t\"current_date\" => $current_date, \"society_id\" => $s_society_id,\"module_name\"=>\"Expense Tracker\"));\n\t\t$this->ledger->saveAll($multipleRowData); \n\n\t\t\t\t$sub_account_id_e = $expense_head;\n\t\t\t\t$this->loadmodel('ledger');\n\t\t\t\t$order=array('ledger.auto_id'=> 'DESC');\n\t\t\t\t$cursor=$this->ledger->find('all',array('order' =>$order,'limit'=>1));\n\t\t\t\tforeach ($cursor as $collection) \n\t\t\t\t{\n\t\t\t\t$last=$collection['ledger'][\"auto_id\"]; \n\t\t\t\t}\n\t\t\t\tif(empty($last))\n\t\t\t\t{\n\t\t\t\t$k=0;\n\t\t\t\t}\t\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t$k=$last;\n\t\t\t\t}\n\t\t\t\t$k++;\n\t\t\t\t$this->loadmodel('ledger');\n\t\t\t\t$multipleRowData = Array( Array(\"auto_id\" => $k, \"receipt_id\" => $r, \n\t\t\t\t\"amount\" => $invoice_amount, \"amount_category_id\" => 1, \"table_name\" => \"expense_tracker\", \"account_type\" => 2, \n\t\t\t\t\"account_id\" => $sub_account_id_e, \"current_date\" => $current_date, \"society_id\" => $s_society_id,\"module_name\"=>\"Expense Tracker\"));\n\t\t\t\t$this->ledger->saveAll($multipleRowData); \n\n\t\t\t\t\t$this->loadmodel('expense_tracker');\n\t\t\t\t\t$conditions=array(\"society_id\" => $s_society_id);\n\t\t\t\t\t$cursor3=$this->expense_tracker->find('all',array('conditions'=>$conditions));\n\t\t\t\t\tforeach($cursor3 as $collection)\n\t\t\t\t\t{\n\t\t\t\t\t$d_receipt_id = (int)$collection['expense_tracker']['receipt_id'];\t\n\t\t\t\t\t}\n?>\n\t\t\t\t\t\t<div class=\"modal-backdrop fade in\"></div>\n\t\t\t\t\t\t<div class=\"modal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel1\" aria-hidden=\"true\">\n\t\t\t\t\t\t<div class=\"modal-header\">\n\t\t\t\t\t\t<center>\n\t\t\t\t\t\t<h3 id=\"myModalLabel3\" style=\"color:#999;\"><b>Expense Tracker</b></h3>\n\t\t\t\t\t\t</center>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"modal-body\">\n\t\t\t\t\t\t<center>\n\t\t\t\t\t\t<h5><b>Expense Voucher #<?php echo $d_receipt_id; ?> is generated successfully</b></h5>\n\t\t\t\t\t\t</center>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"modal-footer\">\n\t\t\t\t\t\t<a href=\"expense_tracker_view\" class=\"btn blue\">OK</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t<?php\t\t\n\t\t\t\t}\n\t\t\t\t}", "function add()\n {\n if(isset($_POST) && count($_POST) > 0)\n {\n $params = array(\n 'exe_asistencia' => $this->input->post('exe_asistencia'),\n );\n\n $eve_x_est_id = $this->Eve_x_est_model->add_eve_x_est($params);\n redirect('eve_x_est/index');\n }\n else\n {\n $data['_view'] = 'eve_x_est/add';\n $this->load->view('layouts/main',$data);\n }\n }", "public function store(Request $request)\n {\n //\n $expense = new Expense();\n $expense = $expense->create([\n 'user_id' => $request->user_id,\n 'category_id' => $request->category_id,\n 'amount' => $request->amount,\n 'entry_date' => $request->entry_date,\n ]);\n\n if($expense){\n $data = [\n 'data' => $expense,\n 'status' => 'success',\n ];\n }else{\n $data = [\n 'data' => false,\n 'status' => 'failed',\n ];\n }\n\n\n return response()->json($data);\n }", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(),\n [\n 'budget_id' => 'required',\n 'place' => 'required',\n 'date' => 'required|date',\n 'price' => 'required|between:0,99.99',\n 'reason' => 'max:255'\n ]);\n\n if ($validator->fails()) {\n return $this->sendError('Validation Failed', $validator->errors(), 400);\n }\n\n $expense = Expense::create([\n 'budget_id' => $request->budget_id,\n 'place' => $request->place,\n 'date' => $request->date,\n 'price' => $request->price,\n 'reason' => $request->reason\n ]);\n\n return $this->sendResponse($expense, 'Expense created');\n }", "public function create()\n {\n return redirect('expensesgroup');\n }", "public function addDegree() {\n global $REQUEST_DATA;\n\n return SystemDatabaseManager::getInstance()->runAutoInsert('degree', array('degreeCode','degreeName','degreeAbbr'), array(strtoupper($REQUEST_DATA['degreeCode']),$REQUEST_DATA['degreeName'],$REQUEST_DATA['degreeAbbr']) );\n }", "public function incomeFormAction()\n\t{\n\t\tView::renderTemplate('Income/addIncome.html', [\n\t\t\t'date' => date('Y-m-d'),\n\t\t\t'incomes' => Income::getIncomesCategories()\n\t\t]);\n\t}", "public function addAction() {\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('groups', $groups);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "function expense_tracker_add_row()\n{\n\t$this->layout='blank';\n\t$s_society_id=(int)$this->Session->read('society_id');\n\t$s_user_id=(int)$this->Session->read('user_id');\n\n\t\t$count = (int)$this->request->query('con');\n\t\t$this->set('count',$count);\n\n\t\t\t$this->loadmodel('accounts_group');\n\t\t\t$conditions=array(\"accounts_id\" => 4);\n\t\t\t$cursor1=$this->accounts_group->find('all',array('conditions'=>$conditions));\n\t\t\t$this->set('cursor1',$cursor1);\n\n\t\t\t\t$this->loadmodel('ledger_sub_account');\n\t\t\t\t$conditions=array(\"ledger_id\" => 15);\n\t\t\t\t$cursor2=$this->ledger_sub_account->find('all',array('conditions'=>$conditions));\n\t\t\t\t$this->set('cursor2',$cursor2);\n}", "function admin_add() {\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t$this->User->create();\n\n\t\t\t/**\n\t\t\t * Save new user.\n\t\t\t */\n\t\t\tif ($this->User->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * If the new user is saved, a success message is displayed.\n\t\t\t\t * Redirect to the index page.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has been saved.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If the user is not saved, an error message is displayed.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has not been saved.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Select all profiles (Administrator or Member).\n\t\t * @var array\n\t\t */\n\t\t$profiles = $this->User->Profile->find('list');\n\n\t\t/**\n\t\t * Select all offers enabled.\n\t\t * @var array\n\t\t */\n\t\t$offers = $this->User->Offer->find('list');\n\n\t\t/**\n\t\t * Put all profiles in \"profiles\" and offers in \"offers\".\n\t\t * $profiles and $offers will be available in the view.\n\t\t */\n\t\t$this->set(compact('profiles', 'offers'));\n\n\t}", "public function addUser(){}", "public function store(StoreNewExperience $request)\n {\n //\n $experience = new Experience(request([\n 'company_name',\n 'role',\n 'city',\n 'start_date',\n 'end_date'\n ]));\n auth()->user()->makeExperience($experience);\n\n $experiences = Experience::all();\n return view('admin.experiences.index',compact('experiences'));\n }", "public function add_employee()\n\t{\n\t\t\n\t\n\t\t//this is calling the view page employee_details to insert the employee's details\n\t\t$this->load->view('employee_details');\n\t}", "public function createAction()\n {\n $request = $this->getRequest();\n $entity = new Experience();\n $entity->setCandidat($this->getCurrentCandidat());\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('job_hub_candidat_show'));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function addUser()\n {\n\n foreach ($this->employeeStorage->getEmployeeScheme() as $key => $singleUser) {\n\n $userInput = readline(\"$singleUser : \");\n $validate = $this->validateInput($userInput, $key); // Each input is sent for validation using validateInput method\n\n while (!$validate) // loop that forces user to enter valid input\n {\n $userInput = readline(\"Unesite ispravan format : \");\n $validate = $this->validateInput($userInput, $key);\n\n }\n if ($key === 'income'){\n $userInput = number_format((float)$userInput, 2, '.', ''); // formats income input so it always has 2 decimal points\n }\n\n $data[$key] = $userInput;\n\n }\n\n $this->employeeStorage->setEmployee( $data ); // After every input is validated data is stored using setEmployee method\n\n echo \"\\033[32m\". \"## Novi zaposlenik \". $data['name'].\" \". $data['lastname'].\" je dodan! \\n\\n\".\"\\033[0m\";\n\n\n }", "public function add(){\n $this->edit();\n }", "public function store(CreateEarningRequest $request)\n {\n $input = $request->all();\n $customFields = $this->customFieldRepository->findByField('custom_field_model', $this->earningRepository->model());\n try {\n $earning = $this->earningRepository->create($input);\n $earning->customFieldsValues()->createMany(getCustomFieldsValues($customFields,$request));\n \n } catch (ValidatorException $e) {\n Flash::error($e->getMessage());\n }\n\n Flash::success(__('lang.saved_successfully',['operator' => __('lang.earning')]));\n\n return redirect(route('earnings.index'));\n }", "public function add(){\n\t\t$this->OnlyAdmin();\n\t\tif($this->input->post()){\n\t\t\t$this->TicketModel->Add($this->input->post());\n\t\t\tredirect('index.php/ticket/lists');}\n\t}", "public function addAction() {\n \t$dataType = $this->getInput('dataType');\n \tif (!in_array($dataType,$this->DATATYPE)) {\n \t exit(\"参数错误\");\n \t}\n \t$this->assign('dataType', $dataType);\n $this->assign('dataTypes', $this->DATATYPE);\n }" ]
[ "0.8273928", "0.76954234", "0.70365936", "0.6929456", "0.68369997", "0.6636071", "0.6512573", "0.6475286", "0.6455503", "0.6442551", "0.64412916", "0.6402608", "0.6362004", "0.63363075", "0.6334624", "0.6318255", "0.63086754", "0.6304994", "0.62851876", "0.6274362", "0.6258462", "0.6227976", "0.6227976", "0.62086105", "0.61792773", "0.6146554", "0.6136692", "0.61074126", "0.6086481", "0.60858124", "0.6077317", "0.6072688", "0.6072439", "0.6041687", "0.6020037", "0.60010666", "0.59780276", "0.59640235", "0.5962293", "0.59611744", "0.59492505", "0.59464043", "0.5931926", "0.592378", "0.5906139", "0.5887718", "0.58873475", "0.5882222", "0.5881204", "0.5867681", "0.5854119", "0.58489966", "0.58489287", "0.5847529", "0.58454335", "0.5842044", "0.5841813", "0.5836048", "0.5826889", "0.5826889", "0.5824167", "0.57997286", "0.5756376", "0.5743491", "0.57347095", "0.57203436", "0.5717736", "0.5712783", "0.5708012", "0.5702713", "0.5702086", "0.5698058", "0.56976503", "0.56853384", "0.56845623", "0.5674583", "0.5649715", "0.5631265", "0.5631083", "0.5628547", "0.56279933", "0.56235677", "0.5621989", "0.5621806", "0.5616291", "0.5598565", "0.5594445", "0.55920863", "0.5591466", "0.5568549", "0.556125", "0.55530185", "0.5546325", "0.554598", "0.5543273", "0.55429727", "0.55394095", "0.5537914", "0.5532574", "0.55307704" ]
0.77033734
1
Action to allow a user to edit an existing expense.
public function edit($cID) { $entry = $this->getEntryToEdit($cID); $this->set('entry', $entry); $this->set('showSaveDraft', true); $this->render('clov/default/edit'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Expense $expense)\n {\n //\n }", "public function edit(Expense $expense)\n {\n //\n }", "public function edit( Expenses $expenses ) {\n //\n }", "function edit($expenses_id)\n { \n\t\tif ($this->auth->loggedin()) {\n\t\t\t$id = $this->auth->userid();\n\t\t\t\n\t\t\tif(!($this->User_model->hasPermission('update',$id)&&($this->User_model->hasPermission('accounts',$id)||$this->User_model->hasPermission('WILD_CARD',$id)))){\n\t\t\t\tshow_error('You Don\\'t have permission to perform this operation.');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// check if the expense exists before trying to edit it\n\t\t\t$this->data['expense'] = $this->acc_expenses_model->get_acc_expense($expenses_id);\n\t\t\t$this->data['location'] = $this->Location_model->get_all_location();\n\t\t\t\n\t\t\tif(isset($this->data['expense']['id']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$this->form_validation->set_rules('expenseItem_id', '<b>Item</b>', 'trim|required|integer|min_length[1]|max_length[100]');\n\t\t\t\t$this->form_validation->set_rules('amount', '<b>Amount</b>', 'trim|required|integer|min_length[1]|max_length[10]');\n\t\t\t\t\t\n\t\t\t\tif(isset($_POST) && count($_POST) > 0 && $this->form_validation->run()) \n\t\t\t\t{ \n\t\t\t\t\t$params = array(\n\t\t\t\t\t\t\n\t\t\t\t\t\t'acc_expense_item_id' => $this->input->post('expenseItem_id'),\n\t\t\t\t\t\t'expense' => $this->input->post('amount'),\n\t\t\t\t\t\t'remark' => $this->input->post('remark'),\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$this->acc_expenses_model->update_acc_expense($expenses_id,$params); \n\t\t\t\t\tredirect('acc_expenses/index');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$user = $this->User_model->get('person_id', $id);\n\t\t\t\t\tunset($user['password']);\n\t\t\t\t\t$user_role = $this->User_model->loadRoles($user['person_id']);\n\t\t\t\t\t\n\t\t\t\t\t$this->data['user'] = $user['username'];\n\t\t\t\t\t$this->data['urole'] = $user_role;\n\t\t\t\t\t$specialPerm = $this->User_model->loadSpecialPermission($id);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$this->data['pp'] = $specialPerm;\n\t\t\t\t\t$this->data['p_role'] = $this->Person_role_model->get_person_role($id);\n\t\t\t\t\t$this->data['expenseItem'] = $this->acc_expensesItem_model->get_all_acc_expense_items();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$this->template\n\t\t\t\t\t\t->title('Welcome','My Aapp')\n\t\t\t\t\t\t->build('acc_expenses/edit',$this->data);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\tshow_error('The expense you are trying to edit does not exist.');\n\t\t}\n\t\telse{\n\t\t\t$this->template\n\t\t\t\t\t->title('Login Admin','Login Page')\n\t\t\t\t\t->set_layout('access')\n\t\t\t\t\t->build('access/login');\n\t\t}\n }", "public function edit(Expense $expense)\n { \n //check for correct user\n if(auth()->user()->id !== $expense->user_id){\n return redirect('/operations')->with('error','Unauthorized Page');\n }\n else\n {\n $title = \"Edit expense\";\n\n $accounts = Account::where('user_id', auth()->user()->id)->get();\n $categories_ex = Category::where('type','expense')->where(function ($query) { $query->where('user_id', auth()->user()->id)->orWhere('user_id', NULL);})->get();\n\n return view('pages.editexpense')->with('title', $title)\n ->with('expense', $expense)\n ->with('accounts', $accounts)\n ->with('categories_ex', $categories_ex);\n } \n }", "public function editExpense($id)\n {\n $self='expense';\n if (\\Auth::user()->user_name!=='admin'){\n $get_perm=permission::permitted($self);\n\n if ($get_perm=='access denied'){\n return redirect('permission-error')->with([\n 'message'=>language_data('You do not have permission to view this page'),\n 'message_important'=>true\n ]);\n }\n }\n\n\n $expense = Expense::find($id);\n if ($expense) {\n $employee = Employee::where('user_name', '!=', 'admin')->get();\n return view('admin.edit-expense', compact('expense', 'employee'));\n\n } else {\n return redirect('expense')->with([\n 'message' => language_data('Expense not found'),\n 'message_important' => true\n ]);\n }\n\n }", "public function edit(Depense $depense)\n {\n //\n }", "public function edit(ExpenceManagement $expenceManagement) {\n\t\t//\n\t}", "public function edit(Experience $experience)\n {\n //\n }", "public function edit($id){\n\t\t$transaction = Expense::find($id); // getting the speific user to edit\n\t\treturn view('driver.expense.edit')->with([\n 'transaction' => $transaction\n\t\t]);\n }", "public function edit(Income $income)\n {\n //\n }", "public function edit(ExpenceHead $expenceHead)\n {\n //\n }", "public function edit($id)\n\t{\n\t\t\n\t\treturn View::make('admin.expense.edit')->with('data', Expense::find($id))->with('cashInHand', Expense::cashInHand());\n\t}", "public function edit($id)\n {\n $data['dalyExpense'] = DB::table('personal_expense')\n ->where('id',$id)\n ->first();\n\n $data['title'] = \"Update Personal Expenses\";\n return view(\"admincontrol.personalexpenses.update\",$data);\n }", "public function edit($id)\n {\n $isAdmin = $this->getIsAdmin();\n $list_company = $this->getListCompany();\n\n $expense = Expense::find($id);\n if (is_null($expense)) return redirect()->back()->with('info', 'Id expense not found');\n\n $transaction = Transaction::where('model_id', $expense->id)->first();\n if (is_null($transaction)) return redirect()->back()->with('info', 'Id transaction not found');\n\n $expense_detail = TransactionDetail::select(DB::raw('\n transaction_details.*,\n accounts.account_name\n '))\n ->join('accounts', 'accounts.id', '=', 'transaction_details.account_id')\n ->where('transaction_details.transaction_id', $transaction->id)\n ->whereIn('accounts.account_type', [Account::EXPENSES, Account::OTHER_EXPENSES])\n ->first();\n if (is_null($expense_detail)) return redirect()->back()->with('info', 'Id transaction detail not found');\n\n if (!$isAdmin) {\n if ($expense->company_id != Auth::user()->company_id) {\n return redirect()->back()->with('info', 'You dont have a permission');\n }\n }\n if ($expense->is_posted) {\n return redirect()->route('finance.expenses.index')->with('info', 'Expense has been posted');\n }\n\n return view('finance.expense.edit', [\n 'expense' => $expense,\n 'expense_detail' => $expense_detail,\n 'transaction' => $transaction,\n 'isAdmin' => $isAdmin,\n 'list_company' => $list_company\n ]);\n }", "public function update()\n\t{\n\t\t$id = Input::get('id');\n\t\t\n\t\t$validation = Validator::make(Input::all(),\n\t\t[\n\t\t\t'description'\t=>\t'required',\n\t\t\t'memo'\t\t\t=>\t'',\n\t\t\t'amount'\t\t=>\t'required|numeric',\n\t\t\t'quantity'\t\t=>\t'required|numeric'\n\t\t]);\n\t\t\n\t\t$errorMessages = new MessageBag;\n\t\t\n\t\tif($validation->fails()){\n\t\t\t$errorMessages->merge($validation->errors()->toArray());\n\t\t}\n\t\t\n\t\t$data = Input::all();\n\t\t\n\t\t$cashInHand = Expense::cashInHand();\n\t\t\n\t\t$ex = ($data['amount'] * $data['quantity']);\n\t\t\n\t\tif($ex > $cashInHand){\n\t\t\t$errorMessages->add('amount', 'You cannot make an expense exceeding cash in hand');\n\t\t}\n\t\t\n\t\tif(count($errorMessages) > 0){\n\t\t\treturn Redirect::route('getExpenses')\n\t\t\t\t\t->withInput()\n\t\t\t\t\t->withErrors($errorMessages)\n\t\t\t\t\t->with('modal','#myModal');\n\t\t} else {\n\t\t\t$expense = Expense::find($id);\n\t\t\t\n\t\t\t$expense->description = Input::get('description');\n\t\t\t$expense->memo = Input::get('memo');\n\t\t\t$expense->amount = Input::get('amount');\n\t\t\t$expense->quantity = Input::get('quantity');\n\t\t\t\n\t\t\tif($expense->save()){\n\t\t\t\treturn Redirect::route('getExpenses')->with('success', 'Edited successfully');\n\t\t\t} else {\n\t\t\t\treturn Redirect::route('getExpenses')->with('fail', 'An error ocurred while editing the expense');\n\t\t\t}\n\t\t}\n\t}", "public function edit($id)\n {\n $expense=Expense::findOrFail($id);\n return view('expenses.edit',compact('expense'));\n }", "public function edit($id)\n {\n \n if (Auth::guard('restaurantUser')->id() == RestaurantExpenseItem::find($id)->user_id) {\n $expenseItem = RestaurantExpenseItem::find($id);\n\n return view('pages.restaurant.expense.expenseItem.edit', compact('expenseItem'));\n } else {\n toastr()->error('You are not allowed to show this resource because this is not belongs to you.');\n // redirect\n return redirect()->route('expense-items.index');\n }\n }", "public function update(Request $request, Expense $expense)\n {\n //\n }", "public function edit($id)\n {\n $expenses = $this->expensesRepository->findWithoutFail($id);\n\n $types = $this->typeRepository->pluck('name', 'id');\n $currencies = $this->currencyRepository->pluck('code', 'id');\n $invoices = $this->user->invoices->pluck('code', 'id');\n $accounts = $this->AccountRepository->all()->pluck('name', 'id');\n $vendors = $this->VendorRepository->all()->pluck('name', 'id');\n $attachedInvoices = $expenses->invoices->pluck('id')->toArray();\n\n if (empty($expenses)) {\n Flash::error('Expenses not found');\n\n return redirect(route('expenses.index'));\n }\n\n return view('bimmunity/invoice::expenses.edit', compact('vendors','accounts','types', 'currencies', 'expenses', 'invoices', 'attachedInvoices'));\n }", "public function edit(OtherIncome $otherIncome)\n {\n //\n }", "public function edit($id)\n {\n $expense = Expense::with('users')->findOrFail($id);\n $users = User::all();\n return view('admin.expense.edit', compact('expense','users'));\n }", "public function editAction() {}", "public function edit(Lance $lance)\n {\n //\n }", "public function edit(AppExpenseType $expenseType,$id)\n {\n $expense_type = AppExpenseType::find($id);\n return view('admin.master.expense_type.edit',compact('expense_type'));\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($id)\n {\n $expence = Expence::findOrFail($id);\n return view('bsd-admin.expences.edit', compact('expence'));\n }", "public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function edit($id)\n {\n $transaction = IncomeExpense::find($id);\n return view('pages.edit',compact('transaction'));\n }", "public function testUpdateExpense()\n {\n $attributes = array(\n 'amount' => 24344,\n 'merchant_id' => 1,\n 'category_id' => 1,\n 'created_at' => date('Y-m-d H:i:s')\n );\n\n $response = $this->call('PUT', 'v1/expenses/1', $attributes);\n $data = json_decode($response->getContent());\n\n $this->assertFalse($data->error);\n $this->assertEquals('Expense has been updated.', $data->message);\n }", "public function edit(Exercice $exercice)\n {\n //\n }", "public function edit($id)\n {\n $expense= Expense::find($id);\n\n\n $data['expense_types']=Expense_type::pluck('name', 'id')->toArray();\n $data['payment_types']=['cheque'=>'Cheque','cash'=>'Cash','net_banking'=>'Net Banking'];\n $data['companies']=Company::pluck('name', 'id')->toArray();\n\n\n $key = array_search ($expense->payment_by, $data['payment_types']);\n $expense->payment_by = $key;\n $data['expense']=$expense;\n\n return view('expenses.edit',$data);\n }", "public function edit( $id )\n {\n $expense = Expense::find( $id );\n\n return view( 'expense.edit' )\n ->with( 'expense', $expense )\n ->with( 'categories', ExpenseCategory::get() );\n }", "public function edit(Supply $supply)\n {\n //\n }", "public function edit($id)\n {\n $data = Experience::find($id); \n if($data) \n {\n return view('experience_edit', ['data'=>$data]);\n }\n }", "public function edit(FoodPrice $foodPrice)\n {\n //\n }", "public function edit(Allowance $allowance)\n {\n //\n }", "public function edit($id)\n {\n $expense_price = ExpensePrice::find($id);\n $funded_institutions = FundedInstitution::orderBy('name')->where('status', 1)->get();\n $months = Month::all();\n\n if ($expense_price) {\n return view('admin.expensePrice.edit', compact('funded_institutions', 'expense_price', 'months'));\n } else {\n return redirect(\"/admin/expense_prices\")->with('error', 'الرابط الذي تحاول الوصول له غير صحيح');\n }\n }", "public function modifyAction()\n {\n\n $id = $this->get('security.context')->getToken()->getUser()->getId();\n\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('SyndicateComponentBundle:Education')->findOneBy(array('user'=>$id));\n\n if (!$entity) {\n return $this->redirect($this->generateUrl('education_new'));\n }\n\n $editForm = $this->createEditForm($entity);\n\n return $this->render('SyndicateComponentBundle:Education:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView()\n\n ));\n }", "public function edit(IntentionToPay $intentionToPay)\n {\n //\n }", "public function edit(Offer $offer)\n {\n //\n }", "public function edit( )\r\n {\r\n //\r\n }", "public function actionEdit($id) { }", "public function editAction()\r\n {\r\n }", "public function edit($id)\n {\n $groupevents = Groupevent::all();\n $expense = Expense::findOrFail($id);\n return view('expense.edit')->with(['expense' => $expense, 'groupevents' => $groupevents]);\n }", "public function edit() {\n }", "public function edit(Exercise $exercise){\n //\n }", "public function edit(Inspection $inspection)\n {\n //\n }", "public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n\n Helper::checkUrlIdAgainstLoginId($userId);\n\n View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => UserModel::load()->get($userId),\n 'roles' => RoleModel::load()->all(),\n ]);\n }", "public function edit(Faclexperiences $faclexperiences)\n {\n //\n }", "public function edit(Evaluation $evaluation)\n {\n //\n }", "public function edit(Evaluation $evaluation)\n {\n //\n }", "public function edit(Employee $employee)\n {\n //\n }", "public function edit(Employee $employee)\n {\n //\n }", "public function edit(Employee $employee)\n {\n //\n }", "public function edit(Employee $employee)\n {\n //\n }", "public function edit(Employee $employee)\n {\n //\n }", "public function edit(Employee $employee)\n {\n //\n }", "public function edit()\n {\n \n \n }", "public function edit(Expanse $expanse)\n {\n //\n }", "public function edit(RequireEmployee $requireEmployee)\n {\n //\n }", "public function edit(Evange $evange)\n {\n //\n }", "public function expense()\n {\n\n $self='expense';\n if (\\Auth::user()->user_name!=='admin'){\n $get_perm=permission::permitted($self);\n\n if ($get_perm=='access denied'){\n return redirect('permission-error')->with([\n 'message'=>language_data('You do not have permission to view this page'),\n 'message_important'=>true\n ]);\n }\n }\n\n\n $expense = Expense::all();\n $employee = Employee::where('user_name', '!=', 'admin')->get();\n return view('admin.expense', compact('expense', 'employee'));\n }", "public function edit(evaluationSummary $evaluationSummary)\n {\n //\n }", "public function edit()\n\t{\n\t\t//\n\t}", "public function edit(Emploitime $emploitime)\n {\n //\n }", "public function editAction() {\n $id = $this->getInput('id');\n $info = Client_Service_Ad::getAd(intval($id));\n \n $this->assign('ad_type', self::AD_TYPE);\n $this->assign('ad_ptypes', $this->ad_ptypes);\n $this->assign('info', $info);\n }", "public function edit(Estimate $estimate)\n {\n //remove this\n }", "public function edit(Absent $absent)\n {\n //\n }", "public function edit(Attendance $attendance)\n {\n //\n }", "public function edit(Attendance $attendance)\n {\n //\n }", "public function edit(Attendance $attendance)\n {\n //\n }", "public function edit() {\n\t\t\t\n\t\t}", "public function edit(ActeurEmploye $acteurEmploye)\n {\n //\n }", "public function edit(Income $income)\n {\n return $this->sendResponse($income, 'Income retrieved successfully.');\n }", "public function edit($id)\n {\n $earning = $this->earningRepository->findWithoutFail($id);\n $market = $this->marketRepository->pluck('name','id');\n \n\n if (empty($earning)) {\n Flash::error(__('lang.not_found',['operator' => __('lang.earning')]));\n\n return redirect(route('earnings.index'));\n }\n $customFieldsValues = $earning->customFieldsValues()->with('customField')->get();\n $customFields = $this->customFieldRepository->findByField('custom_field_model', $this->earningRepository->model());\n $hasCustomField = in_array($this->earningRepository->model(),setting('custom_field_models',[]));\n if($hasCustomField) {\n $html = generateCustomField($customFields, $customFieldsValues);\n }\n\n return view('earnings.edit')->with('earning', $earning)->with(\"customFields\", isset($html) ? $html : false)->with(\"market\",$market);\n }", "public function edit(Acte $acte, Request $request)\n {\n\n }", "public function edit(Request $request, $id)\n {\n $varAPIWebToken = $request->session()->get('SessionLogin');\n \n $varData = \\App\\Helpers\\ZhtHelper\\System\\FrontEnd\\Helper_APICall::setCallAPIGateway(\n \\App\\Helpers\\ZhtHelper\\System\\Helper_Environment::getUserSessionID_System(),\n $varAPIWebToken, \n 'transaction.read.dataRecord.budgeting.getBudgetExpense', \n 'latest', \n [\n 'recordID' => (int)$id,\n ]\n );\n return view('Budget.BudgetExpense.Transactions.edit')->with('data', $varData['data']);\n }", "public function edit($id)\n {\n Log::info('Editing user equipo for user: '.$id);\n $op = Auth::user()->authorizeRoles(['UPDATE', 'ADMIN']);\n if($op)\n return view('equipo.edit', ['equipo' => Equipo::findOrFail($id)]);\n else\n return redirect()->back(); \n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id){\n $skills = Skill::pluck('title','id');\n $expertStatus = ExpertStatus::pluck('title','id');\n $expertises = Expertise::where('user_id',$this->user_id)->get();\n $expertise = Expertise::where('user_id',$this->user_id)->find($id);\n if (is_null($expertise)){\n return view('jobseeker.not-permitted');\n }else{\n return view('jobseeker.expertise.edit', compact('expertises','expertise','skills','expertStatus'));\n }\n }", "public function edit()\n {\n \n }", "public function affExp($id)\n {\n if (Auth::check()) {\n $exp = Experience::find($id);\n return view('updateExp', compact('exp'));\n } else {\n return redirect('/');\n }\n }", "public function edit(Renew $renew)\n {\n //\n }", "public function edit($expense_id, $id)\n {\n $sql = DetailExpense::find($id);\n return $sql->toJson();\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit(Price $price)\n {\n //\n }", "public function edit(Price $price)\n {\n //\n }", "public function edit($id_user,$id_project,$id_experience)\n {\n $project = Project::findorFail($id_project);\n if(Auth::id()==$id_user&& Auth::id()== $project->id_user){\n $experience = Experience::findOrFail($id_experience);\n return view('project.experience.edit', compact('experience'));\n }else{\n Auth::logout();\n return view('home');\n }\n \n }", "public function edit($id)\n {\n $experience = $this->experienceRepo->find($id);\n return view('backend.admin.portfolio.experiences.edit',compact('experience'));\n }", "public function edit(EstabelecimentoSaude $estabelecimentoSaude)\n {\n //\n }", "public function edit($id)\n {\n // get the nerd\n $income = $this->incomes->find($id);\n //print_r($guest);die;\n // show the edit form and pass the nerd\n return view('incomes.edit')\n ->with(['income' => $income]);\n }", "public function edit(Buy $buy)\n {\n //\n }", "public function update(ExpenseRequest $request, Expense $expense){\n\n\t\t$expense->update($request->all());\n\t\t$expense = Expense::latest()->first();\n\n\t\t\\Session::flash('flash_message', 'Expense ' . $expense->id . ' was updated.');\n\n\t\treturn redirect('expenses');\n\t}", "public function edit(Evolution $evolution)\n {\n //\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fj_Service_Goods::getGoods(intval($id));\n $this->assign('dir', \"goods\");\n $this->assign('ueditor', true);\n\t\t$this->assign('info', $info);\n\t}", "public function edit($id)\n {\n $data['edit_investor'] = Investor::find($id);\n return view('admin/user/investor/edit', $data);\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }" ]
[ "0.86577326", "0.86577326", "0.84517413", "0.7908673", "0.78986496", "0.78270763", "0.7816504", "0.7747384", "0.7570398", "0.75106645", "0.7332953", "0.73311645", "0.73094684", "0.72742414", "0.72681177", "0.7217165", "0.718886", "0.71645033", "0.7119471", "0.71124727", "0.71072865", "0.70803994", "0.70640707", "0.7046042", "0.69947696", "0.69804513", "0.69461316", "0.6922266", "0.691577", "0.6875699", "0.68587106", "0.6840288", "0.6839874", "0.68336624", "0.6818336", "0.6793812", "0.6789885", "0.6769584", "0.67522603", "0.6751688", "0.67419875", "0.67390186", "0.672017", "0.6718438", "0.6715999", "0.6707934", "0.67050964", "0.67021364", "0.6684637", "0.6683398", "0.66817737", "0.66817737", "0.6672785", "0.6672785", "0.6672785", "0.6672785", "0.6672785", "0.6672785", "0.66673326", "0.66670775", "0.666257", "0.6660229", "0.66450316", "0.66431797", "0.66357833", "0.6633165", "0.6631125", "0.6630722", "0.66260815", "0.66220826", "0.66220826", "0.66220826", "0.6620763", "0.6618463", "0.6616453", "0.6614496", "0.6605852", "0.6602276", "0.65892035", "0.65870684", "0.6584429", "0.65829617", "0.6578539", "0.65784925", "0.65780437", "0.6574109", "0.6574109", "0.65703195", "0.65703195", "0.65695995", "0.65636307", "0.65513587", "0.6549415", "0.6549045", "0.65485924", "0.65412116", "0.65372634", "0.6533088", "0.6532106", "0.6532106", "0.6532106" ]
0.0
-1
Save an expense. This is the action that both the add & edit forms submit to.
public function save($cID) { $entry = $this->getEntryToSave($cID); if($this->saveEntry($entry)) { Loader::helper('clov_url', 'clov'); // Redirect to the associated project or the generic list page. // Drafts always go to the generic list page because drafts are // not shown on the project page. if(!$entry->isComposerDraft() && $projectID = $entry->getAttribute('clov_expense_project')) { $project = Page::getByID($projectID); $this->redirect(ClovUrlHelper::getCollectionRoute($project)); } else { $this->redirect('clov/expenses'); } } else { // Something went wrong. Show the edit view where errors can be // displayed. $this->edit($entry->getCollectionID()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addExpenseAction()\n\t{\n\t\t$expense = new Expense($_POST);\n\t\t\n\t\tif ($expense->addExpense()) {\n\t\t\tFlash::addMessage('Add expense successful!');\n\t\t\t\n\t\t\t$this->redirect('/profile/expenseForm');\n\t\t} else {\n\t\t\tFlash::addMessage('Add expense unsuccessful, please try again!', Flash::WARNING);\n\t\t\t\n\t\t\tView::renderTemplate('Expense/addExpense.html', [\n\t\t\t'date' => $expense->date,\n\t\t\t'payments' => Payment::getPaymentsCategories(),\n\t\t\t'expenses' => Expense::getExpensesCategories(),\n\t\t\t'expense' => $expense\n\t\t]);\n\t\t}\n\t}", "public function testUpdateExpense()\n {\n $attributes = array(\n 'amount' => 24344,\n 'merchant_id' => 1,\n 'category_id' => 1,\n 'created_at' => date('Y-m-d H:i:s')\n );\n\n $response = $this->call('PUT', 'v1/expenses/1', $attributes);\n $data = json_decode($response->getContent());\n\n $this->assertFalse($data->error);\n $this->assertEquals('Expense has been updated.', $data->message);\n }", "public function edit(Expense $expense)\n {\n //\n }", "public function edit(Expense $expense)\n {\n //\n }", "public function expenseFormAction()\n\t{\n\t\tView::renderTemplate('Expense/addExpense.html', [\n\t\t\t'date' => date('Y-m-d'),\n\t\t\t'payments' => Payment::getPaymentsCategories(),\n\t\t\t'expenses' => Expense::getExpensesCategories()\n\t\t]);\n\t}", "public function update()\n\t{\n\t\t$id = Input::get('id');\n\t\t\n\t\t$validation = Validator::make(Input::all(),\n\t\t[\n\t\t\t'description'\t=>\t'required',\n\t\t\t'memo'\t\t\t=>\t'',\n\t\t\t'amount'\t\t=>\t'required|numeric',\n\t\t\t'quantity'\t\t=>\t'required|numeric'\n\t\t]);\n\t\t\n\t\t$errorMessages = new MessageBag;\n\t\t\n\t\tif($validation->fails()){\n\t\t\t$errorMessages->merge($validation->errors()->toArray());\n\t\t}\n\t\t\n\t\t$data = Input::all();\n\t\t\n\t\t$cashInHand = Expense::cashInHand();\n\t\t\n\t\t$ex = ($data['amount'] * $data['quantity']);\n\t\t\n\t\tif($ex > $cashInHand){\n\t\t\t$errorMessages->add('amount', 'You cannot make an expense exceeding cash in hand');\n\t\t}\n\t\t\n\t\tif(count($errorMessages) > 0){\n\t\t\treturn Redirect::route('getExpenses')\n\t\t\t\t\t->withInput()\n\t\t\t\t\t->withErrors($errorMessages)\n\t\t\t\t\t->with('modal','#myModal');\n\t\t} else {\n\t\t\t$expense = Expense::find($id);\n\t\t\t\n\t\t\t$expense->description = Input::get('description');\n\t\t\t$expense->memo = Input::get('memo');\n\t\t\t$expense->amount = Input::get('amount');\n\t\t\t$expense->quantity = Input::get('quantity');\n\t\t\t\n\t\t\tif($expense->save()){\n\t\t\t\treturn Redirect::route('getExpenses')->with('success', 'Edited successfully');\n\t\t\t} else {\n\t\t\t\treturn Redirect::route('getExpenses')->with('fail', 'An error ocurred while editing the expense');\n\t\t\t}\n\t\t}\n\t}", "public function update(Request $request, Expense $expense)\n {\n //\n }", "public function postCreateExpense(){\n\t\t$rules = array(\n\t\t\t\"date\" =>\"required|date\",\n\t\t\t\"user_id\" =>\"required|integer\",\n\t\t\t\"amount\" =>\"required|integer|min:1\",\n\t\t\t\"description\" =>\"required\"\n\t\t\t);\n\t\t\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\tif ($validator->fails()) {\n\t\t\techo \"Validator fails\";\n\t\t} else {\n\t\t\t$expense = New Expense();\n\t\t\t$expense->date = Input::get('date');\n\t\t\t$expense->user_id = Input::get('user_id');\n\t\t\t$expense->amount = Input::get('amount');\n\t\t\tif (Input::get('approved')) $expense->status = 1;\n\t\t\telse $expense->status = 0;\n\t\t\t$expense->description = Input::get('description');\n\t\t\t$expense->save();\n\t\t\tSession::put('notification_expense', 'Expense has been created successful!!');\n\t\t\treturn Redirect::to('expense/create-expense');\n\t\t}\n\t}", "public function store()\n\t{\n\t\t$data = Input::all();\n\t\t\n\t\t$validation = Validator::make($data, [\n\t\t\t'description'\t=>\t'required|min:3',\n\t\t\t'memo'\t\t\t=>\t'',\n\t\t\t'amount'\t\t=>\t'required|numeric',\n\t\t\t'quantity'\t\t=>\t'required|numeric'\n\t\t]);\n\t\t\n\t\t$errorMessages = new MessageBag;\n\t\t\n\t\tif($validation->fails()){\n\t\t\t$errorMessages->merge($validation->errors()->toArray());\n\t\t}\n\t\t\n\t\t//$cash = new Expense;\n\t\t\n\t\t$cashInHand = Expense::cashInHand();\n\t\t\n\t\t$ex = ($data['amount'] * $data['quantity']);\n\t\t\n\t\tif($ex > $cashInHand){\n\t\t\t$errorMessages->add('amount', 'You cannot make an expense exceeding cash in hand');\n\t\t}\n\t\t\n\t\t//return dd($errorMessages);\n\t\t//die;\n\t\t\n\t\tif(count($errorMessages) > 0){\n\t\t\treturn Redirect::route('getAddExpense')\n\t\t\t\t\t->withInput()\n\t\t\t\t\t->withErrors($errorMessages);\n\t\t} else {\n\t\t\t$expense = Expense::create([\n\t\t\t\t'description'\t=> \t$data['description'],\n\t\t\t\t'amount'\t\t=>\t$data['amount'],\n\t\t\t\t'memo'\t\t\t=>\t$data['memo'],\n\t\t\t\t'quantity'\t\t=>\t$data['quantity']\n\t\t\t]);\n\t\t\t\n\t\t\tif($expense){\n\t\t\t\treturn Redirect::route('getExpenses')->with('success','Expense added successfully');\n\t\t\t} else {\n\t\t\t\treturn Redirect::route('getExpenses')->with('fail','An error occured while saving the expense');\n\t\t\t}\n\t\t}\n\t}", "public function update(ExpenseRequest $request, Expense $expense){\n\n\t\t$expense->update($request->all());\n\t\t$expense = Expense::latest()->first();\n\n\t\t\\Session::flash('flash_message', 'Expense ' . $expense->id . ' was updated.');\n\n\t\treturn redirect('expenses');\n\t}", "public function edit( Expenses $expenses ) {\n //\n }", "public function saveAction(){\n\t\t$this->__checkAuth();\n\t\t$this->_helper->layout->setLayout(\"empty\");\n\t\t$db = Zend_Registry::get(\"main_db\");\n\t\t$data = array();\n\t\tZend_Loader::loadClass(\"CreateRiskFreeRate\", array(FORMS_PATH));\n\t\t$form = new CreateRiskFreeRate();\n\t\t$this->_helper->layout->setLayout(\"empty\");\n\t\tif ($form->isValid($_POST)){\n\t\t\t$data = $form->getValues($_POST);\n\t\t\tZend_Loader::loadClass(\"RiskFreeRate\", array(MODELS_PATH));\n\t\t\t$riskFreeRateTable = new RiskFreeRate();\n\t\t\t$foundRiskFreeRate = $riskFreeRateTable->fetchRow($riskFreeRateTable->select()->where(\"year = ?\", $data[\"year\"])->where(\"month = ?\", $data[\"month\"]));\n\t\t\tif ($foundRiskFreeRate){\n\t\t\t\t$riskFreeRateTable->update($data, $riskFreeRateTable->getAdapter()->quoteInto(\"id = ?\", $foundRiskFreeRate->id));\n\t\t\t}else{\n\t\t\t\t$riskFreeRateTable->insert($data);\n\t\t\t}\n\t\t}\n\t}", "public function submit(Request $request){\n\t\t// dd($request->all());\n\t\t// added some validation for form values. \n\t\t$request->validate([\n\t\t\t'type' => 'required|string',\n\t\t\t'amount' => 'required|numeric',\n\t\t\t'title' => 'required|string'\n\t\t]);\n\t\t\n\t\tDB::beginTransaction(); // starting transaction for runtime db error.\n\t\t// if one query executed and other gives error then both will be roll backed. \n\t\ttry {\n\t\t\t// dd($request->all()); // debugging method die dump.\n $transaction = new Expense;\n $transaction->type = $request->type;\n $transaction->title = $request->title;\n $transaction->amount = $request->amount;\n $transaction->driver_id = auth()->user()->id;\n\t\t\t$transaction->save();\n\n\n\n\t\t} catch (\\Throwable $th) {\n\t\t\tdd($th);\n\t\t\tDB::rollback();\n\t\t\tToastr::error('Server side error');\n\t\t\treturn redirect()->back();\n\t\t}\n\n\t\tDB::commit();\n\t\tToastr::success('transaction created successfully', 'Created!');\n return redirect()->back();\n\t}", "public function store(Request $request)\n {\n $expense = new Expense();\n $expense->expense_type = $request->expense_type;\n $expense->amount = $request->amount;\n $expense->date = $request->date;\n $expense->employee_id = $request->employee_id;\n $expense->branch_id = $request->branch_id;\n\n $expense->save();\n return back();\n }", "function edit($expenses_id)\n { \n\t\tif ($this->auth->loggedin()) {\n\t\t\t$id = $this->auth->userid();\n\t\t\t\n\t\t\tif(!($this->User_model->hasPermission('update',$id)&&($this->User_model->hasPermission('accounts',$id)||$this->User_model->hasPermission('WILD_CARD',$id)))){\n\t\t\t\tshow_error('You Don\\'t have permission to perform this operation.');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// check if the expense exists before trying to edit it\n\t\t\t$this->data['expense'] = $this->acc_expenses_model->get_acc_expense($expenses_id);\n\t\t\t$this->data['location'] = $this->Location_model->get_all_location();\n\t\t\t\n\t\t\tif(isset($this->data['expense']['id']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$this->form_validation->set_rules('expenseItem_id', '<b>Item</b>', 'trim|required|integer|min_length[1]|max_length[100]');\n\t\t\t\t$this->form_validation->set_rules('amount', '<b>Amount</b>', 'trim|required|integer|min_length[1]|max_length[10]');\n\t\t\t\t\t\n\t\t\t\tif(isset($_POST) && count($_POST) > 0 && $this->form_validation->run()) \n\t\t\t\t{ \n\t\t\t\t\t$params = array(\n\t\t\t\t\t\t\n\t\t\t\t\t\t'acc_expense_item_id' => $this->input->post('expenseItem_id'),\n\t\t\t\t\t\t'expense' => $this->input->post('amount'),\n\t\t\t\t\t\t'remark' => $this->input->post('remark'),\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$this->acc_expenses_model->update_acc_expense($expenses_id,$params); \n\t\t\t\t\tredirect('acc_expenses/index');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$user = $this->User_model->get('person_id', $id);\n\t\t\t\t\tunset($user['password']);\n\t\t\t\t\t$user_role = $this->User_model->loadRoles($user['person_id']);\n\t\t\t\t\t\n\t\t\t\t\t$this->data['user'] = $user['username'];\n\t\t\t\t\t$this->data['urole'] = $user_role;\n\t\t\t\t\t$specialPerm = $this->User_model->loadSpecialPermission($id);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$this->data['pp'] = $specialPerm;\n\t\t\t\t\t$this->data['p_role'] = $this->Person_role_model->get_person_role($id);\n\t\t\t\t\t$this->data['expenseItem'] = $this->acc_expensesItem_model->get_all_acc_expense_items();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$this->template\n\t\t\t\t\t\t->title('Welcome','My Aapp')\n\t\t\t\t\t\t->build('acc_expenses/edit',$this->data);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\tshow_error('The expense you are trying to edit does not exist.');\n\t\t}\n\t\telse{\n\t\t\t$this->template\n\t\t\t\t\t->title('Login Admin','Login Page')\n\t\t\t\t\t->set_layout('access')\n\t\t\t\t\t->build('access/login');\n\t\t}\n }", "public function store( Request $request ) {\n $property_id = $request->input( 'property_id' );\n $expense_title = ucwords( $request->input( 'expense_title' ) );\n $expense_amount = $request->input( 'expense_amount' );\n\n $expense = new Expenses();\n $expense->exp_property_id = $property_id;\n $expense->expense_title = $expense_title;\n $expense->expense_amount = $expense_amount;\n\n $expense->save();\n\n Toastr::success( 'Expense added successfully' );\n return back();\n }", "public function store(Request $request)\n {\n $input = \\Request::all();\n $expense = new Expense($input);\n \\Auth::user()->expenses()->save($expense);\n \n return redirect('home');\n }", "public function update( Request $request, Expense $expense )\n {\n $request->validate( [\n 'details' => 'required',\n 'amount' => 'required|numeric',\n ] );\n\n $expense->details = $request->details;\n $expense->amount = $request->amount;\n $expense->save();\n }", "public function store(Request $request)\n {\n \n $requestData = $request->all();\n \n Expense::create($requestData);\n\n return redirect('admin/expense')->with('flash_message', 'Expense added!');\n }", "public function saveExpensePayment(Request $request)\r\n {\r\n try {\r\n $business_id = $request->session()->get('business.id');\r\n $settlement = Settlement::where('settlement_no', $request->settlement_no)->where('business_id', $business_id)->first();\r\n $data = array(\r\n 'business_id' => $business_id,\r\n 'settlement_no' => $settlement->id,\r\n 'expense_number' => $request->expense_number,\r\n 'category_id' => $request->category_id,\r\n 'reference_no' => $request->reference_no,\r\n 'account_id' => $request->account_id,\r\n 'reason' => $request->reason,\r\n 'amount' => $request->amount,\r\n );\r\n\r\n //Update reference count\r\n $ref_count = $this->transactionUtil->setAndGetReferenceCount('expense');\r\n //Generate reference number\r\n if (empty($request->reference_no)) {\r\n $data['reference_no'] = $this->transactionUtil->generateReferenceNumber('expense', $ref_count);\r\n }\r\n\r\n $settlement_expense_payment = SettlementExpensePayment::create($data);\r\n\r\n $expense_number = $this->getExpenseNumber($request->settlement_no);\r\n\r\n $output = [\r\n 'success' => true,\r\n 'expense_number' => $expense_number,\r\n 'reference_no' => $settlement_expense_payment->reference_no,\r\n 'settlement_expense_payment_id' => $settlement_expense_payment->id,\r\n 'msg' => __('petro::lang.success')\r\n ];\r\n } catch (\\Exception $e) {\r\n Log::emergency('File: ' . $e->getFile() . 'Line: ' . $e->getLine() . 'Message: ' . $e->getMessage());\r\n $output = [\r\n 'success' => false,\r\n 'msg' => __('messages.something_went_wrong')\r\n ];\r\n }\r\n\r\n return $output;\r\n }", "public function store(Request $request)\n {\n $expenseData = ['name' => $request->name,\n 'category_id' => $request->category_id,\n 'due_date' => $request->due_date,\n 'repeat' => $request->repeat,\n 'note' => $request->note,\n 'amount' => $request->amount, ];\n\n $expense = new Expense($expenseData);\n $expense->createdBy()->associate(Auth::user());\n $expense->updatedBy()->associate(Auth::user());\n $expense->save();\n\n if ($request->due_date <= Carbon::today()->format('Y-m-d')) {\n $expense->paid = \\constPaymentStatus::Paid;\n } else {\n $expense->paid = \\constPaymentStatus::Unpaid;\n }\n\n $expense->createdBy()->associate(Auth::user());\n\n $expense->save();\n flash()->success('Expense was successfully added');\n\n return redirect('expenses/all');\n }", "public function store( Request $request )\n {\n $request->validate( [\n 'details' => 'required',\n 'amount' => 'required|numeric',\n ] );\n\n $expense = new Expense();\n $expense->details = $request->details;\n $expense->amount = $request->amount;\n $expense->date = date( 'Y-m-d' );\n $expense->save();\n }", "public function store(Request $request)\n {\n\t\t$request->validate([\n 'expense_name' => 'required',\n\t\t\t'expense_date' => 'required',\n\t\t\t'expense_amount' => 'required',\n ]);\n \n $expenses = new Expenses;\n\t\t$expenses->name = strip_tags($request->expense_name);\n $expenses->expense_category_id = $request->expense_category;\n $expenses->expense_amount = $request->expense_amount;\n $expenses->expense_date = date(\"Y-m-d\", strtotime($request->expense_date));\n $expenses->expense_notes = strip_tags($request->notes);\n $expenses->customer_id = $request->customer;\n $expenses->vendor_id = $request->vendor_id;\n \n $expenses->user_id = auth()->user()->id;\n\t\t$expenses->company_id = auth()->user()->company->id;\n $expenses->save();\n \n return redirect()->route('expenses.index')->withStatus(__('Expense successfully created!'));\n }", "public function store(Request $request)\n {\n $user=auth()->user();\n $restaurant=$user->restaurant_profile;\n \n $data=$request->validate([\n 'name'=>'required',\n 'description'=>'required',\n 'amount'=>'required|integer'\n ]);\n $expense=new Expense;\n $expense->name=$request->name;\n $expense->description = $request->description;\n $expense->restaurant_profile_id=$restaurant->id;\n $expense->amount=$request->amount;\n $expense->user=auth()->user()->name;\n $expense->save();\n\n return redirect()->route('expenses')->with('success','Expense added successfully');\n }", "public function testStoreExpense()\n {\n $attributes = array(\n 'amount' => 432424,\n 'merchant_id' => 1,\n 'category_id' => 1,\n 'notes' => 'Lorem ipsum set amet.',\n 'attachment_id' => 1,\n 'created_at' => date('Y-m-d H:i:s')\n );\n\n $response = $this->call('POST', 'v1/expenses', $attributes);\n $data = json_decode($response->getContent());\n\n $this->assertFalse($data->error);\n $this->assertEquals('Expense has been created.', $data->message);\n }", "public function postUpdateStatus(){\n\t\t$expense_id = Input::get('expense_id');\n\t\t$status = Input::get('status');\n\t\t$expense = Expense::find($expense_id);\n\t\t$expense->status = $status;\n\t\t$expense->save();\n\t}", "public function store( Request $request )\n {\n $expense = new Expense;\n $expense->name = 'Expense';\n $expense->category_id = 0;\n $expense->monthly = true;\n $expense->amount = 0;\n $expense->user_id = Auth::user()->id;\n $expense->save();\n\n Session::flash( 'success', \"Expense added\" );\n $message = View::make( 'partials/flash-messages' );\n $view = View::make( 'partials/expense-row' )\n ->with( 'expense', $expense );\n\n return response()->json(\n [\n 'message' => $message->render(),\n 'view' => $view->render(),\n ], 200 );\n }", "public function newAction()\n {\n $securityContext = $this->get('security.context');\n if ($securityContext->isGranted('IS_AUTHENTICATED_REMEMBERED')) {\n $userEntity = $securityContext->getToken()->getUser();\n } else {\n return $this->redirect($this->generateUrl('fos_user_security_login'));\n }\n\n $entity = new Expense();\n $entity->setUser($userEntity);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function update( int $expenseId, array $parameters );", "public function add() {\n\t\t$entry = $this->getEntryToAdd('clov_expense');\n\t\t\n\t\t// Default to the logged-in user.\n\t\t$loggedInUser = new User;\n\t\t$entry->setAttribute('clov_expense_payer', $loggedInUser->getUserID());\n\t\t\n\t\t// If the user got here from a project page, pre-fill the project \n\t\t// attribute.\n\t\tLoader::helper('clov_url', 'clov');\n\t\tif($project = ClovUrlHelper::loadReferrerPage('clov_project')) {\n\t\t\t$entry->setAttribute('clov_expense_project', $project->getCollectionID());\n\t\t}\n\t\t\n\t\t$this->set('entry', $entry);\n\t\t$this->set('showSaveDraft', true);\n\t\t$this->render('clov/default/add');\n\t}", "public function update( Request $request, $expense_id ) {\n $now = Carbon::now( 'Africa/Nairobi' )->toDateTimeString();\n\n /** Get expense data from edit expense form **/\n $property_id = $request->input( 'property_id' );\n $expense_title = ucwords( $request->input( 'expense_title' ) );\n $expense_amount = $request->input( 'expense_amount' );\n\n $expense_data = array(\n 'exp_property_id' => $property_id,\n 'expense_title' => $expense_title,\n 'expense_amount' => $expense_amount\n );\n $update_expense = Expenses::where( 'id', $expense_id )->update( $expense_data );\n\n /** Log the action in the logs file */\n Log::info( 'Expense of ID ' . $expense_id . ' updated'.\n ' at ' . $now );\n\n Toastr::success( 'Expense updated successfully' );\n\n return back();\n }", "public function edit(Expense $expense)\n { \n //check for correct user\n if(auth()->user()->id !== $expense->user_id){\n return redirect('/operations')->with('error','Unauthorized Page');\n }\n else\n {\n $title = \"Edit expense\";\n\n $accounts = Account::where('user_id', auth()->user()->id)->get();\n $categories_ex = Category::where('type','expense')->where(function ($query) { $query->where('user_id', auth()->user()->id)->orWhere('user_id', NULL);})->get();\n\n return view('pages.editexpense')->with('title', $title)\n ->with('expense', $expense)\n ->with('accounts', $accounts)\n ->with('categories_ex', $categories_ex);\n } \n }", "public function save(){\n\t\t// yei bata feri \"index.php\" ma falne jun chai profile ma jancha\n\t\t$req = new Requirement();\n\n\t\tif(isset($_POST['title'])){\n\t\t$req->setTitle($_POST['title']);\n\t\t}else{\n\t\t\t$req->setTitle(\"\");\n\t\t}\n\t\tif(isset($_POST['date'])){\n\n\t\t$req->setDate($_POST['date']);\n\t\t}else{\n\t\t\t$req->setDate(\"01-01-2001\");\n\t\t}\n\t\tif(isset($_POST['details'])){\n\t\t$req->setDescription($_POST['details']);\n\t\t}else{\n\t\t\t$req->setDescription(\"\");\n\t\t}\n\t\t$req->setStatus(1);\n\t\t$req->setOrgname(\"\");\n\t\t$this->requirement_repository->insert($req);\n\n\t}", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $employee = Employee::findFirstByid($id);\n\n if (!$employee) {\n $this->flash->error(\"employee does not exist \" . $id);\n\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $employee->id = $this->request->getPost(\"id\");\n $employee->name = $this->request->getPost(\"name\");\n $employee->surename = $this->request->getPost(\"surename\");\n $employee->patronymic = $this->request->getPost(\"patronymic\");\n $employee->position = $this->request->getPost(\"position\");\n $employee->departmentId = $this->request->getPost(\"department_id\");\n \n\n if (!$employee->save()) {\n\n foreach ($employee->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'edit',\n 'params' => [$employee->id]\n ]);\n\n return;\n }\n\n $this->flash->success(\"employee was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'index'\n ]);\n }", "public function edit(Depense $depense)\n {\n //\n }", "public function postEditExpense(Request $request)\n {\n $self='expense';\n if (\\Auth::user()->user_name!=='admin'){\n $get_perm=permission::permitted($self);\n\n if ($get_perm=='access denied'){\n return redirect('permission-error')->with([\n 'message'=>language_data('You do not have permission to view this page'),\n 'message_important'=>true\n ]);\n }\n }\n\n $cmd = Input::get('cmd');\n\n $appStage=app_config('AppStage');\n if($appStage=='Demo'){\n return redirect('expense/edit/'.$cmd)->with([\n 'message'=>language_data('This Option is Disable In Demo Mode'),\n 'message_important'=>true\n ]);\n }\n\n $expense = Expense::find($cmd);\n\n if ($expense) {\n $v = \\Validator::make($request->all(), [\n 'item_name' => 'required', 'purchase_from' => 'required', 'emp_name' => 'required', 'amount' => 'required', 'purchase_date' => 'required', 'status' => 'required'\n ]);\n\n if ($v->fails()) {\n return redirect('expense/edit/' . $cmd)->withErrors($v->errors());\n }\n\n\n $item_name = Input::get('item_name');\n $purchase_from = Input::get('purchase_from');\n $emp_name = Input::get('emp_name');\n $purchase_date = Input::get('purchase_date');\n $purchase_date=date('Y-m-d',strtotime($purchase_date));\n $amount = Input::get('amount');\n $status = Input::get('status');\n $bill_copy = Input::file('bill_copy');\n\n if ($bill_copy != '') {\n $destinationPath = public_path() . '/assets/bill_copy/';\n\n \\File::delete($destinationPath.$expense->bill_copy);\n\n $bill_copy_name = $bill_copy->getClientOriginalName();\n Input::file('bill_copy')->move($destinationPath, $bill_copy_name);\n } else {\n $bill_copy_name = $expense->bill_copy;\n }\n $expense->item_name = $item_name;\n $expense->purchase_from = $purchase_from;\n $expense->purchase_date = $purchase_date;\n $expense->purchase_by = $emp_name;\n $expense->amount = $amount;\n $expense->status = $status;\n $expense->bill_copy = $bill_copy_name;\n $expense->save();\n\n return redirect('expense')->with([\n 'message' => language_data('Expense Updated Successfully')\n ]);\n } else {\n return redirect('expense')->with([\n 'message' => language_data('Expense not found'),\n 'message_important' => true\n ]);\n }\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"holidays\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $holiday = Holidays::findFirstByid($id);\n\n if (!$holiday) {\n $this->flash->error(\"holiday does not exist \" . $id);\n\n $this->dispatcher->forward([\n 'controller' => \"holidays\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $holiday->date = $this->request->getPost(\"date\");\n $holiday->name = $this->request->getPost(\"name\");\n \n\n if (!$holiday->save()) {\n\n foreach ($holiday->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"holidays\",\n 'action' => 'edit',\n 'params' => [$holiday->id]\n ]);\n\n return;\n }\n\n $this->flash->success(\"Запись успешно изменена\");\n\n $this->dispatcher->forward([\n 'controller' => \"holidays\",\n 'action' => 'index'\n ]);\n }", "public function update($id, Request $request, Expenses $expenses)\n {\n\t\t$request->validate([\n 'expense_name' => 'required',\n\t\t\t'expense_date' => 'required',\n\t\t\t'expense_amount' => 'required',\n ]);\n\t\t\n\t\t$expenses = Expenses::find($id);\n $expenses->name = strip_tags($request->expense_name);\n $expenses->expense_category_id = $request->expense_category;\n $expenses->expense_amount = $request->expense_amount;\n $expenses->expense_date = date(\"Y-m-d\", strtotime($request->expense_date));\n $expenses->expense_notes = strip_tags($request->notes);\n $expenses->customer_id = $request->customer;\n $expenses->vendor_id = $request->vendor_id;\n \n $expenses->user_id = auth()->user()->id;\n\t\t$expenses->company_id = auth()->user()->company->id;\n $expenses->save();\n\t\t\n return redirect()->route('expenses.index')->withStatus(__('Expense successfully updated!'));\n }", "public function update(Request $request, Expense $expense)\n {\n // $request['is_paid'] = true;\n $expense->update($request->all());\n return response()->json($expense);\n }", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(),\n [\n 'budget_id' => 'required',\n 'place' => 'required',\n 'date' => 'required|date',\n 'price' => 'required|between:0,99.99',\n 'reason' => 'max:255'\n ]);\n\n if ($validator->fails()) {\n return $this->sendError('Validation Failed', $validator->errors(), 400);\n }\n\n $expense = Expense::create([\n 'budget_id' => $request->budget_id,\n 'place' => $request->place,\n 'date' => $request->date,\n 'price' => $request->price,\n 'reason' => $request->reason\n ]);\n\n return $this->sendResponse($expense, 'Expense created');\n }", "public function updateExpenseTypes()\n {\n $this->validate([\n 'name' => ['required', Rule::unique('expense_types')->ignore($this->expenseType->id)],\n 'description' => 'nullable',\n ]);\n\n $this->expenseType->update([\n 'name' => mb_strtolower($this->name),\n 'description' => mb_strtolower($this->description),\n ]);\n\n session()->flash('success', 'You have successfully updated an expenseType.');\n\n return redirect(route('breed-types.index'));\n }", "function expense($param1 = '', $param2 = '', $param3 = '') {\r\n if ($this->session->userdata('accountant_login') != 1)\r\n redirect(base_url(), 'refresh');\r\n\r\n\r\n if ($param1 == 'create') {\r\n $data['expense_by'] = $this->input->post('expense_by');\r\n $data['expense_id'] = $this->input->post('expense_id');\r\n $data['invoice_id'] = $this->input->post('invoice_id');\r\n $data['expense_name'] = $this->input->post('expense_name');\r\n $data['description'] = $this->input->post('description');\r\n $data['category'] = $this->input->post('category');\r\n $data['material_name'] = $this->input->post('material_name');\r\n $data['document_name'] = $this->input->post('document_name');\r\n $data['payment_to'] = $this->input->post('payment_to');\r\n $data['payment_method'] = $this->input->post('payment_method');\r\n $data['amount'] = $this->input->post('amount');\r\n $data['expense_date'] = date('m/d/Y', strtotime($this->input->post('expense_date')));\r\n $data['expense_timestamp'] = strtotime($this->input->post('expense_date'));\r\n\r\n// echo \"##############\";\r\n// echo '<pre>';\r\n// print_r($data);\r\n// die;\r\n\r\n $this->db->insert('expense', $data);\r\n $exp_id = mysql_insert_id();\r\n move_uploaded_file($_FILES['document_name']['tmp_name'], 'uploads/expense_image/' . $exp_id . '.jpg');\r\n\r\n redirect(base_url() . 'index.php?admin/expense', 'refresh');\r\n }\r\n if ($param1 == 'do_update') {\r\n $data['expense_by'] = $this->input->post('expense_by');\r\n $data['expense_id'] = $this->input->post('expense_id');\r\n $data['invoice_id'] = $this->input->post('invoice_id');\r\n $data['expense_name'] = $this->input->post('expense_name');\r\n $data['description'] = $this->input->post('description');\r\n $data['category'] = $this->input->post('category');\r\n $data['material_name'] = $this->input->post('material_name');\r\n $data['document_name'] = $this->input->post('document_name');\r\n $data['payment_to'] = $this->input->post('payment_to');\r\n $data['payment_method'] = $this->input->post('payment_method');\r\n $data['amount'] = $this->input->post('amount');\r\n $data['expense_date'] = date('m/d/Y', strtotime($this->input->post('expense_date')));\r\n $data['expense_timestamp'] = strtotime($this->input->post('expense_date'));\r\n\r\n $this->db->where('exp_id', $param2);\r\n $this->db->update('expense', $data);\r\n move_uploaded_file($_FILES['document_name']['tmp_name'], 'uploads/expense_image/' . $param2 . '.jpg');\r\n $this->crud_model->clear_cache();\r\n\r\n redirect(base_url() . 'index.php?admin/expense', 'refresh');\r\n } else if ($param1 == 'edit') {\r\n $page_data['edit_data'] = $this->db->get_where('expense', array('exp_id' => $param2))->result_array();\r\n }\r\n if ($param1 == 'delete') {\r\n $this->db->where('exp_id', $param2);\r\n $this->db->delete('expense');\r\n redirect(base_url() . 'index.php?admin/expense', 'refresh');\r\n }\r\n $page_data['page_name'] = 'expense';\r\n $page_data['page_title'] = get_phrase('manage_expense');\r\n $this->db->order_by('expense_date', 'desc');\r\n $page_data['expenses'] = $this->db->get('expense')->result_array();\r\n //$page_data['expenses'] = $this->crud_model->get_all_expense();\r\n $this->load->view('index', $page_data);\r\n }", "public function postExpense(Request $request)\n {\n\n $self='add-new-expense';\n if (\\Auth::user()->user_name!=='admin'){\n $get_perm=permission::permitted($self);\n\n if ($get_perm=='access denied'){\n return redirect('permission-error')->with([\n 'message'=>language_data('You do not have permission to view this page'),\n 'message_important'=>true\n ]);\n }\n }\n\n\n $v = \\Validator::make($request->all(), [\n 'item_name' => 'required', 'purchase_from' => 'required', 'emp_name' => 'required', 'amount' => 'required', 'purchase_date' => 'required', 'status' => 'required'\n ]);\n\n if ($v->fails()) {\n return redirect('expense')->withErrors($v->errors());\n }\n\n $item_name = Input::get('item_name');\n $purchase_from = Input::get('purchase_from');\n $emp_name = Input::get('emp_name');\n $purchase_date = Input::get('purchase_date');\n $purchase_date=date('Y-m-d',strtotime($purchase_date));\n $amount = Input::get('amount');\n $status = Input::get('status');\n $bill_copy = Input::file('bill_copy');\n\n if ($bill_copy != '') {\n $destinationPath = public_path() . '/assets/bill_copy/';\n $bill_copy_name = $bill_copy->getClientOriginalName();\n Input::file('bill_copy')->move($destinationPath, $bill_copy_name);\n } else {\n $bill_copy_name = '';\n }\n\n $expense = new Expense();\n $expense->item_name = $item_name;\n $expense->purchase_from = $purchase_from;\n $expense->purchase_date = $purchase_date;\n $expense->purchase_by = $emp_name;\n $expense->amount = $amount;\n $expense->status = $status;\n $expense->bill_copy = $bill_copy_name;\n $expense->save();\n\n return redirect('expense')->with([\n 'message' => language_data('Expense Added Successfully')\n ]);\n\n }", "public function store(Request $request)\n {\n $transaction = new IncomeExpense;\n $transaction->title = $request->title;\n $transaction->description = $request->description;\n $transaction->amount = $request->amount;\n $transaction->type = $request->type;\n\n $transaction->save();\n \n // // $transactions = IncomeExpense::all();\n // $transactions = IncomeExpense::all();\n // return view('pages.index', compact('transactions'));\n\n return redirect('/');\n\n }", "public function store(Request $request, $expense_id)\n {\n $cuenta = trim($request -> input('cuenta'));\n $detalle = trim($request -> input('detalle'));\n $total = trim($request -> input('total'));\n\n $rules=array(\n 'cuenta' => 'required',\n 'detalle' => 'required',\n 'total' => 'required'\n );\n $data=array(\n 'cuenta' => $cuenta,\n 'detalle' => $detalle,\n 'total' => $total\n );\n $validator = \\Validator::make($data, $rules);\n if ($validator->fails())\n { \n return redirect('detail-expense/'.$expense_id)\n ->withErrors($validator)\n ->withInput();\n }else{\n try{\n $sql = new DetailExpense;\n $sql -> expense_id = $expense_id;\n $sql -> cuenta = $cuenta;\n $sql -> detalle = $detalle;\n $sql -> total = $total;\n $sql -> save();\n\n return redirect('detail-expense/'.$expense_id)->with('message', 'La Guardo correctamente el detalle de gasto.');\n }catch(\\Illuminate\\Database\\QueryException $e){ \n return redirect('detail-expense/'.$expense_id)->with('message', 'Error en la base de datos.');\n }\n }\n }", "public function saveAction(){\n //d'you post?\n if ($this->getRequest()->isPost()){\n $knight = $this->getKnight();\n $knight->setName( $this->getRequest()->getPost(\"name\") );\n $knight->setArmor( $this->getRequest()->getPost(\"armor\") );\n //persist the knight\n $this->getDM()->persist($knight);\n $this->getDM()->flush();\n }\n //go back to home (indexAction) to show the grid of knights\n $this->redirect()->toRoute(\"home\");\n }", "public function editExpense($id)\n {\n $self='expense';\n if (\\Auth::user()->user_name!=='admin'){\n $get_perm=permission::permitted($self);\n\n if ($get_perm=='access denied'){\n return redirect('permission-error')->with([\n 'message'=>language_data('You do not have permission to view this page'),\n 'message_important'=>true\n ]);\n }\n }\n\n\n $expense = Expense::find($id);\n if ($expense) {\n $employee = Employee::where('user_name', '!=', 'admin')->get();\n return view('admin.edit-expense', compact('expense', 'employee'));\n\n } else {\n return redirect('expense')->with([\n 'message' => language_data('Expense not found'),\n 'message_important' => true\n ]);\n }\n\n }", "public function store()\n\t{\n\t\t$entry = new Offering;\n\t\t$entry->deposit_id = Input::get('deposit_id');\t\t\n\t\t$entry->name = Input::get('name');\n\t\t$entry->created_at = Input::get('created_at');\n\t\t$entry->memo = Input::get('memo');\n\t\t$entry->save();\n\t \n\t\treturn Redirect::to('accounting/deposits/'.$entry->deposit->id.'#'.$entry->name)->with('message', 'Offering Successfully created!');\n\t}", "public function createAction(Request $request)\n {\n $entity = new Expense();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('expense'));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function update(Request $request, Expense $expense)\n {\n $request->validate([\n 'name' => 'required',\n 'amount' => 'required',\n 'price' => 'required',\n 'category' => 'required|exists:categories,id',\n ], [\n 'name.required' => \"Expense Name is Required.\",\n 'amount.required' => \"Expense Amount is Required.\",\n 'price.required' => \"Expense Price is Required.\",\n 'category.required' => \"Expense Category is Required.\",\n 'category.exists' => \"Category Does Not Exist\",\n ]);\n\n if($expense->user_id === $request->user()->id) {\n $expense->item = $request->input('name');\n $expense->amount = $request->input('amount');\n $expense->price = $request->input('price');\n $expense->category_id = $request->input('category');\n $expense->save();\n\n return response([\n 'success'=>true,\n 'expense' => Expense::where('id', $expense->id)->with('category')->get()\n ]);\n }\n return response(['success'=> false],401);\n\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 update(Tense $tense)\n {\n $is_free = (request()->has('is_free'))? 1 : 0;\n \n $tense->update([\n \t\t\t'name' => request('name'),\n \t\t\t'is_free' => $is_free\n \t]);\n\n return redirect(\"admin/verbs/\" . request('verb_id'));\n \t}", "public function update(Request $request, FlowExpenses $flowExpenses)\n {\n //\n }", "public function update(Request $request, $expense_id, $id)\n {\n //\n $cuenta = trim($request -> input('cuenta'));\n $detalle = trim($request -> input('detalle'));\n $total = trim($request -> input('total'));\n\n $rules=array(\n 'cuenta' => 'required',\n 'detalle' => 'required',\n 'total' => 'required'\n );\n $data=array(\n 'cuenta' => $cuenta,\n 'detalle' => $detalle,\n 'total' => $total\n );\n $validator = \\Validator::make($data, $rules);\n if ($validator->fails())\n { \n return array('message'=>'Error de servidor.');\n }else{\n try{\n $sql = DetailExpense::find($id);\n $sql -> cuenta = $cuenta;\n $sql -> detalle = $detalle;\n $sql -> total = $total;\n $sql -> save();\n\n return array('message'=>'Guardado Exitosamente.');\n }catch(\\Illuminate\\Database\\QueryException $e){ \n return array('message'=>'Error de Base de Datos.');\n }\n }\n }", "public function expense()\n {\n\n $self='expense';\n if (\\Auth::user()->user_name!=='admin'){\n $get_perm=permission::permitted($self);\n\n if ($get_perm=='access denied'){\n return redirect('permission-error')->with([\n 'message'=>language_data('You do not have permission to view this page'),\n 'message_important'=>true\n ]);\n }\n }\n\n\n $expense = Expense::all();\n $employee = Employee::where('user_name', '!=', 'admin')->get();\n return view('admin.expense', compact('expense', 'employee'));\n }", "public function save()\n {\n Session::clear(\"Checkout.PostageID\");\n \n // Extend our save operation\n $this->extend(\"onBeforeSave\");\n\n // Save cart items\n Session::set(\n \"Checkout.ShoppingCart.Items\",\n serialize($this->items)\n );\n\n // Save cart discounts\n Session::set(\n \"Checkout.ShoppingCart.Discount\",\n serialize($this->discount)\n );\n\n // Update available postage\n if ($data = Session::get(\"Form.Form_PostageForm.data\")) {\n $country = $data[\"Country\"];\n $code = $data[\"ZipCode\"];\n $this->setAvailablePostage($country, $code);\n }\n }", "public function saveAction()\r\n\t{\r\n\t\t// check if data sent\r\n\t\tif ($data = $this->getRequest()->getPost()) {\r\n\t\t\t\r\n\t\t\t// init model and set data\r\n\t\t\t$model = Mage::getModel('flagbit_faq/faq');\r\n\t\t\t$model->setData($data);\r\n\t\t\t\r\n\t\t\t// try to save it\r\n\t\t\ttry {\r\n\t\t\t\t// save the data\r\n\t\t\t\t$model->save();\r\n\t\t\t\t\r\n\t\t\t\t// display success message\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess(\r\n\t\t\t\t\t\tMage::helper('cms')->__('FAQ Item was successfully saved')\r\n\t\t\t\t);\r\n\t\t\t\t// clear previously saved data from session\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->setFormData(false);\r\n\t\t\t\t// check if 'Save and Continue'\r\n\t\t\t\tif ($this->getRequest()->getParam('back')) {\r\n\t\t\t\t\t$this->_redirect('*/*/edit', array (\r\n\t\t\t\t\t\t\t'faq_id' => $model->getId() ));\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// go to grid\r\n\t\t\t\t$this->_redirect('*/*/');\r\n\t\t\t\treturn;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\tcatch (Exception $e) {\r\n\t\t\t\t// display error message\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n\t\t\t\t// save data in session\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->setFormData($data);\r\n\t\t\t\t// redirect to edit form\r\n\t\t\t\t$this->_redirect('*/*/edit', array (\r\n\t\t\t\t\t\t'faq_id' => $this->getRequest()->getParam('faq_id') ));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->_redirect('*/*/');\r\n\t}", "public function adsaveAction() {\n\t// Received Parameter from JS file.\n\t$adCancelReasion = (string) $this->_getParam('adCancelReasion');\n\t$adsId = (string) $this->_getParam('adsId');\n\t// Decode a ad id\n\t$adsId = Engine_Api::_()->communityad()->getEncodeToDecode($adsId);\n\t$adDescription = (string) $this->_getParam('adDescription');\n\t//Insert entry in the data base.\n\t$viewerId = Engine_Api::_()->user()->getViewer()->getIdentity();\n\t$adcancelTable = Engine_Api::_()->getItemTable('communityad_adcancel');\n\t$adcancelList = $adcancelTable->createRow();\n\t$adcancelList->user_id = $viewerId;\n\t$adcancelList->report_type = $adCancelReasion;\n\tif (!empty($adDescription)) {\n\t $adcancelList->report_description = $adDescription;\n\t}\n\t$adcancelList->ad_id = $adsId;\n\t$adcancelList->save();\n\t$this->view->showMsg = 1;\n }", "public function update(Request $request, Expense $expense)\n { \n $this->validate($request, [\n 'amount' => 'numeric|required',\n 'date' => 'required|date_format:d/m/Y'\n ]);\n $account_id = $request->input('account');\n $amount = str_replace(',', '.', $request->input('amount'));\n\n $amount_old = $expense->amount;\n $account_id_old = $expense->account_id;\n $account_old = Account::find($account_id_old);\n\n //Rollback to old balance\n $old_balance = $account_old->balance + abs($amount_old);\n $account_old->balance = $old_balance;\n $account_old->save();\n\n $account = Account::find($account_id);\n\n if($account->balance >= $amount)\n { \n\n //Update Expense\n $expense->account_id = $account_id;\n $expense->category_id = $request->input('category');\n $expense->amount = $amount;\n $expense->date = Carbon::createFromFormat('d/m/Y', $request->input('date'));\n $expense->save();\n \n //Update the balance\n $new_balance = $account->balance - abs($amount);\n $account->balance = $new_balance;\n $account->save();\n\n return redirect('/operations')->with('success','<strong>'.$account->name.'</strong> balance is now: <strong>'.$account->balance.' '.$account->currency()->first()->sign.'</strong>');\n }\n else\n {\n //Undo the rollback\n $old_balance = $account_old->balance - abs($amount_old);\n $account_old->balance = $old_balance;\n $account_old->save();\n //\n return redirect()->route('expenses.edit', $expense->id)->with('error','You don’t have enough funds in this account. <strong>'.$account->name.'</strong> balance is: <strong>'.$account->balance.' '.$account->currency()->first()->sign.'</strong>')->withInput();\n }\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'date' => 'required',\n 'name' => 'required',\n 'total' => 'required'\n ]);\n\n $expence = new Expence();\n $expence->date = $request->date;\n $expence->name = $request->name;\n $expence->details = $request->details;\n $expence->total = $request->total;\n $expence->save();\n return redirect()->route('expences.index')->with('success', 'Expence added successfully');\n }", "public function save_experience(Request $request)\n {\n $company_id = CompanyHelper::touch($request->user_id);\n $item_id = CompanyExperienceHelper::save_data($company_id, $request->exp);\n\n return response()->json([\n 'status' => 'OK',\n 'id' => $item_id\n ]);\n }", "public function store(Request $request)\n {\n $request->validate([\n 'employee_id' => 'required',\n 'salary' => 'required'\n ]);\n $salary = Salary::create([\n 'employee_id' => $request->employee_id,\n 'balance' => $request->salary,\n 'quantity' => $request->quantity,\n 'rate' => $request->rate,\n 'note' => $request->note,\n 'qty_desc' => $request->quantity,\n 'designation' => $request->designation,\n 'working_day' => $request->working_day,\n 'month' => $request->month,\n 'paid_salary' => $request->paid_salary\n\n ]);\n $eh = ExpensesHead::where('title', 'Salary Purpose')->first();\n\n Expense::create([\n 'title' => $salary->employee->name,\n 'amount' => $salary->balance,\n 'expenses_head_id' => $eh->id,\n 'date'=> Carbon::now(),\n 'note' => $salary->note,\n ]);\n\n return redirect()->route('expenses.index')->with('success', 'Salary Paid Successfuly !!');\n\n }", "public function expenseLedgerEntry()\n {\n $items = $this->getVoucherItems();\n \n $financeLedger = new Core_Model_Finance_Ledger;\n $expenseLedgerRecord = $financeLedger->fetchByName('Indirect expense');\n \n $totalPrice = 0;\n for($i = 0; $i <= sizeof($items)-1; $i += 1) {\n $price = $items[$i]['unit_price'] * $items[$i]['quantity'];\n $totalPrice = $totalPrice + $price;\n }\n $notes = 'Purchase with Purchase Id = '.$this->_purchaseId; \n \n $dataToInsert = array(\n 'debit' => $amount,\n 'credit' => \"0\",\n 'notes' => $notes,\n 'transaction_timestamp' => $this->_transactionTime,\n 'fa_ledger_id' => $expenseLedgerRecord['fa_ledger_id']\n );\n $ledgerEntryModel = new Core_Model_Finance_Ledger_Entry;\n $ledgerEntryId = $ledgerEntryModel->create($dataToInsert);\n return $ledgerEntryId;\n }", "public function experiencesAction() {\n $id = $this->_getParam('expid');\n $ses = new Application_Model_Session();\n $ses->startSession();\n if ($ses->getSessionParameter('view') == 1) {\n $ses->unsetSessionParameter('view');\n $this->view->msg = \"Thank you for sharing your views\";\n }\n $request = $this->getRequest();\n $form = new Campuswisdom_Form_Exps();\n $this->view->form = $form;\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($request->getPost())) {\n $mapper = new Campuswisdom_Model_ExpMapper();\n $Category = $this->_getParam('Category');\n $Name = $this->_getParam(\"Name\");\n $Views = $this->_getparam('Views');\n $dbTable = new Campuswisdom_Model_DbTable_Exps();\n $mapper->setDbTable($dbTable);\n $mapper->simplesave($Category, $Name, $Views);\n $ses->setSessionParameter('msg', \"Your Experience has been added\");\n $this->_helper->_redirector(array('controller' => 'experiences', 'action' => 'getexperiences'));\n }\n }\n \n }", "public function saveAction()\n {\n //the data for the thing\n $_consumerId = $this->getRequest()->getParam('consumer_id');\n \n //the post data\n $_data = $this->getRequest()->getPost();\n if ($_data) {\n $_artist = $this->_initConsumerSave();\n \n try {\n $_artist->save();\n \n $_redirectBack = false;\n $this->_getSession()->addSuccess($this->__('The consumer has been saved.'));\n } catch (Mage_Core_Exception $e) {\n $this->_getSession()->addError($e->getMessage())\n ->setArtistData($_data);\n $_redirectBack = true;\n } catch (Exception $e) {\n Mage::logException($e);\n $this->_getSession()->addError($e->getMessage());\n $_redirectBack = true;\n }\n }\n \n if ($_redirectBack) {\n $this->_redirect(\n '*/*/edit', array(\n 'id' => $_consumerId,\n '_current' => true\n )\n );\n } else {\n $this->_redirect('*/*/');\n }\n }", "public function store(Request $request)\n {\n if (!Sentinel::hasAccess('expenses.create')) {\n Flash::warning(\"Permission Denied\");\n return redirect('/');\n }\n $expense = new Expense();\n $expense->expense_type_id = $request->expense_type_id;\n $expense->amount = $request->amount;\n $expense->notes = $request->notes;\n $expense->branch_id = session('branch_id');\n $expense->date = $request->date;\n $date = explode('-', $request->date);\n $expense->recurring = $request->recurring;\n if ($request->recurring == 1) {\n $expense->recur_frequency = $request->recur_frequency;\n $expense->recur_start_date = $request->recur_start_date;\n if (!empty($request->recur_end_date)) {\n $expense->recur_end_date = $request->recur_end_date;\n }\n\n $expense->recur_next_date = date_format(date_add(date_create($request->recur_start_date),\n date_interval_create_from_date_string($request->recur_frequency . ' ' . $request->recur_type . 's')),\n 'Y-m-d');\n\n $expense->recur_type = $request->recur_type;\n }\n $expense->year = $date[0];\n $expense->month = $date[1];\n $files = array();\n if (!empty(array_filter($request->file('files')))) {\n $count = 0;\n foreach ($request->file('files') as $key) {\n $file = array('files' => $key);\n $rules = array('files' => 'required|mimes:jpeg,jpg,bmp,png,pdf,docx,xlsx');\n $validator = Validator::make($file, $rules);\n if ($validator->fails()) {\n Flash::warning(trans('general.validation_error'));\n return redirect()->back()->withInput()->withErrors($validator);\n } else {\n $files[$count] = $key->getClientOriginalName();\n $key->move(public_path() . '/uploads',\n $key->getClientOriginalName());\n }\n $count++;\n }\n }\n $expense->files = serialize($files);\n //files\n $expense->save();\n $custom_fields = CustomField::where('category', 'expenses')->get();\n foreach ($custom_fields as $key) {\n $custom_field = new CustomFieldMeta();\n $id = $key->id;\n $custom_field->name = $request->$id;\n $custom_field->parent_id = $expense->id;\n $custom_field->custom_field_id = $key->id;\n $custom_field->category = \"expenses\";\n $custom_field->save();\n }\n GeneralHelper::audit_trail(\"Added expense with id:\".$expense->id);\n Flash::success(trans('general.successfully_saved'));\n return redirect('expense/data');\n }", "public function update(Request $request, $id)\n {\n $expense = Expense::find($id);\n // $project = Project::where('id', '=', $id)->first();\n $expense->report_sort = $request->report_sort;\n $expense->publication_date = $request->publication_date;\n $expense->agency_name = $request->agency_name;\n $expense->line_number = $request->line_number;\n $expense->line_number_description = $request->line_number_description;\n $expense->fiscal_year1 = $request->fiscal_year1;\n $expense->year1_forecast = $request->year1_forecast;\n $expense->year2_estimate = $request->year2_estimate;\n $expense->year3_estimate = $request->year3_estimate;\n $expense->year4_estimate = $request->year4_estimate;\n $expense->flag = 'modified';\n $expense->save();\n // var_dump($project);\n // exit();\n return response()->json($expense);\n }", "public function save()\n {\n // If deposit is new, will get assigned database ID.\n $this->dbID = $this->db->saveDeposit($this);\n }", "public function saveAction()\n {\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"education\",\"action\" => \"index\"));\n }\n $ideducation = $this->request->getPost(\"ideducation\");\n $education = Education::findFirstByideducation($ideducation);\n $educationlog = serialize($_POST);\n if (!$education) {\n DataLogger::education('error', \"\\n\\n education not exist \\n {$educationlog} \\n\\n\");\n $this->flash->error(\"education does not exist \" . $ideducation);\n return $this->dispatcher->forward(array(\n \"controller\" => \"education\",\"action\" => \"index\"));\n }\n $education->iduser = $this->request->getPost(\"iduser\");\n $education->title = $this->request->getPost(\"title\");\n $education->description = $this->request->getPost(\"description\");\n $education->from_date = $this->request->getPost(\"from_date\");\n $education->to_date = $this->request->getPost(\"to_date\");\n $education->college = $this->request->getPost(\"college\");\n $education->grade = $this->request->getPost(\"grade\");\n $education->stream = $this->request->getPost(\"stream\");\n $education->created_by = $this->request->getPost(\"created_by\");\n $education->updated_by = $this->request->getPost(\"updated_by\");\n $education->created_on = $this->request->getPost(\"created_on\");\n $education->updated_on = $this->request->getPost(\"updated_on\");\n if (!$education->save()) {\n DataLogger::education('error', \"\\n\\n education not update \\n {$educationlog} \\n\\n\");\n foreach ($education->getMessages() as $message) {\n $this->flash->error($message);}\n return $this->response->redirect(\"education/edit/\".$ideducation); \n }else{\n $this->flash->success(\"Education was updtaed successfully\");\n return $this->response->redirect(\"education/index\"); \n } \n }", "public function update(Request $request, $id)\n {\n $expense = Expense::find($id);\n $expense->expense_type = $request->upexpense_type;\n $expense->amount = $request->upamount;\n $expense->date = $request->update;\n $expense->employee_id = $request->upemployee_id;\n $expense->branch_id = $request->upbranch_id;\n\n $expense->save();\n return back();\n }", "public function store(Requests\\CreateOffenceRequest $request)\n {\n if($request->isMethod('post'))\n {\n\n $StudentOffense = new StudentOffense;\n\n $StudentOffense->teacher_id = $request->input('teacher_id');\n $StudentOffense->student_id = $request->input('student_id');\n $StudentOffense->offense_id = $request->input('offense_id');\n $StudentOffense->tarikh_kesalahan = $request->input('tarikh_kesalahan');\n $StudentOffense->masa_kesalahan = $request->input('masa_kesalahan');\n $StudentOffense->tempat_kesalahan = $request->input('tempat_kesalahan');\n\n $StudentOffense->save();\n\n Session::flash('flash_message','Kesalahan pelajar berjaya didaftarkan.');\n\n }\n return redirect('studentoffense');\n }", "public function _report_form_submit()\n\t{\n\t\t$incident = Event::$data;\n\n\t\tif ($_POST)\n\t\t{\n\t\t\t$action_item = ORM::factory('actionable')\n\t\t\t\t->where('incident_id', $incident->id)\n\t\t\t\t->find();\n\t\t\t$action_item->incident_id = $incident->id;\n\t\t\t$action_item->actionable = isset($_POST['actionable']) ?\n\t\t\t\t$_POST['actionable'] : \"\";\n\t\t\t$action_item->action_taken = isset($_POST['action_taken']) ?\n\t\t\t\t$_POST['action_taken'] : \"\";\n\t\t\t$action_item->action_summary = $_POST['action_summary'];\n\t\t\t$action_item->save();\n\n\t\t}\n\t}", "public function store(Request $request) {\n\t\t// return ($request->all());\n\t\t$expence_manages = $this->validate($request, [\n\t\t\t'employee_id' => 'required',\n\t\t\t'opening_blance' => 'required',\n\t\t\t'recovery_amount_on_cash' => 'required',\n\t\t\t'recovery_amount_by_cheque' => 'required',\n\t\t\t'bank_deposit_amount' => 'required',\n\t\t\t'expenses_amount' => 'required',\n\t\t\t'balance_amount' => 'required',\n\t\t\t'remarks_if_any' => 'required',\n\n\t\t]);\n\t\t$result = ExpenceManagement::create($expence_manages + ['created_by' => auth()->user()->id]);\n\t\t$inserted_id = $result->id;\n\t\tif (!empty($inserted_id)) {\n\t\t\treturn redirect('/hrm/expence/manage-expence')->with('message', 'Add successfully.');\n\t\t}\n\t\treturn redirect('/hrm/expence/manage-expence')->with('exception', 'Operation failed !');\n\n\t}", "public function saveAction() {\n $request = $this->getRequest();\n if($request->isPost()) {\n $params = $request->getPost();\n if(!array_key_exists('company_id', $params)) {\n Default_Model_Company::create($params);\n } else {\n Default_Model_Company::update($params);\n }\n }\n \n $this->_redirect($this->view->actions['index']);\n }", "public function store()\n {\n $validatedDate = $this->validate([\n 'name' => 'required',\n ]);\n \n Department::updateOrCreate(['id' => $this->department_id],[\n 'name' => $this->name, \n ]);\n \n // session()->flash('message', 'expense Created Successfully.');\n \n // $this->resetInputFields();\n\n session()->flash('message', $this->department_id ? $this->name . ' Departiment Created Successfuly': $this->name . ' Departiment Created Successfuly');\n $this->closeModal(); //TUTUP MODAL\n $this->resetFields();\n }", "public function addIncomeAction()\n\t{\n\t\t$income = new Income($_POST);\n\t\t\n\t\tif ($income->addIncome()) {\n\t\t\tFlash::addMessage('Add income successful!');\n\t\t\t\n\t\t\t$this->redirect('/profile/incomeForm');\n\t\t} else {\n\t\t\tFlash::addMessage('Add income unsuccessful, please try again!', Flash::WARNING);\n\t\t\t\n\t\t\tView::renderTemplate('Income/addIncome.html', [\n\t\t\t'date' => $income->date,\n\t\t\t'incomes' => Income::getIncomesCategories(),\n\t\t\t'income' => $income\n\t\t]);\n\t\t}\n\t}", "function saveEstimateSignDetailsAction()\n\t{\n\t\tif($this->_request->isPost())\n\t\t{\n\t\t\t$signParams = $this->_request->getParams();\n\n\t\t\t$quote_id=$signParams['quote_id'];\n\n\t\t\tif($quote_id)\n\t\t\t{\n\t\t\t\t$quoteObj=new Ep_Quote_Quotes();\n\t\t\t\t$quoteDetails=$quoteObj->getQuoteDetails($quote_id);\n\n\t\t\t\t$status=$quoteDetails[0]['sales_review'];\n\t\t\t\tif($status=='not_done')\n\t\t\t\t\t$status='';\n\n\t\t\t\t\n\t\t\t\t$quote_update['estimate_sign_percentage']=$signParams['estimate_sign_percentage'];\n\t\t\t\t$quote_update['estimate_sign_date']=$signParams['estimate_sign_date'];\n\t\t\t\t$quote_update['estimate_sign_comments']=$signParams['estimate_sign_comments'];\n\n\n\t\t\t\t//echo \"<pre>\";print_r($_SERVER);exit;\t\t\t\t\n\t\t\t\t$quoteObj->updateQuote($quote_update,$quote_id);\n\n\t\t\t\t$this->_helper->FlashMessenger('Details updated successfully');\n\t\t\t}\t\n\n\n\t\t\t$this->_redirect(\"/quote/sales-quotes-list?submenuId=ML13-SL2&active=\".$status);\n\t\t}\n\t\t\n\t}", "public function store(CreateExpensesRequest $request)\n {\n $this->validate($request,[\n 'amount'=>'required|numeric|min:0'\n ]);\n $input = $request->all();\n $expenses = $this->expensesRepository->create($input);\n if(! empty($input['profile'])){\n // store the image\n $profilePicture = File::getFileByPath($input['profile']);\n $expenses->files()->attach($profilePicture,['is_profile'=>1]);\n }\n else{\n // set a place holder\n $expenses->files()->attach(File::getFileByPath(config('ifm.buildings.image_placeholder')));\n }\n\n Flash::success('Expenses saved successfully.');\n\n return redirect(route('expenses.index'));\n }", "public function save()\r\n {\r\n if($this->id != -1)\r\n {\r\n $this->update_target_grade();\r\n }\r\n else\r\n {\r\n $this->insert_target_grade();\r\n }\r\n }", "public function update(ExpensePriceRequest $request, $id)\n {\n $euro_nis = $request['euro_nis'];\n $euro_usd = $request['euro_usd'];\n $usd_nis = $request['usd_nis'];\n\n $expense_price = ExpensePrice::find($id);\n\n if ($expense_price) {\n\n $expense_price->update([\n 'euro_usd' => $euro_usd,\n 'usd_nis' => $usd_nis,\n 'euro_nis' => $euro_nis,\n ]\n );\n\n $action = Action::create(['title' => 'تم تعديل سعر صرف', 'type' => Permission::findByName('list expensePrices')->title, 'link' => Permission::findByName('list expensePrices')->link]);\n $users = User::permission('expensePrices')->whereNotIn('id', [auth()->user()->id])->get();\n if ($users->first())\n Notification::send($users, new NotifyUsers($action));\n return redirect('admin/expense_prices')->with('success', 'تم تعديل سعر صرف بنجاح');\n\n\n } else {\n return redirect(\"/admin/expense_prices\")->with('error', 'الرابط الذي تحاول الوصول له غير صحيح');\n }\n }", "public function save() {\n JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\n\t\t// Initialise variables.\n $app = JFactory::getApplication();\n $model = $this->getModel('DwOpportunityForm', 'Dw_opportunitiesModel');\t\n\n // Get the user data.\n $data = JFactory::getApplication()->input->get('jform', array(), 'array');\n\t\t\n\t\t// Check if user can edit or create the item ---------------------------------------------------------------------------------------------\n\t\t$id = ( ( $data['id'] == 0 ) || !isset ( $data['id'] ) ) ? null : (int)$data['id'];\n $user = JFactory::getUser();\n\n if( $id ) \n\t\t{\n \t//Check the user can edit this item\n $authorised = $user->authorise('core.edit', 'com_dw_opportunities');\n\t\t\t\n\t\t\tif(!$authorised && $user->authorise('core.edit.own', 'com_dw_opportunities'))\n\t\t\t{\n\t\t\t\t//Check the owner from the model\n\t\t\t\t$itemData = $model -> getData($id);\n\t\t\t\t$itemOwner = ( isset ( $itemData -> created_by ) ) ? $itemData -> created_by : null ;\n\t\t\t\t$authorised = $user -> id == $itemOwner ; \n\t\t\t}\n\t\t\n } \n\t\telse \n\t\t{\n //Check the user can create new item\n $authorised = $user->authorise('core.create', 'com_dw_opportunities');\n }\t\t\n\n\t\tif (!$authorised)\n\t\t{\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\techo new JResponseJson( '' , JText::_('COM_DW_OPPORTUNITIES_OPPORTUNITY_WIZARD_PERMISSION_DENIED') , true );\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\techo new JResponseJson($e);\n\t\t\t}\n\t\t\n\t\t\tjexit();\n\t\t}\n\t\t// ------------------------------------------------------------------------------------------------------------------------------\n\t\t\n // Validate the posted data.\n $form = $model->getForm();\n \n\t\tif (!$form)\n\t\t{\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\techo new JResponseJson( '' , $model->getError() , true ); //JForm::getInstance could not load file\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\techo new JResponseJson($e);\n\t\t\t}\n\t\t\n\t\t\tjexit();\n\t\t}\n\t\t\n // Validate the posted data.\n $data = $model->validate($form, $data);\n\n // Check for errors.\n if ($data === false) \n\t\t{\n \ttry\n\t\t\t{\n\t\t\t\techo new JResponseJson( '' , $model->getErrors() , true );\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\techo new JResponseJson($e);\n\t\t\t}\n\t\t\n\t\t\tjexit();\n\t\t\t\n }\n\n // Attempt to save the data.\n $return = $model->save($data);\n\n // Check for errors.\n if ($return === false) \n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\techo new JResponseJson( '' , $model->getError() , true );\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\techo new JResponseJson($e);\n\t\t\t}\n\t\t\n\t\t\tjexit();\n\t\t\t\n }\n\n\t\ttry\n\t\t{\n\t\t\techo new JResponseJson( $return );\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\techo new JResponseJson($e);\n\t\t}\n\t\n\t\tjexit();\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"answer\",\n \"action\" => \"index\"\n ));\n }\n\n $answid = $this->request->getPost(\"answid\");\n\n $answ = Answer::findFirstByAnswerId($answid);\n if (!$answ) {\n $this->flash->error(\"answer does not exist \" . $answid);\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"answer\",\n \"action\" => \"index\"\n ));\n }\n\n $answ->setAnswId($this->request->getPost(\"answid\"));\n $answ->setQuesId($this->request->getPost(\"quesid\"));\n $answ->setUserId($this->request->getPost(\"userid\"));\n $answ->setAgree($this->request->getPost(\"agree\"));\n $answ->setRank($this->request->getPost(\"rank\"));\n $answ->setComment($this->request->getPost(\"comment\"));\n $answ->setInans($this->request->getPost(\"inans\"));\n $answ->setRankId($this->request->getPost(\"rankid\"));\n $answ->setChgreason($this->request->getPost(\"chgreason\"));\n $answ->setChgcomment($this->request->getPost(\"chgcomment\"));\n $answ->setCrdt($this->request->getPost(\"crdt\"));\n $answ->setCrdtId($this->request->getPost(\"crdtid\"));\n $answ->setUpdt($this->request->getPost(\"updt\"));\n $answ->setUpdtId($this->request->getPost(\"updtid\"));\n $answ->setDelmark($this->request->getPost(\"delmark\"));\n \n\n if (!$answ->save()) {\n\n foreach ($answ->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"answer\",\n \"action\" => \"edit\",\n \"params\" => array($answ->answid)\n ));\n }\n\n $this->flash->success(\"answer was updated successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"answer\",\n \"action\" => \"index\"\n ));\n\n }", "public function update(Request $request, $id)\n {\n $user=auth()->user();\n $restaurant=$user->restaurant_profile;\n \n $data=$request->validate([\n 'name'=>'required',\n 'description'=>'required',\n 'amount'=>'required|integer'\n ]);\n $expense=Expense::findOrFail($id);\n $expense->name=$request->name;\n $expense->description = $request->description;\n $expense->amount=$request->amount;\n $expense->save();\n\n return redirect()->route('expenses')->with('success','Expense updated successfully');\n }", "public function save() {\n \n $fields = array(\"id\", \"title\", \"largeimage\", \"description\", \"credits\", \"activitypoints\", \"activitypointstype\", \"expirydays\", \"enabled\", \"items\");\n \n foreach ($fields as $value)\n {\n if (!isset($_POST[$value]))\n {\n $this->load_view('housekeeping/response');\n $this->view->data->status = \"Error\";\n $this->view->data->alert_type = \"important\";\n $this->view->data->error = \"Unexpected error occured!\";\n $this->view->publish();\n return;\n }\n else if ($_POST[$value] == \"\")\n {\n $this->load_view('housekeeping/response');\n $this->view->data->status = \"Error\";\n $this->view->data->alert_type = \"important\";\n $this->view->data->error = \"You left a field blank!\";\n $this->view->publish();\n return;\n }\n }\n \n $daysUntilExpiry = (time() + (86400 * intval($_POST['expirydays'])));\n \n //R::exec(\"UPDATE site_articles SET article_name = ?, article_topstory = '/c_images/Top_Story_Images/\" . $_POST[\"topstory\"] . \"', article_description = ?, article_story = ? WHERE id = \". $_POST[\"id\"], array($_POST[\"name\"], $_POST[\"description\"], $_POST[\"story\"]));\n \n R::exec(\"UPDATE targeted_offers SET title = ?, description = ?, credits = ?, activity_points = ?, activity_points_type = ?, large_image = ?, expire_time = ?, enabled = ?, items = ? WHERE id = ?\", array($_POST[\"title\"], $_POST[\"description\"], $_POST[\"credits\"], $_POST[\"activitypoints\"], $_POST[\"activitypointstype\"], \"targetedoffers/\" . $_POST[\"largeimage\"], $daysUntilExpiry, $_POST[\"enabled\"], $_POST[\"items\"], $_POST['id']));\n \n MUS(\"reloadoffers\", \"\");\n \n $this->load_view('housekeeping/response');\n $this->view->data->status = \"Success\";\n $this->view->data->alert_type = \"success\";\n $this->view->data->error = \"Targeted offer is saved!\";\n $this->view->publish();\n }", "public function save() {\r\n $data = array(\r\n 'CatagoryName' => $this->CatagoryName,\r\n 'Days' => $this->Days,\r\n 'PaidUnpaid' => $this->PaidUnpaid,\r\n 'ShorfForm' => $this->ShorfForm\r\n ); \r\n $this->db->insert('tbl_leave_catagory', $data);\r\n }", "public function saveAction()\n {\n $form = $this->getForm();\n $form->setData($_POST);\n try {\n $valid = $form->isValid();\n } catch (\\Exception $e) {\n $valid = false;\n }\n if (!$valid)\n {\n $this->getSessionStorage()->fromArray(['form' => $form]);\n return $this->redirect()->toRoute($this->routeName, ['action' => 'edit']);\n }\n $modelName = $this->modelName;\n $model = new $modelName();\n $model->exchangeArray($this->getDataFromRequest());\n $this->sm->get($this->mainTableFactory)->save($model);\n return $this->redirect()->toRoute($this->routeName);\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'account_' => 'integer|required',\n 'category_' => 'integer|required',\n 'amount_' => 'numeric|required',\n 'date_' => 'required|date_format:d/m/Y'\n ]);\n \n $account_id = $request->input('account_');\n $amount = str_replace(',', '.', $request->input('amount_'));\n\n $account = Account::find($account_id);\n\n if($account->balance >= $amount)\n {\n //Create Expense\n $expense = new Expense;\n $expense->user_id = auth()->user()->id;\n $expense->account_id = $account_id;\n $expense->category_id = $request->input('category_');\n $expense->amount = $amount;\n $expense->date = Carbon::createFromFormat('d/m/Y', $request->input('date_'));\n $expense->save();\n\n //Update the balance\n $new_balance = $account->balance - abs($amount);\n $account->balance = $new_balance;\n $account->save();\n\n return redirect('/operations')->with('success','<strong>'.$account->name.'</strong> balance is now: <strong>'.$account->balance.' '.$account->currency()->first()->sign.'</strong>');\n }\n else\n {\n return redirect('/operations')->with('error','You don’t have enough funds in this account. <strong>'.$account->name.'</strong> balance is: <strong>'.$account->balance.' '.$account->currency()->first()->sign.'</strong>')->withInput();\n }\n \n }", "function postEdit($params)\n\t{\n\t\t$action = getPostText('actionField');\n\t\tif($action != 'cancel')\n\t\t{\n\t\t\t$defaults['date'] = $expenseInfo['date'] = getPostText('date');\n\t\t\t$defaults['category_id'] = $expenseInfo['category_id'] = getPostInt('category_id');\n\t\t\t$defaults['entered_by'] = $expenseInfo['entered_by'] = getPostInt('entered_by');\n\t\t\t$this->session('defaults', $defaults);\n\t\t\t$expenseInfo['store'] = getPostText('store');\n\t\t\t$expenseInfo['amount'] = getPostText('amount');\n\t\t\t$expenseInfo['comment'] = getPostText('comment');\n\t\t\t$expenseInfo['credit'] = getPostInt('credit');\n\t\t\tif(getPostIsset('repeat'))\n\t\t\t\t$expenseInfo['span_months'] = getPostInt('span_months');\n\t\t\telse\n\t\t\t\t$expenseInfo['span_months'] = 1;\n\t\t\tif($params[1] === 'new')\n\t\t\t{\n\t\t\t\tExpense::insert($expenseInfo);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$expense = &new Expense($params[1]);\n\t\t\t\t$expense->setInfo($expenseInfo);\n\t\t\t}\n\t\t\t$date = explode('-', $defaults['date']);\n\t\t\t$year = $date[0];\n\t\t\t$month = (int)$date[1];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$defaults = $this->session('defaults');\n\t\t\t$date = explode('-', $defaults['date']);\n\t\t\t$year = $date[0];\n\t\t\t$month = (int)$date[1];\n\t\t}\n\t\tswitch($action)\n\t\t{\n\t\t\tcase 'save':\n\t\t\tcase 'cancel':\n\t\t\t\t$this->zoneRedirect(\"list\");\n\t\t\t\tbreak;\n\t\t\tcase 'split':\n\t\t\t\t$this->zoneRedirect(\"split/{$params[1]}\");\n\t\t\t\tbreak;\n\t\t\tcase 'continue':\n\t\t\tcase 'default':\n\t\t\t\t$this->zoneRedirect('edit/new');\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->zoneRedirect(\"list\");\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function store(StoreIncome $request)\n {\n $request->saveIncome();\n\n return back()->with('flash', 'Income has been added!');\n }", "public function saveAction() {\n parent::saveAction();\n }", "public function updateFinance($post){\n if(!$post) return false;\n $id = $this->id;\n $post_expenses = isset($post['Expense'])?$post['Expense']:[];\n $post_incomes = isset($post['Income'])?$post['Income']:[];\n //first we have to remove the ones that are removed\n $project_expenses = Expense::find()->where(['project_id' => $id])->all();\n foreach($project_expenses as $exp){\n $toDelete = true;\n foreach($post_expenses as $post_exp){\n if($post_exp['id'] == $exp->id) $toDelete = false;\n }\n if($toDelete){\n $exp->delete();\n } \n }\n $project_incomes = Income::find()->where(['project_id' => $id])->all();\n foreach($project_incomes as $inc){\n $toDelete = true;\n foreach($post_incomes as $post_inc){\n if($post_inc['id'] == $inc->id) $toDelete = false;\n }\n if($toDelete){\n $inc->delete();\n } \n }\n //then we add the new expenses and update the existing ones\n foreach($post_expenses as $exp){\n if(!$exp['id']) {\n $new_exp = new Expense();\n $new_exp->amount = $exp['amount'];\n $new_exp->project_id = $id;\n $new_exp->date = $exp['date'];\n $new_exp->save();\n }else{\n $existing = Expense::findOne($exp['id']);\n $existing->amount = $exp['amount'];\n $existing->date = $exp['date'];\n $existing->update();\n }\n }\n //then we add the new incomes, and update the existing ones\n foreach($post_incomes as $inc){\n if(!$inc['id']) {\n $new_inc = new Income();\n $new_inc->amount = $inc['amount'];\n $new_inc->project_id = $id;\n $new_inc->date = $inc['date'];\n $new_inc->save();\n }else{\n $existing = Income::findOne($inc['id']);\n $existing->amount = $inc['amount'];\n $existing->date = $inc['date'];\n $existing->update();\n }\n }\n\n return true;\n }", "public function updated(Expense $expense)\n {\n if ($expense->status == 1 && $expense->wallet) {\n $wallet = $expense->wallet;\n $wallet->update([\n 'balance' => ($wallet->balance - $expense->amount)\n ]);\n }\n }", "public function save($user_id)\n {\n $this->validate();\n \n if (empty($this->errors)) {\n\n $sql = 'INSERT INTO expenses VALUES (NULL,\n :user_id, \n :expense_category_assigned_to_user_id, \n :payment_method_assigned_to_user_id,\n :amount, \n :date_of_expense, \n :expense_comment)';\n\n $db = static::getDB();\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':user_id', $user_id, PDO::PARAM_INT);\n $stmt->bindValue(':amount', $this->amount, PDO::PARAM_STR);\n $stmt->bindValue(':date_of_expense', $this->date, PDO::PARAM_STR);\n $stmt->bindValue(':payment_method_assigned_to_user_id', $this->payment, PDO::PARAM_INT);\n $stmt->bindValue(':expense_category_assigned_to_user_id', $this->category, PDO::PARAM_INT);\n $stmt->bindValue(':expense_comment', $this->comment, PDO::PARAM_STR);\n \n return $stmt->execute();\n }\n\n return false;\n }", "public function saveAction() {\n if (!$data = $this->getRequest()->getPost()) {\n $this->_redirect('*/*/index');\n }\n $productData = $this->_prepareDataForDraftPO($data);\n $model = Mage::getModel('inventorypurchasing/purchaseorder_draftpo')\n ->load($this->getRequest()->getParam('id'))\n ->setData('product_data', $productData);\n try {\n $model->save();\n Mage::getSingleton('vendors/session')\n ->addSuccess(Mage::helper('inventorypurchasing')->__('Data has been saved.'));\n return $this->_redirect('*/*/view', array('id' => $model->getId()));\n } catch (Exception $ex) {\n Mage::getSingleton('vendors/session')->addError($ex->getMessage());\n return $this->_redirect('*/*/view', array('id' => $model->getId()));\n }\n }", "public function update(Request $request, $id)\n {\n \n $requestData = $request->all();\n \n $expense = Expense::findOrFail($id);\n $expense->update($requestData);\n\n return redirect('admin/expense')->with('flash_message', 'Expense updated!');\n }", "function save()\n\t{\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\n\t\t$user = JFactory::getUser();\n\t\t$post\t= JRequest::get('post');\n\t\tif (!($user->authorise('core.create', 'com_gmapfp') and empty($post['id'])) and !($user->authorise('core.edit', 'com_gmapfp') and !empty($post['id'])))\n\t\t{\n\t\t\t$this->setMessage(JText::_('JLIB_APPLICATION_ERROR_CREATE_RECORD_NOT_PERMITTED'), 'error');\n\t\t} else {\n\t\t\t$model = $this->getModel('gmapfp');\n\t\t\t$returnid=$model->store($post);\n\t\t\tif ($returnid>0) {\n\t\t\t\t$msg = JText::_( 'GMAPFP_SAVED' );\n\t\t\t} else {\n\t\t\t\t$msg = JText::_( 'GMAPFP_SAVED_ERROR' );\n\t\t\t}\n\t\t}\n\n\t\t$link = 'index.php?option=com_gmapfp&controller=gmapfp&task=view';\n\t\t// Check the table in so it can be edited.... we are done with it anyway\n\t\t$this->setRedirect($link, $msg);\n\t}", "public function save()\r\n {\r\n \r\n }", "public function update(Request $request, AppExpenseType $expenseType,$id)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required|unique:expense_types,name,'.$id.',id,deleted_at,NULL',\n 'type' => 'required',\n ])->validate();\n\n $expense_type = AppExpenseType::find($id);\n $expense_type->name = $request->name;\n $expense_type->type = $request->type;\n $expense_type->remark = $request->remark;\n $expense_type->created_by = 0;\n $expense_type->updated_by = 0;\n if ($expense_type->save()) {\n return Redirect::back()->with('success', 'Updated Successfully');\n } else {\n return Redirect::back()->with('failure', 'Something Went Wrong..!');\n }\n }", "public function save();", "public function save();", "public function save();" ]
[ "0.7616036", "0.68547523", "0.6811038", "0.6811038", "0.6735758", "0.6654462", "0.6652764", "0.6651849", "0.6641644", "0.6607206", "0.65666515", "0.6527555", "0.64734066", "0.6456755", "0.64544475", "0.6452617", "0.6447812", "0.6385678", "0.6313902", "0.631229", "0.63038576", "0.6289227", "0.6274884", "0.62011486", "0.61933905", "0.6181883", "0.6172064", "0.61580485", "0.6124376", "0.60935676", "0.60723853", "0.606359", "0.6058721", "0.60576415", "0.6053846", "0.605348", "0.6047754", "0.6021618", "0.5995856", "0.59875953", "0.59841466", "0.5980321", "0.5945957", "0.5916682", "0.5897677", "0.5889661", "0.58784354", "0.58524925", "0.58455515", "0.5832874", "0.58309674", "0.58269125", "0.580891", "0.57841635", "0.57820314", "0.5779839", "0.5769362", "0.57588786", "0.575358", "0.5745455", "0.5743455", "0.57378453", "0.5735583", "0.5726154", "0.5717189", "0.5715372", "0.5707156", "0.5705667", "0.569573", "0.5695091", "0.5695012", "0.5693985", "0.5683798", "0.5678178", "0.5677174", "0.56560224", "0.56552434", "0.5651391", "0.5650403", "0.56248635", "0.56212217", "0.5617612", "0.55973893", "0.5594284", "0.55887693", "0.5584476", "0.55690116", "0.55686337", "0.55677974", "0.5566434", "0.55659705", "0.55557615", "0.55465376", "0.5546123", "0.5543774", "0.55436826", "0.5533002", "0.55143464", "0.5512562", "0.5512562", "0.5512562" ]
0.0
-1
Save method for interface
public function save($data);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "public function save() {}", "public function save() {}", "public function save() {}", "public final function save() {\n }", "public final function save()\n {\n }", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save()\n {\n }", "public function save()\r\n {\r\n \r\n }", "public function save( Application_Model_Interface $model );", "public function save() {\n }", "public function save() {\n }", "public function save() {\n }", "public function save() {\n\t\t\t\n\t\t}", "public function save()\n {\n }", "public function save()\n {\n }", "abstract public function saveOperation(OperationInterface $op);", "public function save()\r\n {\r\n //\r\n }", "public function save()\n\t{\n\n\t}", "public function save():void;", "public function save()\n {\n // For V2.0\n }", "public function save()\n {\n //\n }", "public function save() {\n\n }", "abstract protected function save($data);", "abstract public function save( $data );", "public function save()\n {\n \treturn FactoryAbastract::dao(get_class($this))->save($this);\n }", "public function save()\n \t{\n \t $this->getMapper()->save($this);\n \t}", "public abstract function saveHolder(HolderInterface $holder);", "public\tfunction\tsave()\n\t\t{\n\t\t}", "public function save(){\n }", "public function save(Application_Model_ProfileInterface $profile);", "public function Save()\n {\n }", "protected function saving() {\n // This will get reimplemented by children when necessary\n }", "public function save() {\r\n $conn = GFSalsaConnector::instance();\r\n if ($conn) {\r\n $conn->saveObject($this->object, $this);\r\n }\r\n }", "protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}", "public function save(EmailInterface $email);", "public function saveToDB()\n {\n }", "public function save($entity) {\n throw new NotImplementedException;\n }", "public function saveData()\r\n {\r\n \r\n }", "public function save()\n {\n if ($this->id) {\n $this->update();\n } else {\n $this->id = $this->insert();\n }\n }", "public function save() {\n $class = get_called_class();\n return $class::$objects->save($this);\n }", "function save()\n {\n $save = false;\n if ( $this->lastActivity === NULL )\n return false;\n foreach ( $this->dataInterfaces as $data )\n {\n if ( $data->save() )\n $save = true;\n }\n return $save;\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 final function save() {\n\t\t\treturn SERIA_Meta::save($this);\n\t\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 if ($this->id) {\n return $this->update();\n } else {\n return $this->insert();\n }\n }", "public function save()\n\t{\n\t\t$this->container->save($this);\n\t}", "abstract protected function doSaveTag(TagInterface $tag);", "public abstract function saveWallet(WalletInterface $wallet);", "public function save()\n {\n return;\n }", "public function save($data)\n {\n }", "public function save($data)\n {\n }", "public function save($data)\n {\n }", "public function save($data)\n {\n }", "public function save($data)\n {\n }", "public function save($method = true) {}", "public function save()\n\t{\n\n\t\treturn parent::save();\n\t}", "public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }", "abstract public function save(Model $model);", "public function persist();", "public function save($object);", "public function save()\n {\n if ($this->id === null) {\n $this->insert();\n } else {\n $this->update();\n }\n }", "function savePage(PageInterface $page);", "public function save()\n {\n\n // generate all column's sql query\n $column_names = '';\n $column_values = '';\n foreach ($this->columns as $field_name => $column_obj)\n {\n if ($column_obj->columnName === null) {\n $column_names .= $field_name.', ';\n } else {\n $column_names .= $column_obj->columnName.', ';\n }\n $column_values .= $column_obj->generateValueForSQL().', ';\n }\n $column_names = substr($column_names, 0, -1);\n $column_values = substr($column_values, 0, -1);\n $this_table_name = $this->table_name;\n $this_id = $this->id;\n\n if ($this->id === 0) {\n // This object is not saved yet.\n $query = 'INSERT INTO $this_table_name ($column_names) VALUES ($column_values);';\n // Execute query\n } else {\n // This object is on the DB.\n $query = 'INSERT INTO $this_table_name ($column_names) VALUES ($column_values) WHERE id=$this_id;';\n // Execute query\n }\n\n mysql_run_query($query);\n\n }", "public function saveType()\n {\n }", "function save() {\n\n\t\t// calls generic ORM save (insert or update)\n\t\tparent::save();\n\n\t}", "public function save(EntityInterface $entity) {\n return SAVED_NEW;\n }", "public function save(){\r\n\t\tif ($this->new){\r\n\t\t\treturn $this->insert();\r\n\t\t} else {\r\n\t\t\treturn $this->update();\r\n\t\t}\r\n\t}", "public function save(){\r\n\t \t\treturn isset($this->id) ? $this->update() : $this->create();\r\n\t\t}", "public function save($data): void;", "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->loaded) {\n return $this->update();\n }else{\n return $this->create();\n }\n }", "public function save()\n {\n $this->persist($this->state);\n }", "function save()\n {\n }", "function save()\n {\n }", "abstract protected function doSaveAddress(AddressInterface $address);" ]
[ "0.8323629", "0.8231945", "0.8231945", "0.8231945", "0.8231945", "0.8231945", "0.79014146", "0.79014146", "0.790038", "0.7896929", "0.7797633", "0.7767889", "0.7767889", "0.7767889", "0.7767889", "0.7767889", "0.7767889", "0.7767889", "0.7767889", "0.7767889", "0.7767889", "0.7767889", "0.7767889", "0.7767889", "0.7767889", "0.7767889", "0.7767889", "0.7767889", "0.7767889", "0.7735693", "0.7722109", "0.77188665", "0.7706741", "0.7706741", "0.7700547", "0.76868814", "0.7642231", "0.7642231", "0.7597785", "0.75882196", "0.7575978", "0.7544053", "0.7509999", "0.74811584", "0.74596024", "0.7427011", "0.74261826", "0.7408044", "0.7348075", "0.7333662", "0.7322111", "0.7301719", "0.72948265", "0.72268367", "0.721398", "0.7110375", "0.70889413", "0.708556", "0.70688283", "0.7062071", "0.6960265", "0.69592714", "0.69333655", "0.69274914", "0.6919754", "0.6894741", "0.6867617", "0.6865853", "0.68479633", "0.6830929", "0.68242", "0.6819508", "0.6816751", "0.6816751", "0.6815741", "0.6815649", "0.6815649", "0.6807466", "0.68050516", "0.67965007", "0.6786518", "0.6785805", "0.67741823", "0.6772432", "0.67692053", "0.67553926", "0.6747946", "0.674683", "0.67463833", "0.67448515", "0.672156", "0.672088", "0.6718197", "0.6715159", "0.6708826", "0.67059386", "0.67059386", "0.670358" ]
0.69459295
64
filter between database entry row and dataaccessobjects\n validates database value
private static function clean($in) { return htmlentities($in); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function filterFieldvalue();", "abstract function get_sql_filter($data);", "protected function filter_row(&$row) {}", "abstract public function filterFields();", "abstract protected function filterField(): string;", "function dataVerification($fieldName=null,$value=null,$tableName){\r\n\t\tif($fieldName==\"\") return false;\r\n\t\tif($value==\"\") return false;\r\n\t\t\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array(\"$fieldName\"=>$value));\r\n\t\t$this->db->where(array('is_active'=>true));\r\n\t\t$recordSet = $this->db->get($tableName);\r\n\t\t$data=$recordSet->result() ;\r\n\t\tif(count($data)>0){\r\n \t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}", "function Page_FilterValidated() {\n\n\t\t// Example:\n\t\t//global $MyTable;\n\t\t//$MyTable->MyField1->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function Page_FilterValidated() {\n\n\t\t// Example:\n\t\t//global $MyTable;\n\t\t//$MyTable->MyField1->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function my_browse_data( $table_name , $datas ){\r\n\t\r\n\tglobal $connection;\r\n\t\r\n\t$primary_field = my_get_field_list($table_name);\r\n\tforeach($datas as $field => $value){\r\n\t\t$fieldname = $field ;\r\n\t\t$fieldvalue = $value;\r\n\t}\r\n\t\r\n\t$query = \" SELECT `\".$primary_field. \"` FROM `\".$table_name.\"` WHERE `\".$fieldname.\"` = \". $fieldvalue ;\r\n\t \r\n\t$result = my_query( $query );\r\n\tif( my_num_rows($result) > 0 ){\r\n\t\t\r\n\t\t$data = array();\r\n\t\t\r\n\t\twhile(\t$row = my_fetch_array($result) ){\r\n\t\t\t$data[] = $row[$primary_field];\r\n\t\t}\r\n\t\t\r\n\t\treturn $data;\r\n\t\r\n\t}\r\n\t\r\n\treturn false;\r\n\t\r\n}", "function createObjectFilter($opt) {\n\textract($opt);\n\n\t//make an array if we only have a singular column value\n\tif (is_array($object_filter)) $str = implode(\",\",$object_filter);\n\telse $str = $object_filter;\n\n\t$sql = \"SELECT id FROM docmgr.dm_object WHERE id IN (\".$str.\")\";\n\n\treturn $sql;\n\n}", "function filterType($tbl, $tbl2, $tbl3, $col, $col2, $col3, $filter) {\n\t\tinclude('connect.php');\n\t\t$queryFilter = \"SELECT * FROM {$tbl} m, {$tbl2} g, {$tbl3} mg WHERE m.{$col} = mg.{$col} AND g.{$col2} = mg.{$col2} AND g.{$col3} = '{$filter}'\";\n\t\t$runFilter = mysqli_query($link, $queryFilter);\n\t\tif($runFilter){\n\t\t\treturn $runFilter;\n\t\t}else{\n\t\t\t$error = \"There was an error accessing this Information. Please contact your admin.\";\n\t\t\treturn $error;\n\t\t}\n\t\tmysqli_close($link);\n\t}", "function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//global $MyTable;\n\t\t//$MyTable->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "abstract protected function getWhereForRow($data);", "public function fetch( )\n {\n\n if ( $this->db_query_result )\n {\n $this->db_current_object = @ mysql_fetch_object( $this->db_query_result );\n if(!$this->db_current_object)\n return false;\n\n $l_fields_names = $this->table_fields_names[$this->table_name];\n\n if($l_fields_names)\n {\n foreach ($l_fields_names as $field_index => $field_name)\n {\n if(@isset($this->db_current_object->$field_name))\n {\n if(@array_key_exists($field_name,$this->out_filters[$this->table_name]))\n $this->db_current_object->$field_name = $this->applyOutFilter($field_name);\n }\n }\n return true;\n }\n else\n return true;\n }\n else\n return false;\n\n }", "public function check_if_in_db($conn,$tabel,$column,$data,$userid=0){\r\n $query=\"SELECT * FROM \".$tabel.\" WHERE \".$column.\"= :data AND user_id = \". $userid;\r\n $get=$conn->prepare($query);\r\n $get->bindValue(':data', $data);\r\n $get->execute();\r\n $row=$get->rowCount();\r\n if($row==0){return false;}\r\n else{return true ;}\r\n \r\n}", "function FetchOneRowDataByTwoField($tableName,$fieldName,$fieldValue,$fieldName2,$fieldValue2)\n{\n $query = $this->db->query(\"Select * from $tableName where $fieldName='\".$fieldValue.\"' and $fieldName2='\".$fieldValue2.\"' \");\n $totalRowsUnique = $query->num_rows();\n if($totalRowsUnique > 0)\n {\n return $query->row();\n }\n \n}", "function filterBy_S_A_F_E($SEDE, $AREA, $FACULTAD, $ESCUELA,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? \");\n $parametros = array(\"iiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "public function filter(Record $record);", "protected function cbFilterObjects($value)\n {\n return !is_object($value);\n }", "function validateUnequeIndividual($db, $data, $dbColumnName) {\n $sql = \"SELECT * FROM blog_comment WHERE \" . $dbColumnName . \" = ?\";\n $isUneque = true;\n $statement = $db ->prepare($sql);\n $statement->execute([$data]);\n\n $results = $statement->fetchAll(PDO::FETCH_ASSOC);\n if ($results != []) {\n $isUneque = false;\n }\n return $isUneque;\n}", "function filterBy_S_A_F_E_C($SEDE, $AREA, $FACULTAD, $ESCUELA, $CARRERA,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? AND car_ia = ? \");\n $parametros = array(\"iiiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA, &$CARRERA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "function filter_TR_By_S_A_F_E($SEDE, $AREA, $FACULTAD, $ESCUELA,$TABLE_R)\n{\n global $mysqli;\n $TRES = $TABLE_R;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,ps,pca,pcg,gatb,verbal,numer,indice FROM \" .$TRES. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? \");\n $parametros = array(\"iiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "function getfilteredrec($data)\n\t{\n\t\t$this->db->like($data[\"field\"], $data[\"value\"]);\n\n\t\treturn $this->db->get(\"tblteman\");\n\t}", "function validar($objeto){\n\t\t$sql = \"SELECT\n\t\t\t\t\tid\n\t\t\t\tFROM\n\t\t\t\t\tcom_recetas\n\t\t\t\tWHERE\n\t\t\t\t\tid = \".$objeto['id_receta'];\n\t\t// return $sql;\n\t\t$result =$this->queryArray($sql);\n\n\t\treturn $result;\n\t}", "public function process() {\n if ($this->skip()) {\n return;\n }\n $values = explode($this->config('delimiter'), $this->value());\n\n $conditions = [];\n foreach ($this->fields() as $field) {\n $left = $field . ' ' . $this->config('comparison');\n\n foreach ($values as $value) {\n $right = $this->_wildCards($value);\n $conditions[] = [$left => $right];\n }\n }\n $this->query()->andWhere([$this->config('mode') => $conditions]);\n }", "private function get_filterItem( $uid, $value )\n {\n static $loop = array();\n\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n if ( !isset( $loop[ $this->curr_tableField ] ) )\n {\n $loop[ $this->curr_tableField ] = 0;\n }\n else\n {\n $loop[ $this->curr_tableField ] ++;\n }\n\n if ( $loop[ $this->curr_tableField ] < 2 )\n {\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'begin' );\n }\n\n // Get TS configuration of the current filter / tableField\n $conf_name = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field ];\n $conf_array = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ];\n\n // Make a backup\n $cObjDataBak = $this->pObj->cObj->data;\n // Add elements of current row to cObj->data\n $this->cObjData_updateRow( $uid );\n\n $this->set_markerArrayUpdateRow( $uid );\n\n // IF first_item, set the first item tree view\n if ( $uid == $conf_array[ 'first_item.' ][ 'option_value' ] )\n {\n $this->set_firstItemTreeView();\n }\n // IF first_item, set the first item tree view\n // DEVELOPMENT: Browser engine 4.x\n switch ( $this->pObj->dev_browserEngine )\n {\n case( 3 ):\n // stdWrap the current value\n $item = $this->get_filterItemValueStdWrap( $conf_name, $conf_array, $uid, $value );\n break;\n case( 4 ):\n // #i0112, 141218, dwildt, 1+\n case( 5 ):\n // Wrap the current value by the cObject\n $this->updateWizard( 'filter_cObject' );\n if ( $loop[ $this->curr_tableField ] < 2 )\n {\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, '### 1' );\n }\n $item = $this->get_filterItemCObj( $uid, $value );\n if ( $loop[ $this->curr_tableField ] < 2 )\n {\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, '### 2' );\n }\n break;\n default:\n $header = 'FATAL ERROR!';\n $text = 'Sorry, this error shouldn\\'t occure: case is undefined.';\n $this->pObj->drs_die( $header, $text );\n break;\n }\n // DEVELOPMENT: Browser engine 4.x\n\n\n $this->set_itemCurrentNumber();\n if ( $loop[ $this->curr_tableField ] < 2 )\n {\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, '### 3' );\n }\n\n // Reset cObj->data\n $this->pObj->cObj->data = $cObjDataBak;\n\n if ( $loop[ $this->curr_tableField ] < 2 )\n {\n $this->pObj->timeTracking_log( $debugTrailLevel, 'end' );\n }\n return $item;\n }", "function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "private function createWhereByValue($value){\n $filterDbOfValue = $value->getFilterDB();\n if(is_null($filterDbOfValue)){\n $filterDbOfValue = $this->id .\"='\".$value->getId().\"'\";\n }\n return $filterDbOfValue;\n }", "function MyMod_Data_Fields_Sql_Search_Select($data,$rdata,$value)\n {\n if\n (\n $this->ItemData[ $data ][ \"GETSearchVarName\" ]\n &&\n !preg_match('/^Admin$/',$this->Profile())\n )\n {\n $getvalue=$this->CGI_GETint($this->ItemData[ $data ][ \"GETSearchVarName\" ]);\n if (!empty($getvalue))\n {\n if (empty($value))\n {\n $value=$getvalue;\n }\n }\n }\n\n //Where clause in module sql table\n $where=$this->MyMod_Data_Fields_Sql_Where($data,$value);\n\n if (!is_array($where)) { $where=$this->Hash2SqlWhere($where); }\n\n //Get values present in table.\n $colvalues=$this->Sql_Select_Unique_Col_Values\n (\n $data,\n $where\n );\n $colvalues=preg_grep('/^\\d+$/',$colvalues);\n \n if (!empty($colvalues))\n {\n $where[ \"ID\" ]=$colvalues;\n }\n\n $datas=$this->MyMod_Data_Fields_Module_Datas($data);\n $datas=preg_grep('/^ID$/',$datas,PREG_GREP_INVERT);\n array_push($datas,\"ID\");\n\n $hashes=array();\n if (!empty($this->ItemData[ $data ][ \"SqlTables_Regex\" ]))\n {\n $class=$this->ItemData[ $data ][ \"SqlClass\" ];\n \n $hashes=\n $this->Module2Object($data)->Sql_Tables_Select_Hashes\n (\n $this->ItemData[ $data ][ \"SqlTables_Regex\" ],\n $where,\n $datas\n );\n }\n elseif (!empty($this->ItemData[ $data ][ \"Search_Vars\" ]))\n {\n $class=$this->ItemData[ $data ][ \"SqlClass\" ];\n $sqltable=$this->ApplicationObj()->SubModulesVars[ $class ][ \"SqlTable\" ];\n\n foreach ($this->ItemData[ $data ][ \"Search_Vars\" ] as $searchvar)\n {\n $sqltable=\n preg_replace\n (\n '/#'.$searchvar.'/',\n $this->MyMod_Search_CGI_Value($searchvar),\n $sqltable\n );\n }\n $hashes=\n $this->Module2Object($data)->Sql_Select_Hashes\n (\n $where,\n $datas,\n \"\",FALSE,\n $sqltable\n );\n }\n else\n {\n if (!empty($where[ $data ]))\n {\n #$where[ \"ID\" ]=$where[ $data ];\n unset($where[ $data ]);\n }\n $class=$this->ItemData[ $data ][ \"SqlClass\" ];\n if (\n !empty($this->ItemData[ $data ][ \"SqlClass\" ])\n &&\n method_exists($this->Module2Object($data),\"SqlWhere\")\n )\n {\n if (!is_array($where))\n {\n $where=$this->SqlClause2Hash($where);\n }\n\n $where=\n array_merge\n (\n $where,\n $this->Module2Object($data)->SqlWhere(array($data => $value))\n );\n }\n\n $hashes=\n $this->Module2Object($data)->Sql_Select_Hashes\n (\n $where,\n $datas,\n join(\",\",$this->ApplicationObj()->SubModulesVars[ $class ][ \"SqlDerivedData\" ])\n );\n }\n\n $rvalue=$this->Html_Select_Hashes2Field\n (\n $this->MyMod_Search_CGI_Name($data),\n $this->MyMod_Data_Fields_Module_SubItems_2Options\n (\n $data,\n $this->MyMod_Sort_List($hashes,$datas)\n ),\n $value\n );\n\n if ($this->ItemData[ $data ][ \"SqlTextSearch\" ] && ($value==\"\" || $value==0))\n {\n $rvalue=\n array\n (\n $value,\n $this->MyMod_Search_Field_Text($data)\n );\n }\n else\n {\n $rvalue=preg_replace\n (\n '/NAME=\\''.$data.'\\'/',\n \"NAME='\".$rdata.\"'\",\n $rvalue\n );\n }\n \n return $rvalue;\n }", "function MyMod_Data_Fields_Sql_Where($data,$value)\n {\n $where=array();\n if (!empty($this->SqlWhere[ $data ]))\n {\n $where[ $data ]=$this->SqlWhere[ $data ];\n }\n return $where;\n }", "function FetchOneRowDataByOneField($tableName,$fieldName,$fieldValue)\n{\n $query = $this->db->query(\"Select * from $tableName where $fieldName='\".$fieldValue.\"'\");\n $totalRowsUnique = $query->num_rows();\n if($totalRowsUnique > 0)\n {\n return $query->row();\n }\n \n}", "function FetchDataByThreeField($tableName,$fieldName,$fieldValue,$fieldName2,$fieldValue2,$fieldName3,$fieldValue3)\n{\n $query = $this->db->query(\"Select * from $tableName where $fieldName='\".$fieldValue.\"' and $fieldName2='\".$fieldValue2.\"' and $fieldName3='\".$fieldValue3.\"' \");\n $totalRowsUnique = $query->num_rows();\n if($totalRowsUnique > 0)\n {\n return $query->result_array();\n }\n \n}", "function filterByS_A_F($SEDE, $AREA, $FACULTAD,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ?\");\n $parametros = array(\"iii\", &$SEDE, &$AREA, &$FACULTAD);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "function IsRecordEditable($values, $isEditable)\n{\n\n\t\t\n\n$lkd=$values[\"Locked\"];\n\nif($lkd==1) {\n\nreturn $isEditable=false;\n\n}\n\nelse return $isEditable=true;\n;\t\t\n}", "function Select_Record_By_One_Filter($data, $table_name) {\r\n global $con;\r\n $key = array_keys($data);\r\n $value = array_values($data);\r\n $sql = \"select * from $table_name where $key[0] = '$value[0]'\";\r\n try {\r\n $stmt = $con->query($sql);\r\n return $stmt;\r\n } catch (PDOException $e) {\r\n print $e->getMessage();\r\n }\r\n}", "private function get_filterItemsFromRows()\n {\n // Default return value\n $arr_return = array();\n $arr_return[ 'data' ][ 'items' ] = null;\n\n // RETURN rows are empty\n if ( empty( $this->rows ) )\n {\n // DRS\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = 'Rows are empty. Filter: ' . $this->curr_tableField . '.';\n t3lib_div::devlog( '[WARN/FILTER] ' . $prompt, $this->pObj->extKey, 2 );\n }\n // DRS\n return $arr_return;\n }\n // RETURN rows are empty\n // Get table and field\n list( $table ) = explode( '.', $this->curr_tableField );\n\n // Set nice_piVar\n $this->set_nicePiVar();\n\n // Set class var $htmlSpaceLeft\n $this->set_htmlSpaceLeft();\n\n // Set class var $maxItemsPerHtmlRow\n $this->set_maxItemsPerHtmlRow();\n\n // SWITCH current filter is a tree view\n // #i0117, 141223, dwildt, 1-/+\n //switch ( in_array( $table, $this->arr_tablesWiTreeparentfield ) )\n switch ( in_array( $this->curr_tableField, $this->arr_tablesWiTreeparentfield ) )\n {\n case( true ):\n $arr_return = $this->get_filterItemsTree();\n break;\n case( false ):\n default:\n $arr_return = $this->get_filterItemsDefault();\n $items = $arr_return[ 'data' ][ 'items' ];\n $arr_return = $this->get_filterItemsWrap( $items );\n break;\n }\n // SWITCH current filter is a tree view\n\n return $arr_return;\n }", "function checkValues($row,&$data,$insert,$from_update=false) {\n global $Language;\n $hp = Codendi_HTMLPurifier::instance();\n for ($c=0; $c < count($this->parsed_labels); $c++) {\n $label = $this->parsed_labels[$c];\n $val = $data[$c];\n $field = $this->used_fields[$label];\n if ($field) $field_name = $field->getName();\n \n // check if val in predefined vals (if applicable)\n unset($predef_vals);\n if (isset($this->predefined_values[$c])) {$predef_vals = $this->predefined_values[$c];}\n if (isset($predef_vals)) {\n\tif (!$this->checkPredefinedValues($field,$field_name,$label,$val,$predef_vals,$row,$data)) {\n\t return false;\n\t}\n }\n \n // check whether we specify None for a field which is mandatory\n if ($field && !$field->isEmptyOk() &&\n\t $field_name != \"artifact_id\") {\n\tif ($field_name == \"submitted_by\" ||\n\t $field_name == \"open_date\") {\n\t //submitted on and submitted by are accepted as \"\" on inserts and\n\t //we put time() importing user as default\n\t} else {\n\t \n\t $is_empty = ( ($field->isSelectBox() || $field->isMultiSelectBox()) ? ($val==$Language->getText('global','none')) : ($val==''));\n\n\t if ($is_empty) {\n\t $this->setError($Language->getText('plugin_tracker_import_utils','field_mandatory_and_current',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML),\n $hp->purify($label, CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify(SimpleSanitizer::unsanitize($this->ath->getName()), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($val, CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n\t }\n\t}\n }\n \n // for date fields: check format\n if ($field && $field->isDateField()) {\n\tif ($field_name == \"open_date\" && $val == \"\") {\n\t //is ok.\n\t} else {\n\t \n\t if ($val == \"-\" || $val == \"\") {\n\t //ok. transform it by hand into 0 before updating db\n\t $data[$c] = \"\";\n\t } else {\n\t list($unix_time,$ok) = util_importdatefmt_to_unixtime($val);\n\t if (!$ok) {\n\t $this->setError($Language->getText('plugin_tracker_import_utils','incorrect_date',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($val, CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n\t }\n\t $date = format_date(\"Y-m-d\",$unix_time);\n\t $data[$c] = $date;\n\t }\n\t}\n }\n } // end of for parsed_labels\n\n\n if (!$insert && $label == $this->lbl_list['follow_ups']) {\n /* check whether we need to remove known follow-ups */\n \n }\n \n // if we come from update case ( column tracker_id is specified but for this concrete artifact no aid is given)\n // we have to check whether all mandatory fields are specified and not empty\n if ($from_update) {\n\n \n while (list($label,$field) = each($this->used_fields)) {\n\tif ($field) $field_name = $field->getName();\n\t\n\tif ($field) {\n if ($field_name != \"artifact_id\" &&\n $field_name != \"open_date\" &&\n $field_name != \"submitted_by\" &&\n $label != $this->lbl_list['follow_ups'] &&\n $label != $this->lbl_list['is_dependent_on'] &&\n $label != $this->lbl_list['add_cc'] &&\n $label != $this->lbl_list['cc_comment'] &&\n !$field->isEmptyOk() && !in_array($label,$this->parsed_labels)) {\n\t \n\t $this->setError($Language->getText('plugin_tracker_import_utils','field_mandatory_and_line',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($label, CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify(SimpleSanitizer::unsanitize($this->ath->getName()), CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n }\n\t}\n }\n \n \n }//end from_update\n \n return true;\n }", "function validateUnequeIndividualFromTable($table, $db, $data, $dbColumnName) {\n $sql = \"SELECT * FROM \" . $table . \" WHERE \" . $dbColumnName . \" = ?\";\n $isUneque = true;\n $statement = $db ->prepare($sql);\n $statement->execute([$data]);\n\n $results = $statement->fetchAll(PDO::FETCH_ASSOC);\n if ($results != []) {\n $isUneque = false;\n }\n return $isUneque;\n}", "public function verificationDB($data) {\n global $wpdb;\n $cobcolaborativa_model = new CobColaborativaDataModel();\n if($data != '') {\n $verifica = $wpdb->get_row(\"SELECT * FROM \" . $cobcolaborativa_model->table_name . \" WHERE data = '\".$data.\"'\");\n } else {\n $verifica = true;\n }\n return $verifica;\n }", "function filter_TR_By_S_A_F_E_C($SEDE, $AREA, $FACULTAD, $ESCUELA, $CARRERA,$TABLE_R)\n{\n global $mysqli;\n $TRES = $TABLE_R;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio))AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,ps,pca,pcg,gatb,verbal,numer,indice FROM \" .$TRES. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? AND car_ia = ? \");\n $parametros = array(\"iiiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA, &$CARRERA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "function campo($tabla,$campo,$criterio,$pos,$and=''){\n\t$array=CON::getRow(\"SELECT $pos FROM $tabla WHERE $campo='$criterio' $and\");\n\treturn $array[$pos];\n}", "function FetchDataByTwoField($tableName,$fieldName,$fieldValue,$fieldName2,$fieldValue2)\n{\n $query = $this->db->query(\"Select * from $tableName where $fieldName='\".$fieldValue.\"' and $fieldName2='\".$fieldValue2.\"' \");\n $totalRowsUnique = $query->num_rows();\n if($totalRowsUnique > 0)\n {\n return $query->result_array();\n }\n \n}", "private function _sanitizeData($table, $data, $id = null) \n\t{\t\t\n\t\t// remove the id from the data\n\t\t! $id || $data = array_diff_key($data, $id);\n\n\t\t// keep only the fields that actuallty exist in the database\n\t\treturn array_intersect_key($data, array_flip($this->_list_fields($table)));\n\t}", "function filter_TR_By_S_A_F($SEDE, $AREA, $FACULTAD,$TABLE_R)\n{\n global $mysqli;\n $TRES = $TABLE_R;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,ps,pca,pcg,gatb,verbal,numer,indice FROM \" .$TRES. \" where sede = ? AND area_i = ? AND fac_ia = ?\");\n $parametros = array(\"iii\", &$SEDE, &$AREA, &$FACULTAD);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "public function isValid() {\n\n foreach ($this->entity as $nameColumn => $column) {\n\n $validate = null;\n // Se for chave primaria e tiver valor, valida inteiro somente sem nenhuma outra validacao.\n if ($column['contraint'] == 'pk' && $column['value']) {\n $validate = new Zend_Validate_Digits();\n } else {\n\n//______________________________________________________________________________ VALIDANDO POR TIPO DA COLUNA NO BANCO\n // Se tiver valor comeca validacoes de acordo com o tipo.\n // Se nao pergunta se é obrigatorio, se for obrigatorio valida.\n if ($column['value']) {\n // Se for inteiro\n if ($column['type'] == 'integer' || $column['type'] == 'smallint') {\n $validate = new Zend_Validate_Digits();\n // Se for data\n } else if ($column['type'] == 'numeric') {\n $column['value'] = str_replace('.', '', $column['value']);\n $column['value'] = (float) str_replace(',', '.', $column['value']);\n $validate = new Zend_Validate_Float();\n } else if ($column['type'] == 'date') {\n\n\t\t\t\t\t\t$posBarra = strpos($column['value'], '/');\n\t\t\t\t\t\t$pos = strpos($column['value'], '-');\n\t\t\t\t\t\tif ($posBarra !== false) {\n\t\t\t\t\t\t\t$date = explode('/', $column['value']);\n\t\t\t\t\t\t\tif (!checkdate($date[1], $date[0], $date[2])) {\n\t\t\t\t\t\t\t\t$this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($pos !== false) {\n\t\t\t\t\t\t\t$date = explode('-', $column['value']);\n\t\t\t\t\t\t\tif (!checkdate($date[1], $date[2], $date[0])) {\n\t\t\t\t\t\t\t\t$this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n // Se for texto\n } else if ($column['type'] == 'character' || $column['type'] == 'character varying') {\n\n // Se for Bollean\n } else if ($column['type'] == 'boolean') {\n\n // Se for texto\n } else if ($column['type'] == 'text') {\n \n } else if ($column['type'] == 'timestamp without time zone') {\n if (strpos($column['value'], '/')) {\n\n if (strpos($column['value'], ' ')) {\n $arrDate = explode(' ', $column['value']);\n\n // Validando a data\n $date = explode('/', $arrDate[0]);\n if (!checkdate($date[1], $arrDate[0], $date[2])) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($arrDate[0] . self::MSG_DATA_INVALIDA));\n }\n\n // Validando a hora\n $validateTime = new Zend_Validate_Date('hh:mm');\n $validateTime->isValid($arrDate[1]);\n if ($validateTime->getErrors()) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($arrDate[1] . self::MSG_DATA_HORA_INVALIDA));\n }\n } else {\n // Validando a data\n $date = explode('/', trim($column['value']));\n if (!checkdate($date[1], $date[0], $date[2])) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n }\n }\n }\n }\n\n//______________________________________________________________________________ VALIDANDO POR LIMITE DA COLUNA NO BANCO\n // Validando quantidade de caracteres.\n if ($column['maximum']) {\n $validateMax = new Zend_Validate_StringLength(array('max' => $column['maximum']));\n $validateMax->isValid($column['value']);\n if ($validateMax->getErrors()) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => (reset($validateMax->getMessages())));\n }\n $validateMax = null;\n }\n } else {\n//______________________________________________________________________________ VALIDANDO POR NAO VAZIO DA COLUNA NO BANCO\n // Validando se nao tiver valor e ele for obrigatorio.\n if ($column['is_null'] == 'NO' && $column['contraint'] != 'pk') {\n $validate = new Zend_Validate_NotEmpty();\n }\n }\n\n//______________________________________________________________________________ VALIDANDO A CLOUNA E COLOCANDO A MENSAGEM\n if ($validate) {\n $validate->isValid($column['value']);\n if ($validate->getErrors()) {\n\t\t\t\t\t\t$msg = $validate->getMessages();\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ( reset($msg) ));\n }\n\n $validate = null;\n }\n }\n }\n\t\t\n if ($this->error)\n return false;\n else\n return true;\n }", "function validate_rows() {\r\n $ok = True;\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (!$this->validate_field($colvar,$i)) { # make sure this field is not empty\r\n $ok = False;\r\n }\r\n }\r\n }\r\n return $ok;\r\n }", "function FilterMethod($row){\n\t\treturn $row['parentid'] == $this->filter;\n }", "function checkTypeForFilter($field, $value){\n\t\tif (get_magic_quotes_gpc()){\n\t\t\t$value = stripslashes($value);\n\t\t}\n\t\t\n\t\t$type=$this->types[$field];\n\t\t\n\t\tswitch ($type){\n\t\t\tcase \"date\":\n\t\t\t\t\n\t\t\t\t$value=date_ymd($value);\n\t\t\t\t$return=\" = '$value'\";\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"number\":\n\t\t\t\t$return=\"= $value\";\n\t\t\t\tbreak;\n\t\t\tcase \"progressbar\":\n\t\t\t\t$pje=$value/100;\n\t\t\t\treturn \"= $pje\";\n\t\t\t\tbreak;\n\t\t\tcase \"string\":\n\t\t\tdefault:\n\t\t\t\t$return=\"LIKE \".db::checkRealEscapeString($value,true);\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "function FetchDataByFourField($tableName,$fieldName,$fieldValue,$fieldName2,$fieldValue2,$fieldName3,$fieldValue3,$fieldName4,$fieldValue4)\n{\n $query = $this->db->query(\"Select * from $tableName where $fieldName='\".$fieldValue.\"' and $fieldName2='\".$fieldValue2.\"' and $fieldName3='\".$fieldValue3.\"' and $fieldName4='\".$fieldValue4.\"'\");\n $totalRowsUnique = $query->num_rows();\n if($totalRowsUnique > 0)\n {\n return $query->result_array();\n }\n \n}", "function query() {\n // Don't filter if we're exposed and the checkbox isn't selected.\n\n if ((!empty($this->options['exposed'])) && empty($this->value)) {\n return;\n }\n if (!$this->options['exposed']) {\n $value = $this->options['uid'];\n }\n else {\n $value = $this->validated_exposed_input[0];\n }\n\n\n $this->ensure_my_table();\n\n\n $table = 'scheduling_appointments';\n //$field1 = $this->query->add_field($table, 'nid');\n //$field2 = $this->query->add_field($table, 'title');\n\n\n //$field1 = $table . '.nid';\n //$field2 = $table . '.title';\n if ($value != '') {\n $this->query->add_where(\n $this->options['group'],\n db_and()\n ->condition($table . '.uid', $value, '=')\n );\n }\n }", "public function updateRowCheckInjections($table, $row, $filter)\r\n {\r\n\r\n //call to check validation of query injection of filter:\r\n $filterObj = $filter;\r\n if (gettype($filterObj)==object) {\r\n $filterObj = array();\r\n foreach ($filter as $key => $value) {\r\n array_push($filterObj, array($key,$value));\r\n }\r\n }\r\n $filter_obj = $this->processFilter($filterObj,$this->error);\r\n if(!$filter_obj) return false;\r\n \r\n $array = $row;\r\n if (!is_array($array)) {\r\n $array = json_decode($row);\r\n }\r\n \r\n \r\n if (count($array) ==0) {\r\n array_push($this->error, \"Post does not contain any data!\");\r\n return false;\r\n }\r\n\r\n //check if any post data is not a valid column_name:\r\n $all_columns = $this->getRows(\"SHOW COLUMNS FROM $table \", true);\r\n $table_columns = array();\r\n foreach ($all_columns as $col_row) {\r\n $col_name = $col_row[\"Field\"];\r\n array_push($table_columns, $col_name);\r\n }\r\n\r\n $where_columns = array();\r\n foreach ($filterObj as $filterRow) {\r\n array_push($where_columns, $filterRow[0]);\r\n }\r\n foreach ($where_columns as $where_column) {\r\n if (!in_array($where_column, $table_columns)) {\r\n array_push($this->error, \"field: $where_column is not in table: $table\");\r\n return false;\r\n }\r\n }\r\n $posted_columns = array_keys($array);\r\n foreach ($posted_columns as $posted_column) {\r\n if (!in_array($posted_column, $table_columns)) {\r\n array_push($this->error, \"field: $posted_column is not in table: $table\");\r\n return false;\r\n }\r\n }\r\n \r\n $setCommand = \"\";\r\n $values_arr = array();\r\n $param_type = \"\"; //array();\r\n $count = 0;\r\n foreach ($array as $key => $value) {\r\n $count+=1;\r\n if (strlen($setCommand)==0) {\r\n $setCommand .= $key.\" = ? \";\r\n } else {\r\n $setCommand .= \", \".$key.\" = ? \";\r\n }\r\n array_push($values_arr, $value);\r\n $param_type .= \"s\";\r\n }\r\n $filterRowValues =$filter_obj[\"filterRowValues\"];\r\n foreach ($filterRowValues as $sValue) {\r\n $param_type.=\"s\";\r\n }\r\n\r\n $sql = \"update $table set \".$setCommand;\r\n $a_params = array();\r\n array_push($a_params, $param_type);\r\n foreach ($values_arr as $singleValue) {\r\n array_push($a_params, $singleValue);\r\n }\r\n //adding params of where:\r\n \r\n if(strlen($filter_obj[\"filterWhere\"]) >0){\r\n foreach ($filterRowValues as $singleValue) {\r\n array_push($a_params, $singleValue);\r\n }\r\n $sql .= \" where \".$filter_obj[\"filterWhere\"];\r\n }\r\n \r\n //echo json_encode($a_params);\r\n $this->sql_statement = $sql;\r\n $stmt = $this->conn->prepare($sql);\r\n\r\n if (!$stmt) {\r\n array_push($this->error, \"updateRow: Error in preparing statement (\".$sql.\") \\n\".$this->conn->error);\r\n return false;\r\n } elseif(count($a_params)<1) {\r\n array_push($this->error, \"update must have parameters: \".$sql.\") \\n\");\r\n return false;\r\n } else {\r\n call_user_func_array(array($stmt, 'bind_param'), $this->refValues($a_params));\r\n $result = $stmt->execute();\r\n $count = $this->getConn()->affected_rows;\r\n $this->rowCount = $count;\r\n $stmt->close();\r\n\r\n if($count>0 && $count<10){\r\n $result_sql = \"select * from $table \";\r\n $result_row = $this->getRowsv2($result_sql,$filter, true);\r\n return $result_row;\r\n }\r\n return true;\r\n }\r\n }", "public function checkForUniqueValue($table,$column,$value,$editId) \n{\n \n $value=trim($value);\n $editId=trim($editId);\n $returnVal='';\n \n \n if ($value !== '') {\n $sql=\"select id, $column from $table where $column = '\".$value.\"'\";\n if ($editId != '') {\n $sql=$sql.\" and id <> $editId\"; \n } \n \n $retArray=$this->getTableData($sql,false,true); \n \n if (count($retArray)) {\n $returnVal='This value is not unique. Please update with a unique value.';\n }\n }\n \n return $returnVal; \n}", "public function getFiltered(&$filter, $value, $return_sql = true)\n\t{\n\t\tif (!in_array($filter->field_type, static::$field_types)) return;\n\n\t\t// If we are filtering via a relation-reverse field, then get the ID of relation field\n\t\tif ($filter->field_type === 'relation_reverse')\n\t\t{\n\t\t\t$relation_field_id = (int) $filter->parameters->get('reverse_field', 0);\n\n\t\t\tif (!$relation_field_id)\n\t\t\t{\n\t\t\t\techo '<div class=\"alert alert-warning\">' . $filter->label . ': ' . JText::_('FLEXI_RIFLD_NO_FIELD_SELECTED_TO_BE_REVERSED') . '</div>';\n\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\telseif ($filter->field_type === 'relation')\n\t\t{\n\t\t\t$relation_field_id = $filter->id;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo '<div class=\"alert alert-warning\">Field type : ' . $filter->field_type . ' is not filterable </div>';\n\n\t\t\treturn null;\n\t\t}\n\n\t\t//$value = !is_array($value) ? array($value) : $value;\n\n\t\t$is_relation = $filter->field_type === 'relation';\n\t\t$ritem_field_id = key($value);\n\t\t$ritem_field_id = is_int($ritem_field_id) && $ritem_field_id < 0\n\t\t\t? -$ritem_field_id\n\t\t\t: 0;\n\n\t\tif (!$ritem_field_id)\n\t\t{\n\t\t\tif ($is_relation)\n\t\t\t{\n\t\t\t\t$filter->filter_colname = ' rel.value_integer';\n\t\t\t\t$filter->filter_valuesjoin = null; // use default\n\t\t\t\t$filter->filter_valueformat = null; // use default\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\t$rel = 'relv';\n\t\t\t$c = 'c';\n\t\t\t$join_field_filters = '';\n\n\t\t\t// Find items that are directly / indirectly related via a RELATION / REVERSE RELATION field\n\t\t\t$match_rel_items = $is_relation\n\t\t\t\t? $c . '.id = ' . $rel . '.item_id'\n\t\t\t\t: $c . '.id = ' . $rel . '.value_integer';\n\t\t\t$join_field_filters .= ' JOIN #__flexicontent_fields_item_relations AS ' . $rel . ' ON ' . $match_rel_items . ' AND ' . $rel . '.field_id = ' . $relation_field_id;\n\n\t\t\t$val_tbl = $rel . '_ritems';\n\t\t\t$val_field_id = $ritem_field_id;\n\n\t\t\t// RELATED / REVERSE RELATED Items must have given values\n\t\t\t$val_on_items = $is_relation\n\t\t\t\t? $val_tbl . '.item_id = ' . $rel . '.value_integer'\n\t\t\t\t: $val_tbl . '.item_id = ' . $rel . '.item_id';\n\n\t\t\t// Join with values table 'ON' the current filter field id and 'ON' the items at interest ... below we will add an extra 'ON' clause to limit to the given field values\n\t\t\t$join_field_filters .= ' JOIN #__flexicontent_fields_item_relations AS ' . $val_tbl . ' ON ' . $val_on_items . ' AND ' . $val_tbl . '.field_id = ' . $val_field_id;\n\n\t\t\t$filter->filter_colname = ' ' . $val_tbl . '.value';\n\t\t\t$filter->filter_valuesjoin = $join_field_filters;\n\t\t\t$filter->filter_valueformat = null; // use default\n\t\t\t$filter->filter_valuewhere = null; // use default\n\t\t}\n\n\t\treturn FlexicontentFields::getFiltered($filter, $value, $return_sql);\n\t}", "function post_or_db($fieldname, $data_row = array(), $data_field = ''){\r\n\tglobal $in;\r\n\t// Check if there's a database row..\r\n\tif (@sizeof($data_row) > 0 ){\r\n\t\tif ( $data_field == '' ){\r\n\t\t\t$data_field = $fieldname;\r\n\t\t}\r\n\t\t$database_value = $data_row[$data_field];\r\n\t}else{\r\n\t\t$database_value = '';\r\n\t}\r\n\treturn ($in->get($fieldname)) ? $in->get($fieldname) : $database_value;\r\n}", "abstract function query( $p_filter_input );", "public function filter($data);", "protected function unique($item, $value, $operator = '='){\r\n\t\r\n\tswitch($item->row->table){\r\n\t\tcase 'base':\r\n\t\t\t$res = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->tableName.\" WHERE \".$this->fieldName.\" != \".(int)$this->id.\" AND \".$item->row->name.\" \".$operator.\" '\".$value.\"'\");\r\n\t\tbreak; case 'meta':\r\n\t\t\t$res = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->metaDataTableName.\" WHERE id_meta = '\".$item->row->name.\"' AND \".$this->metaConnectId.\" != \".$this->id.\" AND \".$item->row->attributes()->system_type.\"_value \".$operator.\" '\".$value.\"'\");\r\n\t\tbreak; default:\r\n\t\t\treturn false;\r\n\t}\r\n\r\n\treturn count($res) == 0 ? true: false; \r\n}", "protected abstract function retrieveNonBaseFields(Row $row);", "function testFilteredQuery()\n {\n $q1 = MysqlQueryFactory::getInstance(array(\n \"parameters\" => array(\n \"simple\" => array(\"TYPE\" => \"String\"),\n \"number\" => array(\"TYPE\" => \"Integer\"),\n \"number2\" => array(\"TYPE\" => \"Integer\")\n ),\n \"base\" => \"SELECT * FROM MiTest WHERE [[%filter%]] \"\n ));\n $q1->setConnection($this->connection);\n $g=new StorageEngineGetParams(array(\"query\"=>\"test\",\"filter\"=>array(\"FIELD\"=>\"simple\",\"OPERATOR\"=>\"EQUALS\",\"VALUE\"=>\"Ho'la\")));\n $composed=$q1->parse($g);\n $this->assertEquals(\"SELECT * FROM MiTest WHERE simple = 'Ho\\\\'la'\",trim($composed));\n }", "function getDataRowWhere($table,$fields = null,$where = null,$order = null) {\r\n\t\t\r\n\t\t$db = self::getDatabaseDataWhere($table,$fields,$where,$order);\r\n\t\t\r\n\t\t//echo $db->getQuery();\r\n\t\treturn $db->loadObject();\r\n\t}", "function FetchDataByOneField($tableName,$fieldName,$fieldValue)\n{\n $query = $this->db->query(\"Select * from $tableName where $fieldName='\".$fieldValue.\"'\");\n $totalRowsUnique = $query->num_rows();\n if($totalRowsUnique > 0)\n {\n return $query->result_array();\n }\n \n}", "function process($dataSet)\t{\r\n\t\tif($val = $dataSet->get($this->fieldName)) {\r\n\t\t\tif($val != $dataSet->get($this->comparisonField)){\r\n\t\t\t\t$this->setError($dataSet);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function filterTable($query,$db)\n{\n \n $filter_Result = mysqli_query($db, $query);\n return $filter_Result;\n}", "public function valid ()\n\t{\n\t\tif (is_a($this->rs,'iterator'))\n\t\t{\n\t\t\treturn $this->rs->valid();\n\t\t}\n\t\treturn false;\n\t}", "function CheckDatabase($report,$field,$value){\n\t$tables = mysql_query(\"SHOW TABLES FROM events\");\n\t$report .=\"<p>La estructura de la base de datos es: </p>\";\n\t$report .= \"Tables<ul>\";\n\twhile($table = mysql_fetch_row($tables)){\n\t\tfor($i = 0;$i<sizeof($table);$i++) {$report .= \"<li>\".$table[$i].\"</li>\";\n\t\t\t$tablename = $table[$i];\n\t\t\t$col = mysql_query(\"SELECT * FROM $tablename\");\n\t\t\t$report .= \"<ul>\";\n\t\t\t$j = 0;\n\t\t\t$row = mysql_fetch_row($col);\n\t\t\twhile($j<sizeof($row)){\n\t\t\t\t$colname = mysql_field_name($col,$j);\n\t\t\t\t$report .= \"<li>\".$colname.\"</li><ul>\";\n\t\t\t\tif ($tablename == $field){\t\t\t\t//Shows only the members tables\n\t\t\t\t\twhile($row = mysql_fetch_row($col)){\n\t\t\t\t\t\tif($colname == $value){\t\t\t//Shows only the UserId cows\n\t\t\t\t\t\t$report .= \"<li>\".$row[0].\"</li>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$report .= \"</ul>\";\n\t\t\t\t$j++;\n\t\t\t}\n\t\t\t$report .= \"</ul>\";\n\t\t\t}\n\t}\n\t$report .= \"</ul>\";\n\treturn $report;\n}", "public function filtrar(){\n\n \t\t$sql=\"select * from __________ where ;\";\n \t return $this->ejecutar($sql); \n\n }", "public function checkProducto(){\n $sql='SELECT * FROM producto where nombre = ?';\n $params=array($this->nombre);\n return Database::getRow($sql, $params);\n }", "function wp_filter_object_list($input_list, $args = array(), $operator = 'and', $field = \\false)\n {\n }", "function DatosRow($tabla,$columna,$valor){\n\t\t\t\t\t$this->db->where($columna,$valor);\n\t\t\t\t\t$query = $this->db->get($tabla);\n\n\t\t\t\t\tif ($query->num_rows() > 0) {\n\t\t\t\t\t\treturn $query->result();\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}", "function filterByS($SEDE,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ?\");\n $parametros = array('i', &$SEDE);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "function check_if_field_exits($id_field='', $id_app=''){\n\t\ttry{\n\t\t\t$this->db->select('*');\n\t\t\t$this->db->from('fields');\n\t\t\t$this->db->where('id', $id_field);\n\t\t\t$this->db->where('id_wapp', $id_app);\n\t\t\t$result = $this->db->get()->row();\n\t\t\t//echo $this->db->last_query();\n\t\t\tif($result){\n\t\t\t\treturn $result;\n\t\t\t}else{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}catch(Exception $e){\n\t\t\tlog_message('debug','Error al tratar de traer los datos de un campo din�mico');\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function check_entry($data){\r\n\t\t$query = $this->conn->query($data);\r\n\t\t$row = $query->fetch_array(MYSQLI_ASSOC);\r\n\t\tif($query->num_rows>0){\r\n \t\t\treturn 1;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "function frame_search_sql($obj)\n\n\t{\n\n\t\t\n\n\t\t$param_array = func_get_args();\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::frame_search_sql() - PARAMETER LIST : ', $param_array);\n\n\t\n\n\t\tif($obj->get_search_types[0]['search_condition'] == \"depend_object_setting\" && is_array($obj->search_types))\n\n\t\t{\n\n\t\t\t\n\n\t\t\t$str = \"\";\n\n\t\t\t\n\n\t\t\t$_SESSION[$obj->srch_ses_val] = array();\n\n\t\t\t\n\n\t\t\t$start = 0;\n\n\t\t\t\n\n\t\t\t$enter_switch = 0;\n\n\t\t\t\n\n\t\t\tforeach($obj->search_types as $key => $value)\n\n\t\t\t{\n\n\t\t\t\t$enter_switch = 0;\n\n\t\t\t\tif(strtolower($obj->match_case) == \"yes\")\n\n\t\t\t\t{\n\n\t\t\t\t\t$fld_name = $_REQUEST[$value['tbl_fld_name']];\n\n\t\t\t\t\t$fld_value = $_REQUEST[$value['tbl_fld_value']];\n\n\t\t\t\t}\n\n\t\t\t\telse\n\n\t\t\t\t{\n\n\t\t\t\t\t$fld_name = strtolower($_REQUEST[$value['tbl_fld_name']]);\n\n\t\t\t\t\t$fld_value = strtolower($_REQUEST[$value['tbl_fld_value']]);\n\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\tif($key == \"between\")\n\n\t\t\t\t{\n\n\t\t\t\t\t$fld_value_frm = stripslashes($_REQUEST[$value['tbl_fld_value_frm']]);\n\n\t\t\t\t\t$fld_value_to = stripslashes($_REQUEST[$value['tbl_fld_value_to']]);\n\n\n\n\t\t\t\t\tif(strlen($fld_name) > 0 && strlen($fld_value_frm) > 0 && strlen($fld_value_to) > 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t$_SESSION[$obj->srch_ses_val][$key] = array('tbl_fld_name' => stripslashes($_REQUEST[$value['tbl_fld_name']]), 'tbl_fld_value_frm' => $fld_value_frm, 'tbl_fld_value_to' => $fld_value_to);\n\n\t\t\t\t\t$enter_switch = 1;\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t}\n\n\t\t\t\telse if(strlen($fld_name) > 0 && strlen($fld_value) > 0)\n\n\t\t\t\t{\n\n\t\t\t\t\t$_SESSION[$obj->srch_ses_val][$key] = array('tbl_fld_name' => stripslashes($_REQUEST[$value['tbl_fld_name']]), 'tbl_fld_value' => stripslashes($_REQUEST[$value['tbl_fld_value']]));\n\n\t\t\t\t\t$enter_switch = 1;\n\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\tif($enter_switch == 1)\n\n\t\t\t\t{\n\n\n\n\t\t\t\t\tswitch ($key)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tcase \"contains\":\n\n\t\t\t\t\t\t\tif($start == 0)\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$str .= \" and (\";\n\n\t\t\t\t\t\t\t\t$start = 1;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$str .= \" \" . $obj->search_cond . \" \";\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif($obj->match_case == \"yes\")\n\n\t\t\t\t\t\t\t\t$str .= $fld_name . \" like '\" . wrap_values(\"%\" . str_replace(' ', '%', $fld_value) . \"%\") . \"'\";\n\n\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t\t$str .= \"lower(\" . $fld_name . \") like '\" . wrap_values(\"%\" . str_replace(' ', '%', $fld_value) . \"%\") . \"'\";\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tcase \"startswith\":\n\n\t\t\t\t\t\t\tif($start == 0)\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$str .= \" and (\";\n\n\t\t\t\t\t\t\t\t$start = 1;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$str .= \" \" . $obj->search_cond . \" \";\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif($obj->match_case == \"yes\")\n\n\t\t\t\t\t\t\t\t$str .= $fld_name . \" like '\" . wrap_values($fld_value . \"%\") . \"'\";\n\n\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t\t$str .= \"lower(\" . $fld_name . \") like '\" . wrap_values($fld_value . \"%\") . \"'\";\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tcase \"endswith\":\n\n\t\t\t\t\t\t\tif($start == 0)\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$str .= \" and (\";\n\n\t\t\t\t\t\t\t\t$start = 1;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$str .= \" \" . $obj->search_cond . \" \";\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif($obj->match_case == \"yes\")\n\n\t\t\t\t\t\t\t\t$str .= $fld_name . \" like '\" . wrap_values(\"%\" . $fld_value) . \"'\";\n\n\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t\t$str .= \"lower(\" . $fld_name . \") like '\" . wrap_values(\"%\" . $fld_value) . \"'\";\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tcase \"equalto\":\n\n\t\t\t\t\t\t\tif($start == 0)\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$str .= \" and (\";\n\n\t\t\t\t\t\t\t\t$start = 1;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$str .= \" \" . $obj->search_cond . \" \";\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif($obj->match_case == \"yes\")\n\n\t\t\t\t\t\t\t\t$str .= $fld_name . \" = '\" . wrap_values($fld_value) . \"'\";\n\n\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t\t$str .= \"lower(\" . $fld_name . \") = '\" . wrap_values($fld_value) . \"'\";\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tcase \"lessthan\": //since numeric fields can only be compared for <, > and between case match is not checked.\n\n\t\t\t\t\t\t\tif($start == 0)\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$str .= \" and (\";\n\n\t\t\t\t\t\t\t\t$start = 1;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$str .= \" \" . $obj->search_cond . \" \";\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$str .= $fld_name . \" < '\" . wrap_values($fld_value) . \"'\";\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tcase \"greaterthan\":\n\n\t\t\t\t\t\t\tif($start == 0)\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$str .= \" and (\";\n\n\t\t\t\t\t\t\t\t$start = 1;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$str .= \" \" . $obj->search_cond . \" \";\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$str .= $fld_name . \" > '\" . wrap_values($fld_value) . \"'\";\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tcase \"between\":\n\n\t\t\t\t\t\t\tif($start == 0)\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$str .= \" and (\";\n\n\t\t\t\t\t\t\t\t$start = 1;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$str .= \" \" . $obj->search_cond . \" \";\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$str .= $fld_name . \" between '\" . $fld_value_frm . \"' and '\" . $fld_value_to . \"'\";\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tcase \"sort_by\":\n\n\t\t\t\t\t\t\t$order_by_str = \" \" . $fld_name . \" \" . $fld_value;\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t}//end switch\t\t\t\n\n\n\n\t\t\t\t}//end if($enter_switch == 1)\n\n\n\n\t\t\t}//end foreach\n\n\t\t\n\n\t\t}//end if(is_array\n\n\t\telse if($obj->get_search_types[1]['search_condition'] == \"depend_request\" && is_array($obj->search_types))\n\n\t\t{\n\n\t\t\t\n\n\t\t\t$fld_name = $_REQUEST[$obj->get_search_types['search_condition_tbl_fld_name']];\n\n\t\t\t$fld_value = $_REQUEST[$obj->get_search_types['search_condition_tbl_fld_value']];\n\n\t\t\t$srch_typ = $_REQUEST[$obj->get_search_types['search_condition_fld_name']];\n\n\t\t\t\n\n\t\t\t$_SESSION[$obj->srch_ses_val]['depend_request'][$obj->get_search_types['search_condition_tbl_fld_name']] = $fld_name;\n\n\t\t\t$_SESSION[$obj->srch_ses_val]['depend_request'][$obj->get_search_types['search_condition_tbl_fld_value']] = $fld_value;\n\n\n\n\t\t\tswitch ($srch_typ)\n\n\t\t\t{\n\n\t\t\t\t\n\n\t\t\t\tcase \"contains\":\n\n\t\t\t\t\tif($start == 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$str .= \" and (\";\n\n\t\t\t\t\t\t$start = 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$str .= \" \" . $obj->search_cond . \" \";\n\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t\t\tif($obj->match_case == \"yes\")\n\n\t\t\t\t\t\t$str .= $fld_name . \" like '\" . wrap_values(\"%\" . str_replace(' ', '%', $fld_value) . \"%\") . \"'\";\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\t$str .= \"lower(\" . $fld_name . \") like '\" . wrap_values(\"%\" . str_replace(' ', '%', $fld_value) . \"%\") . \"'\";\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\n\n\t\t\t\tcase \"startswith\":\n\n\t\t\t\t\tif($start == 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$str .= \" and (\";\n\n\t\t\t\t\t\t$start = 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$str .= \" \" . $obj->search_cond . \" \";\n\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t\t\tif($obj->match_case == \"yes\")\n\n\t\t\t\t\t\t$str .= $fld_name . \" like '\" . wrap_values($fld_value . \"%\") . \"'\";\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\t$str .= \"lower(\" . $fld_name . \") like '\" . wrap_values($fld_value . \"%\") . \"'\";\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\n\n\t\t\t\tcase \"endswith\":\n\n\t\t\t\t\tif($start == 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$str .= \" and (\";\n\n\t\t\t\t\t\t$start = 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$str .= \" \" . $obj->search_cond . \" \";\n\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t\t\tif($obj->match_case == \"yes\")\n\n\t\t\t\t\t\t$str .= $fld_name . \" like '\" . wrap_values(\"%\" . $fld_value) . \"'\";\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\t$str .= \"lower(\" . $fld_name . \") like '\" . wrap_values(\"%\" . $fld_value) . \"'\";\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\n\n\t\t\t\tcase \"equalto\":\n\n\t\t\t\t\tif($start == 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$str .= \" and (\";\n\n\t\t\t\t\t\t$start = 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$str .= \" \" . $obj->search_cond . \" \";\n\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t\t\tif($obj->match_case == \"yes\")\n\n\t\t\t\t\t\t$str .= $fld_name . \" = '\" . wrap_values($fld_value) . \"'\";\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\t$str .= \"lower(\" . $fld_name . \") = '\" . wrap_values($fld_value) . \"'\";\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\n\n\t\t\t\tcase \"lessthan\": //since numeric fields can only be compared for <, > and between case match is not checked.\n\n\t\t\t\t\tif($start == 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$str .= \" and (\";\n\n\t\t\t\t\t\t$start = 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$str .= \" \" . $obj->search_cond . \" \";\n\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t\t\t$str .= $fld_name . \" < '\" . wrap_values($fld_value) . \"'\";\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\n\n\t\t\t\tcase \"greaterthan\":\n\n\t\t\t\t\tif($start == 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$str .= \" and (\";\n\n\t\t\t\t\t\t$start = 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$str .= \" \" . $obj->search_cond . \" \";\n\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t\t\t$str .= $fld_name . \" > '\" . wrap_values($fld_value) . \"'\";\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\n\n\t\t\t\tcase \"between\":\n\n\t\t\t\t\tif($start == 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$str .= \" and (\";\n\n\t\t\t\t\t\t$start = 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$str .= \" \" . $obj->search_cond . \" \";\n\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t\t\t$str .= $fld_name . \" between '\" . $fld_value_frm . \"' and '\" . $fld_value_to . \"'\";\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\n\n\t\t\t\tcase \"sort_by\":\n\n\t\t\t\t\t$order_by_str = \" \" . $fld_name . \" \" . $fld_value;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\n\n\t\t\t}//end switch\t\t\t\n\n\n\n\t\t}\n\n\t\t\n\n\t\t$group_by_qry = \"\";\n\n\t\t\n\n\t\t\n\n\t\tif($start == 1)\n\n\t\t$str .= \")\";\n\n\t\t\n\n\t\t$qry = $obj->search_sql . $str . $group_by_qry . $order_by_str;\n\n\t\t\n\n\t\t$_SESSION[$obj->srch_ses_qry_str] = $qry;\n\n\t\t\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::frame_search_sql() - Return Value : ', 'Frames the search query in session and returns void');\n\n\n\n\t}", "function BeforeQueryView(&$strSQL, &$strWhereClause, &$pageObject)\n{\n\n\t\t$strSQL = calendar_getDbValuesById($_REQUEST[\"editid1\"], $pageObject->connection);\n;\t\t\n}", "function fn_advanced_import_filter_out_null_values(&$row)\n{\n foreach ($row as $key => $value) {\n\n if ($value === null) {\n unset($row[$key]);\n }\n }\n\n return true;\n}", "function Page_FilterValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function Page_FilterValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function ValidRow($row) {\n\t$ValidRow = TRUE;\n\treturn $ValidRow;\n}", "protected function check($item){\r\n\tif((string)$item->row->attributes()->system_type=='bool'){\r\n\t\t$postdata = !isset($this->sourceData['meta_value_'.(string)$item->row->name]) ? 0: 1;\r\n\t}else{\r\n\t\t$postdata = (string)$item->row->attributes()->system_type=='password' ? array($this->sourceData['meta_value_'.(string)$item->row->name], $this->sourceData['meta_value_'.(string)$item->row->name.'_check']):$this->sourceData['meta_value_'.(string)$item->row->name];\r\n\t}\r\n\tif((int)$item->row->attributes()->validate == 1){\r\n\t\t$ret = DataValidator::validateData($postdata, (string)$item->row->attributes()->system_type, (int)$item->row->attributes()->size) === true ? 'ok': 'v';\r\n\t\t\r\n\t\t$tpref = Lng::get('system/mwms_meta_datatype_operators');\r\n\t\t\r\n\t\t$operator = $tpref[(string)$item->row->attributes()->system_type];\r\n\t\t\r\n\t\tif((int)$item->row->attributes()->unique == 1 && $ret == 'ok'){\r\n\t\t\t$ret = $ret=='ok' && $this->unique($item, $this->sourceData['meta_value_'.(string)$item->row->name], $operator) ? 'ok': 'u';\r\n\t\t}\r\n\t\t\r\n\t\tif(!$ret){\r\n\t\t\t$show = is_array($postdata) ? implode(\"/\", $postdata): $postdata;\r\n\t\t\t//echo $item->row->title.'(@'.$item->row->name.') -> '.$item->row->attributes()->system_type.' -> '.$postdata.'<br />';\r\n\t\t}\r\n\t\t\r\n\t\treturn $ret;\r\n\t}else{\r\n\t\treturn 'ok';\r\n\t}\r\n}", "function get_form_filter() {\n\n $val_ = new OrSysvalue();\n if (!is_null($var_)) {\n foreach ($val_->filter AS $id => $value) {\n //echo '$id [ ' . $id . ' ] = [ ' . $value . ' ] <br>' ;\n if ($id != 'filter_by') {\n if (!$this->filter_use[$id]) {\n $my_filter = new OrFieldHidden($id, 'val_filter[' . $id . ']');\n $my_filter->OP_[auto_post]->set(true);\n $my_filter_tag .= $my_filter->get_tag();\n\n if ($val_->compare[$id] == 'BETWEEN' OR $val_->message[$id . '_II'] != '') {\n $my_filter = new OrFieldHidden($id . '_II', 'val_msg[' . $id . '_II]');\n $my_filter->OP_[auto_post]->set(true);\n $my_filter_tag .= $my_filter->get_tag();\n }\n }\n $my_compare = new OrFieldHidden('val_compare_' . $id . '_', 'val_compare[' . $id . ']');\n $my_compare->OP_[auto_post]->set(true);\n $my_filter_tag .= $my_compare->get_tag();\n }\n }\n }\n\n\n /* $my_table = new OrTable('table_query');\n $my_table->OP_[align_table]->set('center');\n $my_table->OP_[class_name]->set('tbl_body');\n $my_table->set_col(' ค้นหา ' . $this->get_control_filter() . ' เรียง ' . $this->get_control_order() . ' ' . $this->get_button_filter() . $my_filter_tag );\n $my_table->set_row(); */\n $my_table = (' ค้นหา ' . $this->get_control_filter() . ' เรียง ' . $this->get_control_order() . ' ' . $this->get_button_filter() . $my_filter_tag );\n return $my_table;\n }", "protected function _query($value)\n {\n /**\n * Check for an adapter being defined. if not, fetch the default adapter.\n */\n if ($this->_adapter === null) {\n $this->_adapter = Zend_Db_Table_Abstract::getDefaultAdapter();\n if (null === $this->_adapter) {\n // require_once 'Zend/Validate/Exception.php';\n throw new Zend_Validate_Exception('No database adapter present');\n }\n }\n\n /**\n * Build select object\n */\n $select = new Zend_Db_Select($this->_adapter);\n $select->from($this->_table, array($this->_field), $this->_schema)\n ->where($this->_adapter->quoteIdentifier($this->_field).' = ?', $value);\n if ($this->_exclude !== null) {\n if (is_array($this->_exclude)) {\n $select->where($this->_adapter->quoteIdentifier($this->_exclude['field']).' != ?', $this->_exclude['value']);\n } else {\n $select->where($this->_exclude);\n }\n }\n $select->limit(1);\n\n /**\n * Run query\n */\n $result = $this->_adapter->fetchRow($select, array(), Zend_Db::FETCH_ASSOC);\n\n return $result;\n }", "function filter_TR_By_S($SEDE,$TABLE_R)\n{\n global $mysqli;\n $TRES = $TABLE_R;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,ps,pca,pcg,gatb,verbal,numer,indice FROM \" .$TRES. \" where sede = ?\");\n $parametros = array('i', &$SEDE);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "protected function filter($rows){\n\n if(request()->has('name') && request()->get('name') !=\"\"){\n $rows = $rows->where('name',request()->get('name')) ; \n }\n return $rows;\n }", "function validate_fishbowl_item($mysqli, $item)\n{\n\tif ( empty($item[\"date\"])\n\t || !is_numeric($item[\"log_type\"]) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "private function add($database) {\n\n \t\t// loop through tuple objects\n \t\tforeach($database->getTables() as $table){\n\n\t \t\t// insertDB() and exists() take a filter array which is filled with strings representing\n\t \t\t// attributes in the table that can be diferent (or are not to be compared)\n\t \t\t$existFilter = array('ExhibitionReferenceNo','EventReferenceNo','ArtistReferenceNo', 'ReceptionReferenceNo', 'BodyContent');\n\t \t\t$insertFilter= array('ExhibitionReferenceNo','EventReferenceNo','ArtistReferenceNo', 'ReceptionReferenceNo', 'GalleryID', \n\t \t\t\t\t\t\t\t 'EmployeeID', 'DepartmentID', 'KeywordID', 'StaticPageID', 'ClassroomPageID', 'DepartmentReferenceNo', 'SubNavLinkID', 'NavID', 'FooterLinkID'\n\t \t\t\t\t\t\t\t);\n\t \t\t$artworkFilter = array('ArtworkReferenceNo');\n\t \t\t$artworkExistFilter = array('ArtworkReferenceNo', 'Title');\n\t \t\t$eventExistFilter = array('StartDate', 'EndDate', 'StartTime', 'EndTime', 'Canceled(bool)', 'Description','RegistrationFull(bool)');\n\t \t\t$eventInsertFilter = array('StartDate', 'EndDate', 'StartTime', 'EndTime', 'Canceled(bool)', 'RegistrationFull(bool)');\n\t \t\t$navCategoryFilter = array('NavCategoryID');\n\t \t\t$navCategoryLinkFilter = array('NavCategoryLinkID');\n\n \t\t\tif($table->getTableName()=='EVENT'){\n \t\t\t\t$existFilter = array_merge($existFilter, $eventExistFilter);\n \t\t\t\t$insertFilter = array_merge($insertFilter, $eventInsertFilter);\n \t\t\t}\n\n \t\t\tif($table->getTableName()=='ARTWORK'){\n \t\t\t\t$existFilter = array_merge($existFilter, $artworkExistFilter);\n \t\t\t\t$insertFilter = array_merge($insertFilter, $artworkFilter);\n \t\t\t}\n\n \t\t\tif($table->getTableName() == 'NAV_CATEGORY'){\n \t\t\t\t$insertFilter = array_merge($insertFilter, $navCategoryFilter);\n \t\t\t}\n\n \t\t\tif($table->getTableName() == 'NAV_CATEGORY_LINK'){\n \t\t\t\t$insertFilter = array_merge($insertFilter, $navCategoryLinkFilter);\n \t\t\t}\n\n \t\t\tforeach ($table->getTuples() as $tuple){\n\t \t\t\t$id=$this->exists($tuple->getTableName(), $tuple->getTuple(), $existFilter);\n\n\t \t\t\tif(!$id){\n\t \t\t\t\t$id = $this->insertDb($tuple->getTableName(), $tuple->getTuple(), $insertFilter, $isrefTable=FALSE);\n\t \t\t\t}\n\t \t\t\telseif ($id){\n\t \t\t\t\techo \"<br>exists, heres the id: \". $id.\" <br>\";\n\t \t\t\t}\n\n\t \t\t\t$tuple->setPK($id);\n\t \t\t\t}\n\n \t\t}\n\n\n \t}", "function dbWhereVars() {\n\n foreach ($this->fields() as $f) {\n if ($this->$f === false) continue;\n $this->db->where($this->model.'.'.$f,$this->$f);\n }\n\n }", "public function checkData()\n\t{\n\t\t$result = parent::checkData();\n\t\t$query = (new \\App\\Db\\Query())->from($this->baseTable)->where(['server_id' => $this->get('server_id'), 'user_name' => $this->get('user_name')]);\n\t\tif ($this->getId()) {\n\t\t\t$query->andWhere(['<>', 'id', $this->getId()]);\n\t\t}\n\t\treturn !$result && $query->exists() ? 'LBL_DUPLICATE_LOGIN' : $result;\n\t}", "private function get_filterItemCObj( $uid, $value )\n {\n static $firstLoop = true;\n static $loop = array();\n static $conf_array = null;\n\n//// #56339\n//$this->pObj->dev_var_dump( $uid, $this->markerArray['###UID###'] );\n//$this->pObj->dev_var_dump( $uid, $value );\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n if ( !isset( $loop[ $this->curr_tableField ] ) )\n {\n $loop[ $this->curr_tableField ] = 0;\n }\n else\n {\n $loop[ $this->curr_tableField ] ++;\n }\n if ( $loop[ $this->curr_tableField ] < 2 )\n {\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'begin' );\n }\n\n // Item class\n // Get TS configuration of the current filter / tableField\n $conf_name = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field ];\n $conf_array = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ];\n // #41753.01, 121010, dwildt, 4-\n// if($conf_name == 'CATEGORY_MENU')\n// {\n// $conf_array = $this->pObj->objJss->class_onchange($conf_name, $conf_array, $this->row_number);\n// }\n // #41753.01, 121010, dwildt, 10+\n switch ( true )\n {\n case( $conf_name == 'CATEGORY_MENU' ):\n case( $conf_name == 'TREEVIEW' ):\n $conf_array = $this->pObj->objJss->class_onchange( $conf_name, $conf_array, $this->row_number );\n break;\n default:\n // Follow the workflow\n break;\n }\n\n//var_dump( __METHOD__, __LINE__, $value, $conf_array );\n // DRS :TODO:\n if ( $firstLoop && $this->pObj->b_drs_devTodo )\n {\n $prompt = 'Check AJAX ###ONCHANGE###';\n t3lib_div::devlog( '[INFO/TODO] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS :TODO:\n\n $this->markerArray[ '###CLASS###' ] = $this->replace_itemClass( $conf_array, '###CLASS###' );\n $this->markerArray[ '###STYLE###' ] = $this->replace_itemStyle( $conf_array, '###STYLE###' );\n $this->markerArray[ '###TITLE###' ] = $this->replace_itemTitle( '###TITLE###' );\n $this->markerArray[ '###URL###' ] = $this->replace_itemUrl( $conf_array, $uid, '###URL###' );\n // #i0129, 150218, dwildt, 1+\n $this->markerArray[ '###ID###' ] = $table . '__' . $field . '__' . $uid;\n $this->markerArray[ '###ITEM_SELECTED###' ] = $this->replace_itemSelected( $conf_array, $uid, $value, '###ITEM_SELECTED###' );\n // #40354, #40354, 4.1.7, 1+\n $this->markerArray[ '###TABLE.FIELD###' ] = $this->nicePiVar[ 'key_piVar' ];\n\n // 3.9.20: Be careful: Method need 10 milliseconds. Can be a\n // performance problem in case of a lot records!\n //$conf_array = $this->replace_marker( $conf_array );\n // Get the COA configuration for the value\n // SWITCH first item\n switch ( true )\n {\n case( $uid == $conf_array[ 'first_item.' ][ 'option_value' ] ):\n $cObj_name = $conf_array[ 'first_item.' ][ 'cObject' ];\n $cObj_conf = $conf_array[ 'first_item.' ][ 'cObject.' ];\n break;\n default:\n $cObj_name = $conf_array[ 'wrap.' ][ 'item.' ][ 'cObject' ];\n $cObj_conf = $conf_array[ 'wrap.' ][ 'item.' ][ 'cObject.' ];\n break;\n }\n // SWITCH first item\n // Get the COA configuration for the value\n\n $this->cObjData_setFlagDisplayInCaseOfNoCounting();\n\n $item = $this->pObj->cObj->cObjGetSingle( $cObj_name, $cObj_conf );\n\n // 3.9.20\n // 3.9.20: Be careful: Method need 10 milliseconds. Can be a\n // performance problem in case of a lot records!\n $item = $this->pObj->cObj->substituteMarkerArray( $item, $this->markerArray );\n\n // 3.9.20: Code is moved from above\n // Workaround: remove ###ONCHANGE###\n $item = str_replace( ' class=\" ###ONCHANGE###\"', null, $item );\n if ( $firstLoop && $this->pObj->b_drs_devTodo )\n {\n $prompt = 'class=\" ###ONCHANGE###\" is removed. Check the code!';\n t3lib_div::devlog( '[WARN/TODO] ' . $prompt, $this->pObj->extKey, 2 );\n }\n // Workaround: remove ###ONCHANGE###\n\n $this->cObjData_unsetFlagDisplayInCaseOfNoCounting();\n\n // maxItemsTagEndBegin\n // DRS :TODO:\n if ( $firstLoop && $this->pObj->b_drs_devTodo )\n {\n $prompt = 'Check maxItemsPerRow!';\n t3lib_div::devlog( '[INFO/TODO] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS :TODO:\n $item = $this->get_maxItemsTagEndBegin( $item );\n // maxItemsTagEndBegin\n\n\n $firstLoop = false;\n\n if ( $loop[ $this->curr_tableField ] < 2 )\n {\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'end' );\n }\n return $item;\n }", "function mswGetTableData($table,$row,$val,$and='',$params='*') {\n $q = mysql_query(\"SELECT $params FROM `\".DB_PREFIX.$table.\"`\n WHERE `\".$row.\"` = '{$val}'\n $and\n LIMIT 1\n \") or die(mswMysqlErrMsg(mysql_errno(),mysql_error(),__LINE__,__FILE__));\n return mysql_fetch_object($q);\n}", "function getRows($table,$field=\"\",$value=\"\")\n\t{\n\t\t\n\t\t$q=\"SELECT * From \".$table;\n\t\tif(strlen($field)>0)\n\t\t\t$q.=\" WHERE `\".$field.\"`='\".$value.\"'\";\n\t\treturn mysql_query($q);\n\t}", "function process($dataSet)\r\n\t{\r\n\t\t$val = $dataSet->get($this->fieldName);\r\n\t\tif(!isset($val))\r\n\t\t{\r\n\t\t\t$this->setError($dataSet);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function inputted_to_sql_for_search($row,$i)\n\t{\n\t\treturn NULL;\n\t}", "function get_filtered_data($adviserId=\"\"){ \n $this->make_query($adviserId); \n $query = $this->adviceprocess_db->get(); \n return $query->num_rows(); \n }", "function chk_add_process01($table,$field_chk,$data_chk){\n $query = $this->db->get_where($table,array($field_chk => $data_chk));\n if($query->num_rows()!=0){return FALSE;}else{return TRUE;}\n }", "private function _validData($data){\n\t\t$columnsLen = array(\n\t\t\t\t\t\t\t'nro_pedido' => 6,\n\t\t\t\t\t\t\t'id_factura_pagos' => 1,\n\t\t\t\t\t\t\t'valor' => 1,\n\t\t\t\t\t\t\t'concepto' => 1,\n\t\t\t\t\t\t\t'fecha_inicio' => 0,\n\t\t\t\t\t\t\t'fecha_fin' => 0,\n\t\t\t\t\t\t\t'id_user' => 1\n\t\t);\n\t\treturn $this->_checkColumnsData($columnsLen, $data);\n\t}", "function local_powerprouserexport_get_user_data($lastrun = 0, $data = null) {\n global $DB;\n\n $params = array();\n $whereclause = '';\n\n if ($data) {\n $params['timestart'] = $data->timestart;\n $params['timeend'] = $data->timeend;\n $whereclause = \"u.timemodified BETWEEN :timestart and :timeend\";\n } else {\n $params['lastrun'] = $lastrun;\n $whereclause = \"u.timemodified > :lastrun\";\n }\n\n $sql = \"\n SELECT *\n FROM {user} AS u\n WHERE $whereclause\n \";\n\n/*\n print_object($params);\n echo \"<pre>$sql</pre>\";\n*/\n return $DB->get_recordset_sql($sql, $params);\n}", "function IsRecordEditable($values, $isEditable, $table = \"\")\n\t{\n\t\tglobal $strTableName;\n\t\tif($table == \"\")\n\t\t\t$table = $strTableName;\n\t\tif($table == \"demo_user\")\n\t\t{\n\t\t\t\n\n$lk=$values[\"Inactive\"]; \n\n//$lk=DBLookup(\"SELECT Inactive FROM inventorydate WHERE IDate='$sd'\");\n\nif ($lk==1)\n return false;\nelse\n return true;\n\n\n\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n\n//return $isEditable;;\n\t\t}\n\t\tif($table == \"indschedule\")\n\t\t{\n\t\t\t\n\n\n//$lk=$values[\"Locked\"];\n\n\n\n//if ($lk == 1)\n// return false;\n//else\n return true;;\n\t\t}\n\t\tif($table == \"loans\")\n\t\t{\n\t\t\t$eid=$values[\"EmployeeID\"] ;\n\n$lk=DBLookup(\"SELECT Inactive FROM demo_user WHERE EmployeeID='$eid'\");\n\nif ($lk==1)\n return false;\nelse\n return true;\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n\n//return $isEditable;;\n\t\t}\n\t\tif($table == \"payroll\")\n\t\t{\n\t\t\t\n$lk=$values[\"Locked\"];\n\nif ($lk == 1)\n return false;\nelse\n return true;\n//return $isEditable;\n;\n\t\t}\n\t\tif($table == \"payrolltab\")\n\t\t{\n\t\t\t\n\n\n$lk=$values[\"Locked\"];\n\nif ($lk == 1)\n return false;\nelse\n return true;;\n\t\t}\n\t\tif($table == \"earningadjustment\")\n\t\t{\n\t\t\t$eid=$values[\"EmployeeID\"] ;\n\n$lk=DBLookup(\"SELECT Inactive FROM demo_user WHERE EmployeeID='$eid'\");\n\nif ($lk==1)\n return false;\nelse\n return true;\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n\n//return $isEditable;;\n\t\t}\n\t\tif($table == \"payrollearnadj\")\n\t\t{\n\t\t\t$fr=$values[\"FromDate\"];\n$to=$values[\"ToDate\"]; \n\n$lk=DBLookup(\"SELECT Locked FROM payrolltab WHERE FromDate='$fr' and ToDate='$to'\");\n\nif ($lk==1)\n{\n//$pageObject->setMessage(\"Date is already Locked!\");\n return false;\n}\nelse {\n return true;\n\n}\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n\n//return $isEditable;;\n\t\t}\n\t\tif($table == \"payrolldeductions\")\n\t\t{\n\t\t\t$fr=$values[\"FromDate\"];\n$to=$values[\"ToDate\"]; \n\n$lk=DBLookup(\"SELECT Locked FROM payrolltab WHERE FromDate='$fr' and ToDate='$to'\");\n\nif ($lk==1)\n{\n//$pageObject->setMessage(\"Date is already Locked!\");\n return false;\n}\nelse {\n return true;\n\n}\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n\n//return $isEditable;;\n\t\t}\n\t\tif($table == \"payrollstatutories\")\n\t\t{\n\t\t\t$fr=$values[\"FromDate\"];\n$to=$values[\"ToDate\"]; \n\n$lk=DBLookup(\"SELECT Locked FROM payrolltab WHERE FromDate='$fr' and ToDate='$to'\");\n\nif ($lk==1)\n{\n//$pageObject->setMessage(\"Date is already Locked!\");\n return false;\n}\nelse {\n return true;\n\n}\n//return $isEditable;;\n\t\t}\n\t\tif($table == \"payrolltax\")\n\t\t{\n\t\t\t\n$fr=$values[\"FromDate\"];\n$to=$values[\"ToDate\"]; \n\n$lk=DBLookup(\"SELECT Locked FROM payrolltab WHERE FromDate='$fr' and ToDate='$to'\");\n\nif ($lk==1)\n{\n//$pageObject->setMessage(\"Date is already Locked!\");\n return false;\n}\nelse {\n return true;\n\n};\n\t\t}\n\t\tif($table == \"payroll21\")\n\t\t{\n\t\t\t\n return true;\n//return $isEditable;\n;\n\t\t}\n\t\tif($table == \"leaves11\")\n\t\t{\n\t\t\t\n\n$lkd=$values[\"Locked\"];\n\nif($lkd==1) {\n\nreturn $isEditable=false;\n\n}\n\nelse return $isEditable=true;;\n\t\t}\n\t\tif($table == \"leavesapp\")\n\t\t{\n\t\t\t\n\n$lkd=$values[\"Locked\"];\n\nif($lkd==1) {\n\nreturn $isEditable=false;\n\n}\n\nelse return $isEditable=true;;\n\t\t}\n\t\tif($table == \"indschedrange\")\n\t\t{\n\t\t\t$eid=$values[\"EmployeeID\"] ;\n\n$lk=DBLookup(\"SELECT Inactive FROM demo_user WHERE EmployeeID='$eid'\");\n\nif ($lk==1)\n return false;\nelse\n return true;\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n\n//return $isEditable;;\n\t\t}\n\t\tif($table == \"empdtr\")\n\t\t{\n\t\t\t\n\n\n//$lk=$values[\"Locked\"];\n\n\n\n//if ($lk == 1)\n// return false;\n//else\n return true;;\n\t\t}\n\t\tif($table == \"overtimefile\")\n\t\t{\n\t\t\t\n$lkd=$values[\"Locked\"];\n\nif($lkd==1) {\n\nreturn $isEditable=false;\n\n}\n\nelse return $isEditable=true;;\n\t\t}\n\t\tif($table == \"payrolldiv\")\n\t\t{\n\t\t\t\n\n$lk=$values[\"Locked\"];\n\nif ($lk == 1)\n return false;\nelse\n return true;;\n\t\t}\n\t\tif($table == \"leavesapp2\")\n\t\t{\n\t\t\t\n$lkd=$values[\"Locked\"];\n\nif($lkd==1) {\n\nreturn $isEditable=false;\n\n}\n\nelse return $isEditable=true;;\n\t\t}\n\t\tif($table == \"filelog\")\n\t\t{\n\t\t\t\n\n\n$lkd=$values[\"Locked\"];\n\nif($lkd==1) {\n\nreturn $isEditable=false;\n\n}\n\nelse return $isEditable=true;;\n\t\t}\n\t\tif($table == \"filelog1\")\n\t\t{\n\t\t\t\n$lkd=$values[\"Locked\"];\n\nif($lkd==1) {\n\nreturn $isEditable=false;\n\n}\n\nelse return $isEditable=true;;\n\t\t}\n\t\tif($table == \"filelog2\")\n\t\t{\n\t\t\t\n$lkd=$values[\"Locked\"];\n\nif($lkd==1) {\n\nreturn $isEditable=false;\n\n}\n\nelse return $isEditable=true;;\n\t\t}\n\t\tif($table == \"filelog3\")\n\t\t{\n\t\t\t;\n\t\t}\n\t\tif($table == \"demo_user_open\")\n\t\t{\n\t\t\t\n\n$lk=$values[\"Inactive\"]; \n\n//$lk=DBLookup(\"SELECT Inactive FROM inventorydate WHERE IDate='$sd'\");\n\nif ($lk==1)\n return false;\nelse\n return true;\n\n\n\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n\n//return $isEditable;;\n\t\t}\n\t\tif($table == \"overtimefileapp\")\n\t\t{\n\t\t\t\n$lkd=$values[\"Locked\"];\n\nif($lkd==1) {\n\nreturn $isEditable=false;\n\n}\n\nelse return $isEditable=true;;\n\t\t}\n\t\tif($table == \"overtimefileapp2\")\n\t\t{\n\t\t\t\n$lkd=$values[\"Locked\"];\n\nif($lkd==1) {\n\nreturn $isEditable=false;\n\n}\n\nelse return $isEditable=true;;\n\t\t}\n\t\tif($table == \"demo_useremp\")\n\t\t{\n\t\t\t\n\n$lk=$values[\"Inactive\"]; \n\n//$lk=DBLookup(\"SELECT Inactive FROM inventorydate WHERE IDate='$sd'\");\n\nif ($lk==1)\n return false;\nelse\n return true;\n\n\n\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n\n//return $isEditable;;\n\t\t}\n\t\tif($table == \"payrolltab1\")\n\t\t{\n\t\t\t\n\n\n$lk=$values[\"Locked\"];\n\nif ($lk == 1)\n return false;\nelse\n return true;;\n\t\t}\n\t\tif($table == \"indscheduleemp\")\n\t\t{\n\t\t\t\n\n\n//$lk=$values[\"Locked\"];\n\n\n\n//if ($lk == 1)\n// return false;\n//else\n return true;;\n\t\t}\n\t\tif($table == \"demo_useractive\")\n\t\t{\n\t\t\t\n\n$lk=$values[\"Inactive\"]; \n\n//$lk=DBLookup(\"SELECT Inactive FROM inventorydate WHERE IDate='$sd'\");\n\nif ($lk==1)\n return false;\nelse\n return true;\n\n\n\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n\n//return $isEditable;;\n\t\t}\n\t\treturn $isEditable;\n\t}" ]
[ "0.64261895", "0.6103079", "0.5991156", "0.55947495", "0.5495172", "0.5435611", "0.540329", "0.540329", "0.53804904", "0.53389007", "0.5333275", "0.5314852", "0.5277785", "0.5204024", "0.52024233", "0.5190446", "0.51651275", "0.5127004", "0.51221544", "0.51164764", "0.5076392", "0.5065434", "0.505565", "0.5053234", "0.5021207", "0.5016069", "0.5011417", "0.5011417", "0.5011417", "0.5011417", "0.5011417", "0.5009766", "0.50036603", "0.4996042", "0.49943617", "0.4970782", "0.4969614", "0.49673292", "0.49664676", "0.49614418", "0.4959736", "0.4958508", "0.49483672", "0.49404553", "0.49373204", "0.49372205", "0.49371335", "0.49338332", "0.49332607", "0.49300113", "0.4921362", "0.49210876", "0.49126062", "0.49123332", "0.49102637", "0.49095935", "0.49047127", "0.49027133", "0.4900371", "0.48984042", "0.48873973", "0.4876953", "0.48688397", "0.4867409", "0.4865612", "0.48578086", "0.4856917", "0.48520744", "0.4847477", "0.48455408", "0.4843254", "0.4842624", "0.48353824", "0.4831451", "0.48277742", "0.48188713", "0.48102954", "0.48095748", "0.48076585", "0.48060492", "0.48060492", "0.480601", "0.48051354", "0.48027226", "0.4797126", "0.47902206", "0.47878826", "0.47790927", "0.47784692", "0.47771427", "0.4769268", "0.47657523", "0.4762264", "0.47589868", "0.47564846", "0.47558916", "0.4750543", "0.47491714", "0.47478476", "0.47471526", "0.4744601" ]
0.0
-1
translate database row to ForumThread
public static function toThread($data) { $thread = new ForumThread(Parse::clean($data->topic)); $thread->setId(Parse::clean($data->id)); $thread->setSubjectFK(Parse::clean($data->subject)); return $thread; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Forum_showThread(&$PAGEDATA, &$id) {\n\trequire_once SCRIPTBASE.'ww.incs/bb2html.php';\n\tWW_addCSS('/ww.plugins/forum/frontend/forum.css');\n\t$script='$(function(){$(\".ratings\").ratings();});';\n\tWW_addScript('ratings/ratings.js');\n\tWW_addInlineScript($script);\n\t$thread=dbRow('select * from forums_threads where id='.$id);\n\t$forum_id=$thread['forum_id'];\n\tif (!$thread || !count($thread)) {\n\t\treturn '<em class=\"error\">Error: this thread does not exist!</em>';\n\t}\n\t$c=Forum_getForumBreadcrumbs($PAGEDATA, $thread['forum_id'])\n\t\t.' &raquo; <a href=\"'.$PAGEDATA->getRelativeUrl().'?forum-f='.$forum_id\n\t\t.'&forum-t='.$id.'\">'.htmlspecialchars($thread['name']).'</a>';\n\t$c.='<table id=\"forum-posts\"><tr><th>Author</th><th>Post</th></tr>';\n\t$posts=dbAll(\n\t\t'select * from forums_posts where thread_id='\n\t\t.$id.' and moderated = 1 order by created_date'\n\t);\n\tforeach ($posts as $post) {\n\t\t$user=User::getInstance($post['author_id']);\n\t\tif ($user) {\n\t\t\t$user_name=$user->get('name');\n\t\t\t$user_id=$post['author_id'];\n\t\t\t$user_email=$user->get('email');\n\t\t}\n\t\telse {\n\t\t\t$user_name='unknown';\n\t\t\t$user_id=0;\n\t\t\t$user_email='';\n\t\t}\n\t\t$c.='<tr p-data=\\'({\"id\":'.$post['id']\n\t\t\t.',\"cdate\":\"'.$post['created_date'].'\"'\n\t\t\t.',\"uid\":'.$post['author_id'].'})\\'>'\n\t\t\t.'<td class=\"user-details\"><a name=\"forum-c-'.$post['id']\n\t\t\t.'\"></a>'.htmlspecialchars($user_name).'</td>'\n\t\t\t.'<td><div class=\"post-header\">Posted: '\n\t\t\t.Core_dateM2H($post['created_date'], 'datetime')\n\t\t\t.'</div></td></tr>';\n\t\t$count_posts=$user_id\n\t\t\t?dbOne(\n\t\t\t\t'select count(id) from forums_posts where author_id='.$user->get('id'),\n\t\t\t\t'count(id)'\n\t\t\t)\n\t\t\t:0;\n\t\t$emailHash=md5(trim(strtolower($user_email)));\n\t\t\n\t\t$c.='<tr><td><img class=\"avatar\" data-uid=\"'.$user_id.'\" />'\n\t\t\t. '<span>Posts: '.$count_posts.'</span>'\n\t\t\t. '<p>Helpfulness:'\n\t\t\t. '<span class=\"ratings\" id=\"forum_user_'.$user_email.'\"'\n\t\t\t. ' type=\"forum_user\">rating</span></p>';\t\t\t\t\n\n\t\t$c.='</td><td class=\"post\">'.bb2html($post['body'])\n\t\t\t.'</td></tr>';\n\t}\n\t$c.='</table>';\n\t// { post form\n\tif (isset($_SESSION['userdata']) && $_SESSION['userdata']['id']) {\n\t\t$c.='<div id=\"forum-post-submission-form\"><script defer=\"defer\">var forum_id='\n\t\t\t.$forum_id.',forum_thread_id='.$id.';</script></div>';\n\t\tWW_addScript('//cdn.ckeditor.com/4.4.3/standard/ckeditor.js');\n\t\tWW_addScript('//cdn.ckeditor.com/4.4.3/standard/adapters/jquery.js');\n\t\tWW_addScript('forum/frontend/forum.js');\n\t}\n\telse {\n\t\t$c.='<div class=\"forum-not-logged-in\">In order to post to this thread,'\n\t\t\t.' you must <a href=\"/_r?type=loginpage\">login'\n\t\t\t.'</a> first.</div>';\n\t}\n\t// }\n\treturn $c;\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}", "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}", "function getThread($threadid)\n {\n\t try {\n\t\t $db = JFusionFactory::getDatabase($this->getJname());\n\n\t\t $query = $db->getQuery(true)\n\t\t\t ->select('topic_id AS threadid, forum_id AS forumid, topic_first_post_id AS postid')\n\t\t\t ->from('#__topics')\n\t\t\t ->where('topic_id = ' . (int) $threadid);\n\n\t\t $db->setQuery($query);\n\t\t $result = $db->loadObject();\n\t } catch (Exception $e) {\n\t\t $result = null;\n\t }\n\t return $result;\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}", "function createThread(&$dbparams, &$contentitem, $forumid, &$status)\n\t{\n\t\ttry {\n\t\t\t//setup some variables\n\t\t\t$userid = $this->getThreadAuthor($dbparams, $contentitem);\n\t\t\t$db = JFusionFactory::getDatabase($this->getJname());\n\t\t\t$subject = trim(strip_tags($contentitem->title));\n\n\t\t\t//prepare the content body\n\t\t\t$text = $this->prepareFirstPostBody($dbparams, $contentitem);\n\n\t\t\t//the user information\n\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->select('username, username_clean, user_colour, user_permissions')\n\t\t\t\t->from('#__users')\n\t\t\t\t->where('user_id = ' . (int) $userid);\n\n\t\t\t$db->setQuery($query);\n\t\t\t$user = $db->loadObject();\n\n\t\t\tif ($dbparams->get('use_content_created_date', false)) {\n\t\t\t\t$timezone = JFusionFactory::getConfig()->get('offset');\n\t\t\t\t$timestamp = strtotime($contentitem->created);\n\t\t\t\t//undo Joomla timezone offset\n\t\t\t\t$timestamp += ($timezone * 3600);\n\t\t\t} else {\n\t\t\t\t$timestamp = time();\n\t\t\t}\n\n\t\t\t$topic = new stdClass();\n\t\t\t$topic->topic_poster = (int) $userid;\n\t\t\t$topic->topic_time = $timestamp;\n\t\t\t$topic->forum_id = $forumid;\n\t\t\t$topic->icon_id = false;\n\t\t\t$topic->topic_visibility = 1;\n\t\t\t$topic->topic_title = $subject;\n\t\t\t$topic->topic_first_poster_name\t= $user->username;\n\t\t\t$topic->topic_first_poster_colour = $user->user_colour;\n\t\t\t$topic->topic_type = 0;\n\t\t\t$topic->topic_time_limit = 0;\n\t\t\t$topic->topic_attachment = 0;\n\n\t\t\t$db->insertObject('#__topics', $topic, 'topic_id' );\n\n\t\t\t$bbcode = $this->helper->bbcode_parser($text);\n\n\t\t\t$post = new stdClass();\n\t\t\t$post->forum_id\t\t\t= (int) $forumid;\n\t\t\t$post->topic_id \t\t= (int) $topic->topic_id;\n\t\t\t$post->poster_id\t\t= (int) $userid;\n\t\t\t$post->icon_id\t\t\t= 0;\n\t\t\t$post->poster_ip\t\t= $_SERVER['REMOTE_ADDR'];\n\t\t\t$post->post_time\t\t= (int) $timestamp;\n\t\t\t$post->post_visibility\t= 1;\n\t\t\t$post->enable_bbcode\t= 1;\n\t\t\t$post->enable_smilies\t= 1;\n\t\t\t$post->enable_magic_url\t= 1;\n\t\t\t$post->enable_sig\t\t= 1;\n\t\t\t$post->post_username\t= $user->username;\n\t\t\t$post->post_subject\t\t= $subject;\n\t\t\t$post->post_text\t\t= $bbcode->text;\n\t\t\t$post->post_checksum\t= md5($bbcode->text);\n\t\t\t$post->post_attachment\t= 0;\n\t\t\t$post->bbcode_bitfield\t= $bbcode->bbcode_bitfield;\n\t\t\t$post->bbcode_uid\t\t= $bbcode->bbcode_uid;\n\t\t\t$post->post_postcount\t= 1;\n\t\t\t$post->post_edit_locked\t= 0;\n\n\t\t\t$db->insertObject('#__posts', $post, 'post_id');\n\n\t\t\t$topic->topic_first_post_id\t\t\t= $post->post_id;\n\t\t\t$topic->topic_last_post_id\t\t\t= $post->post_id;\n\t\t\t$topic->topic_last_post_time\t\t= (int) $timestamp;\n\t\t\t$topic->topic_last_poster_id\t\t= (int) $userid;\n\t\t\t$topic->topic_last_poster_name\t\t= $user->username;\n\t\t\t$topic->topic_last_poster_colour\t= $user->user_colour;\n\t\t\t$topic->topic_last_post_subject\t\t= (string) $subject;\n\t\t\t$topic->topic_posts_approved = 1;\n\n\t\t\t$db->updateObject('#__topics', $topic, 'topic_id' );\n\n\t\t\tif ($dbparams->get('use_content_created_date', false)) {\n\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t->select('forum_last_post_time')\n\t\t\t\t\t->from('#__forums')\n\t\t\t\t\t->where('forum_id = ' . (int) $forumid);\n\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$forum_last_post_time = $db->loadResult();\n\n\t\t\t\t//only update the last post for the topic if it really is newer\n\t\t\t\t$updateLastPost = ($timestamp > $forum_last_post_time) ? true : false;\n\t\t\t} else {\n\t\t\t\t$updateLastPost = true;\n\t\t\t}\n\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->update('#__forums');\n\n\t\t\tif($updateLastPost) {\n\t\t\t\t$query->set('forum_last_post_id = ' . $db->quote($post->post_id))\n\t\t\t\t\t->set('forum_last_post_subject = ' . $db->quote($subject))\n\t\t\t\t\t->set('forum_last_post_time = ' . (int) $timestamp)\n\t\t\t\t\t->set('forum_last_poster_id = ' . (int) $userid)\n\t\t\t\t\t->set('forum_last_poster_name = ' . $db->quote($user->username))\n\t\t\t\t\t->set('forum_last_poster_colour = ' . $db->quote($user->user_colour));\n\t\t\t}\n\n\t\t\t//update some stats\n\t\t\t$query->set('forum_posts_approved = forum_posts_approved + 1')\n\t\t\t\t->set('forum_topics_approved = forum_topics_approved + 1')\n\t\t\t\t->where('forum_id = ' . $db->quote($forumid));\n\n\t\t\t$db->setQuery($query);\n\t\t\t$db->execute();\n\n\t\t\t//update some stats\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->update('#__users')\n\t\t\t\t->set('user_posts = user_posts + 1')\n\t\t\t\t->where('user_id = ' . (int) $userid);\n\n\t\t\t$db->setQuery($query);\n\t\t\t$db->execute();\n\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->update('#__config')\n\t\t\t\t->set('config_value = config_value + 1')\n\t\t\t\t->where('config_name = ' . $db->quote('num_topics'));\n\n\t\t\t$db->setQuery($query);\n\t\t\t$db->execute();\n\n\t\t\tif(!empty($topic->topic_id) && !empty($post->post_id)) {\n\t\t\t\t//add information to update forum lookup\n\t\t\t\t$status['threadinfo']->forumid = $forumid;\n\t\t\t\t$status['threadinfo']->threadid = $topic->topic_id;\n\t\t\t\t$status['threadinfo']->postid = $post->post_id;\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\t$status['error'] = $e->getMessage();\n\t\t}\n\t}", "function show_thread_and_context($thread, $user, $i) {\n $thread_forum = BoincForum::lookup_id($thread->forum);\n if (!$thread_forum) return;\n if (!is_forum_visible_to_user($thread_forum, $user)) return;\n $owner = BoincUser::lookup_id($thread->owner);\n $j = $i % 2;\n echo \"<tr class=row$j><td>\\n\";\n switch($thread_forum->parent_type) {\n case 0:\n $category = BoincCategory::lookup_id($thread_forum->category);\n show_forum_title($category, $thread_forum, $thread, true);\n break;\n case 1:\n show_team_forum_title($thread_forum, $thread);\n break;\n }\n echo '\n </td><td class=\"numbers\">'.($thread->replies+1).'</td>\n <td>'.user_links($owner).'</td>\n <td class=\"numbers\">'.$thread->views.'</td>\n <td class=\"lastpost\">'.time_diff_str($thread->timestamp, time()).'</td>\n </tr>\n ';\n}", "protected function _translateRow(array $data, $key = null)\n {\n $newData = array();\n\n $newData['topic_id'] = $data['thread_id'];\n if( $data['forum_id'] )\n $newData['forum_id'] = $data['forum_id'];\n $newData['user_id'] = $data['user_id'];\n $newData['title'] = $data['title'];\n $newData['closed'] = $data['is_closed'];\n $newData['creation_date'] = $this->_translateTime($data['time_stamp']);\n $newData['modified_date'] = $this->_translateTime($data['time_update']);\n $newData['sticky'] = $data['order_id'];\n $newData['lastposter_id'] = $data['last_user_id'] ? $data['last_user_id'] : $data['user_id'];\n $newData['view_count'] = $data['total_view'];\n $type_id = '';\n //FIND WHEATER THIS FORUM IS PAGES FORUM AND FIND PAGES TYPE\n if( !$data['forum_id'] ) {\n $type_id = $this->getFromDb()->select()\n ->from($this->getfromPrefix() . 'pages', 'type_id')\n ->where('page_id = ?', $data['group_id'])\n ->query()\n ->fetchColumn();\n }\n $albumTitle = 'Forum Photos';\n $isGroupForum = false;\n if( !empty($type_id) ) {\n\n $newData['group_id'] = $data['group_id'];\n $albumTitle = 'Group Photos';\n $isGroupForum = true;\n //INSERT GROUP FORUM TOPIC\n $this->getToDb()->insert('engine4_group_topics', $newData);\n } else {\n //INSERT THE FORUM TOPIC\n $this->getToDb()->insert('engine4_forum_topics', $newData);\n }\n\n $topic_id = $this->getToDb()->lastInsertId();\n //FIND ALL THE POST OF THIS TOPIC\n $posts = $this->getFromDb()->select()\n ->from($this->getfromPrefix() . 'forum_post', '*')\n ->where('thread_id = ?', $data['thread_id'])\n ->query()\n ->fetchAll();\n $newPostData = array();\n $count = 0;\n //INSERT ALL THE POST OF TOPIC\n foreach( $posts as $post ) {\n //GETTING TEXT\n $text = $this->getFromDb()->select()\n ->from($this->getfromPrefix() . 'forum_post_text', 'text')\n ->where('post_id = ?', $post['post_id'])\n ->query()\n ->fetchColumn();\n\n if( is_null($text) || $text === false )\n $text = '';\n\n $userInfo = array(\n 'user_id' => $post['user_id'],\n 'time_stamp' => $post['time_stamp'],\n 'text' => $text,\n 'item_id' => $post['post_id'],\n 'album_title' => $albumTitle,\n 'album_type' => 'forum',\n 'categoryId' => 'forum'\n );\n if( !empty($type_id) ) {\n $userInfo['page_id'] = $data['group_id'];\n $userInfo['album_table'] = 'group_albums';\n }\n //FIND THE POST BODY\n $body = $this->getBody($userInfo);\n if( is_null($body) )\n $body = '';\n\n $newPostData['post_id'] = $post['post_id'];\n $newPostData['topic_id'] = $data['thread_id'];\n if( $data['forum_id'] )\n $newPostData['forum_id'] = $data['forum_id'];\n $newPostData['user_id'] = $post['user_id'];\n $newPostData['body'] = $body;\n $newPostData['creation_date'] = $this->_translateTime($post['time_stamp']);\n $newPostData['modified_date'] = $post['update_time'] ? $this->_translateTime($post['update_time']) : $this->_translateTime($post['time_stamp']);\n// INSERT THE FORUM POST\n if( $isGroupForum ) {\n $newPostData['group_id'] = $data['group_id'];\n $this->getToDb()->insert('engine4_group_posts', $newPostData);\n } else {\n $this->getToDb()->insert('engine4_forum_posts', $newPostData);\n }\n $post_id = $this->getToDb()->lastInsertId();\n //UPDATE THE COUNT OF POST INTO THE TOPIC\n if( $isGroupForum ) {\n $this->getToDb()->update('engine4_group_topics', array(\n 'lastpost_id' => $post_id,\n 'post_count' => ++$count\n ), array(\n 'topic_id = ?' => $topic_id\n ));\n } else {\n $this->getToDb()->update('engine4_forum_topics', array(\n 'lastpost_id' => $post_id,\n 'post_count' => ++$count\n ), array(\n 'topic_id = ?' => $topic_id,\n 'forum_id = ?' => $data['forum_id'],\n ));\n }\n }\n //PREPARE AN ARRAY FOR TOPIC WATCHES\n $newWatchData = array();\n if( $data['forum_id'] )\n $newWatchData['resource_id'] = $data['forum_id'];\n\n $newWatchData['topic_id'] = $data['thread_id'];\n $newWatchData['user_id'] = $data['user_id'];\n $newWatchData['watch'] = 1;\n if( $isGroupForum ) {\n $newWatchData['resource_id'] = $data['group_id'];\n $this->getToDb()->insert('engine4_group_topicwatches', $newWatchData);\n } else {\n $this->getToDb()->insert('engine4_forum_topicwatches', $newWatchData);\n }\n\n if( $data['forum_id'] ) {\n //PREPARE AN ARRAY FOR TOPIC VIEW\n $newTopicViewsData = array();\n $newTopicViewsData['user_id'] = $data['user_id'];\n $newTopicViewsData['topic_id'] = $data['thread_id'];\n $newTopicViewsData['last_view_date'] = $this->_translateTime($data['time_stamp']);\n $this->getToDb()->insert('engine4_forum_topicviews', $newTopicViewsData);\n //FIND THE FORUM DETAIL\n $forums = $this->getFromDb()->select()\n ->from($this->getfromPrefix() . 'forum', '*')\n ->where('forum_id = ?', $data['forum_id'])\n ->where('thread_id = ?', $data['thread_id'])\n ->query()\n ->fetchAll();\n //UPDATE THE POST COUNT INTO THE FORUM\n foreach( $forums as $forum ) {\n $this->getToDb()->update('engine4_forum_forums', array(\n 'topic_count' => $forum['total_thread'],\n 'post_count' => $forum['total_post'] + 1,\n 'lastpost_id' => $post_id,\n 'lastposter_id' => $forum['last_user_id'],\n ), array(\n 'forum_id = ?' => $data['forum_id'],\n ));\n }\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 Forum() {\n\t $this->sql .= \" UNION\t\n\t SELECT 3, forum_id, thread_id, post_id, post_subject, LEFT(post_message, \".$this->nahlad.\") as post_message, post_datestamp\tFROM `fusion_posts`\n\t\t WHERE '\".$this->a.\"' > post_datestamp AND post_datestamp > '\".$this->b.\"'\tAND post_author = '\".$this->id.\"'\n\t \";\n\t}", "final public function post_thread(Thread $thread) {\r\n\t\tif ($this->user_id && $thread->thread_text && $thread->type) {\r\n\t\t\tif ($thread->type == 1) {\r\n\t\t\t\t$sql = \"INSERT INTO `threads` (thread_text, author_id, date_posted, type, date_play) VALUES ('$thread->thread_text', '$this->user_id', NOW(), '$thread->type', '$thread->date_play')\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$sql = \"INSERT INTO `threads` (thread_text, author_id, date_posted, type) VALUES ('$thread->thread_text', '$this->user_id', NOW(), '$thread->type')\";\r\n\t\t\t}\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t\t$thread->thread_id = $this->dbc->insert_id;\r\n\r\n\t\t\t//Push the action\r\n\t\t\t$action = new PostedThread(array(\r\n\t\t\t\t'thread' => $thread,\r\n\t\t\t\t'poster' => clone $this)\r\n\t\t\t);\r\n\t\t\tActionPusher::push_action($action);\r\n\t\t\treturn $thread;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthrow new UnexpectedValueException('UnexpectedValueException occured on method call post_thread');\r\n\t\t}\r\n\t}", "public function getThread()\n {\n return $this->hasOne(InboxThread::className(), ['id' => 'thread_id']);\n }", "public function thread()\n {\n return $this->belongsTo('\\Boxkode\\Forum\\Models\\Thread', 'parent_thread');\n }", "function updateThread(&$dbparams, &$existingthread, &$contentitem, &$status)\n\t{\n\t\ttry {\n\t\t\t$threadid = $existingthread->threadid;\n\t\t\t$postid = $existingthread->postid;\n\n\t\t\t//setup some variables\n\t\t\t$db = JFusionFactory::getDatabase($this->getJname());\n\t\t\t$subject = trim(strip_tags($contentitem->title));\n\n\t\t\t//prepare the content body\n\t\t\t$text = $this->prepareFirstPostBody($dbparams, $contentitem);\n\n\t\t\t$bbcode = $this->helper->bbcode_parser($text);\n\n\t\t\t$timestamp = $dbparams->get('use_content_created_date', false) ? JFusionFactory::getDate($contentitem->created)->toUnix() : time();\n\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->select('post_edit_count')\n\t\t\t\t->from('#__posts')\n\t\t\t\t->where('post_id = ' . $postid);\n\n\t\t\t$db->setQuery($query);\n\t\t\t$count = $db->loadResult();\n\n\t\t\t$post = new stdClass();\n\t\t\t$post->post_subject\t\t= $subject;\n\t\t\t$post->post_text\t\t= $bbcode->text;\n\t\t\t$post->post_checksum\t= md5($bbcode->text);\n\t\t\t$post->bbcode_bitfield\t= $bbcode->bbcode_bitfield;\n\t\t\t$post->bbcode_uid\t\t= $bbcode->bbcode_uid;\n\t\t\t$post->post_edit_time \t= $timestamp;\n\t\t\t$post->post_edit_user\t= $dbparams->get('default_user');\n\t\t\t$post->post_edit_count\t= $count + 1;\n\t\t\t$post->post_id \t\t\t= $postid;\n\t\t\t$db->updateObject('#__posts', $post, 'post_id');\n\n\t\t\t//update the thread title\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->update('#__topics')\n\t\t\t\t->set('topic_title = ' . $db->quote($subject))\n\t\t\t\t->where('topic_id = ' . (int) $threadid);\n\n\t\t\t$db->setQuery($query);\n\t\t\t$db->execute();\n\t\t} catch (Exception $e) {\n\t\t\t$status['error'][] = $e->getMessage();\n\t\t}\n\t}", "function view_thread($user, $title, $timestamp, $forum_type, $text, $edit, $post, $thread, $updated=\"\")\n{\n $author = $user['name'];\n $post_count =0;\n $post_counts = mysql_query(\"SELECT * FROM posts WHERE userid={$user['id']}\");\n \n //Gets the last post from a specific user.\n $last_post = mysql_query(\"SELECT * FROM posts WHERE userid={$user['id']} ORDER by time DESC\");\n $last_post = mysql_fetch_array($last_post);\n fix_time($last_post['time'], $lp_time, $lp_date);\n \n while ($array_count = mysql_fetch_array($post_counts))\n {\n $post_count += 1;\n }\n \n $posts = $user['posts'];\n fix_time($timestamp, $the_time, $date);\n if (isset($updated) == 1 && $updated != \"0000-00-00 00:00:00\" && $updated != \"\")\n {\n fix_time($updated, $up_time, $up_date);\n $update_message = \"Last Edited at $up_time on $up_date <br />\";\n }\n else\n {\n $update_message = \"\";\n }\n print \"\n <table id='connect_tables' width='70%' border='1'>\n <tr>\n <th width='123' rowspan='3' scope='col'><p class='username'>$author</p><br /><h5>$post_count Posts<br />Last post at $lp_time on $lp_date</h5></th>\n <th height='23' scope='col'>$title</th>\n <th colspan='2' rowspan='2' scope='col'>&nbsp;</th>\n <th scope='col'>$date</th>\n </tr>\n <tr>\n <th class='caps' width='378' height='20' scope='col'>$forum_type</th>\n <th width='237' scope='col'>$the_time\";\n if (isset($edit)==1 && $edit == 1)\n {\n print \" <a href='edit_post.php?thread=$thread&post=$post'>Edit</a>\";\n }\n print \"\n </th>\n </tr>\n <tr>\n <td height='100' colspan='4'><p id='edit'>$update_message <h5 id='body_text'>$text</h5></p></td>\n </tr>\n</table>\";\n}", "public function create(int $forumId, int $userId, string $title, string $body): \\Gazelle\\ForumThread {\n $db = new \\Gazelle\\DB;\n $db->relaxConstraints(true);\n self::$db->prepared_query(\"\n INSERT INTO forums_topics\n (ForumID, Title, AuthorID, LastPostAuthorID)\n Values (?, ?, ?, ?)\n \", $forumId, $title, $userId, $userId\n );\n $thread = $this->findById(self::$db->inserted_id());\n $postId = $thread->addPost($userId, $body);\n $db->relaxConstraints(false);\n (new \\Gazelle\\Stats\\User($userId))->increment('forum_thread_total');\n return $thread;\n }", "public function viewtopicAction($thread_id){\n\t\t$per_page = 20;\n\n\t\t# Chargement du manager\n\t\t$this->load_manager('forum', 'base_app');\n\n\t\t# On commpte le nombre de message\n\t\t$NbMessage = $this->app->db->count(PREFIX . 'forum_message', array('thread_id =' => $thread_id));\n\n\t\t# On recupere les messages\n\t\t$Messages = $this->manager->forum->getMessagesByThreadId($thread_id, $per_page, getOffset($per_page));\n\n\t\t# Recuperation infos topic\n\t\t$Thread = new Basethread($this->app->db->get_one(PREFIX . 'forum_thread', array('id =' => $thread_id)));\n\n\t\t# On traite la pagination\n\t\t$Pagination = new Zebra_Pagination();\n\t\t$Pagination->records($NbMessage);\n\t\t$Pagination->records_per_page($per_page);\n\n\t\tif( $this->isModerateur() == true ):\n\t\t\t$this->app->smarty->assign('Forums', $this->manager->forum->getAllForums());\n\t\tendif;\n\t\t\n\t\t# Envoie a smarty\n\t\t$this->app->smarty->assign(array(\n\t\t\t'ctitre'\t\t=>\t'Forum :: ' . $Thread->titre,\n\t\t\t'Messages'\t\t=>\t$Messages,\n\t\t\t'Thread'\t\t=>\t$Thread,\n\t\t\t'Pagination'\t=>\t$Pagination,\n\t\t\t'Forum'\t\t\t=>\tnew myObject( $this->app->db->get_one(PREFIX . 'forum', array('id =' => $Thread->forum_id)) )\n\t\t));\n\n\t\tif( $_SESSION['utilisateur']['id'] != 'Visiteur' ):\n\t\t\t$this->getFormValidatorJs();\n\n\t\t\t$this->app->load_web_lib('markitup/skins/simple/style.css','css');\n\t\t\t$this->app->load_web_lib('markitup/bbcode/style.css','css');\n\t\t\t$this->app->load_web_lib('markitup/jquery.markitup.js','js');\n\t\t\t$this->app->load_web_lib('markitup/bbcode/set.js','js');\n\t\tendif;\n\t\t\n\t\t# Generation de la page\n\t\treturn $this->app->smarty->fetch(BASE_APP_PATH . 'view' . DS . 'forum' . DS . 'viewtopic.tpl');\n\n\t}", "public function createLink() {\n\t\t$sql = \"INSERT INTO\twbb\".WBB_N.\"_thread\n\t\t\t\t\t(boardID, languageID, prefix, topic, time, userID, username, lastPostTime, \n\t\t\t\t\tlastPosterID, lastPoster, replies, views, ratings, rating, attachments,\n\t\t\t\t\tpolls, isAnnouncement, isSticky, isDisabled, everEnabled, isClosed, isDeleted,\n\t\t\t\t\tmovedThreadID, movedTime, deleteTime, deletedBy, deletedByID, deleteReason)\n\t\t\tVALUES\t\t(\".$this->boardID.\",\n\t\t\t\t\t\".$this->languageID.\",\n\t\t\t\t\t'\".escapeString($this->prefix).\"',\n\t\t\t\t\t'\".escapeString($this->topic).\"',\n\t\t\t\t\t\".$this->time.\",\n\t\t\t\t\t\".$this->userID.\",\n\t\t\t\t\t'\".escapeString($this->username).\"',\n\t\t\t\t\t\".$this->lastPostTime.\",\n\t\t\t\t\t\".$this->lastPosterID.\",\n\t\t\t\t\t'\".escapeString($this->lastPoster).\"',\n\t\t\t\t\t\".$this->replies.\",\n\t\t\t\t\t\".$this->views.\",\n\t\t\t\t\t\".$this->ratings.\",\n\t\t\t\t\t\".$this->rating.\",\n\t\t\t\t\t\".$this->attachments.\",\n\t\t\t\t\t\".$this->polls.\",\n\t\t\t\t\t\".$this->isAnnouncement.\",\n\t\t\t\t\t\".$this->isSticky.\",\n\t\t\t\t\t\".$this->isDisabled.\",\n\t\t\t\t\t\".$this->everEnabled.\",\n\t\t\t\t\t\".$this->isClosed.\",\n\t\t\t\t\t\".$this->isDeleted.\",\n\t\t\t\t\t\".$this->threadID.\",\n\t\t\t\t\t\".TIME_NOW.\",\n\t\t\t\t\t\".$this->deleteTime.\",\n\t\t\t\t\t'\".escapeString($this->deletedBy).\"',\n\t\t\t\t\t\".$this->deletedByID.\",\n\t\t\t\t\t'\".escapeString($this->deleteReason).\"')\";\n\t\tWCF::getDB()->sendQuery($sql);\n\t}", "function createThread() {\n\t//create thread\n\techo $_POST[\"title\"] . \"<br/>\";\n\t$db = DB::$connection;\n\t$db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );\n\n\t$sql = \"INSERT INTO threads(title,userid,date) VALUES (?,?,NOW())\";\n\t$stmt = $db->prepare($sql);\n\t$stmt->execute(array(htmlspecialchars($_POST[\"title\"]),$_SESSION['currentUser']));\n\t$trd_id = $db->lastInsertId();\n\techo $trd_id;\n\n\t// post to thread\n\t$db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );\n\n\n\t$threadid = $trd_id;\n\t$postbody = $_POST[\"postbody\"];\n\t$userid = $_SESSION['currentUser'];\n\n\t// post to thread\n\t$sql = 'INSERT INTO posts(threadid,postbody,userid,date) VALUES(?,?,?,NOW())';\n\t$stmt = $db->prepare($sql);\n\t$stmt->execute(array(htmlspecialchars($threadid),($postbody),($userid)));\n\treturn $trd_id;\n}", "function asForumTopics($data) {\r\n$IPBHTML = \"\";\r\n//--starthtml--//\r\n$IPBHTML .= <<<EOF\r\n<tr class='__topic __tid{$data['tid']} <if test=\"!$data['_icon']['is_read']\">unread</if> expandable <if test=\"$data['approved'] != 1\"> moderated</if>' id='trow_{$data['tid']}' data-tid=\"{$data['tid']}\">\n\t<td class='col_f_icon short altrow'>\n\t\t{parse template=\"generateTopicIcon\" group=\"global_other\" params=\"$data['_icon'], $data['_unreadUrl']\"}\n\t</td>\n\t<td>\n\t\t<if test=\"archivedBadge:|:$this->registry->class_forums->fetchArchiveTopicType( $data ) == 'archived'\">\n\t\t\t<span class='ipsBadge ipsBadge_lightgrey'>{$this->lang->words['topic_is_archived']}</span>\n\t\t</if>\n\t\t<if test=\"hasPrefix:|:!empty($data['tags']['formatted']['prefix'])\">\n\t\t\t{$data['tags']['formatted']['prefix']}\n\t\t</if>\n\t\t<h4><a href='{parse url=\"showtopic={$data['tid']}<if test=\"isNewPostTR:|:$this->request['do']=='new_posts' OR $this->request['do']=='active'\">&amp;view=getnewpost<else /><if test=\"resultIsPostTR:|:$data['pid'] AND $data['pid'] != $data['topic_firstpost']\">&amp;view=findpost&amp;p={$data['pid']}</if></if>&amp;hl={$data['cleanSearchTerm']}\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}' title='{$this->lang->words['view_result']}'>{$data['_shortTitle']}</a></h4>\n\t\t<span class='desc blend_links'>\n\t\t\t<foreach loop=\"topicsForumTrail:$data['_forum_trail'] as $i => $f\">\n\t\t\t<if test=\"notLastFtAsForum:|:$i+1 == count( $data['_forum_trail'] )\"><span class='desc lighter'>{$this->lang->words['search_aft_in']}</span> <a href='{parse url=\"{$f[1]}\" template=\"showforum\" seotitle=\"{$f[2]}\" base=\"public\"}'>{$f[0]}</a></if>\n\t\t\t</foreach>\n\t\t</span>\n\t\t<span class='desc lighter blend_links toggle_notify_off'>\n\t\t\t<br />{$this->lang->words['aft_started_by']} {$data['starter']}, {parse date=\"$data['start_date']\" format=\"DATE\"}\n\t\t\t<if test=\"hasTags:|:count($data['tags']['formatted'])\">\n\t\t\t\t&nbsp;<img src='{$this->settings['img_url']}/icon_tag.png' /> {$data['tags']['formatted']['truncatedWithLinks']}\n\t\t\t</if>\n\t\t</span>\n\t\t<if test=\"multipages:|:isset( $data['pages'] ) AND is_array( $data['pages'] ) AND count( $data['pages'] )\">\n\t\t\t<ul class='mini_pagination toggle_notify_off'>\n\t\t\t<foreach loop=\"pages:$data['pages'] as $page\">\n\t\t\t\t\t<if test=\"haslastpage:|:$page['last']\">\n\t\t\t\t\t\t<li><a href=\"{parse url=\"showtopic={$data['tid']}&amp;st={$page['st']}\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}\" title='{$this->lang->words['topic_goto_page']} {$page['page']}'>{$page['page']} {$this->lang->words['_rarr']}</a></li>\n\t\t\t\t\t<else />\n\t\t\t\t\t\t<li><a href=\"{parse url=\"showtopic={$data['tid']}&amp;st={$page['st']}\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}\" title='{$this->lang->words['topic_goto_page']} {$page['page']}'>{$page['page']}</a></li>\n\t\t\t\t\t</if>\n\t\t\t</foreach>\n\t\t\t</ul>\n\t\t</if>\n\t\t<if test=\"bothSearchUnderTitle:|:IPSSearchRegistry::get('set.searchResultType') == 'both'\">\n\t\t\t<span class='desc lighter blend_links toggle_notify_off'>\n\t\t\t\t<br />{$this->lang->words['n_last_post_by']} {$data['last_poster']},\n\t\t\t\t<a href='{parse url=\"showtopic={$data['tid']}&amp;view=getlastpost\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}' title='{$this->lang->words['goto_last_post']}'>{parse date=\"$data['_last_post']\" format=\"DATE\"}</a>\n\t\t\t</span>\n\t\t</if>\n\t\t<if test=\"isFollowedStuff:|:count($data['_followData'])\">\n\t\t\t{parse template=\"followData\" group=\"search\" params=\"$data['_followData']\"}\n\t\t</if>\n\t</td>\n\t<td class='col_f_preview __topic_preview'>\n\t\t<a href='#' class='expander closed' title='{$this->lang->words['view_topic_preview']}'>&nbsp;</a>\n\t</td>\n\t<td class='col_f_views'>\n\t\t<ul>\n\t\t\t<li>{parse format_number=\"$data['posts']\"} <if test=\"replylang:|:intval($data['posts']) == 1\">{$this->lang->words['reply']}<else />{$this->lang->words['replies']}</if></li>\n\t\t\t<li class='views desc'>{parse format_number=\"$data['views']\"} {$this->lang->words['views']}</li>\n\t\t</ul>\n\t</td>\n\t<td class='col_f_post'>\n\t\t{parse template=\"userSmallPhoto\" group=\"global\" params=\"$data\"}\n\t\t<ul class='last_post ipsType_small'>\n\t\t\t<if test=\"bothSearch:|:IPSSearchRegistry::get('set.searchResultType') == 'both'\">\n\t\t\t\t<li>{parse template=\"userHoverCard\" group=\"global\" params=\"$data\"}</li>\n\t\t\t\t<li>\n\t\t\t\t\t<a href='{parse url=\"showtopic={$data['tid']}&amp;view=getlastpost\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}' title='{$this->lang->words['goto_last_post']}'>{$this->lang->words['n_posted']} {parse date=\"$data['_post_date']\" format=\"DATE\"}</a>\n\t\t\t\t</li>\n\t\t\t<else />\n\t\t\t\t<li>{$data['last_poster']}</li>\n\t\t\t\t<li>\n\t\t\t\t\t<a href='{parse url=\"showtopic={$data['tid']}&amp;view=getlastpost\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}' title='{$this->lang->words['goto_last_post']}'>{parse date=\"$data['_last_post']\" format=\"DATE\"}</a>\n\t\t\t\t</li>\n\t\t\t</if>\n\t\t</ul>\n\t</td>\n\t<if test=\"isFollowedStuff:|:count($data['_followData'])\">\n\t\t<td class='col_f_mod'>\n\t\t\t<input class='input_check checkall toggle_notify_on' type=\"checkbox\" name=\"likes[]\" value=\"{$data['_followData']['like_app']}-{$data['_followData']['like_area']}-{$data['_followData']['like_rel_id']}\" />\n\t\t</td>\n\t<else />\n\t\t<if test=\"isAdmin:|:$this->memberData['g_is_supmod']\">\n\t\t\t<td class='col_f_mod'>\n\t\t\t\t<if test=\"isArchivedCb:|:$this->request['search_app_filters']['forums']['liveOrArchive'] == 'archive'\">\n\t\t\t\t\t&nbsp;\n\t\t\t\t<else />\n\t\t\t\t\t<input type='checkbox' class='input_check topic_mod' id='tmod_{$data['tid']}' />\n\t\t\t\t</if>\n\t\t\t</td>\n\t\t</if>\n\t</if>\n</tr>\n<if test=\"$data['pid']\">\n<script type='text/javascript'>\nipb.global.searchResults[ {$data['tid']} ] = { pid: {parse expression=\"intval($data['pid'])\"}, searchterm:\"{$data['cleanSearchTerm']}\" };\n</script>\n</if>\r\nEOF;\r\n//--endhtml--//\r\nreturn $IPBHTML;\r\n}", "function html_thread(array $thread, $date_format='%c',\n $locale='en_US.UTF-8', $parent_id=0) {\n setlocale(LC_TIME, $locale);\n foreach ($thread as $subthread) {\n if ($subthread['parent_id'] == $parent_id) {\n echo '<div class=\"comment\">' . PHP_EOL;\n echo '<div class=\"comment_message\"><p>'.\n $subthread['message'] . '</div>' . PHP_EOL;\n echo '<div class=\"comment_signature\">' . \n '<span class=\"comment_username\">' .\n $subthread['username'] . '</span>;' . PHP_EOL;\n echo '<span>' .\n '<time datetime=' .\n strftime('%Y-%m-%dT%H:%M:%S',\n strtotime($subthread['timestamp'])) . '>' .\n strftime($date_format,\n strtotime($subthread['timestamp'])) .\n '</time></span>' . PHP_EOL;\n echo ' &bull; ';\n echo '<span class=\"comment-reply\">'. PHP_EOL;\n echo '<a href=\"#\">Reply</a></span>' . PHP_EOL;\n echo '</div>' . PHP_EOL;\n\n if ($subthread['children']) {\n html_thread($subthread['children'], $date_format,\n $locale, $subthread['id']);\n }\n echo '</div>' . PHP_EOL;\n }\n }\n}", "public static function toPost($data)\n {\n $post = new ForumPost();\n $post->setId(Parse::clean($data->id));\n $post->setAuthorFK(Parse::clean($data->author));\n $post->setMessage(Parse::clean($data->message));\n $post->setCreated(Parse::clean($data->created));\n $post->setEdited(Parse::clean($data->edited));\n $post->setThreadFK(Parse::clean($data->thread));\n\n return $post;\n }", "public function make_post_forum_topic($forum_name, $topic_identifier, $member, $post_title, $_post, $content_title, $topic_identifier_encapsulation_prefix, $content_url = null, $time = null, $ip = null, $validated = null, $topic_validated = 1, $skip_post_checks = false, $poster_name_if_guest = '', $parent_id = null, $staff_only = false)\n {\n $__post = comcode_to_tempcode($_post);\n $post = $__post->evaluate();\n\n if (is_null($time)) {\n $time = time();\n }\n if (is_null($ip)) {\n $ip = get_ip_address();\n }\n $forum_id = $this->forum_id_from_name($forum_name);\n if (is_null($forum_id)) {\n warn_exit(do_lang_tempcode('MISSING_FORUM', escape_html($forum_name)));\n }\n\n $username = $this->_get_username($member);//needed for the mybb_theads DB table\n\n $test = $this->connection->query_select('forums', array('*'), null, '', 1);\n $fm = array_key_exists('status', $test[0]);\n\n $topic_id = $this->find_topic_id_for_topic_identifier($forum_name, $topic_identifier);\n\n $ip_address = $ip;\n $long_ip_address = $this->_phpbb_ip($ip);\n $local_ip_address = '127.0.0.1'; //$this->_phpbb_ip('127.0.0.1');\n\n $is_new = is_null($topic_id);\n if ($is_new) {\n $topic_id = $this->connection->query_insert('threads', array('fid' => $forum_id, 'subject' => $content_title . ', ' . $topic_identifier_encapsulation_prefix . ': #' . $topic_identifier, 'username' => $username, 'uid' => $member, 'lastposter' => $username, 'lastposteruid' => $member, 'visible' => 1, 'dateline' => $time, 'lastpost' => $time), true);\n $home_link = hyperlink($content_url, $content_title, false, true);\n $this->connection->query_insert('posts', array('fid' => $forum_id, 'tid' => $topic_id, 'username' => do_lang('SYSTEM', '', '', '', get_site_default_lang()), 'uid' => $member, 'message' => do_lang('SPACER_POST', $home_link->evaluate(), '', '', get_site_default_lang()), 'subject' => '', 'dateline' => $time, 'visible' => 1, 'ipaddress' => $ip_address, 'longipaddress' => $long_ip_address));\n $this->connection->query('UPDATE ' . $this->connection->get_table_prefix() . 'forums SET posts=(posts+1), threads=(threads+1) WHERE fid=' . (string)intval($forum_id), 1);\n }\n\n $GLOBALS['LAST_TOPIC_ID'] = $topic_id;\n $GLOBALS['LAST_TOPIC_IS_NEW'] = $is_new;\n\n if ($post == '') {\n return array($topic_id, false);\n }\n\n $this->connection->query_insert('posts', array('fid' => $forum_id, 'tid' => $topic_id, 'username' => $username, 'uid' => $member, 'message' => $post, 'subject' => $post_title, 'dateline' => $time, 'visible' => 1, 'ipaddress' => $ip_address, 'longipaddress' => $long_ip_address));\n $this->connection->query('UPDATE ' . $this->connection->get_table_prefix() . 'forums SET posts=(posts+1), lastpost=' . strval($time) . ', lastposter=\\'' . db_escape_string($username) . '\\' WHERE fid=' . (string)intval($forum_id), 1);\n $this->connection->query('UPDATE ' . $this->connection->get_table_prefix() . 'threads SET lastpost=' . strval($time) . ', lastposter=\\'' . db_escape_string($username) . '\\', lastposteruid=' . strval($member) . ', replies=(replies+1) WHERE tid=' . (string)intval($topic_id), 1);\n\n return array($topic_id, false);\n }", "function convert_from_sql_row($row)\n\t{\n $this->SignupId = (int)$row->SignupId;\n $this->UserId = (int)$row->UserId;\n $this->RunId = (int)$row->RunId;\n $this->State = (string)$row->State;\n $this->PrevState = (string)$row->PrevState;\n $this->Gender = (string)$row->Gender;\n $this->Counted = (string)$row->Counted;\n $this->UpdatedById = (int)$row->UpdatedById;\n $this->TimeStamp = (string)$row->TimeStamp;\n\t}", "function show_post_and_context($post, $thread, $forum, $options, $n) {\n $thread = BoincThread::lookup_id($post->thread);\n $forum = BoincForum::lookup_id($thread->forum);\n\n $content = output_transform($post->content, $options);\n $when = time_diff_str($post->timestamp, time());\n $user = lookup_user_id($post->user);\n $title = cleanup_title($thread->title);\n $m = $n%2;\n if ($post->hidden) {\n $deleted = \"<br><font color=red>[\".tra(\"Hidden by a moderator\").\"]</font>\";\n } else {\n $deleted = \"\";\n }\n echo \"\n <tr class=row$m>\n <td>\n $n)\n \";\n switch ($forum->parent_type) {\n case 0:\n $category = BoincCategory::lookup_id($forum->category);\n show_forum_title($category, $forum, $thread, true);\n break;\n case 1:\n show_team_forum_title($forum);\n break;\n }\n echo \"\n (<a href=\\\"forum_thread.php?id=\".$thread->id.\"&amp;postid=\".$post->id.\"\\\">\".tra(\"Message %1\", $post->id).\"</a>)\n <br>\n \".tra(\"Posted %1 by %2\", $when, user_links($user)).\" $deleted\n <hr>\n $content\n </td></tr>\n \";\n}", "public function load_thread($threadID){\n\t\t$query = $this->db->query(\"SELECT ID, name, comment, threadID FROM bboard WHERE threadID =\".$threadID);\n\t\tforeach ($query->result() as $row){\n\t\t\t$data['id']\t = \"$row->ID\";\n\t\t\t$data['name'] = \"$row->name\";\n\t\t\t$data['comment'] = \"$row->comment\";\t\t\t\n\t\t}\n\t\t\n\t\treturn $data;\n\t}", "public function write() {\n\t\t$this->loadModel('Thread');\n\t\tif ($this->request->is('post')) {\n $this->Thread->set('user_id', $this->Auth->user('id'));\n $this->Thread->set('forums_id', $this->params['pass'][0]);\n if ($this->Thread->save($this->request->data)) {\n $this->Session->setFlash('Din tråd har sparats.');\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash('Kunde inte spara tråden.');\n }\n }\n\t}", "public function generateThread($forum_id, $user, $subject, $message, $notify, $notify_posts, $alias = '', $date = '')\n\t{\t\n\t\tglobal $ilDB;\n\n\t\t$objNewThread = new ilForumTopic();\n\t\t$objNewThread->setForumId($forum_id);\n\t\t$objNewThread->setUserId($user);\n\t\t$objNewThread->setSubject($subject);\n\t\tif ($date == \"\")\n\t\t{\n\t\t\t$objNewThread->setCreateDate(date(\"Y-m-d H:i:s\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (strpos($date, \"-\") > 0)\t\t// in mysql format\n\t\t\t{\n\t\t\t\t$objNewThread->setCreateDate($date);\n\t\t\t}\n\t\t\telse\t\t\t\t\t\t\t\t// a timestamp\n\t\t\t{\n\t\t\t\t$objNewThread->setCreateDate(date(\"Y-m-d H:i:s\", $date));\n\t\t\t}\n\t\t}\n\t\t$objNewThread->setImportName($this->getImportName());\n\t\t$objNewThread->setUserAlias($alias);\n\t\t$objNewThread->insert();\n\t\t\n\t\tif ($notify_posts == 1)\n\t\t{\n\t\t\t$objNewThread->enableNotification($user);\n\t\t}\n\t\t\t\n\t\t// update forum\n\t\t$statement = $ilDB->manipulateF('\n\t\t\tUPDATE frm_data \n\t\t\tSET top_num_threads = top_num_threads + 1\n\t\t\tWHERE top_pk = %s',\n\t\t\tarray('integer'), array($forum_id));\n\t\t\n\t\treturn $this->generatePost($forum_id, $objNewThread->getId(), $user, $message, 0, $notify, $subject, $alias, $objNewThread->getCreateDate());\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}", "function createThread($boardUrl, $subject, $comment, $user, $ip){\n R::begin();\n try {\n $board = boardByURL($boardUrl);\n $user = checkSetDefaultPoster($user, $board);\n $thread = R::dispense(TTHREAD::TABLE);\n R::store($thread);\n $post = _dispensePost($board, $subject, $comment, $user, $ip);\n $post[TPOST::ISOP] = true;\n R::store($post);\n array_push($thread[TTHREAD::POSTS], $post);\n array_push($board[TBOARD::THREADS], $thread);\n R::store($board);\n R::commit();\n } catch(Exception $e) {\n R::rollback();\n }\n \n }", "public function actionThread($cid = null, $fid = null, $id = null, $slug = null)\r\n {\r\n $thread = Thread::verify($cid, $fid, $id, $slug, Podium::getInstance()->user->isGuest);\r\n if (empty($thread)) {\r\n $this->error(Yii::t('podium/flash', 'Sorry! We can not find the thread you are looking for.'));\r\n return $this->redirect(['forum/index']);\r\n }\r\n\r\n $this->setMetaTags(\r\n $thread->forum->keywords ?: $thread->forum->category->keywords, \r\n $thread->forum->description ?: $thread->forum->category->description\r\n );\r\n \r\n $dataProvider = (new Post)->search($thread->forum->id, $thread->id);\r\n $model = new Post;\r\n $model->subscribe = 1;\r\n\r\n return $this->render('thread', [\r\n 'model' => $model,\r\n 'dataProvider' => $dataProvider,\r\n 'thread' => $thread,\r\n ]);\r\n }", "function messageThreadTree( $threadID, $showUnApprived = false, $offset = 0, $limit = 100 )\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n if ( !isSet( $showUnApproved ) || !$showUnApproved )\r\n $showUnApproved = \" AND IsApproved='1' \";\r\n else\r\n $showUnApproved = \" AND IsApproved='0' \";\r\n\r\n $db->array_query( $message_array, \"SELECT ID, TreeID FROM eZForum_Message\r\n WHERE ForumID='$this->ID'\r\n AND ThreadID='$threadID'\r\n AND IsTemporary='0'\r\n $showUnApproved\r\n ORDER BY TreeID DESC\",\r\n array( \"Limit\" => $limit, \"Offset\" => $offset ) );\r\n\r\n $ret = array();\r\n\r\n foreach ( $message_array as $message )\r\n {\r\n $ret[] = new eZForumMessage( $message[$db->fieldName(\"ID\")] );\r\n }\r\n\r\n return $ret;\r\n }", "function loadMessages($thread_id)\n\t\t{\n\t\t\t$query=sqlite_query($this->connection, \"SELECT user_id, message, date FROM message WHERE thread_id='$thread_id' ORDER BY message_id ASC\");\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}\n\t\t\treturn $row;\n\t\t}", "function newthread( $args )\n\t{\n\t // if not logged in redirect\n\t if( !$this->app->user->is_logged_in() ){\n\t $this->app->redirect('user/login');\n\t }\n\t \n\t // get board id\n\t $board_id = (int) $args['id'];\n\t \n\t // get board info\n\t $boards_model = $this->app->\n\t model('forum_boards','forum/models');\n\t \n\t // get board item\n\t $board = $boards_model->get_item( $board_id );\n\t \n\t // check if board exists\n\t if( count($board) == 0 ){\n\t $this->app->redirect('forum');\n\t }\n\t \n\t // action message\n\t $action_message = null;\n\t \n\t \n\t \n\t // init failed submission values\n\t $name_value = '';\n\t $description_value = '';\n\t \n\t \n\t /* -------------------------\n\t * Check for form submission\n\t */\n\t if( $_SERVER['REQUEST_METHOD'] == 'POST' && \n\t isset( $_POST['name']) && \n\t $_POST['name'] != null &&\n\t isset( $_POST['description']) && \n\t $_POST['description'] != null\n\t ){\n\t \n\t // get threads model\n\t $threads_model = $this->app->\n\t model('forum_threads','forum/models');\n\t \n\t // add the new thread\n\t $success = $threads_model->\n\t new_item($this->app->user->get_user_id(), \n\t $board_id, $_POST );\n\t \n\t // test for success\n\t if( $success ){\n\t \n\t // get most recent thread\n\t $thread = $threads_model->last_thread();\n\t \n\t // increment thread count\n\t $boards_model->increment_thread($board_id);\n\t \n\t // redirect to the new thread\n\t $this->app->redirect('forum/thread/'.$thread['id']);\n\t }\n\t } elseif($_SERVER['REQUEST_METHOD'] == 'POST' ) {\n\t $action_message = \"One ore more required inputs were not \n\t provided.\";\n\t \n\t $name_value = 'value=\"'.$_POST['name'].'\"';\n\t $description_value = $_POST['description'];\n\t \n\t }\n\t \n\t // add init values\n\t $this->view->add('name_value',$name_value);\n\t $this->view->add('description_value',$description_value);\n\t \n\t // add action message\n\t $this->view->add('action_message',$action_message);\n\t \n\t \n\t \n\t /* -------------------------\n\t * Action paths defined here\n\t */\n\t \n\t // action on form submit\n\t $this->view->add('submit_action',\n\t $this->app->form_path('forum/newthread/'.$board_id));\n\t \n\t // get wysiwyg extension\n\t $wysiwyg = $this->app->extension('wysiwyg');\n\t \n\t // set page title\n\t $this->view->add('page_title','Create a new thread');\n\t \n\t}", "function Forum_showForum(&$PAGEDATA, &$id) {\n\tWW_addCSS('/ww.plugins/forum/frontend/forum.css');\n\t// { forum data\n\t$forum=dbRow('select * from forums where id='.$id);\n\tif (!$forum || !count($forum)) {\n\t\treturn '<em class=\"error\">Error: this forum does not exist!</em>';\n\t}\n\t$c='<h2 class=\"forum-name\">'.htmlspecialchars($forum['name']).'</h2>';\n\t// }\n\t// { subforums\n\t$subforums=dbAll('select * from forums where parent_id='.$id);\n\tif ($subforums && count($subforums)) {\n\t\treturn 'TODO: subforums';\n\t}\n\t// }\n\t// { threads\n\t$threads=dbAll(\n\t\t'select * from forums_threads '\n\t\t.'where forum_id='.$id.' order by last_post_date desc'\n\t);\n\tif ($threads && count($threads)) {\n\t\t$c.='<table id=\"forum-threads\">'\n\t\t\t.'<tr><th>Topics</th><th>Replies</th>'\n\t\t\t.'<th>Author</th><th>Last Post</th></tr>';\n\t\tforeach ($threads as $thread) {\n\t\t\t$user=User::getInstance($thread['creator_id']);\n\t\t\t$last_user=User::getInstance($thread['last_post_by']);\n\t\t\t$user_name=$user?$user->get('name'):'';\n\t\t\t$last_user_name=$last_user?$last_user->get('name'):'';\n\t\t\t$c.='<tr><td><a href=\"'.$PAGEDATA->getRelativeUrl()\n\t\t\t\t.'?forum-f='.$id.'&amp;forum-t='.$thread['id'].'\">'\n\t\t\t\t.htmlspecialchars($thread['name']).'</td><td>'\n\t\t\t\t.($thread['num_posts']-1).'</td>'\n\t\t\t\t.'<td>'.htmlspecialchars($user_name).'</td><td>'\n\t\t\t\t.Core_dateM2H($thread['last_post_date'], 'datetime').', by '\n\t\t\t\t.htmlspecialchars($last_user_name).'</td></tr>';\n\t\t}\n\t\t$c.='</table>';\n\t}\n\telse {\n\t\t$c.='<div class=\"forum-no-threads\"><p>This forum has no threads in it.'\n\t\t\t.' Be the first to post to it!</p></div>';\n\t}\n\t// }\n\t// { post form\n\tif (isset($_SESSION['userdata']) && $_SESSION['userdata']['id']) {\n\t\t$c.='<div id=\"forum-post-submission-form\"><script defer=\"defer\">var forum_id='\n\t\t\t.$id.';</script></div>';\n\t\tWW_addScript('//cdn.ckeditor.com/4.4.3/standard/ckeditor.js');\n\t\tWW_addScript('//cdn.ckeditor.com/4.4.3/standard/adapters/jquery.js');\n\t\tWW_addScript('forum/frontend/forum.js');\n\t}\n\telse {\n\t\t$c.='<div class=\"forum-not-logged-in\">In order to post to this forum,'\n\t\t\t.' you must <a href=\"/_r?type=loginpage\">login'\n\t\t\t.'</a> first.</div>';\n\t}\n\t// }\n\treturn $c;\n}", "public function getOriginalPost() {\n\t\t\n\t\ttry {\n\t\t\t$select = $this->pdo->select()\n\t\t\t\t\t\t\t\t->from('posts_'.$this->board)\n\t\t\t\t\t\t\t\t->where('id', '=', $this->tId);\n\t\t\t$stmt = $select->execute();\n\t\t\t$data = $stmt->fetch();\n\t\t\t\n\t\t\tif($data) {\n\t\t\t\t$thread_exists = true;\n\t\t\t\t\n\t\t\t\t$this->tSubject = $data['subject'];\n\t\t\t\t$this->tEmail = $data['email'];\n\t\t\t\t$this->tName = $data['name'];\n\t\t\t\t$this->tTrip = $data['trip'];\n\t\t\t\t$this->tCapcode = $data['capcode'];\n\t\t\t\t$this->tSubject = $data['subject'];\n\t\t\t\t$this->tBody = $data['body'];\n\t\t\t\t$this->tFiles = $data['files'];\n\t\t\t\t$this->tIP = $data['ip'];\n\t\t\t\t$this->tPostedAt = $data['posted_at'];\n\t\t\t\t$this->tBumpedAt = $data['bumped_at'];\n\t\t\t\t$this->tSticky = $data['sticky'];\n\t\t\t\t$this->tLocked = $data['locked'];\n\t\t\t\t$this->tSage = $data['sage'];\n\t\t\t\t\n\t\t\t\tif($this->tFiles) {\n\t\t\t\t\n\t\t\t\t\t$fileInfo = json_decode($this->tFiles);\n\t\t\t\t\t\n\t\t\t\t\t$this->tFileName = $fileInfo->{'name'}.'.'.$fileInfo->{'mime'};\n\t\t\t\t\t$this->tFileThumb = SITE_URL.'/content/thumb/'.$this->tFileName;\n\t\t\t\t\t$this->tFileUrl = SITE_URL.'/content/'.$this->tFileName;\n\t\t\t\t\t$this->tHuman = '('.$fileInfo->{'human'}.', '.$fileInfo->{'width'}.'x'.$fileInfo->{'height'}.', '.$fileInfo->{'oriName'}.')';\n\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$thread_exists = false;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} catch (\\Exception $e) {\n\t\t\t$this->app->error($e);\n\t\t}\n\t\n\t\treturn $thread_exists;\n\t}", "private function getNewsForumLang(GWF_Language $lang, $pid)\n\t{\n\t\t\n\t\t$pid = (int) $pid;\n\t\t$title = $lang->escaped('lang_nativename');\n\t\t// found old board\n\t\tif (false !== ($board = GDO::table('GWF_ForumBoard')->selectFirst(\"board_pid=$pid AND board_title='$title'\"))) {\n\t\t\treturn $board;\n\t\t}\n\n\t\t/// Create new board\n\t\t$options = GWF_ForumBoard::GUEST_VIEW;\n\t\t$descr = $this->module->langISO($lang->getISO(), 'board_lang_descr', array($lang->displayName()));\n\t\t$board = GWF_ForumBoard::createBoard($title, $descr, $pid, $options);\n\t\t\n\t\treturn $board;\n\t}", "public function thread()\n {\n return $this->belongsTo('App\\Models\\Thread')->select(['id', 'title']);\n }", "public function findByPostId(int $postId): ?\\Gazelle\\ForumThread {\n $id = self::$db->scalar(\"\n SELECT TopicID FROM forums_posts WHERE ID = ?\n \", $postId\n );\n return $id ? new \\Gazelle\\ForumThread($id) : null;\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 __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}", "public function displayForumImp()\r\n {\r\n $servername = \"localhost\";\r\n $username = \"root\";\r\n $password = \"\";\r\n\r\n $db = \"forumdb\";\r\n\r\n $table = \"forum\";\r\n\r\n $count=1;\r\n $frname=array();\r\n $frdesc=array();\r\n\r\n // Create connection\r\n $conn = new mysqli($servername, $username, $password, $db);\r\n\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Connection failed: \" . $conn->connect_error);\r\n }\r\n else\r\n {\r\n $sql = \"SELECT * FROM $table WHERE sticky='1'\";\r\n $result = $conn->query($sql);\r\n\r\n if ($result->num_rows > 0)\r\n {\r\n // get data of each row\r\n while ($row = $result->fetch_assoc())\r\n {\r\n $frname[$count] = $row['forum_name'];\r\n $frdesc[$count] = $row['forum_desc'];\r\n\r\n $count++;\r\n }\r\n\r\n $CallClassBack = new forumCall();\r\n $CallClassBack->previewForum($frname, $frdesc);\r\n\r\n }\r\n else\r\n {\r\n //echo \"0 results\";\r\n echo \"Be the first the post!\";\r\n }\r\n $conn->close();\r\n }\r\n }", "function create_post($content, $parent_id, $user, $forum, $thread, $signature) {\n $content = substr($content, 0, 64000);\n $content = mysql_real_escape_string($content);\n $now = time();\n $sig = $signature?1:0;\n $id = BoincPost::insert(\"(thread, user, timestamp, content, parent_post, signature) values ($thread->id, $user->id, $now, '$content', $parent_id, $sig)\");\n if (!$id) return null;\n\n // notify subscribed users\n //\n $subs = BoincSubscription::enum(\"threadid=$thread->id\");\n foreach ($subs as $sub) {\n if ($user->id == $sub->userid) continue;\n $user2 = BoincUser::lookup_id($sub->userid);\n if ($user2) {\n notify_subscriber($thread, $user2);\n }\n }\n $user->prefs->update(\"posts=posts+1\");\n $thread->update(\"replies=replies+1, timestamp=$now\");\n $forum->update(\"posts=posts+1, timestamp=$now\");\n return $id;\n}", "public function thread() {\n return $this->belongsTo('Thread');\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}", "function getThreadById($id){\n \n return $this->find($id)->toArray(); \n }", "function process_board($card)\r\r\n{\r\r\n if($card['var']['themecolor']){\r\r\n $color = 'style=\"color:'.$card['var']['themecolor'].'\"';\r\r\n $bordercolor = 'style=\"border-top-color:'.$card['var']['themecolor'].'\"';\r\r\n }\r\r\n\r\r\n $title_link = $card['var']['title_link'] ? $card['var']['title_link'] : 'javascript:void(0);';\r\r\n $header = '<div class=\"news-t\" '.$bordercolor.'><h3>'.\r\r\n '<a '.$color.' href=\"'.$title_link.'\">'.$card['var']['title'].'</a></h3>';\r\r\n if($card['var']['subtitle']){\r\r\n $header .= '<nav class=\"tmore\">';\r\r\n foreach ($card['var']['subtitle'] as $i => $subtitle) {\r\r\n $header .= '<a '.$color.' href=\"'.$card['var']['subtitle_link'][$i].'\">'.$subtitle.'</a>';\r\r\n }\r\r\n $header .= '</nav>';\r\r\n }\r\r\n $header .= '</div>';\r\r\n\r\r\n include_once libfile('function/forumlist');\r\r\n $fids = dintval($card['var']['fids'], TRUE);\r\r\n $forums = C::t('forum_forum')->fetch_all_by_fid($fids);\r\r\n $forum_fields = C::t('forum_forumfield')->fetch_all($fids);\r\r\n foreach($forums as $forum) {\r\r\n\r\r\n if($forum_fields[$forum['fid']]['fid']) {\r\r\n $forum = array_merge($forum, $forum_fields[$forum['fid']]);\r\r\n }\r\r\n $forum['extra'] = empty($forum['extra']) ? array() : dunserialize($forum['extra']);\r\r\n if(!is_array($forum['extra'])) {\r\r\n $forum['extra'] = array();\r\r\n }\r\r\n\r\r\n if($forum['icon']) {\r\r\n $forum['icon'] = get_forumimg($forum['icon']);\r\r\n }\r\r\n $forumlist[ $forum['fid'] ] = $forum;\r\r\n }\r\r\n\r\r\n $list = '<ul class=\"b-l cl\">';\r\r\n foreach ($forumlist as $f) {\r\r\n\r\r\n $link = forum_link($f['fid']);\r\r\n\r\r\n $list .= ' <li><a href=\"'.$link.'\"><img src=\"'.$f['icon'].'\" onerror=\"this.error=null;this.src=\\'source/plugin/xigua_portal/template/cards/board/images/bg.png\\'\"><span class=\"b-tit\">'.$f['name'].'</span></a></li>';\r\r\n }\r\r\n $list .= '</ul>';\r\r\n\r\r\n $card['var']['html'] = $header . $list;\r\r\n\r\r\n return $card;\r\r\n}", "public function fetchPostNodeData($a_row)\n\t{\n\t\tglobal $lng;\n\n\t\trequire_once('./Services/User/classes/class.ilObjUser.php');\n\t\t\n\t\tif (ilObject::_exists($a_row->pos_usr_id))\n\t\t{\n\t\t\t$tmp_user = new ilObjUser($a_row->pos_usr_id);\n\t\t\t$fullname = $tmp_user->getFullname();\n\t\t\t$loginname = $tmp_user->getLogin();\n\t\t}\n\t\n\t\t$fullname = $fullname ? $fullname : ($a_row->import_name ? $a_row->import_name : $lng->txt(\"unknown\"));\n\n\t\t$data = array(\n\t\t\t\t\t\"pos_pk\"\t\t=> $a_row->pos_pk,\n\t\t\t\t\t\"child\" => $a_row->pos_pk,\n\t\t\t\t\t\"author\"\t\t=> $a_row->pos_usr_id,\n\t\t\t\t\t\"alias\"\t\t\t=> $a_row->pos_usr_alias,\n\t\t\t\t\t\"title\" => $fullname,\n\t\t\t\t\t\"loginname\"\t\t=> $loginname,\n\t\t\t\t\t\"type\" => \"post\",\n\t\t\t\t\t\"message\"\t\t=> $a_row->pos_message,\n\t\t\t\t\t\"subject\"\t\t=> $a_row->pos_subject,\t\n\t\t\t\t\t\"pos_cens_com\"\t=> $a_row->pos_cens_com,\n\t\t\t\t\t\"pos_cens\"\t\t=> $a_row->pos_cens,\n\t\t\t\t//\t\"date\"\t\t\t=> $a_row->date,\n\t\t\t\t\t\"date\"\t\t\t=> $a_row->fpt_date,\n\t\t\t\t\t\"create_date\"\t=> $a_row->pos_date,\n\t\t\t\t\t\"update\"\t\t=> $a_row->pos_update,\t\t\t\t\t\n\t\t\t\t\t\"update_user\"\t=> $a_row->update_user,\n\t\t\t\t\t\"tree\"\t\t\t=> $a_row->thr_fk,\t\t\t\t\t\n\t\t\t\t\t\"parent\"\t\t=> $a_row->parent_pos,\n\t\t\t\t\t\"lft\"\t\t\t=> $a_row->lft,\n\t\t\t\t\t\"rgt\"\t\t\t=> $a_row->rgt,\n\t\t\t\t\t\"depth\"\t\t\t=> $a_row->depth,\n\t\t\t\t\t\"id\"\t\t\t=> $a_row->fpt_pk,\n\t\t\t\t\t\"notify\"\t\t=> $a_row->notify,\n\t\t\t\t\t\"import_name\" => $a_row->import_name,\n\t\t\t\t\t\"pos_status\" => $a_row->pos_status\n\t\t\t\t\t);\n\t\t\n\t\t// why this line? data should be stored without slashes in db\n\t\t//$data[\"message\"] = stripslashes($data[\"message\"]);\n\n\t\treturn $data ? $data : array();\n\t}", "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 fetchActiveForum()\n {\n $sql = new Sql( $this->tableGateway->adapter );\n $select = $sql->select();\n $select->from('forum');\n $select->columns(array('active'));\n //$select->where( $where );\n $select->where(array( 'active' => 1 ) );\n /*for debug*/\n //echo $select->getSqlString($adapter->getPlatform());\n //echo $select->getSqlString();\n $resultSetPrototype = new ResultSet();\n $resultSetPrototype->setArrayObjectPrototype(new Forum());\n $paginatorAdapter = new DbSelect(\n $select,\n $this->tableGateway->getAdapter(),\n $resultSetPrototype\n );\n $paginator = new Paginator($paginatorAdapter);\n if($paginator){\n foreach ($paginator as $list) : \n return 1;\n endforeach; \n }\n return -1;\n }", "protected function forum_queue_post()\n\t{\n\t\tif (!$this->topic->phpbb_topic_id)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$forum_id = self::get_queue_forum_id($this->topic->topic_category, $this->post_type);\n\n\t\tif (!$forum_id)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\ttitania::_include('functions_posting', 'phpbb_posting');\n\n\t\t$path_helper = phpbb::$container->get('path_helper');\n\t\t$post_text = $this->post_text;\n\n\t\thandle_queue_attachments($this, $post_text);\n\t\tmessage::decode($post_text, $this->post_text_uid);\n\n\t\t$post_text .= \"\\n\\n\" . $path_helper->strip_url_params($this->get_url(), 'sid');\n\n\t\t$options = array(\n\t\t\t'poster_id'\t\t\t\t=> $this->post_user_id,\n\t\t\t'topic_id'\t\t\t\t=> $this->topic->phpbb_topic_id,\n\t\t\t'topic_title'\t\t\t=> $this->post_subject,\n\t\t\t'post_text'\t\t\t\t=> $post_text,\n\t\t);\n\n\t\t$this->phpbb_post_id = phpbb_posting('reply', $options);\n\n\t\t$sql = 'UPDATE ' . TITANIA_POSTS_TABLE . '\n\t\t\tSET phpbb_post_id = ' . $this->phpbb_post_id . '\n\t\t\tWHERE post_id = ' . $this->post_id;\n\t\tphpbb::$db->sql_query($sql);\n\t}", "public function findById(int $threadId): ?\\Gazelle\\ForumThread {\n $key = sprintf(self::ID_KEY, $threadId);\n $id = self::$cache->get_value($key);\n if ($id === false) {\n $id = self::$db->scalar(\"\n SELECT ID FROM forums_topics WHERE ID = ?\n \", $threadId\n );\n if (!is_null($id)) {\n self::$cache->cache_value($key, $id, 7200);\n }\n }\n return $id ? new \\Gazelle\\ForumThread($id) : null;\n }", "public function get_forum() { // Declare \\Markguyver\\LivefyreImporter\\Data\\Livefyre\\Conversation->get_forum() function\n\t\t\treturn $this->forum;\n\t\t}", "public function getThreadEntity() {\n\t\treturn get_entity($this->getThreadGUID());\n\t}", "protected function transformRow($row){\n\n // if nothing to do\n if($row===null || is_scalar($row)){\n return $row;\n }\n\n foreach($this->connections as $data){\n // get self value\n $self = $row->{$data->getSelfKey()};\n\n $class = $data->getClassName();\n\n // if data isset - inject into key\n if(isset($this->relatedData[$class][$self])){\n $row->{$class} = $this->relatedData[$class][$self];\n // or inject empty value\n }else{\n $row->{$class} = [];\n }\n }\n\n return $row;\n }", "public function thread()\n {\n return $this->belongsTo(Thread::class);\n }", "public function thread()\n {\n return $this->belongsTo(Thread::class);\n }", "private function dbToConvMessage(array $entry) : ConversationMessage {\n\n\t\t$message = new ConversationMessage();\n\n\t\t$message->set_id($entry[\"id\"]);\n\t\t$message->set_userID($entry[\"user_id\"]);\n\t\t$message->set_time_sent($entry[\"time_insert\"]);\n\t\tif($entry[\"image_path\"] != null)\n\t\t\t$message->set_image_path($entry[\"image_path\"]);\n\t\tif($entry[\"message\"] != null)\n\t\t\t$message->set_message($entry[\"message\"]);\n\n\t\treturn $message;\n\n\t}", "public function generatePost($forum_id, $thread_id, $user, $message, $parent_pos, $notify, $subject = '', $alias = '', $date = '', $status = 1, $send_activation_mail = 0)\n\t{\n\t\tglobal $ilUser, $ilDB;\n\t\n\t\t$objNewPost = new ilForumPost();\n\t\t$objNewPost->setForumId($forum_id);\n\t\t$objNewPost->setThreadId($thread_id);\n\t\t$objNewPost->setSubject($subject);\n\t\t$objNewPost->setMessage($message);\n\t\t$objNewPost->setUserId($user);\n\t\t$objNewPost->setUserAlias($alias);\n\t\tif ($date == \"\")\n\t\t{\n\t\t\t$objNewPost->setCreateDate(date(\"Y-m-d H:i:s\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (strpos($date, \"-\") > 0)\t\t// in mysql format\n\t\t\t{\n\t\t\t\t$objNewPost->setCreateDate($date);\n\t\t\t}\n\t\t\telse\t\t\t\t\t\t\t\t// a timestamp\n\t\t\t{\n\t\t\t\t$objNewPost->setCreateDate(date(\"Y-m-d H:i:s\", $date));\n\t\t\t}\n\t\t}\n\n\t\t$objNewPost->setImportName($this->getImportName());\n\t\t$objNewPost->setNotification($notify);\n\t\t$objNewPost->setStatus($status);\n\t\t$objNewPost->insert();\n\t\t\n\t\t// entry in tree-table\n\t\tif ($parent_pos == 0)\n\t\t{\n\t\t\t$this->addPostTree($objNewPost->getThreadId(), $objNewPost->getId(), $objNewPost->getCreateDate());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->insertPostNode($objNewPost->getId(), $parent_pos, $objNewPost->getThreadId(), $objNewPost->getCreateDate());\n\t\t}\n//echo \"<br>->\".$objNewPost->getId().\"-\".$parent_pos.\"-\".$objNewPost->getThreadId().\"-\".\n//\t$objNewPost->getCreateDate().\"-\".$forum_id.\"-\".$message.\"-\".$user.\"-\";\n\t\t// string last post\n\t\t$lastPost = $objNewPost->getForumId().\"#\".$objNewPost->getThreadId().\"#\".$objNewPost->getId();\n\t\t\t\n\t\t// update thread\n\t\t$result = $ilDB->manipulateF('\n\t\t\tUPDATE frm_threads \n\t\t\tSET thr_num_posts = thr_num_posts + 1,\n\t\t\t\tthr_last_post = %s\n\t\t\tWHERE thr_pk = %s',\n\t\t\tarray('text', 'integer'),\n\t\t\tarray($lastPost, $objNewPost->getThreadId()));\n\t\t\n\t\t// update forum\n\t\t$result = $ilDB->manipulateF('\n\t\t\tUPDATE frm_data \n\t\t\tSET top_num_posts = top_num_posts + 1,\n\t\t\t \ttop_last_post = %s\n\t\t\tWHERE top_pk = %s',\n\t\t\tarray('text', 'integer'),\n\t\t\tarray($lastPost, $objNewPost->getForumId()));\n\t\t\n\t\t// MARK READ\n\t\t$forum_obj = ilObjectFactory::getInstanceByRefId($this->getForumRefId());\n\t\t$forum_obj->markPostRead($objNewPost->getUserId(), $objNewPost->getThreadId(), $objNewPost->getId());\n\t\t\n\t\t$pos_data = $objNewPost->getDataAsArray();\n\t\t$pos_data[\"ref_id\"] = $this->getForumRefId();\n\n\t\t// FINALLY SEND MESSAGE\n\n\t\tif ($this->ilias->getSetting(\"forum_notification\") == 1 && (int)$status )\n\t\t{\n\t\t\t$GLOBALS[\"frm_notifications_sent\"] = array();\n\t\t\t$this->__sendMessage($parent_pos, $pos_data);\n\n\t\t\t$pos_data[\"top_name\"] = $forum_obj->getTitle();\t\t\t\n\t\t\t$this->sendForumNotifications($pos_data);\n\t\t\t$this->sendThreadNotifications($pos_data);\n\t\t\tunset($GLOBALS[\"frm_notifications_sent\"]);\n\t\t}\n\t\t\n\t\t// Send notification to moderators if they have to enable a post\n\t\t\n\t\tif (!$status && $send_activation_mail)\n\t\t{\n\t\t\t$pos_data[\"top_name\"] = $forum_obj->getTitle();\t\t\t\n\t\t\t$this->sendPostActivationNotification($pos_data);\n\t\t}\n\t\t\n\t\t// Add Notification to news\n\t\tif ($status)\n\t\t{\n\t\t\trequire_once 'Services/RTE/classes/class.ilRTE.php';\n\t\t\tinclude_once(\"./Services/News/classes/class.ilNewsItem.php\");\n\t\t\t$news_item = new ilNewsItem();\n\t\t\t$news_item->setContext($forum_obj->getId(), 'frm', $objNewPost->getId(), 'pos');\n\t\t\t$news_item->setPriority(NEWS_NOTICE);\n\t\t\t$news_item->setTitle($objNewPost->getSubject());\n\t\t\t$news_item->setContent(ilRTE::_replaceMediaObjectImageSrc($this->prepareText($objNewPost->getMessage(), 0), 1));\n\t\t\t$news_item->setUserId($user);\n\t\t\t$news_item->setVisibility(NEWS_USERS);\n\t\t\t$news_item->create();\n\t\t}\n\t\t\n\t\treturn $objNewPost->getId();\n\t}", "function dream_post_forum_link($db, $dreamid) {\n $forum = \"Policy Forum\";\n $topic_match = \"Policy #$dreamid\";\n return forummagic_getlink($db, $forum, $topic_match);\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 rss_forum()\n\t{\n\t\tif (!$this->id || !Fsb::$session->is_authorized($this->id, 'ga_view') || !Fsb::$session->is_authorized($this->id, 'ga_view_topics'))\n\t\t{\n\t\t\tDisplay::message('not_allowed');\n\t\t}\n\n\t\t// Liste des messages\n\t\t$sql = 'SELECT f.f_name, p.p_id, p.u_id, p.f_id, p.p_text, p.p_time, p.p_nickname, p.p_map, t.t_id, t.t_title, t.t_description, u.u_activate_email, u.u_email, u.u_auth\n\t\t\t\tFROM ' . SQL_PREFIX . 'forums f\n\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'topics t\n\t\t\t\t\tON f.f_id = t.f_id\n\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'posts p\n\t\t\t\t\tON p.p_id = t.t_first_p_id\n\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'users u\n\t\t\t\t\tON u.u_id = p.u_id\n\t\t\t\tWHERE t.f_id = ' . $this->id . '\n\t\t\t\t\tAND p.p_approve = 0\n\t\t\t\tORDER BY t.t_last_p_time DESC\n\t\t\t\tLIMIT 100';\n\t\t$this->check_caching($sql, 'rss_' . $this->id . '_');\n\t\t$result = Fsb::$db->query($sql, 'rss_' . $this->id . '_');\n\t\tif ($row = Fsb::$db->row($result))\n\t\t{\n\t\t\t$this->rss->open(\n\t\t\t\thtmlspecialchars(Fsb::$cfg->get('forum_name') . Fsb::$session->getStyle('other', 'title_separator') . $row['f_name']),\n\t\t\t\thtmlspecialchars(sprintf(Fsb::$session->lang('rss_forum_name'), $row['f_name'])),\n\t\t\t\tFsb::$session->data['u_language'],\n\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=rss&amp;mode=forum&amp;id=' . $this->id),\n\t\t\t\t$row['p_time']\n\t\t\t);\n\n\t\t\t$parser = new Parser();\n\t\t\tdo\n\t\t\t{\n\t\t\t\t// Informations passees au parseur de message\n\t\t\t\t$parser_info = array(\n\t\t\t\t\t'u_id' =>\t\t\t$row['u_id'],\n\t\t\t\t\t'p_nickname' =>\t\t$row['p_nickname'],\n\t\t\t\t\t'u_auth' =>\t\t\t$row['u_auth'],\n\t\t\t\t\t'f_id' =>\t\t\t$row['f_id'],\n\t\t\t\t\t't_id' =>\t\t\t$row['t_id'],\n\t\t\t\t);\n\t\t\t\t$parser->parse_html = (Fsb::$cfg->get('activate_html') && $row['u_auth'] >= MODOSUP) ? true : false;\n\n\t\t\t\t$this->rss->add_entry(\n\t\t\t\t\tParser::title($row['t_title']),\n\t\t\t\t\thtmlspecialchars(($row['t_description']) ? $row['t_description'] : $parser->mapped_message($row['p_text'], $row['p_map'], $parser_info)),\n\t\t\t\t\t(($row['u_activate_email'] & 2) ? 'mailto:' . $row['u_email'] : Fsb::$cfg->get('forum_mail')) . ' ' . htmlspecialchars($row['p_nickname']),\n\t\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=topic&t_id=' . $row['t_id']),\n\t\t\t\t\t$row['p_time']\n\t\t\t\t);\n\t\t\t}\n\t\t\twhile ($row = Fsb::$db->row($result));\n\t\t}\n\t\t// Aucun sujet, on pioche donc directement les informations dans le forum\n\t\telse \n\t\t{\n\t\t\t$sql = 'SELECT f_id, f_name, f_text\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'forums\n\t\t\t\t\tWHERE f_id = ' . $this->id;\n\t\t\t$row = Fsb::$db->request($sql);\n\n\t\t\t$this->rss->open(\n\t\t\t\tParser::title($row['f_name']),\n\t\t\t\thtmlspecialchars($row['f_text']),\n\t\t\t\tFsb::$session->data['u_language'],\n\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=rss&amp;mode=forum&amp;id=' . $this->id),\n\t\t\t\tCURRENT_TIME\n\t\t\t);\n\t\t}\n\t}", "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}", "function replace_forum_text( $translated_text ) {\n if( is_bbpress() ){\n if ( $translated_text == 'Forum' ) {\n $translated_text = 'Forum Category';\n }\n }\n return $translated_text;\n}", "function board( $args )\n\t{\n\t // get board id\n\t $board_id = (int) $args['id'];\n\t \n\t // get board info\n\t $boards_model = $this->app->\n\t model('forum_boards','forum/models');\n\t \n\t // get board item\n\t $board = $boards_model->get_item( $board_id );\n\t \n\t // check if records found\n\t if( count($board) == 0 ){\n\t \n\t // st page title to reflect\n\t $this->view->add('page_title','Unknown board');\n\t $this->view->add('board_description','None');\n\t $this->view->add('board_name','Unknown');\n\t } else {\n\t \n\t // set page title\n\t $this->view->add('page_title','Viewing threads\n\t in message board: ' . $board[0]['name'] );\n\t $this->view->add('board_description',\n\t $board[0]['description']);\n\t $this->view->add('board_name',\n\t $board[0]['name']);\n\t }\n\t \n\t // get threads\n\t $threads_model = $this->app->\n\t model('forum_threads','forum/models');\n\t \n\t // add the threads to the page\n\t $this->view->add('threads_result',\n\t $threads_model->get_threads($board_id) );\n\t \n\t \n\t /* -----------------------\n\t * Add actions to the view\n\t */\n\t \n\t // index action\n\t $this->view->add('index_action',\n\t $this->app->form_path('forum'));\n\t \n\t // create a new thread action\n\t $this->view->add('add_action',\n\t $this->app->form_path('forum/newthread/'.$board_id));\n\t \n\t // search the forum action\n\t $this->view->add('search_action',\n\t $this->app->form_path('forum/search'));\n\t \n\t // add thread action to view\n\t $this->view->add('thread_action',\n $this->app->form_path('forum/thread'));\n \t\n\t}", "public function thread(){\n return $this->belongsTo(Thread::class);\n }", "private function getThreadForContext($str_field, $str_id)\n {\n try {\n $obj_thread = $this->evaluateResponse($this->httpPost($this->str_endpoint . '/thread/detail', (object)[\n 'client' => $this->str_client,\n 'key' => $this->str_api_key,\n $str_field => $str_id\n ]));\n return $obj_thread;\n } catch (\\UnexpectedValueException $obj_ex) {\n if(404 == $obj_ex->getCode()) {\n return false;\n }\n throw $obj_ex;\n }\n }", "function update_last_post_forum($forum_id)\r\n\t{\r\n\t\tglobal $auth, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\t$forum_id = (int) $forum_id;\r\n\r\n\t\tif (!isset($this->forum_data[$forum_id]))\r\n\t\t{\r\n\t\t\t$this->get_forum_data(array($forum_id));\r\n\t\t}\r\n\r\n\t\t// If it still is not set the forum does not exist, so return.\r\n\t\tif (!isset($this->forum_data[$forum_id]))\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$sql = 'SELECT p.post_id, p.topic_id, p.post_subject, p.post_time, u.user_id, u.username, u.user_colour FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u\r\n\t\t\tWHERE p.forum_id = ' . $forum_id . '\r\n\t\t\t\tAND p.post_deleted = 0\r\n\t\t\t\tAND u.user_id = p.poster_id\r\n\t\t\t\t\tORDER BY p.post_time DESC';\r\n\t\t$result = $db->sql_query_limit($sql, 1);\r\n\t\t$last_post_data = $db->sql_fetchrow($result);\r\n\t\t$db->sql_freeresult($result);\r\n\r\n\t\tif ($this->forum_data[$forum_id]['forum_last_post_id'] == $last_post_data['post_id'])\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif ($last_post_data)\r\n\t\t{\r\n\t\t\t$sql_data = array(\r\n\t\t\t\t'forum_last_post_id'\t\t=> $last_post_data['post_id'],\r\n\t\t\t\t'forum_last_poster_id'\t\t=> $last_post_data['user_id'],\r\n\t\t\t\t'forum_last_post_subject'\t=> $last_post_data['post_subject'],\r\n\t\t\t\t'forum_last_post_time'\t\t=> $last_post_data['post_time'],\r\n\t\t\t\t'forum_last_poster_name'\t=> $last_post_data['username'],\r\n\t\t\t\t'forum_last_poster_colour'\t=> $last_post_data['user_colour'],\r\n\t\t\t);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$sql_data = array(\r\n\t\t\t\t'forum_last_post_id'\t\t=> 0,\r\n\t\t\t\t'forum_last_poster_id'\t\t=> 0,\r\n\t\t\t\t'forum_last_post_subject'\t=> '',\r\n\t\t\t\t'forum_last_post_time'\t\t=> 0,\r\n\t\t\t\t'forum_last_poster_name'\t=> '',\r\n\t\t\t\t'forum_last_poster_colour'\t=> '',\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\t$this->forum_data[$forum_id] = array_merge($this->forum_data[$forum_id], $sql_data);\r\n\r\n\t\t$sql = 'UPDATE ' . FORUMS_TABLE . '\r\n\t\t\tSET ' . $db->sql_build_array('UPDATE', $sql_data) . '\r\n\t\t\t\tWHERE forum_id = ' . $forum_id;\r\n\t\t$db->sql_query($sql);\r\n\r\n\t\tif ($this->forum_data[$forum_id]['parent_id'] != 0)\r\n\t\t{\r\n\t\t\t$this->update_last_post_forum($this->forum_data[$forum_id]['parent_id']);\r\n\t\t}\r\n\t}", "function fetch_thread_move_prune_sql($thread)\n{\n\tglobal $DB_site, $vbphrase;\n\n\t$query = '1=1';\n\n\t// original post\n\tif (intval($thread['originaldaysolder']))\n\t{\n\t\t$query .= ' AND thread.dateline <= ' . (TIMENOW - ($thread['originaldaysolder'] * 86400));\n\t}\n\tif (intval($thread['originaldaysnewer']))\n\t{\n\t\t$query .= ' AND thread.dateline >= ' . (TIMENOW - ($thread['originaldaysnewer'] * 86400));\n\t}\n\n\t// last post\n\tif (intval($thread['lastdaysolder']))\n\t{\n\t\t$query .= ' AND thread.lastpost <= ' . (TIMENOW - ($thread['lastdaysolder'] * 86400));\n\t}\n\tif (intval($thread['lastdaysnewer']))\n\t{\n\t\t$query .= ' AND thread.lastpost >= ' . (TIMENOW - ($thread['lastdaysnewer'] * 86400));\n\t}\n\n\t// replies\n\tif (intval($thread['repliesleast']) > 0)\n\t{\n\t\t$query .= ' AND thread.replycount >= ' . intval($thread['repliesleast']);\n\t}\n\tif (intval($thread['repliesmost']) > -1)\n\t{\n\t\t$query .= ' AND thread.replycount <= ' . intval($thread['repliesmost']);\n\t}\n\n\t// views\n\tif (intval($thread['viewsleast']) > 0)\n\t{\n\t\t$query .= ' AND thread.views >= ' . intval($thread['viewsleast']);\n\t}\n\tif (intval($thread['viewsmost']) > -1)\n\t{\n\t\t$query .= ' AND thread.views <= ' . intval($thread['viewsmost']);\n\t}\n\n\t// sticky\n\tif ($thread['issticky'] == 1)\n\t{\n\t\t$query .= ' AND thread.sticky = 1';\n\t}\n\telse if ($thread['issticky'] == 0)\n\n\t{\n\t\t$query .= ' AND thread.sticky = 0';\n\t}\n\n\t// deleted\n\tif ($thread['isdeleted'] == 1)\n\t{\n\t\t$query .= ' AND deletionlog.primaryid IS NOT NULL';\n\t}\n\telse if ($thread['isdeleted'] == 0)\n\t{\n\t\t$query .= ' AND deletionlog.primaryid IS NULL';\n\t}\n\n\t// open\n\tif ($thread['isopen'] == 1)\n\t{\n\t\t$query .= ' AND thread.open = 1';\n\t}\n\telse if ($thread['isopen'] == 0)\n\t{\n\t\t$query .= ' AND thread.open = 0';\n\t}\n\n\t// visible\n\tif ($thread['isvisible'] == 1)\n\t{\n\t\t$query .= ' AND thread.visible = 1';\n\t}\n\telse if ($thread['isvisible'] == 0)\n\t{\n\t\t$query .= ' AND thread.visible = 0';\n\t}\n\n\t// redirect\n\tif ($thread['isredirect'] == 1)\n\t{\n\t\t$query .= ' AND thread.open = 10';\n\t}\n\telse if ($thread['isredirect'] == 0)\n\t{\n\t\t$query .= ' AND thread.open <> 10';\n\t}\n\n\t// posted by\n\tif ($thread['posteduser'])\n\t{\n\t\t$user = $DB_site->query_first(\"\n\t\t\tSELECT userid\n\t\t\tFROM \" . TABLE_PREFIX . \"user\n\t\t\tWHERE username = '\" . addslashes(htmlspecialchars_uni($thread['posteduser'])) . \"'\n\t\t\");\n\t\tif (!$user)\n\t\t{\n\t\t\tprint_stop_message('invalid_user_specified');\n\t\t}\n\t\t$query .= \" AND thread.postuserid = $user[userid]\";\n\t}\n\n\t// title contains\n\tif ($thread['titlecontains'])\n\t{\n\t\t$query .= \" AND thread.title LIKE '%\" . addslashes_like(htmlspecialchars_uni($thread['titlecontains'])) . \"%'\";\n\t}\n\n\t// forum\n\tif ($thread['subforums'])\n\t{\n\t\t$query .= \" AND (thread.forumid = $thread[forumid] OR forum.parentlist LIKE '%,$thread[forumid],%')\";\n\t}\n\telse\n\t{\n\t\t$query .= \" AND thread.forumid = $thread[forumid]\";\n\t}\n\n\treturn $query;\n}", "function target_add_forum($forum)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $forum['name']);\n\n\tif (!isset($GLOBALS['cat_map'][ $forum['cat_id'] ])) {\n\t\tpf('WARNING: Create category for uncategorized forum.');\n\t\t$cat_id = q_singleval('SELECT MAX(id)+1 from '. $GLOBALS['DBHOST_TBL_PREFIX'] .'cat');\n\t\tif (!$cat_id) $cat_id = 1;\n\t\ttarget_add_cat(array('id'=>$cat_id, 'name'=>'Uncategorized Forums', 'description'=>'', 'view_order'=>$cat_id));\n\t\t$GLOBALS['cat_map'][ $forum['cat_id'] ] = $cat_id;\n\t}\n\n\t$forum_opt = 16;\t// Set tag_style to BBCode.\n\tif (!empty($forum['post_passwd'])) {\n\t\t$forum_opt |= 4;\t// Enable passwd_posting.\n\t}\n\n\t$frm = new fud_forum();\n\t$frm->cat_id = $GLOBALS['cat_map'][ $forum['cat_id'] ];\n\t$frm->name = $forum['name'];\n\t$frm->descr = $forum['description'];\n\t$frm->view_order = $forum['view_order'];\n\t$frm->post_passwd = $forum['post_passwd'];\n\t$frm->url_redirect = $forum['url_redirect'];\n\t$frm->forum_opt = $forum_opt;\n\t$frm->max_attach_size = 0;\t// No limit.\n\t$frm->max_file_attachments = 5;\t// Sensible default.\n\t$id = $frm->add('LAST');\n\t$GLOBALS['forum_map'][ (int)$forum['id'] ] = $id;\n/*\nfud_use('forum_adm.inc', true);\nfud_use('groups_adm.inc', true);\nfud_use('groups.inc');\n$nf = new fud_forum;\n// $cat_id, $name, $descr, $parent, $url_redirect, $post_passwd, $forum_icon,\n// $forum_opt, $date_created, $message_threshold, $max_attach_size,\n// $max_file_attachments\n$nf->cat_id = $GLOBALS['cat_map'][$c->pid];\n$nf->name = $c->name;\n$nf->description = $c->description;\n$nf->view_order = $c->disporder;\n$nf->post_passwd = $c->password;\n// $nf->cat_opt = 1|2;\n$GLOBALS['forum_map'][$c->fid] = $nf->add('LAST');\n*/\n}", "public function actionView($id)\n {\n $model = $this->findModel($id);\n if ($model->parent_id == PreForumBoard::AS_CATEGORY) {\n return $this->render('boards', [\n 'model' => $model,\n 'forum' => $model->forumModel,\n 'parentId' => $model->id,\n ]);\n }\n\n $newThread = new PreForumThread();\n\n if ($newThread->load(Yii::$app->request->post())) {\n $newThread->board_id = $model->id;\n if ($newThread->save()) {\n Yii::$app->db->createCommand()->update('{{%pre_forum_board}}', [\n 'updated_at' => time(),\n 'updated_by' => Yii::$app->user->id\n ], 'id=:id', [':id' => $model->id])->execute();\n return $this->refresh();\n }\n }\n \n return $this->render('view', [\n 'model' => $model,\n 'newThread' => $newThread,\n ]);\n }", "public function restore(User $user, CForumThread $thread)\n {\n //\n }", "public function forumNode()\n {\n if (!$this->forumNode)\n {\n $this->forumNode = eZContentObjectTreeNode::fetch(\n $this->attribute('node_id'),\n $this->languageCode()\n );\n }\n return $this->forumNode;\n }", "public function getThreads()\r\n{\r\n $query_string = \"SELECT postid, postsubject, postdate, postcategory FROM posts \";\r\n $query_string .= \"WHERE postcategory = :postcategory\";\r\n\r\n return $query_string;\r\n\r\n}", "public function getForum()\n {\n return $this->hasOne(Forum::class, ['id' => 'fk_forum']);\n }", "function forum_rss_feed_posts($forum, $newsince=0) {\n\n global $CFG;\n\n $items = array();\n\n if ($newsince) {\n $newsince = \" AND p.modified > '$newsince'\";\n } else {\n $newsince = \"\";\n }\n\n if ($recs = get_records_sql (\"SELECT p.id AS postid,\n d.id AS discussionid,\n d.name AS discussionname,\n u.id AS userid,\n u.firstname AS userfirstname,\n u.lastname AS userlastname,\n p.subject AS postsubject,\n p.message AS postmessage,\n p.created AS postcreated,\n p.format AS postformat\n FROM {$CFG->prefix}forum_discussions d,\n {$CFG->prefix}forum_posts p,\n {$CFG->prefix}user u\n WHERE d.forum = '$forum->id' AND\n p.discussion = d.id AND\n u.id = p.userid $newsince\n ORDER BY p.created desc\", 0, $forum->rssarticles)) {\n\n $item = NULL;\n $user = NULL;\n\n $formatoptions = new object;\n $formatoptions->trusttext = true;\n\n foreach ($recs as $rec) {\n unset($item);\n unset($user);\n $item->category = $rec->discussionname;\n $item->title = $rec->postsubject;\n $user->firstname = $rec->userfirstname;\n $user->lastname = $rec->userlastname;\n $item->author = fullname($user);\n $item->pubdate = $rec->postcreated;\n $item->link = $CFG->wwwroot.\"/mod/forum/discuss.php?d=\".$rec->discussionid.\"&parent=\".$rec->postid;\n $item->description = format_text($rec->postmessage,$rec->postformat,$formatoptions,$forum->course);\n\n\n $post_file_area_name = str_replace('//', '/', \"$forum->course/$CFG->moddata/forum/$forum->id/$rec->postid\");\n $post_files = get_directory_list(\"$CFG->dataroot/$post_file_area_name\");\n \n if (!empty($post_files)) { \n $item->attachments = array();\n foreach ($post_files as $file) { \n $attachment = new stdClass;\n if ($CFG->slasharguments) {\n $attachment->url = \"{$CFG->wwwroot}/file.php/$post_file_area_name/$file\";\n } else {\n $attachment->url = \"{$CFG->wwwroot}/file.php?file=/$post_file_area_name/$file\";\n } \n $attachment->length = filesize(\"$CFG->dataroot/$post_file_area_name/$file\");\n $item->attachments[] = $attachment;\n }\n }\n\n $items[] = $item;\n }\n }\n return $items;\n }", "function get_thread_posts($threadid, $sort_style, $show_hidden) {\n $sql = \"thread=$threadid\";\n if (!$show_hidden) {\n $sql .= ' AND hidden = 0';\n }\n switch($sort_style) {\n case CREATE_TIME_NEW:\n $sql .= ' ORDER BY timestamp desc';\n break;\n case CREATE_TIME_OLD:\n $sql .= ' ORDER BY timestamp asc';\n break;\n case POST_SCORE:\n $sql .= ' ORDER BY score DESC';\n break;\n default:\n $sql .= ' ORDER BY timestamp asc';\n break;\n }\n return BoincPost::enum($sql);\n}", "function getFromDatabase($row) {\r\n\t\t//id\r\n\t\t$this->id = $row['id'];\r\n\t\t//eventDateTime\r\n\t\t$this->event_date_time = $row['eventDateTime'];\r\n\t\t//time before\r\n\t\t$this->time_before = $row['timeBefore'];\r\n\t\t//frequency\r\n\t\t$this->freq = $row['frequency'];\r\n\t\t//method\r\n\t\t$this->notif_method = $row['method'];\r\n\t}", "public function buildFromQueryRow($row)\n\t{\n\t\tif(isset($row['name']))\n\t\t{\n\t\t\t$tempArray = array(\n\t\t\t\t\t'id'\t=> $row['taskId'],\n\t\t\t\t\t'value'\t=> $row['name']\n\t\t\t);\n\t\t\t$this->setParentTask($tempArray);\n\t\t}else\n\t\t{\n\t\t\t$this->setTaskId($row['taskId']);\n\t\t}\n\t\t$this->setTag($row['tag']);\n\t\t$this->setTitle($row['title']);\n\t\t$this->setContent($row['content']);\n\t\t/* SEE COMMENT IN THE SAME METHOD FOR TASK TO SEE WHY THIS WAS DONE */\n\t\t$this->commentArray['member'] = $row['firstName'];\n\t\t$this->setDate($row['postedDate']);\n\t}", "public function displayPost()\r\n {\r\n $forumName = $_GET['name'];\r\n\r\n $servername = \"localhost\";\r\n $username = \"root\";\r\n $password = \"\";\r\n\r\n $db = \"forumdb\";\r\n\r\n $table = \"post\";\r\n\r\n // Create connection\r\n $conn = new mysqli($servername, $username, $password, $db);\r\n\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Connection failed: \" . $conn->connect_error);\r\n }\r\n else\r\n {\r\n $sql = \"SELECT * FROM $table WHERE forum_name = '$forumName'\";\r\n $result = $conn->query($sql);\r\n\r\n if ($result->num_rows > 0)\r\n {\r\n // get data of each row\r\n while ($row = $result->fetch_assoc())\r\n {\r\n if (strpos($row[\"post_body\"], 'https://')!==false)\r\n {\r\n /*this part checks if a url exists in the chat, the !==false is there on purpose because\r\n strpos returns either the offset at which the needle string begins in the haystack string\r\n or the boolean false if the needle isn't found.\r\n */\r\n echo \"<p style='color:greenyellow;'>\" . $row[\"post_author\"] . \" - Posted @ \" . $row[\"timin\"] . \" : </p>\" .\"<a href='\". $row[\"post_body\"] . \"'>\".$row[\"post_body\"].\"</a><br><br>\";\r\n echo \"</br>\";\r\n }\r\n else if(strpos($row[\"post_body\"], '.com')!==false) //if you want to add more options for link detections you can do it here and keep advancing the else if statements\r\n {\r\n echo \"<p style='color:greenyellow;'>\" . $row[\"post_author\"] . \" - Posted @ \" . $row[\"timin\"] . \" : </p>\" .\"<a href='\". $row[\"post_body\"] . \"'>\".$row[\"post_body\"].\"</a><br><br>\";\r\n echo \"</br>\";\r\n }\r\n else\r\n {\r\n echo \"<p style='color:greenyellow;'>\" . $row[\"post_author\"] . \" - Posted @ \" . $row[\"timin\"] . \" : </p>\" . $row[\"post_body\"] . \"<br><br>\";\r\n echo \"</br>\";\r\n }\r\n }\r\n\r\n }\r\n else\r\n {\r\n //echo \"0 results\";\r\n echo \"Be the first the post!\";\r\n }\r\n $conn->close();\r\n }\r\n }", "public static function createThread($user_id)\n\t{\n\t\tif (!Input::has('subject')) {\n\t\t\tthrow new Exception('Your message must have a subject');\n\t\t}\n\n\t\t// set subject from input\n\t\t$subject = Input::get('subject');\n\n\t\t// make sure subject is not greater than 100 characters\n\t\tif (strlen($subject) > 100) {\n\t\t\tthrow new Exception('Please limit the subject of your message to 100 characters');\t\t\n\t\t}\n\n\t\t// make sure recipients of the thread were sent\n\t\tif(!is_array(Input::get('recipient'))) {\n\t\t\tthrow new Exception('There must be a recipient of your message');\n\t\t}\n\n\t\t// set recipients from input\n\t\t$recipients = Input::get('recipient');\n\n\t\t// loop through all the recipients and...\n\t\tforeach ($recipients as $recipient) {\n\t\t\t// make sure every recipient is numeric\n\t\t\tif (!is_numeric($recipient)) {\n\t\t\t\tthrow new Exception('Invalid recipient');\n\t\t\t}\n\t\t}\n\n\t\t// make sure message body was sent\n\t\tif (!Input::has('body')) {\n\t\t\tthrow new Exception('The body of your message may not be blank');\n\t\t}\n\n\t\t// set body from input\n\t\t$body = Input::get('body');\n\n\t\t// make sure body is not greater than 1024 characters\n\t\tif (strlen($body) > 1024) {\n\t\t\tthrow new Exception('Please limit the body of your message to 1024 characters (it currently has ' . strlen($body) . ')');\t\t\n\t\t}\n\n\t\t// create a transaction to wrap the creation of Thread, UsersThread, Message, and UsersMessage\n\t\tDB::transaction(function() use ($user_id, $subject, $recipients, $body)\n\t\t{\n\t\t\ttry {\n\t\t\t\t// create new thread\n\t\t\t\t$thread = new Thread();\n\t\t\t\t$thread->subject = $subject;\n\t\t\t\t$thread->save();\n\t\t\t} catch (Exception $e) {\n\t\t\t\tthrow new Exception('Could not create conversation');\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// create record of author in users_threads\n\t\t\t\t$author_thread = new UsersThread();\n\t\t\t\t$author_thread->user_id = $user_id;\n\t\t\t\t$author_thread->thread_id = $thread->id;\n\t\t\t\t$author_thread->save();\n\t\t\t} catch (Exception $e) {\n\t\t\t\tthrow new Exception('Could not create authors connection to conversation');\n\t\t\t}\n\n\t\t\t// loop through all the recipients and...\n\t\t\tforeach ($recipients as $recipient) {\n\n\t\t\t\t// make sure the recipient is not the author\n\t\t\t\tif ($recipient != $user_id) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// create record of recipient in users_threads\n\t\t\t\t\t\t$recipient_thread = new UsersThread();\n\t\t\t\t\t\t$recipient_thread->user_id = $recipient;\n\t\t\t\t\t\t$recipient_thread->thread_id = $thread->id;\n\t\t\t\t\t\t$recipient_thread->save();\n\t\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t\tthrow new Exception('Could not create recipients connection to conversation');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// create message (users threads caches are deleted in createMessage)\n\t\t\tMessagesService::createMessage($thread->id, $user_id, $recipients, $body);\t\t\t\n\t\t});\n\t}", "public static function create($boardID, $languageID, $prefix, $subject, $text, $userID, $username, $sticky = 0, $announcement = 0, $closed = 0, $options = array(), $subscription = 0, $attachments = null, $poll = null, $disabled = 0) {\n\t\t$attachmentsAmount = $attachments != null ? count($attachments->getAttachments()) : 0;\n\t\t$polls = ($poll != null && $poll->pollID) ? 1 : 0;\n\t\t\n\t\t// insert thread\n\t\t$threadID = self::insert($subject, $boardID, array(\n\t\t\t'languageID' => $languageID,\n\t\t\t'userID' => $userID,\n\t\t\t'username' => $username,\n\t\t\t'prefix' => $prefix,\n\t\t\t'time' => TIME_NOW,\n\t\t\t'lastPostTime' => TIME_NOW,\n\t\t\t'lastPosterID' => $userID,\n\t\t\t'lastPoster' => $username,\n\t\t\t'attachments' => $attachmentsAmount,\n\t\t\t'polls' => $polls,\n\t\t\t'isSticky' => $sticky,\n\t\t\t'isAnnouncement' => $announcement,\n\t\t\t'isClosed' => $closed,\n\t\t\t'isDisabled' => $disabled,\n\t\t\t'everEnabled' => ($disabled ? 0 : 1)\n\t\t));\n\t\t\n\t\t// create post\n\t\t$post = PostEditor::create($threadID, $subject, $text, $userID, $username, $options, $attachments, $poll, null, $disabled, true);\n\t\t\n\t\t// update first post id\n\t\t$sql = \"UPDATE\twbb\".WBB_N.\"_thread\n\t\t\tSET\tfirstPostID = \".$post->postID.\"\n\t\t\tWHERE\tthreadID = \".$threadID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t\t\n\t\t// update first post preview\n\t\tPostEditor::updateFirstPostPreview($threadID, $post->postID, $text, $options);\n\t\t\n\t\t// get thread object\n\t\t$thread = new ThreadEditor($threadID);\n\t\t\n\t\t// update subscription\n\t\t$thread->setSubscription($subscription);\n\t\t\n\t\t// get similar threads\n\t\tself::updateSimilarThreads($threadID, $subject, $boardID);\n\t\t\n\t\treturn $thread;\n\t}", "function mark_thread_messages_read_main($message_thread_code)\n {\n $current_user = $this->session->userdata('login_type') . '-' . $this->session->userdata('login_user_id');\n $this->db->where('sender !=', $current_user);\n $this->db->where('message_thread_code', $message_thread_code);\n $this->db->update('admin_message', array('read_status' => 1));\n //echo $this->db->last_query();die;\n \n }", "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 getForumTypeAttribute()\n\t{\n\t\treturn 'reply';\n\t}", "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 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 mark_thread_messages_read($message_thread_code, $school_id)\n {\n $current_user = $this->session->userdata('login_type') . '-' . $this->session->userdata('login_user_id');\n $this->db->where('sender !=', $current_user);\n $this->db->where('message_thread_code', $message_thread_code);\n $this->db->where('school_id', $school_id);\n $this->db->update('message', array('read_status' => 1));\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 }", "function asForumPosts($data) {\r\n$IPBHTML = \"\";\r\n//--starthtml--//\r\n$IPBHTML .= <<<EOF\r\n<!--Begin Msg Number {$data['pid']}-->\n<div class='post_block hentry clear no_sidebar ipsBox_container' id='post_id_{$data['pid']}'>\n\t<div class='post_wrap'>\n\t\t<if test=\"postMid:|:$data['member_id']\">\n\t\t\t<h3 class='row2'>\n\t\t<else />\n\t\t\t<h3 class='guest row2'>\n\t\t</if>\n\t\t<if test=\"postModCheckbox:|:$this->memberData['g_is_supmod']\">\n\t\t\t<span class='right'>\n\t\t\t\t<label for='checkbox_{$data['pid']}' class='post_mod hide'>{$this->lang->words['mod_select_post']}</label><input type='checkbox' id='checkbox_{$data['pid']}' name='selectedpids[]' value='{$data['pid']}' class='post_mod right'<if test=\"postModSelected:|:!empty( $data['_pid_selected'] )\"> checked='checked'</if> />\n\t\t\t</span>\n\t\t</if>\n\t\t\t<span class='post_id right ipsType_small desc blend_links'><a href='{parse url=\"showtopic={$data['topic_id']}&amp;view=findpost&amp;p={$data['pid']}\" template=\"showtopic\" seotitle=\"{$data['title_seo']}\" base=\"public\"}' rel='bookmark' title='{$this->lang->words['link_to_post']} #{$data['pid']}'>#{$data['pid']}</a></span>\n\t\t\t<a href=\"{parse url=\"showtopic={$data['tid']}\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}\">{IPSText::truncate( $data['topic_title'], 80)}</a>\n\t\t</h3>\n\t\t<div class='post_body'>\n\t\t\t<p class='posted_info desc lighter ipsType_small'>\n\t\t\t\t<img src='{$data['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_tiny' /> {$this->lang->words['posted']} {$this->lang->words['search_by']}\n\t\t\t\t<if test=\"postMember:|:$data['member_id']\"><span class=\"author vcard\">{parse template=\"userHoverCard\" group=\"global\" params=\"$data\"}</span><else />{$data['members_display_name']}</if>\n\t\t\t\t{$this->lang->words['on']} <abbr class=\"published\" title=\"{parse expression=\"date( 'c', $data['_post_date'] )\"}\">{parse date=\"$data['_post_date']\" format=\"long\"}</abbr>\n\t\t\t\t<if test=\"hasForumTrail:|:$data['_forum_trail']\">\n\t\t\t\t\t{$this->lang->words['in']}\n\t\t\t\t\t<foreach loop=\"topicsForumTrail:$data['_forum_trail'] as $i => $f\">\n\t\t\t\t\t\t<if test=\"notLastFtAsForum:|:$i+1 == count( $data['_forum_trail'] )\"><a href='{parse url=\"{$f[1]}\" template=\"showforum\" seotitle=\"{$f[2]}\" base=\"public\"}'>{$f[0]}</a></if>\n\t\t\t\t\t</foreach>\n\t\t\t\t</if>\n\t\t\t</p>\n\t\t\t<div class='post entry-content'>\n\t\t\t\t{$data['post']}\n\t\t\t\t{$data['attachmentHtml']}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<br />\n</div>\n<hr />\n<br />\r\nEOF;\r\n//--endhtml--//\r\nreturn $IPBHTML;\r\n}", "public function getAllThreads($a_topic_id, $is_moderator = false)\n\t{\n\t\tglobal $ilDB, $ilUser;\n\n\t\t$this->threads = array();\n\t\t\n\t\t$data = array();\n\t\t$data_types = array();\n\n\t\t$query = 'SELECT thr_pk, MAX(pos_date) post_date, is_sticky, thr_date\n\t\t\t\t FROM frm_threads\n\t\t\t\t LEFT JOIN frm_posts ON pos_thr_fk = thr_pk';\n\t\t\n\t\tif (!$is_moderator) \n\t\t{\n\t\t\t$query .= ' AND (pos_status = %s \n\t\t\t\t\t\tOR (pos_status = %s \n\t\t\t\t\t\tAND pos_usr_id = %s))';\n\t\t\t\n\t\t\tarray_push($data_types, 'integer', 'integer', 'integer');\n\t\t\tarray_push($data, '1', '0', $ilUser->getId());\n\t\t\t\n\t\t}\n\t\t$query .= ' WHERE thr_top_fk = %s\n\t\t\t\t GROUP BY thr_pk, is_sticky, thr_date\n\t\t\t\t ORDER BY is_sticky DESC, post_date DESC, thr_date DESC';\n\t\t\n\t\n\t\tarray_push($data_types, 'integer');\n\t\tarray_push($data, $a_topic_id);\n\n\n\t\t$res = $ilDB->queryf($query, $data_types, $data);\n\n\t\twhile ($row = $ilDB->fetchObject($res))\n\t\t{\n\t\t\t\n\t\t\t$this->threads[] = new ilForumTopic($row->thr_pk);\n\t\t}\n\n\t\treturn $this->threads;\t\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 forum_recent_posts(){\n self::$db = Database::get();\n\t\t$data = self::$db->select(\"\n SELECT sub.*\n FROM\n (SELECT\n fp.forum_post_id as forum_post_id, fp.forum_id as forum_id,\n fp.forum_user_id as forum_user_id, fp.forum_title as forum_title,\n fp.forum_content as forum_content, fp.forum_edit_date as forum_edit_date,\n fp.forum_timestamp as forum_timestamp, fpr.id as id,\n fpr.fpr_post_id as fpr_post_id, fpr.fpr_id as fpr_id,\n fpr.fpr_user_id as fpr_user_id, fpr.fpr_title as fpr_title,\n fpr.fpr_content as fpr_content, fpr.fpr_edit_date as fpr_edit_date,\n fpr.fpr_timestamp as fpr_timestamp,\n GREATEST(fp.forum_timestamp, COALESCE(fpr.fpr_timestamp, '00-00-00 00:00:00')) AS tstamp\n FROM \".PREFIX.\"forum_posts fp\n LEFT JOIN \".PREFIX.\"forum_posts_replys fpr\n ON fp.forum_post_id = fpr.fpr_post_id\n WHERE fp.allow = 'TRUE'\n ORDER BY fpr.fpr_timestamp DESC\n ) sub\n GROUP BY forum_post_id\n ORDER BY tstamp DESC\n LIMIT 10\n \");\n return $data;\n }", "function remove_category_header_bbp_get_single_forum_description($retstr, $r, $args = ''){\n\t\n\t// Unhook the 'view all' query var adder\n\tremove_filter( 'bbp_get_forum_permalink', 'bbp_add_view_all' );\n\t\n\t// Get some forum data\n\t$tc_int = bbp_get_forum_topic_count( $forum_id, false );\n\t$rc_int = bbp_get_forum_reply_count( $forum_id, false );\n\t$topic_count = bbp_get_forum_topic_count( $forum_id );\n\t$reply_count = bbp_get_forum_reply_count( $forum_id );\n\t$subforum_count = bbp_get_forum_subforum_count($forum_id);\n\t$total_discussions_count = bbp_get_forum_topic_count($forum_id, true, true);\n\t$last_active = bbp_get_forum_last_active_id( $forum_id );\n\t\n\t// Has replies\n\tif ( !empty( $reply_count ) ) {\n\t\t$reply_text = sprintf( _n( '%s reply', '%s replies', $rc_int, 'bbpress' ), $reply_count );\n\t}\n\t\n\t// Forum has active data\n\tif ( !empty( $last_active ) ) {\n\t\t$topic_text = bbp_get_forum_topics_link( $forum_id );\n\t\t$time_since = bbp_get_forum_freshness_link( $forum_id );\n\t\t$last_updated_by = bbp_get_author_link( array( 'post_id' => $last_active, 'size' => $r['size'] ) );\n\t\n\t\t// Forum has no last active data\n\t} else {\n\t\t$topic_text = sprintf( _n( '%s topic', '%s topics', $tc_int, 'bbpress' ), $topic_count );\n\t}\n\t\n\t// Forum has active data\n\tif ( !empty( $last_active ) ) {\n\t\n\t\tif ( !empty( $reply_count ) ) {\n\t\n\t\t\tif ( bbp_is_forum_category( $forum_id ) ) {\n\t\t\t\t$retstr = sprintf('This forum contains %1$s topics and a total of %2$s discussions', $subforum_count, $total_discussions_count );\n\t\t\t} else {\n\t\t\t\t$retstr = sprintf( esc_html__( 'This forum contains %1$s and %2$s.', 'bbpress' ), $topic_text, $reply_text );\n\t\t\t}\n\t\n\t\t} else {\n\t\n\t\t\tif ( bbp_is_forum_category( $forum_id ) ) {\n\t\t\t\t$retstr = sprintf( esc_html__( 'This category contains %1$s.', 'bbpress' ), $topic_text);\n\t\t\t} else {\n\t\t\t\t$retstr = sprintf( esc_html__( 'This forum contains %1$s.', 'bbpress' ), $topic_text );\n\t\t\t}\n\t\t}\n\t\n\t\t// Forum has no last active data\n\t} else {\n\t\n\t\tif ( !empty( $reply_count ) ) {\n\t\n\t\t\tif ( bbp_is_forum_category( $forum_id ) ) {\n\t\t\t\t$retstr = sprintf( esc_html__( 'This category contains %1$s and %2$s.', 'bbpress' ), $topic_text, $reply_text );\n\t\t\t} else {\n\t\t\t\t$retstr = sprintf( esc_html__( 'This forum contains %1$s and %2$s.', 'bbpress' ), $topic_text, $reply_text );\n\t\t\t}\n\t\n\t\t} else {\n\t\n\t\t\tif ( !empty( $topic_count ) ) {\n\t\n\t\t\t\tif ( bbp_is_forum_category( $forum_id ) ) {\n\t\t\t\t\t$retstr = sprintf( esc_html__( 'This category contains %1$s.', 'bbpress' ), $topic_text );\n\t\t\t\t} else {\n\t\t\t\t\t$retstr = sprintf( esc_html__( 'This forum contains %1$s.', 'bbpress' ), $topic_text );\n\t\t\t\t}\n\t\n\t\t\t} else {\n\t\t\t\t$retstr = esc_html__( 'This topic has no discussions. Be the first!.', 'bbpress' );\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// Add feeds\n\t//$feed_links = ( !empty( $r['feed'] ) ) ? bbp_get_forum_topics_feed_link ( $forum_id ) . bbp_get_forum_replies_feed_link( $forum_id ) : '';\n\t\n\t// Add the 'view all' filter back\n\tadd_filter( 'bbp_get_forum_permalink', 'bbp_add_view_all' );\n\t\n\t// Combine the elements together\n\techo $retstr = $r['before'] . $retstr . $r['after'];\n\t\n\n/*\n * \n * \n \t// Parse arguments against default values\n\t$r = bbp_parse_args( $args, array(\n\t\t\t'forum_id' => 0,\n\t\t\t'before' => '<div class=\"bbp-template-notice info\"><p class=\"bbp-forum-description\">',\n\t\t\t'after' => '</p></div>',\n\t\t\t'size' => 14,\n\t\t\t'feed' => true\n\t), 'bbp_get_single_forum_description' );\n\t\n\t\n\t\n\t// Validate forum_id\n\t$forum_id = bbp_get_forum_id( $r['forum_id'] );\n\t\n\t\n\tif ( bbp_is_forum_category( $forum_id ) ) {\n\t\t\n\t\t$retstr = \"Here are the Topics within \" . the_title(null, null, false);\n\t\t//$r['before'] = '<div style=\"display:none;\" class=\"bbp-template-notice info\"><h1>hi</h1><p class=\"bbp-forum-description\">';\n\techo\t$retstr = $r['before'] . $retstr . $r['after'];\n\t} \n\telse{\n\t\t//Since I only change the $retstr if the forum is a \"category\", the text doesn't change for the other forums (Topics in our terms)\n\t\t//so just echo it unchanged.\n\t\t\n\techo\t$retstr;\n\t}\n\t*/\t\n}", "function threadRemove(){\n\n\t$threadId\t\t\t \t= strip_tags($_GET['ThreadId']);\t\t\t\t #int - primaryKey\n\n\t$db = pdo(); # pdo() creates and returns a PDO object\n\t#dumpDie($_POST);\n\n\t$sql = \"DELETE FROM ma_Threads WHERE `ThreadID` = :ThreadID\";\n\n\t$stmt = $db->prepare($sql);\n\t//INTEGER EXAMPLE $stmt->bindValue(1, $id, PDO::PARAM_INT);\n\t$stmt->bindValue(':ThreadID', $threadId, PDO::PARAM_INT);\n\n\ttry {$stmt->execute();} catch(PDOException $ex) {trigger_error($ex->getMessage(), E_USER_ERROR);}\n\t#feedback success or failure of update\n\n\tif ($stmt->rowCount() > 0)\n\t{//success! provide feedback, chance to change another!\n\t\tfeedback(\"Thread Removed Successfully From Timeline!\",\"success\");\n\t}else{//Problem! Provide feedback!\n\t\tfeedback(\"Thread Not Removed!\",\"warning\");\n\t}\n\tmyRedirect(THIS_PAGE);\n}", "public function getForumTopicList($debug_to_pass = '') {\n\n $this->db->select('ft.topic_id,ft.topic_title,ft.category_id,ft.topic_short_description,ft.topic_content,ft.posted_by,ft.posted_on,ft.status as ft_status,fc.category_id,fc.category_name,fc.page_description,u.user_name,u.user_id');\n $this->db->from('mst_forum_topics as ft');\n $this->db->join('mst_forum_categories as fc', 'ft.category_id = fc.category_id', 'inner');\n $this->db->join('mst_users as u', 'ft.posted_by=u.user_id', 'inner');\n// $this->db->join('trans_forum_comments as tfc', 'tfc.topic_id=ft.topic_id', 'inner');\n $this->db->where('ft.status', '1');\n// $this->db->where('tfc.status','1');\n $this->db->order_by('ft.topic_id desc');\n $query = $this->db->get();\n if ($debug_to_pass)\n echo $this->db->last_query();\n return $query->result_array();\n }", "public function getOneTopic()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$data_type = array();\n\t\t$data_value = array();\n\t\t\n\t\t$query = 'SELECT * FROM frm_data 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\n\t\t\t$res = $ilDB->queryf($query, $data_type, $data_value);\t\t\t\n\t\t\t$row = $ilDB->fetchAssoc($res);\n\t\t\t\n\t\t\tif(is_null($row)) return NULL;\n\t\t\t\n\t\t\t$row[\"top_name\"] = trim($row[\"top_name\"]);\n\t\t\t$row[\"top_description\"] = nl2br($row[\"top_description\"]);\n\n\t\t\treturn $row;\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\t\t\t\n\t\t\t$query .= '1 = 1';\n\t\t\n\t\t\t$res = $ilDB->query($query);\t\t\t\n\t\t\t$row = $ilDB->fetchAssoc($res);\n\t\t\t\n\t\t\tif(!is_array($row) || !count($row)) return null;\n\t\t\t\n\t\t\t$row['top_name'] = trim($row['top_name']);\n\t\t\t$row['top_description'] = nl2br($row['top_description']);\n\t\n\t\t\treturn $row;\t\t\t\n\t\t}\n\t}", "public function extract($object)\n {\n if (!$object instanceof ThreadInterface) {\n throw new Exception\\InvalidArgumentException('$object must be an instance of EdpDiscuss\\Model\\Thread\\ThreadInterface');\n }\n $data = parent::extract($object);\n unset($data['original_message']);\n unset($data['latest_message']);\n unset($data['slugifier']);\n unset($data['message_count']);\n unset($data['visit_count']);\n unset($data['last_post']);\n return $data;\n }", "public function getPostList($topic, $thread)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$data_types = array();\n\t\t$data = array();\n\t\t\n\t\t$query ='\tSELECT frm_posts.*, usr_data.lastname FROM frm_posts, usr_data \n\t\t\t\t\tWHERE pos_top_fk = %s\n\t\t\t\t\tAND pos_thr_fk = %s\n\t\t\t\t\tAND pos_usr_id = usr_id';\n\t\t\n\t\tarray_push($data_types, 'integer', 'integer');\n\t\tarray_push($data, $topic, $thread);\n\t\t\n\t\tif($this->orderField != '')\n\t\t{\n\t\t\t$query .= ' ORDER BY '.$this->orderField .' ';\n\t\t}\n\t\t\n\t\t$result = $ilDB->queryf($query, $data_types, $data);\n\t\t\n\t\treturn $result;\n\t}", "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}" ]
[ "0.58324414", "0.5804083", "0.5800071", "0.57637006", "0.5755244", "0.5709423", "0.56874114", "0.56669766", "0.5648643", "0.56475234", "0.54793316", "0.54456306", "0.5416198", "0.54152834", "0.54046494", "0.5372317", "0.53578883", "0.5289383", "0.5275244", "0.52680343", "0.5265798", "0.52644295", "0.5263639", "0.5235009", "0.5201653", "0.518888", "0.5179132", "0.51778585", "0.5127575", "0.5100374", "0.5097216", "0.50896436", "0.5073203", "0.5057089", "0.50566727", "0.5050946", "0.5029041", "0.50243026", "0.5019803", "0.50098234", "0.5006791", "0.49950078", "0.49877053", "0.49824715", "0.49712998", "0.49694014", "0.49630687", "0.49558273", "0.49546534", "0.4942038", "0.49399337", "0.49376968", "0.4917907", "0.4900836", "0.48897126", "0.48866794", "0.48866794", "0.4877196", "0.48691744", "0.4868309", "0.4859008", "0.4852854", "0.48526636", "0.4852642", "0.48499808", "0.48496205", "0.48437425", "0.48374528", "0.48228103", "0.4819594", "0.48193973", "0.48161462", "0.4798079", "0.47963223", "0.4789799", "0.47738853", "0.47732475", "0.47622707", "0.47619233", "0.47609046", "0.47564295", "0.4754314", "0.47516108", "0.47466007", "0.47433743", "0.47424924", "0.47262317", "0.47243172", "0.47187087", "0.4716371", "0.47082448", "0.47074395", "0.47060588", "0.47019303", "0.46927512", "0.46926144", "0.4690538", "0.46904564", "0.4687689", "0.46834388" ]
0.6420657
0
translate database row to ForumSubject
public static function toSubject($data) { $subj = new ForumSubject(); $subj->setId(Parse::clean($data->id)); $subj->setTopic(Parse::clean($data->topic)); $subj->setSubtitle(Parse::clean($data->subtitle)); return $subj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function subject_obtain($report_subject)\n\t{\n\t\t$sql = 'SELECT t.topic_title, t.topic_first_post_id\n\t\t\tFROM ' . BB_POSTS . ' p\n\t\t\tINNER JOIN ' . BB_POSTS_TEXT . ' pt\n\t\t\t\tON pt.post_id = p.post_id\n\t\t\tINNER JOIN ' . BB_TOPICS . ' t\n\t\t\t\tON t.topic_id = p.topic_id\n\t\t\tWHERE p.post_id = ' . (int)$report_subject;\n\t\tif (!$result = DB()->sql_query($sql)) {\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not obtain report subject', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\t$row = DB()->sql_fetchrow($result);\n\t\tDB()->sql_freeresult($result);\n\n\t\tif (!$row) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($row['topic_title'] != '') {\n\t\t\treturn $row['topic_title'];\n\t\t} else {\n\t\t\t$subject = ($row['topic_first_post_id'] == $report_subject) ? '' : 'Re: ';\n\t\t\t$subject .= $row['topic_title'];\n\n\t\t\treturn $subject;\n\t\t}\n\t}", "function getSubject() {\n $sql = 'select *from ebh_users limit 10';\n $row = $this->db->query($sql)->list_array();\n return $row;\n }", "function subject_data_obtain($report_subject)\n\t{\n\t\t$sql = 'SELECT forum_id\n\t\t\tFROM ' . BB_POSTS . '\n\t\t\tWHERE post_id = ' . (int)$report_subject;\n\t\tif (!$result = DB()->sql_query($sql)) {\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not obtain report subject data', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\t$row = DB()->sql_fetchrow($result);\n\t\tDB()->sql_freeresult($result);\n\n\t\treturn $row;\n\t}", "function getThemengebietesById($messageId)\n\t{\n\t\t$strMessage = '';\n\t\t$resMessage = $GLOBALS['TYPO3_DB']-> exec_SELECTquery('title', 'tx_topic_detail', 'uid='.$messageId);\n\t\tif($rowMessage = mysql_fetch_array($resMessage)) {\n\t\t\t$strMessage = mb_convert_encoding($rowMessage['title'], 'UTF-8', 'HTML-ENTITIES');\n\t\t}\n\t\t\n\t\treturn $strMessage;\n\t}", "function getSubject($code) {\n $con = getConnection();\n $sql = \"SELECT email_subject FROM email_text_tab WHERE email_code = ?;\";\n $subject = \"\";\n if ($stmt = mysqli_prepare($con, $sql)) {\n mysqli_stmt_bind_param($stmt, \"s\", $code);\n mysqli_stmt_execute($stmt); \n mysqli_stmt_bind_result($stmt, $result);\n while(mysqli_stmt_fetch($stmt)) {\n $subject = $result;\n }\n mysqli_stmt_close($stmt);\n }\n closeConnection($con);\n return $subject;\n }", "abstract public function get_subject();", "function getSubject() {\n\t\treturn $this->getData('subject');\n\t}", "function getSubject() {\n\t\treturn $this->getData('subject');\n\t}", "protected function get_primary_column_name() {\n\n\t\treturn 'subject';\n\t}", "public function getSubject()\n {\n return $this->hasOne(Subject::className(), ['subject_id' => 'subject_id']);\n }", "public function getSubject(): string;", "public function getSubjectData()\n {\n return PerchUtil::json_safe_encode($this->subject->toArray());\n }", "public function renderSubjectCell()\n {\n\n $subjlink = CHtml::link(CHtml::encode($this->subject), $this->url);\n $authorlink = Users::model()->getUsernameWithLink($this->author_id, true);\n\n return '<div class=\"name\">' . $subjlink . '</div>' .\n '<div class=\"level2\"><small>' . $authorlink . ' ' . AlexBond::time_since(time() - $this->created) . '</small></div>';\n }", "function Subject( $subject )\r\n\t\t{\r\n//echo \"$subject\";\r\n\t\t$this->msubject = \"=?utf-8?B?\"\r\n\t\t\t. base64_encode( strtr( $subject, \"\\r\\n\" , \" \" ) )\r\n\t\t\t. \"?=\";\r\n\t\t}", "abstract function getSubject() : string;", "public function getSubject($subjectId) {\n $subject = null;\n $sql = 'SELECT title FROM `hotornot-dev`.tblChallengeSubjects WHERE id = ?';\n $params = array( $subjectId );\n $stmt = $this->prepareAndExecute($sql, $params);\n $data = $stmt->fetchAll( PDO::FETCH_CLASS, 'stdClass' );\n if( $data ){\n $subject = $data[0]->title;\n }\n return $subject;\n }", "public function subject()\n {\n return $this->hasOne(Subject::class,\n SchemaConstant::PRIMARY_KEY,\n SchemaConstant::SUBJECT_FOREIGN_KEY);\n }", "public function getSubjectRaw( $params ) {\n\t\treturn empty( $params['subject_escaped'] ) ? @$params['subject'] : $this->unhtmlspecialchars( @$params['subject'] );\n\t}", "public static function fetchSubject($user_id, $uuid)\n\t{\n\t\t$result = NULL;\n\t\t$user = User::model()->findByPk($user_id);\n\t\t$subjects = $user->subjects;\n\t\tif (count($subjects) > 0) {\n\t\t\tforeach ($subjects as $subject) {\n\t\t\t\tif ($subject->uuid == $uuid) {\n\t\t\t\t\t$result = $subject;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "function get_subject_info($subject_id){\n $query = $this->db->get_where('subject', array('subject_id'=> $subject_id));\n return $query->result_array();\n }", "public function getSubjectByStreamId($stream_id)\n\t{\n\t\t $this->db->where('stream_id', $stream_id);\n\t\t$query=$this->db->get('subject');\n\t\treturn $query->result();\n\t}", "function setEmailSubject($emailId, $subject) {\n if ($this->connectToMySql()) {\n $query = sprintf(\"UPDATE scuola.email_store\n SET subject = \\\"%s\\\" WHERE id_email = %s\", mysql_real_escape_string($subject), ($emailId));\n\n // Perform Query\n $result = mysql_query($query);\n if (!$result) {\n setcookie('message', mysql_error());\n }\n }\n $this->closeConnection();\n return $result;\n }", "protected function _subject($additional = array()) {\n\t\treturn $this->_crud()->getSubject($additional);\n\t}", "function getEmailSubject($emailId) {\n if ($this->connectToMySql()) {\n $query = sprintf(\"SELECT subject FROM scuola.email_store WHERE id_email = %s\", $emailId);\n\n // Perform Query\n $result = mysql_query($query);\n if (!$result) {\n setcookie('message', mysql_error());\n }\n $row = mysql_fetch_assoc($result);\n $subject = $row['subject'];\n }\n $this->closeConnection();\n return ($subject == null || strlen($subject) == 0) ? '<NO SUBJECT>' : test_input($subject);\n }", "function subjectData() {\r\n\t\t$sql = \"SELECT a.*, s.*, f.*, c.*\r\n\t\t\tFROM assignment a \r\n\t\t\tINNER JOIN subject s ON s.subjectid = a.subjectid\r\n\t\t\tINNER JOIN audio_file f ON f.audioid = a.audioid\r\n\t\t\tINNER JOIN audio_category_bridge ac ON ac.audioid = a.audioid\r\n\t\t\tINNER JOIN audio_category c ON c.categoryid = ac.categoryid\r\n\t\tWHERE \r\n\t\t\t(a.active + s.active + f.active + c.active) = 4 \r\n\t\t\tAND s.subjectid = {$this->userid}\";\r\n\t\treturn $this->db->query($sql);\r\n\t}", "function getSubject(){\n\t\t\treturn $this->subject;\n\t\t}", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getOriginalSubject(): string\n {\n return $this->decodeForHeader($this->subject);\n }", "function sc_mailbox_message_subject($parm = '')\n {\n // if(e107::getParser()->filter($_GET['id']))\n // {\n // return $this->var['message_subject'];\n // }\n\n \n $urlparms = array(\n 'id' => $this->var['message_id'],\n );\n\n // Check if draft, because then it requires a link to continue writing the message (compose)\n if(e107::getParser()->filter($_GET['page']) == 'draftbox')\n {\n $url = e107::url('mailbox', 'composeid', $urlparms);\n }\n else\n {\n $url = e107::url('mailbox', 'read', $urlparms);\n }\n\n if($parm['type'] == 'url')\n {\n return $url; \n }\n\n return $this->var['message_subject']; \n \n }", "function encodeSubject($text)\n {\n return $text;\n }", "public function get_single_subject($id){\n $query = $this->db->get_where('msit_tb_subject', array('id' => $id));\n // return $query->row();\n if ($query->num_rows()==1) {\n return $query->row();\n }\n else {\n return FALSE;\n }\n }", "public function getSubjectID()\n {\n return $this->subject->getID();\n }", "protected function prepareSubject(Mail\\Message $message) {\r\n\t\t$headers = $message->getHeaders ();\r\n\t\tif (! $headers->has ( 'subject' )) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t$header = $headers->get ( 'subject' );\r\n\t\treturn $header->getFieldValue ( HeaderInterface::FORMAT_ENCODED );\r\n\t}", "function getContactUsSubjects() {\n return array(\n '0' => 'I would like to know the advertising prices',\n '1' => 'I would like to know how to create my profile',\n '2' => 'I would like to make a booking with an escort',\n '3' => 'Problems logging in',\n '4' => \"I didn't recieve my activation email\",\n '5' => 'Technical Support',\n '6' => 'Other'\n );\n}", "protected function _translateRow(array $data, $key = null)\n {\n $newData = array();\n\n $newData['topic_id'] = $data['thread_id'];\n if( $data['forum_id'] )\n $newData['forum_id'] = $data['forum_id'];\n $newData['user_id'] = $data['user_id'];\n $newData['title'] = $data['title'];\n $newData['closed'] = $data['is_closed'];\n $newData['creation_date'] = $this->_translateTime($data['time_stamp']);\n $newData['modified_date'] = $this->_translateTime($data['time_update']);\n $newData['sticky'] = $data['order_id'];\n $newData['lastposter_id'] = $data['last_user_id'] ? $data['last_user_id'] : $data['user_id'];\n $newData['view_count'] = $data['total_view'];\n $type_id = '';\n //FIND WHEATER THIS FORUM IS PAGES FORUM AND FIND PAGES TYPE\n if( !$data['forum_id'] ) {\n $type_id = $this->getFromDb()->select()\n ->from($this->getfromPrefix() . 'pages', 'type_id')\n ->where('page_id = ?', $data['group_id'])\n ->query()\n ->fetchColumn();\n }\n $albumTitle = 'Forum Photos';\n $isGroupForum = false;\n if( !empty($type_id) ) {\n\n $newData['group_id'] = $data['group_id'];\n $albumTitle = 'Group Photos';\n $isGroupForum = true;\n //INSERT GROUP FORUM TOPIC\n $this->getToDb()->insert('engine4_group_topics', $newData);\n } else {\n //INSERT THE FORUM TOPIC\n $this->getToDb()->insert('engine4_forum_topics', $newData);\n }\n\n $topic_id = $this->getToDb()->lastInsertId();\n //FIND ALL THE POST OF THIS TOPIC\n $posts = $this->getFromDb()->select()\n ->from($this->getfromPrefix() . 'forum_post', '*')\n ->where('thread_id = ?', $data['thread_id'])\n ->query()\n ->fetchAll();\n $newPostData = array();\n $count = 0;\n //INSERT ALL THE POST OF TOPIC\n foreach( $posts as $post ) {\n //GETTING TEXT\n $text = $this->getFromDb()->select()\n ->from($this->getfromPrefix() . 'forum_post_text', 'text')\n ->where('post_id = ?', $post['post_id'])\n ->query()\n ->fetchColumn();\n\n if( is_null($text) || $text === false )\n $text = '';\n\n $userInfo = array(\n 'user_id' => $post['user_id'],\n 'time_stamp' => $post['time_stamp'],\n 'text' => $text,\n 'item_id' => $post['post_id'],\n 'album_title' => $albumTitle,\n 'album_type' => 'forum',\n 'categoryId' => 'forum'\n );\n if( !empty($type_id) ) {\n $userInfo['page_id'] = $data['group_id'];\n $userInfo['album_table'] = 'group_albums';\n }\n //FIND THE POST BODY\n $body = $this->getBody($userInfo);\n if( is_null($body) )\n $body = '';\n\n $newPostData['post_id'] = $post['post_id'];\n $newPostData['topic_id'] = $data['thread_id'];\n if( $data['forum_id'] )\n $newPostData['forum_id'] = $data['forum_id'];\n $newPostData['user_id'] = $post['user_id'];\n $newPostData['body'] = $body;\n $newPostData['creation_date'] = $this->_translateTime($post['time_stamp']);\n $newPostData['modified_date'] = $post['update_time'] ? $this->_translateTime($post['update_time']) : $this->_translateTime($post['time_stamp']);\n// INSERT THE FORUM POST\n if( $isGroupForum ) {\n $newPostData['group_id'] = $data['group_id'];\n $this->getToDb()->insert('engine4_group_posts', $newPostData);\n } else {\n $this->getToDb()->insert('engine4_forum_posts', $newPostData);\n }\n $post_id = $this->getToDb()->lastInsertId();\n //UPDATE THE COUNT OF POST INTO THE TOPIC\n if( $isGroupForum ) {\n $this->getToDb()->update('engine4_group_topics', array(\n 'lastpost_id' => $post_id,\n 'post_count' => ++$count\n ), array(\n 'topic_id = ?' => $topic_id\n ));\n } else {\n $this->getToDb()->update('engine4_forum_topics', array(\n 'lastpost_id' => $post_id,\n 'post_count' => ++$count\n ), array(\n 'topic_id = ?' => $topic_id,\n 'forum_id = ?' => $data['forum_id'],\n ));\n }\n }\n //PREPARE AN ARRAY FOR TOPIC WATCHES\n $newWatchData = array();\n if( $data['forum_id'] )\n $newWatchData['resource_id'] = $data['forum_id'];\n\n $newWatchData['topic_id'] = $data['thread_id'];\n $newWatchData['user_id'] = $data['user_id'];\n $newWatchData['watch'] = 1;\n if( $isGroupForum ) {\n $newWatchData['resource_id'] = $data['group_id'];\n $this->getToDb()->insert('engine4_group_topicwatches', $newWatchData);\n } else {\n $this->getToDb()->insert('engine4_forum_topicwatches', $newWatchData);\n }\n\n if( $data['forum_id'] ) {\n //PREPARE AN ARRAY FOR TOPIC VIEW\n $newTopicViewsData = array();\n $newTopicViewsData['user_id'] = $data['user_id'];\n $newTopicViewsData['topic_id'] = $data['thread_id'];\n $newTopicViewsData['last_view_date'] = $this->_translateTime($data['time_stamp']);\n $this->getToDb()->insert('engine4_forum_topicviews', $newTopicViewsData);\n //FIND THE FORUM DETAIL\n $forums = $this->getFromDb()->select()\n ->from($this->getfromPrefix() . 'forum', '*')\n ->where('forum_id = ?', $data['forum_id'])\n ->where('thread_id = ?', $data['thread_id'])\n ->query()\n ->fetchAll();\n //UPDATE THE POST COUNT INTO THE FORUM\n foreach( $forums as $forum ) {\n $this->getToDb()->update('engine4_forum_forums', array(\n 'topic_count' => $forum['total_thread'],\n 'post_count' => $forum['total_post'] + 1,\n 'lastpost_id' => $post_id,\n 'lastposter_id' => $forum['last_user_id'],\n ), array(\n 'forum_id = ?' => $data['forum_id'],\n ));\n }\n }\n }", "public function subject()\n {\n return $this->belongsTo(\n __NAMESPACE__ . '\\Subject', 'email_subject_id', 'id'\n );\n }", "abstract protected function getSubject();", "public function getSubjectTemplateID() {\n\n\t\t\t$sql = new DB_Sql();\n\t\t\t$sql->connect();\n\t\t\t$query = \"SELECT template_id FROM webmatrix_page_template WHERE basename = '\".$this->subject_tpl.\"'\"; // Get template ID\n\t\t\t$sql->query($query, $this->debug);\n\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\twhile($sql->next_record()) {\n\t\t\t\t\t$this->subject_tpl_id = $sql->Record['template_id'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t}", "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}", "public function getSubject() \r\n { \r\n return $this->_subject; \r\n }", "function readName(){\r\n $query = \"SELECT SubjectName\r\n FROM \" . $this->table_name . \r\n \" WHERE SubjectID = ? limit 0,1\";\r\n $stmt = $this->dbConn->prepare( $query );\r\n // CHANGE - SubjectID should probably be just 'ID'\r\n $stmt->bindParam(1, $this->SubjectID);\r\n $stmt->execute();\r\n \r\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n \r\n $this->SubjectName = $row['SubjectName'];\r\n }", "public function subject()\n\t{\n\t\treturn $this->belongsTo(Subject::class);\n\t}", "public function getSubject()\n {\n }", "public function getSubjectAttribute()\n {\n if (isset($this->_subject)) {\n return $this->_subject;\n }\n\n return null;\n }", "function get_subject_info($subject_id)\n\t{\n\t\t$query = $this->db->query('select subject_id, subject_code, subject_name, group_name from subject a, subject_group b where a.sub_group_id= b.group_id AND subject_id = '.$subject_id);\n\t\treturn $query->result_array();\n\t}", "protected function getEmailSubject() {}", "protected function _getSubject($iLang)\n {\n return $this->getContent();\n }", "public function getSubject(): string\n {\n return $this->subject;\n }", "function encodeSubject($text)\r\n\t{\r\n\t\t// Activate tanya following line manka antaed\r\n\t\t// $text = \"=?{$sina->charSet}?B?\".base64_encode($text).\"?=\";\r\n\t\treturn $text;\r\n\t}", "private function retrieveSubject() : string {\n\n // Get header of current email\n $header = $this->getHeader();\n\n // Return the subject in \"ASCII\" format\n return $this->decodeMimeHeaderExtension($header->subject, false);\n }", "function question_opt($subject){\n $sql = 'select question_content,id from t_question where question_subject like ? and status =1 order by id';\n return $this->db->query($sql,array(\"%$subject%\"))->result();\n }", "public function getdistringsubject()\n\t{\n\t\t$this->db->distinct();\n\t\t$this->db->select('gen_type');\n\t\t$this->db->order_by('gen_type', 'asc');\n\t\t$query=$this->db->get('admission_erp');\n\t\treturn $query->result();\n\t}", "protected function prepareSubject(\\Zend\\Mail\\Message $message)\n {\n $headers = $message->getHeaders();\n if (!$headers->has('subject')) {\n return;\n }\n $header = $headers->get('subject');\n\n return $header->getFieldValue(HeaderInterface::FORMAT_ENCODED);\n }", "public function getTitleFromTopicCode($topic_code) {\n\n\t\t\t$sql = new DB_Sql();\n\t\t\t$sql->connect();\n\t\t\t\n\t\t\t$topic_code = mysql_real_escape_string($topic_code, $sql->Link_ID);\n\n\t\t\t$query = \"SELECT Description FROM tblsubject WHERE ID = '$topic_code'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$title = '';\n\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\twhile($sql->next_record()) {\n\t\t\t\t\t$title = $sql->Record['Description'];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $title;\n\n\t\t}", "public function getSubject(): string\n {\n return 'mailingSubject';\n }", "public function getSubject()\n {\n return $this->config['Message']['Subject']['Data'];\n }", "private static function get_email_subject($user_data)\n {\n }", "public function subject()\n {\n return $this->belongsTo('App\\Models\\Subject');\n }", "public function subject(){\n return $this->belongsTo('App\\Models\\Clazz','subject_id');\n }", "function DecodeMessage($mid) {\n\n\t\t//Select Message to Decode\n $msgq = \"SELECT Message FROM Messages WHERE mid = $mid\";\n $msgqu = $this->query($msgq);\n //while ($row = sqlsrv_fetch_array($msgqu, SQLSRV_FETCH_ASSOC)) {\n\t\tforeach ($msgqu as $row){\n $Message = $row['Message'];\n }\n\n\t\t//Decode the HTML\n $dmsg = html_entity_decode($Message);\n\n\t\t//Echo the Message\n echo \"<br>Decoded Message:<br> \" . $dmsg . \"\";\n }", "public function getSubject() \n\t{\n\t\treturn $this->subject;\n\t}", "public function getSubject() : string {\n return $this->_subject;\n }", "function subjectName($id){\n\t$con = mysqli_connect('localhost','root','','e-examsproject');\n\t$subject_query_with_id = mysqli_query($con,\"SELECT * FROM subjects where id = '\".$id.\"' \");\n\t$subject_query_with_id_result = mysqli_fetch_all($subject_query_with_id,MYSQLI_ASSOC);\n\t\n\treturn $subject_query_with_id_result[0]['name'];\n}", "function getSubject()\n {\n return $this->_subject;\n }", "function the_ticket_subject() {\n\n // Get ticket\n $ticket = md_the_component_variable('support_single_ticket');\n\n // Verify if ticket exists\n if ( $ticket ) {\n return $ticket[0]['subject'];\n } else {\n return false;\n }\n \n }", "public function getOneTopic()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$data_type = array();\n\t\t$data_value = array();\n\t\t\n\t\t$query = 'SELECT * FROM frm_data 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\n\t\t\t$res = $ilDB->queryf($query, $data_type, $data_value);\t\t\t\n\t\t\t$row = $ilDB->fetchAssoc($res);\n\t\t\t\n\t\t\tif(is_null($row)) return NULL;\n\t\t\t\n\t\t\t$row[\"top_name\"] = trim($row[\"top_name\"]);\n\t\t\t$row[\"top_description\"] = nl2br($row[\"top_description\"]);\n\n\t\t\treturn $row;\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\t\t\t\n\t\t\t$query .= '1 = 1';\n\t\t\n\t\t\t$res = $ilDB->query($query);\t\t\t\n\t\t\t$row = $ilDB->fetchAssoc($res);\n\t\t\t\n\t\t\tif(!is_array($row) || !count($row)) return null;\n\t\t\t\n\t\t\t$row['top_name'] = trim($row['top_name']);\n\t\t\t$row['top_description'] = nl2br($row['top_description']);\n\t\n\t\t\treturn $row;\t\t\t\n\t\t}\n\t}", "function fetchTeacherSubjects($academicid, $teacherid, $sortorder = '', $sortfield = '', $limit = 0, $offset = 0) {\n global $db, $conf;\n dol_syslog(__METHOD__, LOG_DEBUG);\n $table_element = 'educo_teacher_subject';\n $sql = 'SELECT';\n $sql .= ' t.rowid,';\n $sql .= \" t.ref,\";\n $sql .= \" t.label,\";\n $sql .= \" t.status,\";\n $sql .= \" t.datec,\";\n $sql .= \" t.tms,\";\n $sql .= \" t.asignature_code,\";\n $sql .= \" t.fk_user,\";\n $sql .= \" t.fk_academicyear,\";\n $sql .= \" t.entity,\";\n $sql .= \" t.hours,\";\n $sql .= \" s.label as subject_label\";\n $sql .= ' FROM ' . MAIN_DB_PREFIX . $table_element . ' as t';\n $sql .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'edcuo_c_asignatura AS s ON asignature_code=s.code';\n // Manage filter\n\n $sql .= ' WHERE 1 = 1';\n $sql .= ' AND t.fk_academicyear = ' . $academicid;\n $sql .= ' AND t.fk_user = ' . $teacherid;\n if (!empty($conf->multicompany->enabled)) {\n $sql .= \" AND entity IN (\" . getEntity(\"educoteachersubject\", 1) . \")\";\n }\n\n if (!empty($sortfield)) {\n $sql .= $db->order($sortfield, $sortorder);\n }\n if (!empty($limit)) {\n $sql .= ' ' . $db->plimit($limit + 1, $offset);\n }\n //var_dump($sql);\n $lines = array();\n\n $resql = $db->query($sql);\n if ($resql) {\n $num = $db->num_rows($resql);\n\n while ($obj = $db->fetch_object($resql)) {\n\n\n $lines[] = $obj;\n }\n $db->free($resql);\n //var_dump(count($lines));\n return $lines;\n } else {\n // print 'Error ' . $db->lasterror();\n // dol_syslog(__METHOD__ . ' ' . implode(',', $errors), LOG_ERR);\n\n return - 1;\n }\n}", "public function getSubject(): mixed\n {\n return $this->subject;\n }", "public function getSubjectTitle(): ?string {\n $val = $this->getBackingStore()->get('subjectTitle');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'subjectTitle'\");\n }", "public function updateSubjects() {\n\n\t\t\t$sql = new DB_Sql();\n\t\t\t$sql->connect();\n\n\t\t\t// update news and event subject topic code assignments\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'CONSTRBUI' WHERE text = 'BUILDSERV'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'CONSTRBUI' WHERE text = 'CNSTRCRAFT'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'ENGMATHICT' WHERE text = 'ENGMATH'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'HAIRBEAU' WHERE text = 'HAIRBEAUSP'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'FORGNLANG' WHERE text = 'MODERNLANG'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'APMEDFRSCI' WHERE text = 'SCIENCES'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'N/A' WHERE text = 'SOCSCIENCE'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'N/A' WHERE text = 'TU'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'N/A' WHERE text = 'YNGPEOPCOL'\";\n\t\t\t$sql->query($query, $this->debug);\n\n\t\t\t// update tblunit courses to use their new sujbect topic codes\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'CONSTRBUI' WHERE Subject_ID = 'BUILDSERV'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'CONSTRBUI' WHERE Subject_ID = 'CNSTRCRAFT'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'ENGMATHICT' WHERE Subject_ID = 'ENGMATH'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'HAIRBEAU' WHERE Subject_ID = 'HAIRBEAUSP'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'FORGNLANG' WHERE Subject_ID = 'MODERNLANG'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'APMEDFRSCI' WHERE Subject_ID = 'SCIENCES'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'N/A' WHERE Subject_ID = 'SOCSCIENCE'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'N/A' WHERE Subject_ID = 'TU'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'N/A' WHERE Subject_ID = 'YNGPEOPCOL'\";\n\t\t\t$sql->query($query, $this->debug);\n\n\t\t\t// Delete invalid subjects - will not delete any courses or assignments as we've updated them to use correct topic codes in previous steps\n\t\t\t$query = \"DELETE FROM tblsubject WHERE ID IN ('BUILDSERV','CNSTRCRAFT','ENGMATH','HAIRBEAUSP','MODERNLANG','SCIENCES','SOCSCIENCE','YNGPEOPCOL','TU')\";\n\t\t\t$sql->query($query, $this->debug);\n\n\t\t\t$query = \"DESCRIBE tblfees\";\n\t\t\t$sql->query($query, $debug = FALSE);\n\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\t$this->deleteOldTables(); // if old tables found: delete them\n\t\t\t}\n\n\t\t\t// Now we've updated courses - search for existing webmatrix pages using subject codes not in valid list - if found de-activate them.\n\t\t\t//$this->deleteInvalidSubjectPages();\n\n\t\t}", "function get_level_subject($id)\n {\n return $this->db->get_where('level_subjects',array('id'=>$id))->row_array();\n }", "function find_subject_by_id($selected_subject_id, $public = true) {\r\n\t\tglobal $db;\r\n\t\t// b/c we are receiving the subject id from the query string, we need to make sure it is safe to use.\r\n\t\t$safe_subject_id = mysqli_real_escape_string($db, $selected_subject_id);\r\n\t\t\r\n\t\t$query = \"SELECT * \";\r\n\t\t$query .= \"FROM subjects \";\r\n\t//\t$query .= \"WHERE visible = 1 \";\r\n\t\t$query .= \"WHERE id = {$safe_subject_id} \";\r\n\t\tif($public) {\r\n\t\t\t$query .= \"AND visible = 1 \";\r\n\t\t}\r\n\t\t$query .= \"LIMIT 1\";\r\n\t\t\r\n\t\t$subject_set = mysqli_query($db, $query);\r\n\t\tconfirm_query($subject_set);\r\n\t\t\r\n\t\t// Since we are returning only one specific row, we can perform the mysqli_fetch on the function side\r\n\t\t// and just return the associative array itself within $subject\r\n\t\tif($subject = mysqli_fetch_assoc($subject_set)) {\r\n\t\t\treturn $subject;\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public function subject()\n {\n return $this->belongsTo('App\\Subject');\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "private function createSubject()\n {\n $input = file_get_contents('subject.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/subjects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "public function getSubject()\n\t{\n\t\treturn $this->subject;\n\t}", "function tep_get_email_subjects_list($subjects_array = '') {\n if (!is_array($subjects_array)) $subjects_array = array();\n\n $subjects_query = tep_db_query(\"select email_subjects_id, email_subjects_name, email_subjects_category from \" . TABLE_EMAIL_SUBJECTS . \" where email_subjects_category = '2' order by email_subjects_name\");\n while ($subjects = tep_db_fetch_array($subjects_query)) {\n $subjects_array[] = array('id' => $subjects['email_subjects_name'], 'text' => $subjects['email_subjects_name']);\n }\n\n return $subjects_array;\n }", "function getSubject($locale) {\n\t\treturn isset($this->localeData[$locale]['subject']) ? $this->localeData[$locale]['subject'] : '';\n\t}", "public function topic()\n\t{\n\t\treturn $this->belongs_to('Forumtopic', 'forumtopic_id');\n\t}" ]
[ "0.619802", "0.6001956", "0.5975424", "0.561473", "0.5539607", "0.553472", "0.55325335", "0.55325335", "0.5529022", "0.5519426", "0.5517631", "0.5487055", "0.54284054", "0.53972363", "0.5377242", "0.5360678", "0.5346992", "0.5340689", "0.5332699", "0.5331949", "0.53112787", "0.53077537", "0.5305618", "0.52854246", "0.52805275", "0.5242821", "0.52403945", "0.52403945", "0.52403945", "0.52403945", "0.52403945", "0.52403945", "0.52403945", "0.52344966", "0.5228685", "0.5224219", "0.52055836", "0.52014136", "0.5179317", "0.5174082", "0.5163159", "0.5147277", "0.5146531", "0.51455", "0.51399356", "0.5134136", "0.51216495", "0.51155066", "0.5112322", "0.5105387", "0.509376", "0.50874615", "0.50847703", "0.5077627", "0.506081", "0.50573885", "0.5037995", "0.5031011", "0.50181615", "0.50175774", "0.50155175", "0.50136614", "0.49836767", "0.49794868", "0.49709427", "0.49505004", "0.49453378", "0.49439883", "0.4941498", "0.4937922", "0.49243334", "0.4920243", "0.49183744", "0.49152935", "0.49126875", "0.49105638", "0.49095222", "0.490348", "0.49021202", "0.48957345", "0.48957345", "0.48957345", "0.48957345", "0.48957345", "0.48957345", "0.48957345", "0.48957345", "0.48957345", "0.48957345", "0.48957345", "0.48957345", "0.48957345", "0.48957345", "0.48957345", "0.48957345", "0.4880167", "0.48800904", "0.4877878", "0.4875162", "0.4874834" ]
0.59466463
3
translate database row to Role
public static function toRole($data) { return new Role( (int) Parse::clean($data->id), (string) Parse::clean($data->title) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRole()\n\t{\n\t\t$column = self::COL_ROLE;\n\t\t$v = $this->$column;\n\n\t\tif( $v !== null){\n\t\t\t$v = (string)$v;\n\t\t}\n\n\t\treturn $v;\n\t}", "function translate_level_to_role($level)\n {\n }", "public function getRole();", "public function getRole();", "public function getRole() {}", "public function getRole()\n {\n $res = $this->getEntity()->getRole();\n\t\tif($res === null)\n\t\t{\n\t\t\tSDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->create($this);\n\t\t\treturn $this->getEntity()->getRole();\n\t\t}\n return $res;\n }", "public static function getRole(){\n $role = Auth::user()->role_id ;\n switch($role){\n case 1 :\n return \"admin\";\n break;\n case 2 :\n return \"khateeb\";\n break ;\n case 3 :\n return \"ad\";\n break;\n default:\n return \"false\";\n }\n }", "private function _getRole()\n {\n //return role\n if(false/*logged_in*/){\n\n }else{\n $this->load->Model('user_roles/Mdl_roles');\n return $this->Mdl_roles->getRolesName();\n }\n }", "function get_user_role() {\n global $current_user;\n $user_roles = $current_user->roles;\n $user_role = array_shift($user_roles);\n return $user_role; // return translate_user_role( $user_role );\n}", "public function getRole() : string;", "protected function _getRole(){\n\t$user = new Pas_User_Details();\n $person = $user->getPerson();\n if($person){\n \treturn $person->role;\n } else {\n \treturn false;\n }\n }", "public function getRoleCode(){\n\t\t/* return user code */\n\t\treturn $this->_intRoleCode;\n\t}", "public function get_role()\n {\n }", "public function getRole() {\n $user = new Pas_User_Details();\n $person = $user->getPerson();\n if ($person) {\n $this->_role = $person->role;\n } \n return $this->_role;\n }", "function jr_translate_role( $role ) {\r\n\tglobal $wp_roles;\r\n\r\n\t$roles = $wp_roles->get_names();\r\n\r\n\t$translated_roles = array(\r\n\t\t'job_lister' => __('Job Lister',APP_TD),\r\n\t\t'job_seeker' => __('Job Seeker',APP_TD),\r\n\t\t'recruiter' => __('Recruiter',APP_TD),\r\n\t);\r\n\r\n\tif ( !array_key_exists($role, $translated_roles) ) return $roles[ $role ];\r\n\r\n\treturn $translated_roles[ $role ];\r\n\r\n}", "public function getRole() \n {\n return $this->_fields['Role']['FieldValue'];\n }", "function yourls_translate_user_role( $name ) {\n\treturn yourls_translate_with_context( $name, 'User role' );\n}", "public function getROLE()\n {\n return $this->hasOne(Role::className(), ['id' => 'ROLE']);\n }", "function getRole() {\n\t\treturn 1;\n\t}", "static function getRole(&$rsData)\n {\n return $rsData['role'];\n }", "function getRole($uid,$rid){\n\t$sql = \"SELECT \tr.id,r.name\n\t\t\t\t from \t\tadministrador a,roles r\n\t\t\t\t\twhere \ta.Rol = r.id\n\t\t\t\t\tand\t\t\ta.Rol = $rid\n\t\t\t\t\tand \t\ta.IdAdministrador = $uid\";\n\t\n\t$result = mysql_query($sql) or die('Error :'.mysql_error());\n\t\t\n\twhile($row = mysql_fetch_object($result))\n\t{\n\t $rid = $row->id;\n\t $rname = $row->name;\n\t}\n\t\t\n\tif(trim($rname) == \"Superadmin\"){\n\t\t$role = 1;\n\t}\n\telse{\n\t\t$role = 0;\n\t}\n\treturn $role;\t\t\t\t\n}", "public function get_role($role)\n {\n }", "public function getRole(): int\n {\n return $this->role;\n }", "function get_role($role_id) {\n\t\treturn $this->db->get_where('system_security.security_role', array('role_id' => $role_id));\n\t\t\n\t}", "function translate_user_role($name, $domain = 'default')\n {\n }", "public function getRoleId()\n {\n return $this->db->get('role_id')->result_array();\n }", "public function getRoleId()\n {\n return $this->__get(\"role_id\");\n }", "public function getRole(){\n return $this->role; \n }", "function IdRole($name)\n {\n $role = Catalogo::select('id')->table('ROLES')->where('codigo',$name)->first();\n return $role->id;\n }", "public function getRoleId()\n {\n return $this->role_id;\n }", "public function getRoleId()\n {\n return $this->role_id;\n }", "public function to($role);", "protected function populateItemName($row) : \\yii\\rbac\\Item\n {\n $class = Role::className();\n $type = 'Role';\n switch ($row['type']){\n case Item::TYPE_PERMISSION;\n $class = Permission::className();\n $type = 'Permission';\n break;\n case Item::TYPE_FEATURE;\n $class = Feature::className();\n $type = 'Feature';\n break;\n }\n\n if (!isset($row['data']) || ($data = @unserialize($row['data'])) === false) {\n $data = null;\n }\n\n\n return new $class([\n 'name' => Inflector::titleize( $row['name']),\n 'type' => $type,\n 'description' => $row['description'],\n 'ruleName' => $row['rule_name'],\n 'data' => $data,\n 'createdAt' => date('Y-m-d', $row['created_at']),\n 'updatedAt' => date('Y-m-d',$row['updated_at']),\n 'createdBy' => $row['created_by'],\n 'updatedBy' => $row['updated_by'],\n ]);\n }", "function getRole()\n\t{\n\t\tif (($role = $this->getState('__role')) !== null)\n\t\t\treturn $this->role;\n\t\telse\n\t\t\treturn 0;\n\t}", "public function getRoleID(string $role):string;", "function get_role_id(){\n return $this->role_id;\n }", "private function getUserRole($id) { \n $dv_role = Yii::$app->db->createCommand(\"SELECT meta_value FROM assist_user_meta WHERE uid = '$id' AND meta_key = 'role'\")->queryAll();\n return $dv_role;\n }", "public function getRole(){\r\n\t\t\treturn $this->role;\r\n\t\t}", "public function roleFieldName() {\n return 'role';\n }", "public function _getRoleID()\n {\n $this->selftest();\n return $this->objectUser->RoleID;\n }", "function get_user_role($u_id){\n\t\t$this->db->select($this->flexi_auth->db_column('user_acc', 'group_id'));\t\n\t\t$this->db->where($this->flexi_auth->db_column('user_acc', 'id'),$u_id);\t\n\t\t$qres=$this->db->get($this->auth->tbl_user_account);\n\t\tif ($qres->num_rows() > 0) {\n\t\t\t$row=$qres->row_array();\n\t\t\t//$this->firephp->log($row['uacc_group_fk'].\"for email=\".$email);\n\t\t\tswitch ($row['uacc_group_fk']){\n\t\t\t\tcase (1):\n\t\t\t\t\treturn \"Parent\";\n\t\t\t\tcase (2):\n\t\t\t\t\treturn \"Student\";\n\t\t\t\tcase (3):\n\t\t\t\t\treturn \"Admin\";\n\t\t\t\tdefault:\n\t\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n\t}", "public function getRole()\n {\n return $this->_getVar('user_role');\n }", "public function getRole() {\n return($this->role);\n }", "protected function buildDomainObject($row) {\n $role = new Role();\n $role->setId($row['id']);\n $role->setNom($row['nom']);\n $role->setDescription($row['description']);\n $role->setActif($row['actif']);\n $role->setLastUpdate($row['last_update']);\n \n return $role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function selectRole($rid)\n {\n $result = $this->sdb->query(\"select * from role where id=$1\",\n array($rid));\n $row = $this->sdb->fetchrow($result);\n $row['pid_list'] = $this->selectRolePrivilegeList($row['id']);\n return $row;\n }", "function owa_translate_role($roles) {\r\n\t\r\n\tif (!empty($roles)) {\r\n\t\r\n\t\tif (in_array('administrator', $roles)) {\r\n\t\t\t$owa_role = 'admin';\r\n\t\t} elseif (in_array('editor', $roles)) {\r\n\t\t\t$owa_role = 'viewer';\r\n\t\t} elseif (in_array('author', $roles)) {\r\n\t\t\t$owa_role = 'viewer';\r\n\t\t} elseif (in_array('contributor', $roles)) {\r\n\t\t\t$owa_role = 'viewer';\r\n\t\t} elseif (in_array('subscriber', $roles)) {\r\n\t\t\t$owa_role = 'everyone';\r\n\t\t} else {\r\n\t\t\t$owa_role = 'everyone';\r\n\t\t}\r\n\t\t\r\n\t} else {\r\n\t\t$owa_role = 'everyone';\r\n\t}\r\n\t\r\n\treturn $owa_role;\r\n}", "public function getRole() \n {\n return $this->role;\n }", "public function UpdateRole($data)\n {\n $sql = \"UPDATE USER SET role=? WHERE rowid=?\";\n $resutl = $this->getDb()->fetchAssoc($sql, array($data['role'], $data['id']));\n return $resutl;\n }", "public function getRole() : string\n {\n return $this->role;\n }", "function get_role_list() {\n\t\treturn $this->db->get('system_security.security_role');\n\t\t\n\t}", "function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n $userIdentity = $this->getIdentity();\n if ($userIdentity === false) {\n return false;\n }\n return $userIdentity->role;\n }", "function getToRoleId() {\n\t\treturn $this->getData('toRoleId');\n\t}", "function getUserRole($user_id){\n $this->db->select('role_id');\n $this->db->from('users');\n $this->db->where('id', $user_id); \n $query = $this->db->get();\n\n return $query->row(); \n }", "public static function userRole()\n\t{\n\t\ttry {\n\t\t\tif(Auth::user()->roles) {\n\t\t\t\treturn ucfirst(Auth::user()->roles->role->name);\n\t\t\t} else {\n\t\t\t\treturn 'User';\n\t\t\t}\n\t\t\treturn 'User';\n\t\t} catch (\\Throwable $th) {\n\t\t\tLog::error('error on userRole in CommanHelper '. $th->getMessage());\n\t\t}\n\t}", "public function getRole()\n {\n return $this->hasOne(Role::className(), ['id' => 'role_id']);\n }", "function getRole($index){\r\n //as we won't be using classes yet this is our (messy) work-around\r\n $ROLES = array('Student' => STUDENT,\r\n 'Lector' => LECTURER,\r\n 'Studieadviseur' => ADVISOR,\r\n 'Administrator' => ADMIN);\r\n foreach($ROLES as $role => $roleIndex){\r\n if($index == $roleIndex){\r\n return $role;\r\n }\r\n }\r\n}", "function &getToRoleName() {\n\t\t$roleDao =& DAORegistry::getDAO('RoleDAO');\n\t\treturn $roleDao->getRoleName($this->getToRoleId());\n\t}", "function getRole($userID) {\n $result = $this->db->dbQuery('Select roleID from User where userID=' . $userID);\n if ($result->num_rows > 0) {\n $finalResult = $result->fetch_assoc();\n return $finalResult['roleID'];\n } else return -1;\n }", "public function getRoleEntityClass();", "public function getRoleId()\n {\n return $this->roleId;\n }", "public function getRoleId()\n {\n return $this->roleId;\n }", "public function getRoleId()\n {\n return $this->roleId;\n }", "static public function getRole() {\n\t\tif(!Yii::$app->user->isGuest) {\n\t\t\tif($role = AuthAssignment::findOne(['user_id' => Yii::$app->user->identity->id]))\n\t\t\t\tif($key = array_search($role->item_name, Yii::$app->params['league_roles']))\n\t\t\t\t\treturn $key;\n\t\t\treturn self::DEFAULT_ROLE;\n\t\t}\n\t\treturn null;\n\t}", "public static function getUserRole(){\n\t\t$db = DemoDB::getConnection();\n $sql = \"SELECT *\n FROM user_role\";\n $stmt = $db->prepare($sql);\n $ok = $stmt->execute();\n if ($ok) {\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }\n\t}", "public function transform($role): string\n {\n return $role instanceof Role ? $role->getId() : '';\n }", "public function getRoleId() {\n return $this->roleId;\n }", "function get_user_role_id(){\n return $this->user_role_id;\n }", "public function getRole() {\n return $this->role;\n }", "public function actionUserRole ()\n\t\t{\n\t\t\t$userClass = $this->module->modelUser;\n\t\t\t$post = Yii::$app->request->post();\n\t\t\t$user = $userClass::findOne($post[ 'id' ]);\n\t\t\tif (!is_null($user))\n\t\t\t{\n\n\t\t\t\tLogManager::info(Yii::tr('Пользователю {user} забрали права {roles}', [ 'user' => Html::a($user->name, Url::toRoute([ 'user/view', 'id' => $user->id ])), 'roles' => implode(',', $user->getRolesNames()) ]));\n\t\t\t\t$user->revokeAllRoles();\n\t\t\t\tif (is_array($post[ 'roles' ]))\n\t\t\t\t{\n\t\t\t\t\tforeach ($post[ 'roles' ] as $item)\n\t\t\t\t\t{\n\t\t\t\t\t\t$user->assignRole($item);\n\t\t\t\t\t}\n\t\t\t\t\tLogManager::info(Yii::tr('Пользователю {user} добавили права {roles}', [ 'user' => Html::a($user->name, Url::toRoute([ 'user/view', 'id' => $user->id ])), 'roles' => implode(',', $post[ 'roles' ]) ]));\n\t\t\t\t}\n\t\t\t}\n\t\t\tYii::$app->end();\n\t\t}", "function getRole($roleId) {\n $statement = 'SELECT role FROM ROLE_LOV where id = (?)';\n $query = $this->prepare($statement);\n $query->execute([$roleId]);\n return $query->fetch();\n }", "function cs_get_user_role() {\n\tglobal $current_user;\n\t$user_roles = $current_user->roles;\n\t$user_role = array_shift($user_roles);\n\treturn $user_role;\n}", "public static function manageRole(){\n $rolelist = [];\n $db = Db::getInstance(); \t \n $req = $db->query('SELECT * FROM hp_role'); \n foreach($req->fetchAll() as $row) {\n $rolelist[] = $row;\n }\n return $rolelist;\n \n }", "public function getAdminRole($username){\n \n $result= $this->con->query(\"SELECT admin_role_idadmin_role AS role FROM admin WHERE username='\".$username.\"';\");\n $row=$result->fetch_assoc();\n $result=$row[\"role\"];\n return $result;\n }", "function get_user_roles()\n{\n $roles = get_acl()->getRoles();\n foreach ($roles as $key => $val) {\n $roles[$val] = __(Inflector::humanize($val));\n unset($roles[$key]);\n }\n return $roles;\n}", "protected function getIsRoleAttribute()\n {\n $dataRole = $this->attributes['role'];\n if ($dataRole === 0) {\n return \"Student\";\n } \n if ($dataRole === 1) {\n return \"Teacher\";\n }\n if ($dataRole === 3) {\n return \"Admin\";\n }\n return false;\n }", "public function getRoleId()\n {\n if (array_key_exists(\"roleId\", $this->_propDict)) {\n return $this->_propDict[\"roleId\"];\n } else {\n return null;\n }\n }", "protected function populateItem($row) : \\yii\\rbac\\Item\n {\n $class = null;\n $userId = 1;\n switch ($row['type']){\n case Item::TYPE_PERMISSION;\n $class = Permission::className();\n break;\n case Item::TYPE_FEATURE;\n $class = Feature::className();\n\n break;\n case Item::TYPE_ROLE;\n $class = Role::className();\n break;\n }\n\n if (!isset($row['data']) || ($data = @unserialize($row['data'])) === false) {\n $data = null;\n }\n\n if(! isset($row['created_by'])){\n $row['created_by'] = $userId;\n }\n\n if(! isset($row['updated_by'])){\n $row['updated_by'] = $userId;\n }\n\n return new $class([\n 'name' => $row['name'],\n 'type' => $row['type'],\n 'description' => $row['description'],\n 'ruleName' => $row['rule_name'],\n 'data' => $data,\n 'createdAt' => date('Y-m-d', $row['created_at']),\n 'updatedAt' => date('Y-m-d',$row['updated_at']),\n 'createdBy' => $row['created_by'],\n 'updatedBy' => $row['updated_by'],\n ]);\n }", "private function setRolesFromDB(){\n $connection = new Connection();\n $link = $connection->connect();\n $result = $link->query(\"SELECT role_id FROM user_has_role WHERE user_id = '$this->id'\");\n $roles = new UserRoles();\n foreach ($result as $record){\n $roles[] = new Role('id', $record['role_id']);\n }\n $this->setRoles($roles);\n $connection = null;\n }", "public function getRole(): ?string\n { \n return $this->role;\n }", "public function getRole(): string\n {\n $roles = RoleEnum::getConstants();\n\n return $roles[$this->role][1];\n }", "public function getRole(){\n\t\tif (current_user_can('editor')) {\n\t\t\t$this->role_object = get_role('editor');\n\t\t}\n\t}", "public function getRole() {\n\n return session('role');\n\n }", "public function actionRole()\n {\n foreach (USER::getRoleOptions() as $key => $val) {\n\n self::log(\"\\n\" . $val . ' Role-id is ' . $key . \"\\n\");\n }\n\n if (is_null($this->email)) {\n\n self::log('Email required ! (Hint -e=)');\n\n return ExitCode::DATAERR;\n }\n\n $model = User::findOne([\n 'email' => $this->email\n ]);\n\n if (is_null($model)) {\n\n self::log('User not found');\n\n return ExitCode::NOUSER;\n }\n\n if (is_null($this->role_id)) {\n\n self::log('Current Role Id is ' . $model->role_id . \"\\n\");\n self::log('Add correct Role id (Hint -r=)');\n\n return ExitCode::DATAERR;\n }\n\n if (is_null(ArrayHelper::getValue(USER::getRoleOptions(), $this->role_id))) {\n\n self::log('Please enter correct role id :');\n\n return ExitCode::DATAERR;\n }\n\n $model->role_id = $this->role_id;\n\n if (! $model->save()) {\n\n self::log('Please enter valid Role Id ');\n\n return ExitCode::DATAERR;\n }\n\n self::log($this->email . ' = Role Id successfully Updated !');\n\n return ExitCode::OK;\n }", "public function getUserRole()\r\n{\r\n $query_string = \"SELECT role FROM users \";\r\n $query_string .= \"WHERE userid = :userid\";\r\n\r\n return $query_string;\r\n}", "public function getRoleId()\n\t{\n\t\treturn $this->_roleId;\n\t}", "public function getRoleId()\n {\n return $this->RoleId;\n }", "function get_role($role_name){\n\t\tglobal $database;\n\t\t$getrolequery = \"SELECT id FROM roles WHERE role = :roleName\";\n\n\t\t$stmt = $database->prepare($getrolequery);\n\n\t\t$stmt->bindParam(':roleName', $role_name);\n\n\t\t$stmt->execute();\n\n\t\treturn $stmt->fetch();\n\t}", "public function rolesForUser();", "public function getAuthenticatedRole();" ]
[ "0.70421773", "0.674241", "0.67201006", "0.67201006", "0.6687683", "0.6643433", "0.6575945", "0.65338296", "0.6517904", "0.6514955", "0.64639443", "0.64161825", "0.6392676", "0.63348615", "0.62882066", "0.6280999", "0.6278904", "0.6251113", "0.62088037", "0.61973906", "0.61907035", "0.61640614", "0.6163783", "0.6156622", "0.61425525", "0.6131233", "0.612588", "0.6124109", "0.6103285", "0.6095418", "0.6095418", "0.60829794", "0.60645115", "0.60577863", "0.6047536", "0.60431963", "0.60391486", "0.6020144", "0.60187435", "0.60059756", "0.5991392", "0.5989262", "0.5971322", "0.5963752", "0.5953569", "0.5953569", "0.5953569", "0.5953569", "0.5953569", "0.5953569", "0.5953569", "0.5953569", "0.5953569", "0.5953569", "0.5953498", "0.5947547", "0.59418267", "0.59344697", "0.5931002", "0.5922277", "0.5906485", "0.59063125", "0.590392", "0.59012115", "0.58930486", "0.5884927", "0.58772504", "0.587654", "0.5871564", "0.5871124", "0.58570856", "0.58570856", "0.58570856", "0.585505", "0.5852898", "0.5851807", "0.58498245", "0.5840386", "0.5822979", "0.58228153", "0.58186024", "0.58180016", "0.5817582", "0.58160543", "0.5799377", "0.57971954", "0.57950383", "0.57829976", "0.5777619", "0.57735485", "0.57673395", "0.5766801", "0.57659173", "0.5763734", "0.5748376", "0.5739804", "0.572959", "0.5721685", "0.57137847", "0.57124317" ]
0.6548822
7
translate database row to News
public static function toNews($data) { $news = new News(); $news->setId(Parse::clean($data->id)); $news->setAuthorPK(Parse::clean($data->author)); $news->setTitle(Parse::clean($data->title)); $news->setMessage(Parse::clean($data->message)); $news->setCreated(Parse::clean($data->created)); return $news; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function frontpage_news_manual(&$db) {\n $newsq = $db->Execute(\"SELECT * FROM `frontpage_news`\");\n if($newsq->numrows()==0) return \"No news to show.\";\n\n while($item = $newsq->fetchrow()) {\n $news .= \"<div style='border:1px solid #CCC;margin:4px;padding:4px;-moz-border-radius-topright:12px;border-radius-topright:12px;'>\n <a>\".$item['title'].\"</a><br />\n <span style='font-size:10px;'>\".date(\"h:i A M jS\",$item['time']).\"</span>\n <p>\".$item['body'].\"</p></div>\";\n }\n return $news;\n}", "public function getNews()\n {\n $sql = \"SELECT * FROM news \";\n return $this->get($sql, array());\n }", "function get_news(){\n\t\tif($result = $this->db->query('SELECT * FROM news WHERE id<>1 ORDER BY add_date DESC LIMIT 50')){\n\t\t\t$return = '';\n\t\t\twhile($r = $result->fetch_object()){\n\t\t\t\t$return .= '<p>id: '.$r->id.' | '.htmlspecialchars($r->title).'</p>';\n\t\t\t\t$return .= '<hr/>';\n\t\t\t}\n\t\t\treturn $return;\n\t\t}\n\t}", "public function normal_news() {\n $this->load->library(array('rb'));\n $this->output->set_content_type('application/json', 'utf-8')\n\t->set_header('Access-Control-Allow-Origin: *');\n $data = array();\n try {\n\t$news = R::find('news', 'is_fixed=?', ['N']);\n\tforeach($news as $new) {\n\t array_push($data, array(\n\t\t'title'=>$new->title,\n\t\t'text'=>$new->text,\n\t\t'created_at'=>$new->created_at,\n\t ));\n\t}\n\t$this->output->set_status_header(200)\n\t ->set_output(json_encode(array(\n\t\t'status'=>'success',\n\t\t'data'=>$data,\n\t )));\n } catch(Exception $e) {\n\t$this->output->set_status_header(500)\n\t ->set_output(json_encode(array(\n\t \t'status'=>'error',\n\t\t'message'=>'Ocorreu um erro de conexão ao banco de dados'\n\t )));\n }\n }", "public function getNews() {\n\n $list_news = [];\n $sql = \"SELECT * FROM news\";\n $resultados = $this->ExecuteQuery($sql, array());\n foreach ($resultados as $linha) {\n $list_news[] = new Noticia(\n $linha['title'], $linha['text'], null,$linha['id_news']);\n }\n return $list_news;\n }", "function get_news()\n {\n $query = \"SELECT * FROM `news` ORDER BY `date` DESC\";\n $result = $this->db->query($query);\n\n return $result->fetchAll();\n }", "function news($word) {\n $link = new Db;\n $link->query(sprintf(\"select distinct newssite.razd,newssite.id,newssite.subj,newssiterazd.type_user from newssite left join newssiterazd on newssite.razd=newssiterazd.id where newssite.site='%d' and newssiterazd.site='%d' and (newssite.msg like '%%%s%%' or newssite.subj like '%%%s%%')\",$this->sitenumber,$this->sitenumber,$word,$word));\n $y=$link->num_rows();\n $j=0;\n for ($i=0;$i<$y;$i++) {\n $res[$i]=$link->next_record();\n if ($this->auth->verify($res[$i])) {\n $result[$j]=$res[$i];$j++;\n }\n }\n $smarty = new Smarty; \n $smarty->assign(\"res\",$result);\n $smarty->assign(\"word\",$word);\n $smarty->assign(\"from\",$this->from);\n $res=$smarty->fetch(\"{$this->path}sres-news.tpl\");\n return $res;\n// $link->close();\n }", "public static function getAllNewsFromDB(){\r\n include_once './db_functions.php';\r\n $db = new DB_Functions();\r\n $query = \"SELECT *\r\n FROM \t NEWS;\";\r\n $resQuery = $db->executeQuery($query);\r\n\r\n $i=0;\r\n $allNews= array();\r\n foreach($resQuery[\"response\"] as $row ){\r\n $news = News($row[0],$row[1],$row[2],$row[3],$row[4]);\r\n $allNews[$i] = $news;\r\n $i++;\r\n }\r\n return $allNews;\r\n }", "function ViewDetail_Item_news( $tbl_news, $id ){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE id = '$id'\");\n\t\t$result = mysql_fetch_object($sql);\n\t\treturn $result;\n\t}", "private function _populateNews()\n {\n return $this->news->create(\n $this->newsData['title'], \n $this->newsData['content'], \n $this->newsData['created_by']\n );\n }", "public function fixed_news() {\n $this->load->library(array('rb'));\n $this->output->set_content_type('application/json', 'utf-8')\n\t->set_header('Access-Control-Allow-Origin: *');\n $data = array();\n try {\n\t$news = R::find('news', 'is_fixed=?', ['Y']);\n\tforeach($news as $new) {\n\t array_push($data, array(\n\t 'title'=> $new->title,\n\t 'text'=> $new->text,\n\t 'created_at'=> $new->created_at,\n\t ));\n\t}\n\t$this->output->set_status_header(200)\n\t ->set_output(json_encode(array(\n\t\t'status'=>'success',\n\t\t'data'=>$data,\n\t)));\n } catch(Exception $e) {\n\t$this->output->set_status_header(500)\n\t ->set_output(json_encode(array(\n\t\t'status'=>'error',\n\t\t'message'=>'Ocorreu um erro de conexão ao banco de dados'\n\t )));\n }\n }", "protected function getAllNews() {\n $model = new News();\n \n $result= $model->getAll();\n return $result;\n }", "function news_get_row( $p_news_id ) {\r\n\t\t$c_news_id = db_prepare_int( $p_news_id );\r\n\r\n\t\t$t_news_table = config_get( 'mantis_news_table' );\r\n\r\n\t\t$query = \"SELECT *\r\n\t\t\t\t FROM $t_news_table\r\n\t\t\t\t WHERE id='$c_news_id'\";\r\n\t\t$result = db_query( $query );\r\n\r\n\t\tif ( 0 == db_num_rows( $result ) ) {\r\n\t\t\ttrigger_error( ERROR_NEWS_NOT_FOUND, ERROR );\r\n\t\t} else {\r\n\t\t\t$row = db_fetch_array( $result );\r\n\t\t\t$row['date_posted'] = db_unixtimestamp ( $row['date_posted'] );\r\n\t\t\treturn $row;\r\n\t\t}\r\n\t}", "public static function getRecordInDB($id_news){\r\n include_once './db_functions.php';\r\n $db = new DB_Functions();\r\n //Escaping\r\n $id_news = DB_Functions::esc($id_news);\r\n $query = \"SELECT *\r\n FROM \t NEWS\r\n\t WHERE\t ID_NEWS = $id_news;\";\r\n $resQuery = $db->executeQuery($query);\r\n //Se ho un recordset\r\n if (count($resQuery[\"response\"][]) == 1) {\r\n $news = new News($resQuery[\"response\"][0][0],$resQuery[\"response\"][0][1],$resQuery[\"response\"][0][2],$resQuery[\"response\"][0][3],$resQuery[\"response\"][0][4]);\r\n return $news;\r\n }\r\n else\r\n return null;\r\n }", "function newsItem_BacaDataDetil( $tbl_news, $id ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE id = '$id'\");\n\t$result = mysql_fetch_object($sql);\n\treturn $result;\n}", "private function getOneNews() {\n $this->news->findOne();\n }", "function GetNews($num=false){\n\t\tif($num){\n\t\t\t$return = $this->db->query(\"SELECT * FROM news WHERE (langs=? OR langs LIKE ?) AND (user_groups=? OR user_groups LIKE ?) AND (users=? OR users LIKE ?) AND not_langs NOT LIKE ? AND user_groups NOT LIKE ? AND users NOT LIKE ? ORDER by id DESC LIMIT 0,?\",array('','%|'.$_SESSION['language'].'|%','','%|'.$_SESSION['user_group'].'|%','','%|'.$_SESSION['id'].'|%', '%|'.$_SESSION['language'].'|%','%|'.$_SESSION['user_group'].'|%','%|'.$_SESSION['id'].'|%', intval($num)))->result_array();\n\t\t}else{\n\t\t\t$return = $this->db->query(\"SELECT * FROM news WHERE (langs=? OR langs LIKE ?) AND (user_groups=? OR user_groups LIKE ?) AND (users=? OR users LIKE ?) AND not_langs NOT LIKE ? AND user_groups NOT LIKE ? AND users NOT LIKE ? ORDER by id DESC\",array('','%|'.$_SESSION['language'].'|%','','%|'.$_SESSION['user_group'].'|%','','%|'.$_SESSION['id'].'|%', '%|'.$_SESSION['language'].'|%','%|'.$_SESSION['user_group'].'|%','%|'.$_SESSION['id'].'|%'))->result_array();\n\t\t}\n\t\treturn $return;\n\t}", "public static function ReadFromDB()\n {\n return News::search();\n }", "public function newsAction() {\n\t\t\t$db = Zend_Registry::get('db');\n\t\t\t$id = (int)$this->getRequest()->getParam('id');\n\t\t\t$this->view->news = $db->fetchAll($db->select()->from('inwestycje_news')->order('data DESC')->where('id_inwest = ?', $id));\n\t\t\t$this->view->inwestycja = $db->fetchRow($db->select()->from('inwestycje')->where('id = ?', $id));\n\t\t}", "public function list_news(){\n\t\t\t$recordPerPage = 15;\n\t\t\t//----\n\t\t\t//phan trang\t\n\t\t\t//tinh tong so ban ghi\n\t\t\t$total = $this->model_total();\t\t\t\n\t\t\t//tinh tong so trang\n\t\t\t$numPage = ceil($total/$recordPerPage);//ham ceil de lay tran\n\t\t\t//lay bien p truyen tu url -> bien nay the hien la dang o may\n\t\t\t$p = isset($_GET[\"p\"])&&is_numeric($_GET[\"p\"])? $_GET[\"p\"]-1:0;\n\t\t\t$fromRecord = $p*$recordPerPage;\t\t\t\n\t\t\t//----\n\t\t\t//goi ham model_get() trong class newsModel de lay du lieu\n\t\t\t$data = $this->model_get($fromRecord,$recordPerPage);\n\t\t\t$this->renderHTML(\"views/backend/list_news.php\", array(\"data\"=>$data,\"numPage\"=>$numPage));\n\t\t}", "function get_news($news_id)\n {\n return $this->db->get_where('news',array('news_id'=>$news_id))->row_array();\n }", "public function getNews() {\n\t\treturn $this->news;\n\t}", "public function gameNews() {\n\t\t$game = $this->getGame();\n\t\tif (!$game) {\n DooUriRouter::redirect(Doo::conf()->APP_URL);\n return FALSE;\n }\n\t\t$list = array();\n\t\t$blog = new News();\n\t\t$list['NewsCategoriesType'] = NEWS_GAMES;\n\t\t$list['infoBox'] = MainHelper::loadInfoBox('News', 'index', true);\n\t\t$list['game'] = $game;\n\n\t\t$blogTotal = $news->getTotalByType($game->ID_GAME, GAME);\n\t\t$pager = $this->appendPagination($list, $news, $newsTotal, $game->NEWS_URL.'/page');\n\t\t$list['gameNews'] = $news->getNewsByType($game->ID_GAME, GAME, $pager->limit);\n\n $data['title'] = $this->__('Game News');\n $data['body_class'] = 'game_news';\n $data['selected_menu'] = 'news';\n $data['left'] = PlayerHelper::playerLeftSide();\n $data['right'] = PlayerHelper::playerRightSide();\n $data['content'] = $this->renderBlock('news/gameNews', $list);\n $data['footer'] = MainHelper::bottomMenu();\n $data['header'] = MainHelper::topMenu();\n $this->render3Cols($data);\n }", "public function run()\n {\n $news= [\n ['Title' => 'Túi thủ công dáng tròn \\'chiếm sóng\\' xu hướng phụ kiện hè 2018', 'Slug' => 'Tui-thu-cong-dang-tron-chiem-song-thi-truong-he-2018','Content'=>'Thời trang Xu hướng | Sao style Tư vấn\nThứ sáu, 25/5/2018, 08:00 (GMT+7)11\nTúi thủ công dáng tròn \\'chiếm sóng\\' xu hướng phụ kiện hè 2018\nTúi xách hình mặt nguyệt thiết kế trên chất liệu thiên nhiên được các tín đồ thời trang yêu thích khi xuống phố.Đối với những cô nàng mê đồ mỹ nghệ và thủ công đan lát thì túi mây tre dáng tròn không quá xa lạ. Ở mùa hè 2018, các kiểu túi hình mặt nguyệt được phái đẹp ưa chuộng và tạo nên cơn sốt mới.Các fashionista đua nhau chọn túi dáng tròn thay vì sử dụng các kiểu túi chữ nhật, túi dạng \\'làn đi chợ\\' như ở mùa cũ.Túi mây tre đan kết hợp cùng quai da cũng là dòng sản phẩm \\'cháy hàng\\' vì nó là phụ kiện dễ dàng tạo nên sự liên kết với các kiểu váy nhẹ nhàng phù hợp với không khí mùa nắng.', 'Author' => 'admin', 'Intro' => 'Túi xách hình mặt nguyệt thiết kế trên chất liệu thiên nhiên được các tín đồ thời trang yêu thích khi xuống phố.','images'=>'aaa'],\n\n ];\n DB::table('news')->insert($news);\n }", "public function news();", "public function prepareDataNews(SimplePieItemAdapter $data)\n {\n $news = [];\n $news['title'] = $data->title;\n $news['source_id'] = 1;\n $news['source_link'] = $data->link ?: '';\n $news['publication_date'] = date(\"Y-m-d H:m:s\", strtotime($data->date));\n\n //get first img from content\n preg_match('/<img.+src=[\\'\"](?P<src>.+?)[\\'\"].*>/i', $data->content, $image);\n $news['image'] = count($image) ? $image['src'] : '';\n \n //replace of html tags\n $news['text'] = preg_replace('#<p>(Запись)[^>]*?>.*?<\\/p>|<div class=\"td-gallery-slide-count(.)*\\R?(.)*<\\/div>#',\n '', $data->content);\n $news['text'] = preg_replace('#<!--see-also-->[^\\R]*?<!--end-see-also-->#', '', $news['text']);\n $news['text'] = preg_replace('#<[^>]*>|(\\s\\s)+|\\\\r\\\\n|\\\\n#', '', $news['text']);\n $news['text'] = trim($news['text']);\n \n //tags\n $categories = [];\n foreach ($data->categories as $key => $category) {\n $categories[$key] = $category->term;\n }\n $news['tags'] = json_encode($categories);\n\n return $news;\n }", "function settaNews($cod)\n {\n $this->codice = $cod;\n \n $data=$this->database;\n // chiamata alla funzione di connessione\n $data->connetti();\n // interrogazione della tabella\n $auth = $data->query(\"SELECT * FROM newsletter WHERE codice_news='$this->codice'\");\n\n\n // controllo sul risultato dell'interrogazione\n if(mysql_num_rows($auth)==0)\n {\n //errore newsletter non esiste \n //disconnetto la connessione al database\n $data->disconnetti();\n }\n else\n {\n //recupero i valori del risultato della query\n $iteratore=mysql_fetch_array($auth);\n //imposto i valori delle variabili in base ai valori memorizzati nel database\n $this->codice=$iteratore[0];\n $this->titolo=$iteratore[1];\n $this->cod_utente=$iteratore[2];\n $this->data_news=$iteratore[3];\n $this->testo=$iteratore[4];\n //disconnetto la connessione al database\n $data->disconnetti();\n }\n \n }", "private function generateNewsData() {\n require_once 'WebsiteNewsModel.php';\n $model = new WebsiteNewsModel();\n $this->newsData = $model->getData();\n }", "public function getNews()\n {\n return $this->hasOne(News::className(), ['id' => 'news_id']);\n }", "public function retrieveNews()\n {\n return News::simplePaginate(5);\n }", "function Select_Detail_Item_news($tbl_news, $id){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE id = '$id'\");\n\t\treturn mysql_fetch_object($sql);\n\t}", "function smarty_function_articles($params, &$smarty) \n{\n extract($params); \n\tunset($params);\n\n\tif (!pnModAvailable('News')) {\n\t\treturn;\n\t}\n\n $dbconn =& pnDBGetConn(true);\n $pntable =& pnDBGetTables();\n\n $admart = pnConfigGetVar('admart');\n\n if (pnSecAuthAction(0, 'Stories::Story', '::', ACCESS_EDIT)) {\n OpenTable();\n echo '<h2>'._LAST.' '.pnVarPrepForDisplay($admart).' '._ARTICLES.'</h2>'.\"\\n\"\n .'<table border=\"1\" width=\"100%\">';\n $storiescolumn = &$pntable['stories_column'];\n $topicscolumn = &$pntable['topics_column'];\n if (strcmp(pnConfigGetVar('dbtype'), 'oci8') == 0) {\n $myquery = \"SELECT $storiescolumn[sid],\n $storiescolumn[cid],\n $storiescolumn[aid],\n $storiescolumn[title],\n $storiescolumn[time],\n $storiescolumn[topic],\n $storiescolumn[informant],\n $storiescolumn[alanguage],\n $topicscolumn[topicname]\n FROM $pntable[stories], $pntable[topics]\n WHERE $storiescolumn[topic]=$topicscolumn[topicid](+)\n ORDER BY $storiescolumn[time] DESC LIMIT $admart\";\n } else {\n $myquery = \"SELECT $storiescolumn[sid],\n $storiescolumn[cid],\n $storiescolumn[aid],\n $storiescolumn[title],\n $storiescolumn[time],\n $storiescolumn[topic],\n $storiescolumn[informant],\n $storiescolumn[alanguage],\n $topicscolumn[topicname]\n FROM $pntable[stories]\n LEFT JOIN $pntable[topics] ON $storiescolumn[topic]=$topicscolumn[topicid]\n ORDER BY $storiescolumn[time] DESC LIMIT $admart\";\n }\n $result =& $dbconn->Execute($myquery);\n while(list($sid, $cid, $said, $title, $time, $topic, $informant, $alanguage,$topicname) = $result->fields) {\n if ($alanguage=='') {\n $alanguage = 'x_all';\n }\n if ($title == \"\") {\n $title = '- No title -';\n }\n echo '<tr>'.\"\\n\"\n .'<td align=\"right\"><strong>'.pnVarPrepForDisplay($sid).'</strong></td>'\n .'<td align=\"left\" style=\"width:100%\"><a href=\"modules.php?name=News&amp;file=article&amp;sid='.$sid.'\">'.pnVarPrepForDisplay($title).'</a></td>'.\"\\n\"\n .'<td align=\"center\">'.language_name($alanguage).'</td>'.\"\\n\"\n .'<td align=\"right\">'.pnVarPrepForDisplay($topicname).'</td>'.\"\\n\";\n if ($cid == 0) {\n // Default category\n $cattitle = _ARTICLES;\n } else {\n $catcolumn = &$pntable['stories_cat_column'];\n //$catquery = buildSimpleQuery('stories_cat', array('title'), \"$catcolumn[catid] = $cid\");\n\t\t\t\t$catquery = \"SELECT $catcolumn[title] \n\t\t\t\t\t\t\tFROM $pntable[stories_cat]\n\t\t\t\t\t\t\tWHERE $catcolumn[catid] = '\".(int)pnVarPrepForStore($cid).\"'\";\n $catresult =& $dbconn->Execute($catquery);\n list($cattitle) = $catresult->fields;\n }\n if (pnSecAuthAction(0, 'Stories::Story', \"$said:$cattitle:\", ACCESS_EDIT)) {\n echo '<td align=\"right\">(<a href=\"admin.php?module=AddStory&amp;op=EditStory&amp;sid='.$sid.'\">'._EDIT.'</a>';\n if (pnSecAuthAction(0, 'Stories::Story', \"$said:$cattitle:\", ACCESS_DELETE)) {\n echo '-<a href=\"admin.php?module=AddStory&amp;op=RemoveStory&amp;sid='.$sid.'\">'._DELETE.'</a>';\n }\n echo ')</td>';\n } else {\n echo '<td>&nbsp;</td>';\n }\n echo '</tr>'.\"\\n\";\n $result->MoveNext();\n }\n echo '</table>'.\"\\n\";\n if (pnSecAuthAction(0, 'Stories::Story', '::', ACCESS_EDIT)) {\n echo '<div style=\"text-align:center\">'.\"\\n\"\n .'<form action=\"admin.php\" method=\"post\"><div>'.\"\\n\"\n .'<input type=\"hidden\" name=\"module\" value=\"AddStory\" />'.\"\\n\"\n ._ADMINSTORYID.': <input type=\"text\" name=\"sid\" size=\"10\" />'.\"\\n\"\n .'<select name=\"op\">'.\"\\n\"\n .'<option value=\"EditStory\" selected=\"selected\">'._EDIT.'</option>'.\"\\n\";\n if (pnSecAuthAction(0, 'Stories::Story', '::', ACCESS_DELETE)) {\n echo '<option value=\"RemoveStory\">'._DELETE.'</option>'.\"\\n\";\n }\n echo '</select>'.\"\\n\"\n .'<input type=\"hidden\" name=\"authid\" value=\"' . pnSecGenAuthKey() . '\" />'\n .'<input type=\"submit\" value=\"'._GO.'\" />'.\"\\n\"\n\t\t\t\t .'</div>'.\"\\n\"\n .'</form>'.\"\\n\"\n .'</div>'.\"\\n\";\n }\n CloseTable();\n }\n\treturn;\n}", "public function get_news()\n\t{\n\t\t$this->db->where('blog_category_id = 5');\n\t \t$this->db->order_by('last_modified','ASC');\n\t\t$query = $this->db->get('post');\n\t\t\n\t\treturn $query;\n\t}", "public function elencaNews()\n {\n \n $database=$this->database;\n // chiamata alla funzione di connessione\n $database->connetti();\n // interrogazione della tabella\n $auth = $database->query(\"SELECT codice_news FROM newsletter\");\n if(mysql_num_rows($auth)==0)\n {\n return null;\n //disconnetto la connessione al database\n $database->disconnetti();\n }\n else\n {\n return $auth; \n //disconnetto la connessione al database\n $database->disconnetti();\n }\n }", "public static function getNewsList(){\n\t\t// $host = '192.168.0.158';\n\t\t// $dbname = 'polimorfizm';\n\t\t// $user = 'root';\n\t\t// $password ='';\n\t\t// $db = new PDO(\"mysql:host=$host;dbname=$dbname\", $user, $password);\n\t\t\t\n\t\t\t$db = Db::getConnection();\n\t\t\t\n\t\t## Создай пустой массив в который ты будешь складывать результаты\n\t\t$newsList = array();\n\t\t\n\t\t## Выбрать 10 последних новостей из таблицы новости\n\t\t$result = $db->query('SELECT id, title, date, short_content'\n\t\t\t\t. ' FROM publication '\n\t\t\t\t. ' ORDER BY date DESC '\n\t\t\t\t. ' LIMIT 10 ');\n\techo'<pre>';\n\tvar_dump($result);\n\techo'</pre>';\n\t$i=0;\n\t## обращаемся к методу(функции)fetch переменной $result\n\twhile($row = $result->fetch()){\n\t\t$newsList[$i]['id']=$row['id'];\n\t\t$newsList[$i]['title']=$row['title'];\n\t\t$newsList[$i]['date']=$row['date'];\n\t\t$newsList[$i]['short_content']=$row['short_content'];\n\t\t$i++;\n\t\t}\n\t\treturn $newsList;\n\t}", "public function updateNews()\r\n\t{\r\n\t\t$this->newsScraper->all();\r\n\t}", "function news_view() {\n // retrieve response object\n $response = responseObject();\n\n $locale = get_var( 'locale', 'en' );\n\n // response data\n $data = array();\n\n // language str\n $locale_str = array(\n 'en' => array(\n 'title' => 'englishtitle',\n 'detail' => 'englishdetails',\n 'dir' => 'ltr'\n ),\n 'ar' => array(\n 'title' => 'arabictitle',\n 'detail' => 'arabicdetails',\n 'dir' => 'rtl'\n ),\n 'fr' => array(\n 'title' => 'frenchtitle',\n 'detail' => 'frenchdetails',\n 'dir' => 'ltr'\n )\n );\n\n $data['locale'] = $locale;\n $data['dir'] = $locale_str[$locale]['dir'];\n $data['title'] = $locale_str[$locale]['title'];\n $data['detail'] = $locale_str[$locale]['detail'];\n\n // news id from request\n $id = get_var( 'id' );\n\n // fetch news data\n $news = db_row( 'news', '*', 'newsid', $id );\n\n if( $news == null ) {\n $response->isTemplate( false );\n $response->Send( '404.html' );\n return;\n }\n\n $data['news'] = $news;\n\n $response->send( 'views/news_view.php', $data );\n}", "function getNewsById($id) {\r\n global $db;\r\n\r\n $stmt = $db->prepare('SELECT * FROM news JOIN users USING (username) WHERE id = ?');\r\n $stmt->execute(array($id));\r\n return $stmt->fetch();\r\n }", "public static function getNewsList() {\r\n/*\t\t$host = 'localhost';\r\n\t\t$dbname = 'php_base';\r\n\t\t$user = 'root';\r\n\t\t$password = '';\r\n\t\t$db = new PDO(\"mysql:host=$host;dbname=$dbname\", $user, $password);*/\r\n\r\n\t\t$db = Db::getConnection();\r\n\t\t$newsList = array();\r\n\r\n\t\t$result = $db->query('SELECT id, film_title, film_about, quality, viewing_time, country, year, genre, in_roles, img, vote, voters, video FROM films LIMIT 11');\r\n\r\n\t\t$i = 0;\r\n\t\twhile($row = $result->fetch()) {\r\n\t\t\t$newsList[$i]['id'] = $row['id'];\r\n\t\t\t$newsList[$i]['film_title'] = $row['film_title'];\r\n\t\t\t$newsList[$i]['film_about'] = $row['film_about'];\r\n\t\t\t$newsList[$i]['quality'] = $row['quality'];\r\n\t\t\t$newsList[$i]['viewing_time'] = $row['viewing_time'];\r\n\t\t\t$newsList[$i]['country'] = $row['country'];\r\n\t\t\t$newsList[$i]['year'] = $row['year'];\r\n\t\t\t$newsList[$i]['genre'] = $row['genre'];\r\n\t\t\t$newsList[$i]['in_roles'] = $row['in_roles'];\r\n\t\t\t$newsList[$i]['img'] = $row['img'];\r\n\t\t\t$newsList[$i]['vote'] = $row['vote'];\r\n\t\t\t$newsList[$i]['voters'] = $row['voters'];\r\n\t\t\t$newsList[$i]['video'] = $row['video'];\r\n\t\t\t$i++;\r\n\t\t}\r\n\r\n\t\treturn $newsList;\r\n\t\r\n}", "function getNews( $mysqli, $query ) {\n \n # 1\n \n try {\n \n if ( empty ( $query ) ) {\n throw new Exception('<div class=\"container\">Helaas bevat ons archief nog geen berichten.</div>');\n }\n \n if ( ! $stmt = $mysqli->prepare( $query ) ) {\n throw new Exception('<div class=\"container\">Helaas ging er iets mis bij het ophalen van de berichten.</div>');\n }\n\n $id=false;\n \n if (isset($_GET['id'])) {\n $id = intval(sanit_input($_GET['id']));\n }\n\n if ( $id ) {\n $stmt->bind_param('i', $id);\n }\n\n if ( ! $stmt->execute() ) {\n\t\t\t throw new Exception('<div class=\"container\">Helaas ging er iets mis bij het ophalen van de berichten.</div>');\n }\n \n $result = $stmt->get_result();\n \n # 2\n \n if ( $result->num_rows > 0 ) {\n \n while ( $row = $result->fetch_assoc() ) {\n \n // Standaard weergave TITLE + INTRO in variabele\n $message = '<div class=\"col-lg-4\">\n <h2>' . $row ['title'] . '</h2>\n <p>' . $row ['date'] . '</p>\n <p><b>' . $row ['intro'] . '</b></p>';\n \n \n if (! isset( $_GET['id'] ) ) {\n // Als alle berichten moeten worden getoond met VIEW MORE knop\n echo $message;\n echo '<a href=\"post.php?id=' . $row ['id'] . '\" class=\"btn btn-default\">View more &raquo;</a></p></div>';\n }\n \n if ( isset( $_GET['id'] )) {\n \n if ( strpos( $_SERVER ['REQUEST_URI'], 'post' ) ) {\n \n echo $message;\n echo '<p>' . $row ['post'] . '</p>';\n \n if ( isset($_SESSION['email'] ) ) { \n // Als er een ID moet worden getoond met INLOG dus met EDIT KNOP, = link naar bewerkingsformulier \n echo '<a href=\"edit.php?id=' . $row ['id'] . '\" class=\"btn btn-default\">Edit &raquo;</a>';\n }\n }\n \n # 3\n \n if ( strpos( $_SERVER ['REQUEST_URI'], 'edit' ) && isset($_SESSION['email'] ) ) {\n \n echo '<form method=\"post\"><div><label><h3>Titel</h3></label></div><textarea name=\"title\" cols=\"12\" rows=\"2\" autofocus required>' . $row['title'] . '</textarea><br><div><label><h3>Inleiding</h3></label></div><textarea name=\"intro\" cols=\"12\" rows=\"4\" required>' . $row['intro'] . '</textarea><br><div><label><h3>Bericht</h3></label></div><textarea name=\"post\" rows=\"15\" required>' . $row['post'] . '</textarea><br><div class=\"btnRow\"><button type=\"submit\" name=\"save\" class=\"btn btn-success\">Opslaan</button></div></form>';\n } \n } \n } \n }\n }\n catch (Exception $e) { \n echo $e->getMessage();\n }\n}", "public function getNewsForFlags(){\n\t\t//$news = DB::table('news')->orderBy('new_id', 'desc');\n\t\t$news = DB::table('news')\n\t\t\t\t\t\t\t\t->orderBy('new_id', 'desc')\n\t\t\t\t\t\t\t\t->skip(0)->take(100)\n\t\t\t\t\t\t\t\t->get();\n\t\treturn $news;\n\t}", "protected function _translateRow(array $data, $key = null)\n {\n $newData = array();\n\n $newData['topic_id'] = $data['thread_id'];\n if( $data['forum_id'] )\n $newData['forum_id'] = $data['forum_id'];\n $newData['user_id'] = $data['user_id'];\n $newData['title'] = $data['title'];\n $newData['closed'] = $data['is_closed'];\n $newData['creation_date'] = $this->_translateTime($data['time_stamp']);\n $newData['modified_date'] = $this->_translateTime($data['time_update']);\n $newData['sticky'] = $data['order_id'];\n $newData['lastposter_id'] = $data['last_user_id'] ? $data['last_user_id'] : $data['user_id'];\n $newData['view_count'] = $data['total_view'];\n $type_id = '';\n //FIND WHEATER THIS FORUM IS PAGES FORUM AND FIND PAGES TYPE\n if( !$data['forum_id'] ) {\n $type_id = $this->getFromDb()->select()\n ->from($this->getfromPrefix() . 'pages', 'type_id')\n ->where('page_id = ?', $data['group_id'])\n ->query()\n ->fetchColumn();\n }\n $albumTitle = 'Forum Photos';\n $isGroupForum = false;\n if( !empty($type_id) ) {\n\n $newData['group_id'] = $data['group_id'];\n $albumTitle = 'Group Photos';\n $isGroupForum = true;\n //INSERT GROUP FORUM TOPIC\n $this->getToDb()->insert('engine4_group_topics', $newData);\n } else {\n //INSERT THE FORUM TOPIC\n $this->getToDb()->insert('engine4_forum_topics', $newData);\n }\n\n $topic_id = $this->getToDb()->lastInsertId();\n //FIND ALL THE POST OF THIS TOPIC\n $posts = $this->getFromDb()->select()\n ->from($this->getfromPrefix() . 'forum_post', '*')\n ->where('thread_id = ?', $data['thread_id'])\n ->query()\n ->fetchAll();\n $newPostData = array();\n $count = 0;\n //INSERT ALL THE POST OF TOPIC\n foreach( $posts as $post ) {\n //GETTING TEXT\n $text = $this->getFromDb()->select()\n ->from($this->getfromPrefix() . 'forum_post_text', 'text')\n ->where('post_id = ?', $post['post_id'])\n ->query()\n ->fetchColumn();\n\n if( is_null($text) || $text === false )\n $text = '';\n\n $userInfo = array(\n 'user_id' => $post['user_id'],\n 'time_stamp' => $post['time_stamp'],\n 'text' => $text,\n 'item_id' => $post['post_id'],\n 'album_title' => $albumTitle,\n 'album_type' => 'forum',\n 'categoryId' => 'forum'\n );\n if( !empty($type_id) ) {\n $userInfo['page_id'] = $data['group_id'];\n $userInfo['album_table'] = 'group_albums';\n }\n //FIND THE POST BODY\n $body = $this->getBody($userInfo);\n if( is_null($body) )\n $body = '';\n\n $newPostData['post_id'] = $post['post_id'];\n $newPostData['topic_id'] = $data['thread_id'];\n if( $data['forum_id'] )\n $newPostData['forum_id'] = $data['forum_id'];\n $newPostData['user_id'] = $post['user_id'];\n $newPostData['body'] = $body;\n $newPostData['creation_date'] = $this->_translateTime($post['time_stamp']);\n $newPostData['modified_date'] = $post['update_time'] ? $this->_translateTime($post['update_time']) : $this->_translateTime($post['time_stamp']);\n// INSERT THE FORUM POST\n if( $isGroupForum ) {\n $newPostData['group_id'] = $data['group_id'];\n $this->getToDb()->insert('engine4_group_posts', $newPostData);\n } else {\n $this->getToDb()->insert('engine4_forum_posts', $newPostData);\n }\n $post_id = $this->getToDb()->lastInsertId();\n //UPDATE THE COUNT OF POST INTO THE TOPIC\n if( $isGroupForum ) {\n $this->getToDb()->update('engine4_group_topics', array(\n 'lastpost_id' => $post_id,\n 'post_count' => ++$count\n ), array(\n 'topic_id = ?' => $topic_id\n ));\n } else {\n $this->getToDb()->update('engine4_forum_topics', array(\n 'lastpost_id' => $post_id,\n 'post_count' => ++$count\n ), array(\n 'topic_id = ?' => $topic_id,\n 'forum_id = ?' => $data['forum_id'],\n ));\n }\n }\n //PREPARE AN ARRAY FOR TOPIC WATCHES\n $newWatchData = array();\n if( $data['forum_id'] )\n $newWatchData['resource_id'] = $data['forum_id'];\n\n $newWatchData['topic_id'] = $data['thread_id'];\n $newWatchData['user_id'] = $data['user_id'];\n $newWatchData['watch'] = 1;\n if( $isGroupForum ) {\n $newWatchData['resource_id'] = $data['group_id'];\n $this->getToDb()->insert('engine4_group_topicwatches', $newWatchData);\n } else {\n $this->getToDb()->insert('engine4_forum_topicwatches', $newWatchData);\n }\n\n if( $data['forum_id'] ) {\n //PREPARE AN ARRAY FOR TOPIC VIEW\n $newTopicViewsData = array();\n $newTopicViewsData['user_id'] = $data['user_id'];\n $newTopicViewsData['topic_id'] = $data['thread_id'];\n $newTopicViewsData['last_view_date'] = $this->_translateTime($data['time_stamp']);\n $this->getToDb()->insert('engine4_forum_topicviews', $newTopicViewsData);\n //FIND THE FORUM DETAIL\n $forums = $this->getFromDb()->select()\n ->from($this->getfromPrefix() . 'forum', '*')\n ->where('forum_id = ?', $data['forum_id'])\n ->where('thread_id = ?', $data['thread_id'])\n ->query()\n ->fetchAll();\n //UPDATE THE POST COUNT INTO THE FORUM\n foreach( $forums as $forum ) {\n $this->getToDb()->update('engine4_forum_forums', array(\n 'topic_count' => $forum['total_thread'],\n 'post_count' => $forum['total_post'] + 1,\n 'lastpost_id' => $post_id,\n 'lastposter_id' => $forum['last_user_id'],\n ), array(\n 'forum_id = ?' => $data['forum_id'],\n ));\n }\n }\n }", "public function getNews()\n {\n return News::all();\n }", "public function queryNews($query){\n\t\t\treturn $this->query('News',$query);\n\t\t}", "public function getDataNews()\n {\n return $this->data_news;\n }", "public static function retrieveAllNews() {\n return R::getAll('SELECT * FROM news');\n }", "function get_news(){\r\n $string=\"SELECT * from news\";\r\n\r\n $result=mysqli_query($GLOBALS['conn'],$string);\r\n\r\n while($row=mysqli_fetch_array($result)){\r\n echo \"<br><br><div id='top'><img src='data:image/jpeg;base64,\".base64_encode($row['image']).\"'><div id='headline'>\".$row['headline'].\"</div></div><br><div id='bottom'><div id='detail'>\".substr($row['detail'], 0, 300).\"</div></div><a style='color:#008db1;font-family:sans-serif;font-size:14px' href='\".$row['source'].\"'>Read More>></a>\";\r\n }\r\n\r\n}", "public function get_news_by_id($id)\n {\n $query = $this->db->get_where('news', array('id' => $id));\n return $query->row_array();\n }", "public function getId_news()\n {\n return $this->id_news;\n }", "function getAllNews() {\n global $pdo;\n $statement = $pdo->prepare('SELECT * FROM `news` ORDER BY `timestamp`;');\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n}", "public function updateNews(){\n $id = intval($_GET['id']);\n $info = D('News')->where('id='.$id)->find();\n $this->assign('info', $info);\n $this->assign('typeList', $this->get_type_list());\n $this->display();\n }", "public function getRecord($id){\n return News::find($id);\n\n }", "public function newsone($id = 0) {\n\t$this->load->library(array('rb'));\n\t$this->output->set_content_type('application/json', 'utf-8')\n\t ->set_header('Access-Control-Allow-Origin: *');\n\ttry {\n\t $new = R::findOne('news', 'id=?', [$id]);\n\t if(count($new) > 0) {\n\t $data_new = array(\n\t 'title'=>$new->title,\n\t\t'text'=>$new->text,\n\t\t'create_at'=>$new->created_at,\n );\n\t $this->output->set_status_header(200)\n\t\t->set_output(json_encode(array(\n\t\t 'status'=>'success',\n\t\t 'data'=>$data_new\n\t )));\n\t } else {\n\t $this->output->set_status_header(404)\n\t\t->set_output(json_encode(array(\n\t\t 'status'=>'error',\n\t\t 'message'=>'Notícia não encontrada'\n\t )));\n\t }\n\t} catch(Exception $e) {\n\t $this->output->set_status_header(500)\n\t\t->set_output(json_encode(array(\n\t\t 'status'=>'error',\n\t\t 'message'=>'Ocorreu um erro de conexão ao banco de dados',\n\t )));\n\t}\n }", "function convert_from_sql_row($row)\n\t{\n $this->SignupId = (int)$row->SignupId;\n $this->UserId = (int)$row->UserId;\n $this->RunId = (int)$row->RunId;\n $this->State = (string)$row->State;\n $this->PrevState = (string)$row->PrevState;\n $this->Gender = (string)$row->Gender;\n $this->Counted = (string)$row->Counted;\n $this->UpdatedById = (int)$row->UpdatedById;\n $this->TimeStamp = (string)$row->TimeStamp;\n\t}", "function news_view_sql()\n {\n \t$news_view=mysqli_query($this->con,\"SELECT * FROM `news` order by id desc\");\n \treturn $news_view;\n }", "public function toWordPressEntity();", "function enh_latest_news_text($mod_id, $nl_url, $ModName) {\n\n// get vars\n $prefix = pnConfigGetVar('prefix');\t\t\n list($dbconn) = pnDBGetConn();\n\t $pntable =& pnDBGetTables();\n\n $language = pnConfigGetVar('language');\n\n// name the lang file the same as this file\n include(\"modules/$ModName/modules/lang/$language/enhnews.php\");\n\n// get the module setting from the database\n\t $modsql = \"SELECT mod_qty, mod_data FROM $prefix\"._nl_modules.\" WHERE mod_id = '$mod_id'\";\n\t\t$result = $dbconn->Execute($modsql);\n\t if ($dbconn->ErrorNo() != 0) {\n\t\t echo _DBREADERROR;\n\t }\n if (!$result->EOF) {\n\t list($mod_qty, $mod_data) = $result->fields;\n } else {\n\t\t // take care od errors?\n\t\t}\n\n// clear the output variable\n// title of the page to show up\n\t $output =\"\"._ENHLATESTARTICLES.\":\\n\\n\";\n\n// query the database and generate your output in the amount of mod_qty\n\t $sql = \"SELECT pn_sid, pn_title, pn_hometext, pn_bodytext, pn_informant, pn_time \n\t\t FROM $pntable[stories] \n\t\t WHERE pn_ihome = '0' ORDER BY pn_time DESC limit 0,$mod_qty\";\n\n\t\t$result = $dbconn->Execute($sql);\n\t if ($dbconn->ErrorNo() != 0) {\n\t\t echo _DBREADERROR;\n\t }\n\t\t\t\t\t\t\n while(!$result->EOF) {\n\t\t list($pn_sid, $pn_title, $pn_hometext, $pn_bodytext, $pn_informant, $pn_time) = $result->fields;\n\t\t\t\t$result->MoveNext(); \n\t\t $output .= \"$pn_title\\n\";\n\t\t $output .= \"$pn_hometext\\n\";\n\t\t if ($pn_bodytext) {\n\t\t\t $output .= \"\"._READMORE.\": $nl_url/modules.php?op=modload&name=News&file=article&sid=$pn_sid\\n\";\n\t\t\t }\n\t\t $output .= \"\\n\";\n\t\t}\n\n// strip the slashes out all at once\n\t $output = stripslashes($output);\n\n// send the output to the system (it must be output and not another variable name)\n\t return $output;\n}", "function get_news_db(){\n\t\t\t\t$conn=new PDO(\"mysql:dbname=doseddb;host=localhost;charset=utf8\", \"dosed\", \"pass\");\n\t\t\t\t$stmt=$conn->prepare(\"select id, date as time, title, author, headline, article, url from articles where id= :id\");\n\t\t\t \t$stmt->execute(array(':id' => $_GET['news_id']));\n\t\t\t\t$result = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\t return $result;\n\t\t\t}", "private function _populateDealerNews()\n {\n return $this->dealerNews->set(1,$this->dealerNewsData);\n }", "protected function getSystemNews() {}", "public function searchNews (){\n $this->news = $this->daoJson->searchFeedDate($this->keyword, \"2014-09-01\", \"2014-11-30\");\n }", "public static function news(){\r\n\r\n $news = static::whereHas('category', function($query){\r\n $query->where('name','NOT LIKE','A venir');\r\n })\r\n ->where('featured',1)\r\n ->get();\r\n return $news;\r\n }", "public function model()\n {\n return News::class;\n }", "public function model()\n {\n return News::class;\n }", "public function model()\n {\n return News::class;\n }", "function newsDiLihat( $tbl_news, $Det ){\n\t\n\t\t\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE id='$Det'\");\n\t\t\t$datanews = mysql_fetch_array($sql);\n\t\t\t$dilihat = $datanews ['dilihat'];\n\t\t\t$dilihat = $dilihat+1;\n\t\n\t\t\t$sqlupdate = mysql_query(\"UPDATE $tbl_news SET dilihat='$dilihat' WHERE id='$Det'\");\n\t\t\t\n\t\t\treturn $sqlupdate;\n\t}", "public function getNewsData() {\n return $this->newsData;\n }", "function outputNews() {\r\n\t\tglobal $currentNewsItems, $newsCount, $fourWeeksAgo, $json;\r\n\t\tfor ($i = 0; $i < $currentNewsItems; $i++) {\r\n\t\t\tif (strtotime($json->data[$i]->releaseDate) >= $fourWeeksAgo) {\r\n\t\t\t\t$newsCount = $newsCount + 1;\r\n\t\t\t\techo '{';\r\n\t\t\t\techo '\"uid\": \"', $json->data[$i]->id, '\",';\r\n\t\t\t\techo '\"updateDate\": \"', gmdate(\"Y-m-d\\TH:i:s\\Z\", strtotime($json->data[$i]->releaseDate)), '\",';\r\n\t\t\t\techo '\"titleText\": ', json_encode($json->data[$i]->title), ',';\r\n\t\t\t\tif ($json->data[$i]->url != '') {\r\n\t\t\t\t\techo '\"mainText\": ', json_encode($json->data[$i]->abstract), ',';\r\n\t\t\t\t\techo '\"redirectionUrl\": \"', $json->data[$i]->url, '\"';\r\n\t\t\t\t} else {\r\n\t\t\t\t\techo '\"mainText\": ', json_encode($json->data[$i]->abstract);\r\n\t\t\t\t}\r\n\t\t\t\tif ($currentNewsItems > $newsCount) {\r\n\t\t\t\t\techo '},';\r\n\t\t\t\t} else {\r\n\t\t\t\t\techo '}';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function viewNews($newsid){\n\t\t$sql = \"select * from nns_news where newsid = '$newsid'\";\n\t\t$result = dbquery($sql);\n\t\t$user=pg_fetch_assoc($result);\n\t\t$this->channelid=$user['channelid'];\n\t\t$this->uid=$user['uid'];\n\t\t$this->description=$user['description'];\n\t\t$this->timestamp=$user['timestamp'];\n\t\t$this->status=$user['status'];\n\t\t$this->newsid=$newsid;\n\t}", "public function supports_news() {\n return true;\n }", "public static function getNewsItemByID($id)\r\n\t{\r\n\t\t$id = intval($id);\r\n\r\n\t\tif ($id) {\r\n/*\t\t\t$host = 'localhost';\r\n\t\t\t$dbname = 'php_base';\r\n\t\t\t$user = 'root';\r\n\t\t\t$password = '';\r\n\t\t\t$db = new PDO(\"mysql:host=$host;dbname=$dbname\", $user, $password);*/\r\n\t\t\t$db = Db::getConnection();\r\n\t\t\t$result = $db->query('SELECT * FROM films WHERE id=' . $id);\r\n\r\n\t\t\t/*$result->setFetchMode(PDO::FETCH_NUM);*/\r\n\t\t\t$result->setFetchMode(PDO::FETCH_ASSOC);\r\n\r\n\t\t\t$newsItem = $result->fetch();\r\n\r\n\t\t\treturn $newsItem;\r\n\t\t}\r\n\r\n\t}", "public function updateToDB()\n {\n try {\n $sql = 'UPDATE news\n SET link_id=:link_id, title=:title, date_public=:date_public, date_create=:date_create,\n short_text=:short_text, full_text=:full_text\n WHERE id=:id';\n $this->_db->query($sql, array('link_id' => $this->_link->getId(), 'title' => $this->_title, 'date_create' => $this->_dateCreate,\n 'date_public' => $this->_datePublic, 'short_text' => $this->_shortText, 'full_text' => $this->_fullText, 'id' => $this->_id));\n\n $fileName = $this->_file->download('file');\n if ($fileName !== false) {\n $this->_file->createPreview(40, 40);\n $this->_db->query('UPDATE news SET file=:file WHERE id=:id', array('file' => $fileName, 'id' => $this->_id));\n }\n } catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n }", "public function getNews()\n {\n return $this->hasMany(News::className(), ['news_category_id' => 'id']);\n }", "public function getSmsNews()\n {\n return $this->sms_news;\n }", "public static function frontCategoryNews(){\n $odisha_category_id = \\Config::get('constants.ODISHA_CATEGORY_ID');\n $query = \"SELECT b.id,b.name,b.slug,b.tags,b.featured_image,b.short_description,b.cat_id,b.file_path,b.approved_date AS approved_date,\n b.position,c.name AS categoryname,b.is_video,b.is_image,b.file_path,c.slug AS categoryslug,d.name AS username, b.journalist_name\n FROM\n (SELECT a.cat_id AS catid, MAX(a.approved_date) AS appdate FROM news a \n WHERE a.is_hot=1 AND a.is_approved=1 AND a.is_featured=0 AND a.is_top_story=0 AND a.is_archive=0 AND a.is_enable=1 AND a.is_trash=0 AND a.is_trash=0\n AND a.cat_id != $odisha_category_id GROUP BY a.cat_id) AS x \n INNER JOIN news b ON x.catid=b.cat_id AND x.appdate=b.approved_date\n LEFT JOIN news_categories c ON b.cat_id=c.id\n LEFT JOIN users d ON b.user_id=d.id\n WHERE c.is_active=1\n GROUP BY b.cat_id\n ORDER BY c.order ASC\";\n // ORDER BY b.cat_id ASC,b.position ASC,c.order ASC\";\n $categoryNews = DB::select(DB::raw($query));\n return $categoryNews; \n }", "public static function getMostRecent()\n\t{\n\t\t$table = new Zend_Db_Table(array('name'=>PrecurioTableConstants::NEWS, 'rowClass'=>'News'));\n\t\t$select = $table->select();\n\t\t$select->setIntegrityCheck(false);\n\t\t$select->setTable($table); \n\t\t$select = $select->from(array('a' => PrecurioTableConstants::CONTENT))\n\t\t\t\t\t\t->join(array('b' => PrecurioTableConstants::NEWS),'a.id = b.content_id',array('content_id'))\n\t\t\t\t\t\t->where('a.active=1')\n\t\t\t\t\t\t->order('a.id DESC')\n\t\t\t\t\t\t->limit(1);\n\t\t$news = $table->fetchRow($select);\n\t\treturn $news;\n\t}", "private function getDashboardNews(){\n $this->dashboard->findDashboardNewsData();\n }", "public function news($url='page',$page=0){\n\t\t$data \t\t\t\t\t\t= $this->data;\n\t\t$data['menu'] \t\t\t\t= 'news';\n\t\t$data['category'] \t\t\t= CategoryBlogModel::desc()->get();\n\t\t$data['tag'] \t\t\t\t= TagModel::desc()->get();\n\t\t$data['popular_news'] \t\t= BlogModel::notDraft()->take(4)->orderBy('view','desc')->get();\n\t\t$data['events']\t\t\t\t= EventPromoModel::notDraft()->take(4)->desc()->get();\n\t\tif($url==\"detail\" && $page!=0){\n\n\t\t\t$news \t\t\t\t= BlogModel::notDraft()->find($page);\n\n\t\t\tif(!$news){\n\t\t\t\tredirect('error');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$data['tag_txt'] \t= '';\n\n\t\t\tforeach ($news->tags as $result) {\n\t\t\t\t$data['tag_txt'] .= $result->tag->name.',';\n\t\t\t}\n\n\n\t\t\t$data['news'] \t\t= $news;\n\t\t\t$data['related'] \t= BlogModel::notDraft()->where('id_category',$news->id_category)\n\t\t\t\t\t\t\t\t\t\t->where('id','!=',$news->id)->take(3)->desc()->get();\n\t\t\techo $this->blade->nggambar('website.news.content',$data);\n\t\t}\n\t\telse {\n\t\t\tif(!is_numeric($page)){\n\t\t\t\t$page \t= 0;\n\t\t\t}\n\n\t\t\t$name \t\t\t\t\t\t= (null != $this->input->get('q')) ? $this->input->get('q') : '';\n\t\t\t\n\t\t\t$paginate\t\t\t\t\t= new Aksa_pagination;\n\t\t\t$data['page']\t\t\t\t= $page;\n\t\t\t\n\t\t\t$data['total']\t\t\t\t= BlogModel::notDraft()->where('name', 'LIKE', '%'.$name.'%');\n\t\t\t$data['news']\t\t\t\t= BlogModel::notDraft()->where('name', 'LIKE', '%'.$name.'%');\n\n\t\t\t$data['total'] \t\t\t\t= $data['total']->get();\n\t\t\t$data['news'] \t\t\t\t= $data['news']->take(6)->skip($page*6)->desc()->get();\n\n\t\t\t$data['pagination'] \t\t= $paginate->paginate(base_url('main/news/page/'),5,6,count($data['total']),$page);\n\t\t\techo $this->blade->nggambar('website.news.index',$data);\n\t\t\treturn;\n\t\t}\n\t}", "public function getList2(){\r\n $listArticles =[]; ///on creer une liste vide ou ont mettra tous les articles\r\n\r\n\r\n //prepare une requete de type select\r\n $sql= 'SELECT id, ' \r\n .'titre, '\r\n .'texte, '\r\n .'publie, '\r\n .'DATE_FORMAT(date, \"%d/%m/%Y\")as date '\r\n .'FROM articles ';\r\n \r\n \r\n $req = $this->bdd->prepare($sql);\r\n\r\n//////execution de la requete avec attribution des valeurs\r\n$req->execute();\r\n\r\n/////on stocke les données obtenues dans un tableau\r\nwhile ($donnees = $req->fetch(PDO::FETCH_ASSOC)){///tant que il y a des article alors on boucle\r\n ////on cree des objets avec les données issue de la bdd\r\n $articles = new articles();\r\n $articles->hydrate($donnees);\r\n $listArticles[] = $articles;\r\n}\r\n///print_r2($listArticles)\r\nreturn $listArticles;\r\n\r\n\r\n}", "function GetJML_Search_Item_news_Publish( $tbl_news, $cari ){\n\t\t$sql = mysql_query(\"SELECT count(id) as jml FROM $tbl_news WHERE \n\t\t\tstatustampil = '1' AND\n\t\t\tjudul LIKE '%$cari%' OR\n\t\t\tjudulinggris LIKE '%$cari%' OR \n\t\t\t \n\t\t\tdeskripsi LIKE '%$cari%' OR\n\t\t\tdeskripsiinggris LIKE '%$cari%' \n\t\t\");\n \t\t$row = mysql_fetch_object($sql);\n \t\t$jml = $row->jml;\n \t\treturn $jml;\t\n}", "function get_news_content($table_name)\n\t{\n\t\t$response = array();\n\t\t$response[\"data\"] = \"\";\n\t\t\n\t\t$link_db = db_connection();\n\t\tif($link_db==null)\n\t\t\t$response['data'] = 'cannot link db.';\n\t\telse\n\t\t{\n\t\t\t$stmt = $link_db -> prepare('CALL get_news(:table_name)'); //CALL procedure_name\n\t\t\t$stmt -> execute(array(\":table_name\"=>$table_name));\n\t\t\t\n\t\t\t$res_count = 0;\n\t\t\t$result = array();\n\t\t\twhile($res=$stmt->fetch())\n\t\t\t{\n\t\t\t\t$result[$res_count][\"date\"] = $res[\"date\"];\n\t\t\t\t$result[$res_count][\"title\"] = $res[\"title\"];\n\t\t\t\tif(stristr($res[\"link\"], 'lic.nttu.edu.tw') || stristr($res[\"link\"], 'lib.nttu.edu.tw'))\n\t\t\t\t{\n\t\t\t\t\t$result[$res_count][\"link\"] = $res[\"link\"];\n\t\t\t\t}\n\t\t\t\telse if(stristr($res[\"link\"],'?'))\n\t\t\t\t{\n\t\t\t\t\t$temp = explode('?',$res[\"link\"]);\n\t\t\t\t\t$result[$res_count][\"link\"] = $temp[0];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$result[$res_count][\"link\"] = $res[\"link\"];\n\t\t\t\t$res_count++;\n\t\t\t}\n\t\t\t\n\t\t\t$response[\"data\"] = $result;\n\t\t\t$response_count = count($result);\n\t\t\tif($response_count==0)\n\t\t\t\t$response[\"data\"] = '';\n\t\t}\n\t\t\n\t\techo json_encode($response);\n\t}", "public function addNews(){\n $this->assign('typeList', $this->get_type_list());\n $this->display();\n }", "static function newFromArticle( $article, $parser ) {\n\t\t$title = $article->getTitle();\n\t\t$article->getContent(); \n\t\t$text = $article->mContent;\n\t\tif (!$text) return null;\n\n\t\t$uniq_prefix = \"\\x07NR-UNIQ\";\n\t\t$elements = array( 'nowiki', 'gallery', 'newsfeed');\n\t\t$matches = array();\n\t\t$text = Parser::extractTagsAndParams( $elements, $text, $matches, $uniq_prefix );\n\n\t\tforeach( $matches as $marker => $data ) {\n\t\t\tlist( $element, $content, $params, $tag ) = $data;\n\t\t\t$tagName = strtolower( $element );\n\n\t\t\tif ($tagName != 'newsfeed') continue;\n\t\t\t#if (!is_null($id) && (!isset($params['id']) || $params['id'] != $id)) continue;\n\t\t\t\n\t\t\treturn new NewsRenderer( $title, $content, $params, $parser );\n\t\t}\n\n\t\treturn null;\n\t}", "protected function _show_news()\n {\n $this->load->model('news_model', 'news');\n\n // fetch the last 5 news items\n $news = $this->news->get_news_items(5, $this->session->userdata('userid'));\n\n if ($news->num_rows() > 0) {\n $i = 1;\n $datestring = $this->options['date_format'];\n\n foreach ($news->result() as $row) {\n $date = gmt_to_local($row->news_date, $this->timezone, $this->dst);\n\n $items[$i]['id'] = $row->news_id;\n $items[$i]['title'] = $row->news_title;\n $items[$i]['content'] = $row->news_content;\n $items[$i]['date'] = mdate($datestring, $date);\n $items[$i]['category'] = $row->newscat_name;\n $items[$i]['author'] = $this->char->get_character_name($row->news_author_character, true, false, true);\n\n ++$i;\n }\n\n return $items;\n }\n\n return false;\n }", "public function working_mom_news(){\r\n\t\t\r\n\t\t/* Get model */\r\n\t\t$itemsModel = $this->getModel('items');\r\n\t\t$itemsModel->set('category', $this->get('category'));\r\n\t\t\r\n\t\t/* Get data */\r\n\t\t$latestNews = $itemsModel->getLatest('news', 0, 4);\r\n\t\t\r\n\t\t/* Display data */\r\n\t\tinclude(BLUPATH_TEMPLATES . '/site/modules/working_mom_news.php');\r\n\t\t\r\n\t}", "public static function getNewsById(int $id)\n {\n return self::find($id);\n }", "public function importNews( $deptid ) {\n\t\t\n\t\tif( !is_numeric( $deptid ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$rows = $this->source_db->get_results( $this->source_db->prepare(\"SELECT * from newsannouncementlookup WHERE \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdepartment = '%s' AND \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t(expire_dtm IS NULL OR expire_dtm >= NOW()) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND active_ind = 'A'\n\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY news_dtm DESC\" , $deptid));\n\t\t\n\t\tforeach( $rows as $currow ) {\n\t\t\t$attachment_append = '';\n\t\t\t$post_check = get_page_by_title($currow->newstitle,OBJECT,'post');\n\t\t\t\n\t\t\tif( isset($post_check->ID ) && strtotime( $post_check->post_date ) == strtotime( $currow->news_dtm) ) {\n\t\t\t\t$post_id = $post_check->ID;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$post_id = '';\n\t\t\t}\n\t\t\t\n\t\t\t$post_content = $currow->newsdesc;\n\t\t\t\n\t\t\t// Check for attachment, add link.\n\t\t\tif( strlen($currow->attachment) ) {\n\t\t\t\t$attachment_append = '<div id=\"attachmentLink\"><a href=\"http://' . $this->site_url . '/_attachments/'. $currow->attachment . '\">View attachment ></a></div>';\n\t\t\t\t$post_content .= $attachment_append;\n\t\t\t}\n\t\n\t\t\t$attr = array(\n\t\t\t\t\t\t\t'ID' => $post_id,\n\t\t\t\t\t\t\t'post_content' => $this->clean_html(wpautop( wptexturize( stripslashes($post_content) ) )),\n\t\t\t\t\t\t\t'post_title' => stripslashes( $currow->newstitle),\n\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t'post_type' => 'post',\n\t\t\t\t\t\t\t'post_date' => $currow->news_dtm,\n\t\t\t\t\t\t\t'post_category' => array( get_cat_id('News'))\n\t\t\t);\n\t\t\t\n\t\t\t// Check to see if this has already been entered...\n\t\t\t$returnedPosts = get_page_by_title( $attr['post_title']);\n\t\t\t\n\t\t\tif( count( $returnedPosts )) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$post_insert = wp_insert_post( $attr, false );\n\t\n\t\t\tif( $post_insert == 0 ) {\n\t\t\t\tadd_error( 'Unable to insert news ' . $currow->newstitle );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Create redirects...\n\t\t\t\t$this->redirects[] = '/news/article.php?id='.$currow->newsid . ' ' .\n\t\t\t\t\t\t\tget_the_permalink($post_insert);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn;\n\t}", "public function printBreakingNews() {\n\t\t\t$query = \"SELECT * FROM `BreakingNews`\";\n\n\t\t\t$result = $this->connection->query($query);\n\t\t\twhile ($row = $result->fetch_assoc())\n\t\t\t{\n\n\t\t\t\tforeach($row as $newsStory) {\n\t\t\t\t\techo '<article class=\"newsStory\">';\n\t\t\t\t\techo '<p><strong>'.$newsStory.'</strong></p>';\n\t\t\t\t\techo '</article>';\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}", "function fetch_all_news() {\n $conn = connectionObject();\n $query = $conn->prepare( 'SELECT * FROM news ORDER BY creationdate DESC' );\n $query->execute();\n return $query->fetchAll(PDO::FETCH_ASSOC);\n}", "function ShowNewsFromURL()\n{\n\t$str0=\"select value1 from options where name='newsfromurl'\";\n\t$result0=mysql_query($str0) or die(mysql_error());\n\t$row0=mysql_fetch_array($result0);\n\tif ($row0['value1']==1)\n\t{ \n\n\t\techo(\"<tr><td bgcolor='\");\n\t\techo(background());\n\t\techo(\"' class='leftmenumainitem' width='216'\");\n\t\techo(\"valign='top'><img src='image/point.jpg' />&nbsp;&nbsp;\");\n\t\techo(getPara('newsfromurl','value2'));\n\t\techo(\"</td>\");\n\t\techo(\"</tr><tr><td height='176'>\");\n\t\techo(\"<marquee height='170' onmouseover=this.stop() onmouseout=this.start() \");\n\t\techo(\"scrollamount='1' scrolldelay='80' truespeed='true' direction=up>\");\n\t\techo(\"<div class='topnews'>\");\n\t\t\n\t\t$content = file_get_contents(getPara('newsfromurl','value3'));\n\t\t$x = new SimpleXmlElement($content);\n\t\t$s=\"\";\n\t\tforeach($x->channel->item as $entry) \n\t\t{\n\t\t\t$s.=\"<a target='_blank' href='\".$entry->link.\"'>\" . $entry->title . \"</a><br><br>\";\n\t\t}\n\n\t\techo($s);\n\t\techo(\"</div></marquee></td></tr>\");\n \t}\n\tmysql_free_result($result0);\n}", "public static function LoadWithData($row)\n \t{\n \t\treturn new Announcement_model(\n \t\t\t$row->announcement_id,\n \t\t\t$row->title,\n \t\t\t$row->content,\n \t\t\t$row->posted_by,\n \t\t\t$row->posted_on\n \t\t);\n \t}", "function Select_Item_news_Terkait_Publish($tbl_news, $keyword , $offset , $id ){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE id!='$id' AND statustampil = '1' AND keyword LIKE '%$keyword%' ORDER BY urutan DESC, timeunix DESC LIMIT $offset\"); \n \t\treturn $sql;\n}", "function getNews($table,$list_field,$wh=null,$order=null,$limit=null,$key=null,$is_cache=false)\n\t{\n\t\t\n\t\tif($table=='store')\n\t\t{\n\t\t\tif(!$wh) $wh='time_public < '.time();\n\t\t\telse $wh.=\" AND time_public < \".time();\t\t\t\t\n\t\t}\n\t\t\n\t\tif($is_cache){\n\t\t\t$Cache=new CacheFile();\n\t\t\t$data=$Cache->get(md5($wh.$table),'',CACHE_FILE_PATH.'news'.DS,300);\n\t\t\tif($data){\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t}\n\t\t$result=self::$dbNews->select($table,$list_field,$wh,$order,$limit,$key);\n\t\tif($is_cache){\n\t\t\t$Cache->set(md5($wh.$table),$result,300,'',CACHE_FILE_PATH.'news'.DS);\n\t\t}\n\t\treturn $result;\t\n\t}", "public function convertItem($item);", "function warquest_show_breaking_news() { \r\n\r\n\t/* input */\r\n\tglobal $page;\r\n\tglobal $player;\r\n\tglobal $config;\r\n\tglobal $browser;\r\n\r\n\t$page .= '<div class=\"subparagraph\">'.t('HOME_FLASH_NEWS_TITLE').'</div>';\r\n\t$message = '';\r\n\t\r\n\t$language=\"en\";\r\n\tif (isset($player) && (strlen($player->language)>0)) {\r\n\t\t$language=$player->language;\r\n\t} \r\n\t\t\r\n\t$query = 'select date, body, content from news where language=\"en\" order by id desc ';\r\n\t$result = warquest_db_query($query);\r\n\t\t\r\n\twhile ($data=warquest_db_fetch_object($result)) {\r\n\t\t\t\r\n\t\t$message .= '<span class=\"money\">';\r\n\t\t$message .= $data->body;\r\n\t\t$message .= '</span> ';\r\n\t\t$message .= $data->content;\r\n\t\t$message .= ' ';\r\n\t}\r\n\t\t\r\n\t$page .= '<div class=\"box\">';\r\n\t\r\n $page .= '<marquee id=\"breakingnews\" behavior=\"scroll\" direction=\"left\" scrollamount=\"4\">';\r\n\t$page .= $message;\r\n\t$page .= '</marquee>';\r\n\t$page .= '</div>';\r\n\t\r\n\t$page .= '<script language=\"JavaScript\" src=\"'.$config[\"content_url\"].'js/news2.js\" type=\"text/javascript\"></script>';\r\n\t$page .= '<script language=\"JavaScript\">';\r\n\t$page .= 'newsInit('.MENU_SERVICE.','.EVENT_GET_HEADLINES.'); newsCall();';\r\n\t$page .= '</script>';\r\n}", "public function prepareRow($row) {\n\n\t#$wp_row = $row->xml->children($this->arguments['namespaces']['wp']);\n\t#$content_row = $row->xml->children($this->arguments['namespaces']['content']);\n\t$xml_data = $row->xml->children();\n\n\t// skipe if there is not title\n\t$row->title = (string) $xml_data->title;\n if (!$row->title) {\n \treturn FALSE;\n }\n\t// ONLY migrate publish or draft content\n\t$status = $this->xpathValue($row->xml->xpath(\"wp:status\")); \n\tif ($status == 'publish') {\n\t\t$row->status = 1;\n\t} elseif ($status == 'draft') {\n\t\t$row->status = 0;\t\n\t} else {\n\t\treturn FALSE;\n\t}\n\n\t$row->pubdate = $this->xpathValue($row->xml->xpath(\"pubDate\"));\n\t$row->urlalias = $this->xpathValue($row->xml->xpath(\"wp:post_name\"));\n\t$row->native_advertiser = $this->xpathValue($row->xml->xpath(\"category[@domain = 'sponsor' and @nicename]\"));\n\t$row->eyebrow_text = $this->xpathValue($row->xml->xpath(\"wp:postmeta[wp:meta_key = 'digital-issue-text']/wp:meta_value\"));\n\t$row->eyebrow_link = $this->xpathValue($row->xml->xpath(\"wp:postmeta[wp:meta_key = 'digital-issue-url']/wp:meta_value\"));\n\t$row->disable_flipboard = $this->xpathValue($row->xml->xpath(\"wp:postmeta[wp:meta_key = 'disable_flipboard']/wp:meta_value\"));\n\t$row->google_news_standout = $this->xpathValue($row->xml->xpath(\"wp:postmeta[wp:meta_key = 'post_standout_tag']/wp:meta_value\"));\n\n\t// drush_print_r($row);\n }", "public function getAllNews($conn)\n {\n $sql = \"SELECT newsID FROM news ORDER BY date DESC\";\n\n $stmt = $conn->prepare($sql);\n\n try {\n $stmt->execute();\n $results = $stmt->fetchAll();\n return $results;\n } catch (PDOException $e) {\n return \"Database news query failed: \" . $e->getMessage();\n }\n }", "function newsItem_BacaDataListing_Terkini_All( $tbl_news ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}", "public function getNewsFeed()\n\t{\n\t\treturn \"\";\n\t}", "function News_chercher($args)\n{\n\t$tab_result = array();\n\n\t$sql = \" SELECT * \n\t\t\t\tFROM \".$GLOBALS['prefix'].\"new\n\t\t\t\tWHERE 1\";\n\n\tif (!isset($args['id_new']) && !isset($args['code_news']) && !isset($args['code'])\n\t\t && !isset($args['titre']) && !isset($args['contenu'])\n\t\t && !isset($args['titre_data1']) && !isset($args['data1'])\n\t\t && !isset($args['titre_data2']) && !isset($args['data2'])\n\t\t && !isset($args['titre_data3']) && !isset($args['data3'])\n\t\t && !isset($args['titre_data4']) && !isset($args['data4'])\n\t\t && !isset($args['titre_data5']) && !isset($args['data5'])\n\t\t && !isset($args['titre_data6']) && !isset($args['data6'])\n\t\t && !isset($args['lang']) && !isset($args['etat']) && !isset($args['position'])\n\t\t && !isset($args['order_by']) && !isset($args['tab_ids_news']))\n\t\treturn $tab_result;\n\n\t$condition=\"\";\n\n\tif (isset($args['id_new']) && $args['id_new'] != \"*\")\n\t\t$condition .= \" AND id_new = '\".$args['id_new'].\"' \";\n\tif (isset($args['code_news']))\n\t\t$condition .= \" AND code_news LIKE '\".Sql_prepareTexteStockage($args['code_news']).\"' \";\n\tif (isset($args['code']))\n\t\t$condition .= \" AND code = '\".$args['code'].\"' \";\n\tif (isset($args['titre']))\n\t\t$condition .= \" AND titre LIKE '\".$args['titre'].\"' \";\n\tif (isset($args['titre_data1']))\n\t\t$condition .= \" AND titre_data1 LIKE '\".$args['titre_data1'].\"' \";\n\tif (isset($args['titre_data2']))\n\t\t$condition .= \" AND titre_data2 LIKE '\".$args['titre_data2'].\"' \";\n\tif (isset($args['titre_data3']))\n\t\t$condition .= \" AND titre_data3 LIKE '\".$args['titre_data3'].\"' \";\n\tif (isset($args['titre_data4']))\n\t\t$condition .= \" AND titre_data4 LIKE '\".$args['titre_data4'].\"' \";\n\tif (isset($args['titre_data5']))\n\t\t$condition .= \" AND titre_data5 LIKE '\".$args['titre_data5'].\"' \";\n\tif (isset($args['titre_data6']))\n\t\t$condition .= \" AND titre_data6 LIKE '\".$args['titre_data6'].\"' \";\n\tif (isset($args['contenu']))\n\t\t$condition .= \" AND contenu LIKE '\".$args['contenu'].\"' \";\n\tif (isset($args['data1']))\n\t\t$condition .= \" AND data1 LIKE '\".$args['data1'].\"' \";\n\tif (isset($args['data2']))\n\t\t$condition .= \" AND data2 LIKE '\".$args['data2'].\"' \";\n\tif (isset($args['data3']))\n\t\t$condition .= \" AND data3 LIKE '\".$args['data3'].\"' \";\n\tif (isset($args['data4']))\n\t\t$condition .= \" AND data4 LIKE '\".$args['data4'].\"' \";\n\tif (isset($args['data5']))\n\t\t$condition .= \" AND data5 LIKE '\".$args['data5'].\"' \";\n\tif (isset($args['data6']))\n\t\t$condition .= \" AND data6 LIKE '\".$args['data6'].\"' \";\n\tif (isset($args['lang']))\n\t\t$condition .= \" AND lang LIKE '\".Sql_prepareTexteStockage($args['lang']).\"' \";\n\tif (isset($args['etat']))\n\t\t$condition .= \" AND etat LIKE '\".Sql_prepareTexteStockage($args['etat']).\"' \";\n\tif (isset($args['position']) && $args['position'] != \"*\")\n\t\t$condition .= \" AND position = '\".$args['position'].\"' \";\n\n\tif (isset($args['tab_ids_news'])) {\n\t\t$ids = implode(\",\", $args['tab_ids_news']);\n\t\t$condition .= \" AND id_new IN (0\".$ids.\") \";\n\t}\n\n\t$sql .= $condition;\n\n\tif (!isset($args['etat'])) \n\t\t$sql .= \" AND etat != 'supprime' \"; \n\tif (isset($args['order_by']) && !isset($args['asc_desc']))\n\t\t$sql .= \" ORDER BY \".$args['order_by'].\" ASC\";\n\tif (isset($args['order_by']) && isset($args['asc_desc']))\n\t\t$sql .= \" ORDER BY \".$args['order_by'].\" \".$args['asc_desc'];\n\n\tif (isset($args['limit']) && !isset($args['start']))\n\t\t$sql .= \" LIMIT \".$args['limit'];\n\n\tif (isset($args['limit']) && isset($args['start']))\n\t\t$sql .= \" LIMIT \".$args['start'].\",\".$args['limit'];\n\n\t/*=============*/ Lib_myLog(\"SQL: $sql\");\n\t$result = Sql_query($sql);\n\n\tif ($result && Sql_errorCode($result) === \"00000\") {\n\t\twhile($row = Sql_fetch($result)) {\n\t\t\t$id = $row['id_new'];\n\t\t\t$tab_result[$id][\"id_new\"]\t\t= $id;\n\t\t\t$tab_result[$id][\"code_news\"]\t= Sql_prepareTexteAffichage($row['code_news']);\n\t\t\t$tab_result[$id][\"code\"]\t= $row['code'];\n\t\t\t$tab_result[$id][\"lang\"]\t\t= Sql_prepareTexteAffichage($row['lang']);\n\t\t\t$tab_result[$id][\"etat\"]\t\t= Sql_prepareTexteAffichage($row['etat']);\n\t\t\t$tab_result[$id][\"position\"]\t= $row['position'];\n\t\t\t$tab_result[$id][\"meta_titre\"]\t\t= Sql_prepareTexteAffichage($row['meta_titre']);\n\t\t\t$tab_result[$id][\"meta_description\"]= Sql_prepareTexteAffichage($row['meta_description']);\n\t\t\t$tab_result[$id][\"meta_mots_clefs\"]\t= Sql_prepareTexteAffichage($row['meta_mots_clefs']);\n\t\t\t$tab_result[$id][\"meta_url\"]\t\t\t= Sql_prepareTexteAffichage($row['meta_url']);\n\t\t\t$tab_result[$id][\"titre\"]\t\t= Sql_prepareTexteAffichage($row['titre']);\n\t\t\t$tab_result[$id][\"contenu\"]\t= Sql_prepareTexteAffichage($row['contenu']);\n\t\t\t$tab_result[$id][\"texte_intro\"]\t= Sql_prepareTexteAffichage($row['texte_intro']);\n\t\t\t$tab_result[$id][\"image_intro\"]\t= Sql_prepareTexteAffichage($row['image_intro']);\n\t\t\t$tab_result[$id][\"date\"]\t\t= Sql_prepareTexteAffichage($row['date']);\n\t\t\t$tab_result[$id][\"titre_data1\"]\t= Sql_prepareTexteAffichage($row['titre_data1']);\n\t\t\t$tab_result[$id][\"data1\"]\t\t= Sql_prepareTexteAffichage($row['data1']);\n\t\t\t$tab_result[$id][\"titre_data2\"]\t= Sql_prepareTexteAffichage($row['titre_data2']);\n\t\t\t$tab_result[$id][\"data2\"]\t\t= Sql_prepareTexteAffichage($row['data2']);\n\t\t\t$tab_result[$id][\"titre_data3\"]\t= Sql_prepareTexteAffichage($row['titre_data3']);\n\t\t\t$tab_result[$id][\"data3\"]\t\t= Sql_prepareTexteAffichage($row['data3']);\n\t\t\t$tab_result[$id][\"titre_data4\"]\t= Sql_prepareTexteAffichage($row['titre_data4']);\n\t\t\t$tab_result[$id][\"data4\"]\t\t= Sql_prepareTexteAffichage($row['data4']);\n\t\t\t$tab_result[$id][\"titre_data5\"]\t= Sql_prepareTexteAffichage($row['titre_data5']);\n\t\t\t$tab_result[$id][\"data5\"]\t\t= Sql_prepareTexteAffichage($row['data5']);\n\t\t\t$tab_result[$id][\"titre_data6\"]\t= Sql_prepareTexteAffichage($row['titre_data6']);\n\t\t\t$tab_result[$id][\"data6\"]\t\t= Sql_prepareTexteAffichage($row['data6']);\n\t\t\t$tab_result[$id][\"url_image\"]\t= Sql_prepareTexteAffichage($row['url_image']);\n\t\t\t$tab_result[$id][\"url_image2\"]\t= Sql_prepareTexteAffichage($row['url_image2']);\n\t\t\t$tab_result[$id][\"date_add\"]\t= Sql_prepareTexteAffichage($row['date_add']);\n\t\t\t$tab_result[$id][\"date_upd\"]\t= Sql_prepareTexteAffichage($row['date_upd']);\n\t\t\t$tab_result[$id][\"info_new\"]\t= Sql_prepareTexteAffichage($row['info_new']);\n\t\t}\n\t}\n\n\tif (count($tab_result) == 1 && ($args['id_new'] != '' && $args['id_new'] != '*'))\n\t\t$tab_result = array_pop($tab_result);\n\tif (count($tab_result) == 1 && ($args['code'] != '' && $args['lang'] != ''))\n\t\t$tab_result = array_pop($tab_result);\n\n\treturn $tab_result;\n}" ]
[ "0.6109563", "0.6082923", "0.60338396", "0.6025663", "0.59787697", "0.5885495", "0.58462244", "0.580724", "0.5804226", "0.5750887", "0.56910336", "0.56821924", "0.5677215", "0.5665121", "0.56553566", "0.5654239", "0.5640323", "0.5638037", "0.5546119", "0.5514486", "0.5499933", "0.54780215", "0.5448788", "0.54469", "0.54160666", "0.53895944", "0.5383873", "0.53560615", "0.535595", "0.5344046", "0.5343795", "0.5335156", "0.53298926", "0.53271496", "0.5323469", "0.53022206", "0.5296113", "0.52947605", "0.5291861", "0.5291679", "0.5284171", "0.527695", "0.52738297", "0.5254333", "0.5239493", "0.5237395", "0.52186245", "0.51965034", "0.5195374", "0.518887", "0.51771957", "0.51720226", "0.51682603", "0.51419735", "0.51333994", "0.51317817", "0.5117568", "0.51119465", "0.5097345", "0.5085029", "0.50823045", "0.50782406", "0.507815", "0.507815", "0.507815", "0.5072723", "0.50527287", "0.5047416", "0.50457025", "0.50390625", "0.5034999", "0.50336397", "0.50329673", "0.5032494", "0.5031703", "0.5027548", "0.5026837", "0.502503", "0.5019488", "0.50038856", "0.5002872", "0.49953473", "0.4993564", "0.49835163", "0.49806643", "0.49779117", "0.4975109", "0.49582303", "0.49433398", "0.49431792", "0.49387196", "0.49315867", "0.49281418", "0.49242687", "0.4914359", "0.49105588", "0.49095443", "0.49083656", "0.48970094", "0.48968035" ]
0.6236477
0
translate database row to ForumPost
public static function toPost($data) { $post = new ForumPost(); $post->setId(Parse::clean($data->id)); $post->setAuthorFK(Parse::clean($data->author)); $post->setMessage(Parse::clean($data->message)); $post->setCreated(Parse::clean($data->created)); $post->setEdited(Parse::clean($data->edited)); $post->setThreadFK(Parse::clean($data->thread)); return $post; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _convert_entity_to_post($entity)\n {\n // Was a model passed instead of an entity?\n $post = $entity;\n if (!$entity instanceof stdClass) {\n $post = $entity->get_entity();\n }\n // Create the post content\n $post_content = clone $post;\n foreach ($this->object->_table_columns as $column) {\n unset($post_content->{$column});\n }\n unset($post->id_field);\n unset($post->post_content_filtered);\n unset($post->post_content);\n $post->post_content = $this->object->serialize($post_content);\n $post->post_content_filtered = $post->post_content;\n $post->post_type = $this->object->get_object_name();\n // Sometimes an entity can contain a data stored in an array or object\n // Those will be removed from the post, and serialized in the\n // post_content field\n foreach ($post as $key => $value) {\n if (in_array(strtolower(gettype($value)), array('object', 'array'))) {\n unset($post->{$key});\n }\n }\n // A post required a title\n if (!property_exists($post, 'post_title')) {\n $post->post_title = $this->object->get_post_title($post);\n }\n // A post also requires an excerpt\n if (!property_exists($post, 'post_excerpt')) {\n $post->post_excerpt = $this->object->get_post_excerpt($post);\n }\n return $post;\n }", "public function toWordPressEntity();", "function formatarPost($post) {\n\n foreach($post as $chave => $valor) {\n $post[$chave] = filtrarSql($valor);\n }\n return $post;\n}", "protected function _translateRow(array $data, $key = null)\n {\n $newData = array();\n\n $newData['topic_id'] = $data['thread_id'];\n if( $data['forum_id'] )\n $newData['forum_id'] = $data['forum_id'];\n $newData['user_id'] = $data['user_id'];\n $newData['title'] = $data['title'];\n $newData['closed'] = $data['is_closed'];\n $newData['creation_date'] = $this->_translateTime($data['time_stamp']);\n $newData['modified_date'] = $this->_translateTime($data['time_update']);\n $newData['sticky'] = $data['order_id'];\n $newData['lastposter_id'] = $data['last_user_id'] ? $data['last_user_id'] : $data['user_id'];\n $newData['view_count'] = $data['total_view'];\n $type_id = '';\n //FIND WHEATER THIS FORUM IS PAGES FORUM AND FIND PAGES TYPE\n if( !$data['forum_id'] ) {\n $type_id = $this->getFromDb()->select()\n ->from($this->getfromPrefix() . 'pages', 'type_id')\n ->where('page_id = ?', $data['group_id'])\n ->query()\n ->fetchColumn();\n }\n $albumTitle = 'Forum Photos';\n $isGroupForum = false;\n if( !empty($type_id) ) {\n\n $newData['group_id'] = $data['group_id'];\n $albumTitle = 'Group Photos';\n $isGroupForum = true;\n //INSERT GROUP FORUM TOPIC\n $this->getToDb()->insert('engine4_group_topics', $newData);\n } else {\n //INSERT THE FORUM TOPIC\n $this->getToDb()->insert('engine4_forum_topics', $newData);\n }\n\n $topic_id = $this->getToDb()->lastInsertId();\n //FIND ALL THE POST OF THIS TOPIC\n $posts = $this->getFromDb()->select()\n ->from($this->getfromPrefix() . 'forum_post', '*')\n ->where('thread_id = ?', $data['thread_id'])\n ->query()\n ->fetchAll();\n $newPostData = array();\n $count = 0;\n //INSERT ALL THE POST OF TOPIC\n foreach( $posts as $post ) {\n //GETTING TEXT\n $text = $this->getFromDb()->select()\n ->from($this->getfromPrefix() . 'forum_post_text', 'text')\n ->where('post_id = ?', $post['post_id'])\n ->query()\n ->fetchColumn();\n\n if( is_null($text) || $text === false )\n $text = '';\n\n $userInfo = array(\n 'user_id' => $post['user_id'],\n 'time_stamp' => $post['time_stamp'],\n 'text' => $text,\n 'item_id' => $post['post_id'],\n 'album_title' => $albumTitle,\n 'album_type' => 'forum',\n 'categoryId' => 'forum'\n );\n if( !empty($type_id) ) {\n $userInfo['page_id'] = $data['group_id'];\n $userInfo['album_table'] = 'group_albums';\n }\n //FIND THE POST BODY\n $body = $this->getBody($userInfo);\n if( is_null($body) )\n $body = '';\n\n $newPostData['post_id'] = $post['post_id'];\n $newPostData['topic_id'] = $data['thread_id'];\n if( $data['forum_id'] )\n $newPostData['forum_id'] = $data['forum_id'];\n $newPostData['user_id'] = $post['user_id'];\n $newPostData['body'] = $body;\n $newPostData['creation_date'] = $this->_translateTime($post['time_stamp']);\n $newPostData['modified_date'] = $post['update_time'] ? $this->_translateTime($post['update_time']) : $this->_translateTime($post['time_stamp']);\n// INSERT THE FORUM POST\n if( $isGroupForum ) {\n $newPostData['group_id'] = $data['group_id'];\n $this->getToDb()->insert('engine4_group_posts', $newPostData);\n } else {\n $this->getToDb()->insert('engine4_forum_posts', $newPostData);\n }\n $post_id = $this->getToDb()->lastInsertId();\n //UPDATE THE COUNT OF POST INTO THE TOPIC\n if( $isGroupForum ) {\n $this->getToDb()->update('engine4_group_topics', array(\n 'lastpost_id' => $post_id,\n 'post_count' => ++$count\n ), array(\n 'topic_id = ?' => $topic_id\n ));\n } else {\n $this->getToDb()->update('engine4_forum_topics', array(\n 'lastpost_id' => $post_id,\n 'post_count' => ++$count\n ), array(\n 'topic_id = ?' => $topic_id,\n 'forum_id = ?' => $data['forum_id'],\n ));\n }\n }\n //PREPARE AN ARRAY FOR TOPIC WATCHES\n $newWatchData = array();\n if( $data['forum_id'] )\n $newWatchData['resource_id'] = $data['forum_id'];\n\n $newWatchData['topic_id'] = $data['thread_id'];\n $newWatchData['user_id'] = $data['user_id'];\n $newWatchData['watch'] = 1;\n if( $isGroupForum ) {\n $newWatchData['resource_id'] = $data['group_id'];\n $this->getToDb()->insert('engine4_group_topicwatches', $newWatchData);\n } else {\n $this->getToDb()->insert('engine4_forum_topicwatches', $newWatchData);\n }\n\n if( $data['forum_id'] ) {\n //PREPARE AN ARRAY FOR TOPIC VIEW\n $newTopicViewsData = array();\n $newTopicViewsData['user_id'] = $data['user_id'];\n $newTopicViewsData['topic_id'] = $data['thread_id'];\n $newTopicViewsData['last_view_date'] = $this->_translateTime($data['time_stamp']);\n $this->getToDb()->insert('engine4_forum_topicviews', $newTopicViewsData);\n //FIND THE FORUM DETAIL\n $forums = $this->getFromDb()->select()\n ->from($this->getfromPrefix() . 'forum', '*')\n ->where('forum_id = ?', $data['forum_id'])\n ->where('thread_id = ?', $data['thread_id'])\n ->query()\n ->fetchAll();\n //UPDATE THE POST COUNT INTO THE FORUM\n foreach( $forums as $forum ) {\n $this->getToDb()->update('engine4_forum_forums', array(\n 'topic_count' => $forum['total_thread'],\n 'post_count' => $forum['total_post'] + 1,\n 'lastpost_id' => $post_id,\n 'lastposter_id' => $forum['last_user_id'],\n ), array(\n 'forum_id = ?' => $data['forum_id'],\n ));\n }\n }\n }", "function convert_from_sql_row($row)\n\t{\n $this->SignupId = (int)$row->SignupId;\n $this->UserId = (int)$row->UserId;\n $this->RunId = (int)$row->RunId;\n $this->State = (string)$row->State;\n $this->PrevState = (string)$row->PrevState;\n $this->Gender = (string)$row->Gender;\n $this->Counted = (string)$row->Counted;\n $this->UpdatedById = (int)$row->UpdatedById;\n $this->TimeStamp = (string)$row->TimeStamp;\n\t}", "function convert_post_to_entity($post, $model = FALSE)\n {\n $entity = new stdClass();\n // Unserialize the post_content_filtered field\n if (is_string($post->post_content_filtered)) {\n if ($post_content = $this->object->unserialize($post->post_content_filtered)) {\n foreach ($post_content as $key => $value) {\n $post->{$key} = $value;\n }\n }\n }\n // Unserialize the post content field\n if (is_string($post->post_content)) {\n if ($post_content = $this->object->unserialize($post->post_content)) {\n foreach ($post_content as $key => $value) {\n $post->{$key} = $value;\n }\n }\n }\n // Copy post fields to entity\n unset($post->post_content);\n unset($post->post_content_filtered);\n foreach ($post as $key => $value) {\n $entity->{$key} = $value;\n }\n $this->object->_convert_to_entity($entity);\n return $model ? $this->object->convert_to_model($entity) : $entity;\n }", "public static function fixPostData( $post )\n\t{\n\t\treturn $post;\n\t}", "public function Forum() {\n\t $this->sql .= \" UNION\t\n\t SELECT 3, forum_id, thread_id, post_id, post_subject, LEFT(post_message, \".$this->nahlad.\") as post_message, post_datestamp\tFROM `fusion_posts`\n\t\t WHERE '\".$this->a.\"' > post_datestamp AND post_datestamp > '\".$this->b.\"'\tAND post_author = '\".$this->id.\"'\n\t \";\n\t}", "function asForumPosts($data) {\r\n$IPBHTML = \"\";\r\n//--starthtml--//\r\n$IPBHTML .= <<<EOF\r\n<!--Begin Msg Number {$data['pid']}-->\n<div class='post_block hentry clear no_sidebar ipsBox_container' id='post_id_{$data['pid']}'>\n\t<div class='post_wrap'>\n\t\t<if test=\"postMid:|:$data['member_id']\">\n\t\t\t<h3 class='row2'>\n\t\t<else />\n\t\t\t<h3 class='guest row2'>\n\t\t</if>\n\t\t<if test=\"postModCheckbox:|:$this->memberData['g_is_supmod']\">\n\t\t\t<span class='right'>\n\t\t\t\t<label for='checkbox_{$data['pid']}' class='post_mod hide'>{$this->lang->words['mod_select_post']}</label><input type='checkbox' id='checkbox_{$data['pid']}' name='selectedpids[]' value='{$data['pid']}' class='post_mod right'<if test=\"postModSelected:|:!empty( $data['_pid_selected'] )\"> checked='checked'</if> />\n\t\t\t</span>\n\t\t</if>\n\t\t\t<span class='post_id right ipsType_small desc blend_links'><a href='{parse url=\"showtopic={$data['topic_id']}&amp;view=findpost&amp;p={$data['pid']}\" template=\"showtopic\" seotitle=\"{$data['title_seo']}\" base=\"public\"}' rel='bookmark' title='{$this->lang->words['link_to_post']} #{$data['pid']}'>#{$data['pid']}</a></span>\n\t\t\t<a href=\"{parse url=\"showtopic={$data['tid']}\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}\">{IPSText::truncate( $data['topic_title'], 80)}</a>\n\t\t</h3>\n\t\t<div class='post_body'>\n\t\t\t<p class='posted_info desc lighter ipsType_small'>\n\t\t\t\t<img src='{$data['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_tiny' /> {$this->lang->words['posted']} {$this->lang->words['search_by']}\n\t\t\t\t<if test=\"postMember:|:$data['member_id']\"><span class=\"author vcard\">{parse template=\"userHoverCard\" group=\"global\" params=\"$data\"}</span><else />{$data['members_display_name']}</if>\n\t\t\t\t{$this->lang->words['on']} <abbr class=\"published\" title=\"{parse expression=\"date( 'c', $data['_post_date'] )\"}\">{parse date=\"$data['_post_date']\" format=\"long\"}</abbr>\n\t\t\t\t<if test=\"hasForumTrail:|:$data['_forum_trail']\">\n\t\t\t\t\t{$this->lang->words['in']}\n\t\t\t\t\t<foreach loop=\"topicsForumTrail:$data['_forum_trail'] as $i => $f\">\n\t\t\t\t\t\t<if test=\"notLastFtAsForum:|:$i+1 == count( $data['_forum_trail'] )\"><a href='{parse url=\"{$f[1]}\" template=\"showforum\" seotitle=\"{$f[2]}\" base=\"public\"}'>{$f[0]}</a></if>\n\t\t\t\t\t</foreach>\n\t\t\t\t</if>\n\t\t\t</p>\n\t\t\t<div class='post entry-content'>\n\t\t\t\t{$data['post']}\n\t\t\t\t{$data['attachmentHtml']}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<br />\n</div>\n<hr />\n<br />\r\nEOF;\r\n//--endhtml--//\r\nreturn $IPBHTML;\r\n}", "public static function getBlogPostInstance($row)\r\n\t\t{\r\n\t\t\t$blogPost = new BlogPost($row['blogger_id'],$row['title'],$row['blog_content']);\r\n\t\t\t$blogPost->setId($row['id']);\r\n\t\t\t$blogPost->setCreatedDate($row['created_date']);\r\n\t\t\treturn $blogPost;\r\n\t\t}", "protected function forum_queue_post()\n\t{\n\t\tif (!$this->topic->phpbb_topic_id)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$forum_id = self::get_queue_forum_id($this->topic->topic_category, $this->post_type);\n\n\t\tif (!$forum_id)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\ttitania::_include('functions_posting', 'phpbb_posting');\n\n\t\t$path_helper = phpbb::$container->get('path_helper');\n\t\t$post_text = $this->post_text;\n\n\t\thandle_queue_attachments($this, $post_text);\n\t\tmessage::decode($post_text, $this->post_text_uid);\n\n\t\t$post_text .= \"\\n\\n\" . $path_helper->strip_url_params($this->get_url(), 'sid');\n\n\t\t$options = array(\n\t\t\t'poster_id'\t\t\t\t=> $this->post_user_id,\n\t\t\t'topic_id'\t\t\t\t=> $this->topic->phpbb_topic_id,\n\t\t\t'topic_title'\t\t\t=> $this->post_subject,\n\t\t\t'post_text'\t\t\t\t=> $post_text,\n\t\t);\n\n\t\t$this->phpbb_post_id = phpbb_posting('reply', $options);\n\n\t\t$sql = 'UPDATE ' . TITANIA_POSTS_TABLE . '\n\t\t\tSET phpbb_post_id = ' . $this->phpbb_post_id . '\n\t\t\tWHERE post_id = ' . $this->post_id;\n\t\tphpbb::$db->sql_query($sql);\n\t}", "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 takePost($idPost){\r\n $db = $this->connectDB();\r\n $post = $db->prepare('SELECT id, title, text, DATE_FORMAT(date, \"le %d %b %Y à %H:%i\") AS datePost FROM oui.posts WHERE id = ?');\r\n $post->execute(array($idPost));\r\n \r\n return $post;\r\n }", "public function consultarPost($idPost){\n\n\t\ttry {\n \n\t\t\t$con = new PDO(\"mysql:host=localhost;dbname=forum;charset=utf8\", \"root\", \"\");\n\n \t\t$resultSet = $con->prepare(\"SELECT pos.nomePost,\n \t\t\t\t\t\t\t\t\t\t pos.descricao,\n \t\t\t\t\t\t\t\t\t\t date_format(pos.dataPost, '%d/%m/%Y') as dataPost,\n \t\t\t\t\t\t\t\t\t\t usu.nickname,\n \t\t\t\t\t\t\t\t\t\t usu.nome,\n \t\t\t\t\t\t\t\t\t\t usu.perfil,\n \t\t\t\t\t\t\t\t\t\t usu.foto,\n \t\t\t\t\t\t\t\t\t\t usu.assinatura,\n \t\t\t\t\t\t\t\t\t\t date_format(usu.dataRegistro, '%d/%m/%Y') as dataRegistro,\n \t\t\t\t\t\t\t\t\t\t usu.id_usuario,\n\t\t\t\t\t\t\t\t\t\t\t pos.id_post\n \t\t\t\t\t\t\t\t\t\t FROM tb_posts pos, \n\t \t\t\t\t\t\t\t\t\t\t tb_usuario usu\n \t\t\t\t\t\t\t\t\t\t WHERE pos.tb_usuario_id_usuario = usu.id_usuario\n \t\t\t\t\t\t\t\t\t\t AND pos.tb_topicos_id_topico = ?\" );\n\n\t\t\t$resultSet->bindParam(1, $idPost); // parametro bind se quizesse utilizar like seria // $resultSet->bindParam(1, $nome . “%”);\n\n\t\t\tif($resultSet->execute()){ // executa o select\n\t\t\t\tif($resultSet->rowCount() > 0){ // consulta retornou mais que 1 registro\n\t\t\t\t\twhile($row = $resultSet->fetch(PDO::FETCH_OBJ)){\n \t\t\t\t\t\t\n \t\t\t\t\t$postagem = New Postagem();\n \t\t\t\t\t$postagem->setNomePost($row->nomePost);\n \t\t\t\t\t$postagem->setDescricao($row->descricao);\n\t\t\t\t\t$postagem->setDataPost($row->dataPost);\n\t\t\t\t\t$postagem->setNickName($row->nickname);\n\t\t\t\t\t$postagem->setNome($row->nome);\n\t\t\t\t\t$postagem->setPerfil($row->perfil);\n\t\t\t\t\t$postagem->setAssinatura($row->assinatura);\n\t\t\t\t\t$postagem->setDataRegistro($row->dataRegistro);\n\t\t\t\t\t$postagem->setIdUsuario($row->id_usuario);\n\t\t\t\t\tif(empty($row->foto)){\n\t\t\t\t\t\t$postagem->setFoto('./imagens/usuarios/alien.png');\n\t\t\t\t\t}else{\n\t\t\t\t\t $postagem->setFoto($row->foto);\n\t\t\t\t\t}\n\t\t\t\t\t\t$postagem->setIdPost($row->id_post);\n\n\t\t\t\t\t}\n } \n }\n \n return $postagem;\n\n \t} \n \tcatch (Exception $e) {\n \t\tUtil::alerta($e->getMessage());\n \t}\n\n\t}", "public function parsePost($post){\n\t\t\n\t\t$postData = array();\n\t\t$postData['id'] = $post->id;\n\t\t$postData['title'] = $post->title;\n\t\t$postData['slug'] = $post->slug;\n\t\t$postData['url'] = Yii::app()->createAbsoluteUrl('/news/'.$post->id.'/'.$post->slug);\n\t\t$postData['description'] = $post->description;\n\t\t$postData['source'] = $post->source;\n\t\t$postData['source_title'] = $post->source_title;\n\t\t$postData['created_dt'] = $this->time2StringFormatted($post->created_dt);\n\t\t$postData['updated_dt'] = $this->time2StringFormatted($post->updated_dt);\n\t\t$postData['image'] = $post->image != '' ? Yii::app()->request->hostInfo . Yii::app()->request->baseUrl . '/static/' . $post->image : Yii::app()->request->hostInfo . Yii::app()->request->baseUrl . '/static/default_image.png';\n\t\t$postData['category'] = array();\n\t\tif($post->cat_id){\n\t\t\t$postData['category']['cat_id'] = $post->cat_id;\n\t\t\t$postData['category']['title'] = $post->Cat->title;\n\t\t}\n\t\t$postData['author'] = array();\n\t\tif($post->user_id){\n\t\t\t$postData['author']['user_id'] = $post->user_id;\n\t\t\t$postData['author']['user_full_name'] = $post->User->user_full_name;\n\t\t}\n\t\treturn $postData;\n\t\t\n\t}", "protected function transformRow($row){\n\n // if nothing to do\n if($row===null || is_scalar($row)){\n return $row;\n }\n\n foreach($this->connections as $data){\n // get self value\n $self = $row->{$data->getSelfKey()};\n\n $class = $data->getClassName();\n\n // if data isset - inject into key\n if(isset($this->relatedData[$class][$self])){\n $row->{$class} = $this->relatedData[$class][$self];\n // or inject empty value\n }else{\n $row->{$class} = [];\n }\n }\n\n return $row;\n }", "function forum_rss_feed_posts($forum, $newsince=0) {\n\n global $CFG;\n\n $items = array();\n\n if ($newsince) {\n $newsince = \" AND p.modified > '$newsince'\";\n } else {\n $newsince = \"\";\n }\n\n if ($recs = get_records_sql (\"SELECT p.id AS postid,\n d.id AS discussionid,\n d.name AS discussionname,\n u.id AS userid,\n u.firstname AS userfirstname,\n u.lastname AS userlastname,\n p.subject AS postsubject,\n p.message AS postmessage,\n p.created AS postcreated,\n p.format AS postformat\n FROM {$CFG->prefix}forum_discussions d,\n {$CFG->prefix}forum_posts p,\n {$CFG->prefix}user u\n WHERE d.forum = '$forum->id' AND\n p.discussion = d.id AND\n u.id = p.userid $newsince\n ORDER BY p.created desc\", 0, $forum->rssarticles)) {\n\n $item = NULL;\n $user = NULL;\n\n $formatoptions = new object;\n $formatoptions->trusttext = true;\n\n foreach ($recs as $rec) {\n unset($item);\n unset($user);\n $item->category = $rec->discussionname;\n $item->title = $rec->postsubject;\n $user->firstname = $rec->userfirstname;\n $user->lastname = $rec->userlastname;\n $item->author = fullname($user);\n $item->pubdate = $rec->postcreated;\n $item->link = $CFG->wwwroot.\"/mod/forum/discuss.php?d=\".$rec->discussionid.\"&parent=\".$rec->postid;\n $item->description = format_text($rec->postmessage,$rec->postformat,$formatoptions,$forum->course);\n\n\n $post_file_area_name = str_replace('//', '/', \"$forum->course/$CFG->moddata/forum/$forum->id/$rec->postid\");\n $post_files = get_directory_list(\"$CFG->dataroot/$post_file_area_name\");\n \n if (!empty($post_files)) { \n $item->attachments = array();\n foreach ($post_files as $file) { \n $attachment = new stdClass;\n if ($CFG->slasharguments) {\n $attachment->url = \"{$CFG->wwwroot}/file.php/$post_file_area_name/$file\";\n } else {\n $attachment->url = \"{$CFG->wwwroot}/file.php?file=/$post_file_area_name/$file\";\n } \n $attachment->length = filesize(\"$CFG->dataroot/$post_file_area_name/$file\");\n $item->attachments[] = $attachment;\n }\n }\n\n $items[] = $item;\n }\n }\n return $items;\n }", "public function generatePost($forum_id, $thread_id, $user, $message, $parent_pos, $notify, $subject = '', $alias = '', $date = '', $status = 1, $send_activation_mail = 0)\n\t{\n\t\tglobal $ilUser, $ilDB;\n\t\n\t\t$objNewPost = new ilForumPost();\n\t\t$objNewPost->setForumId($forum_id);\n\t\t$objNewPost->setThreadId($thread_id);\n\t\t$objNewPost->setSubject($subject);\n\t\t$objNewPost->setMessage($message);\n\t\t$objNewPost->setUserId($user);\n\t\t$objNewPost->setUserAlias($alias);\n\t\tif ($date == \"\")\n\t\t{\n\t\t\t$objNewPost->setCreateDate(date(\"Y-m-d H:i:s\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (strpos($date, \"-\") > 0)\t\t// in mysql format\n\t\t\t{\n\t\t\t\t$objNewPost->setCreateDate($date);\n\t\t\t}\n\t\t\telse\t\t\t\t\t\t\t\t// a timestamp\n\t\t\t{\n\t\t\t\t$objNewPost->setCreateDate(date(\"Y-m-d H:i:s\", $date));\n\t\t\t}\n\t\t}\n\n\t\t$objNewPost->setImportName($this->getImportName());\n\t\t$objNewPost->setNotification($notify);\n\t\t$objNewPost->setStatus($status);\n\t\t$objNewPost->insert();\n\t\t\n\t\t// entry in tree-table\n\t\tif ($parent_pos == 0)\n\t\t{\n\t\t\t$this->addPostTree($objNewPost->getThreadId(), $objNewPost->getId(), $objNewPost->getCreateDate());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->insertPostNode($objNewPost->getId(), $parent_pos, $objNewPost->getThreadId(), $objNewPost->getCreateDate());\n\t\t}\n//echo \"<br>->\".$objNewPost->getId().\"-\".$parent_pos.\"-\".$objNewPost->getThreadId().\"-\".\n//\t$objNewPost->getCreateDate().\"-\".$forum_id.\"-\".$message.\"-\".$user.\"-\";\n\t\t// string last post\n\t\t$lastPost = $objNewPost->getForumId().\"#\".$objNewPost->getThreadId().\"#\".$objNewPost->getId();\n\t\t\t\n\t\t// update thread\n\t\t$result = $ilDB->manipulateF('\n\t\t\tUPDATE frm_threads \n\t\t\tSET thr_num_posts = thr_num_posts + 1,\n\t\t\t\tthr_last_post = %s\n\t\t\tWHERE thr_pk = %s',\n\t\t\tarray('text', 'integer'),\n\t\t\tarray($lastPost, $objNewPost->getThreadId()));\n\t\t\n\t\t// update forum\n\t\t$result = $ilDB->manipulateF('\n\t\t\tUPDATE frm_data \n\t\t\tSET top_num_posts = top_num_posts + 1,\n\t\t\t \ttop_last_post = %s\n\t\t\tWHERE top_pk = %s',\n\t\t\tarray('text', 'integer'),\n\t\t\tarray($lastPost, $objNewPost->getForumId()));\n\t\t\n\t\t// MARK READ\n\t\t$forum_obj = ilObjectFactory::getInstanceByRefId($this->getForumRefId());\n\t\t$forum_obj->markPostRead($objNewPost->getUserId(), $objNewPost->getThreadId(), $objNewPost->getId());\n\t\t\n\t\t$pos_data = $objNewPost->getDataAsArray();\n\t\t$pos_data[\"ref_id\"] = $this->getForumRefId();\n\n\t\t// FINALLY SEND MESSAGE\n\n\t\tif ($this->ilias->getSetting(\"forum_notification\") == 1 && (int)$status )\n\t\t{\n\t\t\t$GLOBALS[\"frm_notifications_sent\"] = array();\n\t\t\t$this->__sendMessage($parent_pos, $pos_data);\n\n\t\t\t$pos_data[\"top_name\"] = $forum_obj->getTitle();\t\t\t\n\t\t\t$this->sendForumNotifications($pos_data);\n\t\t\t$this->sendThreadNotifications($pos_data);\n\t\t\tunset($GLOBALS[\"frm_notifications_sent\"]);\n\t\t}\n\t\t\n\t\t// Send notification to moderators if they have to enable a post\n\t\t\n\t\tif (!$status && $send_activation_mail)\n\t\t{\n\t\t\t$pos_data[\"top_name\"] = $forum_obj->getTitle();\t\t\t\n\t\t\t$this->sendPostActivationNotification($pos_data);\n\t\t}\n\t\t\n\t\t// Add Notification to news\n\t\tif ($status)\n\t\t{\n\t\t\trequire_once 'Services/RTE/classes/class.ilRTE.php';\n\t\t\tinclude_once(\"./Services/News/classes/class.ilNewsItem.php\");\n\t\t\t$news_item = new ilNewsItem();\n\t\t\t$news_item->setContext($forum_obj->getId(), 'frm', $objNewPost->getId(), 'pos');\n\t\t\t$news_item->setPriority(NEWS_NOTICE);\n\t\t\t$news_item->setTitle($objNewPost->getSubject());\n\t\t\t$news_item->setContent(ilRTE::_replaceMediaObjectImageSrc($this->prepareText($objNewPost->getMessage(), 0), 1));\n\t\t\t$news_item->setUserId($user);\n\t\t\t$news_item->setVisibility(NEWS_USERS);\n\t\t\t$news_item->create();\n\t\t}\n\t\t\n\t\treturn $objNewPost->getId();\n\t}", "public function getOriginalPost() {\n\t\t\n\t\ttry {\n\t\t\t$select = $this->pdo->select()\n\t\t\t\t\t\t\t\t->from('posts_'.$this->board)\n\t\t\t\t\t\t\t\t->where('id', '=', $this->tId);\n\t\t\t$stmt = $select->execute();\n\t\t\t$data = $stmt->fetch();\n\t\t\t\n\t\t\tif($data) {\n\t\t\t\t$thread_exists = true;\n\t\t\t\t\n\t\t\t\t$this->tSubject = $data['subject'];\n\t\t\t\t$this->tEmail = $data['email'];\n\t\t\t\t$this->tName = $data['name'];\n\t\t\t\t$this->tTrip = $data['trip'];\n\t\t\t\t$this->tCapcode = $data['capcode'];\n\t\t\t\t$this->tSubject = $data['subject'];\n\t\t\t\t$this->tBody = $data['body'];\n\t\t\t\t$this->tFiles = $data['files'];\n\t\t\t\t$this->tIP = $data['ip'];\n\t\t\t\t$this->tPostedAt = $data['posted_at'];\n\t\t\t\t$this->tBumpedAt = $data['bumped_at'];\n\t\t\t\t$this->tSticky = $data['sticky'];\n\t\t\t\t$this->tLocked = $data['locked'];\n\t\t\t\t$this->tSage = $data['sage'];\n\t\t\t\t\n\t\t\t\tif($this->tFiles) {\n\t\t\t\t\n\t\t\t\t\t$fileInfo = json_decode($this->tFiles);\n\t\t\t\t\t\n\t\t\t\t\t$this->tFileName = $fileInfo->{'name'}.'.'.$fileInfo->{'mime'};\n\t\t\t\t\t$this->tFileThumb = SITE_URL.'/content/thumb/'.$this->tFileName;\n\t\t\t\t\t$this->tFileUrl = SITE_URL.'/content/'.$this->tFileName;\n\t\t\t\t\t$this->tHuman = '('.$fileInfo->{'human'}.', '.$fileInfo->{'width'}.'x'.$fileInfo->{'height'}.', '.$fileInfo->{'oriName'}.')';\n\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$thread_exists = false;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} catch (\\Exception $e) {\n\t\t\t$this->app->error($e);\n\t\t}\n\t\n\t\treturn $thread_exists;\n\t}", "public function fetchPostNodeData($a_row)\n\t{\n\t\tglobal $lng;\n\n\t\trequire_once('./Services/User/classes/class.ilObjUser.php');\n\t\t\n\t\tif (ilObject::_exists($a_row->pos_usr_id))\n\t\t{\n\t\t\t$tmp_user = new ilObjUser($a_row->pos_usr_id);\n\t\t\t$fullname = $tmp_user->getFullname();\n\t\t\t$loginname = $tmp_user->getLogin();\n\t\t}\n\t\n\t\t$fullname = $fullname ? $fullname : ($a_row->import_name ? $a_row->import_name : $lng->txt(\"unknown\"));\n\n\t\t$data = array(\n\t\t\t\t\t\"pos_pk\"\t\t=> $a_row->pos_pk,\n\t\t\t\t\t\"child\" => $a_row->pos_pk,\n\t\t\t\t\t\"author\"\t\t=> $a_row->pos_usr_id,\n\t\t\t\t\t\"alias\"\t\t\t=> $a_row->pos_usr_alias,\n\t\t\t\t\t\"title\" => $fullname,\n\t\t\t\t\t\"loginname\"\t\t=> $loginname,\n\t\t\t\t\t\"type\" => \"post\",\n\t\t\t\t\t\"message\"\t\t=> $a_row->pos_message,\n\t\t\t\t\t\"subject\"\t\t=> $a_row->pos_subject,\t\n\t\t\t\t\t\"pos_cens_com\"\t=> $a_row->pos_cens_com,\n\t\t\t\t\t\"pos_cens\"\t\t=> $a_row->pos_cens,\n\t\t\t\t//\t\"date\"\t\t\t=> $a_row->date,\n\t\t\t\t\t\"date\"\t\t\t=> $a_row->fpt_date,\n\t\t\t\t\t\"create_date\"\t=> $a_row->pos_date,\n\t\t\t\t\t\"update\"\t\t=> $a_row->pos_update,\t\t\t\t\t\n\t\t\t\t\t\"update_user\"\t=> $a_row->update_user,\n\t\t\t\t\t\"tree\"\t\t\t=> $a_row->thr_fk,\t\t\t\t\t\n\t\t\t\t\t\"parent\"\t\t=> $a_row->parent_pos,\n\t\t\t\t\t\"lft\"\t\t\t=> $a_row->lft,\n\t\t\t\t\t\"rgt\"\t\t\t=> $a_row->rgt,\n\t\t\t\t\t\"depth\"\t\t\t=> $a_row->depth,\n\t\t\t\t\t\"id\"\t\t\t=> $a_row->fpt_pk,\n\t\t\t\t\t\"notify\"\t\t=> $a_row->notify,\n\t\t\t\t\t\"import_name\" => $a_row->import_name,\n\t\t\t\t\t\"pos_status\" => $a_row->pos_status\n\t\t\t\t\t);\n\t\t\n\t\t// why this line? data should be stored without slashes in db\n\t\t//$data[\"message\"] = stripslashes($data[\"message\"]);\n\n\t\treturn $data ? $data : array();\n\t}", "function populate_object_with_post_by_id() {\n $query = \"SELECT\n *\n FROM\n \" . $this->table_name . \" \n WHERE\n id = ?\";\n \n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n \n // bind id of user to be updated\n $stmt->bindParam(1, $this->id);\n \n // execute query\n $stmt->execute();\n\n if (!$stmt->rowCount() > 0) {\n // false means that post not exists\n return false;\n }\n \n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->id = $row['id'];\n $this->username = $row['username'];\n $this->date = $row['date'];\n $this->private = $row['private'] > 0;\n $this->content = $row['content'];\n /* $this->images = array();\n $this->likes = 0;\n $this->meLike = false;\n $this->comments = array(); */\n return true;\n }", "function create_or_update_blog_post( $param_map )\n {\n $query = <<<SQL\nselect fn_insert_or_update_row\n (\n 'tb_blog_post',\n ?param_json?::json,\n array[ 'blog_post' ]\n ) as blog_post\nSQL;\n\n $param_json = json_encode( $param_map );\n $params = [ 'param_json' => $param_json ];\n\n $upsert = query_execute( $query, $params );\n\n if( query_success( $upsert ) )\n {\n $retval = query_fetch_one( $upsert );\n return $retval['blog_post'];\n }\n else\n return false;\n }", "private function _getContent() {\r\n $fieldsToLoad = array('id', 'pagetitle', 'longtitle', 'description', 'parent',\r\n 'alias', 'pub_date', 'parent', 'introtext', 'content', 'createdby', 'createdon', 'class_key');\r\n $c = $this->xpdo->newQuery('disBoard');\r\n $c->setClassAlias('Board');\r\n $c->distinct();\r\n $c->select(array(\r\n $this->xpdo->getSelectColumns('disBoard', 'Board', 'Board_', $fieldsToLoad),\r\n $this->xpdo->getSelectColumns('disBoard', 'subBoard', 'subBoard_', $fieldsToLoad),\r\n 'lastpost_pagetitle' => 'Post.pagetitle',\r\n 'lastpost_content' => 'Post.content',\r\n 'lastpost_id' => 'Post.id',\r\n 'lastpost_author' => 'Post.createdby',\r\n 'lastpost_username' => 'User.username',\r\n 'lastpost_display_name' => 'Profile.display_name',\r\n 'lastpost_use_display_name' => 'Profile.use_display_name',\r\n 'lastpost_thread_id' => 'Post.parent',\r\n 'lastpost_parent' => 'c.ancestor', // Setting this to Board to show as last post on it\r\n 'lastpost_class_key' => 'Post.class_key',\r\n 'lastpost_createdon' => 'Post.createdon',\r\n 'subPost_pagetitle' => 'subPost.pagetitle',\r\n 'subPost_content' => 'subPost.content',\r\n 'subPost_id' => 'subPost.id',\r\n 'subPost_author' => 'subPost.createdby',\r\n 'subPost_username' => 'User2.username',\r\n 'subPost_display_name' => 'Profile2.display_name',\r\n 'subPost_use_display_name' => 'Profile2.use_display_name',\r\n 'subPost_thread_id' => 'subPost.parent',\r\n 'subPost_parent' => 'c2.ancestor', // Setting this to Board to show as last subPost on it\r\n 'subPost_class_key' => 'subPost.class_key',\r\n 'subPost_createdon' => 'subPost.createdon'\r\n ));\r\n $c->innerJoin('disClosure', 'c', \"{$this->xpdo->escape('c')}.{$this->xpdo->escape('ancestor')} = {$this->xpdo->escape('Board')}.{$this->xpdo->escape('id')} \");\r\n $c->leftJoin('disBoard', 'subBoard', \"{$this->xpdo->escape('subBoard')}.{$this->xpdo->escape('parent')} = {$this->xpdo->escape('Board')}.{$this->xpdo->escape('id')}\r\n AND {$this->xpdo->escape('subBoard')}.{$this->xpdo->escape('class_key')} = 'disBoard'\");\r\n\r\n $cSub = $this->xpdo->newQuery('disPost');\r\n $cSub->setClassAlias('postPrimary');\r\n $cSub->select(array(\"MAX({$this->xpdo->escape('postPrimary')}.{$this->xpdo->escape('id')})\"));\r\n $cSub->leftJoin('disClosure', 'c3', \"{$this->xpdo->escape('postPrimary')}.{$this->xpdo->escape('id')} = {$this->xpdo->escape('c3')}.{$this->xpdo->escape('descendant')}\");\r\n $cSub->where(array(\r\n \"{$this->xpdo->escape('c3')}.{$this->xpdo->escape('ancestor')} = {$this->xpdo->escape('Board')}.{$this->xpdo->escape('id')}\",\r\n \"{$this->xpdo->escape('postPrimary')}.{$this->xpdo->escape('class_key')} = 'disPost'\"));\r\n $cSub->prepare();\r\n\r\n $c->leftJoin('disPost', 'Post', \"{$this->xpdo->escape('Post')}.{$this->xpdo->escape('parent')} = {$this->xpdo->escape('c')}.{$this->xpdo->escape('descendant')}\r\n AND {$this->xpdo->escape('Post')}.{$this->xpdo->escape('class_key')} = 'disPost'\r\n AND{$this->xpdo->escape('Post')}.{$this->xpdo->escape('id')} = ({$cSub->toSQL()})\");\r\n\r\n $cSub2 = $this->xpdo->newQuery('disPost');\r\n $cSub2->setClassAlias('postSecondary');\r\n $cSub2->select(array(\"MAX({$this->xpdo->escape('postSecondary')}.{$this->xpdo->escape('id')})\"));\r\n $cSub2->leftJoin('disClosure', 'c4', \"{$this->xpdo->escape('postSecondary')}.{$this->xpdo->escape('id')} = {$this->xpdo->escape('c4')}.{$this->xpdo->escape('descendant')}\");\r\n $cSub2->where(array(\r\n \"{$this->xpdo->escape('c4')}.{$this->xpdo->escape('ancestor')} = {$this->xpdo->escape('subBoard')}.{$this->xpdo->escape('id')}\",\r\n \"{$this->xpdo->escape('postSecondary')}.{$this->xpdo->escape('class_key')} = 'disPost'\"\r\n ));\r\n\r\n $cSub2->prepare();\r\n $c->leftJoin('disClosure', 'c2', \"{$this->xpdo->escape('c2')}.{$this->xpdo->escape('ancestor')} = {$this->xpdo->escape('subBoard')}.{$this->xpdo->escape('id')} \");\r\n $c->leftJoin('disPost', 'subPost', \"{$this->xpdo->escape('subPost')}.{$this->xpdo->escape('parent')} = {$this->xpdo->escape('c2')}.{$this->xpdo->escape('descendant')}\r\n AND {$this->xpdo->escape('subPost')}.{$this->xpdo->escape('class_key')} = 'disPost'\r\n AND subPost.id = ({$cSub2->toSQL()})\");\r\n\r\n $c->leftJoin('disUser', 'User', \"{$this->xpdo->escape('User')}.{$this->xpdo->escape('id')} = {$this->xpdo->escape('Post')}.{$this->xpdo->escape('createdby')}\");\r\n $c->leftJoin('disUserProfile', 'Profile', \"{$this->xpdo->escape('Profile')}.{$this->xpdo->escape('internalKey')} = {$this->xpdo->escape('User')}.{$this->xpdo->escape('id')}\");\r\n\r\n $c->leftJoin('disUser', 'User2', \"{$this->xpdo->escape('User2')}.{$this->xpdo->escape('id')} = {$this->xpdo->escape('subPost')}.{$this->xpdo->escape('createdby')}\");\r\n $c->leftJoin('disUserProfile', 'Profile2', \"{$this->xpdo->escape('Profile2')}.{$this->xpdo->escape('internalKey')} = {$this->xpdo->escape('User2')}.{$this->xpdo->escape('id')}\");\r\n\r\n $c->where(array(\r\n 'Board.parent' => $this->id,\r\n 'Board.published' => 1,\r\n 'Board.deleted' => 0,\r\n ));\r\n $c->sortby(\"{$this->xpdo->escape('Board')}.{$this->xpdo->escape('menuindex')}\", 'ASC');\r\n $c->prepare();\r\n $rows = self::_loadRows($this->xpdo, 'disCategory', $c);\r\n $rows = $rows->fetchAll(PDO::FETCH_ASSOC);\r\n if (count($rows) == 0) {\r\n return;\r\n }\r\n $hydrated = array();\r\n\r\n foreach ($rows as $row) {\r\n $hydrated = $this->xpdo->discuss2->hydrateRow($row, $hydrated);\r\n }\r\n $disCategory = $this->xpdo->newObject('disBoard');\r\n foreach ($hydrated as $k => $board) {\r\n if ($board['class_key'] == 'disBoard') {\r\n $disCategory->id = $board['id'];\r\n $disCategory->_policies = array();\r\n if ($disCategory->checkPolicy('load') !== true) {\r\n unset($hydrated[$k]);\r\n }\r\n }\r\n }\r\n reset($hydrated);\r\n\r\n $boards = $this->xpdo->discuss2->createTree($hydrated);\r\n $boards = $this->_treeToView($boards);\r\n $this->xpdo->setPlaceholder('discuss2.content', implode(\"\\n\",$boards));\r\n }", "public function read($post_id)\n {\n $ztable = DBUtil::getTables();\n $postscols = DBUtil::_getAllColumnsQualified('dizkus_posts', 'p');\n\n $sql = 'SELECT '. $postscols .',\n t.topic_title,\n t.topic_replies,\n f.forum_name,\n c.cat_title,\n c.cat_id\n FROM '.$ztable['dizkus_posts'].' p\n LEFT JOIN '.$ztable['dizkus_topics'].' t ON t.topic_id = p.topic_id\n LEFT JOIN '.$ztable['dizkus_forums'].' f ON f.forum_id = t.forum_id\n LEFT JOIN '.$ztable['dizkus_categories'].' c ON c.cat_id = f.cat_id\n WHERE p.post_id = '.(int)DataUtil::formatForStore($post_id);\n\n $result = DBUtil::executeSQL($sql);\n if ($result === false) {\n return LogUtil::registerError($this->__('Error! The topic you selected was not found. Please go back and try again.'), null, ModUtil::url('Dizkus', 'user', 'main'));\n }\n\n $colarray = DBUtil::getColumnsArray ('dizkus_posts');\n $colarray[] = 'topic_title';\n $colarray[] = 'topic_replies';\n $colarray[] = 'forum_name';\n $colarray[] = 'cat_title';\n $colarray[] = 'cat_id';\n\n $objarray = DBUtil::marshallObjects ($result, $colarray);\n $post = $objarray[0];\n if (!allowedtoreadcategoryandforum($post['cat_id'], $post['forum_id'])) {\n return LogUtil::registerPermissionError();\n }\n\n $post['post_id'] = DataUtil::formatForDisplay($post['post_id']);\n $post['post_time'] = DataUtil::formatForDisplay($post['post_time']);\n $message = $post['post_text'];\n $post['has_signature'] = (substr($message, -8, 8)=='[addsig]');\n $post['post_rawtext'] = dzk_replacesignature($message, '');\n $post['post_rawtext'] = preg_replace(\"#<!-- editby -->(.*?)<!-- end editby -->#si\", '', $post['post_rawtext']);\n $post['post_rawtext'] = str_replace('<br />', '', $post['post_rawtext']);\n $post['topic_id'] = DataUtil::formatForDisplay($post['topic_id']);\n $post['topic_rawsubject'] = strip_tags($post['topic_title']);\n $post['topic_subject'] = DataUtil::formatForDisplay($post['topic_title']);\n $post['topic_replies'] = DataUtil::formatForDisplay($post['topic_replies']);\n $post['forum_id'] = DataUtil::formatForDisplay($post['forum_id']);\n $post['forum_name'] = DataUtil::formatForDisplay($post['forum_name']);\n $post['cat_title'] = DataUtil::formatForDisplay($post['cat_title']);\n $post['cat_id'] = DataUtil::formatForDisplay($post['cat_id']);\n $post['poster_data'] = ModUtil::apiFunc($this->name, 'user', 'get_userdata_from_id', array('userid' => $post['poster_id']));\n\n // create unix timestamp\n $post['post_unixtime'] = strtotime($post['post_time']);\n $post['posted_unixtime'] = $post['post_unixtime'];\n\n $pn_uid = UserUtil::getVar('uid');\n $post['moderate'] = false;\n if (allowedtomoderatecategoryandforum($post['cat_id'], $post['forum_id'])) {\n $post['moderate'] = true;\n }\n\n $post['poster_data']['edit'] = false;\n $post['poster_data']['reply'] = false;\n $post['poster_data']['seeip'] = false;\n $post['poster_data']['moderate'] = false;\n\n if ($post['poster_data']['uid']==$pn_uid) {\n // user is allowed to moderate || own post\n $post['poster_data']['edit'] = true;\n }\n if (allowedtowritetocategoryandforum($post['cat_id'], $post['forum_id'])) {\n // user is allowed to reply\n $post['poster_data']['reply'] = true;\n }\n\n if (allowedtomoderatecategoryandforum($post['cat_id'], $post['forum_id']) &&\n ModUtil::getVar('Dizkus', 'log_ip') == 'yes') {\n // user is allowed to see ip\n $post['poster_data']['seeip'] = true;\n }\n if (allowedtomoderatecategoryandforum($post['cat_id'], $post['forum_id'])) {\n // user is allowed to moderate\n $post['poster_data']['moderate'] = true;\n $post['poster_data']['edit'] = true;\n }\n\n $post['post_textdisplay'] = phpbb_br2nl($message);\n $post['post_textdisplay'] = dzk_replacesignature($post['post_textdisplay'], $post['poster_data']['signature']);\n\n // call hooks for $message_display ($message remains untouched for the textarea)\n // list($post['post_textdisplay']) = ModUtil::callHooks('item', 'transform', $post['post_id'], array($post['post_textdisplay']));\n $post['post_textdisplay'] = dzkVarPrepHTMLDisplay($post['post_textdisplay']);\n $post['post_text'] = $post['post_textdisplay'];\n\n // allow to edit the subject if first post\n $post['first_post'] = $this->isFirst(array('topic_id' => $post['topic_id'], 'post_id' => $post['post_id']));\n\n return $post;\n }", "private static function transform_db_row_to_data(stdClass $dbrow) : stdClass {\n return (object) [\n 'name' => $dbrow->reengagementname,\n 'userid' => $dbrow->userid,\n 'completiontime' => transform::datetime($dbrow->completiontime),\n 'emailtime' => transform::datetime($dbrow->emailtime),\n 'emailsent' => $dbrow->emailsent,\n 'completed' => $dbrow->completed\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 function getFreshPost(){\n\t\treturn Go_Factory::getDbTable( 'Forum_Model_Post' )->fetchFreshByCategoryId( $this->getId() );\n\t}", "public function load_post($post_id)\n\t{\n\t\t$post = new titania_post();\n\t\t$post->post_id = $post_id;\n\n\t\tif ($post->load() === false)\n\t\t{\n\t\t\ttrigger_error('NO_POST');\n\t\t}\n\n\t\t$post->topic = $this->load_topic($post->topic_id);\n\n\t\treturn $post;\n\t}", "function get_post_title($data)\n\t{\n\t\tglobal $db;\n\t\t$query = 'SELECT board_post_title FROM gv_board_post WHERE (board_post_id = ' . $data . ') AND (board_post_block = 0 AND board_member = 1)';\n\t\t$result = mysql_query($query, $db) or die (mysql_error($db));\n\t\t$row = mysql_fetch_assoc($result);\n\t\textract($row);\n\t\treturn $board_post_title;\n\t}", "private function replacePostContent()\n\t\t{\n\t\t\t//use wpdb\n\t\t\tglobal $wpdb;\n\t\t\t\n\t\t\t//Préparation de la requête\n\t\t\t$postContentSql = $wpdb->prepare(\n\t\t\t\t\"\n\t\t\t\tUPDATE $wpdb->posts \n\t\t\t\tSET post_content = replace(\n\t\t\t\t\tpost_content, \n\t\t\t\t\t%s, \n\t\t\t\t\t%s\n\t\t\t\t) \n\t\t\t\t\",\n\t\t\t\t$this->settings['oldurl_value'],\n\t\t\t\t$this->settings['newurl_value']\n\t\t\t);\n\n\t\t\t//Requête\n\t\t\t$postContentRequete = $wpdb->query($postContentSql,OBJECT);\n\n\t\t\t//Erreur\n\t\t\tif($postContentRequete === false){\n\t\t\t\tdo_action('DFWPNotice',__('Posts content replace error',$this->settings['textdomain']),true);\n\t\t\t}\n\n\t\t\t//Tout est bon\n\t\t\telse{\n\t\t\t\tdo_action('DFWPNotice',sprintf(__('%d replacements in posts content',$this->settings['textdomain']),$postContentRequete),false);\n\t\t\t}\n\t\t}", "public function displayPost()\r\n {\r\n $forumName = $_GET['name'];\r\n\r\n $servername = \"localhost\";\r\n $username = \"root\";\r\n $password = \"\";\r\n\r\n $db = \"forumdb\";\r\n\r\n $table = \"post\";\r\n\r\n // Create connection\r\n $conn = new mysqli($servername, $username, $password, $db);\r\n\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Connection failed: \" . $conn->connect_error);\r\n }\r\n else\r\n {\r\n $sql = \"SELECT * FROM $table WHERE forum_name = '$forumName'\";\r\n $result = $conn->query($sql);\r\n\r\n if ($result->num_rows > 0)\r\n {\r\n // get data of each row\r\n while ($row = $result->fetch_assoc())\r\n {\r\n if (strpos($row[\"post_body\"], 'https://')!==false)\r\n {\r\n /*this part checks if a url exists in the chat, the !==false is there on purpose because\r\n strpos returns either the offset at which the needle string begins in the haystack string\r\n or the boolean false if the needle isn't found.\r\n */\r\n echo \"<p style='color:greenyellow;'>\" . $row[\"post_author\"] . \" - Posted @ \" . $row[\"timin\"] . \" : </p>\" .\"<a href='\". $row[\"post_body\"] . \"'>\".$row[\"post_body\"].\"</a><br><br>\";\r\n echo \"</br>\";\r\n }\r\n else if(strpos($row[\"post_body\"], '.com')!==false) //if you want to add more options for link detections you can do it here and keep advancing the else if statements\r\n {\r\n echo \"<p style='color:greenyellow;'>\" . $row[\"post_author\"] . \" - Posted @ \" . $row[\"timin\"] . \" : </p>\" .\"<a href='\". $row[\"post_body\"] . \"'>\".$row[\"post_body\"].\"</a><br><br>\";\r\n echo \"</br>\";\r\n }\r\n else\r\n {\r\n echo \"<p style='color:greenyellow;'>\" . $row[\"post_author\"] . \" - Posted @ \" . $row[\"timin\"] . \" : </p>\" . $row[\"post_body\"] . \"<br><br>\";\r\n echo \"</br>\";\r\n }\r\n }\r\n\r\n }\r\n else\r\n {\r\n //echo \"0 results\";\r\n echo \"Be the first the post!\";\r\n }\r\n $conn->close();\r\n }\r\n }", "private function _postListToObject($postsList, $loggedUserId){\n $posts = []; //array que armazenará cada OBJETO post\n\n foreach ($postsList as $postItem) {\n $newPost = new Post();\n\n //3.1 Adicionando informações do post\n $newPost->id = $postItem['id'];\n $newPost->type = $postItem['type'];\n $newPost->created_at = $postItem['created_at'];\n $newPost->body = $postItem['body'];\n $newPost->mine = false; //Se true, post é do usuário logado\n\n //Verificando se o post eh do usuário que esta logado\n if ($postItem['id_user'] == $loggedUserId) {\n $newPost->mine = true;\n }\n\n //3. Preencher as informações adicionais no post\n $newUser = User::select()->where('id', $postItem['id_user'])->one();\n\n $newPost->user = new User();\n $newPost->user->setId($newUser['id']);\n $newPost->user->setName($newUser['name']);\n $newPost->user->setAvatar($newUser['avatar']);\n\n //TODO 3.1 Preencher as informações de like\n $newPost->likeCount = 0;\n\n //Flag que indica se o usuário logado curtiu a respectiva postagem\n $newPost->liked = false;\n\n //TODO 3.2 Preencher as informações de comments\n $newPost->comments = [];\n\n $posts[] = $newPost;\n }\n\n return $posts;\n }", "public function updatePost($payload, $post){\n $cols = array();\n $vals = array();\n foreach ($payload as $key => $value) {\n if($key == \"username\" || $key == \"post_id\" || $key == \"UID\" || $key == \"likes\" || $key == \"created_at\"|| $value = null || $key == \"category\" || $key ==\"author\"){\n continue;\n }else if($key == \"body\" || $key == \"title\" || $key == \"image\" ){\n $temp = \"'\".$payload[$key].\"'\";\n array_push($cols, $key);\n array_push($vals, $temp);\n }else{\n throw new error(\"unexpected values for updating post.\");\n }\n }\n array_push($cols, \"updated_at\");\n array_push($vals, \"'\".$formattedTime.\"'\");\n return Message::update($cols, $vals, $payload[\"post_id\"]);\n }", "public function getLastPost()\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\t\n\t\t$select = $select->from(array('a' => PrecurioTableConstants::FORUM_POSTS))\n\t\t\t->join(array('b' => PrecurioTableConstants::USERS), 'a.user_id = b.user_id', array('first_name', 'last_name'))\t\n\t\t\t->join(array('d' => PrecurioTableConstants::FORUM_TOPICS), 'd.id = a.topic_id', array())\n\t\t\t->join(array('c' => PrecurioTableConstants::FORUMS), 'c.id = d.forum_id', array())\n\t\t\t\t\t\t\n\t\t\t->where(\"a.active = 1 AND c.id = {$this->getId()}\")\n\t\t\t->order(\"a.id DESC\");\n\t\t\n\t\n\t\treturn $table->fetchRow($select);\n\t}", "function get_post($id) {\n $ci = & get_instance();\n $ci->db->from('post');\n $ci->db->where('post_id', $id);\n $post = $ci->db->get()->result();\n\n if (!(is_array($post) && count($post) == 1)) {\n return NULL;\n }\n\n $ci->db->from('comment');\n $ci->db->where('post_id', $post[0]->post_id);\n\n $comments = build_comments($ci->db->get()->result());\n\n $ci->db->from('text_post');\n $ci->db->where('post_id', $post[0]->post_id);\n $text_posts = $ci->db->get()->result();\n\n if (is_array($text_posts) && count($text_posts) == 1) {\n $text_post = build_text_post($post[0], $text_posts[0]->post_text);\n $text_post->comments = $comments;\n return $text_post;\n } else {\n $ci->db->from('link_post');\n $ci->db->where('post_id', $post[0]->post_id);\n $link_posts = $ci->db->get()->result();\n\n if (is_array($link_posts) && count($link_posts) == 1) {\n $link_post = build_link_post($post[0], $link_posts[0]->post_link);\n $link_post->comments = $comments;\n return $link_post;\n } else {\n return NULL;\n }\n }\n }", "function create_post($content, $parent_id, $user, $forum, $thread, $signature) {\n $content = substr($content, 0, 64000);\n $content = mysql_real_escape_string($content);\n $now = time();\n $sig = $signature?1:0;\n $id = BoincPost::insert(\"(thread, user, timestamp, content, parent_post, signature) values ($thread->id, $user->id, $now, '$content', $parent_id, $sig)\");\n if (!$id) return null;\n\n // notify subscribed users\n //\n $subs = BoincSubscription::enum(\"threadid=$thread->id\");\n foreach ($subs as $sub) {\n if ($user->id == $sub->userid) continue;\n $user2 = BoincUser::lookup_id($sub->userid);\n if ($user2) {\n notify_subscriber($thread, $user2);\n }\n }\n $user->prefs->update(\"posts=posts+1\");\n $thread->update(\"replies=replies+1, timestamp=$now\");\n $forum->update(\"posts=posts+1, timestamp=$now\");\n return $id;\n}", "public function prepareRow($row) {\n\n\t#$wp_row = $row->xml->children($this->arguments['namespaces']['wp']);\n\t#$content_row = $row->xml->children($this->arguments['namespaces']['content']);\n\t$xml_data = $row->xml->children();\n\n\t// skipe if there is not title\n\t$row->title = (string) $xml_data->title;\n if (!$row->title) {\n \treturn FALSE;\n }\n\t// ONLY migrate publish or draft content\n\t$status = $this->xpathValue($row->xml->xpath(\"wp:status\")); \n\tif ($status == 'publish') {\n\t\t$row->status = 1;\n\t} elseif ($status == 'draft') {\n\t\t$row->status = 0;\t\n\t} else {\n\t\treturn FALSE;\n\t}\n\n\t$row->pubdate = $this->xpathValue($row->xml->xpath(\"pubDate\"));\n\t$row->urlalias = $this->xpathValue($row->xml->xpath(\"wp:post_name\"));\n\t$row->native_advertiser = $this->xpathValue($row->xml->xpath(\"category[@domain = 'sponsor' and @nicename]\"));\n\t$row->eyebrow_text = $this->xpathValue($row->xml->xpath(\"wp:postmeta[wp:meta_key = 'digital-issue-text']/wp:meta_value\"));\n\t$row->eyebrow_link = $this->xpathValue($row->xml->xpath(\"wp:postmeta[wp:meta_key = 'digital-issue-url']/wp:meta_value\"));\n\t$row->disable_flipboard = $this->xpathValue($row->xml->xpath(\"wp:postmeta[wp:meta_key = 'disable_flipboard']/wp:meta_value\"));\n\t$row->google_news_standout = $this->xpathValue($row->xml->xpath(\"wp:postmeta[wp:meta_key = 'post_standout_tag']/wp:meta_value\"));\n\n\t// drush_print_r($row);\n }", "public function createPostFromInput() {\n\n $record = [\n 'id_config' => post_config()->getCurrent()->get('id'),\n 'id_user' => user()->getCurrent()->get('id'),\n 'id_parent' => in('id_parent', 0),\n 'subject' => in('subject', ''),\n 'content' => in('content', ''),\n 'content_stripped' => strip_tags(in('content')),\n 'content_type' => in('content_type'),\n 'id_browser' => getBrowserID(),\n 'ip' => getIP(),\n 'domain' => getDomain(),\n 'user_agent' => getUserAgent(),\n 'country' => in('country'),\n 'province' => in('province'),\n 'city' => in('city'),\n 'link' => in('link'),\n ];\n $post = $this->createPost($record);\n\n $this->updateData($post);\n return $post;\n }", "public function viewPostById($post) {\n $db = $this->dbConnect();\n $req = $db->prepare('SELECT id, title, content, DATE_FORMAT(creation_date, \\'%d/%m/%Y à %Hh%imin%ss\\') AS creation_date_fr FROM posts WHERE id = ?');\n $req->execute(array($post->getId()));\n\n $postById = $req->fetch();\n\n return $postById;\n }", "public function _build_row_by_post()\n {\n $row = [\n 'mime_id' => $this->_post_class->get_post_get_int('mime_id'),\n 'mime_time_create' => $this->_post_class->get_post_int('mime_time_create'),\n 'mime_time_update' => $this->_post_class->get_post_int('mime_time_update'),\n 'mime_ext' => $this->_post_class->get_post_text('mime_ext'),\n 'mime_medium' => $this->_post_class->get_post_text('mime_medium'),\n 'mime_type' => $this->_post_class->get_post_text('mime_type'),\n 'mime_name' => $this->_post_class->get_post_text('mime_name'),\n 'mime_perms' => $this->_post_class->get_post_text('mime_perms'),\n 'mime_ffmpeg' => $this->_post_class->get_post_text('mime_ffmpeg'),\n 'mime_kind' => $this->_post_class->get_post_int('mime_kind'),\n 'mime_option' => $this->_post_class->get_post_text('mime_option'),\n ];\n\n return $row;\n }", "public function make_post_forum_topic($forum_name, $topic_identifier, $member, $post_title, $_post, $content_title, $topic_identifier_encapsulation_prefix, $content_url = null, $time = null, $ip = null, $validated = null, $topic_validated = 1, $skip_post_checks = false, $poster_name_if_guest = '', $parent_id = null, $staff_only = false)\n {\n $__post = comcode_to_tempcode($_post);\n $post = $__post->evaluate();\n\n if (is_null($time)) {\n $time = time();\n }\n if (is_null($ip)) {\n $ip = get_ip_address();\n }\n $forum_id = $this->forum_id_from_name($forum_name);\n if (is_null($forum_id)) {\n warn_exit(do_lang_tempcode('MISSING_FORUM', escape_html($forum_name)));\n }\n\n $username = $this->_get_username($member);//needed for the mybb_theads DB table\n\n $test = $this->connection->query_select('forums', array('*'), null, '', 1);\n $fm = array_key_exists('status', $test[0]);\n\n $topic_id = $this->find_topic_id_for_topic_identifier($forum_name, $topic_identifier);\n\n $ip_address = $ip;\n $long_ip_address = $this->_phpbb_ip($ip);\n $local_ip_address = '127.0.0.1'; //$this->_phpbb_ip('127.0.0.1');\n\n $is_new = is_null($topic_id);\n if ($is_new) {\n $topic_id = $this->connection->query_insert('threads', array('fid' => $forum_id, 'subject' => $content_title . ', ' . $topic_identifier_encapsulation_prefix . ': #' . $topic_identifier, 'username' => $username, 'uid' => $member, 'lastposter' => $username, 'lastposteruid' => $member, 'visible' => 1, 'dateline' => $time, 'lastpost' => $time), true);\n $home_link = hyperlink($content_url, $content_title, false, true);\n $this->connection->query_insert('posts', array('fid' => $forum_id, 'tid' => $topic_id, 'username' => do_lang('SYSTEM', '', '', '', get_site_default_lang()), 'uid' => $member, 'message' => do_lang('SPACER_POST', $home_link->evaluate(), '', '', get_site_default_lang()), 'subject' => '', 'dateline' => $time, 'visible' => 1, 'ipaddress' => $ip_address, 'longipaddress' => $long_ip_address));\n $this->connection->query('UPDATE ' . $this->connection->get_table_prefix() . 'forums SET posts=(posts+1), threads=(threads+1) WHERE fid=' . (string)intval($forum_id), 1);\n }\n\n $GLOBALS['LAST_TOPIC_ID'] = $topic_id;\n $GLOBALS['LAST_TOPIC_IS_NEW'] = $is_new;\n\n if ($post == '') {\n return array($topic_id, false);\n }\n\n $this->connection->query_insert('posts', array('fid' => $forum_id, 'tid' => $topic_id, 'username' => $username, 'uid' => $member, 'message' => $post, 'subject' => $post_title, 'dateline' => $time, 'visible' => 1, 'ipaddress' => $ip_address, 'longipaddress' => $long_ip_address));\n $this->connection->query('UPDATE ' . $this->connection->get_table_prefix() . 'forums SET posts=(posts+1), lastpost=' . strval($time) . ', lastposter=\\'' . db_escape_string($username) . '\\' WHERE fid=' . (string)intval($forum_id), 1);\n $this->connection->query('UPDATE ' . $this->connection->get_table_prefix() . 'threads SET lastpost=' . strval($time) . ', lastposter=\\'' . db_escape_string($username) . '\\', lastposteruid=' . strval($member) . ', replies=(replies+1) WHERE tid=' . (string)intval($topic_id), 1);\n\n return array($topic_id, false);\n }", "private function mapSqlToObject($rs) {\n $langue = new langue();\n $langue->_id = $rs[\"id\"];\n $langue->_key_identifier = $rs[\"key_identifier\"];\n $langue->_english = $rs[\"english\"];\n $langue->_french = $rs[\"french\"];\n $langue->_spanish = $rs[\"spanish\"];\n $langue->_german = $rs[\"german\"];\n $langue->_italien = $rs[\"italien\"];\n return $langue;\n }", "function _build_row_by_post()\n{\n\t$row = array(\n\t\t'user_id' => $this->_post_class->get_post_get_int( 'user_id' ),\n\t\t'user_time_create' => $this->_post_class->get_post_int( 'user_time_create' ),\n\t\t'user_time_update' => $this->_post_class->get_post_int( 'user_time_update' ),\n\t\t'user_uid' => $this->_post_class->get_post_int( 'user_uid' ),\n\t\t'user_cat_id' => $this->_post_class->get_post_int( 'user_cat_id' ),\n\t\t'user_email' => $this->_post_class->get_post_text( 'user_email' ),\n\t\t'user_text1' => $this->_post_class->get_post_text( 'user_text1' ),\n\t\t'user_text2' => $this->_post_class->get_post_text( 'user_text2' ),\n\t\t'user_text3' => $this->_post_class->get_post_text( 'user_text3' ),\n\t\t'user_text4' => $this->_post_class->get_post_text( 'user_text4' ),\n\t\t'user_text5' => $this->_post_class->get_post_text( 'user_text5' ),\n\t);\n\n\tfor ( $i=1; $i <= _C_WEBPHOTO_MAX_CAT_TEXT; $i++ ) \n\t{\n\t\t$name = 'user_text'.$i;\n\t\t$row[ $name ] = $this->_post_class->get_post_text( $name );\n\t}\n\n\treturn $row;\n}", "function get_post_data() {\n\t\tif (empty($this->post)) :\n\t\t\t$this->post = get_post( $this->id );\n\t\tendif;\n\t\t\n\t\treturn $this->post;\n\t}", "public static function toThread($data)\n {\n $thread = new ForumThread(Parse::clean($data->topic));\n $thread->setId(Parse::clean($data->id));\n $thread->setSubjectFK(Parse::clean($data->subject));\n\n return $thread;\n }", "function loadPosts($table) {\r\n $dbh = DBHandlerClass::getInstance();\r\n $colums = array(\"pID\", \"postContent\", \"pDT\", \"users.uName\");\r\n $additionalTerm = \"INNER JOIN users on $table.uID = users.uID\";\r\n /* Join to get username from usertable using user ID */\r\n $posts = $dbh->readFromDB($table, $colums, $additionalTerm, NULL);\r\n\r\n return $posts;\r\n}", "public function savePost($POST) {\r\n\t\t// Verifica daca valorile sunt goale. E important\r\n\r\n\t\t$POST['title'] = $this->cleanPostValue($POST['title']);\r\n\t\t$POST['subtitle'] = $this->cleanPostValue($POST['subtitle']);\r\n\r\n\t\t//tre sa filtrez tagurile din asta, sa accept doar unele pe care le vom folosi pt marcaj sexy\r\n\t\t$POST['content'] = trim($POST['content']);\r\n\r\n\t\t$ret = array();\r\n\t\tif (empty($POST['id'])) {\r\n\t\t\t$sql = 'INSERT INTO `posts` (`post_author`, `post_content`, `post_title`, \r\n\t\t\t\t\t\t`post_subtitle`, `post_date`, `post_status`, `word_count`) \r\n\t\t\t\t\tVALUES (:post_author, :post_content, :post_title, \r\n\t\t\t\t\t\t:post_subtitle, :post_date, :post_status, :word_count)';\r\n\t\t\t$query = $this->db->prepare($sql);\r\n\t\t\t$query->execute(array(\r\n\t\t\t\t'post_author' => $GLOBALS['user']['id'],\r\n\t\t\t\t'post_content' => $POST['content'],\r\n\t\t\t\t'post_title' => $POST['title'],\r\n\t\t\t\t'post_subtitle' => $POST['subtitle'],\r\n\t\t\t\t'post_date' => date('Y-m-d H:i:s'),\r\n\t\t\t\t'post_status' => 'draft',\r\n\t\t\t\t'word_count' => str_word_count($POST['content'])\r\n\t\t\t));\r\n\t\t\t$ret['id'] = $this->db->lastInsertId('posts'); \r\n\t\t} else {\r\n\t\t\t$sql = 'UPDATE `posts` \r\n\t\t\t\t\tSET `post_content` = :post_content, \r\n\t\t\t\t\t `post_title` = :post_title,\r\n\t\t\t\t\t `post_subtitle` = :post_subtitle,\r\n\t\t\t\t\t `post_status` = :post_status,\r\n\t\t\t\t\t `word_count` = :word_count\r\n\t\t\t\t\tWHERE `ID` = :ID AND `post_author` = :post_author LIMIT 1';\r\n\t\t\t$query = $this->db->prepare($sql);\r\n\t\t\t$query->execute(array(\r\n\t\t\t\t'ID' => $POST['id'],\r\n\t\t\t\t'post_author' => $GLOBALS['user']['id'],\r\n\t\t\t\t'post_content' => $POST['content'],\r\n\t\t\t\t'post_title' => $POST['title'],\r\n\t\t\t\t'post_subtitle' => $POST['subtitle'],\r\n\t\t\t\t'post_status' => 'draft',\r\n\t\t\t\t'word_count' => str_word_count($POST['content'])\r\n\t\t\t));\r\n\t\t\t$ret['id'] = $POST['id'];\r\n\t\t}\r\n\t\t\r\n\t\t$ret['date_saved'] = date('H:i:s');\r\n\t\t\r\n\t\treturn $ret;\r\n\t}", "public function postQuestion(){\n $sql = \"INSERT INTO `tbl_forum_question`(`fq_id`, `u_name`, `question`, `date`) VALUES (NULL, '$this->fq_u_name', '$this->fq_question', '$this->fq_date')\";\n return $this->connect->qry($sql);\n }", "function populate_single_post($db, $feed_id, $post)\n\t{\n\t\t$post\t\t\t= data_manipulator::create_post_from_rss($post);\n\t\tif(!$post)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t$post['feed_id']\t= $feed_id;\n\n\t\t$post_select_stmt\t= db_utilities::create_select_single($db, 'posts', 'title_url_hash', 'post_url');\n\t\t$post_select_stmt->execute(array($post['post_url']));\n\t\t$post_hash_array\t= $post_select_stmt->fetch();\n\n\t\tif(!empty($post_hash_array))\n\t\t{\n\t\t\t$stored_post_hash\t= $post_hash_array['title_url_hash'];\n\t\t\tif($stored_post_hash !== $post['title_url_hash'])\n\t\t\t{\n\t\t\t\t$truncated_post\t\t= array(\n\t\t\t\t\t\t\t\t'post_title'\t\t=> $post['post_title'],\n\t\t\t\t\t\t\t\t'post_desc'\t\t=> $post['post_desc'],\n\t\t\t\t\t\t\t\t'post_date'\t\t=> $post['post_date'],\n\t\t\t\t\t\t\t\t'title_url_hash'\t=> $post['title_url_hash'],\n\t\t\t\t\t\t\t\t'feed_id'\t\t=> $post['feed_id']\n\t\t\t\t\t\t\t );\n\n\t\t\t\t$post_update_stmt\t\t= db_utilities::create_update($db, 'posts', $truncated_post, 'post_url');\n\t\t\t\t$truncated_post['post_url']\t= $post['post_url'];\n\n\t\t\t\t$post_update_stmt->execute(array_values($truncated_post));\n\t\t\t\techo 'Modified post, updated: ', $post['post_url'], \"\\n\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 'Duplicate post, ignored: ', $post['post_url'], \"\\n\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$post_insert_stmt\t= db_utilities::create_insert_ignore($db, 'posts', $post);\n\t\t\t$post_insert_stmt->execute(array_values($post));\n\t\t\techo 'New post, added: ', $post['post_url'], \"\\n\";\n\t\t}\n\t}", "function getPost($pid)\n {\n $post= $this->db->getPost($pid);\n if ($post)\n {\n //show a quick reference url, poster and posted datetime\n $post['posttitle'] = \"Posted by {$post['poster']} on {$post['postdate']}\";\n \n $post['downloadurl'] = $this->conf['this_script'] . \"?dl=$pid\";\n $post['deleteurl'] = $this->conf['this_script'] . \"?erase=$pid\";\n $post['pid'] = $pid;\n }\n else\n {\n $post['code'] = '<b>Unknown post id, it may have been deleted</b><br />';\n $this->errors[] = 'Unknown post id, it may have expired or been deleted';\n } \n \n return $post;\n }", "protected function fetch($fpostId) {\n $fpost = Database::get()->querySingle(\"SELECT fp.*, f.course_id, ft.forum_id FROM forum_post fp \n JOIN forum_topic ft ON fp.topic_id = ft.id \n JOIN forum f ON ft.forum_id = f.id \n JOIN forum_category fc ON fc.id = f.cat_id \n WHERE fc.cat_order >= 0 AND fp.id = ?d\", $fpostId);\n if (!$fpost) {\n return null;\n }\n\n return $fpost;\n }", "public function forum_recent_posts(){\n self::$db = Database::get();\n\t\t$data = self::$db->select(\"\n SELECT sub.*\n FROM\n (SELECT\n fp.forum_post_id as forum_post_id, fp.forum_id as forum_id,\n fp.forum_user_id as forum_user_id, fp.forum_title as forum_title,\n fp.forum_content as forum_content, fp.forum_edit_date as forum_edit_date,\n fp.forum_timestamp as forum_timestamp, fpr.id as id,\n fpr.fpr_post_id as fpr_post_id, fpr.fpr_id as fpr_id,\n fpr.fpr_user_id as fpr_user_id, fpr.fpr_title as fpr_title,\n fpr.fpr_content as fpr_content, fpr.fpr_edit_date as fpr_edit_date,\n fpr.fpr_timestamp as fpr_timestamp,\n GREATEST(fp.forum_timestamp, COALESCE(fpr.fpr_timestamp, '00-00-00 00:00:00')) AS tstamp\n FROM \".PREFIX.\"forum_posts fp\n LEFT JOIN \".PREFIX.\"forum_posts_replys fpr\n ON fp.forum_post_id = fpr.fpr_post_id\n WHERE fp.allow = 'TRUE'\n ORDER BY fpr.fpr_timestamp DESC\n ) sub\n GROUP BY forum_post_id\n ORDER BY tstamp DESC\n LIMIT 10\n \");\n return $data;\n }", "public static function createFromPosts($postIDs, $boardID) {\n\t\t// get post\n\t\t$sql = \"SELECT \t\tpost.*, thread.languageID\n\t\t\tFROM \t\twbb\".WBB_N.\"_post post\n\t\t\tLEFT JOIN\twbb\".WBB_N.\"_thread thread\n\t\t\tON\t\t(thread.threadID = post.threadID)\n\t\t\tWHERE \t\tpost.postID IN (\".$postIDs.\")\n\t\t\tORDER BY \tpost.time ASC\";\n\t\t$row = WCF::getDB()->getFirstRow($sql);\n\t\t$post = new Post(null, $row);\n\t\t\n\t\t$sql = \"INSERT INTO \twbb\".WBB_N.\"_thread\n\t\t\t\t\t(boardID, topic, firstPostID, time, userID, username, languageID)\n\t\t\tVALUES\t\t(\".$boardID.\",\n\t\t\t\t\t'\".escapeString($post->subject ? $post->subject : substr($post->message, 0, 255)).\"',\n\t\t\t\t\t\".$post->postID.\",\n\t\t\t\t\t\".$post->time.\",\n\t\t\t\t\t\".$post->userID.\",\n\t\t\t\t\t'\".escapeString($post->username).\"',\n\t\t\t\t\t\".intval($row['languageID']).\")\";\n\t\tWCF::getDB()->sendQuery($sql);\n\t\t$threadID = WCF::getDB()->getInsertID();\n\t\t\n\t\t// update user posts & activity points\n\t\tself::updateUserStats($threadID, 'copy', $boardID);\n\t\t\n\t\t// update first post preview\n\t\tPostEditor::updateFirstPostPreview($threadID, $post->postID, $post->message, array('enableSmilies' => $post->enableSmilies, 'enableHtml' => $post->enableHtml, 'enableBBCodes' => $post->enableBBCodes));\n\t\t\n\t\treturn new ThreadEditor($threadID);\t\n\t}", "private static function formatPostObjUser( $singlePostObj ){\n //$wpSingleUser = WPAPIUserUtil::getWPSingleUserById( $singlePostObj->author ) ;\n \n $wpAPIUserCache = new WPAPIUserCache() ;\n $user = $wpAPIUserCache->getUser( $singlePostObj->author ) ;\n \n if( !$user || !$user->accountid ){\n $singlePostObj->welink_accountid = '' ; // not find accountid , set accountid to emtpy\n }else{\n $singlePostObj->welink_accountid = $user->accountid ;\n }\n \n if( !$user || !$user->user_nicename ){\n $singlePostObj->welink_nameCn = '' ;\n }else{\n $singlePostObj->welink_nameCn = $user->user_nicename ;\n }\n \n return $singlePostObj ;\n \n }", "private function convertContent(){\n $newContent = array();\n foreach ($this->content as $key => $value) {\n if (is_scalar($value)) {\n $newContent[$key] = $this->format($value);\n }\n }\n return $newContent;\n }", "public function post_to_forum($forum, $author) {\n global $DB;\n // Create a discussion in the forum, and then add a post to that discussion.\n $record = new stdClass();\n $record->course = $forum->course;\n $record->userid = $author->id;\n $record->moodleforum = $forum->id;\n $discussion = $this->create_discussion($record, $forum);\n // Retrieve the post which was created by create_discussion.\n $post = $DB->get_record('moodleforum_posts', array('discussion' => $discussion->id));\n\n return array($discussion, $post);\n }", "public function postAction()\n {\n // $this->view->blog = $Blog->fetchAll();\n \n }", "public function run()\n {\n DB::table('posts')->insert([ \n 'Title_ar' => \"اسئلة تدور في ذهنك عند استضافة موقعك\",\n 'Title_en' => \"\",\n 'Auther_ar' => \"الدعم الفني لشركة بال قول \",\n 'Auther_en' => \"\",\n 'Body_ar' => '<p style=\"text-align:right\"><span dir=\"rtl\" lang=\"ar\">جميعنا يتسأل عن بعد الاسئلة التي تدور في ذهن الشخص عند استضافة موقع له وهي الاساسيات في استضافة مواقع الانترنت فلنتعرف عليها معأ</span></p>\n\n <p>&nbsp;</p>\n \n <p><span dir=\"rtl\" lang=\"ar\">ما هي الاستضافة؟</span></p>\n \n <p><span dir=\"rtl\" lang=\"ar\">الاستضافة هي المساحة التي تستأجرها من هارديسك السيرفر (كمبيوتر ذو امكانيات ومواصفات خاصة متصل بالانترنت 24 ساعة) لوضع عليها صفحات موقعك والملفات الخاصة بموقعك مثل الصور و والفيديو وغيرها, وذلك لكي يكون موقعك متصل بالانترنت دائما وعندما يرغب اي زائر في اي مكان بالعالم في زيارة موقعك يجده موجود ويستطيع تصفحه بكل سهولة دون اي تدخل منك, وغالبا تكون هذه المساحة بالميجا بايت او بالجيجا بايت.</span></p>\n \n <p>&nbsp;</p>\n \n <p><span dir=\"rtl\" lang=\"ar\">ما هو الترفك او الباندويث؟</span></p>\n \n <p><span dir=\"rtl\" lang=\"ar\">الترافيك او الباندويدث هو كمية نقل البيانات الشهرية من والى الموقع, التي يتم استهلاكها من تحميل او رفع الصور والفيديو الى موقعك او دخول الزوار الى موقعك وتحميل او تصفح هذه الصور والفيديو. مثال: اذا لديك صفحة على الانترنت وقمت برفع 10 صور في هذه الصفحة وكل صورة حجمها 1 ميجا بايت اذن انت استهلكت من الترافيك الشهري الخاص بك 10 ميجا بايت, واذا دخل زائر على هذه الصفحة ليتصفحها فانه يستهلك ايضا 10 ميجا بايت من رصيد الترافيك الشهري الخاص بموقعك وهكذا.</span></p>\n \n <p>&nbsp;</p>\n \n <p><span dir=\"rtl\" lang=\"ar\">ما المقصود بجميع الخواص غير محدودة؟</span></p>\n \n <p><span dir=\"rtl\" lang=\"ar\">أي أنك تستطيع انشاء عدد غير محدود من قواعد البيانات وحسابات البريد وحسابات اف تي بي والنطاقات الفرعية</span></p>\n \n <p><span dir=\"rtl\" lang=\"ar\">ما المقصود بعدد غير محدود من قواعد البيانات؟</span></p>\n \n <p><span dir=\"rtl\" lang=\"ar\">احيانا بعض الاسكربتات او البرامج التي تعمل على الموقع تحتاج الى انشاء قاعدة بيانات لها لكي تعمل, ونحن في استضافة ندى هوست نوفر لكم عدد غير محدود من قواعد البيانات التي يمكن انشائها مع اي خطة استضافة, اى انه يمكنك تركيب عدد لا نهائي من الاسكربات والبرامج على موقعك.</span></p>\n \n <p>&nbsp;</p>\n \n <p><span dir=\"rtl\" lang=\"ar\">ما المقصود بعدد غير محدود من حسابات البريد الالكتروني؟</span></p>\n \n <p><span dir=\"rtl\" lang=\"ar\">اي انك تستطيع عمل عدد لا نهائي من حسابات البريد الرسمية التي تكون مرتبطة باسم موقعك. مثل [email protected], [email protected]</span></p>\n \n <p>&nbsp;</p>\n \n <p><span dir=\"rtl\" lang=\"ar\">ما هي لوحة التحكم cpanel ؟</span></p>\n \n <p><span dir=\"rtl\" lang=\"ar\">هي لوحة تحكم تحتوي علي كل المميزات التي تساعدك علي ادارة الاستضافة و من مميزاتها دعم اللغة العربية وسهولة التعامل معها لذلك يفضلها الكثير من اصحاب و مديري المواقع بالاضافة الي الخصائص الاخري مثل رفع ملفات موقعك ومعرفة المساحة و الترافيك المستخدمة وكذلك اضافة وحذف دومينات فرعية ودومينات اضافية ودومينات التي توجهها وقواعد البيانات والكثير من المميزات.</span></p>\n \n <p><span dir=\"rtl\" lang=\"ar\">هذه جميعها مطلوبة لكي تتمكن من استضافة موقع علي الانترنت</span></p>\n \n <p>&nbsp;</p>\n \n <p><span dir=\"rtl\" lang=\"ar\">شركة بال قول وفرت لك جميع الشروحات المستلزمة لاستضافة موقعك الالكتروني لا تتردد الان باضافة تعليقك لكي نجيبك علي كل سؤال خاص بك .</span></p>',\n 'Body_en' =>\"\",\n 'image' => \"blog2.jpg\",\n 'slug' => \"asel-tdor-fy-thhnk-aand-astdaf-mokaak\",\n 'created_at' =>'2019-11-05 19:26:52',\n ]);\n DB::table('posts')->insert([ \n 'Title_ar' => \"الفرق بين القوالب الإحترافية والمجانية\",\n 'Title_en' => \"\",\n 'Auther_ar' => \"الدعم الفني لشركة بال قول \",\n 'Auther_en' => \"support palgooal co\",\n 'Body_ar' => '<p>الكثير من مستعملي نظم إدارة المحتوى&nbsp;يسألون هذا السؤال, فكما يعلم الجميع فأغلب هذه الأنظمة توفر إمكانية تركييب القوالب التي من شأنها تغيير شكل الموقع حسب مختلف الأدواق والمتطلبات,لاكن هذه القوالب تنقسم لنوعين : احترافية ومجانية, فما الفرق بينهما.</p>\n\n <h3>تعريف القوالب الإحترافية &ldquo;بريميوم&rdquo;</h3>\n \n <p>هذا التعريف هو طبعا حسب تجربتي الشخصية,يمكنني أن أقول أن القوالب الإحترافية هي التي يتم تحميلها واستعمالها بمقابل مادي يحدده المصمم أو المبرمج. كما أن هذه القوالب تتميز بكونها تحتوي على خيارات ومميزات أكثر من المجانية.</p>\n \n <h3>مميزاتها</h3>\n \n <p>تتميز هذه القوالب بالتصميم الجداب والأنيق الذي يحترم معايير التصميم الحديثة.</p>\n \n <p>توفر إمكانية عالية للتحكم في القالب وتخصيصه ليلائم متطلباتك عن طريق لوحة تحكم خاصة.</p>\n \n <p>توفير الدعم الفني, فالبائع أو المتجر الذي اشتريت منه هذه القوالب ,يوفر لك الدعم الفني في حالة واجهتك مشاكل أتناء استخدام القالب.</p>\n \n <p>جودة البرمجة, فكما أن للتصميم معايير جودة فكذالك الأمر بالنسبة للبرمجة,فالبرمجة الإحترافية تجعل القالب يعمل بسلاسة واستقرار وبدون مشاكل.</p>\n \n <p>توفير تحديثات دورية للقالب لإصلاح المشاكل التي يمكن أن تظهر,كذالك إضافة مميزات أخرى.</p>\n \n <h3>القوالب المجانية</h3>\n \n <p>القوالب المجانية هي التي يمكنك استعمالها بشكل مجاني بدون مقابل.</p>\n \n <p>ميزتها أنها مجانية.</p>\n \n <h3>عيوبها</h3>\n \n <p>غياب الدعم الفني, وهذا أمر طبيعي فالمطور لايمكن أن يقدم الدعم الفني مجانا.</p>\n \n <p>إمكانية جد محدودة للتخصيص.</p>\n \n <p>التصميم والبرمجة غالبا ماتكون دات جودة ضعيفة.</p>\n \n <p>التحديثات غالبا لاتتوفر فالمطور يكتفي بإصدار واحد فقط.</p>\n \n <p>في الأخير اختيار القالب يبقى لك , ويتحكم في هذا متطلباتك الخاصة.</p>\n \n <ul>\n <li>&nbsp;</li>\n </ul>',\n 'Body_en' =>\"\",\n 'image' => \"blog2.jpg\",\n 'slug' => \"alfrk-byn-alkoalb-alehtrafy-oalmjany\",\n 'created_at' =>'2019-11-05 19:26:52',\n ]);\n DB::table('posts')->insert([ \n 'Title_ar' => \"ما هو ترافيك استضافة المواقع\",\n 'Title_en' => \"\",\n 'Auther_ar' => \"الدعم الفني لشركة بال قول \",\n 'Auther_en' => \"support palgooal co\",\n 'Body_ar' => '<p><strong>ماهو الباندويث أو الترافيك أو تناقل البيانات؟</strong><br />\n الثلاث مسميات تعنى معنى واحد وسوف نستخدم كلمة الترافيك في استضافة المواقع فهى تعطى معنى أوضح وتعنى كمية الداتا المتبادله بين موقعك وبين أعضاؤه وزواره</p>\n \n <p><strong>&nbsp;كيف تستهلك كمية نقل البيانات الخاصه بموقعى ؟</strong><br />\n نعطى مثال:<br />\n زائر أو عضو دخل موضوع على منتداك هذا الموضوع به صور للشرح قيمتها 1 ميجا وبها صور فى التوقيعات قيمتها 1 ميجا قام هذا العضو بتحميل برنامج موضوع فى المشاركه ( ومحمل على موقعك ) قيمته 2 ميجا ثم قام هذا العضو برفع ملف على موقعك لوضعرابطه بالمشاركه قيمة الملف الذى وضعه 1 ميجا أضافه الى أن عدد حروف الخاصه بالردود فى هذه المشاركه 500 كيلو وصور الاستايل التى ظهرت عند فتح الموضوع تساوى 1 ميجا ( الان قم بجمع كل القيم تجدها تجدها 6.5 ميجا )<br />\n فهذا العضو وحده ومن خلال تصفحه لهذه المشاركه أستهلك من كمية نقل البيانات لموقعك 6.5 ميجا</p>\n \n <p><strong>هل هذا فقط هو مايستهلك كمية تناقل البيانات الخاصه بموقعى؟</strong><br />\n يبقى شىء أخر وهو شيطان أستهلاك كمية تناقل البيانات الخاصه بموقعك وهى اذا قمت بالافراط فى أرسال الرسائل من موقعك ولذلك يجب عليك أن تفعل مايفعله خبراء المواقع عندما يريدون أرسال رسائل ولا يتأثر موقهم هم يستخدمون أحد برامج أرسال الرسائل من أجهزتهم<br />\n <strong>ماهى الطرق لعدم أستهلاك كمية تناقل البيانات لموقعى ؟</strong><br />\n <strong>1 &ndash;</strong>&nbsp;يجب أن تتعمد أختيار تصميم لموقعك بدون أن تبالغ فى قيمة وعدد الصور عليه وأن تقوم بضغط صور تصميم موقعك قبل رفعها لموقعك مستخدمآ أحد برامج ضغط الصور وهذ ه الخطوه تنطبق على أستايل المنتدى وبالمناسبه فأن هاك تصغير الصور ليس له أى تأثير فى خفض أستهلاك كمية تناقل البيانات فقط هو للمحافظه على الشكل العام للمشاركه وفى نفس الموضوع موضوع الصور يجب على الأعضاء والمشرفين بتحميل الصور الخاصه بالشرح والصور الخاصه بتوقيعهم على موقع رفع وتحميل الصور ثم يضعوا الروابط فقط بموقعك ففى هذه الحاله الاستهلاك سيكون على المواقع التى تم تحميل صور الشرح والتوقيع عليها</p>\n \n <p><strong>2 &ndash;</strong>&nbsp;نفس الشى ينطبق على الملفات التى تضعها كابرامج وغير ذلك فلا تقوم بتحميلها على موقعك بل قم بتحميلها على أى موقع تحميل وضع الروابط فقط فى موقعك وبالتالى الاستهلاك سيكون على الموقع الذى تم رفع الملفات عليه وليس على موقعك</p>\n \n <p><strong>3 &ndash;</strong>&nbsp;لا تستخدم موقعك فى أرسال الرسائل بشكل مفرط وأستخدم أحد البرامج التى تقوم بنفس الغرض ولكن من على جهازك<br />\n <strong>فماذا تفسر أعطاؤهم كمية تناقل بيانات مفتوح للموقع المستضافه لديهم وغير محدده ؟</strong></p>\n \n <p>أولآ هو نوع من أنواع الدعايه ليس إلا وفى نفس الوقت أضرار للمواقع المستضافه لديهم وعدم القدره على تحمل مسؤلية المحافظه على المواقع المستضافه لديهم وعلى سبيل المثال<br />\n اذا أعطى كمية تناقل بيانات مفتوحه وهو بالأساس كمية تناقل البيانات بشكل طبيعى محدده على السيرفر فماذا يحدث اذا كان لديه عدد ما من الموقع مستضافه عنده وليكن 100 موقع أو أقل أو أكثر لا فرق ثم ثم أصحاب عشر مواقع أو أقل أو أكثر أتستهلكوا كمية تناقل البيانات الخاصه بالسيرفر ذاته ؟ الأجابه سيتوقف كل المواقع الباقيه بلا أ ذنب ولذلك ولأسباب مبالغة أصحاب شركات الآستضافه فى خداماتهم التى يقدمونها وهى بالأساس غير واقعيه تجد أن هذه الشركات دائمآ تسقط وتغلق ويضيع ماعليها من مواقع</p>\n \n <p><strong>أنهت كمية تناقل البيانات الخاصه بى ماذا أفعل ؟</strong><br />\n أن كمية تناقل البيانات الخاصه بموقعك تتجدد مع بداية كل شهر فإذا أنتهت قبل نهاية الشهر سيغلق موقعك بشكل أتوماتيكيآ ثم يعاود العمل ويفتح بشكل أتوماتيكيآ أيضآ مع بداية الشهر ويجب عليك تنظيم وضبط موقعك حتى لا يغلق مره أخرى بالشهر الذى يليه</p>\n \n <ul>\n <li>&nbsp;</li>\n </ul>',\n 'Body_en' =>\"\",\n 'image' => \"blog2.jpg\",\n 'slug' => \"ma-ho-trafyk-astdaf-almoakaa\",\n 'created_at' =>'2019-11-05 19:26:52',\n ]);\n }", "public function posts(){\n // initializing haturi for preventing Injections\n $haturi = new Tools();\n //checking Injections\n if (!$haturi->test_input($this->class_id)) {\n $this->conn = null;\n $this->error_message = \"HTML Injection Detected\"; // Injection Detected ... Character: 23\n }else{\n // SQL\n $sql = 'SELECT ps.post_id, ps.created_by as creator_id, p.name as creator_name,ps.created_time, ps.post_text, ps.material as post_material FROM ' .$this->post_table. ' as ps, '.$this->person_table.' as p WHERE ps.created_by=p.person_id and ps.class_id= :class_id and ps.priority=' .$this->post_priority.' ORDER BY ps.created_time DESC';\n\n // Prepare Statement\n if($stmt = $this->conn->prepare($sql)){\n if($stmt->execute(array(':class_id' => $this->class_id)))\n {\n $this->message = true;\n return $stmt;\n }else{\n $this->conn = null;\n $this->error_message = \"Problem on Executing Query\";\n $this->message = false;\n }\n\n }else{\n $this->conn = null;\n $this->error_message = \"Problem on Preparing Query\";\n $this->message = false;\n }\n }\n }", "function getPostDetailsFromDatabase() {\n $postDetails = array('title' => 'Animal: Fox', \n 'date' => '10/05/2019',\n 'author' => 'Victoria Bowie',\n 'content' => '<img src=\"images/fox.jpg\" width=\"30%\" title=\"Happy Fox\" alt=\"Fox in Field\"/\n class=\"pic1\"><p> Diet: Foxes are omnivores. This means that they eat meat and vegetation.</p>\n <p> Offspring: Fox babies are called pups.</p>'\n );\n return $postDetails;\n }", "public function last_post() {\n\t\treturn Model_Forum_Post::factory($this->last_post_id);\n\t}", "function format_to_post($content)\n {\n }", "function aff_post($id_post) {\n\n\t\t$req = $GLOBALS['bdd']->prepare('SELECT a.*, d.*, da.dazibao as sujet_dazibao, da.decapode as sujet_decapode, da.dessication as sujet_dessication, da.diatribe as sujet_diatribe\n\t\t\t\t\t\t\t\t\tFROM adenoide a\n\t\t\t\t\t\t\t\t\tINNER JOIN dactyle d\n\t\t\t\t\t\t\t\t\tON a.alcade = d.dazibao\n\t\t\t\t\t\t\t\t\tINNER JOIN dactyle da\n\t\t\t\t\t\t\t\t\tON a.ammonite = da.dazibao\n\t\t\t\t\t\t\t\t\tWHERE a.alezan = :id');\n\t\t$req->execute(array('id' =>$id_post));\n\t\t$GLOBALS['donnees'] = $req->fetch();\n\n\t}", "function outputPostRow() {\r\n\t$posts = new PostCollection();\r\n\t$posts->loadCollection();\r\n\r\n\t$result = $posts->getArray();\r\n\r\n\tfor($i=0;$i<$posts->getCount();$i++){\t\t\r\n\t\t$firstname = utf8_encode($result[$i]->getFirstName());\r\n\t\t$lastname = utf8_encode($result[$i]->getLastName());\r\n\t\t$date = $result[$i]->getPostTime();\r\n\t\t$createDate = new DateTime($date);\r\n\t\t$strip = $createDate->format('Y/m/d');\r\n\t\t$message = utf8_encode($result[$i]->getMessage());\r\n\t\t\t\r\n\t\techo '<div class=\"row\">';\r\n\t\techo '<div class=\"col-md-2\">';\r\n\t\techo '<a href=\"#\" class=\"\"><img src=\"travel-images/square-medium/' . $result[$i]->getPath() . '\" alt=\"' . $result[$i]->getTitle() . '\" class=\"img-thumbnail\"/></a>';\r\n\t\techo \"</div>\";\r\n\t\techo '<div class=\"col-md-10\">';\r\n\t\techo \"<h2>\" . $result[$i]->getTitle() . \"</h2>\";\r\n\t\techo '<div class=\"details\">';\r\n\t\techo \"Posted by \";\r\n\t\techo '<a href=\"single-user.php?id=' . $result[$i]->getUID(). '\">' . $firstname . \" \" . $lastname . '</a>';\r\n\t\techo '<span class=\"pull-right\">' . $strip . '</span>';\r\n\t\techo \"</div>\";\r\n\t\techo '<p class=\"excerpt\">';\r\n\t\techo truncate($message, 200);\r\n\t\techo \"</p>\";\r\n\t\techo \"<p>\";\r\n\t\techo '<a href=\"single-post.php?Pid=' . $result[$i]->getPostID(). '\" class=\"btn btn-primary btn-sm\">Read More</a>';\r\n\t\techo \"</p>\";\r\n\t\techo \"</div>\";\r\n\t\techo \"</div>\";\r\n\t\techo \"<hr/>\";\r\n\t}\r\n}", "public function run()\n {\n \n\n \\DB::table('posts')->delete();\n \n \\DB::table('posts')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'created_at' => '2021-06-26 06:05:41',\n 'updated_at' => '2021-06-26 06:05:41',\n 'post_header' => 'Header1',\n 'post_thumbnail' => 'users/1/twit.png',\n 'post_content' => 'ContentContentContent',\n 'user_id' => 1,\n 'topic_id' => 6,\n ),\n 1 => \n array (\n 'id' => 2,\n 'created_at' => '2021-06-26 06:16:28',\n 'updated_at' => '2021-06-26 06:16:28',\n 'post_header' => 'Header1',\n 'post_thumbnail' => 'users/1/twit.png',\n 'post_content' => 'ContentContentContent',\n 'user_id' => 1,\n 'topic_id' => 6,\n ),\n 2 => \n array (\n 'id' => 3,\n 'created_at' => '2021-06-26 15:22:14',\n 'updated_at' => '2021-06-26 15:22:14',\n 'post_header' => 'User2s post',\n 'post_thumbnail' => 'users/2/face.png',\n 'post_content' => 'User2Postcontent',\n 'user_id' => 2,\n 'topic_id' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'created_at' => '2021-06-26 15:23:00',\n 'updated_at' => '2021-06-26 15:23:00',\n 'post_header' => 'Users2 2nd post',\n 'post_thumbnail' => 'users/2/yo.png',\n 'post_content' => 'PostContent321213124',\n 'user_id' => 2,\n 'topic_id' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'created_at' => '2021-06-26 15:25:25',\n 'updated_at' => '2021-06-26 15:25:25',\n 'post_header' => 'Header1',\n 'post_thumbnail' => 'users/2/yo.png',\n 'post_content' => 'safsadfasdfsaf',\n 'user_id' => 2,\n 'topic_id' => 4,\n ),\n 5 => \n array (\n 'id' => 6,\n 'created_at' => '2021-06-26 15:23:00',\n 'updated_at' => '2021-06-26 15:23:00',\n 'post_header' => 'Users2 2nd post',\n 'post_thumbnail' => 'users/2/yo.png',\n 'post_content' => 'PostContent321213124',\n 'user_id' => 2,\n 'topic_id' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'created_at' => '2021-06-26 15:22:14',\n 'updated_at' => '2021-06-26 15:22:14',\n 'post_header' => 'User2s post',\n 'post_thumbnail' => 'users/2/face.png',\n 'post_content' => 'User2Postcontent',\n 'user_id' => 2,\n 'topic_id' => 1,\n ),\n ));\n \n \n }", "private function getPost($titleURL){\n $post = DB::connection('mysql')->select('\n SELECT e.title, e.content, eu.titleURL, e.teaser, Date_Format(e.publishAt, \"%b %e, %Y\") AS publishDate,\n c.name AS categoryName, cu.name AS categoryURL,\n count(distinct(ed.id)) AS discussionCount,\n fsp.squareURL AS imageURL, fsp.title AS imageTitle\n FROM entryurls eu\n INNER JOIN entries e ON eu.entryId = e.id AND e.deletedAt IS NULL\n LEFT JOIN entrycategories ec ON ec.entryId = e.id AND ec.deletedAt IS NULL\n LEFT JOIN categories c ON c.id = ec.categoryId\n LEFT JOIN categoryurls cu ON cu.categoryId = c.id AND cu.isActive = 1 AND cu.deletedAt iS NULL\n LEFT JOIN entrydiscussions ed ON ed.entryId = e.id AND ed.deletedAt IS NULL\n LEFT JOIN entryflickrsets efs ON efs.entryId = e.id AND efs.deletedAt IS NULL\n LEFT JOIN flickrsets fs ON fs.id = efs.flickrSetId AND fs.deletedAt IS NULL\n LEFT JOIN flickrcollections fc ON fc.id = fs.flickrCollectionid AND fc.deletedAt IS NULL\n LEFT JOIN flickrsetphotos fsp ON fsp.flickrSetId = fs.id AND fsp.deletedAt IS NULL\n WHERE eu.titleURL = ? AND eu.isActive = 1 AND eu.deletedAt IS NULL\n GROUP BY e.id\n LIMIT 1', [$titleURL]);\n \n return $post;\n }", "function acf_decode_post_id($post_id = 0)\n{\n}", "public function send()\r\n\t{\r\n\t\tif (!$this->isCipher)\r\n\t\t{\r\n\t\t\tthrow new Exception(\"Hey, did you encrypt the post?\");\r\n\t\t}\r\n\t\t$db = Database::Get();\r\n\t\tif (!$this->id)\r\n\t\t{\r\n\t\t\t$stmt = $db->prepare(\"INSERT INTO `pl_posts` (`title`,`content`,`time`,`weather`,`location`,`ip`,`key`,`salt`,`hint`,`algorithm`,`mode`,`iv`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)\");\r\n\t\t\t$stmt->execute(array($this->title,$this->content,$this->time,$this->weather,$this->location,$this->ip,$this->key,$this->salt,$this->hint,$this->algorithm,$this->mode,$this->iv));\r\n\t\t\t\r\n\t\t\treturn $db->lastInsertId();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Edit post\r\n\t\t\t$stmt = $db->prepare(\"UPDATE `pl_posts` SET `title` = ?, `content` = ?, `time` = ?, `weather` = ?, `location` = ?, `key` = ?,`salt` = ?, `hint` = ?, `algorithm` = ?, `mode` = ?, `iv` = ? WHERE `id` = {$this->id}\");\r\n\t\t\t$stmt->execute(array($this->title,$this->content,$this->time,$this->weather,$this->location,$this->key,$this->salt,$this->hint,$this->algorithm,$this->mode,$this->iv));\r\n\t\t\t\r\n\t\t\treturn $this->id;\r\n\t\t}\r\n\t}", "protected function convertRow(&$row) {\n\t\tforeach ($this->columns as $name => $type) {\n\t\t\tswitch ($type) {\n\t\t\t\tcase 'int':\n\t\t\t\t\tif (! is_null($row[$name])) {\n\t\t\t\t\t\t$row[$name] = (int) $row[$name];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'real':\n\t\t\t\t\tif (! is_null($row[$name])) {\n\t\t\t\t\t\t$row[$name] = (float) $row[$name];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// Currently unsure how to handle \"date\" formats\n\t\t\t\tcase 'datetime':\n\t\t\t\tcase 'timestamp':\n\t\t\t\t\tif (! is_null($row[$name])) {\n\t\t\t\t\t\tif ('0000-00-00 00:00:00' === $row[$name]) {\n\t\t\t\t\t\t\t$row[$name] = null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$row[$name] = new DateTime($row[$name]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function createPost()\r\n {\r\n\r\n $servername = \"localhost\";\r\n $username = \"root\";\r\n $password = \"\";\r\n $db = \"forumdb\";\r\n $table = \"post\";\r\n\r\n $forumName = $_GET['name'];\r\n $Body = $_POST['postbody'];\r\n $datetime = new DateTime();\r\n\r\n $user = $_SESSION['username'];\r\n $date = $datetime->format('d-m-Y H:i');\r\n\r\n // Create connection\r\n $conn = new mysqli($servername, $username, $password, $db);\r\n\r\n\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Connection failed: \" . $conn->connect_error);\r\n }\r\n\r\n else if (!(isset($_SESSION['username'])))\r\n {\r\n echo \"Please login first\";\r\n }\r\n else if ($forumName != null)\r\n {\r\n $sql = \"INSERT INTO $table (post_author, post_body, forum_name, timin)VALUES ('$user', '$Body', '$forumName', '$date')\";\r\n\r\n if ($conn->query($sql) === TRUE) {\r\n echo \"<p style='color: orange; position: absolute; left: 43%; top: 90% '>Post created Successfully</p>\";\r\n echo \"<meta http-equiv=\\\"refresh\\\" content=\\\"1;url=http://localhost/secure/scenes/forum_preview_scene.php?name=\".$forumName.\"\\\" />\";\r\n } else {\r\n echo \"Error: \" . $sql . \"<br>\" . $conn->error;\r\n echo \"<p style='color: orangered; position: absolute; left: 34%; top: 90% '>Post was not created successfully, if the problem persists please contact us</p>\";\r\n }\r\n\r\n $conn->close();\r\n //echo \"Connected successfully\";\r\n }\r\n else\r\n {\r\n echo \"<p style='color: orangered; position: absolute; left: 40%; top: 90% '>Please enter something before posting</p>\";\r\n }\r\n }", "function dream_post_forum_link($db, $dreamid) {\n $forum = \"Policy Forum\";\n $topic_match = \"Policy #$dreamid\";\n return forummagic_getlink($db, $forum, $topic_match);\n}", "static function user_roles_to_posts(string $uid): array {\r\n \r\n $role_to_posts = [];\r\n foreach(self::role_to_db_key as $role => $db_key) {\r\n $role_to_posts[$role] = self::user_role_posts($uid, $db_key);\r\n }\r\n \r\n return $role_to_posts;\r\n }", "protected function set_post() {\n $this->post = $this->safe_find_from_id('Post');\n }", "function asForumTopics($data) {\r\n$IPBHTML = \"\";\r\n//--starthtml--//\r\n$IPBHTML .= <<<EOF\r\n<tr class='__topic __tid{$data['tid']} <if test=\"!$data['_icon']['is_read']\">unread</if> expandable <if test=\"$data['approved'] != 1\"> moderated</if>' id='trow_{$data['tid']}' data-tid=\"{$data['tid']}\">\n\t<td class='col_f_icon short altrow'>\n\t\t{parse template=\"generateTopicIcon\" group=\"global_other\" params=\"$data['_icon'], $data['_unreadUrl']\"}\n\t</td>\n\t<td>\n\t\t<if test=\"archivedBadge:|:$this->registry->class_forums->fetchArchiveTopicType( $data ) == 'archived'\">\n\t\t\t<span class='ipsBadge ipsBadge_lightgrey'>{$this->lang->words['topic_is_archived']}</span>\n\t\t</if>\n\t\t<if test=\"hasPrefix:|:!empty($data['tags']['formatted']['prefix'])\">\n\t\t\t{$data['tags']['formatted']['prefix']}\n\t\t</if>\n\t\t<h4><a href='{parse url=\"showtopic={$data['tid']}<if test=\"isNewPostTR:|:$this->request['do']=='new_posts' OR $this->request['do']=='active'\">&amp;view=getnewpost<else /><if test=\"resultIsPostTR:|:$data['pid'] AND $data['pid'] != $data['topic_firstpost']\">&amp;view=findpost&amp;p={$data['pid']}</if></if>&amp;hl={$data['cleanSearchTerm']}\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}' title='{$this->lang->words['view_result']}'>{$data['_shortTitle']}</a></h4>\n\t\t<span class='desc blend_links'>\n\t\t\t<foreach loop=\"topicsForumTrail:$data['_forum_trail'] as $i => $f\">\n\t\t\t<if test=\"notLastFtAsForum:|:$i+1 == count( $data['_forum_trail'] )\"><span class='desc lighter'>{$this->lang->words['search_aft_in']}</span> <a href='{parse url=\"{$f[1]}\" template=\"showforum\" seotitle=\"{$f[2]}\" base=\"public\"}'>{$f[0]}</a></if>\n\t\t\t</foreach>\n\t\t</span>\n\t\t<span class='desc lighter blend_links toggle_notify_off'>\n\t\t\t<br />{$this->lang->words['aft_started_by']} {$data['starter']}, {parse date=\"$data['start_date']\" format=\"DATE\"}\n\t\t\t<if test=\"hasTags:|:count($data['tags']['formatted'])\">\n\t\t\t\t&nbsp;<img src='{$this->settings['img_url']}/icon_tag.png' /> {$data['tags']['formatted']['truncatedWithLinks']}\n\t\t\t</if>\n\t\t</span>\n\t\t<if test=\"multipages:|:isset( $data['pages'] ) AND is_array( $data['pages'] ) AND count( $data['pages'] )\">\n\t\t\t<ul class='mini_pagination toggle_notify_off'>\n\t\t\t<foreach loop=\"pages:$data['pages'] as $page\">\n\t\t\t\t\t<if test=\"haslastpage:|:$page['last']\">\n\t\t\t\t\t\t<li><a href=\"{parse url=\"showtopic={$data['tid']}&amp;st={$page['st']}\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}\" title='{$this->lang->words['topic_goto_page']} {$page['page']}'>{$page['page']} {$this->lang->words['_rarr']}</a></li>\n\t\t\t\t\t<else />\n\t\t\t\t\t\t<li><a href=\"{parse url=\"showtopic={$data['tid']}&amp;st={$page['st']}\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}\" title='{$this->lang->words['topic_goto_page']} {$page['page']}'>{$page['page']}</a></li>\n\t\t\t\t\t</if>\n\t\t\t</foreach>\n\t\t\t</ul>\n\t\t</if>\n\t\t<if test=\"bothSearchUnderTitle:|:IPSSearchRegistry::get('set.searchResultType') == 'both'\">\n\t\t\t<span class='desc lighter blend_links toggle_notify_off'>\n\t\t\t\t<br />{$this->lang->words['n_last_post_by']} {$data['last_poster']},\n\t\t\t\t<a href='{parse url=\"showtopic={$data['tid']}&amp;view=getlastpost\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}' title='{$this->lang->words['goto_last_post']}'>{parse date=\"$data['_last_post']\" format=\"DATE\"}</a>\n\t\t\t</span>\n\t\t</if>\n\t\t<if test=\"isFollowedStuff:|:count($data['_followData'])\">\n\t\t\t{parse template=\"followData\" group=\"search\" params=\"$data['_followData']\"}\n\t\t</if>\n\t</td>\n\t<td class='col_f_preview __topic_preview'>\n\t\t<a href='#' class='expander closed' title='{$this->lang->words['view_topic_preview']}'>&nbsp;</a>\n\t</td>\n\t<td class='col_f_views'>\n\t\t<ul>\n\t\t\t<li>{parse format_number=\"$data['posts']\"} <if test=\"replylang:|:intval($data['posts']) == 1\">{$this->lang->words['reply']}<else />{$this->lang->words['replies']}</if></li>\n\t\t\t<li class='views desc'>{parse format_number=\"$data['views']\"} {$this->lang->words['views']}</li>\n\t\t</ul>\n\t</td>\n\t<td class='col_f_post'>\n\t\t{parse template=\"userSmallPhoto\" group=\"global\" params=\"$data\"}\n\t\t<ul class='last_post ipsType_small'>\n\t\t\t<if test=\"bothSearch:|:IPSSearchRegistry::get('set.searchResultType') == 'both'\">\n\t\t\t\t<li>{parse template=\"userHoverCard\" group=\"global\" params=\"$data\"}</li>\n\t\t\t\t<li>\n\t\t\t\t\t<a href='{parse url=\"showtopic={$data['tid']}&amp;view=getlastpost\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}' title='{$this->lang->words['goto_last_post']}'>{$this->lang->words['n_posted']} {parse date=\"$data['_post_date']\" format=\"DATE\"}</a>\n\t\t\t\t</li>\n\t\t\t<else />\n\t\t\t\t<li>{$data['last_poster']}</li>\n\t\t\t\t<li>\n\t\t\t\t\t<a href='{parse url=\"showtopic={$data['tid']}&amp;view=getlastpost\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}' title='{$this->lang->words['goto_last_post']}'>{parse date=\"$data['_last_post']\" format=\"DATE\"}</a>\n\t\t\t\t</li>\n\t\t\t</if>\n\t\t</ul>\n\t</td>\n\t<if test=\"isFollowedStuff:|:count($data['_followData'])\">\n\t\t<td class='col_f_mod'>\n\t\t\t<input class='input_check checkall toggle_notify_on' type=\"checkbox\" name=\"likes[]\" value=\"{$data['_followData']['like_app']}-{$data['_followData']['like_area']}-{$data['_followData']['like_rel_id']}\" />\n\t\t</td>\n\t<else />\n\t\t<if test=\"isAdmin:|:$this->memberData['g_is_supmod']\">\n\t\t\t<td class='col_f_mod'>\n\t\t\t\t<if test=\"isArchivedCb:|:$this->request['search_app_filters']['forums']['liveOrArchive'] == 'archive'\">\n\t\t\t\t\t&nbsp;\n\t\t\t\t<else />\n\t\t\t\t\t<input type='checkbox' class='input_check topic_mod' id='tmod_{$data['tid']}' />\n\t\t\t\t</if>\n\t\t\t</td>\n\t\t</if>\n\t</if>\n</tr>\n<if test=\"$data['pid']\">\n<script type='text/javascript'>\nipb.global.searchResults[ {$data['tid']} ] = { pid: {parse expression=\"intval($data['pid'])\"}, searchterm:\"{$data['cleanSearchTerm']}\" };\n</script>\n</if>\r\nEOF;\r\n//--endhtml--//\r\nreturn $IPBHTML;\r\n}", "function update_last_post_forum($forum_id)\r\n\t{\r\n\t\tglobal $auth, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\t$forum_id = (int) $forum_id;\r\n\r\n\t\tif (!isset($this->forum_data[$forum_id]))\r\n\t\t{\r\n\t\t\t$this->get_forum_data(array($forum_id));\r\n\t\t}\r\n\r\n\t\t// If it still is not set the forum does not exist, so return.\r\n\t\tif (!isset($this->forum_data[$forum_id]))\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$sql = 'SELECT p.post_id, p.topic_id, p.post_subject, p.post_time, u.user_id, u.username, u.user_colour FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u\r\n\t\t\tWHERE p.forum_id = ' . $forum_id . '\r\n\t\t\t\tAND p.post_deleted = 0\r\n\t\t\t\tAND u.user_id = p.poster_id\r\n\t\t\t\t\tORDER BY p.post_time DESC';\r\n\t\t$result = $db->sql_query_limit($sql, 1);\r\n\t\t$last_post_data = $db->sql_fetchrow($result);\r\n\t\t$db->sql_freeresult($result);\r\n\r\n\t\tif ($this->forum_data[$forum_id]['forum_last_post_id'] == $last_post_data['post_id'])\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif ($last_post_data)\r\n\t\t{\r\n\t\t\t$sql_data = array(\r\n\t\t\t\t'forum_last_post_id'\t\t=> $last_post_data['post_id'],\r\n\t\t\t\t'forum_last_poster_id'\t\t=> $last_post_data['user_id'],\r\n\t\t\t\t'forum_last_post_subject'\t=> $last_post_data['post_subject'],\r\n\t\t\t\t'forum_last_post_time'\t\t=> $last_post_data['post_time'],\r\n\t\t\t\t'forum_last_poster_name'\t=> $last_post_data['username'],\r\n\t\t\t\t'forum_last_poster_colour'\t=> $last_post_data['user_colour'],\r\n\t\t\t);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$sql_data = array(\r\n\t\t\t\t'forum_last_post_id'\t\t=> 0,\r\n\t\t\t\t'forum_last_poster_id'\t\t=> 0,\r\n\t\t\t\t'forum_last_post_subject'\t=> '',\r\n\t\t\t\t'forum_last_post_time'\t\t=> 0,\r\n\t\t\t\t'forum_last_poster_name'\t=> '',\r\n\t\t\t\t'forum_last_poster_colour'\t=> '',\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\t$this->forum_data[$forum_id] = array_merge($this->forum_data[$forum_id], $sql_data);\r\n\r\n\t\t$sql = 'UPDATE ' . FORUMS_TABLE . '\r\n\t\t\tSET ' . $db->sql_build_array('UPDATE', $sql_data) . '\r\n\t\t\t\tWHERE forum_id = ' . $forum_id;\r\n\t\t$db->sql_query($sql);\r\n\r\n\t\tif ($this->forum_data[$forum_id]['parent_id'] != 0)\r\n\t\t{\r\n\t\t\t$this->update_last_post_forum($this->forum_data[$forum_id]['parent_id']);\r\n\t\t}\r\n\t}", "function getPost($slug){\n\tglobal $conn;\n\t// Get single post slug\n\t$post_slug = $_GET['post-slug'];\n\t$sql = \"SELECT * FROM posts WHERE slug='$post_slug' AND published=true\";\n\t$result = mysqli_query($conn, $sql);\n\n\t// fetch query results as associative array.\n\t$post = mysqli_fetch_assoc($result);\n\tif ($post) {\n\t\t// get the topic to which this post belongs\n\t\t$post['topic'] = getPostTopic($post['id']);\n\t\tupdateView($post['id']);\n\t}\n\treturn $post;\n}", "public function convert() {\n $this->issue = Utilities::convertText($this->issue);\n $this->message = Utilities::convertText($this->message);\n }", "public function posts()\n {\n return $this->hasMany('Efed\\Models\\ForumPost', 'topic_id', 'id');\n }", "function giveSpecificPost($postURL) {\n //$postURL gotten from http://miguelamigotgonzalez.com/blog.php?post=[$postURL]\n $postTitle = urldecode($postURL);\n global $DBH;\n $STH = $DBH->prepare('SELECT id, title, date, description, post FROM blogPosts WHERE title = :passTitle');\n $STH->bindParam(':passTitle', $postTitle);\n $STH->execute();\n $result = $STH->fetchAll();\n \n foreach($result as $newEntry) {\n //Save information to an array\n $id = $newEntry[id];\n $title = $newEntry[title];\n $date = $newEntry[date];\n $desc = $newEntry[description];\n $post = $newEntry[post];\n }\n \n //Variables above contain the information of the last blogpost\n $output = formatPost($id, $title, $date, $desc, $post);\n return $output;\n}", "private function getNewsForumLang(GWF_Language $lang, $pid)\n\t{\n\t\t\n\t\t$pid = (int) $pid;\n\t\t$title = $lang->escaped('lang_nativename');\n\t\t// found old board\n\t\tif (false !== ($board = GDO::table('GWF_ForumBoard')->selectFirst(\"board_pid=$pid AND board_title='$title'\"))) {\n\t\t\treturn $board;\n\t\t}\n\n\t\t/// Create new board\n\t\t$options = GWF_ForumBoard::GUEST_VIEW;\n\t\t$descr = $this->module->langISO($lang->getISO(), 'board_lang_descr', array($lang->displayName()));\n\t\t$board = GWF_ForumBoard::createBoard($title, $descr, $pid, $options);\n\t\t\n\t\treturn $board;\n\t}", "public function transform(Post $model)\n {\n return [\n 'id' => (int) $model->id,\n /* place your other model properties here */\n 'title' => $model->title,\n 'body' => $this->getBody($model->body),\n 'image' => url('storage/' . $model->image),\n 'created_at' => $model->created_at->format('Y/m/d H:i')\n ];\n }", "abstract public function transform(Row $row);", "function createThread(&$dbparams, &$contentitem, $forumid, &$status)\n\t{\n\t\ttry {\n\t\t\t//setup some variables\n\t\t\t$userid = $this->getThreadAuthor($dbparams, $contentitem);\n\t\t\t$db = JFusionFactory::getDatabase($this->getJname());\n\t\t\t$subject = trim(strip_tags($contentitem->title));\n\n\t\t\t//prepare the content body\n\t\t\t$text = $this->prepareFirstPostBody($dbparams, $contentitem);\n\n\t\t\t//the user information\n\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->select('username, username_clean, user_colour, user_permissions')\n\t\t\t\t->from('#__users')\n\t\t\t\t->where('user_id = ' . (int) $userid);\n\n\t\t\t$db->setQuery($query);\n\t\t\t$user = $db->loadObject();\n\n\t\t\tif ($dbparams->get('use_content_created_date', false)) {\n\t\t\t\t$timezone = JFusionFactory::getConfig()->get('offset');\n\t\t\t\t$timestamp = strtotime($contentitem->created);\n\t\t\t\t//undo Joomla timezone offset\n\t\t\t\t$timestamp += ($timezone * 3600);\n\t\t\t} else {\n\t\t\t\t$timestamp = time();\n\t\t\t}\n\n\t\t\t$topic = new stdClass();\n\t\t\t$topic->topic_poster = (int) $userid;\n\t\t\t$topic->topic_time = $timestamp;\n\t\t\t$topic->forum_id = $forumid;\n\t\t\t$topic->icon_id = false;\n\t\t\t$topic->topic_visibility = 1;\n\t\t\t$topic->topic_title = $subject;\n\t\t\t$topic->topic_first_poster_name\t= $user->username;\n\t\t\t$topic->topic_first_poster_colour = $user->user_colour;\n\t\t\t$topic->topic_type = 0;\n\t\t\t$topic->topic_time_limit = 0;\n\t\t\t$topic->topic_attachment = 0;\n\n\t\t\t$db->insertObject('#__topics', $topic, 'topic_id' );\n\n\t\t\t$bbcode = $this->helper->bbcode_parser($text);\n\n\t\t\t$post = new stdClass();\n\t\t\t$post->forum_id\t\t\t= (int) $forumid;\n\t\t\t$post->topic_id \t\t= (int) $topic->topic_id;\n\t\t\t$post->poster_id\t\t= (int) $userid;\n\t\t\t$post->icon_id\t\t\t= 0;\n\t\t\t$post->poster_ip\t\t= $_SERVER['REMOTE_ADDR'];\n\t\t\t$post->post_time\t\t= (int) $timestamp;\n\t\t\t$post->post_visibility\t= 1;\n\t\t\t$post->enable_bbcode\t= 1;\n\t\t\t$post->enable_smilies\t= 1;\n\t\t\t$post->enable_magic_url\t= 1;\n\t\t\t$post->enable_sig\t\t= 1;\n\t\t\t$post->post_username\t= $user->username;\n\t\t\t$post->post_subject\t\t= $subject;\n\t\t\t$post->post_text\t\t= $bbcode->text;\n\t\t\t$post->post_checksum\t= md5($bbcode->text);\n\t\t\t$post->post_attachment\t= 0;\n\t\t\t$post->bbcode_bitfield\t= $bbcode->bbcode_bitfield;\n\t\t\t$post->bbcode_uid\t\t= $bbcode->bbcode_uid;\n\t\t\t$post->post_postcount\t= 1;\n\t\t\t$post->post_edit_locked\t= 0;\n\n\t\t\t$db->insertObject('#__posts', $post, 'post_id');\n\n\t\t\t$topic->topic_first_post_id\t\t\t= $post->post_id;\n\t\t\t$topic->topic_last_post_id\t\t\t= $post->post_id;\n\t\t\t$topic->topic_last_post_time\t\t= (int) $timestamp;\n\t\t\t$topic->topic_last_poster_id\t\t= (int) $userid;\n\t\t\t$topic->topic_last_poster_name\t\t= $user->username;\n\t\t\t$topic->topic_last_poster_colour\t= $user->user_colour;\n\t\t\t$topic->topic_last_post_subject\t\t= (string) $subject;\n\t\t\t$topic->topic_posts_approved = 1;\n\n\t\t\t$db->updateObject('#__topics', $topic, 'topic_id' );\n\n\t\t\tif ($dbparams->get('use_content_created_date', false)) {\n\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t->select('forum_last_post_time')\n\t\t\t\t\t->from('#__forums')\n\t\t\t\t\t->where('forum_id = ' . (int) $forumid);\n\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$forum_last_post_time = $db->loadResult();\n\n\t\t\t\t//only update the last post for the topic if it really is newer\n\t\t\t\t$updateLastPost = ($timestamp > $forum_last_post_time) ? true : false;\n\t\t\t} else {\n\t\t\t\t$updateLastPost = true;\n\t\t\t}\n\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->update('#__forums');\n\n\t\t\tif($updateLastPost) {\n\t\t\t\t$query->set('forum_last_post_id = ' . $db->quote($post->post_id))\n\t\t\t\t\t->set('forum_last_post_subject = ' . $db->quote($subject))\n\t\t\t\t\t->set('forum_last_post_time = ' . (int) $timestamp)\n\t\t\t\t\t->set('forum_last_poster_id = ' . (int) $userid)\n\t\t\t\t\t->set('forum_last_poster_name = ' . $db->quote($user->username))\n\t\t\t\t\t->set('forum_last_poster_colour = ' . $db->quote($user->user_colour));\n\t\t\t}\n\n\t\t\t//update some stats\n\t\t\t$query->set('forum_posts_approved = forum_posts_approved + 1')\n\t\t\t\t->set('forum_topics_approved = forum_topics_approved + 1')\n\t\t\t\t->where('forum_id = ' . $db->quote($forumid));\n\n\t\t\t$db->setQuery($query);\n\t\t\t$db->execute();\n\n\t\t\t//update some stats\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->update('#__users')\n\t\t\t\t->set('user_posts = user_posts + 1')\n\t\t\t\t->where('user_id = ' . (int) $userid);\n\n\t\t\t$db->setQuery($query);\n\t\t\t$db->execute();\n\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->update('#__config')\n\t\t\t\t->set('config_value = config_value + 1')\n\t\t\t\t->where('config_name = ' . $db->quote('num_topics'));\n\n\t\t\t$db->setQuery($query);\n\t\t\t$db->execute();\n\n\t\t\tif(!empty($topic->topic_id) && !empty($post->post_id)) {\n\t\t\t\t//add information to update forum lookup\n\t\t\t\t$status['threadinfo']->forumid = $forumid;\n\t\t\t\t$status['threadinfo']->threadid = $topic->topic_id;\n\t\t\t\t$status['threadinfo']->postid = $post->post_id;\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\t$status['error'] = $e->getMessage();\n\t\t}\n\t}", "public function getpostbyid($db_connection, $id){\r\n // SQL query to select a post by its id from the database\r\n $q = 'SELECT postedby_id, dateposted, title, picture, content, board, score\r\n FROM ForumPosts\r\n WHERE id = ?\r\n LIMIT 1';\r\n\r\n // Prepare the SQL query\r\n $pre_q = $db_connection->prepare($q);\r\n // Ensure that the WHERE id = ? part is replaced with\r\n // WHERE id = $id\r\n $pre_q->bindParam(1, $id);\r\n // Then execute the SQL query\r\n $pre_q->execute();\r\n\r\n $this->lastrowcount = $pre_q->rowCount();\r\n\r\n // checking if there is a match\r\n if ($pre_q->rowCount() < 1){\r\n // if there isn't, we return false to indicate this\r\n return false;\r\n }\r\n\r\n // If there is a match, we get that row\r\n $row = $pre_q->fetch(PDO::FETCH_ASSOC);\r\n\r\n // And assign the resulting columns to the appropriate member variables\r\n $this->id = $id;\r\n //$this->user_id = $row['postedby_id'];\r\n $this->user = new User();\r\n if(!$this->user->getuserbyid($db_connection, $row['postedby_id'])){\r\n return false;\r\n }\r\n $this->date_posted = $row['dateposted'];\r\n $this->title = $row['title'];\r\n $this->img_url = $row['picture'];\r\n $this->content = $row['content'];\r\n $this->board = $row['board'];\r\n $this->score = $row['score'];\r\n // We then indicate that the query was successful by returning true\r\n return true;\r\n }", "function _build_row_by_post()\n{\n\t$row = array(\n\t\t'vote_id' => $this->_post_class->get_post_get_int( 'vote_id' ),\n\t\t'vote_time_create' => $this->_post_class->get_post_int( 'vote_time_create' ),\n\t\t'vote_time_update' => $this->_post_class->get_post_int( 'vote_time_update' ),\n\t\t'vote_photo_id' => $this->_post_class->get_post_int( 'vote_photo_id' ),\n\t\t'vote_uid' => $this->_post_class->get_post_int( 'vote_uid' ),\n\t\t'vote_rating' => $this->_post_class->get_post_int( 'vote_rating' ),\n\t\t'vote_hostname' => $this->_post_class->get_post_text( 'vote_hostname' ),\n\n\t);\n\treturn $row;\n}", "public function getPost($postId)\n {\n $dbName = $this->dbConnect();\n $req = $dbName->prepare('SELECT blogpost.id, title,chapo, content,status, user_id,user.login,DATE_FORMAT(dateLastModification, \\'%d/%m/%Y à %Hh%imin%ss\\') \n AS dateLastModification FROM blogpost INNER JOIN user ON blogpost.user_id = user.id WHERE blogpost.id = ? AND blogpost.status = 1');\n $req->execute(array($postId));\n\n while ($row = $req->fetch(PDO::FETCH_ASSOC)) {\n\n $post = new BlogPost();\n $login = new User();\n $login->setLogin($row['login']);\n $post->setId($row['id']);\n $post->setTitle($row['title']);\n $post->setContent($row['content']);\n $post->setDate($row['dateLastModification']);\n $post->setStatus($row['status']);\n $post->setUserId($row['login']);\n $post->setChapo($row['chapo']);\n $posts[] = $post;\n }\n return $posts;\n }", "public function convertToSite($data){\n\t\tforeach($data as $fieldName => $value){\n\n\t\t\tif(isset($this -> convertMap[$fieldName])){\n\n\t\t\t\t$data[$fieldName] = $this -> getSiteId($this -> convertMap[$fieldName], $data[$fieldName]);\n\t\t\t}\n\n\t\t\tif(isset($this -> convertTimeMap[$fieldName])){\n\n\t\t\t\t$data[$fieldName] = $this -> getSiteTime($data[$fieldName]);\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "public function afficherPost(){\r\n\t\t\t$gab = new Template(\"./\");\r\n\t\t\t$gab->set_filenames(array(\"body\" => \"template.post.html\"));\t\r\n\t\t\t$gab->assign_vars(array(\"user\" => $this->user));\r\n\t\t\t$gab->assign_vars(array(\"title\" => $this->title_post));\r\n\t\t\t$gab->assign_vars(array(\"text\" => $this->text_post));\r\n\t\t\t$gab->assign_vars(array(\"date\" => $this->date_post));\r\n\t\t\t$gab->assign_vars(array(\"id_post\" => $this->id_post));\r\n\t\t\t$gab->assign_vars(array(\"count_like\" => $this->count_like));\r\n\t\t\t$gab->assign_vars(array(\"count_answer\" => $this->count_answer));\r\n\t\t\t$gab->assign_vars(array(\"like_button\" => $this->like_button));\r\n\t\t\t$gab->assign_vars(array(\"like_value\" => $this->like_value));\r\n\t\t\t$gab->pparse(\"body\");\r\n\t\t}", "function forum_link_post_processing($title){\n return mb_convert_encoding($title, 'UTF-8', 'auto');\n}", "function giveLastPost() {\n //Figure out the latest inserted ID\n global $DBH; //Access it from outside the function\n $STH = $DBH->prepare('SELECT id, title, date, description, post FROM blogPosts WHERE id = (SELECT MAX(id) FROM blogPosts)');\n $STH->execute();\n //$result is an array\n $result = $STH->fetchAll();\n \n foreach($result as $newEntry) {\n //Save information to an array\n \n //$id = $newEntry[id];\n $title = $newEntry[title];\n //$date = $newEntry[date];\n //$desc = $newEntry[description];\n //$post = $newEntry[post];\n }\n \n return urlencode($title);\n}", "private function dbToConvMessage(array $entry) : ConversationMessage {\n\n\t\t$message = new ConversationMessage();\n\n\t\t$message->set_id($entry[\"id\"]);\n\t\t$message->set_userID($entry[\"user_id\"]);\n\t\t$message->set_time_sent($entry[\"time_insert\"]);\n\t\tif($entry[\"image_path\"] != null)\n\t\t\t$message->set_image_path($entry[\"image_path\"]);\n\t\tif($entry[\"message\"] != null)\n\t\t\t$message->set_message($entry[\"message\"]);\n\n\t\treturn $message;\n\n\t}", "protected function importPost($post)\n {\n $entry = $this->getOrCreatePost($post['WordpressID']);\n\n $entry->ParentID = $this->getBlogHolderID();\n\n // $posts array and $entry have the same key/field names\n // so we can use update here.\n\n $entry->update($post);\n\n //Create an initial write as a draft copy otherwise a write() \n //in SS3.1.2+ will go live and never have a draft Version.\n //@see http://doc.silverstripe.org/framework/en/changelogs/3.1.2#default-current-versioned-\n //stage-to-live-rather-than-stage for details.\n $entry->writeToStage('Stage');\n \n //If the post was published on WP, now ensure it is also live in SS.\n if ($post['IsPublished']) {\n $entry->publish(\"Stage\", \"Live\");\n }\n\n $this->importComments($post, $entry);\n\n return $entry;\n }", "public function post_to_discussion($forum, $discussion, $author) {\n // Add a post to the discussion.\n $record = new stdClass();\n $record->course = $forum->course;\n $record->userid = $author->id;\n $record->moodleforum = $forum->id;\n $record->discussion = $discussion->id;\n $post = $this->create_post($record);\n\n return $post;\n }", "public function getPostList($topic, $thread)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$data_types = array();\n\t\t$data = array();\n\t\t\n\t\t$query ='\tSELECT frm_posts.*, usr_data.lastname FROM frm_posts, usr_data \n\t\t\t\t\tWHERE pos_top_fk = %s\n\t\t\t\t\tAND pos_thr_fk = %s\n\t\t\t\t\tAND pos_usr_id = usr_id';\n\t\t\n\t\tarray_push($data_types, 'integer', 'integer');\n\t\tarray_push($data, $topic, $thread);\n\t\t\n\t\tif($this->orderField != '')\n\t\t{\n\t\t\t$query .= ' ORDER BY '.$this->orderField .' ';\n\t\t}\n\t\t\n\t\t$result = $ilDB->queryf($query, $data_types, $data);\n\t\t\n\t\treturn $result;\n\t}", "static function get_post_by_id($post){\n\t\treturn self::$db->where('token_id',$post)->get('blog')->results();\n\t}", "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 commit() {\r\n if (empty($this->bbcode_uid)) {\r\n $this->bbcode_uid = crc32($this->text);\r\n }\r\n \r\n // Set the editor version\r\n $this->editor_version = defined(\"EDITOR_VERSION\") ? EDITOR_VERSION : 2; \r\n \r\n /** \r\n * Validate the post\r\n */\r\n \r\n $this->validate(); \r\n \r\n /** \r\n * Start the timer if we're in debug mode\r\n */\r\n \r\n if (RP_DEBUG) {\r\n global $site_debug;\r\n $debug_timer_start = microtime(true);\r\n }\r\n \r\n /**\r\n * Process @mentions\r\n */\r\n \r\n if (function_exists(\"process_mentions\")) {\r\n $this->text = process_mentions($this->text);\r\n }\r\n \r\n /**\r\n * Update this information in Redis\r\n */\r\n \r\n $this->mckey = sprintf(\"railpage:forums;post=%d\", $this->id);\r\n $this->Memcached->delete(sprintf(self::CACHEKEY_EDITS, $this->id));\r\n $this->Redis->delete(sprintf(self::CACHEKEY_EDITS, $this->id));\r\n $this->Memcached->delete($this->mckey); \r\n $this->Redis->delete($this->mckey);\r\n $this->Redis->delete(sprintf(\"railpage:forums.post=%d;processed_message\", $this->id));\r\n \r\n /**\r\n * If this is an existing post, insert it into the edit table before we proceed\r\n */\r\n \r\n if (filter_var($this->id, FILTER_VALIDATE_INT)) {\r\n global $User;\r\n \r\n #$CurrentPost = new Post($this->id);\r\n \r\n if ($this->old_text != $this->text) {\r\n $dataArray = array(); \r\n $dataArray['post_id'] = $this->id;\r\n $dataArray['thread_id'] = $this->thread->id;\r\n $dataArray['poster_id'] = $this->uid;\r\n $dataArray['edit_time'] = time(); \r\n $dataArray['edit_body'] = $this->old_text;\r\n $dataArray['bbcode_uid'] = $this->bbcode_uid;\r\n $dataArray['editor_id'] = $User->id;\r\n \r\n if ($this->db->insert(\"nuke_bbposts_edit\", $dataArray)) {\r\n $changes = array(\r\n \"Forum\" => $this->thread->forum->name,\r\n \"Forum ID\" => $this->thread->forum->id,\r\n \"Thread\" => $this->thread->title,\r\n \"Thread ID\" => $this->thread->id,\r\n \"Author user ID\" => $this->uid\r\n );\r\n \r\n try {\r\n $Event = new \\Railpage\\SiteEvent; \r\n $Event->user_id = $User->id; \r\n $Event->title = \"Forum post edited\";\r\n $Event->module_name = \"forums\";\r\n $Event->args = $changes; \r\n $Event->key = \"post_id\";\r\n $Event->value = $this->id;\r\n \r\n $Event->commit();\r\n } catch (Exception $e) {\r\n $Error->save($e); \r\n }\r\n }\r\n }\r\n }\r\n \r\n unset($CurrentPost); unset($dataArray); unset($query);\r\n \r\n /**\r\n * Insert or update the post\r\n */\r\n \r\n $data = array(\r\n \"topic_id\" => $this->thread->id,\r\n \"forum_id\" => $this->thread->forum->id,\r\n \"poster_id\" => $this->uid,\r\n \"post_time\" => $this->timestamp,\r\n \"poster_ip\" => $this->ip,\r\n \"enable_bbcode\" => $this->flag_bbCode,\r\n \"enable_html\" => $this->flag_html,\r\n \"enable_smilies\" => $this->flag_smilies,\r\n \"enable_sig\" => $this->flag_signature,\r\n \"post_rating\" => $this->rating,\r\n \"post_reported\" => $this->reported,\r\n \"post_herring_count\" => $this->herring_count,\r\n \"lat\" => $this->lat,\r\n \"lon\" => $this->lon,\r\n \"pinned\" => intval($this->pinned)\r\n );\r\n \r\n $text = array(\r\n \"bbcode_uid\" => $this->bbcode_uid,\r\n \"post_subject\" => $this->subject,\r\n \"post_text\" => $this->text,\r\n \"editor_version\" => $this->editor_version,\r\n \"url_slug\" => $this->url_slug\r\n );\r\n \r\n if (filter_var($this->id, FILTER_VALIDATE_INT)) {\r\n $data['post_edit_count'] = $this->edit_count++;\r\n \r\n $where = array(\r\n \"post_id = ?\" => $this->id\r\n );\r\n \r\n $this->db->update(\"nuke_bbposts\", $data, $where);\r\n $this->db->update(\"nuke_bbposts_text\", $text, $where);\r\n $verb = \"Update\";\r\n } else {\r\n $this->db->insert(\"nuke_bbposts\", $data); \r\n $this->id = $this->db->lastInsertId(); \r\n \r\n $text['post_id'] = $this->id;\r\n $this->db->insert(\"nuke_bbposts_text\", $text);\r\n $verb = \"Insert\";\r\n \r\n $this->thread->reDrawStats();\r\n }\r\n \r\n if (RP_DEBUG) {\r\n $site_debug[] = \"Zend_DB: \" . $verb . \" Forum post ID \" . $this->id . \" in \" . round(microtime(true) - $debug_timer_start, 5) . \"s\";\r\n }\r\n \r\n $this->makeLinks();\r\n \r\n if (!$this->Author instanceof User) {\r\n $this->loadAuthor();\r\n }\r\n \r\n return true;\r\n }", "public function create(int $forumId, int $userId, string $title, string $body): \\Gazelle\\ForumThread {\n $db = new \\Gazelle\\DB;\n $db->relaxConstraints(true);\n self::$db->prepared_query(\"\n INSERT INTO forums_topics\n (ForumID, Title, AuthorID, LastPostAuthorID)\n Values (?, ?, ?, ?)\n \", $forumId, $title, $userId, $userId\n );\n $thread = $this->findById(self::$db->inserted_id());\n $postId = $thread->addPost($userId, $body);\n $db->relaxConstraints(false);\n (new \\Gazelle\\Stats\\User($userId))->increment('forum_thread_total');\n return $thread;\n }", "function getFromDatabase($row) {\r\n\t\t//id\r\n\t\t$this->id = $row['id'];\r\n\t\t//eventDateTime\r\n\t\t$this->event_date_time = $row['eventDateTime'];\r\n\t\t//time before\r\n\t\t$this->time_before = $row['timeBefore'];\r\n\t\t//frequency\r\n\t\t$this->freq = $row['frequency'];\r\n\t\t//method\r\n\t\t$this->notif_method = $row['method'];\r\n\t}", "public static function getPost(int $id): ?Post\n {\n // NEKAD, NEKAD nelikt $id vai citu $ iekš $query funkcijas, jo tad var uztaisīt SQL injekcijas, kad kāds DROP TABLE sev mūsu datu bāzi. Jātaisa SQL prepaired statements. \n // labāk jarakstīt šitā\n\n // $query = DB::$connection->prepare(\"SELECT * FROM posts WHERE id = ?\");\n // $query->execute([$id]);\n\n $query = DB::$connection->prepare(\"SELECT * FROM posts WHERE id = :id\");\n $query->execute(['id' =>$id]);\n\n \n $post = $query->fetchObject('Post');\n // $posts = self::getPosts(); //Šitā dabū visus Posts\n // foreach ($posts as $post) {\n // if ($post->id == $id) {\n // return $post;\n // }\n // }\n\n\n if(!$post) {\n return null;\n }\n\n // $postObj = new Post();\n // $postObj->id = $post['id'];\n // $postObj->title = $post['title'];\n // $postObj->text = $post['text'];\n\n return $post;\n }" ]
[ "0.5863838", "0.58136", "0.58066976", "0.5783343", "0.5687801", "0.56641865", "0.55674404", "0.5265369", "0.5230894", "0.5221956", "0.5219688", "0.5205111", "0.52033657", "0.5176459", "0.5135551", "0.5093767", "0.5081421", "0.50801456", "0.5077786", "0.5017135", "0.50143826", "0.50040275", "0.49900344", "0.4987429", "0.49643552", "0.49431032", "0.49426943", "0.4942466", "0.49419713", "0.49344632", "0.4923877", "0.49235004", "0.49213263", "0.49191847", "0.49158952", "0.4908995", "0.49025282", "0.48956516", "0.48943412", "0.4888548", "0.48860073", "0.48855957", "0.48854795", "0.4883703", "0.48793894", "0.48740202", "0.487206", "0.48406988", "0.4826157", "0.48231453", "0.4821422", "0.48196366", "0.48145595", "0.48108026", "0.4808795", "0.4807187", "0.48056972", "0.48025587", "0.4801334", "0.47985777", "0.47929826", "0.47916633", "0.4781654", "0.4780769", "0.47684628", "0.47667277", "0.47644714", "0.47601786", "0.47477818", "0.47455752", "0.47446486", "0.4741364", "0.47404438", "0.47313645", "0.47299322", "0.471154", "0.47104228", "0.47091454", "0.4707606", "0.47066537", "0.46932605", "0.46908692", "0.46780792", "0.46717197", "0.4671469", "0.46647555", "0.46594897", "0.46583003", "0.46576127", "0.46543267", "0.46519655", "0.4651642", "0.4651373", "0.46494612", "0.46460366", "0.4643375", "0.46428567", "0.46400794", "0.4633028", "0.46300483" ]
0.60153496
0
translate database row to ForumUser
public static function toUser($data) { $user = new ForumUser(); $user->setId((int) Parse::clean($data->id)); $user->setName(Parse::clean($data->name)); $user->setEmail(Parse::clean(crypt( $data->email, $GLOBALS['database']['crypt_salt'] ))); $user->setRole(Parse::clean($data->title)); $user->setRegistered(Parse::clean($data->registered)); $user->setBanned($data->banned === 't' ? 1:0); return $user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convert_from_sql_row($row)\n\t{\n $this->SignupId = (int)$row->SignupId;\n $this->UserId = (int)$row->UserId;\n $this->RunId = (int)$row->RunId;\n $this->State = (string)$row->State;\n $this->PrevState = (string)$row->PrevState;\n $this->Gender = (string)$row->Gender;\n $this->Counted = (string)$row->Counted;\n $this->UpdatedById = (int)$row->UpdatedById;\n $this->TimeStamp = (string)$row->TimeStamp;\n\t}", "public function convert()\n\t{\n\t\tif (isset($this->fb_data['id'])) \n\t\t{\n\t\t\t$this->user->set_facebook_id($this->fb_data['id'], TRUE);\n\t\t}\n\t\tif (isset($this->fb_data['first_name']))\n\t\t{\n\t\t\t$this->user->set_first_name($this->fb_data['first_name'], TRUE);\n\t\t}\n\t\tif (isset($this->fb_data['last_name'])) \n\t\t{\n\t\t\t$this->user->set_last_name($this->fb_data['last_name'], TRUE);\n\t\t}\n\t\tif (isset($this->fb_data['birthday'])) \n\t\t{\n\t\t\t$this->user->set_birthday( (int) strtotime($this->fb_data['birthday']), TRUE);\n\t\t}\n\t\tif (isset($this->fb_data['gender'])) \n\t\t{\n\t\t\t$this->user->set_gender(substr($this->fb_data['gender'], 0, 1), TRUE);\n\t\t}\n\t\tif (isset($this->fb_data['email']))\n\t\t{\n\t\t\t$this->user->set_email($this->fb_data['email'], TRUE);\n\t\t}\n\t\tif (isset($this->fb_data['timezone']))\n\t\t{\n\t\t\t$this->user->set_timezone( (int) $this->fb_data['timezone'], TRUE);\n\t\t}\n\t\tif (isset($this->fb_data['locale'])) \n\t\t{\n\t\t\t$this->user->set_country_code(substr($this->fb_data['locale'], -2), TRUE);\n\t\t}\n\t\treturn($this);\n\t}", "public static function user_from_row($row) {\r\n $result = new User(UserService::get_key($row,\"UserId\"),UserService::get_key($row,\"Email\"),UserService::get_key($row,\"UserType\"));\r\n $result->set_first_name(UserService::get_key($row,\"FirstName\"));\r\n $result->set_last_name(UserService::get_key($row,\"LastName\"));\r\n $result->set_home_phone(UserService::get_key($row,\"HomePhone\"));\r\n $result->set_mobile_phone(UserService::get_key($row,\"MobilePhone\"));\r\n $result->set_address_1(UserService::get_key($row,\"Address1\"));\r\n $result->set_address_2(UserService::get_key($row,\"Address2\"));\r\n $result->set_city(UserService::get_key($row,\"City\"));\r\n $result->set_state(UserService::get_key($row,\"State\"));\r\n $result->set_zip(UserService::get_key($row,\"ZipCode\"));\r\n $result->set_organization_id(UserService::get_key($row,\"OrganizationId\"));\r\n return $result;\r\n }", "public function get_forum_user()\n\t{\n\t\t$user = get_session(\"user\");\n\t\t$this->db->where(array(\"member_id\"=>$user->id));\n\t\t$hasil = $this->db->get($this->forum_table);\n\t\treturn $hasil->result();\n\t}", "public function convert() {\n $this->user->convert();\n }", "public function transformUsers() {\n $saUsers = $this->kalturaUser->getAll();\n foreach ($saUsers as $key => $saUser){\n /**\n * @var $saUser KalturaUser\n */\n $dwUser = new DwUser();\n $dwUser->setId(\n $this->anonymize->anonymizeUser($saUser->getKalturaUserId())\n );\n $dwUser->setType(\n $this->typeOfUser($saUser->getKalturaUserId())\n );\n $dwUser->setCreatedAt($saUser->created_at);\n $dwUser->setUpdatedAt($saUser->updated_at);\n try{\n $dwUser->save();\n } catch (Exception $e) {\n var_dump($e->getMessage());\n die;\n }\n };\n }", "protected function objectUserEnCours(){\n $fbUid = $this->getRequest()->getSession()->get('_fos_facebook_fb_482361481839052_user_id');\n $user = $this->getDoctrine()->getManager()->getRepository('MetinetFacebookBundle:User')->findOneByfbUid($fbUid);\n return $user ;\n }", "function convertFields($recipRow) {\n\n\t\t\t// Compensation for the fact that fe_users has the field 'telephone' instead of 'phone'\n\t\tif ($recipRow['telephone'])\t{\n\t\t\t$recipRow['phone'] = $recipRow['telephone'];\n\t\t}\n\n\t\t\t// Firstname must be more that 1 character\n\t\t$recipRow['firstname'] = trim(strtok(trim($recipRow['name']), ' '));\n\t\tif (strlen($recipRow['firstname']) < 2 || preg_match('|[^[:alnum:]]$|', $recipRow['firstname'])) {\n\t\t\t$recipRow['firstname'] = $recipRow['name'];\n\t\t}\n\t\tif (!trim($recipRow['firstname'])) {\n\t\t\t$recipRow['firstname'] = $recipRow['email'];\n\t\t}\n\t\treturn $recipRow;\n\t}", "public function mapRow($row)\n {\n $object = new IntercomUser();\n $object->setId ( $row['id'] );\n $object->setIntercomAppId ( $row['intercom_app_id'] );\n $object->setItemId ( $row['item_id'] );\n $object->setItemUserId ( $row['item_user_id'] );\n $object->setEmail ( $row['email'] );\n $object->setOriginContent ( unserialize($row['origin_content']) );\n $object->setProperties ( unserialize($row['properties']) );\n $object->setCreatedAt ( strtotime($row['created_at']) );\n $object->setUpdatedAt ( strtotime($row['updated_at']) );\n return $object;\n }", "private function userdata_convert(&$userdata) \n {\n\t // $userdata is our array that contains user data from our own\n\t // user database, which we must convert to the vBulletin values.\n\t // Minimally, it must contain the username, email and/or password.\n \n\t // required fields\n\t $vbuser = array( 'username' => $userdata['username'] );\n\t if (isset($userdata['email']))\n\t\t$vbuser['email'] = $userdata['email'];\n\t if (isset($userdata['password']))\n\t\t$vbuser['password'] = $userdata['password'];\n\t $vbuser['ipaddress'] = $_SERVER['REMOTE_ADDR'];\n\t // extra stuff, expand as desired\n\t if ($userdata['usergroupid'])\n\t\t$vbuser['usergroupid'] = $userdata['usergroupid'];\n\t if ($userdata['usertitle'])\n\t\t$vbuser['usertitle'] = $userdata['usertitle'];\n\t return $vbuser;\n }", "abstract protected function mapUserToObject(array $user): User;", "private static function formatPostObjUser( $singlePostObj ){\n //$wpSingleUser = WPAPIUserUtil::getWPSingleUserById( $singlePostObj->author ) ;\n \n $wpAPIUserCache = new WPAPIUserCache() ;\n $user = $wpAPIUserCache->getUser( $singlePostObj->author ) ;\n \n if( !$user || !$user->accountid ){\n $singlePostObj->welink_accountid = '' ; // not find accountid , set accountid to emtpy\n }else{\n $singlePostObj->welink_accountid = $user->accountid ;\n }\n \n if( !$user || !$user->user_nicename ){\n $singlePostObj->welink_nameCn = '' ;\n }else{\n $singlePostObj->welink_nameCn = $user->user_nicename ;\n }\n \n return $singlePostObj ;\n \n }", "function jid_to_user( $jid ) {\n\t\treturn substr( $jid, 0, strpos( $jid, \"@\" ) );\n\t}", "public function translate_moodle_userid_to_mapped_value($userid);", "public function transform($value)\n {\n if (null === $value || '' === $value) {\n return UsersConstant::USER_ID_ANONYMOUS;\n }\n\n if (is_numeric($value)) {\n // select user to verify it exists\n /** @var UserEntity $user */\n $user = $this->userRepository->find($value);\n if (null === $user) {\n return UsersConstant::USER_ID_ANONYMOUS;\n }\n\n return $value;\n }\n\n return $value;\n }", "function plexIDToUsername($id, $data) {\n\t foreach ($data->User as $usr){\n\t\tif ($usr->attributes()['id'] == $id) {\n\t\t\treturn $usr->attributes()['username'];\n\t\t\tbreak;\n\t\t}\n\t }\n }", "static function createObjectFromRow($row) \n {\n $uType = 'E'.ucfirst($row['type']); // costruisce la classe da cui istanziare l'oggetto \n \n $user = new $uType();\n \n $user->setId($row['id']);\n $user->setNickName($row['nickname']);\n $user->setPassword($row['password']);\n $user->setMail($row['mail']);\n \n return $user;\n }", "function OS_GetUsernameByUserID( $uid) {\n //$sth = $db->prepare(\"SET NAMES 'utf8'\");\n //$result = $sth->execute();\n\t global $db;\n\t $sth = $db->prepare(\"SELECT * FROM \".OSDB_USERS.\" WHERE user_id = ? LIMIT 1 \");\n\t \n\t $sth->bindValue(1, (int)$uid, PDO::PARAM_INT);\n\t $result = $sth->execute();\n\t $row = $sth->fetch(PDO::FETCH_ASSOC);\n\t $username = $row[\"user_name\"];\n\t return $username;\n }", "protected function createObjectFromRow($row) {\n return new User($row);\n }", "public function toUser($data){\n\t\t\t$this->email=$data['email'];\n\t\t\t$this->password=$data['password'];\n\t\t\t$this->nombre=$data['nombre'];\n\t\t\t$this->apellido=$data['apellido'];\n\t\t}", "function assign_user()\n\t{\n\t\tglobal $current_user;\n\t\t$ass_user = $this->column_fields[\"assigned_user_id\"];\t\t\n\t\tif( $ass_user != $current_user->id)\n\t\t{\n\t\t\t$result = $this->db->query(\"select id from ec_users where user_name = '\".$ass_user.\"' or last_name = '\".$ass_user.\"'\");\n\t\t\tif($this->db->num_rows($result) != 1)\n\t\t\t{\n\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $current_user->id;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\n\t\t\t\t$row = $this->db->fetchByAssoc($result, -1, false);\n\t\t\t\tif (isset($row['id']) && $row['id'] != -1)\n \t {\n\t\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $row['id'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $current_user->id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function transform($data): User\n {\n if (empty($data)) {\n throw new EmptyDataException();\n }\n\n $user = new User();\n $user->setLogin($this->getArrayValue('login', $data));\n $user->setName($this->getArrayValue('name', $data));\n $user->setUrl($this->getArrayValue('html_url', $data));\n $user->setCompany($this->getArrayValue('company', $data));\n $user->setNumOfRepos($this->getArrayValue('public_repos', $data));\n $user->setNumOfFollowers($this->getArrayValue('followers', $data));\n $user->setNumOfFollowing($this->getArrayValue('following', $data));\n $user->setCreatedAt($this->getArrayValue('created_at', $data));\n $user->setUpdatedAt($this->getArrayValue('updated_at', $data));\n\n return $user;\n }", "static protected function getPermalinkFromUserRow($row) {\n if(self::$permalink_pattern === false) {\n self::$permalink_pattern = Router::assemble('user', array('user_id' => '--USER-ID--'));\n } // if\n\n return str_replace('--USER-ID--', $row['id'], self::$permalink_pattern);\n }", "public function tampilUser()\n {\n return $this->db->get('tb_user');\n }", "public function getUserId()\n\t{\n\t\t$column = self::COL_USER_ID;\n\t\t$v = $this->$column;\n\n\t\tif( $v !== null){\n\t\t\t$v = (string)$v;\n\t\t}\n\n\t\treturn $v;\n\t}", "public function getUserId()\n\t{\n\t\t$column = self::COL_USER_ID;\n\t\t$v = $this->$column;\n\n\t\tif( $v !== null){\n\t\t\t$v = (string)$v;\n\t\t}\n\n\t\treturn $v;\n\t}", "public function get_uid($user)\n{\t\t\n\t$uname = $user->__get('uname');\n\t$con = connect();\n\t$q1 = mysqli_query($con, \"SELECT * FROM user WHERE Uname = '$uname'\");\n\t$res = mysqli_fetch_array($q1);\n\t$uid= $res['UId'];\n\treturn $uid;\n}", "function get_FEUserName($uid = 0) {\n\n\t\tif ($uid > 0) {\n\t\t\t$SELECT = '*';\n\t\t\t$FROM = 'fe_users';\n\t\t\t$WHERE = 'uid = ' . intval($uid);\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($SELECT, $FROM, $WHERE);\n\t\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t\tif ($row['name'] == '') {\n\t\t\t\t\t$content = $row['username'];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$content = $row['name'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $content;\n\t}", "private function hachUserMdp($user)\n {\n \tif( get_class($user) != \"PPE\\GSBBundle\\Entity\\Collaborateur\" )\n \t\treturn null;\n \telse\n \t{\n \t\t$factory = $this->get('security.encoder_factory');\n \t\t\n \t\t$encoder = $factory->getEncoder($user);\n \t\t\n \t\t$oldpass = $user->getMdpCol();\n \t\t\n \t\t$password = $encoder->encodePassword($oldpass, $user->getSaltCol());\n \t\t\n \t\t$user->setMdpCol($password);\n \t\t\n \t\treturn $user;\n \t}\n\t}", "function parse_user($value){\n\t\t$value = preg_replace_callback('/\\[user=([\\w-_]+)\\]/iU','preg_replace_user',$value);\n\t\t$CI =& get_instance();\n\t\t$user = $CI->user->is_logged() ? $CI->user->get('name') : t('user guest');\n\t\t$value = str_replace('%username%', $user, $value);\n\t\treturn $value;\n\t}", "function getUserById($id){\n\t\tglobal $db;\n\t\t$query = \"SELECT * FROM t_attendees WHERE id=\" . $id;\n\t\t$result = mysqli_query($db, $query);\n\t\t$user = mysqli_fetch_assoc($result);\n\t\treturn $user;\n\t}", "public function transformItem($data, $api = null) \n\t{\n\t\t$transformer = new UserTransformer();\n\n\t\treturn new User($transformer->transform($data), $api);\n\t}", "function trac_load_value_user_email( $value, $post_id, $field ) {\n\tif ( false !== strpos($post_id, 'user_') && $user_id = str_replace('user_', '', $post_id) ) {\n\t\t$userdata = get_userdata( $user_id );\n\t\tif ( $userdata ) {\n\t\t\t$value = $userdata->user_email;\n\t\t}\n\t}\n return $value;\n}", "public function user_id2user_data($user_id, $q_data)\n {\n if (!isset($this->user_id2user_data_ar[$user_id][$q_data])) {\n try {\n $stm = $this->uFunc->pdo('uAuth')->prepare(\"SELECT \n $q_data \n FROM \n u235_users \n WHERE \n user_id=:user_id\n \");\n $stm->bindParam(':user_id', $user_id, PDO::PARAM_STR);\n $stm->execute();\n\n $this->user_id2user_data_ar[$user_id][$q_data] = $stm->fetch(PDO::FETCH_OBJ);\n } catch (PDOException $e) {$this->uFunc->error(1585456391,1);}\n\n }\n return $this->user_id2user_data_ar[$user_id][$q_data];\n }", "function getUser($username) {\n $db = connect();\n $sql = \"SELECT * FROM registered NATURAL JOIN user NATURAL JOIN freelancer WHERE username = '$username'\";\n $data = $db->query($sql);\n\n //is freelancer\n if($data->num_rows == 1){\n $data = $data->fetch_assoc();\n $user = new Freelancer($data);\n }\n else{\n $sql = \"SELECT * FROM user WHERE username = '$username'\";\n $data = $db->query($sql);\n\n if($data->num_rows == 1){\n $data = $data->fetch_assoc();\n $user = new User($data);\n }\n else{\n $user = null;\n }\n }\n $db->close();\n return $user;\n}", "public function retrieve_user($user)\n{\t\t\n $uid=$user->__get('uid');\n\t$con = connect();\n\t$q1 = mysqli_query($con, \"SELECT * FROM user WHERE UId = '$uid'\");\n\treturn $q1;\n}", "public static function userObjectFromSQL($sql_user)\n {\n if(!$sql_user) return $sql_user;\n $user = new stdClass();\n $user->user_id = $sql_user->user_id;\n $user->user_name = $sql_user->user_name;\n $user->display_name = $sql_user->display_name;\n $user->bio = $sql_user->bio;\n $user->url = $sql_user->url;\n $user->media_id = $sql_user->media_id;\n\n return $user;\n }", "protected function _oldUser() {\n\t\t$user_id = trim($this->in('User ID:'));\n\n\t\tif (!$user_id || !is_numeric($user_id)) {\n\t\t\t$user_id = $this->_oldUser();\n\n\t\t} else {\n\t\t\t$result = $this->db->fetchRow(sprintf(\"SELECT * FROM `%s` AS `User` WHERE `id` = %d LIMIT 1\",\n\t\t\t\t$this->install['table'],\n\t\t\t\t$user_id\n\t\t\t));\n\n\t\t\tif (!$result) {\n\t\t\t\t$this->out('User ID does not exist, please try again.');\n\t\t\t\t$user_id = $this->_oldUser();\n\n\t\t\t} else {\n\t\t\t\t$this->install['username'] = $result['User'][$this->config['userMap']['username']];\n\t\t\t\t$this->install['password'] = $result['User'][$this->config['userMap']['password']];\n\t\t\t\t$this->install['email'] = $result['User'][$this->config['userMap']['email']];\n\t\t\t}\n\t\t}\n\n\t\treturn $user_id;\n\t}", "public function convert()\n {\n if (isset($this->mapped[$this->index][$this->value])) {\n $account = Auth::user()->accounts()->find($this->mapped[$this->index][$this->value]);\n\n return $account;\n } else {\n if (strlen($this->value) > 0) {\n $account = $this->findAccount();\n if (!is_null($account)) {\n return $account;\n }\n }\n\n return $this->value;\n }\n }", "public function topicUser()\n {\n if (!$this->user)\n {\n $this->user = eZUser::fetch($this->attribute('user_id'));\n }\n return $this->user;\n }", "public function get_uname($user)\n{\t\t\n $uid = $user->__get('uid');\n\t$con = connect();\n\t$q1 = mysqli_query($con, \"SELECT * FROM user WHERE UId = '$uid'\");\n\t$res = mysqli_fetch_array($q1);\n\t$uname = $res['Uname'];\n\treturn $uname;\n}", "public function getUser($id){\n \t$sql = \"select * from `usuarios` where `id` = '$id'\";\n \t$result = parent::executaQuery($sql);\n $row = mysqli_fetch_object ( $result );\n return $row;\n }", "protected function mapUserToObject(array $user)\n {\n return (new User)->setRaw($user)->map([\n 'id' => $user['CharacterID'],\n 'name' => $user['CharacterName'],\n 'owner_hash' => $user['CharacterOwnerHash'],\n 'avatar' => 'https://image.eveonline.com/Character/' . $user['CharacterID'] . '_128.jpg',\n ]);\n }", "public function resolveUser() {\n $user = User::model()->findByAttributes(array('emailAddress' => $this->email));\n if(!($user instanceof User)){\n $profile = Profile::model()->findByAttributes(array('emailAddress' => $this->email));\n if($profile instanceof Profile) {\n $user = $profile->user;\n }\n }\n return $user;\n }", "function callFromDb ($obj, $user) {\n $result = $obj->getUser($user);\n if(!empty($result)) {\n foreach ($result as $e) {\n $tmpUser = new user($e['user_id'], $e['password'], $e['name'], $e['permission']);\n }\n }\n return $tmpUser;\n}", "protected function buildDomainObject($row) {\n $user = new User();\n $user->setId($row['user_id']);\n $user->setEmail($row['user_email']);\n $user->setLastname($row['user_lastname']);\n $user->setFirstname($row['user_firstname']);\n $user->setPassword($row['user_password']);\n $user->setSalt($row['user_salt']);\n $user->setAddress($row['user_address']);\n $user->setTown($row['user_town']);\n $user->setZipcode($row['user_zipcode']);\n $user->setRole($row['user_role']);\n return $user;\n }", "public static function LoadWithData($row)\n \t{\n \t\treturn new Users_model(\n \t\t\t$row->user_signup_id,\n \t\t\t$row->email,\n \t\t\t$row->name,\n \t\t\t$row->school,\n \t\t\t$row->city,\n \t\t\t$row->exam\n \t\t);\n \t}", "public function getUser()\n\t{\n\t\tif(!Precurio_Utils::isNull($this->user))\n\t\t\treturn $this->user;\n\t\t$table = new Zend_Db_Table(array('name'=>PrecurioTableConstants::USERS, 'rowClass'=>'User'));\n\t\t$this->user = $table->fetchRow($table->select()->where('user_id = ?',$this->user_id));\n\t\treturn $this->user; \n\t}", "public function convert($adresse_id,$password)\n {\n $adresse = $this->adresse->find($adresse_id);\n\n // Get infos\n $prenom = $adresse->prenom;\n $nom = $adresse->nom;\n $email = $adresse->email;\n\n // Create new user\n $user = $this->user->create(\n array(\n 'prenom' => $prenom,\n 'nom' => $nom,\n 'email' => $email,\n 'password' => $password\n )\n );\n\n if(!$user)\n {\n return false;\n }\n\n // Assign user_id to adresse\n $adresse->user_id = $user->id;\n $adresse->livraison = 1;\n $adresse->type = 1;\n $adresse->save();\n\n return $user;\n\n }", "function obtener_uid($uid) {\n\n $conn = $this->conn;\n if (!$stmt = $conn->prepare(\"SELECT * FROM usuarios WHERE uid = ?\")) {\n die(\"Error al preparar la consulta: \" . $conn->error);\n }\n if (!$stmt->bind_param('s', $uid)) {\n die(\"Error en el bind_param: \" . $stmt->error);\n }\n if (!$stmt->execute()) {\n die(\"Error en el execute: \" . $stmt->error);\n }\n $result = $stmt->get_result();\n\n return $result->fetch_object('Usuario');\n }", "public function get_details_user($details){\r\n\r\n $info = $this->db->get_where('user', array('user_id' => $details->user_id));\r\n $row = $this->user_xss_clean($info->row());\r\n return $row;\r\n }", "protected function buildDomainObject($row)\n {\n $user = new User();\n $user->setId($row['rowid']);\n $user->setUsername($row['username']);\n $user->setFirstname($row['firstname']);\n $user->setEmail($row['email']);\n $user->setBusiness($row['business']);\n $user->setPassword($row['password']);\n $user->setSalt($row['salt']);\n $user->setRole($row['role']);\n return $user;\n }", "protected function getGenericUser($user)\n {\n if ($user !== null) {\n return new GenericUser((array)$user);\n }\n }", "public function getPostUser() {\n\n // Match and map the id of the author ($userId) to a user object\n return UserManager::getUserById($this->userId);\n }", "function getById(){\n //query to read single user\n $query = \"SELECT u.id, u.username, u.password, u.estado, (CASE u.estado WHEN '1' THEN 'ACTIVO' WHEN '0' THEN 'INACTIVO' END)\n AS valor_estado, u.fecha_creacion, p.id AS id_perfil, p.nombre AS nombre_perfil FROM \". $this->table_name .\" u\n INNER JOIN perfil p ON u.id_perfil = p.id AND u.id=? LIMIT 0,1\";\n\n //prepare query statement\n $stmt = $this->conn->prepare($query);\n\n //bind id of user to be updated\n $stmt->bindParam(1, $this->id);\n\n //execute query\n $stmt->execute();\n\n //get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n //set values to object properties\n $this->username = $row['username'];\n $this->password = $row['password'];\n $this->estado = $row['estado'];\n $this->valor_estado = $row['valor_estado'];\n $this->fecha_creacion = $row['fecha_creacion'];\n $this->id_perfil = $row['id_perfil'];\n $this->nombre_perfil = $row['nombre_perfil'];\n }", "function get_user_details()\r\n{\r\n\tdo_log(\"get_user_details called\",5);\r\n\tglobal $userid,$userstate,$forum_id,$username,$email,\r\n\t\t\t$ts3_user_id,$existing_main,$existing_main_name,$corp_ids,$director_corp_ids,\r\n\t\t\t$group_membership,$SETTINGS, $isAdmin, $isSuperAdmin, $jabber_user_name, $registered_characters;\r\n\r\n\t// BigSako: initialize forum_id\r\n\t$forum_id = -1;\r\n\t\r\n\t$isAdmin = false;\r\n\t$isSuperAdmin = false;\r\n\r\n\t$as_user_flood_protect = 0;\r\n\t\r\n\tif($_COOKIE[$SETTINGS['forum_cookie_id']])\r\n\t{\r\n\t\t$forum_hash=sanitise($_COOKIE[$SETTINGS['forum_cookie_id']]); // BigSako: Prevent possible SQL Injection here! Very dangerous \r\n\t\t\r\n\t\t$forum_id=lookup_forum_id($forum_hash);\r\n\t\tdo_log(\"get_user_details(): forum_hash = '$forum_hash', forum_id='$forum_id'\", 9);\r\n\t}\r\n\tif($forum_id<1) \r\n\t{\r\n\t\tdo_log(\"get_user_details(): no forum_id retrieved - exiting...\", 9);\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t$db = connectToDB();\r\n\t\r\n\t// asume user (see further below)\r\nasuser:\r\n\t\r\n\t// set corp ids to an empty array for now\r\n\t$corp_ids = array();\r\n\t$director_corp_ids = array();\r\n\t\t\r\n\t// query the forum and see who this is\r\n\t$sql = \"select user_id,user_name,forum_id,email,state,\" .\r\n\t\t\t\"ts3_user_id,has_regged_main,jabber_user_name from auth_users where forum_id='\".$forum_id.\"'\";\r\n\tdo_log(\"sql='$sql'\", 9);\r\n\t$sth=$db->query($sql);\r\n\tif($sth->num_rows == 1) // should be exactly one result\r\n\t{\r\n\t\t$result=$sth->fetch_array();\r\n\t\t$userid=$result['user_id'];\t\t\r\n\t\t$username=$result['user_name'];\r\n\t\t$userstate=$result['state'];\r\n\t\t$email=$result['email'];\r\n\r\n\t\t$ts3_user_id = $result['ts3_user_id'];\r\n\t\t$jabber_user_name = $result['jabber_user_name'];\r\n\t\t$existing_main=$result['has_regged_main'];\r\n\t\t\r\n\t\t// get main character\r\n\t\t$sth2 = $db->query(\"SELECT character_name FROM api_characters WHERE character_id = $existing_main \");\r\n\t\t$res2 = $sth2->fetch_array();\r\n\t\t$existing_main_name = $res2['character_name'];\r\n\t\t\r\n\t\t\r\n\t\t// get groups\r\n\t\t$sth3 = $db->query(\"SELECT group_id FROM group_membership WHERE user_id = $userid AND state=0\");\r\n\t\t$group_membership = array();\r\n\t\t$group_membership[0] = 0;\r\n\t\t\r\n\t\t$cnt = 1;\r\n\t\t\r\n\t\twhile ($row3 = $sth3->fetch_array())\r\n\t\t{\r\n\t\t\t$group_membership[$cnt] = $row3['group_id'];\r\n\t\t\tif ($row3['group_id'] == ADMIN_GROUP_ID || $row3['group_id'] == SUPERADMIN_GROUP_ID)\r\n\t\t\t{\r\n\t\t\t\t$isAdmin = true;\r\n\t\t\t}\r\n if ($row3['group_id'] == SUPERADMIN_GROUP_ID)\r\n {\r\n $isSuperAdmin = true;\r\n }\r\n\t\t\t$cnt++;\r\n\t\t}\r\n\r\n\t\t\r\n\t\t// check for ASSUME_USER flag\r\n\t\tif ($isAdmin == true && isset($_COOKIE['API_ASUSER']) && $as_user_flood_protect == 0)\r\n\t\t{\r\n\t\t\t$forum_id = intval($_COOKIE['API_ASUSER']);\r\n\t\t\tdo_log(\"Admin is asuming to be user with forum_id $forum_id\", 1);\r\n\t\t\t// reset isAdmin\r\n\t\t\t$isAdmin = false;\r\n\t\t\t$as_user_flood_protect = 1;\r\n\t\t\tgoto asuser;\r\n\t\t}\r\n\t\t\r\n\t\t// get corp ids\r\n\t\t$res = $db->query(\"SELECT a.corp_id, a.is_director, a.is_ceo, c.is_allowed_to_reg as corp_reg, d.is_allowed_to_reg as alliance_reg FROM api_characters a, corporations c, alliances d\r\n \t\t\t\tWHERE c.corp_id = a.corp_id AND a.user_id = $userid AND a.state <= 10 AND c.alliance_id = d.alliance_id\");\r\n\t\t\r\n\t\twhile ($row = $res->fetch_array())\r\n\t\t{\r\n\t\t\t$corp_ids[] = $row['corp_id'];\r\n\t\t\tif (($row['corp_reg'] == 1 || $row['alliance_reg']) && ($row['is_director'] >= 1 || $row['is_ceo'] == 1))\r\n\t\t\t{\r\n\t\t\t\t$director_corp_ids[] = $row['corp_id'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t} else if ($sth->num_rows == 0) { // user has registered at the forums, but does not have an account here\r\n\t\tdo_log(\"New user?\",5);\r\n\t\t$existing_main = -1;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$result = get_forum_details($forum_id);\r\n\t\t// edit: dont forget to escape the username and the email \r\n\t\t$username=$db->real_escape_string($result['username']);\r\n\t\t$email=$db->real_escape_string($result['email']);\r\n\t\t\r\n\t\t// insert user into our database in auth_users\r\n\t\t$sql = \"insert into auth_users (user_name,forum_id,email,state) values \" .\r\n\t\t\t\t\t\"('$username','$forum_id','$email','0')\";\r\n\t\t$sth=$db->query($sql);\r\n\t\t\r\n\t\t// if insert was not successful, it either is an sql error (unlikely) OR\r\n\t\t// the user was already registered, so we need to manually fix this.\r\n\t\tif ($sth == false)\r\n\t\t{\r\n\t\t\tdo_log(\"Inserting user $username with forum_id $forum_id failed...\", 1);\r\n\t\t\tdo_log(\"qry='$sql'\", 1);\r\n\t\t\terror_page(\"Error\", \"It appears that you are already registered with a different forum account. Please contact the IT Team.<br /> \".\r\n\t\t\t\t\t\t\"Details: forum-username: $username, forum_id: $forum_id\");\r\n\t\t\texit;\r\n\t\t\t//return false;\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// get user id etc...\r\n\t\t\t$sth=$db->query(\"select user_id,user_name,forum_id,email,state,ts3_user_id from auth_users where forum_id='$forum_id'\");\r\n\r\n\t\t\t$result=$sth->fetch_array();\r\n\t\t\t$userid=$result['user_id'];\r\n\t\t\t$username=$result['user_name'];\r\n\t\t\t$userstate=$result['state'];\r\n\t\t\t$email=$result['email'];\r\n\t\t\t$ts3_user_id = $result['ts3_user_id'];\r\n\t\t\t\r\n\t\t\t// give user the default group 0\r\n\t\t\t$db->query(\"INSERT INTO group_membership (group_id, user_id, state, previous_state) VALUES (0, $userid, 0, 0)\");\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$sth3 = $db->query(\"SELECT group_id FROM group_membership WHERE user_id = $userid AND state=0\");\r\n\t\t$group_membership = array();\r\n\t\t$group_membership[0] = 0;\r\n\t\t\r\n\t\t$cnt = 1;\r\n\t\t\r\n\t\twhile ($row3 = $sth3->fetch_array())\r\n\t\t{\r\n\t\t\t$group_membership[$cnt] = $row3['group_id'];\r\n\t\t\tif ($row3['group_id'] == ADMIN_GROUP_ID && !isset($_COOKIE['API_ASUSER']))\r\n\t\t\t{\r\n\t\t\t\t$isAdmin = true;\r\n\t\t\t}\r\n\t\t\t$cnt++;\r\n\t\t}\r\n\r\n\r\n\t} else {\r\n\t\tdo_log(\"error happened, more than 1 row returned...\", 5);\r\n\t\treturn false;\r\n\t}\r\n\r\n\r\n // now that we got that far: query all characters belonging to that user with an active API\r\n $registered_characters = array();\r\n\r\n $sql = \"SELECT character_id, character_name FROM api_characters WHERE user_id = $userid AND state < 90 order by key_id,character_name\";\r\n $res = $db->query($sql);\r\n\r\n while ($row = $res->fetch_array())\r\n {\r\n $registered_characters[$row['character_id']] = $row['character_name'];\r\n }\r\n\r\n\tdo_log(\"Username has been determined to be \".$GLOBALS[\"username\"],9);\r\n\treturn true;\r\n}", "public function getUserById($id){\n $this->db->query('SELECT * FROM users WHERE us_id = :id');\n // Bind values\n $this->db->bind(':id', $id);\n $row = $this->db->single();\n return $row;\n\n }", "protected function transformRow($row){\n\n // if nothing to do\n if($row===null || is_scalar($row)){\n return $row;\n }\n\n foreach($this->connections as $data){\n // get self value\n $self = $row->{$data->getSelfKey()};\n\n $class = $data->getClassName();\n\n // if data isset - inject into key\n if(isset($this->relatedData[$class][$self])){\n $row->{$class} = $this->relatedData[$class][$self];\n // or inject empty value\n }else{\n $row->{$class} = [];\n }\n }\n\n return $row;\n }", "public function transform(array $record) : UserModelInterface;", "function todos_get_assignee_filter_callback($row) {\n\t$result = new stdClass();\n\t$result->name = $row->name;\n\t$result->guid = (int) $row->guid;\n\t\n\treturn $result;\n}", "function pilau_get_user_with_meta( $id ) {\n\t\t$user = get_userdata( $id );\n\t\tif ( $user ) {\n\t\t\t$user = $user->data;\n\t\t\t$user_meta = get_user_meta( $id );\n\t\t\tforeach ( $user_meta as $user_meta_key => $user_meta_value ) {\n\t\t\t\t$user->{$user_meta_key} = maybe_unserialize( $user_meta_value[0] );\n\t\t\t}\n\t\t}\n\t\treturn $user;\n\t}", "function getUsername($userId){\n return getSingleValue(\"SELECT `username` FROM `private_users` WHERE `id` =\" . escape(intval($userId)) . \" LIMIT 0, 1\");\n }", "protected function mapUserToObject(array $user)\n {\n\n $result = new User();\n\n $result->name = $user['displayName'];\n $result->email = $user['mail'];\n $result->provideUserId = $user['internal_id'];\n\n return $result;\n }", "private function convert_members()\n\t{\n\t\t$num = $this->oldboard->db->fetch( \"SELECT COUNT(MEMBER_ID) AS count FROM %pmember_profiles\" );\n\t\t$MID = $num['count'] + 1;\n\n\t\t$this->qsf->db->query( \"TRUNCATE %pusers\" );\n\t\t$this->qsf->db->query( \"INSERT INTO %pusers (user_id, user_name, user_group) VALUES (1, 'Guest', 3)\" );\n\n\t\t$result = $this->oldboard->db->query( \"SELECT * FROM %pmember_profiles\" );\n\t\twhile( $row = $this->oldboard->db->nqfetch($result) )\n\t\t{\n\t\t\twhile( $row['MEMBER_ID'] >= $MID )\n\t\t\t\t$MID++;\n\n\t\t\tif( $row['MEMBER_ID'] == 1 )\n\t\t\t\t$row['MEMBER_ID'] = 2;\n\n\t\t\t$row['MEMBER_NAME'] = $this->strip_ikon_tags( $row['MEMBER_NAME'] );\n\t\t\t$row['MEMBER_EMAIL'] = $this->strip_ikon_tags( $row['MEMBER_EMAIL'] );\n\t\t\t$row['WEBSITE'] = $this->strip_ikon_tags( $row['WEBSITE'] );\n\t\t\t$row['LOCATION'] = $this->strip_ikon_tags( $row['LOCATION'] );\n\t\t\t$row['INTERESTS'] = $this->strip_ikon_tags( $row['INTERESTS'] );\n\t\t\t$row['SIGNATURE'] = $this->strip_ikon_tags( $row['SIGNATURE'] );\n\n\t\t\t$pos = strpos( $row['MEMBER_ID'], '-' );\n\t\t\tif( $pos != false )\n\t\t\t{\n\t\t\t\t$IDTABLE[] = array( 'uname' => $row['MEMBER_NAME'], 'newid' => $MID, 'oldid' => $row['MEMBER_ID'] );\n\t\t\t\t$row['MEMBER_ID'] = $MID;\n\t\t\t\t$MID++;\n\t\t\t}\n\t\t\tif( $row['HIDE_EMAIL'] == '' || $row['HIDE_EMAIL'] == 1 )\n\t\t\t\t$showmail = 0;\n\t\t\telse\n\t\t\t\t$showmail = 1;\n\n\t\t\tif( $row['LAST_LOG_IN'] == '' )\n\t\t\t\t$row['LAST_LOG_IN'] = $row['MEMBER_JOINED'];\n\t\t\tif( $row['LAST_ACTIVITY'] == '' )\n\t\t\t\t$row['LAST_ACTIVITY'] = $row['MEMBER_JOINED'];\n\n\t\t\t/* The default Ikonboard groups they claim you can never alter.\n\t\t\t * Additional groups will not be converted. Members in these groups will become standard members.\n\t\t\t */\n\t\t\tif( $row['MEMBER_GROUP'] == 1 )\n\t\t\t\t$row['MEMBER_GROUP'] = 5;\n\t\t\telse if( $row['MEMBER_GROUP'] == 2 )\n\t\t\t\t$row['MEMBER_GROUP'] = 3;\n\t\t\telse if( $row['MEMBER_GROUP'] == 3 )\n\t\t\t\t$row['MEMBER_GROUP'] = 2;\n\t\t\telse if( $row['MEMBER_GROUP'] == 4 )\n\t\t\t\t$row['MEMBER_GROUP'] = 1;\n\t\t\telse\n\t\t\t\t$row['MEMBER_GROUP'] = 2;\n\n\t\t\t$level = $row['MEMBER_LEVEL'] + 1;\n\t\t\tif( $level < 1 )\n\t\t\t\t$level = 1;\n\n\t\t\t$pos = strpos( $row['MEMBER_AVATAR'], '://' );\n\t\t\tif( $pos == 4 )\n\t\t\t{\n\t\t\t\t$avatar = $row['MEMBER_AVATAR'];\n\t\t\t\t$width = 100;\n\t\t\t\t$height = 100;\n\t\t\t\t$type = 'url';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$avatar = '';\n\t\t\t\t$width = 0;\n\t\t\t\t$height = 0;\n\t\t\t\t$type = 'none';\n\t\t\t}\n\n\t\t\t$icq = 0;\n\t\t\tif( $row['ICQNUMBER'] )\n\t\t\t\t$icq = intval( $row['ICQNUMBER'] );\n\n\t\t\t$this->qsf->db->query( \"INSERT INTO %pusers\n\t\t\t\t(user_id, user_name, user_password, user_joined, user_level, user_title, user_group, user_avatar, user_avatar_type, user_avatar_width, user_avatar_height, user_email, user_email_show, user_homepage, user_posts, user_location, user_icq, user_msn, user_aim, user_yahoo, user_interests, user_signature, user_lastvisit, user_lastpost, user_view_avatars, user_view_signatures, user_regip)\n\t\t\t\tVALUES( %d, '%s', '%s', %d, %d, '%s', %d, '%s', '%s', %d, %d, '%s', %d, '%s', %d, '%s', %d, '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, INET_ATON( '%s' ) )\",\n\t\t\t\t$row['MEMBER_ID'], $row['MEMBER_NAME'], $row['MEMBER_PASSWORD'], $row['MEMBER_JOINED'], $level, $row['MEMBER_TITLE'], $row['MEMBER_GROUP'], $avatar, $type, $width, $height, $row['MEMBER_EMAIL'], $showmail, $row['WEBSITE'], $row['MEMBER_POSTS'], $row['LOCATION'], $icq, $row['MSNNAME'], $row['AOLNAME'], $row['YAHOONAME'], $row['INTERESTS'], $row['SIGNATURE'], $row['LAST_LOG_IN'], $row['LAST_ACTIVITY'], $row['VIEW_AVS'], $row['VIEW_SIGS'], $row['MEMBER_IP'] );\n\t\t}\n\n\t\t$this->qsf->db->query( \"DROP TABLE IF EXISTS %pikon_ids\" );\n\t\t$this->qsf->db->query( \"CREATE TABLE %pikon_ids\n\t\t\t( old_name varchar(32) NOT NULL, old_id varchar(32) NOT NULL, new_id int(10) unsigned NOT NULL, PRIMARY KEY(old_id) )\" );\n\n\t\tfor( $x = 0; $x < sizeof( $IDTABLE ); $x++ )\n\t\t{\n\t\t\t$name = $IDTABLE[$x]['uname'];\n\t\t\t$oldid = $IDTABLE[$x]['oldid'];\n\t\t\t$newid = $IDTABLE[$x]['newid'];\n\n\t\t\t$this->qsf->db->query( \"INSERT INTO %pikon_ids VALUES( '%s', '%s', %d )\", $name, $oldid, $newid );\n\t\t}\n\t}", "public static function getById($user_id){\n\t\t$user = new User();\n\t\t$query = sprintf('SELECT USERNAME, PASSWORD, EMAIL_ADDR, IS_ACTIVE FROM %sUSER WHERE USER_ID = %d', DB_TBL_PREFIX, $user_id );\n\t\t$result = mysql_query($query, $GLOBALS['DB']);\n\t\tif(mysql_num_rows($result)){\n\t\t\t$row = mysql_fetch_assoc($result);\n\t\t\t$user->username =$row['USERNAME'];\n\t\t\t$user->password = $row['PASSWORD'];\n\t\t\t$user->emailAddr = $row['EMAIL_ADDR'];\n\t\t\t$user->isActive = $row['IS_ACTIVE'];\n\t\t\t$user->uid = $user_id;\n\t }\n\t\n\t mysql_free_result($result);\n\t return $user;\n\t}", "function member_username($data)\r\n\t{\r\n\t\tglobal $db;\r\n\t\t$query = 'SELECT username FROM gv_members WHERE member_id = ' . $data;\r\n\t\t$result = mysql_query($query, $db) or die(mysql_error($db));\r\n\t\t$row = mysql_fetch_assoc($result);\r\n\t\textract($row);\r\n\t\treturn ucfirst($username);\r\n\t}", "function get_user($user_id){\n\tglobal $connection;\n\t$get_user= mysqli_query($connection,\"SELECT * FROM kp_users WHERE user_id='$user_id'\");\n\t$row = mysqli_fetch_assoc($get_user);\n\t$name = strtoupper($row['username']);\n\treturn $name;\n}", "private function normalizeUser($raw)\n {\n $user = array();\n $user['id'] = strval($raw->Name);\n foreach($raw->Attribute as $item)\n {\n $name = (string)$item->Name;\n $value = (string)$item->Value;\n $user[$name] = $value;\n }\n return $user;\n }", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}" ]
[ "0.6022985", "0.58756256", "0.58455765", "0.5843801", "0.58296764", "0.5796157", "0.55355024", "0.5527318", "0.55139244", "0.547733", "0.5456897", "0.54538655", "0.54429287", "0.54169077", "0.53633946", "0.53233415", "0.5283422", "0.52714103", "0.5245202", "0.5216264", "0.5211179", "0.51976174", "0.51838386", "0.5178537", "0.51579684", "0.51579684", "0.5148118", "0.5130508", "0.51271516", "0.5122969", "0.51215994", "0.5117941", "0.5113282", "0.51102287", "0.5109337", "0.5108501", "0.51082057", "0.51056486", "0.5105493", "0.5100968", "0.5094169", "0.5082525", "0.50812197", "0.5071957", "0.5066936", "0.5040129", "0.5032423", "0.5032125", "0.5017986", "0.501536", "0.5008372", "0.5005202", "0.5000511", "0.4980796", "0.49670926", "0.496481", "0.49633157", "0.4961673", "0.49589545", "0.49560633", "0.49458393", "0.49405596", "0.49405476", "0.49327534", "0.49215987", "0.4920155", "0.4909967", "0.48986313", "0.4893802", "0.4893802", "0.4893802", "0.4893802", "0.4893802", "0.4893802", "0.48935607", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.48932624", "0.4893175", "0.4893175" ]
0.65553194
0
file_put_contents("/tmp/checkuser", "test"); $user = fileowner("/tmp/checkuser"); unlink("/tmp/checkuser"); if ($user!=1000) die; get passed emoncms location from bash e.g. $ echo /var/www/emoncms | php get_emoncms_mysql_auth.php
function getInput() { $input = ''; $fr = fopen("php://stdin", "r"); while (!feof ($fr)) { $input .= fgets($fr); } fclose($fr); return $input; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_file_owner($path) {\n $owner = posix_getpwuid(fileowner($path));\n return $owner['name'];\n}", "function create_user_dir(){\n\t$safeUserDir=bin2hex(random_bytes(4));\n\t$oldDir=getcwd();\n\tchdir(FS_PATH);\n\tif(mkdir(\"$safeUserDir\")) {\n\tchmod(\"$safeUserDir\",0755); //owner=r,w,x group=r,x other=r,x\n\tchdir($oldDir);\n\treturn \t$safeUserDir;\n\t} else {\n\t\tchdir($oldDir);\n\t\terror_log(\"create_user_dir: Could not create user directory in \".FS_PATH,0);\n\t\treturn false;\n\t}\n}", "function get_usrfile($usrid){\r\n\t\r\n}", "function _getHpsaFileOwner($server_ip, $server_port, $username, $password)\n{\n\t//\n\t// Inputs: hpsa access info\n\t//\t$server_ip\n\t//\t$server_port\n\t//\t$username\n\t//\t$password\n\t// Output: \n\t//\t$fileOwner - sa_user_name\n\t//\n\t_log(\"getHpsaFileOwner: Starting.\",\"info\");\n\tglobal $hpmid, $ostype, $cmd_exitcode;\n\n\t$filesRootDir = \"/opsw/.Server.ID/$hpmid/files/\";\n\t$files = _execHpsaCmd($server_ip, $server_port, $username, $password, \"ls $filesRootDir\");\n\tif ($cmd_exitcode <> 0)\n\t{\n\t\t_log(\"getHpsaFileOwner: unable to find SA files owner.\",\"debug\");\n\t}\n\telse\n\t{\n\t\t$files_array = preg_split('/\\s+/', $files);\n\t\t_log(\"getHpsaFileOwner: files: $files.\",\"debug\");\n\t\tforeach ($files_array as $file)\n\t\t{\n\t\t\tif (($ostype == 'windows') ||($ostype == 'x64.win'))\n\t\t\t{\n\t\t\t\t$filePath = \"$filesRootDir\" . $file . \"/C/\";\n\t\t\t\t_log(\"getHpsaFileOwner: ostype: $ostype (windows).\",\"debug\");\n\t\t\t}\n\t\t\telseif (($ostype =='linux') || ($ostype == 'x64.linux'))\n\t\t\t{\n\t\t\t\t$filePath = \"$filesRootDir\" . $file . \"/\";\n\t\t\t\t_log(\"getHpsaFileOwner: ostype: $ostype (linux).\",\"debug\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$filePath = \"$filesRootDir\";\n\t\t\t\t_log(\"getHpsaFileOwner: ostype: $ostype (other).\",\"debug\");\n\t\t\t}\n\t\t\t\n\t\t\t_log(\"getHpsaFileOwner: file: $file.\",\"debug\");\n\t\t\t$osFiles = _execHpsaCmd($server_ip, $server_port, $username, $password, \"ls $filePath\");\n\t\t\t_log(\"getHpsaFileOwner: osFiles: $osFiles.\",\"debug\");\n\t\t\t_log(\"getHpsaFileOwner: cmd_exitcode: $cmd_exitcode.\",\"debug\");\n\t\t\tif (!empty($osFiles) && $cmd_exitcode == 0)\n\t\t\t{\n\t\t\t\t$filesOwner = $file;\n\t\t\t\t_log(\"getHpsaFileOwner: filesOwner: $filesOwner.\",\"debug\");\n\t\t\t\tbreak 1;\n\t\t\t}\n\t\t}\n\t}\n\t_log(\"getHpsaFileOwner: Exiting.\",\"info\");\n\treturn $filesOwner;\n}", "public function checkCLIuser() {}", "function create_user($user_accounts_file, $uname, $email, $password)\r\n{\r\n\tif(false === file_exists($user_accounts_file))\r\n\t{\r\n\t\ttrigger_error(\r\n\t\t\tsprintf(\r\n\t\t\t\t'The $user_accounts_file does not exist at the specified location: %s ',\r\n\t\t\t\t$user_accounts_file\r\n\t\t\t),\r\n\t\t\tE_USER_ERROR\r\n\t\t);\r\n\t\treturn false;\r\n\t}\r\n\treturn (bool)file_put_contents(\r\n\t\t$user_accounts_file,\r\n\t\tsprintf(\r\n\t\t\t\"%s|%s|%s\\r\\n\",\r\n\t\t\t$email,\r\n\t\t\t$uname,\r\n\t\t\t$password\r\n\t\t),\r\n\t\tFILE_APPEND\r\n\t);\r\n}", "function verify(){\r\n\r\n /*\r\n le chemin d'acces du fichier\r\n */\r\n \r\n \r\n \t $file=dirname(__DIR__).DIRECTORY_SEPARATOR.\"username\";\r\n $file2=dirname(__DIR__).DIRECTORY_SEPARATOR.\"password\";\r\n\r\n /*\r\n * cette condition verifie si les fichiers password et username sont crees\r\n * si c'est le cas on verifie leurs contenu\r\n * si le contenue est vide vous rester sur la page d'installation dans le cas contraitre vous avez access au dashboard admin\r\n \r\n *le contenu des fichier sera ainsi enregistre dans la base de donnee afin de faire des eventuelles comparaisons si il ya une modification des fichier\r\n */\r\n \r\n \t if (file_exists($file) and file_exists($file2)):\r\n $content=(string)file_get_contents($file);\r\n $content1=(string)file_get_contents($file2);\r\n if(empty($content) and empty($content1)):\r\n\r\n return false;\r\n\r\n else:\r\n return true;\r\n\r\n endif;\r\n\r\n endif;\r\n\r\n\r\n\r\n\r\n\r\n }", "function havp_check_system() {\n\tglobal $havp_config;\n\n\t/* Check/create user/group accounts */\n\t$grp = exec('/usr/sbin/pw group show ' . HVDEF_GROUP);\n\tif (strpos($grp, HVDEF_GROUP) !== 0) {\n\t\texec('/usr/sbin/pw group add ' . HVDEF_GROUP);\n\t\tlog_error(\"Antivirus: Group '\" . HVDEF_GROUP . \"' was added.\");\n\t}\n\t$usr = exec('/usr/sbin/pw usershow -n ' . HVDEF_USER);\n\tif (strpos($usr, HVDEF_USER) !== 0) {\n\t\texec('/usr/sbin/pw useradd ' . HVDEF_USER . ' -g ' . HVDEF_GROUP . ' -h - -s \"/sbin/nologin\" -d \"/nonexistent\" -c \"havp daemon\"');\n\t\tlog_error(\"Antivirus: User '\" . HVDEF_USER . \"' was added.\");\n\t}\n\n\t/* Workdir permissions */\n\thavp_set_file_access(HVDEF_WORK_DIR, HVDEF_USER, '');\n\n\t/* HAVP tempdir */\n\tif (!file_exists(HVDEF_HAVPTEMP_DIR)) {\n\t\tmwexec(\"/bin/mkdir -p \" . HVDEF_HAVPTEMP_DIR);\n\t}\n\thavp_set_file_access(HVDEF_HAVPTEMP_DIR, HVDEF_USER, '');\n\n\t/* ClamAV dbdir */\n\tif (!file_exists(HVDEF_CLAM_DBDIR)) {\n\t\tmwexec(\"/bin/mkdir -p \" . HVDEF_CLAM_DBDIR);\n\t}\n\thavp_set_file_access(HVDEF_CLAM_DBDIR, HVDEF_AVUSER, '');\n\n\t/* RAM tempdir */\n\tif (!file_exists(HVDEF_RAMTEMP_DIR)) {\n\t\tmwexec(\"/bin/mkdir -p \" . HVDEF_RAMTEMP_DIR);\n\t}\n\thavp_set_file_access(HVDEF_RAMTEMP_DIR, HVDEF_USER, '');\n\n\t/* Template directory and permissions */\n\tif (!file_exists(HVDEF_TEMPLATES_EX)) {\n\t\tmwexec(\"/bin/mkdir -p \" . HVDEF_TEMPLATES_EX);\n\t}\n\thavp_set_file_access(HVDEF_TEMPLATES, HVDEF_USER, '');\n\thavp_set_file_access(HVDEF_TEMPLATES_EX, HVDEF_USER, '');\n\n\t/* HAVP log dir */\n\tif (!file_exists(HVDEF_LOG_DIR)) {\n\t\tmwexec(\"/bin/mkdir -p \" . HVDEF_LOG_DIR);\n\t}\n\thavp_set_file_access(HVDEF_LOG_DIR, HVDEF_USER, '');\n\t/* Create log files if needed */\n\tif (!file_exists(HVDEF_HAVP_ACCESSLOG)) {\n\t\tfile_put_contents(HVDEF_HAVP_ACCESSLOG, '');\n\t}\n\tif (!file_exists(HVDEF_HAVP_ERRORLOG)) {\n\t\tfile_put_contents(HVDEF_HAVP_ERRORLOG, '');\n\t}\n\t/* Log dir permissions */\n\thavp_set_file_access(HVDEF_LOG_DIR, HVDEF_USER, '0764');\n\n\t/* PID file */\n\tif (!file_exists(HVDEF_PID_FILE)) {\n\t\tfile_put_contents(HVDEF_PID_FILE, '');\n\t}\n\thavp_set_file_access(HVDEF_PID_FILE, HVDEF_USER, '0664');\n\n\t/* freshclam config permissions */\n\tif (!file_exists(HVDEF_FRESHCLAM_CONF)) {\n\t\tfile_put_contents(HVDEF_FRESHCLAM_CONF, '');\n\t}\n\thavp_set_file_access(HVDEF_FRESHCLAM_CONF, HVDEF_AVUSER, '0664');\n\n\t/* AV log dir */\n\tif (!file_exists(HVDEF_AVLOG_DIR)) {\n\t\tmwexec(\"mkdir -p \" . HVDEF_AVLOG_DIR);\n\t}\n\thavp_set_file_access(HVDEF_AVLOG_DIR, HVDEF_USER, '');\n\n\t/* Create AV log files if needed */\n\tif (!file_exists(HVDEF_CLAM_LOG)) {\n\t\tfile_put_contents(HVDEF_CLAM_LOG, '');\n\t}\n\tif (!file_exists(HVDEF_FRESHCLAM_LOG)) {\n\t\tfile_put_contents(HVDEF_FRESHCLAM_LOG, '');\n\t}\n\t/* Log dir permissions */\n\thavp_set_file_access(HVDEF_AVLOG_DIR, HVDEF_USER, '0777');\n\n\t/* ClamAV */\n\t/* Directory for pid and socket files */\n\tif (!file_exists(HVDEF_CLAM_RUNDIR)) {\n\t\tmwexec(\"mkdir -p \" . HVDEF_CLAM_RUNDIR);\n\t}\n\thavp_set_file_access(HVDEF_CLAM_RUNDIR, HVDEF_USER, '0774');\n\n\t/* AV update script */\n\tfile_put_contents(HVDEF_AVUPD_SCRIPT, havp_AVupdate_script());\n\thavp_set_file_access(HVDEF_AVUPD_SCRIPT, HVDEF_AVUSER, '0755');\n\n\t/* AV update notification script */\n\t// file_put_contents(HVDEF_ON_AVUPD_SCRIPT, havp_on_avupd_script());\n\t// havp_set_file_access(HVDEF_ON_AVUPD_SCRIPT, HVDEF_AVUSER, '0755');\n\n\t/* Startup scripts (HAVP and clamd) */\n\thavp_startup_script();\n\thv_clamd_startup_script();\n\n\t/* mount RAMDisk */\n\tmountRAMdisk(true);\n}", "function CreateAndCheckConnFile($fileName) {\n\n global $SUB_DIRECTORY;\n\n if (file_exists($fileName)){\n $newFile = @fopen($fileName, 'a');\n if($newFile)\n fclose($newFile);\n else\n echo \"<b>Error</b>: Failed to open ($fileName) file: Permission denied.\";\n \n }\n else{\n if(!is_dir($SUB_DIRECTORY)){\n mkdir($SUB_DIRECTORY);\n }\n $newFile = @fopen($fileName, 'w');\n if($newFile){\n fwrite($newFile, \"<?php echo 'Devart HTTP tunnel temporary file.'; exit; ?>\\r\\n\"); // forbid viewing this file through browser\n fclose($newFile);\n }\n else\n echo \"<b>Error</b>: Failed to create ($fileName) file: Permission denied.\";\n }\n \n if(!$newFile)\n exit;\n}", "function checkUser(){\n global $OPTION;\n if ('root' == trim(`whoami`)) {\n $OPTION['isRoot'] = true;\n }else{\n echo 'You have to exec command as root, but you loged in as ' . `whoami` . PHP_EOL;\n exit;\n };\n return true;\n}", "function file_authenticate($user, $password)\n{\n global $UP_config;\n $pwdhandle = fopen($UP_config['file_location'], \"r\");\n $pattern = \"/^$user:([^:]+):([^:]+)/\";\n $found = 0;\n\n if ($pwdhandle)\n {\n $matches = array();\n while(!feof($pwdhandle))\n {\n $line = trim(fgets($pwdhandle));\n if ($found = preg_match($pattern, $line, $matches) == 1) break;\n }\n\n if ($found)\n {\n # SJC Need PHP 5.5 for password_verify so use own rolled equiv\n $pwdhash = $matches[2];\n if (SC_password_verify($password, $pwdhash))\n {\n $gecos = trim($matches[1]);\n # If authenticated we must return something non null.\n if (empty($gecos)) $gecos = '(no name)';\n return $gecos;\n }\n }\n }\n return NULL;\n}", "function havp_set_file_access($dir, $owner, $mod) {\n\tif (file_exists($dir)) {\n\t\tmwexec(\"/usr/bin/chgrp -R -v $owner $dir\");\n\t\tmwexec(\"/usr/sbin/chown -R -v $owner $dir\");\n\t\tif (!empty($mod)) {\n\t\t\tmwexec( \"/bin/chmod -R -v $mod $dir\");\n\t\t}\n\t}\n}", "function fm_get_user_dir_space($userid = NULL) {\r\n\tglobal $USER;\r\n\t\r\n\tif ($userid == NULL) {\r\n\t\t$userid = $USER->id;\r\n\t}\r\n\t\r\n\treturn \"file_manager/users/$userid\";\r\n}", "function createUserFile( $content = '', $name = '', $user_ID = 1 )\r\n\t{\r\n\t\tglobal $FileRootCache;\r\n\r\n\t\t$FileRoot = & $FileRootCache->get_by_type_and_ID( 'user', $user_ID, true );\r\n\r\n\t\tif( ! $FileRoot )\r\n\t\t{\r\n\t\t\t$this->my_skip_message( 'Cannot get FileRoot for user #'.$user_ID );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif( empty($name) )\r\n\t\t{\r\n\t\t\t$name = basename( tempnam( $FileRoot->ads_path, 'TMP' ) );\r\n\t\t}\r\n\r\n\t\treturn $this->createFile( $FileRoot->ads_path.$name, $content );\r\n\t}", "private function usr(){\r\n\r\n if(defined(\"USER_ID\")){ return true;}else{return false;}\r\n\r\n }", "function has_account()\n{\n return file_exists(DEFAULT_ACCOUNTFILE);\n}", "function permissions_grant_user ($user, $dir, $file, $action)\n{\n\t$permissions = user_get_permissions($user);\n\n\t// determine the permission definitions\n\t$permdefs = permissions_get();\n\n\t// the user with the name \"admin\" always has admin rights\n\tif ($action == \"admin\" && $user == \"admin\")\n\t\treturn true;\n\n\t// check if the action is allowed\n\treturn ($permdefs[$action] & $permissions) != 0;\n}", "function usrdel($no,$pwd){\n global $path,$pwdc,$onlyimgdel;\n $host = gethostbyaddr($_SERVER[\"REMOTE_ADDR\"]);\n $delno = array(\"dummy\");\n $delflag = false;\n reset($_POST);\n while ($item = each($_POST)){\n if($item[1]=='delete'){\n array_push($delno,$item[0]);\n $delflag=true;\n }\n }\n\n if($pwd==\"\"&&$pwdc!=\"\"){\n $pwd=$pwdc;\n }\n\n $fp=fopen(LOGFILE,\"r+\");\n set_file_buffer($fp, 0);\n flock($fp, 2);\n rewind($fp);\n $buf=fread($fp,1000000);\n fclose($fp);\n\n if($buf==''){\n error(\"error user del\");\n }\n\n $line = explode(\"\\n\",$buf);\n $countline=count($line);\n\n for($i = 0; $i < $countline; $i++){\n if($line[$i]!=\"\"){\n $line[$i].=\"\\n\";\n };\n }\n\n $flag = false;\n $countline=count($line)-1;\n for($i = 0; $i<$countline; $i++){\n list($dno,,,,,,,$dhost,$pass,$dext,,,$dtim,) = explode(\",\", $line[$i]);\n if(array_search($dno,$delno) && (substr(md5($pwd),2,8) == $pass || $dhost == $host||ADMIN_PASS==$pwd)){\n $flag = true;\n $line[$i] = \"\";\t\t\t//パスワードがマッチした行は空に\n $delfile = $path.$dtim.$dext;\t//削除ファイル\n if(!$onlyimgdel){\n treedel($dno);\n }\n if(is_file($delfile)){\n unlink($delfile);//削除\n }\n if(is_file(THUMB_DIR.$dtim.'s.jpg')){\n unlink(THUMB_DIR.$dtim.'s.jpg');//削除\n }\n }\n }\n if(!$flag){\n error(\"該当記事が見つからないかパスワードが間違っています\");\n }\n}", "function write_hardcode($con, $db_user, $db_pass, $db_prefix, $admin_pass, $use_cookie) {\n $filepath = \"../hardcode.php\";\n \n file_put_contents(\"../cache/perm/request.001\", \"0\");\n\n\n $data = '<?php\n/* Data base details */\n$dsn=\\'' . $con . '\\'; //DSN\n$db_user=\\'' . $db_user . '\\'; //DB username\n$db_pass=\\'' . $db_pass . '\\'; //DB password \n$driver=\\'' . $_SESSION[\"cms\"] . '\\'; //Integration driver\n$db_prefix=\\'' . $db_prefix . '\\'; //prefix used for tables in database\n$uid=\\'' . uniqid() . '\\'; //Any random unique number\n\n$PATH = \\'' . $_SESSION[\"freichat_renamed\"] . '/\\'; // Use this only if you have placed the freichat folder somewhere else\n$installed=true; //make it false if you want to reinstall freichat\n$admin_pswd=\\'' . $admin_pass . '\\'; //backend password \n\n$debug = false;\n$custom_error_handling=\\'NO\\'; // used during custom installation\n\n$use_cookie='.$use_cookie.';\n\n/* email plugin */\n$smtp_username = \\'\\';\n$smtp_password = \\'\\';\n\n$force_load_jquery = \\'NO\\';\n\n/* Custom driver */\n$usertable=\\'login\\'; //specifies the name of the table in which your user information is stored.\n$row_username=\\'root\\'; //specifies the name of the field in which the user\\'s name/display name is stored.\n$row_userid=\\'loginid\\'; //specifies the name of the field in which the user\\'s id is stored (usually id or userid)\n$avatar_field_name = \\'avatar\\';';\n\n file_put_contents($filepath, $data);\n}", "function create_htpasswd($username,$password) {\n\n\t$encrypted_password = crypt($password, base64_encode($password));\n\t$data = $username.\":\".$encrypted_password;\n\t\t\t\t\t\n\t$ht = fopen(\"administration/.htpasswd\", \"w\") or die(\"<div class=\\\"installer-message\\\">Could not open .htpassword for writing. Please make sure that the server is allowed to write to the administration folder. In Apache, the folder should be chowned to www-data. </div>\");\n\tfwrite($ht, $data);\n\tfclose($ht);\n}", "public function filecheck() {\r\n\t\treturn md5($this->get('file').$this->config->get('secret').date('Y-m-d'));\r\n\t}", "private function avatarCheck( string $path, int $user_id, string $username, string $hex ): void\n {\n $folder = $_SERVER['DOCUMENT_ROOT'] . $path;\n $file = $folder . $user_id . '.jpg';\n if ( file_exists($file) )\n return; // File is found, nothing to do\n \n $avatar = $this->tg->getAvatar( $user_id );\n if ( !$avatar ) { // No avatar, make new one\n $img = new Image_Gen();\n $avatar = $img->makeAvatar( $username, $hex );\n }\n\n $this->mkdirIfNotExist($folder);\n file_put_contents( $file, $avatar );\n chmod( $file, 0664 );\n }", "function rex_com_mediaaccess_ImageManager_checkPerm($filename, $ADDONSsic)\n{\n global $REX;\n \n if($filename)\n {\n ## get auth - isn't loaded yet\n $REX['ADDON']['community']['plugin_auth'] = $ADDONSsic['community']['plugin_auth'];\n require_once $REX[\"INCLUDE_PATH\"].\"/addons/community/plugins/auth/inc/auth.php\";\n \n $media = rex_com_mediaaccess::getMediaByFilename($filename);\n if(!$media->checkPerm())\n exit;\n }\n}", "function actual($name,$ip,$user,$pwd){\n\t $command = escapeshellcmd('sudo -u root nohup /usr/bin/python /var/www/html/hids/python/programme.py '.$name.' '.$ip.' '.$user.' '.$pwd.' &');\n\t passthru($command);\n\t //$output = exec($command);\n\t $output = true;\n if($output!=null){\n //echo $output;\n }else{\n echo \"erreur sur l'actualisation des erreurs.\";\n }\n }", "private function isFileOwner($id){\n $query = \\Drupal::database()->select('ol_file', 'fr');\n $query->addField('fr', 'user_id');\n $query->condition('fr.id', $id);\n $uid = $query->execute()->fetchField();\n return ($uid == $this->current_user->id());\n }", "function drush_sandwich_make_me_a_sandwich_validate() {\n if (drush_is_windows()) {\n // $name = drush_get_username();\n // TODO: implement check for elevated process using w32api\n // as sudo is not available for Windows\n // http://php.net/manual/en/book.w32api.php\n // http://social.msdn.microsoft.com/Forums/en/clr/thread/0957c58c-b30b-4972-a319-015df11b427d\n }\n else {\n $name = posix_getpwuid(posix_geteuid());\n if ($name['name'] !== 'root') {\n return drush_set_error('MAKE_IT_YOUSELF', dt('What? Make your own sandwich.'));\n }\n }\n}", "function watchfile() {\n\t\tglobal $user;\n\n\t\treturn \"temp/dbg-watch.\" . $user;\n\t}", "protected function action_getUserMainDir() {}", "public function userExists( $uid ){\n\t\t$dir = OC_Config::getValue( \"datadirectory\", OC::$SERVERROOT.\"/data\" ) . '/' . $uid . \"/files\";\n\t\treturn file_exists($dir);\n\t}", "function unix2($command,$dir)\n{\n $rndhandle = fopen(\"/dev/urandom\",\"r\");\n $RND = fread($rndhandle,20);\n fclose($rndhandle);\n $FILENAME = $dir.\"/\".sha1($RND);\n $handle = popen(\"$command > \".$FILENAME.\" 2> \".$FILENAME, 'r');\n $res = fread($handle, 20000000);\n pclose($handle);\n $handle = fopen($FILENAME, \"r\");\n $text = fread($handle,20000000);\n fclose($handle);\n // destroy content of the plain text file\n unix(\"dd if=/dev/zero of=\".$FILENAME.\" bs=1 count=\".strlen($text));\n unix(\"sync\");\n unix(\"rm \".$FILENAME);\n return $text;\n}", "public function testChangeOwner() {\n\t\tif (!function_exists('posix_getpwuid') || false === posix_getpwuid(1)) {\n\t\t\t$this->markTestSkipped(\n\t\t\t\t'Either the posix_getpwuid() function is not available, or there is no user with UID of 1');\n\t\t}\n\n\t\t$file = 'test.txt';\n\t\t$fullPath = $this->testBasePath . $file;\n\n\t\ttouch($fullPath);\n\n\t\t$this->assertTrue(file_exists($fullPath), 'Precondition failed. Unable to create test file: ' . $fullPath);\n\t\t$this->assertEquals(0, fileowner($fullPath), 'Precondition failed. Invalid owner for new file.');\n\t\tclearstatcache();\n\t\t$this->assertTrue(file_exists($fullPath), 'Precondition failed. Unable to create test file: ' . $fullPath);\n\t\t$this->assertEquals(0, fileowner($fullPath), 'Precondition failed. Invalid owner for new file.');\n\n\t\tclearstatcache();\n\n\t\t$this->fileHandler->changeOwner($fullPath, null, 1);\n\t\t$this->assertEquals(1, fileowner($fullPath), 'Failed to change owner of the test file');\n\n\t\tclearstatcache();\n\n\t\t$this->fileHandler->changeOwner($fullPath, 1, 1);\n\t\t$this->assertEquals(1, filegroup($fullPath), 'Failed to change group of the test file');\n\t\t$this->assertEquals(1, fileowner($fullPath), 'Invalid user set for file when changing both group and user');\n\n\t\tclearstatcache();\n\n\t\t$this->fileHandler->changeOwner($fullPath, 0);\n\t\t$this->assertEquals(0, filegroup($fullPath), 'Failed to change group of the test file');\n\t\t$this->assertEquals(1, fileowner($fullPath), 'Changing only the group should not change the owner of a file');\n\t}", "function check(){\r\n if ( file_get_contents(sys_get_temp_dir().\"/{$this->file_name}\") != 'run' ) {\r\n exit('Script was canceled by file deletion.') ;\r\n }\r\n }", "function test_temp_dir() \n{\n\tglobal $config;\n\n\treturn is_writable($config['temp_dir']);\n}", "function mysql_auth_usermanagement()\n{\n return 1;\n}", "function N_writable($pathfile) {\r\n\t//fix windows acls bug\r\n\t$isDir = substr($pathfile,-1)=='/' ? true : false;\r\n\tif ($isDir) {\r\n\t\tif (is_dir($pathfile)) {\r\n\t\t\tmt_srand((double)microtime()*1000000);\r\n\t\t\t$pathfile = $pathfile.'pw_'.uniqid(mt_rand()).'.tmp';\r\n\t\t} elseif (@mkdir($pathfile)) {\r\n\t\t\treturn N_writable($pathfile);\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t@chmod($pathfile,0777);\r\n\t$fp = @fopen($pathfile,'ab');\r\n\tif ($fp===false) return false;\r\n\tfclose($fp);\r\n\t$isDir && @unlink($pathfile);\r\n\treturn true;\r\n}", "public function getOwner()\n\t{\n\t\t$command='stat -c %U' . sprintf(' \"%s\"', $this->getFullPath());\n\t\t$user=$this->executeCommand($command);\n\t\treturn $user;\n }", "function cvs_add_user($cvs_user, $cvs_pass, $cvs_project) {\r\n global $cvs_owner;\r\n\r\n $all_cvs_users = cvs_read_passwd($cvs_project);\r\n\r\n $cvs_fields = $all_cvs_users[$cvs_user];\r\n\r\n if (is_null($cvs_fields)) {\r\n\t$cvs_fields[0] = $cvs_pass;\r\n\t$cvs_fields[1] = $cvs_owner;\r\n\t$all_cvs_users[$cvs_user] = $cvs_fields;\r\n\tcvs_write_file($all_cvs_users, $cvs_project);\r\n\tcvs_log(1, \"Added user $cvs_user\");\r\n } else {\r\n\tcvs_log(3, \"User $cvs_user already exists\");\r\n }\r\n}", "function test_config()\n{\n\treturn is_writable('includes/config.php');\n}", "function check_user($user)\n\t\t{\n\n\t\t}", "function perms($file) {\n$perms = fileperms($file);\n\nif (($perms & 0xC000) == 0xC000) {\n // Socket\n $info = 's';\n} elseif (($perms & 0xA000) == 0xA000) {\n // Symbolic Link\n $info = 'l';\n} elseif (($perms & 0x8000) == 0x8000) {\n // Regular\n $info = '-';\n} elseif (($perms & 0x6000) == 0x6000) {\n // Block special\n $info = 'b';\n} elseif (($perms & 0x4000) == 0x4000) {\n // Directory\n $info = 'd';\n} elseif (($perms & 0x2000) == 0x2000) {\n // Character special\n $info = 'c';\n} elseif (($perms & 0x1000) == 0x1000) {\n // FIFO pipe\n $info = 'p';\n} else {\n // Unknown\n $info = 'u';\n}\n\n// Owner\n$info .= (($perms & 0x0100) ? 'r' : '-');\n$info .= (($perms & 0x0080) ? 'w' : '-');\n$info .= (($perms & 0x0040) ?\n (($perms & 0x0800) ? 's' : 'x' ) :\n (($perms & 0x0800) ? 'S' : '-'));\n\n// Group\n$info .= (($perms & 0x0020) ? 'r' : '-');\n$info .= (($perms & 0x0010) ? 'w' : '-');\n$info .= (($perms & 0x0008) ?\n (($perms & 0x0400) ? 's' : 'x' ) :\n (($perms & 0x0400) ? 'S' : '-'));\n\n// World\n$info .= (($perms & 0x0004) ? 'r' : '-');\n$info .= (($perms & 0x0002) ? 'w' : '-');\n$info .= (($perms & 0x0001) ?\n (($perms & 0x0200) ? 't' : 'x' ) :\n (($perms & 0x0200) ? 'T' : '-'));\n return $info;\n}", "function ModifMiniPassUser( $passUser ){\r\n return md5($passUser);\r\n}", "function anadir_usuario(){\n // If $certificate is set, public key has been successfully received\n $certificate = get_certificate();\n if ($certificate != \"\") {\n // Check if certificate syntax is correct\n if(check_certificate($certificate)) {\n $name = get_remote_user();\n $response = doit($name, $certificate);\n // Check if command executed successfully\n if($response)\n return 1;\n else \n return -2;\n } else {\n return -1;\n }\n }\n else return -3;\n}", "function logonscreener_file_cache(&$file) {\n $directory = str_replace('\\\\', '/', rtrim(sys_get_temp_dir(), '/\\\\'));\n $filename = pathinfo($file, PATHINFO_FILENAME);\n $tmp_file = \"$directory/logonscreener $filename.jpg\";\n logonscreener_log(\"Temporary file: $tmp_file\");\n\n if (is_file($tmp_file)) {\n $file = $tmp_file;\n logonscreener_log('Cached file exists.');\n return FALSE;\n }\n\n return $tmp_file;\n}", "protected function allowBeUser($hash) {\n\t\t$workingDirectory = preg_replace('#/+$#', '', $this->extensionConfiguration['workingDirectory']) . '/be/';\n\t\t\n\t\tif (!preg_match('#^/#', $workingDirectory)) {\n\t\t\t$workingDirectory = PATH_site . $workingDirectory;\n\t\t}\n\t\t\n\t\tif (!is_dir($workingDirectory)) {\n\t\t\t@mkdir($workingDirectory, octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask']), true);\n\t\t}\n\t\t\n\t\ttouch($workingDirectory . $hash);\n\t}", "public static function check_file_remote_authorization($user = NULL)\n\t\t{\n\t\t\tforeach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;\n\t\t\tdo_action('ws_plugin__s2member_before_check_file_remote_authorization', get_defined_vars());\n\t\t\tunset($__refs, $__v); // Housekeeping.\n\n\t\t\t$_g = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep(!empty($_GET) ? $_GET : array()));\n\n\t\t\tif(!is_object($user) && isset($_g['s2member_file_remote']) && filter_var($_g['s2member_file_remote'], FILTER_VALIDATE_BOOLEAN))\n\t\t\t{\n\t\t\t\tdo_action('ws_plugin__s2member_during_check_file_remote_authorization_before', get_defined_vars());\n\n\t\t\t\tif((empty($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER'] === 'NOUSER') && !empty($_SERVER['HTTP_AUTHORIZATION']))\n\t\t\t\t{\n\t\t\t\t\t$auth = trim(preg_replace('/^.+?\\s+/', '', $_SERVER['HTTP_AUTHORIZATION']));\n\t\t\t\t\t$auth = explode(':', base64_decode($auth), 2);\n\n\t\t\t\t\tif(!empty($auth[0])) $_SERVER['PHP_AUTH_USER'] = $auth[0];\n\t\t\t\t\tif(!empty($auth[1])) $_SERVER['PHP_AUTH_PW'] = $auth[1];\n\t\t\t\t}\n\t\t\t\tif(empty($_SERVER['PHP_AUTH_USER']) || empty($_SERVER['PHP_AUTH_PW']) || !user_pass_ok($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']))\n\t\t\t\t{\n\t\t\t\t\theader('WWW-Authenticate: Basic realm=\"'.c_ws_plugin__s2member_utils_strings::esc_dq(strip_tags(_x('Members Only', 's2member-front', 's2member'))).'\"');\n\n\t\t\t\t\tstatus_header(401); // Send an unauthorized 401 status header now.\n\t\t\t\t\theader('Content-Type: text/html; charset=UTF-8'); // Content-Type with UTF-8.\n\t\t\t\t\twhile(@ob_end_clean()) ; // Clean any existing output buffers.\n\n\t\t\t\t\texit(_x('<strong>401:</strong> Sorry, access denied.', 's2member-front', 's2member'));\n\t\t\t\t}\n\t\t\t\telse if(is_object($_user = new WP_User($_SERVER['PHP_AUTH_USER'])) && !empty($_user->ID))\n\t\t\t\t\t$user = $_user; // Now assign ``$user``.\n\n\t\t\t\tdo_action('ws_plugin__s2member_during_check_file_remote_authorization_after', get_defined_vars());\n\t\t\t}\n\t\t\treturn apply_filters('ws_plugin__s2member_check_file_remote_authorization', $user, get_defined_vars());\n\t\t}", "function file_reader($file, $password)\n{\n $fileOpen = fopen($file, 'r');\n if ((bool) $fileOpen == FALSE || filesize($file) == 0)\n echo \"content.php: $argv: Cannot open file\\n\";\n else\n {\n $stringFile = fread($fileOpen, filesize($file));\n $encryptFile = openssl_encrypt($stringFile, 'aes128', $password);\n $fileCut = file_cutter($encryptFile);\n fclose($fileOpen);\n return($fileCut);\n }\n}", "function checkAccess() ;", "function cemhub_check_htaccess_in_private_system_path($set_message = TRUE) {\n $is_created = FALSE;\n\n $file_private_path = variable_get('file_private_path', FALSE);\n if ($file_private_path) {\n file_create_htaccess('private://', TRUE);\n\n if (file_exists($file_private_path . '/.htaccess')) {\n $is_created = TRUE;\n }\n elseif ($set_message) {\n drupal_set_message(t(\"Security warning: Couldn't write .htaccess file.\"), 'warning');\n }\n }\n\n return $is_created;\n}", "public function documentCheckContentPage() {\n $user = User::load(\\Drupal::currentUser()->id());\n bhge_user_registration_user_login($user);\n\n }", "function updateExternalDB($user) {\r\n\t\t// Not doing anything here (yet?)\r\n\t\treturn true;\r\n\t}", "function checkExist(){\n GLOBAL $force,$tag,$checkfile;\n\n if(!$force && file_exists($checkfile)){\n $lastcommit = file_get_contents($checkfile);\n if($lastcommit == $tag) return true;\n }\n \n file_put_contents($checkfile, $tag);\n}", "function ipcObjSetpass($fp, $type, $user, $pass, &$err)\n{\n\tfputs($fp, \"ALTER OBJECT \" . $type . \" \" . $user . \" PASS \" . $pass . \"\\n\");\n####\n\tsleep(1);\n\twhile(1) {\n\t\t$l = fgets($fp, 1025);\n\t\tif (feof($fp)) {\n\t\t\t$err = \"Unable to set password.\";\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (empty($l)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$x = split(' ', trim($l));\n\t\t#echo \"[\" . trim($l) . \"]<br>\\n\";\n\n\t\tif ($x[0] == \"OK\" && $x[1] == \"ALTER\" && $x[2] == \"OBJECT\") {\n\t\t\t# echo \"Authentication successful.\\n\";\n\t\t\treturn 1;\n\t\t} else if ($x[0] == \"OK\" || $x[0] == \"YOU\") {\n\t\t} else if ($x[0]) {\n\t\t\t$err = \"Internal error\\n\";\n\t\t\treturn 0;\n\t\t}\n\t}\n}", "function update_file($filename, $content) {\r\n\tif (file_put_contents(DIR_DATABASE.$filename, $content, LOCK_EX) === false\r\n\t\t|| strcmp(file_get_contents(DIR_DATABASE.$filename), $content) != 0)\r\n\t{\r\n\t\tdie('Enable to write file “'. DIR_DATABASE.$filename.'”');\r\n\t}\r\n}", "function createLockFile($file=null){\n $lockFile = ($file!='') ? $file : LOCKFILE;\n if(file_exists($lockFile)){\n print \"detected lockfile at {$lockFile} ... exiting\\n\";\n exit;\n } else {\n // Write a lockfile so we prevent other runs while we are running\n file_put_contents($lockFile, 1);\n }\n}", "function checkPermissions($userToCheck, $loggedInUser=null){\r\n\tif($loggedInUser == null){\r\n\t\t//...ask the session for the currently logged in user\r\n\t\t$loggedInUser = $_SESSION['userName'];\r\n\t}\r\n\t//If the logged in user is not the passed in user, and not a superuser...\r\n\tif(strcasecmp($loggedInUser, $userToCheck) != 0 && !isSuperUser($loggedInUser)){\r\n\t\t\t//This user did not enter the data and therefore may not edit it.\r\n\t\t\tdie (\"You do not have the rights to modify or remove this data.\");\r\n\t\t}\r\n}", "function checkUserName()\r\n{\r\n\t// --------- GLOBALIZE ---------\r\n\tglobal $user,$utf8;\r\n\t// --------- CHECK ---------\r\n\t$name = $utf8->toUTF8(GET_INC('name'));\r\n\tif ( $user->uname_exist($name) )\r\n\t{\r\n\t\techo 1;\r\n\t}else{\r\n\t\techo 0;\r\n\t}\r\n}", "function chkExist($user){\n\tglobal $dbLink;\n\t\n\t$sqlChkExist = \"SELECT uid FROM users WHERE uid='$user'\";\n\t\n\t$dbLink->query($sqlChkExist);\n\t$rows = $dbLink->affected_rows;\n\t\n\tif($rows == 1){\n\t\t$ok==0;\n\t}\n\telse{\n\t\t\t\t\t\t\t$_SESSION['error_message'] = \"The user does not exist\";\n\t\t\t\t\t\t\theader(\"Location: ../admin.php\");\n\t\t\t\t\t\t\tdie();\n\t}\n}", "public function modifpassword($user,$passwd){\n \n }", "function check_cache ($cache_dir, $quality, $zoom_crop) {\n if(!file_exists($cache_dir)) {\n // give 777 permissions so that developer can overwrite\n // files created by web server user\n mkdir($cache_dir);\n chmod($cache_dir, 0777);\n }\n\n show_cache_file($cache_dir, $quality, $zoom_crop);\n}", "public function checkPriv($file, $user = 0)\n {\n if(!$user) $user = $this->session->user->account;\n if($file->addedBy == $user or $this->session->userinfo->roleid != 'student') return true;\n else\n return false;\n }", "function user_get_basedir($username) {\n global $_CONFIG;\n if(user_validate_name($username)) {\n return realpath($_CONFIG['UserBase']) . '/' . $username;\n } else {\n trigger_error(\"user_get_basedir(): Illegal username!\", E_USER_WARNING);\n return false;\n }\n}", "function updateExternalDB($user) {\n return true;\n }", "function create_account($uname, $pwd) {\n $account_info = \"{$uname}:{$pwd}\\n\";\n add_item_to_file(\"users.txt\", $account_info);\n }", "function structureAdmin_permanentFile($files) {\n $status = FALSE;\n\n try {\n foreach ($admin['files'] as $file) {\n $fid = variable_get($file, '');\n if (isset($fid) && !empty($fid)) {\n $file = file_load($fid);\n if ($file->status == 0) {\n $file->status = FILE_STATUS_PERMANENT;\n file_save($file);\n file_usage_add($file, $admin['module'], $admin['module'], 1);\n }//end if\n }//end if\n }//end foreach\n $status = TRUE;\n } catch ( Exception $e){\n $error = $e->getMessage;\n watchdog('Admin Permanent Files ', 'Error message :%message', array('%message' => $error) );\n }//end try\n\n return $status;\n}", "function user_login ($username, $password) {\n global $CFG, $DB;\n\t$program = $this->config->program;\n\t$handle = popen($program, 'w');\n\tfwrite($handle, \"$username\\n$password\\n\");\n\tfflush($handle);\n\t$result = pclose($handle);\n return $result == 0;\n }", "function tempdir()\n\t{\n\t\tif(is_writable(sys_get_temp_dir())) {\n\t\t\treturn sys_get_temp_dir();\n\t\t}\n\t\telse if(is_writable(Site::get_dir('user'))) {\n\t\t\tif(is_dir(Site::get_dir('user') . \"/hpm_tmp\")) {\n\t\t\t\treturn Site::get_dir('user') . \"/hpm_tmp\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmkdir(Site::get_dir('user') . \"/hpm_tmp\", 0755, true);\n\t\t\t\tif(is_dir(Site::get_dir('user') . \"/hpm_tmp\")) {\n\t\t\t\t\treturn Site::get_dir('user') . \"/hpm_tmp\";\n\t\t\t\t}\n\t\t\t\telse return false;\n\t\t\t}\n\t\t}\n\t\telse return false;\n\t}", "function storage_can_set($sv_user) {\n $allowed = ((api_is_platform_admin()) || ($sv_user == api_get_user_id()));\n if (!$allowed) {\n print \"ERROR : Not allowed\";\n }\n return $allowed;\n}", "function check_user() {\n\treturn false; // update allowed\n\treturn true; //no update allowed\n}", "function usernameInUse($User){\r\n $inUse = false;\r\n // santise user input to prevent XSS attack (removes any html elements)\r\n $filteredUser = filter_var($User, FILTER_SANITIZE_STRING);\r\n $file = fopen(\"../login.txt\", \"r\") or die(\"unable to open file!\");\r\n while((! feof($file)) && ($inUse == false)) {\r\n //check username against the credential provided\r\n $storedUsername = fgets($file);\r\n //read password line so it moves on to next username\r\n fgets($file);\r\n if((trim($filteredUser) == trim($storedUsername)))\r\n {\r\n // state the username is in use\r\n $inUse = true;\r\n }\r\n }\r\n fclose($file);\r\n return $inUse;\r\n}", "function phpbb_chmod($filename, $perms = CHMOD_READ)\n{\n\tstatic $_chmod_info;\n\n\t// Return if the file no longer exists.\n\tif (!file_exists($filename))\n\t{\n\t\treturn false;\n\t}\n\n\t// Determine some common vars\n\tif (empty($_chmod_info))\n\t{\n\t\tif (!function_exists('fileowner') || !function_exists('filegroup'))\n\t\t{\n\t\t\t// No need to further determine owner/group - it is unknown\n\t\t\t$_chmod_info['process'] = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tglobal $root_path, $phpEx;\n\n\t\t\t// Determine owner/group of common.php file and the filename we want to change here\n\t\t\t$common_php_owner = @fileowner($phpbb_root_path . 'index.' . $phpEx);\n\t\t\t$common_php_group = @filegroup($phpbb_root_path . 'index.' . $phpEx);\n\n\t\t\t// And the owner and the groups PHP is running under.\n\t\t\t$php_uid = (function_exists('posix_getuid')) ? @posix_getuid() : false;\n\t\t\t$php_gids = (function_exists('posix_getgroups')) ? @posix_getgroups() : false;\n\n\t\t\t// If we are unable to get owner/group, then do not try to set them by guessing\n\t\t\tif (!$php_uid || empty($php_gids) || !$common_php_owner || !$common_php_group)\n\t\t\t{\n\t\t\t\t$_chmod_info['process'] = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_chmod_info = array(\n\t\t\t\t\t'process'\t\t=> true,\n\t\t\t\t\t'common_owner'\t=> $common_php_owner,\n\t\t\t\t\t'common_group'\t=> $common_php_group,\n\t\t\t\t\t'php_uid'\t\t=> $php_uid,\n\t\t\t\t\t'php_gids'\t\t=> $php_gids,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($_chmod_info['process'])\n\t{\n\t\t$file_uid = @fileowner($filename);\n\t\t$file_gid = @filegroup($filename);\n\n\t\t// Change owner\n\t\tif (@chown($filename, $_chmod_info['common_owner']))\n\t\t{\n\t\t\tclearstatcache();\n\t\t\t$file_uid = @fileowner($filename);\n\t\t}\n\n\t\t// Change group\n\t\tif (@chgrp($filename, $_chmod_info['common_group']))\n\t\t{\n\t\t\tclearstatcache();\n\t\t\t$file_gid = @filegroup($filename);\n\t\t}\n\n\t\t// If the file_uid/gid now match the one from common.php we can process further, else we are not able to change something\n\t\tif ($file_uid != $_chmod_info['common_owner'] || $file_gid != $_chmod_info['common_group'])\n\t\t{\n\t\t\t$_chmod_info['process'] = false;\n\t\t}\n\t}\n\n\t// Still able to process?\n\tif ($_chmod_info['process'])\n\t{\n\t\tif ($file_uid == $_chmod_info['php_uid'])\n\t\t{\n\t\t\t$php = 'owner';\n\t\t}\n\t\telse if (in_array($file_gid, $_chmod_info['php_gids']))\n\t\t{\n\t\t\t$php = 'group';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Since we are setting the everyone bit anyway, no need to do expensive operations\n\t\t\t$_chmod_info['process'] = false;\n\t\t}\n\t}\n\n\t// We are not able to determine or change something\n\tif (!$_chmod_info['process'])\n\t{\n\t\t$php = 'other';\n\t}\n\n\t// Owner always has read/write permission\n\t$owner = CHMOD_READ | CHMOD_WRITE;\n\tif (is_dir($filename))\n\t{\n\t\t$owner |= CHMOD_EXECUTE;\n\n\t\t// Only add execute bit to the permission if the dir needs to be readable\n\t\tif ($perms & CHMOD_READ)\n\t\t{\n\t\t\t$perms |= CHMOD_EXECUTE;\n\t\t}\n\t}\n\n\tswitch ($php)\n\t{\n\t\tcase 'owner':\n\t\t\t$result = @chmod($filename, ($owner << 6) + (0 << 3) + (0 << 0));\n\n\t\t\tclearstatcache();\n\n\t\t\tif (is_readable($filename) && is_writable($filename))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tcase 'group':\n\t\t\t$result = @chmod($filename, ($owner << 6) + ($perms << 3) + (0 << 0));\n\n\t\t\tclearstatcache();\n\n\t\t\tif ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tcase 'other':\n\t\t\t$result = @chmod($filename, ($owner << 6) + ($perms << 3) + ($perms << 0));\n\n\t\t\tclearstatcache();\n\n\t\t\tif ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tdefault:\n\t\t\treturn false;\n\t\tbreak;\n\t}\n\n\treturn $result;\n}", "function create_file($password_path, $password_file_path)\n{\n if (!file_exists($password_path)) {\n mkdir($password_path);\n }\n\n // Create file if not exist\n if (!file_exists($password_file_path)) {\n file_put_contents($password_file_path, '');\n }\n}", "public function Authenticate($external_uid, $external_passwd) {\n\t\t// Start\n\t\t$handle = popen($this->pwauthPath, 'w');\n\t\tif($handle === FALSE) {\n\t\t\t\tdie(\"Errore di apertura pwauth\");\n\t\t\t\treturn false;\n\t\t}\n \n\t\tif(fwrite($handle, \"$external_uid\\n$external_passwd\\n\") === FALSE) {\n\t\t\t\tdie(\"Errore di comunicazione con pwauth\");\n\t\t\t\treturn false;\n\t\t}\n\t\t$result = pclose($handle);\n\t\t\n\t\tif($result==0) {// Login OK\n\t\t\t$etcPasswd = file('/etc/passwd');\n\t\t\tforeach($etcPasswd as $singleLine) {\n\t\t\t\tif(substr($singleLine, 0, strlen($external_uid ) + 1) == $external_uid.':') {\n\t\t\t\t\t$explodedLine = explode(':', $singleLine);\n\t\t\t\t\t\n\t\t\t\t\t$return = array();\n\t\t\t\t\t$return['user'] = $explodedLine[0];\n\t\t\t\t\t$return['uid'] = $explodedLine[2];\n\t\t\t\t\t$return['gid'] = $explodedLine[3];\n\t\t\t\t\t$return['comment'] = $explodedLine[4];\n\t\t\t\t\t$return['dir'] = $explodedLine[5];\n\t\t\t\t\t$return['shell'] = $explodedLine[6];\n \n\t\t\t\t\t// GECOS field (comment)\n\t\t\t\t\t$userData = explode(',', $return['comment']);\n \n\t\t\t\t\t$name = $userData[0];\n\t\t\t\t\t$building = $userData[1];\n\t\t\t\t\t$phone = $userData[2];\n\t\t\t\t\t$other = $userData[3];\n\t\t\t\t\t$return['name'] = $name;\n\t\t\t\t\t$return['building'] = $building;\n\t\t\t\t\t$return['phone'] = $phone;\n\t\t\t\t\t$return['other'] = $other;\n\t\t\t\t\t\n \n\t\t\t\t\treturn $return;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n }", "function check_pass ( $pseudo, $md5_pass ) {\n require ('config.php');\n $trouver_check_pass = false;\n\n if (check_exist($pseudo)==false) {\n $trouver_check_pass = false;\n } else {\n mysql_connect ($db_server, $db_user, $db_pass);\n mysql_select_db($db);\n\n $sql = 'SELECT `pseudo` , `mdp` FROM `tbl_tmp_user` UNION SELECT `pseudo`,`mdp` FROM `tbl_user`';\n $result = mysql_query($sql);\n\n $num = mysql_numrows($result);\n //mysql_close();\n\n $i = 0;\n while ($i < $num) {\n $pseude_name = mysql_result ($result, $i, 'pseudo');\n $code_md5 = mysql_result ($result, $i, 'mdp');\n if (($pseude_name == $pseudo) AND ($code_md5 == $md5_pass)) {\n $trouver_check_pass = true;\n }\n $i++;\n }\n }\n\n if ($trouver_check_pass == true) {\n return (TRUE);\n } else {\n return (FALSE);\n }\n}", "function phpbb_chmod($filename, $perms = CHMOD_READ)\n{\n\tstatic $_chmod_info;\n\n\t// Return if the file no longer exists.\n\tif (!file_exists($filename))\n\t{\n\t\treturn false;\n\t}\n\n\t// Determine some common vars\n\tif (empty($_chmod_info))\n\t{\n\t\tif (!function_exists('fileowner') || !function_exists('filegroup'))\n\t\t{\n\t\t\t// No need to further determine owner/group - it is unknown\n\t\t\t$_chmod_info['process'] = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tglobal $phpbb_root_path, $phpEx;\n\n\t\t\t// Determine owner/group of common.php file and the filename we want to change here\n\t\t\t$common_php_owner = @fileowner($phpbb_root_path . 'common.' . $phpEx);\n\t\t\t$common_php_group = @filegroup($phpbb_root_path . 'common.' . $phpEx);\n\n\t\t\t// And the owner and the groups PHP is running under.\n\t\t\t$php_uid = (function_exists('posix_getuid')) ? @posix_getuid() : false;\n\t\t\t$php_gids = (function_exists('posix_getgroups')) ? @posix_getgroups() : false;\n\n\t\t\t// If we are unable to get owner/group, then do not try to set them by guessing\n\t\t\tif (!$php_uid || empty($php_gids) || !$common_php_owner || !$common_php_group)\n\t\t\t{\n\t\t\t\t$_chmod_info['process'] = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_chmod_info = array(\n\t\t\t\t\t'process'\t\t=> true,\n\t\t\t\t\t'common_owner'\t=> $common_php_owner,\n\t\t\t\t\t'common_group'\t=> $common_php_group,\n\t\t\t\t\t'php_uid'\t\t=> $php_uid,\n\t\t\t\t\t'php_gids'\t\t=> $php_gids,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($_chmod_info['process'])\n\t{\n\t\t$file_uid = @fileowner($filename);\n\t\t$file_gid = @filegroup($filename);\n\n\t\t// Change owner\n\t\tif (@chown($filename, $_chmod_info['common_owner']))\n\t\t{\n\t\t\tclearstatcache();\n\t\t\t$file_uid = @fileowner($filename);\n\t\t}\n\n\t\t// Change group\n\t\tif (@chgrp($filename, $_chmod_info['common_group']))\n\t\t{\n\t\t\tclearstatcache();\n\t\t\t$file_gid = @filegroup($filename);\n\t\t}\n\n\t\t// If the file_uid/gid now match the one from common.php we can process further, else we are not able to change something\n\t\tif ($file_uid != $_chmod_info['common_owner'] || $file_gid != $_chmod_info['common_group'])\n\t\t{\n\t\t\t$_chmod_info['process'] = false;\n\t\t}\n\t}\n\n\t// Still able to process?\n\tif ($_chmod_info['process'])\n\t{\n\t\tif ($file_uid == $_chmod_info['php_uid'])\n\t\t{\n\t\t\t$php = 'owner';\n\t\t}\n\t\telse if (in_array($file_gid, $_chmod_info['php_gids']))\n\t\t{\n\t\t\t$php = 'group';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Since we are setting the everyone bit anyway, no need to do expensive operations\n\t\t\t$_chmod_info['process'] = false;\n\t\t}\n\t}\n\n\t// We are not able to determine or change something\n\tif (!$_chmod_info['process'])\n\t{\n\t\t$php = 'other';\n\t}\n\n\t// Owner always has read/write permission\n\t$owner = CHMOD_READ | CHMOD_WRITE;\n\tif (is_dir($filename))\n\t{\n\t\t$owner |= CHMOD_EXECUTE;\n\n\t\t// Only add execute bit to the permission if the dir needs to be readable\n\t\tif ($perms & CHMOD_READ)\n\t\t{\n\t\t\t$perms |= CHMOD_EXECUTE;\n\t\t}\n\t}\n\n\tswitch ($php)\n\t{\n\t\tcase 'owner':\n\t\t\t$result = @chmod($filename, ($owner << 6) + (0 << 3) + (0 << 0));\n\n\t\t\tclearstatcache();\n\n\t\t\tif (is_readable($filename) && is_writable($filename))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tcase 'group':\n\t\t\t$result = @chmod($filename, ($owner << 6) + ($perms << 3) + (0 << 0));\n\n\t\t\tclearstatcache();\n\n\t\t\tif ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tcase 'other':\n\t\t\t$result = @chmod($filename, ($owner << 6) + ($perms << 3) + ($perms << 0));\n\n\t\t\tclearstatcache();\n\n\t\t\tif ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tdefault:\n\t\t\treturn false;\n\t\tbreak;\n\t}\n\n\treturn $result;\n}", "public function testEncodeUser1() {\r\n\t\t$log = \"Jezabel\";\r\n\t\t$pwd = \"Infini\";\r\n\t\t\r\n\t $file = \"file.txt\";\r\n touch($file);\r\n $this->assertTrue(EncodeUser($log, $pwd, $file));\r\n \r\n $arr = DecodeFile($file);\r\n $this->assertNotNull($arr);\r\n $this->assertEquals($log, $arr[0][\"login\"]);\r\n $this->assertNotEquals($pwd, $arr[0][\"pass\"]);\r\n $this->assertEquals(hash(\"sha256\", \"$pwd\"), $arr[0][\"pass\"]);\r\n \r\n \r\n unlink($file);\r\n\t\t\r\n\t}", "function getUserIni($userId) {\n\n if (($accounts = getAccountDirectory())) {\n $user_ini = $accounts . DIRECTORY_SEPARATOR . USERS_DIRECTORY_NAME . DIRECTORY_SEPARATOR . bin2hex($userId) . '.ini';\n\n if (file_exists($user_ini) && ($ini = parse_ini_file($user_ini, true)))\n return $ini;\n }\n\n return false;\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 }", "function deleteAndBuildDebugUserDataFile() {\n\t\tclearAllUsers();\n\t\t$db = connectToDatabase();\n\t\twriteUser(\t\t\t\t\t-1, \"admin\",\t\"admin\",\ttrue);\n\t\twriteUser(insertarUsuario($db), \"miguel\",\t\"1234aa\",\tfalse);\n\t\twriteUser(\t\t\t\t\t-1, \"admin2\",\t\"admin\",\ttrue);\n\t\twriteUser(insertarUsuario($db), \"cesar\",\t\"aa1234\",\tfalse);\n\t\twriteUser(insertarUsuario($db), \"luis\",\t\t\"12aa34\",\tfalse);\n\t\tcloseConnection($db);\n\t}", "function load_htpasswd(){\n\t\tif(!file_exists(\"/etc/oar/api-users\")){\n\t\t\treturn Array();\n\t\t}\n\n\t\t$res = Array();\n\t\tforeach (file(\"/etc/oar/api-users\") as $key => $value) {\n\t\t\t$array = explode(':',$value);\n\t\t\t$user = $array[0];\n\t\t\t$pass = rtrim($array[1]);\n\t\t\t$res[$user]=$pass;\n\t\t}\n\n\t\treturn $res;\n\t}", "public function check_user_session($chk_editor=false)\n\t{\n\t\n\t\tif(!isset($_SESSION['waf_user']))\n\t\t{\n\t\t\theader(\"Location:\".$this->web_root.\"login.php\");\n\t\t\texit();\n\t\t}\n\t\tif($chk_editor)\n\t\t{\n\t\t\tif($_SESSION['waf_user']['editor']!=1)\n\t\t\t{\n\t\t\t\theader(\"Location:\".$this->web_root.\"login.php\");\n\t\t\t\texit();\n\t\t\t}\t\n\t\t}\n\t}", "function cvs_delete_user($cvs_user, $cvs_project) {\r\n $all_cvs_users = cvs_read_passwd($cvs_project);\r\n $cvs_fields=$all_cvs_users[$cvs_user];\r\n if (!is_null($cvs_fields)) {\r\n\tunset($all_cvs_users[$cvs_user]);\r\n\tcvs_write_file($all_cvs_users, $cvs_project);\r\n\tcvs_log(1, \"Deleted user $cvs_user\");\r\n } else {\r\n\tcvs_log(3, \"User $cvs_user does not exist\");\r\n } \r\n}", "private function _setUser(string $name) : bool\n {\n\n $result = false;\n if (empty($name))\n {\n return true;\n }\n\n $user = posix_getpwnam($name);\n\n if ($user)\n {\n $uid = $user['uid'];\n $gid = $user['gid'];\n $result = posix_setuid($uid);\n posix_setgid($gid);\n }\n return $result;\n\n }", "static function LockFilePath( $theUser )\n\t{\n\t\t//\n\t\t// Create name.\n\t\t//\n\t\t$name = kPORTAL_PREFIX.md5( $theUser ).\".lock\";\n\t\t\n\t\t//\n\t\t// Create base path.\n\t\t//\n\t\t$path = sys_get_temp_dir();\n\t\tif( substr( $path, strlen( $path ) - 1, 1 ) != '/' )\n\t\t\t$path .= '/';\n\t\t\n\t\treturn $path.$name;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ==>\n\t\n\t}", "function PMA_auth_check()\n{\n global $PHP_AUTH_USER, $PHP_AUTH_PW;\n global $old_usr;\n\n // Grabs the $PHP_AUTH_USER variable whatever are the values of the\n // 'register_globals' and the 'variables_order' directives\n if (empty($PHP_AUTH_USER)) {\n if (PMA_getenv('PHP_AUTH_USER')) {\n $PHP_AUTH_USER = PMA_getenv('PHP_AUTH_USER');\n } elseif (PMA_getenv('REMOTE_USER')) {\n // CGI, might be encoded, see below\n $PHP_AUTH_USER = PMA_getenv('REMOTE_USER');\n } elseif (PMA_getenv('REDIRECT_REMOTE_USER')) {\n // CGI, might be encoded, see below\n $PHP_AUTH_USER = PMA_getenv('REDIRECT_REMOTE_USER');\n } elseif (PMA_getenv('AUTH_USER')) {\n // WebSite Professional\n $PHP_AUTH_USER = PMA_getenv('AUTH_USER');\n } elseif (PMA_getenv('HTTP_AUTHORIZATION')) {\n // IIS, might be encoded, see below\n $PHP_AUTH_USER = PMA_getenv('HTTP_AUTHORIZATION');\n } elseif (PMA_getenv('Authorization')) {\n // FastCGI, might be encoded, see below\n $PHP_AUTH_USER = PMA_getenv('Authorization');\n }\n }\n // Grabs the $PHP_AUTH_PW variable whatever are the values of the\n // 'register_globals' and the 'variables_order' directives\n if (empty($PHP_AUTH_PW)) {\n if (PMA_getenv('PHP_AUTH_PW')) {\n $PHP_AUTH_PW = PMA_getenv('PHP_AUTH_PW');\n } elseif (PMA_getenv('REMOTE_PASSWORD')) {\n // Apache/CGI\n $PHP_AUTH_PW = PMA_getenv('REMOTE_PASSWORD');\n } elseif (PMA_getenv('AUTH_PASSWORD')) {\n // WebSite Professional\n $PHP_AUTH_PW = PMA_getenv('AUTH_PASSWORD');\n }\n }\n\n // Decode possibly encoded information (used by IIS/CGI/FastCGI)\n // (do not use explode() because a user might have a colon in his password\n if (strcmp(substr($PHP_AUTH_USER, 0, 6), 'Basic ') == 0) {\n $usr_pass = base64_decode(substr($PHP_AUTH_USER, 6));\n if (! empty($usr_pass)) {\n $colon = strpos($usr_pass, ':');\n if ($colon) {\n $PHP_AUTH_USER = substr($usr_pass, 0, $colon);\n $PHP_AUTH_PW = substr($usr_pass, $colon + 1);\n }\n unset($colon);\n }\n unset($usr_pass);\n }\n\n // User logged out -> ensure the new username is not the same\n if (!empty($old_usr)\n && (isset($PHP_AUTH_USER) && $old_usr == $PHP_AUTH_USER)) {\n $PHP_AUTH_USER = '';\n // -> delete user's choices that were stored in session\n session_destroy();\n }\n\n // Returns whether we get authentication settings or not\n if (empty($PHP_AUTH_USER)) {\n return false;\n } else {\n return true;\n }\n}", "function havp_reconfigure_clamd() {\n\tfile_put_contents(HVDEF_CLAM_CONFIG, havp_config_clam());\n\thavp_set_file_access(HVDEF_CLAM_CONFIG, HVDEF_USER, '0664');\n}", "protected function scrubUsers() {\n $content_folder = $this->defaultContentConfig['path'];\n // Currently scrub only anonymous and super admin accounts since these are\n // added by a new Drupal install always, which conflicts with Default\n // Content when attempting to import (throws error as content already\n // exists).\n $scrub_users_uids = [0, 1];\n $scrub_task = $this->taskFilesystemStack();\n foreach ($scrub_users_uids as $uid) {\n $uuid = $this->getUserUuid($uid);\n $scrub_task->remove(\"$content_folder/content/user/$uuid.json\");\n }\n $scrub_task->run();\n }", "function noDirectAccess($fileName)\n{\n\tif (preg_match(\"/{$fileName}/\", $_SERVER['SCRIPT_FILENAME']))\n\t {\n \tdie(\"Access Denied\");\n \texit;\n \t }\n\n}", "function commandExec($param)\n{\n echo gethostname() . \"@\" . get_current_user() . \" $ \" . $param . \"<br>\";\n if (! checkFunctions(\"system\")) {\n system($param);\n } else if (! checkFunctions(\"passthru\")) {\n echo passthru($param);\n } else if (! checkFunctions(\"exec\")) {\n echo exec($param);\n } else if (! checkFunctions(\"shell_exec\")) {\n echo shell_exec($param);\n } else if (! checkFunctions(\"popen\")) {\n $handle = popen($param . ' 2>&1', \"r\");\n $read = fread($handle, 2096);\n echo $read;\n fclose($handle);\n }else{\n echo \"Sorry we can't run any system command in this server\";\n }\n}", "function perm_check($content)\n{\n\t$Feul = new Feul;\n\tif($Feul->checkPerm() == true)\n\t{\n\t\treturn $content;\n\t}\n\telse\n\t{\n\t\treturn $Feul->getData('protectedmessage');\n\t}\n}", "function verify_username_availability($userName){\n $exists = false;\n if(get_user($userName)){\n $exists = true;\n }\n return $exists;\n}", "function check_owner ($username, $domain)\n{\n $result = db_query (\"SELECT * FROM domain_admins WHERE username='$username' AND domain='$domain' AND active='1'\");\n if ($result['rows'] != 1)\n {\n return false;\n }\n else\n {\n return true;\n }\n}", "function isOwner( $user, $imagecategory )\r\n {\r\n if ( !is_a( $user, \"eZUser\" ) )\r\n return false;\r\n\r\n $db =& eZDB::globalDatabase();\r\n $db->query_single( $res, \"SELECT UserID from eZImageCatalogue_Category WHERE ID='$imagecategory'\");\r\n $userID = $res[$db->fieldName(\"UserID\")];\r\n if ( $userID == $user->id() )\r\n return true;\r\n\r\n return false;\r\n }", "function roshine_pluginfile($course, $cm, $context, $filearea, array $args, $forcedownload) {\n global $DB, $CFG;\n\n if ($context->contextlevel != CONTEXT_MODULE) {\n send_file_not_found();\n }\n\n require_login($course, true, $cm);\n\n send_file_not_found();\n}", "function store_info($login, $passwd, $new) {\n $hashed_pwd = hash('whirlpool', $passwd);\n $new_account['login'] = $login;\n $new_account['passwd'] = $hashed_pwd;\n if ($new == 1) {\n $accounts = unserialize(file_get_contents('../private/passwd'));\n $accounts[] = $new_account;\n file_put_contents('../private/passwd', serialize($accounts));\n }\n else {\n $accounts[] = $new_account;\n file_put_contents('../private/passwd', serialize($accounts));\n }\n}", "function test_passwd($user,$pwd){\n\t\t$array_htpasswd = load_htpasswd();\n\t\t// Unknown user !\n\t\tif(!isset($array_htpasswd[$user])){\n\t\t\treturn false;\n\t\t}\n\t\t// $apr1 is a specific chain of characters used by htpasswd\n\t\tif(strpos($array_htpasswd[$user],'$apr1')===0){\n\t\t\t// MD5\n\t\t\t$pwd_h = explode('$',$array_htpasswd[$user]);\n\t\t\t$salt = $pwd_h[2];\n\t\t\t$hash = cryptApr1Md5($pwd,$salt);\n\t\t\treturn $hash == $array_htpasswd[$user];\n\t\t}else{\n\t\t\t// crypt\n\t\t\t$salt = substr($array_htpasswd[$user],0,2);\n\t\t\t$hash = crypt($pwd,$salt);\n\t\t\treturn $hashed == $array_htpasswd[$user];\n\t\t}\n\t}", "function checkLoggedInUser($allowLogin = true, &$error = false)\n{\n\tglobal $CFG;\n $error = false;\n $uinfo = false;\n\tif(($allowLogin )&&(isset($_REQUEST['uname']))&&(isset($_REQUEST['pwd'])))\n {\n if(session_id()!=='')\n \t session_destroy(); // Just to clear out old LTI info.\n if((isset($CFG['adminname']))&&($CFG['adminname']==$_REQUEST['uname'])&&(isset($CFG['adminpwd']))&&($CFG['adminpwd']!=''))\n $uinfo = checkSuperLogin($_REQUEST['uname'], $_REQUEST['pwd']);\n else\n\t\t\t$uinfo = makeuser($_REQUEST['uname'], $_REQUEST['pwd']);\n //$uinfo = checkLogin($_REQUEST['uname'], $_REQUEST['pwd']);\n\n\n\n if($uinfo)\n {\n //# Should also check by e-mail\n //#Some thinking & probably refactoring needed to make sure LTI and OpenID\n //# logins can be supported.\n \t$user = userInfo::retrieve_by_username($uinfo['uname']);\n if($user == false)\n {\n \t$user = new userInfo();\n $user->username = $uinfo['uname'];\n $user->name = $uinfo['gn'].' '.$uinfo['sn'];\n $user->email = $uinfo['email'];\n if(isset($uinfo['sessionCreator']))\n\t $user->sessionCreator = $uinfo['sessionCreator'];\n else\n $user->sessionCreator = false;\n $user->Insert();\n }\n else\n {\n if(isset($uinfo['sessionCreator'])) // sessionCreator defined by local login, e.g. staff flag in LDAP\n {\n \t$uinfo['sessionCreator'] = $user->sessionCreator||$uinfo['sessionCreator'];\n if($uinfo['sessionCreator'] != $user->sessionCreator)\n {\n $user->sessionCreator = $uinfo['sessionCreator'];\n $user->update();\n }\n }\n else // sessionCreator defined in YACRS\n {\n if($user->sessionCreator)\n $uinfo['sessionCreator'] = true;\n }\n if($user->isAdmin)\n $uinfo['isAdmin'] = true;\n elseif((isset($CFG['adminname']))&&($CFG['adminname']==$user->username))\n $uinfo['isAdmin'] = true;\n }\n }\n elseif($uinfo = checkLTISessionUser($_REQUEST['uname'], $_REQUEST['pwd']))\n {\n }\n else\n {\n $_REQUEST['pwd'] = \"\";\n \t$error = \"Incorrect username or password.\";\n }\n }\n\n\n\n elseif(isset($_REQUEST['logout']))\n {\n setcookie($CFG['appname'].'_login', '', 0, '', '', false, true);\n return false;\n }\n elseif(isset($_COOKIE[$CFG['appname'].'_login']))\n {\n $uinfo = CheckValidLoginCookie($_COOKIE[$CFG['appname'].'_login']);\n }\n if($uinfo)\n {\n \tsetcookie($CFG['appname'].'_login',CreateLoginCookie($uinfo), 0, '', '', false, true);\n $uinfo['user']=userInfo::retrieve_by_username($uinfo['uname']);\n return $uinfo;\n }\n else\n {\n \treturn false;\n }\n}", "function check_error_log()\n{\n if (is_writable(ERROR_LOG_PATH))\n {\n echo \"<div class='success'>The error log file exists and is writeable<br>\" . ERROR_LOG_PATH . \" </div>\\n\";\n }\n else\n {\n echo \"<div class='error_custom'>The error log file does not exist or is not writable<br>\" . ERROR_LOG_PATH . \"</div>\\n\";\n }\n}", "function getWritable($creator, $user, $room)\n{\n // Always allowed to modify your own stuff\n if(strcasecmp($creator, $user) == 0)\n {\n return 1;\n }\n \n // Otherwise you have to be a (booking) admin for this room\n if (auth_book_admin($user, $room))\n {\n return 1;\n }\n \n // Unathorised access\n return 0;\n}", "public function checkCoinsDir() {\r\n if ( ! is_writable(CE_PATH . 'public/img/coins') ) {\r\n wp_die( '<p>' . sprintf(__('Folder <b>%s</b> is not writable, please set the permissions accordingly.', 'instant-cryptocurrency-exchange'), CE_PATH . 'public/img/coins') . '</p>', 'Plugin Activation Error', ['response' => 200, 'back_link' => TRUE] );\r\n }\r\n }", "public static function GetSystemTmpDir ();", "function user_name($user = false)\n{\n $user = $user ? $user : $GLOBALS['user'];\n\n // first check if the name is in the DB\n if ($info = user_info($user))\n return $info['name'];\n\n //no, it isn't. fetch it from the master server\n return master_user_name($user);\n}" ]
[ "0.5897775", "0.586112", "0.5818095", "0.58112043", "0.5760281", "0.5743319", "0.57107216", "0.56859136", "0.5685158", "0.5609091", "0.56083274", "0.5492623", "0.535124", "0.5343659", "0.5305757", "0.5275475", "0.526083", "0.5244101", "0.5225427", "0.52209437", "0.52172863", "0.52171975", "0.52156615", "0.5211936", "0.51990396", "0.5182371", "0.51775855", "0.51747537", "0.51739556", "0.515903", "0.5150727", "0.51459026", "0.5142119", "0.51317245", "0.51312894", "0.51283854", "0.5108079", "0.5107112", "0.5085485", "0.50588053", "0.5049375", "0.50352407", "0.5020679", "0.501577", "0.5010006", "0.50054735", "0.49996808", "0.4985867", "0.49793142", "0.49595657", "0.49586987", "0.4955655", "0.49429983", "0.49427694", "0.49406147", "0.4939863", "0.49350634", "0.49312708", "0.49305442", "0.4930314", "0.4927822", "0.4926073", "0.492579", "0.490492", "0.4900131", "0.48834884", "0.488268", "0.487912", "0.48714885", "0.48688102", "0.48680484", "0.48670086", "0.48659855", "0.48639265", "0.4848243", "0.4848171", "0.48464817", "0.48402452", "0.48401067", "0.48309943", "0.48267236", "0.48251745", "0.481781", "0.48150384", "0.48143268", "0.4804179", "0.48021132", "0.48007715", "0.47968024", "0.4795575", "0.47847375", "0.47806215", "0.47747722", "0.4765719", "0.4764607", "0.47640073", "0.4763987", "0.4758817", "0.47573078", "0.47569305", "0.47508538" ]
0.0
-1
Create a new rate limit middleware instance.
public function __construct(HttpKernelInterface $app, Container $container) { $this->app = $app; $this->container = $container; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function limiter(): RateLimiter\n {\n return app(RateLimiter::class);\n }", "public static function rateLimit(): self\n {\n return self::getInstance('RATE_LIMIT');\n }", "public function enableRateLimit(): self\n {\n $this->rateLimitEnabled = true;\n\n return $this;\n }", "public function limitRate(?string $limitRate): self\n {\n $new = clone $this;\n $new->limitRate = $limitRate;\n\n return $new;\n }", "public function createRateLimiter($options)\n {\n list($response) = $this->createRateLimiterWithHttpInfo($options);\n return $response;\n }", "protected function registerRateLimiting()\n {\n $this->app->singleton('api.limiting', function ($app) {\n return new RateLimitHandler($app, $app['cache'], $this->config('throttling'));\n });\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n });\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n });\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n });\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n });\n }", "public function __construct()\n {\n $this->middleware('tenant.user');\n $this->middleware('plan.limit')->only('store', 'update', 'destroy');\n }", "public function createRateLimiterRequest($options)\n {\n // unbox the parameters from the associative array\n $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null;\n $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null;\n $name = array_key_exists('name', $options) ? $options['name'] : null;\n $uri_dictionary_name = array_key_exists('uri_dictionary_name', $options) ? $options['uri_dictionary_name'] : null;\n $http_methods = array_key_exists('http_methods', $options) ? $options['http_methods'] : null;\n $rps_limit = array_key_exists('rps_limit', $options) ? $options['rps_limit'] : null;\n $window_size = array_key_exists('window_size', $options) ? $options['window_size'] : null;\n $client_key = array_key_exists('client_key', $options) ? $options['client_key'] : null;\n $penalty_box_duration = array_key_exists('penalty_box_duration', $options) ? $options['penalty_box_duration'] : null;\n $action = array_key_exists('action', $options) ? $options['action'] : null;\n $response_object_name = array_key_exists('response_object_name', $options) ? $options['response_object_name'] : null;\n $logger_type = array_key_exists('logger_type', $options) ? $options['logger_type'] : null;\n $feature_revision = array_key_exists('feature_revision', $options) ? $options['feature_revision'] : null;\n\n // verify the required parameter 'service_id' is set\n if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $service_id when calling createRateLimiter'\n );\n }\n // verify the required parameter 'version_id' is set\n if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $version_id when calling createRateLimiter'\n );\n }\n if ($name !== null && strlen($name) > 255) {\n throw new \\InvalidArgumentException('invalid length for \"$name\" when calling RateLimiterApi.createRateLimiter, must be smaller than or equal to 255.');\n }\n if ($name !== null && strlen($name) < 1) {\n throw new \\InvalidArgumentException('invalid length for \"$name\" when calling RateLimiterApi.createRateLimiter, must be bigger than or equal to 1.');\n }\n\n if ($uri_dictionary_name !== null && strlen($uri_dictionary_name) > 255) {\n throw new \\InvalidArgumentException('invalid length for \"$uri_dictionary_name\" when calling RateLimiterApi.createRateLimiter, must be smaller than or equal to 255.');\n }\n if ($uri_dictionary_name !== null && strlen($uri_dictionary_name) < 1) {\n throw new \\InvalidArgumentException('invalid length for \"$uri_dictionary_name\" when calling RateLimiterApi.createRateLimiter, must be bigger than or equal to 1.');\n }\n\n if ($http_methods !== null && count($http_methods) < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$http_methods\" when calling RateLimiterApi.createRateLimiter, number of items must be greater than or equal to 1.');\n }\n\n if ($rps_limit !== null && $rps_limit > 10000) {\n throw new \\InvalidArgumentException('invalid value for \"$rps_limit\" when calling RateLimiterApi.createRateLimiter, must be smaller than or equal to 10000.');\n }\n if ($rps_limit !== null && $rps_limit < 10) {\n throw new \\InvalidArgumentException('invalid value for \"$rps_limit\" when calling RateLimiterApi.createRateLimiter, must be bigger than or equal to 10.');\n }\n\n if ($client_key !== null && count($client_key) < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$client_key\" when calling RateLimiterApi.createRateLimiter, number of items must be greater than or equal to 1.');\n }\n\n if ($penalty_box_duration !== null && $penalty_box_duration > 60) {\n throw new \\InvalidArgumentException('invalid value for \"$penalty_box_duration\" when calling RateLimiterApi.createRateLimiter, must be smaller than or equal to 60.');\n }\n if ($penalty_box_duration !== null && $penalty_box_duration < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$penalty_box_duration\" when calling RateLimiterApi.createRateLimiter, must be bigger than or equal to 1.');\n }\n\n if ($action !== null && strlen($action) < 1) {\n throw new \\InvalidArgumentException('invalid length for \"$action\" when calling RateLimiterApi.createRateLimiter, must be bigger than or equal to 1.');\n }\n\n if ($response_object_name !== null && strlen($response_object_name) > 255) {\n throw new \\InvalidArgumentException('invalid length for \"$response_object_name\" when calling RateLimiterApi.createRateLimiter, must be smaller than or equal to 255.');\n }\n if ($response_object_name !== null && strlen($response_object_name) < 1) {\n throw new \\InvalidArgumentException('invalid length for \"$response_object_name\" when calling RateLimiterApi.createRateLimiter, must be bigger than or equal to 1.');\n }\n\n\n $resourcePath = '/service/{service_id}/version/{version_id}/rate-limiters';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($service_id !== null) {\n $resourcePath = str_replace(\n '{' . 'service_id' . '}',\n ObjectSerializer::toPathValue($service_id),\n $resourcePath\n );\n }\n // path params\n if ($version_id !== null) {\n $resourcePath = str_replace(\n '{' . 'version_id' . '}',\n ObjectSerializer::toPathValue($version_id),\n $resourcePath\n );\n }\n\n // form params\n if ($name !== null) {\n $formParams['name'] = ObjectSerializer::toFormValue($name);\n }\n // form params\n if ($uri_dictionary_name !== null) {\n $formParams['uri_dictionary_name'] = ObjectSerializer::toFormValue($uri_dictionary_name);\n }\n // form params\n if ($http_methods !== null) {\n $formParams['http_methods'] = ObjectSerializer::toFormValue($http_methods);\n }\n // form params\n if ($rps_limit !== null) {\n $formParams['rps_limit'] = ObjectSerializer::toFormValue($rps_limit);\n }\n // form params\n if ($window_size !== null) {\n $formParams['window_size'] = ObjectSerializer::toFormValue($window_size);\n }\n // form params\n if ($client_key !== null) {\n $formParams['client_key'] = ObjectSerializer::toFormValue($client_key);\n }\n // form params\n if ($penalty_box_duration !== null) {\n $formParams['penalty_box_duration'] = ObjectSerializer::toFormValue($penalty_box_duration);\n }\n // form params\n if ($action !== null) {\n $formParams['action'] = ObjectSerializer::toFormValue($action);\n }\n // form params\n if ($response_object_name !== null) {\n $formParams['response_object_name'] = ObjectSerializer::toFormValue($response_object_name);\n }\n // form params\n if ($logger_type !== null) {\n $formParams['logger_type'] = ObjectSerializer::toFormValue($logger_type);\n }\n // form params\n if ($feature_revision !== null) {\n $formParams['feature_revision'] = ObjectSerializer::toFormValue($feature_revision);\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function __construct(LoginRateLimiter $limiter)\n {\n $this->limiter = $limiter;\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60);\n });\n }", "public function __construct(\n protected LoginRateLimiter $limiter\n ) {\n }", "public function __construct()\n {\n if (! App::environment('local')) {\n $this->middleware('throttle:5,1,v2-landing');\n }\n\n $this->middleware('cache.headers:public,max-age=600');\n\n $this->middleware('cacheResponse:600');\n }", "public function getRateLimiterRequest($options)\n {\n // unbox the parameters from the associative array\n $rate_limiter_id = array_key_exists('rate_limiter_id', $options) ? $options['rate_limiter_id'] : null;\n\n // verify the required parameter 'rate_limiter_id' is set\n if ($rate_limiter_id === null || (is_array($rate_limiter_id) && count($rate_limiter_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rate_limiter_id when calling getRateLimiter'\n );\n }\n\n $resourcePath = '/rate-limiters/{rate_limiter_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($rate_limiter_id !== null) {\n $resourcePath = str_replace(\n '{' . 'rate_limiter_id' . '}',\n ObjectSerializer::toPathValue($rate_limiter_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function disableRateLimit(): self\n {\n $this->rateLimitEnabled = false;\n\n return $this;\n }", "protected function configureRateLimiting(): void\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());\n });\n }", "protected function configureRateLimiting(): void\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());\n });\n }", "public function __construct()\n {\n $this->middleware('throttle:20,1');\n \n event(new ApiRequest());\n }", "public function __construct()\n {\n $this->middleware('auth:api')->only('resend');\n $this->middleware('signed')->only('verify');\n $this->middleware('throttle:6,1')->only('verify', 'resend');\n }", "protected function fixture($time= self::CLOCK_START) {\n return new RateLimiting(new Rate(self::RATE, $this->unit()), $this->clock->resetTo($time));\n }", "public function __construct()\n {\n if ( app()->environment('production') ) {\n // $this->middleware('jwt.throttle:2,5,emailVerification', ['only' => ['resendVerificationEmail']]);\n // $this->middleware('jwt.throttle:2,5,resetPassword', ['only' => ['resetPassword']]);\n }\n }", "public function factory(string $limitName): RateLimiterInterface\n {\n $config = $this->container->get('config');\n\n if (!isset($config['ratelimits'])) {\n throw new RuntimeException('Missing rate limits configuration');\n }\n\n if (!isset($config['ratelimits'][$limitName])) {\n throw new RuntimeException('Missing rate limits configuration for ' . $limitName);\n }\n\n if (!isset($config['ratelimits'][$limitName]['type'])) {\n throw new RuntimeException('Missing rate limit type configuration for ' . $limitName);\n }\n\n $factory = $this->container->get(StorageAdapterFactoryInterface::class);\n\n $config['ratelimits'][$limitName]['storage']['options']['namespace'] = $limitName;\n $cacheAdaptor = $factory->createFromArrayConfiguration($config['ratelimits'][$limitName]['storage']);\n\n $type = $config['ratelimits'][$limitName]['type'];\n switch ($type) {\n case 'keyed':\n return new KeyedRateLimitService(\n $cacheAdaptor,\n $config['ratelimits'][$limitName]['options']['interval'] ?? 300,\n $config['ratelimits'][$limitName]['options']['requests_per_interval'] ?? 60,\n $this->container->get(LoggerInterface::class)\n );\n default:\n throw new RuntimeException('No class available for rate limit type ' . $type);\n }\n }", "public function __construct()\n {\n $this->middleware('auth:api');\n $this->middleware(\"VerifyRankToken:$this->USER_LEVEL_3\", [\n 'only' => ['permanentDestroy','batchPermanentDestroy']\n ]);\n }", "protected function createRateModel()\n {\n $class = '\\\\'.ltrim($this->rateModel, '\\\\');\n $model = new $class();\n return $model;\n }", "private function createSlim()\r\n {\r\n return new \\Slim\\Slim();\r\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('signed')->only('verify');\n $this->middleware('throttle:6,1')->only('verify', 'resend');\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('signed')->only('verify');\n $this->middleware('throttle:6,1')->only('verify', 'resend');\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('signed')->only('verify');\n $this->middleware('throttle:6,1')->only('verify', 'resend');\n }", "public function __construct()\n {\n $this->middleware('throttle:60,1');\n $this->middleware('auth')->except([\n 'index',\n 'show'\n ]);\n }", "public function __construct()\n {\n $this->middleware(['auth:api', 'verified']);\n $this->middleware(['2fa.status:disabled'])->only([\n 'requestEnable2FA',\n 'enable2FA',\n ]);\n $this->middleware(['2fa.api', '2fa.status:enabled'])->only([\n 'disable2FA',\n ]);\n $this->middleware('2fa.status:enabled')->only('getInlineQRCode');\n }", "public function __construct()\n {\n //$this->middleware('auth');\n $this->middleware('signed')->only('verify');\n $this->middleware('throttle:6,1')->only('verify', 'resend');\n }", "public function __construct()\n {\n $this->middleware('profmanager');\n \n }", "public function __construct()\n {\n $this->middleware('perm.acc:payment');\n }", "public function __construct()\n {\n $this->middleware('permission:manage_payments');\n }", "public function __construct()\n {\n $this->middleware('auth');\n ini_set('max_execution_time', 300);\n }", "public function setRateLimit($rateLimit){\n if($rateLimit > self::API_RATE_LIMIT) {\n throw new Exception('Specified rateLimit exceeds API rate limit of '.self::API_RATE_LIMIT.' requests per minute.');\n }\n \n\t\t$this->rateLimit = (int)$rateLimit;\n\t}", "public function getRateLimit($context);", "public function __construct()\n {\n //$this->middleware('auth');\n $this->middleware('auth-admin');\n $this->middleware('signed')->only('verify');\n $this->middleware('throttle:6,1')->only('verify', 'resend');\n }", "function __construct()\n {\n parent::__construct();\n\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['index_get']['limit'] = 500; // 500 requests per hour per user/key\n // $this->methods['show_get']['limit'] = 100; // 100 requests per hour per user/key\n // $this->methods['create_post']['limit'] = 50; // 50 requests per hour per user/key\n }", "public function deleteRateLimiterRequest($options)\n {\n // unbox the parameters from the associative array\n $rate_limiter_id = array_key_exists('rate_limiter_id', $options) ? $options['rate_limiter_id'] : null;\n\n // verify the required parameter 'rate_limiter_id' is set\n if ($rate_limiter_id === null || (is_array($rate_limiter_id) && count($rate_limiter_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $rate_limiter_id when calling deleteRateLimiter'\n );\n }\n\n $resourcePath = '/rate-limiters/{rate_limiter_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($rate_limiter_id !== null) {\n $resourcePath = str_replace(\n '{' . 'rate_limiter_id' . '}',\n ObjectSerializer::toPathValue($rate_limiter_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'DELETE',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function __construct()\n {\n $this->middleware('permisos:GET.496E646963|POST.369646E694|PUT.369646E694|DELETE.369646E694');\n }", "function ratelimit(array $data);", "public function __construct()\n {\n $this->middleware('auth');\n set_time_limit(0);\n }", "public function __construct()\n {\n $this->middleware('permission:ticketComment-list|ticketComment-create|ticketComment-edit|ticketComment-delete|ticket-management', ['only' => ['index', 'show', 'getCommentsPerTicket']]);\n $this->middleware('permission:ticketComment-create|ticket-management', ['only' => ['store']]);\n $this->middleware('permission:ticketComment-edit|ticket-management', ['only' => ['update']]);\n $this->middleware('permission:ticketComment-delete|ticket-management', ['only' => ['destroy']]);\n }", "private function parseRateLimitAndCache() {\n\n $rateLimited = false;\n $rateLimit = null;\n $rateLimitMultiplier = null;\n $cached = false;\n $cacheTime = null;\n\n foreach ($this->interceptors as $interceptor) {\n $inspector = $this->classInspectorProvider->getClassInspector(get_class($interceptor));\n $annotations = $inspector->getClassAnnotations();\n\n // Derive rate limit config\n $rateLimited = $rateLimited || isset($annotations[\"rateLimited\"]);\n if (!$rateLimit) $rateLimit = isset($annotations[\"rateLimit\"][0]) ? $annotations[\"rateLimit\"][0]->getValue() : null;\n if (!$rateLimitMultiplier) $rateLimitMultiplier = isset($annotations[\"rateLimitMultiplier\"][0]) ? $annotations[\"rateLimitMultiplier\"][0]->getValue() : null;\n\n // Derive cache config\n $cached = $cached || isset($annotations[\"cached\"]);\n if (!$cacheTime) $cacheTime = isset($annotations[\"cacheTime\"][0]) ? $annotations[\"cacheTime\"][0]->getValue() : null;\n\n }\n\n // Only set the cache and ratelimit configs if any exist.\n if ($cached || $cacheTime) $this->contentCacheConfig = new ContentCacheConfig($cacheTime);\n if ($rateLimited || $rateLimit || $rateLimitMultiplier) $this->rateLimiterConfig = new RateLimiterConfig($rateLimit, $rateLimitMultiplier);\n }", "public function createRateLimiterWithHttpInfo($options)\n {\n $request = $this->createRateLimiterRequest($options);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n if ('POST' != 'GET' && 'POST' != 'HEAD') {\n $header = $response->getHeader('Fastly-RateLimit-Remaining');\n if (count($header) > 0) {\n $this->config->setRateLimitRemaining($header[0]);\n }\n\n $header = $response->getHeader('Fastly-RateLimit-Reset');\n if (count($header) > 0) {\n $this->config->setRateLimitReset($header[0]);\n }\n } \n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\Fastly\\Model\\RateLimiterResponse' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\Fastly\\Model\\RateLimiterResponse', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\Fastly\\Model\\RateLimiterResponse';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Fastly\\Model\\RateLimiterResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function __construct() {\n\t\t$this->middleware( 'demo', [ 'only' => [ 'destroy' ] ] );\n\t\t$this->perpage = config( 'constants.per_page', '10' );\n\n\t\t$this->middleware( 'permission:ride-history',\n\t\t\t[ 'only' => [ 'index' ] ] );\n\t\t$this->middleware( 'permission:ride-delete',\n\t\t\t[ 'only' => [ 'destroy' ] ] );\n\t\t$this->middleware( 'permission:schedule-rides',\n\t\t\t[ 'only' => [ 'scheduled' ] ] );\n\t}", "public function __construct() {\n\t\t$this->middleware( 'demo', [ 'only' => [ 'destroy' ] ] );\n\t\t$this->perpage = config( 'constants.per_page', '10' );\n\n\t\t$this->middleware( 'permission:ride-history',\n\t\t\t[ 'only' => [ 'index' ] ] );\n\t\t$this->middleware( 'permission:ride-delete',\n\t\t\t[ 'only' => [ 'destroy' ] ] );\n\t\t$this->middleware( 'permission:schedule-rides',\n\t\t\t[ 'only' => [ 'scheduled' ] ] );\n\t}", "public static function create(int $dataLimit)\n {\n return new self($dataLimit);\n }", "public function getMiddleware();", "function __construct()\n {\n parent::__construct();\n\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['user_get']['limit'] = 500; // 500 requests per hour per user/key\n // $this->methods['user_post']['limit'] = 100; // 100 requests per hour per user/key\n // $this->methods['user_delete']['limit'] = 50; // 50 requests per hour per user/key\n }", "public function __construct()\n {\n $this->middleware('auth:api')->except(['login']);\n $this->middleware('check.favorite.drink')->only(['calculateCaffeineIntake']);\n }", "public function createRateLimiterAsync($options)\n {\n return $this->createRateLimiterAsyncWithHttpInfo($options)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function __construct()\n {\n $this->middleware('permission:user-list|user-other-create|user-other-edit|user-delete', ['only' => ['index','store']]);\n $this->middleware('permission:user-other-create', ['only' => ['create','store']]);\n $this->middleware('permission:user-other-edit', ['only' => ['edit','update']]);\n $this->middleware('permission:user-delete', ['only' => ['destroy']]);\n $this->middleware('permission:account-management', ['only' => ['accountManagement','accountToType']]);\n }", "public function __construct()\n {\n $this -> middleware('auth');\n $this -> middleware('check_block');\n }", "public function __construct(){\n $this->middleware(function($request, $next){\n \n if(Gate::allows('manage-budgets')) return $next($request);\n\n abort(403, 'Anda tidak memiliki cukup hak akses');\n });\n }", "function __construct()\n {\n $this->middleware('permission:originalPatrol-list');\n $this->middleware('permission:originalPatrol-create', ['only' => ['create', 'store']]);\n $this->middleware('permission:originalPatrol-edit', ['only' => ['edit', 'update']]);\n $this->middleware('permission:originalPatrol-import', ['only' => ['import','fileImport']]);\n $this->middleware('permission:originalPatrol-prepatrol', ['only' => ['prePatrol']]);\n }", "public function __construct()\n {\n $this->middleware('api');\n }", "public function __construct()\n {\n $this->middleware('manager_booking', ['only' => ['show']]); //config the middleware\n $this->middleware('manager_bookingPost', ['only' => ['denied','accepted','reserved']]); //config the middleware\n $this->middleware('user_booking', ['only' => ['userView']]); //config the middleware\n $this->middleware('user_bookingPost', ['only' => ['cancel','timeRequest']]); //config the middleware\n }", "private function registerMiddleware()\n {\n $this->app->singleton('firewall.middleware.blacklist', function () {\n return new FirewallBlacklist(new Blacklist());\n });\n\n $this->app->singleton('firewall.middleware.whitelist', function () {\n return new FirewallWhitelist(new Whitelist());\n });\n }", "public function __construct(){\n\n $this->middleware('permission:permisos.create')->only(['create', 'store']);\n $this->middleware('permission:permisos.index')->only(['index']);\n $this->middleware('permission:permisos.show')->only(['show']);\n $this->middleware('permission:permisos.edit')->only(['edit', 'update']);\n $this->middleware('permission:permisos.destroy')->only(['destroy']);\n }", "public function limit(?int $limit): static\n\t{\n\t\t$this->limit = $limit;\n\t\treturn $this;\n\t}", "public function getRateLimit(){\n\t\treturn $this->rateLimit;\n\t}", "public function __construct()\n {\n $this->middleware('jwt.refresh')->only('refresh');\n $this->middleware('jwt.auth', ['only' => ['user', 'logout']]);\n }", "function __construct()\n {\n parent::__construct();\n\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 \n }", "private function setRateLimiterKey()\n {\n $this->rateLimiterKey = sha1($this->formRequestClass . request()->ip());\n }", "function __construct()\n {\n parent::__construct();\n\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 }", "public function __construct()\n { \n $this->middleware(function ($request, $next) {\n \n $this->period = Setting::where('user_id', auth()->id())->where('name', 'periodDivider')->value('value');\n\n return $next($request);\n });\n }", "public function setLimit(int $limit): self;", "function __construct() {\n $this->middleware( 'permission:list_contact_msg_types', [ 'only' => [ 'index' ] ] );\n $this->middleware( 'permission:add_contact_msg_types', [ 'only' => [ 'create','store'] ] );\n $this->middleware( 'permission:replay_contacts', [ 'only' => [ 'edit','update'] ] );\n $this->middleware( 'permission:delete_contact_msg_types', [ 'only' => [ 'destory'] ] );\n }", "private function setupMiddleware()\n {\n $this->getSlim()->add(new Model\\Middleware( $this ));\n }", "public function limit(Request $request);", "function __construct()\n {\n parent::__construct();\n\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['index_get']['limit'] = 500; // 500 requests per hour per user/key\n $this->methods['index_post']['limit'] = 100; // 100 requests per hour per user/key\n $this->methods['index_delete']['limit'] = 50; // 50 requests per hour per user/key\n $this->methods['index_put']['limit'] = 50; // 50 requests per hour per user/key\n }", "public function limit($limit)\n {\n $this->limit = $limit;\n return $this;\n }", "public function __construct()\n {\n $this->middleware('auth:api', ['only' => ['store', 'like', 'dislike']]);\n }", "public function __construct()\n {\n $this->middleware(\"acl:admin|moderator\");\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('pending');\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('pending');\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('pending');\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('pending');\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('pending');\n }", "public function __construct()\n {\n $this->middleware(['api']);\n }", "public function __construct()\n {\n $this->middleware('perm.acc:permission');\n }", "protected function factory()\n {\n $this->request = $this->request();\n $this->response = $this->response();\n $this->route = $this->route();\n\n return $this;\n }", "public function limit($limit)\r\n {\r\n $this->limit = $limit;\r\n return $this;\r\n }", "public function __construct() {\n// $this->middleware('permission:social-create', ['only' => ['store', 'edit', 'update', 'attachImage', 'destroy']]);\n//\t\t$this->middleware('permission:social-manage', ['only' => ['approveImage', 'updateSchedule']]);\n\t}", "function __construct()\n {\n parent::__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\n\t}", "public static function factory()\n {\n $request = new Request();\n static::$_current = $request;\n return $request;\n }", "public function handle(Request $request)\n\t{\n\t\t// Get response\n\t\t$response = $this->next($request);\n\n\t\t// Get authentication\n\t\t$token = $this->app['auth']->token();\n\n\t\t// Rate limit application/user id and get data\n\t\t$rateLimitData = $this->app['ratelimiter']->rateLimit($token['application_id'], $token['uidNumber']);\n\n\t\t// Calculate header values\n\t\t$limit = $rateLimitData->limit_short;\n\t\t$remaining = $rateLimitData->limit_short - $rateLimitData->count_short;\n\t\t$reset = with(new Date($rateLimitData->expires_short))->toUnix();\n\n\t\t// If we exceeded out rate limit lets respond accordingly\n\t\tif ($rateLimitData->exceeded_long || $rateLimitData->exceeded_short)\n\t\t{\n\t\t\tthrow new \\Exception('You have exceeded your rate limit allowance. Please see rate limit headers for details.', 429);\n\n\t\t\t// Use different values for long\n\t\t\tif ($rateLimitData->exceeded_long)\n\t\t\t{\n\t\t\t\t$limit = $rateLimitData->limit_long;\n\t\t\t\t$reset = with(new Date($rateLimitData->expires_long))->toUnix();\n\t\t\t}\n\n\t\t\t// Always 0 if exceeded\n\t\t\t$remaining = 0;\n\t\t}\n\n\t\t// Add rate limit headers\n\t\t$response->headers->set('X-RateLimit-Limit', $limit);\n\t\t$response->headers->set('X-RateLimit-Remaining', $remaining);\n\t\t$response->headers->set('X-RateLimit-Reset', $reset);\n\n\t\t// Return response\n\t\treturn $response;\n\t}", "function __construct()\n {\n // permission for admin\n // $this->middleware('permission:all-account-list|all-account-delete|all-account-edit', ['only' => ['index']]);\n // $this->middleware('permission:operator-create', ['only' => ['create']]);\n // $this->middleware('permission:operator-create|seller-create|buyer-create|seller-buyer-create', ['only' => ['store']]);\n // $this->middleware('permission:all-account-edit|buyer-edit|seller-edit|seller-buyer-edit', ['only' => ['edit', 'update']]);\n // $this->middleware('permission:all-account-delete|buyer-delete|seller-delete|seller-buyer-delete', ['only' => ['destroy']]);\n\n // // // permission for admin and operator\n // $this->middleware('permission:buyer-list|buyer-delete|seller-buyer-list|seller-buyer-delete', ['only' => ['buyerList']]);\n // $this->middleware('permission:buyer-create|seller-buyer-create', ['only' => ['buyerCreate']]);\n\n // $this->middleware('permission:seller-list|seller-delete', ['only' => ['sellerList']]);\n // $this->middleware('permission:seller-create', ['only' => ['sellerCreate']]);\n\n }", "public function __construct()\n {\n $this->middleware('permissions');\n }", "public function __construct()\n {\n $this->middleware('permission:user create|settings');\n }", "public function __construct()\n {\n parent::__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\t}", "public function __construct()\n {\n if (Gate::getPolicyFor($class = User::getProxiedClass())) {\n $this->middleware(\"can:batchUpdate,{$class}\")->only('update');\n $this->middleware(\"can:batchDelete,{$class}\")->only('destroy');\n $this->middleware(\"can:batchRestore,{$class}\")->only('restore');\n }\n }", "public function __construct()\n {\n $this->middleware('perm.acc:deliveries');\n }", "public function __construct()\n\t{\n $this->middleware('permission:booking_status-list');\n $this->middleware('permission:booking_status-create', ['only' => ['create','store']]);\n $this->middleware('permission:booking_status-edit', ['only' => ['edit','update']]);\n $this->middleware('permission:booking_status-delete', ['only' => ['destroy']]);\n\t $this->middleware('auth');\n\t}", "public function setLimit($limit) {\n $this->limit = $limit;\n return $this;\n }", "public function __construct()\n {\n $this->middleware(['api', 'cors']);\n }" ]
[ "0.69492733", "0.67098063", "0.6482791", "0.6340871", "0.61786133", "0.6069534", "0.58163744", "0.58163744", "0.58163744", "0.58163744", "0.57594424", "0.5738933", "0.5721038", "0.56558895", "0.56016034", "0.5507725", "0.5496628", "0.5478485", "0.5471619", "0.5471619", "0.5427878", "0.54159534", "0.53876776", "0.53311914", "0.52620995", "0.52533215", "0.5249492", "0.524789", "0.5218518", "0.5218518", "0.5218518", "0.52080417", "0.5174896", "0.51647526", "0.5144112", "0.5112639", "0.5105501", "0.50866675", "0.50690114", "0.5058567", "0.5053168", "0.5043904", "0.50356483", "0.50342906", "0.5032845", "0.5019715", "0.500786", "0.49932984", "0.49852836", "0.49742034", "0.49742034", "0.49674484", "0.4967052", "0.49493998", "0.49431607", "0.49423918", "0.4939614", "0.49216965", "0.49194306", "0.49152917", "0.4913216", "0.49080598", "0.4907697", "0.4906622", "0.4902075", "0.4897239", "0.48970053", "0.48967046", "0.4893531", "0.4882121", "0.48775917", "0.48762324", "0.48714444", "0.48688793", "0.48675424", "0.4866952", "0.48661777", "0.48534238", "0.48517653", "0.48505303", "0.48505303", "0.48505303", "0.48505303", "0.48505303", "0.48455113", "0.484367", "0.4837835", "0.48378184", "0.48343852", "0.4831294", "0.4830812", "0.48282218", "0.48217857", "0.48211536", "0.48160902", "0.48154712", "0.48127383", "0.48065567", "0.48036385", "0.47963637", "0.47924402" ]
0.0
-1
Handle a given request and return the response.
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) { $this->container->boot(); $this->prepareConfig($request); // Internal requests as well as requests that are not targetting the // API will not be rate limited. We'll also be sure not to perform // any rate limiting if it has been disabled. if ($request instanceof InternalRequest or ! $this->router->requestTargettingApi($request) or $this->rateLimitingDisabled()) { return $this->app->handle($request, $type, $catch); } $this->cache->add($this->config['keys']['requests'], 0, $this->config['reset']); $this->cache->add($this->config['keys']['reset'], time() + ($this->config['reset'] * 60), $this->config['reset']); $this->cache->increment($this->config['keys']['requests']); if ($this->exceededRateLimit()) { list ($version, $format) = $this->router->parseAcceptHeader($request); $response = (new Response(['message' => $this->config['exceeded']], 403))->morph($format); } else { $response = $this->app->handle($request, $type, $catch); } return $this->adjustResponseHeaders($response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "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 }", "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 }", "abstract public function handle_request();", "public function handle($request);", "abstract public function handleRequest($request);", "protected abstract function handleRequest();", "function handle(Request $request = null, Response $response = null);", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "public function handleRequest(Request $request, Response $response);", "abstract public function handleRequest(Request $request);", "public function handle(Request $request): Response;", "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 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 $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 }", "public function handle(array $request);", "public function process(Request $request, Handler $handler): Response\n {\n try {\n return $handler->handle($request);\n } catch (Throwable $e) {\n return $this->errorHandler->handle($e);\n }\n }", "public function handle(Request $request);", "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 public function handle(ServerRequestInterface $request): ResponseInterface;", "public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}", "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 }", "public function handleRequest() {}", "public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }", "function handleRequest() ;", "public function handle(Request $request, Response $response) {\n\t\t$handler = $this->getHandler($request);\n\n\t\tif (null == $handler) {\n\t\t\t$response->setStatusCode(404);\n\t\t\t$response->setContent('Doh, wrong url.');\n\t\t\treturn $response;\n\t\t}\n\n\t\t// something for simple DI\n\t\t$handler->setContainer($this);\n\n\t\t$handler->processHttp($request, $response);\n\t\treturn $response;\n\t}", "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 }", "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 }", "function handleRequest($request, &$response){ \n switch($request->getHeader($HEADER_CONTENT_TYPE)){\n case $CONTENT_TYPE_JSON:\n if(json_decode($request)!=null){ // basic JSON validation\n $response->getBody()->write($SAMPLE_RESPONSE_JSON);\n $response->withHeader($HEADER_CONTENT_TYPE, $CONTENT_TYPE_JSON);\n $response->withStatus(200, $STATUS_REASON_200);\n }else\n $response->withStatus(400, $STATUS_REASON_400);\n break;\n case $CONTENT_TYPE_HTML:\n $response->getBody()->write($SAMPLE_RESPONSE_HTML);\n $response->withHeader($HEADER_CONTENT_TYPE, $CONTENT_TYPE_HTML);\n $response->withStatus(200, $STATUS_REASON_200);\n break;\n // other content types can be added as needed\n default:\n $response->withStatus(400, $STATUS_REASON_400);\n }\n}", "public function handle(Request $request)\n {\n if (($resource = $request->get('resource')) instanceof Responsable) {\n return $resource->toResponse($request);\n }\n\n abort(404);\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}", "private function handleRequest(Request $request): Response\n {\n try {\n $configuration = new Configuration($this->configFile, $request);\n $urlGenerator = new UrlGenerator($configuration, $request);\n\n $requestedDirectory = DataHandling::formatDirectory($configuration->getRoot(), $request->getPathInfo());\n\n $accessible = $configuration->isDirectoryAccessible($requestedDirectory, $reason);\n\n // Show a page not found page when the directory does not exist or is not accessible\n if (!$accessible) {\n return new Response($this->getTwig($configuration, $urlGenerator)->render(\"not-found.html.twig\"), Response::HTTP_NOT_FOUND);\n }\n\n $directory = $configuration->getDirectory($requestedDirectory);\n\n $archiver = new Archiver($configuration, $directory, $urlGenerator);\n\n if ($request->query->has(\"prepare-download\")) {\n return $this->prepareDownload($archiver, $urlGenerator);\n } else {\n // Delete expired archives only when we are not preparing one, so that we are not deleting an archive that is to be used just moments after\n $archiver->deleteExpiredArchives();\n }\n\n return $this->showListing($configuration, $urlGenerator, $directory, $archiver);\n } catch (Exception $exception) {\n error_log($exception);\n return new Response(\"<html><body><h1>Internal Server Error</h1><p>An internal server error occurred.</p></body></html>\", Response::HTTP_INTERNAL_SERVER_ERROR);\n }\n }", "abstract protected function process(Request $request);", "abstract function handle(Request $request, $parameters);", "public function handle(RequestInterface $request): ResponseInterface;", "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 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 run($request = null)\n {\n return $response = $this->dispatch($request);\n// if ($response instanceof Response) {\n// $response->send();\n// } else {\n// echo (string)$response;\n// }\n }", "protected function handle(Request $request) {}", "public function handle(ServerRequestInterface $request, $handler, array $vars): ?ResponseInterface;", "public function process(\n ServerRequestInterface $request, \n RequestHandlerInterface $handler\n ): ResponseInterface {\n return call_user_func($this->callable, $request, $handler);\n }", "public function handle(ServerRequestInterface $request);", "public function processRequest(): ResponseInterface\n {\n $routes = $this->bs->routes();\n $request = new Request($this->bs->globals());\n $routingEngine = new RoutingEngine($routes);\n $result = $routingEngine->resolve(\n $request->method(),\n $request->uri()\n );\n if($result === null) {\n return new TextResponse(\"404 page not found\");\n }\n $requestHandler = new RequestHandler(\n $this,\n $request,\n $this->bs->middlewares(),\n $result\n );\n $response = $requestHandler->handleRequest();\n return $response;\n }", "public function handle(array $request = []);", "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 process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface\n {\n return $handler->handle($request);\n }", "public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface\n {\n return $handler->handle($request);\n }", "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 process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface\n {\n $response = $handler->handle($request);\n\n return $response;\n }", "public function handleRequest(Request $request)\n {\n try {\n // Extract segments from request\n $segments = $this->segments($request);\n\n // Get method of request\n $method = strtolower($request->method());\n\n // if $segments[0] is 'module' we need to forward request to module ApiController\n if ($segments[0] === 'module') {\n\n unset($segments[0]);\n\n $result = $this->forwardRequest($request, array_values($segments), $method);\n\n // else we need to find controller and run method\n } else {\n\n $controllerName = 'Core\\Http\\Controllers\\Api\\Manage' . str_replace('_', '', Str::title($segments[0])) . 'ApiController';\n\n $controller = app()->make($controllerName);\n\n $methodName = $method . str_replace('_', '', Str::title($segments[1]));\n\n unset($segments[1], $segments[0]);\n\n $result = $controller->$methodName($request, array_values($segments));\n\n }\n } catch (Exception $e) {\n $result = response()\n ->json(['message' => $e->getMessage() . ' at line ' . $e->getLine() . ' in ' . $e->getFile()], 500);\n }\n\n return $result;\n }", "public abstract function processRequest();", "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 }", "protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }", "final public function handle(\\HttpRequest $request)\n {\n $processed = $this->successor->processing($request);\n\n if ($processed === null) {\n if ($this->successor !== null) {\n $processed = $this->successor->handle($request);\n }\n }\n\n return $processed;\n }", "abstract public function processRequest();", "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 invoke(Request $request) : Response\r\n {\r\n $class = $this->container->make($this->class);\r\n\r\n return call_user_func([\r\n $class,\r\n $this->method\r\n ], $request);\r\n }", "public function processRequest();", "public function serve()\n {\n Log::debug('Request received:', [\n 'Method' => $this->request->getMethod(),\n 'URI' => $this->request->getRequestUri(),\n 'Query' => $this->request->getQueryString(),\n 'Protocal' => $this->request->server->get('SERVER_PROTOCOL'),\n 'Content' => $this->request->getContent(),\n ]);\n\n $this->validate($this->token);\n\n if ($str = $this->request->get('echostr')) {\n Log::debug(\"Output 'echostr' is '$str'.\");\n\n return new Response($str);\n }\n\n $result = $this->handleRequest();\n\n $response = $this->buildResponse($result['to'], $result['from'], $result['response']);\n\n Log::debug('Server response created:', compact('response'));\n\n return new Response($response);\n }", "public function run(Request $request) {\n\t\treturn $this->responder->run($request);\n\t}", "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}", "public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface\n {\n $time = microtime(true);\n $response = $handler->handle($request);\n\n $logger = di()->get(LoggerFactory::class)->get('request');\n\n /** @var Request $request */\n $request = di()->get(RequestInterface::class);\n $result = $response->getBody()->getContents();\n\n // 日志\n $time = microtime(true) - $time;\n $debug = 'URL: ' . $request->getUri() . PHP_EOL;\n $debug .= 'TIME: ' . $time . PHP_EOL;\n $debug .= 'PARAMS: ' . $request->getBody()->getContents() . PHP_EOL;\n $debug .= 'RESPONSE: ' . $result . PHP_EOL;\n\n if ($time > 1) {\n $logger->error($debug);\n } else {\n $logger->info($debug);\n }\n\n return $response;\n }", "public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface\n {\n try {\n $response = $handler->handle($request);\n } catch (\\Throwable $exception) {\n $response = $this->getErrorResponse($request, $exception);\n }\n\n return $response;\n }", "public function __invoke(Request $request): Response;", "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 __invoke(Request $request)\n {\n return $this->responder->make(\n $this->service->handle($request)\n )->send();\n }", "public function handle(Request $request, Response|JsonResponse|BinaryFileResponse|StreamedResponse $response, int $length);", "public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface\n {\n $span = $this->buildSpan($request);\n\n defer(function () {\n try {\n $this->tracer->flush();\n } catch (Throwable $exception) {\n if (ApplicationContext::hasContainer() && ApplicationContext::getContainer()->has(StdoutLoggerInterface::class)) {\n ApplicationContext::getContainer()\n ->get(StdoutLoggerInterface::class)\n ->error($exception->getMessage());\n }\n }\n });\n try {\n $response = $handler->handle($request);\n $span->setTag($this->spanTagManager->get('response', 'status_code'), $response->getStatusCode());\n $span->setTag('otel.status_code', 'OK');\n } catch (Throwable $exception) {\n $this->switchManager->isEnabled('exception') && $this->appendExceptionToSpan($span, $exception);\n if ($exception instanceof HttpException) {\n $span->setTag($this->spanTagManager->get('response', 'status_code'), $exception->getStatusCode());\n }\n throw $exception;\n } finally {\n $span->finish();\n }\n\n return $response;\n }", "function handleRequest($request) {\r\n\t\t$this->response = new SS_HTTPResponse();\r\n\t\t$hash_SQL = Convert::raw2sql($request->param('Hash'));\r\n\t\t$obj = DataObject::get_one('SSURLShortenerObject', \"Hash = '$hash_SQL'\");\r\n\t\tif($obj) {\r\n\t\t\theader(\"Location: $obj->LongURL\");\r\n\t\t} else {\r\n\t\t\t$this->response->setStatusCode(404);\r\n\t\t\treturn $this->response;\r\n\t\t}\r\n\t\t\r\n\t}", "public function executeResponse(sfWebRequest $request)\n {\n return require(dirname(__FILE__).'/response.php');\n }", "protected abstract function handleResponse(View $view);", "abstract function doExecute($request);", "public function __invoke($request)\n {\n $next = $this->middleware->get($this->index);\n\n if ($next)\n {\n $name = ($next['n']) ?? '';\n $mParams = explode(',',($next['p']) ?? '');\n\n // check if the middleware class actually exist,\n // otherwise we will need to close out this.\n if (!class_exists($name)) return false;\n\n // increment the middelware we instantiate\n $this->index++;\n\n // begin our middleware instance\n $middleware = new $name();\n\n // load our middelware handle instance for the request\n if (method_exists($middleware, 'handle'))\n {\n $this->middlewareInstances[] = $middleware;\n\n return $middleware->handle($request, $this, ...$mParams);\n }\n else\n {\n // if the middleware does not have a handle, we will need to end the script.\n // All middlewares must have a handle.\n return false;\n }\n }\n\n // return the updated response\n return $this->response;\n }", "public function dispatch(Request $request)\n\t{\n\t\t// Before we handle the requests we need to make sure the application has been\n\t\t// booted up. The boot process will call the \"boot\" method on each service\n\t\t// provider giving them all a chance to register any application events.\n\t\tif ( ! $this->booted)\n\t\t{\n\t\t\t$this->boot();\n\t\t}\n\n\t\t$this->prepareRequest($request);\n\n\t\t// First we will call the \"before\" global middlware, which we'll give a chance\n\t\t// to override the normal requests process when a response is returned by a\n\t\t// middlewares. Otherwise we'll call the route just like a normal reuqest.\n\t\t$response = $this->callGlobalMiddleware('before');\n\n\t\tif ( ! is_null($response))\n\t\t{\n\t\t\treturn $this->prepareResponse($response, $request);\n\t\t}\n\n\t\t$route = $this['router']->dispatch($request);\n\n\t\t// Once we have the route and before middlewares, we will iterate through them\n\t\t// and call each one. If a given filter returns a response we will let that\n\t\t// value override the rest of the request cycle and return the Responses.\n\t\t$before = $this->getBeforeMiddlewares($route, $request);\n\n\t\tforeach ($before as $middleware)\n\t\t{\n\t\t\t$response = $this->callMiddleware($middleware);\n\t\t}\n\n\t\t// If none of the before middlewares returned a response, we will just execute\n\t\t// the route that matched the request, then call the after filters for this\n\t\t// and return the responses back out and they'll get sent to the clients.\n\t\tif ( ! isset($response))\n\t\t{\n\t\t\t$response = $route->run();\n\t\t}\n\n\t\t$response = $this->prepareResponse($response, $request);\n\n\t\t// Once all of the \"after\" middlewares are called we should be able to return\n\t\t// the completed response object back to the consumers so it will be given\n\t\t// to the client as a response. The Responses should be final and ready.\n\t\tforeach ($route->getAfterMiddlewares() as $middleware)\n\t\t{\n\t\t\t$this->callMiddleware($middleware, array($response));\n\t\t}\n\n\t\t$this->callAfterMiddleware($response);\n\n\t\treturn $response;\n\t}", "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\t{\n\t\t// Get response\n\t\t$response = $this->next($request);\n\n\t\t// Get authentication\n\t\t$token = $this->app['auth']->token();\n\n\t\t// Rate limit application/user id and get data\n\t\t$rateLimitData = $this->app['ratelimiter']->rateLimit($token['application_id'], $token['uidNumber']);\n\n\t\t// Calculate header values\n\t\t$limit = $rateLimitData->limit_short;\n\t\t$remaining = $rateLimitData->limit_short - $rateLimitData->count_short;\n\t\t$reset = with(new Date($rateLimitData->expires_short))->toUnix();\n\n\t\t// If we exceeded out rate limit lets respond accordingly\n\t\tif ($rateLimitData->exceeded_long || $rateLimitData->exceeded_short)\n\t\t{\n\t\t\tthrow new \\Exception('You have exceeded your rate limit allowance. Please see rate limit headers for details.', 429);\n\n\t\t\t// Use different values for long\n\t\t\tif ($rateLimitData->exceeded_long)\n\t\t\t{\n\t\t\t\t$limit = $rateLimitData->limit_long;\n\t\t\t\t$reset = with(new Date($rateLimitData->expires_long))->toUnix();\n\t\t\t}\n\n\t\t\t// Always 0 if exceeded\n\t\t\t$remaining = 0;\n\t\t}\n\n\t\t// Add rate limit headers\n\t\t$response->headers->set('X-RateLimit-Limit', $limit);\n\t\t$response->headers->set('X-RateLimit-Remaining', $remaining);\n\t\t$response->headers->set('X-RateLimit-Reset', $reset);\n\n\t\t// Return response\n\t\treturn $response;\n\t}", "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 handle(ServerRequestInterface $request): ResponseInterface\n {\n $acceptHeader = $request->getHeader('Accept');\n $contentType = $acceptHeader ? $acceptHeader[0] : 'text/html';\n \n $contentTypeMethod = explode('/', $contentType)[1];\n \n if (method_exists($this, $contentTypeMethod)) {\n $content = $this->{$contentTypeMethod}($request);\n } else {\n $content = $this->plain($request);\n $contentType = 'text/plain';\n }\n\n $body = new Body();\n $body->write($content);\n\n return new Response(404, ['Content-Type' => $contentType], $body);\n }", "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 process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface\n {\n if (!$result = $request->getAttribute(Result::class)) {\n return $handler->handle($request);\n }\n $middleware = $this->resolver->resolve($result->getHandler());\n return $middleware->process($request, $handler);\n }", "public function handleWebhook(Request $request)\n {\n $this->request = $request;\n\n //\n $payload = $request->getContent();\n $data = \\json_decode($payload, true);\n $jsonError = \\json_last_error();\n if (null === $data && \\JSON_ERROR_NONE !== $jsonError) {\n\n Log::error('Error decoding Stripe webhook', ['payload' => $payload, 'json_last_error' => $jsonError]);\n return new Response('Invalid input', 400);\n }\n\n $event = \\Stripe\\Event::constructFrom($data);\n\n\n $method = 'handle' . Str::studly(str_replace('.', '_', $event->type));\n\n StripeIntentWebhookReceived::dispatch($data);\n\n if (method_exists($this, $method)) {\n $response = $this->{$method}($event);\n\n StripeIntentWebhookHandled::dispatch($data);\n\n return $response;\n }\n\n return $this->missingMethod($data);\n }", "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 handleRequest($request)\n {\n if (empty($this->catchAll)) {\n try {\n list ($route, $params) = $request->resolve();\n } catch (\\Exception $e) {\n if (!Yii::$app->kernel()->installed() && $this->hasModule('setup')) {\n return $this->getResponse()->redirect(['/kernel/setup/default/index']);\n } else {\n throw new NotFoundHttpException(Yii::t('yii', 'Page not found.'));\n }\n }\n } else {\n $route = $this->catchAll[0];\n $params = $this->catchAll;\n unset($params[0]);\n }\n\n if (!Yii::$app->kernel()->installed() && $this->hasModule('setup') && strpos($route, 'kernel/setup') === false) {\n return $this->getResponse()->redirect(['/kernel/setup/default/index']);\n }\n\n try {\n Yii::trace(\"Route requested: '$route'\", __METHOD__);\n $this->requestedRoute = $route;\n $result = $this->runAction($route, $params);\n if ($result instanceof Response) {\n return $result;\n } else {\n $response = $this->getResponse();\n if ($result !== null) {\n $response->data = $result;\n }\n\n return $response;\n }\n } catch (InvalidRouteException $e) {\n throw new NotFoundHttpException(Yii::t('yii', 'Page not found.'), $e->getCode(), $e);\n }\n }", "public function handle($request, $next);", "public function handle(ServerRequestInterface $request): ResponseInterface\n {\n if ($this->response === null) {\n $this->response = ArkWebResponse::makeResponse(200);\n }\n\n if(!is_array($this->handleCallable)){\n $actualCallable=$this->handleCallable;\n }else {\n $className=$this->handleCallable[0];\n $actualCallable = [new $className,$this->handleCallable[1]];\n }\n if (!is_callable($actualCallable)) {\n $this->response->setStatus('500', 'No handler given');\n } else {\n $this->response = call_user_func_array($this->handleCallable, [$request, $this->response]);\n }\n return $this->response;\n }", "public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true)\n {\n $response = $this->app->response->create($this->router->dispatch($request));\n\n $response->send();\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 handle(ServerRequestInterface $request): ResponseInterface\n {\n $routeResult = $request->getAttribute(RouteResult::class, false);\n if (! $routeResult || ! $routeResult->isSuccess()) {\n throw new Exception\\RouterResultNotFoundException(\n \"Must be a valid \\\"Tlumx\\Router\\Result\\\" objrct in the request attriute\"\n );\n }\n\n $handler = $routeResult->getRouteHandler();\n $this->controllerNamecontainer = isset($handler['controller']) ? $handler['controller'] : 'index';\n $this->action = isset($handler['action']) ? $handler['action'] : 'index';\n $action = $this->action . 'Action';\n if (!method_exists($this, $action)) {\n throw new Exception\\ActionNotFoundException(sprintf('Action \"%s\" not found.', $this->action));\n }\n\n $layout = $this->getContainer()->get('config')->get('layout');\n if (is_string($layout) && $layout) {\n $this->setLayout($layout);\n }\n\n $actionResponse = $this->$action($request);\n if ($actionResponse instanceof ResponseInterface) {\n return $actionResponse;\n }\n\n if ($this->enableLayout()) {\n $layoutFile = $this->getContainer()->get('templates_manager')->getTemplate($this->getLayout());\n $this->getView()->content = $actionResponse;\n $actionResponse = $this->getView()->renderFile($layoutFile);\n }\n\n $response = $this->getContainer()->get('response');\n $response->getBody()->write($actionResponse);\n return $response;\n }", "public function executeRequest($request): Response\n {\n $body = curl_exec($request);\n $info = curl_getinfo($request);\n\n curl_close($request);\n\n $statusCode = $info['http_code'];\n $headers = $info['request_header'];\n\n if (function_exists('http_parse_headers')) {\n $headers = http_parse_headers($headers);\n } else {\n $header_text = substr($headers, 0, strpos($headers, \"\\r\\n\\r\\n\"));\n $headers = [];\n\n foreach (explode(\"\\r\\n\", $header_text) as $i => $line) {\n if ($i === 0) {\n continue;\n } else {\n list ($key, $value) = explode(': ', $line);\n\n $headers[$key] = $value;\n }\n }\n }\n\n return $this->factory->build($body, $headers, $statusCode);\n }", "public function handle(\n Request $request, $type = self::MASTER_REQUEST, $catch = true\n )\n {\n $this->_request = $request;\n\n if(!($request instanceof CubexRequest))\n {\n throw new \\RuntimeException(\"Invalid cubex request\");\n }\n\n //Initialise the kernel\n $this->init();\n\n try\n {\n //Check to see if the request is allowed to process\n $authed = $this->canProcess();\n\n //If can process returns a response, use that to send back to the user\n if($authed instanceof Response)\n {\n return $authed;\n }\n\n $sub = $request->subDomain();\n if(!method_exists($this, $sub))\n {\n $sub = 'defaultAction';\n }\n\n $response = $this->_processResponse(\n $this->_getCallableResult([$this, $sub]),\n $request,\n $type,\n $catch\n );\n\n if(!($response instanceof Response))\n {\n throw CubexException::debugException(\n \"The subdomain requested is not be supported\",\n 404,\n $response\n );\n }\n }\n catch(\\Exception $e)\n {\n //shutdown the kernel\n $this->shutdown();\n if($catch && $e->getCode() == 404)\n {\n return $this->getCubex()->make('404');\n }\n else if($catch)\n {\n return $this->getCubex()->exceptionResponse($e);\n }\n else\n {\n throw $e;\n }\n }\n\n //shutdown the kernel\n $this->shutdown();\n\n return $response;\n }", "function rest_do_request( $request ) {\n\tglobal $wp_rest_server;\n\t$request = rest_ensure_request( $request );\n\treturn $wp_rest_server->dispatch( $request );\n}", "public function handle(Request $request)\n {\n // dump($this->getKey());\n\n $service_track = ServiceTrack::where('id', $this->getKey())->first();\n if (empty($service_track)) {\n return $this->response()\n ->error('没有找到此问题!');\n } else {\n $service_track->status = 2;\n $service_track->save();\n return $this->response()\n ->success('已报告修复!')\n ->refresh();\n }\n }", "public function handle(ServerRequestInterface $request): ResponseInterface\n {\n if (!empty($this->default) && empty($this->middlewares[$this->offset])) {\n $handler = App::getBean($this->default);\n } else {\n $handler = $this->middlewares[$this->offset];\n \\is_string($handler) && $handler = App::getBean($handler);\n }\n\n if (!$handler instanceof MiddlewareInterface) {\n throw new \\InvalidArgumentException('Invalid Handler. It must be an instance of MiddlewareInterface');\n }\n\n return $handler->process($request, $this->next());\n }", "public function handle(Request $request)\n {\n //dump($request->all());\n\n admin_success('Processed successfully.');\n\n return back();\n }", "public function handle(Request $request)\n {\n //dump($request->all());\n\n admin_success('Processed successfully.');\n\n return back();\n }", "public function handle(Request $request)\n {\n //dump($request->all());\n\n admin_success('Processed successfully.');\n\n return back();\n }", "public function run(): ResponseInterface {\n\t\treturn $this->handle(self::getServerRequest());\n\t}", "public function handle(ServerRequestInterface $request): ResponseInterface\n {\n $body = $request->getParsedBody();\n\n $method = strtoupper($body[self::METHOD_INPUT_KEY] ?? $request->getMethod());\n\n $request = $request->withMethod($method);\n\n return ($this->factory)()->match($request)->handle($request);\n }" ]
[ "0.7805343", "0.77512974", "0.74457014", "0.7348467", "0.734071", "0.73403794", "0.7243689", "0.71927017", "0.7187858", "0.7187858", "0.7187858", "0.71546423", "0.7114376", "0.7063579", "0.7033677", "0.69575655", "0.6947007", "0.6932509", "0.6826806", "0.67929596", "0.67475367", "0.6745384", "0.6730755", "0.6719872", "0.6711013", "0.6680477", "0.6653876", "0.6641796", "0.66400164", "0.659829", "0.6580355", "0.65801775", "0.6550496", "0.6542632", "0.64996094", "0.64771783", "0.64708316", "0.6462895", "0.643861", "0.6430473", "0.6422668", "0.64162487", "0.64159346", "0.64140993", "0.6400388", "0.6381413", "0.63712937", "0.6366549", "0.6365191", "0.6365191", "0.63287115", "0.6295683", "0.6281415", "0.6276575", "0.626308", "0.6261684", "0.6257434", "0.622524", "0.62233454", "0.6216769", "0.6216612", "0.62019557", "0.61892074", "0.6179855", "0.6173592", "0.6167796", "0.6167135", "0.6162401", "0.6159594", "0.6147374", "0.6144389", "0.6137163", "0.6126841", "0.6123953", "0.6115195", "0.61139417", "0.6089812", "0.60643774", "0.6060189", "0.60540557", "0.6046278", "0.60342443", "0.6028912", "0.6018996", "0.601723", "0.6003381", "0.60024005", "0.59994715", "0.59954804", "0.5982929", "0.59593505", "0.5939946", "0.5935237", "0.5933129", "0.5931231", "0.59263843", "0.59225595", "0.59225595", "0.59225595", "0.592218", "0.5917259" ]
0.0
-1
Adjust the response headers and return the response.
protected function adjustResponseHeaders($response) { $requestsRemaining = $this->config['limit'] - $this->cache->get($this->config['keys']['requests']); if ($requestsRemaining < 0) { $requestsRemaining = 0; } $response->headers->set('X-RateLimit-Limit', $this->config['limit']); $response->headers->set('X-RateLimit-Remaining', $requestsRemaining); $response->headers->set('X-RateLimit-Reset', $this->cache->get($this->config['keys']['reset'])); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function sendHeaders()\n {\n http_response_code($this->response_status_code);\n\n // collect current headers into array\n $headers = headers_list();\n\n foreach ($headers as $h) {\n $h_parts = explode(\":\", $h);\n\n if (array_key_exists($h_parts[0], $this->response_headers)) {\n continue;\n }\n\n $this->response_headers[$h_parts[0]] = $h_parts[1];\n }\n\n // response type\n $this->response_headers[\"Content-Type\"] = $this->response_content_type;\n\n if (!is_null($this->response_content_charset)) {\n $this->response_headers[\"Content-Type\"] .= \"; charset=\" . $this->response_content_charset;\n }\n\n // by default remove php version\n unset($this->response_headers[\"X-Powered-By\"]);\n\n // put own headers\n header_remove();\n\n foreach ($this->response_headers as $key => $value) {\n header($key . \":\" . $value);\n }\n\n return;\n }", "public function outputRegularHeaders()\n {\n if (headers_sent()) {\n // headers have already been sent - this is an error\n $this->logger->error(\"Headers already sent!\");\n return;\n }\n\n\n if (!$this->client) {\n // client hasn't been used\n $this->logger->error(\"Client not used? (\" . __METHOD__ . \")\");\n return;\n }\n\n\n $response = $this->client->getResponse();\n\n // response code header\n header(\"HTTP/1.1 \" . $response->getResponseCode(), true );\n\n // Set-Cookie: headers if present\n if ($response->hasHeaders() ) {\n foreach ($response->getHeaders() as $name => $value) {\n\t //$this->logger->debug(\" >>\" . $name . \": \" . $value);\n \tif( $name != \"Set-Cookie\" && ( $name == \"Cache-Control\" || $name == \"Expires\" ) ) {\n \t\t// we process cookies separately, due to there being multiple headers\n\t\t\t\t\t$this->logger->debug(\"Setting header: \" . $name . \": \" . $value);\n\t\t\t\t\t//error_log( \"Setting header: \" . $name . \": \" . $value);\n\t\t\t\t\theader($name . \": \" . $value, true);\n \t}\n }\n }\n\n\n $this->outputCookieHeaders();\n\n // Location: header if required (if this is a redirect)\n if ($response->isRedirect() && $response->hasHeader(\"Location\")) {\n header(\"Location: \" . $response->getHeader(\"Location\"), true);\n }\n }", "public function outputHeaders()\n {\n if (headers_sent()) {\n // headers have already been sent - this is an error\n $this->logger->error(\"Headers already sent!\");\n return;\n }\n\n\n if (!$this->client) {\n // client hasn't been used\n $this->logger->error(\"Client not used? (\" . __METHOD__ . \")\");\n return;\n }\n\n\n $response = $this->client->getResponse();\n\n // response code header\n header(\"HTTP/1.1 \" . $response->getResponseCode(), true );\n\n // Set-Cookie: headers if present\n if ($response->hasHeaders() ) {\n foreach ($response->getHeaders() as $name => $value) {\n \tif( $name != \"Set-Cookie\" ) {\n \t\t// we process cookies separately, due to there being multiple headers\n\t\t\t\t\t//$this->logger->debug($name . \": \" . $value);\n\t\t\t\t\theader($name . \": \" . $value);\n \t}\n }\n }\n\n $this->outputCookieHeaders();\n\n // Location: header if required (if this is a redirect)\n if ($response->isRedirect() && $response->hasHeader(\"Location\")) {\n header(\"Location: \" . $response->getHeader(\"Location\"), true);\n }\n }", "function setHeaders()\n {\n header('Content-type: application/json');\n\n // Calculate Expires Headers if set to > 0\n $expires = $this->grav['config']->get('system.pages.expires');\n if ($expires > 0) {\n $expires_date = gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT';\n header('Cache-Control: max-age=' . $expires);\n header('Expires: '. $expires_date);\n }\n }", "private function respond()\n {\n $this->response->header('Content-Type', 'application/json');\n return $this->response;\n }", "public function send() {\n /** @var HeaderCollection $headers */\n $headers = Yii::$app->response->headers;\n $headers->removeAll();\n foreach ($this->getHeaders() as $_header => $lines) {\n $headers->add($_header, $this->getHeaderLine($_header));\n }\n Yii::$app->response->version = $this->getProtocolVersion();\n Yii::$app->response->statusCode = $this->getStatusCode();\n Yii::$app->response->statusText = $this->getReasonPhrase();\n Yii::$app->response->content = $this->getBody();\n\n Yii::$app->response->send();\n }", "protected static function get_response_headers()\n {\n }", "protected function outputHeaders() {\n $controlFlags = [];\n if (!$this->cacheable) {\n $controlFlags[] = 'no-store';\n $controlFlags[] = 'no-cache';\n } else {\n if ($this->revalidate) {\n $controlFlags[] = 'no-cache';\n $controlFlags[] = 'must-revalidate';\n }\n $controlFlags[] = $this->private ? 'private' : 'public';\n if ($this->age > 0) {\n $controlFlags[] = 'max-age=' . (int)round($this->age);\n }\n if (!empty($this->ETag)) {\n $this->setHeader('ETag', $this->ETag);\n }\n if (!is_null($this->modifiedDate)) {\n $this->setHeader('Last-Modified', $this->httpUtils->formatDateTime($this->modifiedDate));\n }\n }\n if (!empty($controlFlags)) {\n $this->setHeader('Cache-Control', implode(', ', $controlFlags));\n }\n parent::outputHeaders();\n }", "public function prepareResponse();", "function _setHeaders(){\n header(\"HTTP/1.1 \" . $this->CodeHTTP . \" \" . $this->_getStatusMessage());\n header(\"Content-Type: $this->ContentType\");\n }", "public function alter_header()\n\t{\n\t\theader(\"HTTP/1.0 $this->code $this->title\");\n\t}", "private function getResponse() {\n $this->response['status_code'] = $this->status->getStatusCode();\n $this->response['reason_phrase'] = $this->status->getReasonPhrase();\n \n $this->readHeaders();\n }", "private function addCommonHeader()\r\n {\r\n $this->response->headers['Allow'] = 'OPTIONS,GET,HEAD,POST,PATCH';\r\n $this->response->headers['Access-Control-Allow-Methods']='OPTIONS,GET,HEAD,POST,PATCH';\r\n $this->response->headers['Access-Control-Allow-Origin']='*';\r\n $this->response->headers['Access-Control-Allow-Headers']= 'Origin, X-Requested-With, Content-Type, Accept, Entity-Length, Offset';\r\n $this->response->headers['Access-Control-Expose-Headers']= 'Location, Range, Content-Disposition, Offset';\r\n }", "protected function sendHeaders()\n {\n if (headers_sent()) {\n return;\n }\n $headers = $this->getHeaders();\n foreach ($headers as $name => $values) {\n $name = str_replace(' ', '-', ucwords(str_replace('-', ' ', $name)));\n // set replace for first occurrence of header but false afterwards to allow multiple\n// $replace = true;\n foreach ($values as $value) {\n $this->responseBySwoole->header($name,$value);\n// header(\"$name: $value\", $replace);\n// $replace = false;\n }\n }\n $statusCode = $this->getStatusCode();\n// $this->responseBySwoole->header(\"HTTP/{$this->version} {$statusCode} {$this->statusText}\");\n $this->sendCookies();\n }", "private function configureResponseForInline($filename)\n {\n // For some reason, Zend won't allow me to remove these headers\n header('Pragma: ');\n header('Cache-Control: ');\n\n $this\n ->getResponse()\n ->setHeader('Content-Type', 'application/pdf')\n ;\n }", "function setResponse(){\n\t// Set the response message header\n\t// This example just sets a basic header response but you may need to \n\t// add some more checks, authentication, etc \n\t$header = array(\n\t\t'status'\t=> 'ok',\n\t\t'message'\t=> 'Service call was successful'\n\t);\n\t\n\treturn $header; \n}", "public function init()\n {\n $this->getResponse()->setHeader('Content-Type', 'application/json');\n $this->getResponse()->setHeader('Access-Control-Allow-Origin', '*');\n $this->getResponse()->setHeader('Access-Control-Expose-Headers', 'Link');\n }", "public function onResponse(FilterResponseEvent $event) {\n if (!$event->isMasterRequest()) {\n return;\n }\n $response = $event->getResponse();\n $response->headers->set('X-Commerce-Core', '2');\n }", "public function getResponseHeaders();", "public function onKernelResponse(ResponseEvent $event): void\n {\n if (!$event->isMainRequest()) {\n return;\n }\n\n $event->getResponse()->headers->set($this->headerName, $this->requestIdProvider->getCurrentRequestId());\n }", "public function sendHeaders()\n {\n\n $httpCodeSent = false;\n\n foreach ($this->_headersRaw as $header) {\n if (!$httpCodeSent && $this->_httpResponseCode) {\n echo \"HTTP/1.1 \" . $this->_httpResponseCode . \"\\n\"; // we don't actually sent the status code name\n echo $header . \"\\n\";\n $httpCodeSent = true;\n } else {\n echo $header . \"\\n\";\n }\n }\n\n foreach ($this->_headers as $header) {\n if (!$httpCodeSent && $this->_httpResponseCode) {\n echo \"HTTP/1.1 \" . $this->_httpResponseCode . \"\\n\";\n echo $header['name'] . ': ' . $header['value'] . \"\\n\"; // the \"replace\" value is ignored\n $httpCodeSent = true;\n } else {\n echo $header['name'] . ': ' . $header['value'] . \"\\n\"; // the \"replace\" value is ignored\n }\n }\n\n if (!$httpCodeSent) {\n echo \"HTTP/1.1 \" . $this->_httpResponseCode . \"\\n\";\n $httpCodeSent = true;\n }\n\n echo \"\\n\";\n\n return $this;\n }", "private static function setHeaders()\n {\n header('X-Powered-By: Intellivoid-API');\n header('X-Server-Version: 2.0');\n header('X-Organization: Intellivoid Technologies');\n header('X-Author: Zi Xing Narrakas');\n header('X-Request-ID: ' . self::$ReferenceCode);\n }", "private function setHeaders(){\n header('Cache-Control: no-cache, must-revalidate');\n header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');\n header('Content-type: application/json charset=utf8');\n }", "public function toResponse(): Response\n {\n $response = clone RequestContext::getResponse();\n return $response->setException($this->getException())->auto($this->handleBody(), $this->getStatusCode());\n }", "private function setHeaders()\n\t{\n\t\theader(\"Cache-Control: must-revalidate, max-age=12000\");\n\t\theader(\"Vary: Accept-Encoding\");\n\t\theader('Content-Type: text/plain; charset=utf-8');\n\t}", "private function response() {\n if ($this->responseStatus !== 200) {\n $this->request['format'] = self::DEFAULT_RESPONSE_FORMAT;\n }\n $method = $this->request['format'] . 'Response';\n $this->response = array('status' => $this->responseStatus, 'body' => $this->$method());\n return $this;\n }", "protected function sendHeaders()\n {\n // setup response code\n http_response_code($this->code);\n\n // send stored cookies\n foreach ($this->cookies as $cookie) {\n call_user_func_array('setcookie', array_values($cookie));\n }\n\n // send stored headers\n foreach ($this->headers as $key => $value) {\n header($key .': '. join(', ', $value));\n }\n }", "public function setHeaders() {\r\n\t\t$this->resource->setHeaders();\r\n\t}", "protected function sendHeaders()\n {\n $statusCode = $this->getStatusCode();\n $this->swoole_http_response->status($statusCode);\n if ($this->_headers) {\n $headers = $this->getHeaders();\n foreach ($headers as $name => $values) {\n // Swoole底层不允许设置相同$key的Http头\n $this->swoole_http_response->header($name, end($values));\n }\n }\n $this->sendCookies();\n }", "protected function send_headers() {\n header('Cache-Control: private, must-revalidate, pre-check=0, post-check=0, max-age=0');\n header('Expires: '. gmdate('D, d M Y H:i:s', 0) .' GMT');\n header('Pragma: no-cache');\n header('Accept-Ranges: none');\n }", "public function after()\n\t{\n\t\t// Set headers to not cache anything\n\t\t$this->response->headers('cache-control', 'no-cache, no-store, max-age=0, must-revalidate');\n\n\t\t// Set the content-type header\n\t\t$this->response->headers('content-type', 'application/json');\n\n\t\t// Set and encode the body data\n\t\t$this->response->body(json_encode($this->body));\n\t}", "protected function set_headers() {\n\t\t// Overwrite Content-Type header.\n\t\tif ( ! \\headers_sent() ) {\n\t\t\t\\header( 'Content-Type: ' . \\get_option( 'html_type' ) . '; charset=' . \\get_option( 'blog_charset' ) );\n\t\t}\n\n\t\t\\status_header( 404 );\n\t\t\\nocache_headers();\n\t}", "private function readHeaders() {\n $headers = $this->status->getHeaders();\n\n foreach ($headers as $key => $value) {\n switch ($key) {\n case \"Location\":\n $this->response['location'] = $value[0];\n break;\n\n case \"Content-Type\":\n $this->response['content_type'] = $value[0];\n break;\n\n case \"Content-Length\":\n $this->response['content_length'] = $value[0];\n break;\n\n default:\n break;\n }\n }\n }", "public function sendHeaders() {\n\n\t\t\tif($this->getHeadersIsSent()) {\n\t\t\t\ttrigger_error(\n\t\t\t\t\t'http response headers already sent, sending again',\n\t\t\t\t\tE_USER_WARNING\n\t\t\t\t);\n\t\t\t}\n\t\t\tforeach($this->getHeadersArray() as $header => $value) {\n\t\t\t\theader($header . ': ' . (string)$value);\n\t\t\t}\n\t\t\t$this->setHeadersIsSent();\n\t\t\treturn $this;\n\n\t\t}", "public function sendHeaders(){\n \n // canary...\n if(headers_sent()){ return; }//if\n \n return parent::sendHeaders();\n \n }", "public function addHeaders(Response $response = null);", "abstract public function SetHeaders();", "private function __send_response(){\n http_response_code($this->response_code);\n if($this->_redirect) header(\"Location: \".Config::WEB_DIRECTORY.\"{$this->_redirect_location}\");\n elseif($this->_JSON){\n header('Content-Type: application/json; charset=UTF-8');\n print json_encode($this->_JSON_contents, JSON_PRETTY_PRINT);\n }elseif($this->_HTML){\n if($this->_HTML_load_view) $this->_template->render();\n } /** @noinspection PhpStatementHasEmptyBodyInspection */ else{\n // Do nothing\n }\n }", "public function buildHeaders()\n {\n if ($this->use_cors) {\n if (strlen($this->cors_allow_origin) > 0) {\n header(\"Access-Control-Allow-Origin: $this->cors_allow_origin\");\n }\n if ($this->cors_with_credentials) {\n header('Access-Control-Allow-Credentials: true');\n } else {\n header('Access-Control-Allow-Credentials: false');\n }\n }\n\n // Cache Control RFC: https://tools.ietf.org/html/rfc7234\n if ($this->nb_request instanceof CNabuHTTPRequest &&\n ($nb_site_target = $this->nb_request->getSiteTarget()) instanceof CNabuSiteTarget\n ) {\n if (($max_age = $nb_site_target->getDynamicCacheEffectiveMaxAge()) !== false) {\n $expire_date = gmdate(\"D, d M Y H:i:s\", time() + $max_age);\n $this->setHeader('Expires', $expire_date . 'GMT');\n $this->setHeader('Cache-Control', \"max-age=$max_age\");\n $this->setHeader('User-Cache-Control', \"max-age=$max_age\");\n $this->setHeader('Pragma', 'cache');\n } else {\n $this->setHeader('Expires', 'Thu, 1 Jan 1981 00:00:00 GMT');\n $this->setheader('Cache-Control', 'no-store, no-cache, must-revalidate');\n $this->setHeader('Pragma', 'no-cache');\n }\n if ($nb_site_target->getAttachment() === 'T') {\n if (is_string($this->attachment_filename) && strlen($this->attachment_filename) > 0) {\n $this->setHeader('Content-Disposition', 'attachment; filename=' . $this->attachment_filename);\n } else {\n $this->setHeader('Content-Disposition', 'attachment');\n }\n }\n }\n\n if (($frame_options = $this->calculateFrameOptions()) !== null) {\n $this->setHeader('X-Frame-Options', $frame_options);\n }\n\n if (count($this->header_list) > 0) {\n foreach ($this->header_list as $name => $value) {\n header(\"$name: $value\");\n }\n }\n }", "public function respond() {\n\t\thttp_response_code($this->code);\n\n\t\t// Additional headers\n\t\tforeach ($this->head as $header) {\n\t\t\theader($header);\n\t\t}\n\n\t\t// Write the body\n\t\tforeach ($this->body as $toStringable) {\n\t\t\techo $toStringable;\n\t\t}\n\t}", "private function setBaseHeaders(Response $response)\n {\n $response->headers->set('Content-Type', 'application/json');\n $response->headers->set('Access-Control-Allow-Origin', '*');\n\n return $response;\n }", "private function setBaseHeaders(Response $response)\n {\n $response->headers->set('Content-Type', 'application/json');\n $response->headers->set('Access-Control-Allow-Origin', '*');\n\n return $response;\n }", "protected function output_headers()\n\t{\n\t\t$this->add_header('Content-type', $this->content_type);\n\t\tforeach ($this->_headers as $k=>$v) header($k.': '.$v);\n\t}", "public function send_headers()\n\t{\n\t\tif ( ! headers_sent())\n\t\t{\n\t\t\tif (isset($_SERVER['SERVER_PROTOCOL']))\n\t\t\t{\n\t\t\t\t// Use the default server protocol\n\t\t\t\t$protocol = $_SERVER['SERVER_PROTOCOL'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Default to using newer protocol\n\t\t\t\t$protocol = 'HTTP/1.1';\n\t\t\t}\n\n\t\t\t// HTTP status line\n\t\t\theader($protocol.' '.$this->status.' '.Request::$messages[$this->status]);\n\n\t\t\tforeach ($this->headers as $name => $value)\n\t\t\t{\n\t\t\t\tif (is_string($name))\n\t\t\t\t{\n\t\t\t\t\t// Combine the name and value to make a raw header\n\t\t\t\t\t$value = \"{$name}: {$value}\";\n\t\t\t\t}\n\n\t\t\t\t// Send the raw header\n\t\t\t\theader($value, TRUE);\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "protected function cleanHeaders()\n {\n //Clean up header\n $this->headers = ['Accept' => 'application/json'];\n }", "public function sendHeaders(): void\n\t{\n\t\tif ($this->httpResponse === null) {\n\t\t\tthrow new InvalidStateException(sprintf('Cannot send response without %s', Response::class));\n\t\t}\n\n\t\t// Send status code\n\t\t$this->httpResponse->setCode($this->getStatusCode());\n\n\t\t// Send headers\n\t\tforeach ($this->getHeaders() as $name => $values) {\n\t\t\tforeach ($values as $value) {\n\t\t\t\t$this->httpResponse->setHeader($name, $value);\n\t\t\t}\n\t\t}\n\t}", "public function apply($response): Response\n {\n UnionTypes::assert('response', $response, Response::class);\n\n foreach ($this->getHeaders() as $name => $values) {\n /** @var HeaderValue $header */\n foreach ($values as $header) {\n $response->headers->set($name, $header->getValue(), $header->isReplace());\n }\n }\n return $response;\n }", "protected function buildResponse()\n {\n $response = new Response('', 204);\n\n return $this->addHeaders($response, true );\n }", "public function evaluate()\n {\n $httpResponse = new Response();\n $httpResponse->setVersion($this->getHttpVersion());\n $httpResponse->setStatus($this->getStatusCode());\n $httpResponse->setHeaders(new Headers());\n\n foreach ($this->getHeaders() as $name => $value) {\n $httpResponse->setHeader($name, $value);\n }\n\n return implode(\"\\r\\n\", $httpResponse->renderHeaders()) . \"\\r\\n\\r\\n\";\n }", "public function onResponse(FilterResponseEvent $event)\n {\n if (!$this->isActive($event)) {\n return;\n }\n\n $request = $event->getRequest();\n $response = $event->getResponse();\n $content = $response->getContent();\n\n // convert content to content container\n if (!$content instanceof ResponseContainer) {\n $content = ResponseContainer::createAutoDetect($response);\n }\n\n // override http status code if needed\n $statusCode = $content->getStatusCode();\n if (!empty($statusCode)) {\n $response->setStatusCode($content->getStatusCode());\n }\n\n // set 204 header for empty content\n if ($content->isEmpty() && !$response->isRedirect()) {\n $response->setStatusCode(Response::HTTP_NO_CONTENT);\n $content->setStatusCode(Response::HTTP_NO_CONTENT);\n }\n\n // put statusCode in response and force 200 OK in header?\n if ($request->headers->has('X-Force-Status-Code-200')\n || ($request->getRequestFormat() == self::FORMAT_JSON && $request->query->has('callback'))\n ) {\n $content->setReturnStatusCode(true);\n $response->setStatusCode(Response::HTTP_OK);\n $response->headers->set('X-Status-Code', Response::HTTP_OK);\n }\n\n // serialize content container\n try {\n $context = new SerializationContext();\n $context->setSerializeNull(true);\n $format = $event->getRequest()->getRequestFormat();\n $contentSerialized = $this->serializer->serialize($content->toArray(), $format, $context);\n switch ($format) {\n case self::FORMAT_XML:\n $response->setContent($contentSerialized);\n break;\n default:\n $headers = $response->headers;\n $response = new JsonResponse(null, $response->getStatusCode());\n $response->headers = $headers;\n $response->setContent($contentSerialized);\n break;\n }\n } catch (\\Exception $e) {\n $response = new JsonResponse([\n 'error' => [\n 'code' => 'error.api.middleware',\n 'message' => $e->getMessage()\n ]\n ]);\n }\n\n // force empty output on a no-content response\n if ($content->isEmpty() && $response->isEmpty()) {\n $response->setContent('');\n }\n\n $event->setResponse($response);\n }", "public function dumpHeaders(): self\n {\n dump($this->response->getHeaders());\n\n return $this;\n }", "function deliver_response(){\n\n // --- Step 1: Initialize variables and functions\n //\n // Deliver HTTP Response\n // The desired HTTP response content type: [json, html, xml]\n // The desired HTTP response data\n\n\n header('HTTP/1.1 '.$this->response['status'] . // Set HTTP Response\n ' '.$this->http_response_code[$this->response['status'] ]);\n header('Content-Type: application/json; charset=utf-8'); // Set HTTP Response Content Type\n $json_response = json_encode($this->response['data']); // Format data into a JSON response\n echo $json_response; // Deliver formatted data\n }", "public function createResponseWriter();", "public function withResponse($request, $response)\n {\n $response->header('Content-Type', 'application/vnd.api+json');\n }", "public function withResponse($request, $response)\n {\n $response->header('Content-Type', 'application/vnd.api+json');\n }", "public function enableViaHeaders()\n {\n $this->typeResponseCode = true;\n\t}", "private function resetReponse()\n {\n $this->app->singleton(\"response\", function () {\n return new Response();\n });\n }", "function getResponseHeaders();", "public function sendHttpHeaders()\n {\n if (!$this->options['send_http_headers'])\n {\n return;\n }\n\n // status\n $status = $this->options['http_protocol'].' '.$this->statusCode.' '.$this->statusText;\n header($status);\n\n if (substr(php_sapi_name(), 0, 3) == 'cgi')\n {\n // fastcgi servers cannot send this status information because it was sent by them already due to the HTT/1.0 line\n // so we can safely unset them. see ticket #3191\n unset($this->headers['Status']);\n }\n\n if ($this->options['logging'])\n {\n $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Send status \"%s\"', $status))));\n }\n\n // headers\n if (!$this->getHttpHeader('Content-Type'))\n {\n $this->setContentType($this->options['content_type']);\n }\n foreach ($this->headers as $name => $value)\n {\n header($name.': '.$value);\n\n if ($value != '' && $this->options['logging'])\n {\n $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Send header \"%s: %s\"', $name, $value))));\n }\n }\n\n // cookies\n foreach ($this->cookies as $cookie)\n {\n setrawcookie($cookie['name'], $cookie['value'], $cookie['expire'], $cookie['path'], $cookie['domain'], $cookie['secure'], $cookie['httpOnly']);\n\n if ($this->options['logging'])\n {\n $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Send cookie \"%s\": \"%s\"', $cookie['name'], $cookie['value']))));\n }\n }\n // prevent resending the headers\n $this->options['send_http_headers'] = false;\n }", "public function sendHeaders()\n {\n if (headers_sent()) {\n return;\n }\n\n header(sprintf(\n 'HTTP/%s %s %s',\n $this->protocolVersion,\n $this->code,\n self::STATUS_TEXTS[$this->code]\n ));\n\n if (!isset($this->headers['Content-Type'])) {\n $this->addHeader(\n 'Content-Type',\n 'text/html; charset=' . $this->charset\n );\n } elseif ('text/' === substr($this->headers['Content-Type'], 0, 5)\n && false === strpos($this->headers['Content-Type'], 'charset')\n ) {\n $this->addHeader(\n 'Content-Type',\n $this->headers['Content-Type'] . '; charset=' . $this->charset\n );\n }\n\n foreach ($this->headers as $name => $value) {\n header($name . ': ' . $value, true);\n }\n\n foreach ($this->cookies as $cookie) {\n setcookie(\n $cookie->getName(),\n $cookie->getValue(),\n $cookie->getExpiresTime(),\n $cookie->getPath(),\n $cookie->getDomain(),\n $cookie->isSecure(),\n $cookie->isHttpOnly()\n );\n }\n }", "protected function _response() {}", "public function setHttpHeaders() {\n $this->_httpHeaders[] = \"Content-Type: application/json\";\n parent::setHttpHeaders();\n }", "public function output(): \\Maleficarum\\Response\\AbstractResponse {\n $contentType = $this->handler->getContentType();\n $body = $this->handler->getBody();\n\n // add typical response headers\n $this\n ->response\n ->setHeader('Content-Type', $contentType);\n\n // send the response\n $this\n ->response\n ->setContent((string)$body)\n ->send();\n\n return $this;\n }", "public function setResponseHeaders($headers)\n { \n // parse the given headers. \n $headers = $this->parseResponseHeaders($headers);\n \n // lowercase all keys in the array.\n $headers = Arrays::normalize($headers);\n if (is_array($this->responseHeaders)) {\n $headers = array_merge_recursive($this->responseHeaders, $headers);\n }\n \n $this->responseHeaders = $headers;\n }", "private function configureResponseForDownload($filename)\n {\n // For some reason, Zend won't allow me to remove these headers\n header('Pragma: ');\n header('Cache-Control: ');\n\n $this\n ->getResponse()\n ->setHeader('Content-Type', 'application/octet-stream')\n ->setHeader('Content-Disposition', sprintf('attachment; filename=\"%s\"', $filename))\n ;\n }", "public function sendResponse()\n {\n $this->_response = Mage::app()->getResponse();\n\n //check redirect\n if ($this->_response->isRedirect()) {\n $headers = $this->_response->getHeaders();\n $redirect = '';\n foreach ($headers as $header) {\n if (\"Location\" == $header[\"name\"]) {\n $redirect = $header[\"value\"];\n break;\n }\n }\n if ($redirect) {\n $this->setRedirect($redirect);\n }\n }\n\n $this->_response->clearHeaders();\n $this->_response->setHeader('Content-Type', 'application/json');\n $this->_response->clearBody();\n $this->_response->setBody($this->toJson());\n $this->_response->sendResponse();\n exit;\n }", "protected function sendResponse() {}", "public function setHeaders() {\n\t\tif($_SERVER['REQUEST_METHOD'] == \"OPTIONS\") {\n\t\t\t// if($_SERVER['HTTP_ORIGIN'] == \"https://cpbphotography.com\" || $_SERVER['HTTP_ORIGIN'] == \"http://cpbphotography.com\") {\n\t\t\tif($_SERVER['HTTP_ORIGIN'] == \"http://localhost:8080\") {\n\t\t\t\theader('Access-Control-Allow-Origin: *');\n\t\t\t\theader('Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS');\n\t\t\t\theader('Access-Control-Allow-Headers: Access-Control-Allow-Origin, Access-Control-Allow-Headers, Origin, X-Requested-With, Content-Type, X-Auth-Token, Authorization');\n\t\t\t\theader('Access-Control-Max-Age: 1728000');\n\t\t\t\theader(\"Content-Length: 0\");\n\t\t\t\theader('Access-Control-Allow-Credentials: true');\n\t\t\t\texit(0);\n\t\t\t} else {\n\t\t\t header(\"HTTP/1.1 403 Access Forbidden\");\n\t\t\t header(\"Content-Type: text/plain\");\n\t\t\t echo \"You cannot repeat this request\";\n\t\t\t}\n\n\t\t}\n\t\theader('Access-Control-Allow-Origin: *');\n\t\theader(\"Access-Control-Allow-Credentials: true\");\n\t\theader('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');\n\t\theader('Access-Control-Max-Age: 1000');\n\t\theader('Access-Control-Allow-Headers: Access-Control-Allow-Origin, Access-Control-Allow-Headers, Origin, X-Requested-With, Content-Type, X-Auth-Token, Authorization');\n\n\t\theader('Content-Type: application/json');\n\t}", "public function proxyHttpHeaders($override = []) {\n foreach (array_merge(self::getHeadersFromCurlResponse($this->lastCurlResponse),\n $override) as $hName => $hValue) {\n switch ($hName) {\n case 'Content-Encoding':\n case 'Transfer-Encoding':\n break; //Skip Header\n case 'Location':\n $hValue = $this->fixURLs($hValue);\n break;\n case 'Content-Type':\n $this->format = $this->contentTypeToFormat($hValue);\n default:\n header($hName . ': ' . $hValue);\n break;\n }\n }\n }", "public function getResponse()\n\t{\n\t\t$outGoingResponse = $this->response;\n\t\t$request = $this->request;\n\n\t\t$headers = $outGoingResponse->getHeaders();\n\t\t$status_code = (isset($headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS])) ? $headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS] : 200;\n\t\tunset($headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS]);\n\n\t\t$response = new Response(trim($outGoingResponse->getStream()), $status_code, array_filter($headers));\n\t\t$response->prepare($request->getRequest());\n\n\t\treturn $response;\n\t}", "public static function headers($mime, $cleanup = TRUE)\n\t{\n\t\tif ( ! headers_sent())\n\t\t{\n\t\t\t$response = Request::current()->response();\n\n\t\t\tif ($cleanup === TRUE)\n\t\t\t{\n\t\t\t\t// Remove any existing headers from response\n\t\t\t\t$response->headers(array());\n\t\t\t}\n\n\t\t\t$response->headers('Last-Modified', gmdate('D, d M Y H:i:s').' GMT');\n\n\t\t\tif (Ku_AJAX::$iframe === TRUE)\n\t\t\t{\n\t\t\t\tself::_wrap_response();\n\t\t\t\t// Force iframe mode\n\t\t\t\t$mime = 'html';\n\t\t\t}\n\n\t\t\tif ($mime == 'json')\n\t\t\t{\n\t\t\t\t$response->headers('Content-Transfer-Encoding', '8bit');\n\t\t\t}\n\n\t\t\t$mime = Kohana::$config->load('mimes.'.$mime);\n\n\t\t\t$response->headers('Content-Type', $mime[0].'; charset='.Kohana::$charset);\n\t\t\t$response->headers('Content-Length', strlen($response->body()));\n\t\t\tif (Request::current()->method() !== Request::GET)\n\t\t\t{\n\t\t\t\t$response->headers('Cache-Control', 'no-store, no-cache, must-revalidate');\n\t\t\t\t$response->headers('Pragma', 'no-cache');\n\t\t\t}\n\t\t}\n\t}", "public function as_response() {\n return Net_HTTP::Response($this);\n }", "private function _sendPrimaryHeaders() {\n\t\theader(\"Access-Control-Allow-Origin: \".Environment::$api->allowOrigin);\n\t\theader(\"Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS\");\n\t\theader(\"Access-Control-Allow-Headers: Origin, Content-Type, Authorization, X-Custom-Auth\");\t\n\t}", "public function renderResponse()\n {\n $cache = null;\n $request = $this->_options->getRequest();\n\n if ($this->_options->getApc()) {\n $cache = new Cache\\Apc($request->getCacheId());\n $content = $cache->load();\n\n if (false !== $content) {\n $this->_display($content, $this->_options->getGzip());\n }\n }\n\n $content = $this->_buildContent($request);\n\n if ($this->_options->getGzip()) {\n // Apply gzip encoding with compression level \"9\"\n $content = gzencode($content, 9);\n }\n\n if ($cache) {\n $cache->store($content, $this->_options->getCacheTtl());\n }\n\n $this->_display($content, $this->_options->getGzip());\n }", "protected function setHeaders() {\n\t\tif(!self::$headerIncluded) {\n\n\t\t\tif($this->settings['includes']['jquery'])\n\t\t\t\t$this->response->addAdditionalHeaderData('<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js\"></script>');\n\n if($this->settings['includes']['mediaelement'])\n\t\t\t $this->response->addAdditionalHeaderData('<script type=\"text/javascript\" src=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/mediaelement-and-player.min.js\"></script>');\n\n\t\t\tif($this->settings['includes']['jquery-resize'])\n\t\t\t\t$this->response->addAdditionalHeaderData('<script type=\"text/javascript\" src=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/jquery.ba-resize.min.js\"></script>');\n\t\t\tif($this->settings['includes']['modernizr'])\n\t\t\t\t$this->response->addAdditionalHeaderData('<script type=\"text/javascript\" src=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/modernizr-2.5.3.js\"></script>');\n\t\t\t\t\t\t\n\t\t\tif($this->settings['includes']['css'])\n\t\t\t\t$this->response->addAdditionalHeaderData('<link rel=\"stylesheet\" href=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/CSS/tx-vibeo.css\" />');\n\n if($this->settings['includes']['mediaelement-css'])\n\t\t\t $this->response->addAdditionalHeaderData('<link rel=\"stylesheet\" href=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/mediaelementplayer.css\" />');\n\n if($this->settings['includes']['mediaelement-skin-css'])\n $this->response->addAdditionalHeaderData('<link rel=\"stylesheet\" href=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/skin-gray.css\" />');\n\n\t\t\tself::$headerIncluded = true;\n\t\t}\n\t}", "function send_response($response)\n {\n header(\"Cache-Control: no-cache, must-revalidate\"); // HTTP/1.1\n header(\"Expires: Sat, 26 Jul 1997 05:00:00 GMT\"); // Date in the past\n header(\"Content-type: application/json; charset=utf-8\");\n echo $response;\n }", "public function onKernelResponse(FilterResponseEvent $event)\n {\n if (isset($this->lastModifiedDate)) {\n $event->getResponse()->setLastModified($this->lastModifiedDate);\n }\n }", "public function headers() {\n\n $template = $this->template();\n if(isset($this->kirby->options['headers'][$template])) {\n $headers = $this->kirby->options['headers'][$template];\n\n if(is_numeric($headers)) {\n header::status($headers);\n } else if(is_callable($headers)) {\n call($headers, $this);\n }\n\n } else if($this->isErrorPage()) {\n header::notfound();\n }\n\n // send the header of the representation\n if($representation = $this->representation()) {\n if($mime = f::extensionToMime($representation)) header::type($mime);\n }\n\n }", "public function sendHttpHeaders() {}", "public function onKernelResponse(FilterResponseEvent $event)\n {\n if (!$token = $event->getRequest()->attributes->get('auth_token')) {\n return;\n }\n $response = $event->getResponse();\n\n // create a hash and set it as a response header\n $hash = sha1($response->getContent().$token);\n $response->headers->set('X-Content-Hash', $hash);\n }", "public function populate_headers() {\n // If header is already defined, return it immediately\n if (!empty($this->headers)) {\n return;\n }\n\n // In Apache, you can simply call apache_request_headers()\n if (function_exists('apache_request_headers')) {\n $this->headers = apache_request_headers();\n } else {\n isset($_SERVER['CONTENT_TYPE']) && $this->headers['Content-Type'] = $_SERVER['CONTENT_TYPE'];\n\n foreach ($_SERVER as $key => $val) {\n if (sscanf($key, 'HTTP_%s', $header) === 1) {\n // take SOME_HEADER and turn it into Some-Header\n $header = str_replace('_', ' ', strtolower($header));\n $header = str_replace(' ', '-', ucwords($header));\n\n $this->headers[$header] = $val;\n $this->header_map[strtolower($header)] = $header;\n }\n }\n }\n\n }", "function output() {\n if (isset($this->status)) {\n $this->send_header(sprintf('HTTP/1.1 %d %s',\n $this->status, $this->reason),\n TRUE,\n $this->status);\n }\n\n foreach ($this->headers as $k => $v) {\n $this->send_header(\"$k: $v\");\n }\n\n echo $this->body;\n }", "protected function sendResponse() {\n $this->eventManager->triggerEvent(self::EVENT_PRE_RESPONSE, array('web' => $this));\n\n $this->setSessionCookie();\n\n $this->renderView();\n\n // send the response\n if ($this->log) {\n $this->log->logDebug('Sending response', 'Status code ' . $this->response->getStatusCode(), System::LOG_SOURCE);\n\n $headers = $this->response->getHeaders();\n foreach ($headers as $header) {\n $this->log->logDebug('Sending header', $header, System::LOG_SOURCE);\n }\n\n $cookies = $this->response->getCookies();\n foreach ($cookies as $cookie) {\n $this->log->logDebug('Sending header', Header::HEADER_SET_COOKIE . ': ' . $cookie, System::LOG_SOURCE);\n }\n\n $view = $this->response->getView();\n if ($view) {\n $this->log->logDebug('Rendering and sending view', get_class($view), System::LOG_SOURCE);\n }\n }\n\n $this->response->send($this->request);\n\n $this->eventManager->triggerEvent(self::EVENT_POST_RESPONSE, array('web' => $this));\n\n $this->writeSession();\n }", "public static function set_headers()\n {\n }", "private function writeHeaders() {\n if( is_null($this->Headers) ) return;\n\n foreach($this->Headers as $hd) {\n header($hd);\n }\n\n header(\"Content-Type: \". $this->ContentType .\"; charset=\". $this->Charset .\"\");\n }", "public function sendHeaders() {}", "public function onKernelResponse(ResponseEvent $event): void\n {\n if (!$event->isMasterRequest()) {\n return;\n }\n\n $response = $event->getResponse();\n if ($response) {\n $response->headers->set('Access-Control-Allow-Origin', '*');\n $response->headers->set('Access-Control-Allow-Methods', 'GET,POST,PUT,PATCH');\n $response->headers->set('Access-Control-Allow-Headers', 'content-type,x-requested-with,BY-CLIENT-ID,BY-SESSION-ID');\n }\n }", "public function registerHeaders(Zend_Controller_Response_Http $response,\n Zend_View_Abstract $view)\n {\n \n }", "public function setHeaders()\n {\n }", "public static function getCORSSymfonyResponse()\n {\n return new \\Symfony\\Component\\HttpFoundation\\Response('', 200, static::getCORSResponseHeaders());\n }", "public function run()\n\t{\n\t\t// Proxy requests, write headers, and then render response\n\t\treturn $this\n\t\t\t->request()\n\t\t\t->response()\n\t\t;\n\t}", "public function index() : Response\n {\n $results = $this->processIndex();\n\n //return the response + transform it if needed\n return $this->response($results);\n }", "public function sendHeaders()\n {\n $codes = $this->getHttpResponseCodes();\n\n if ($this->isValidRedirectStatus()) {\n throw new InvalidRedirectStatusCodeException(\n 'You cannot send a redirect using a regular response. Use $this->response->redirect(url, status);'\n );\n }\n $string = 'HTTP/1.0 ' . $this->status . ' ' . $codes[$this->status];\n\n header($string);\n $this->outputHeaders();\n }", "public function index()\n {\n $this->response->setHeader('Access-Control-Allow-Origin', '*');\n $this->response->setHeader('Access-Control-Allow-Headers', 'X-Requested-With');\n $this->response->setHeader('Access-Control-Allow-Headers', 'Authorization');\n $this->response->sendHeaders();\n $this->response->setFileToSend('docs/api-doc.json');\n\n return $this->response;\n }", "private function _initializeResponseHeaders()\n {\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_CONTENTTYPE] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_CONTENTLENGTH] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_ETAG] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_CACHECONTROL] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_LASTMODIFIED] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_LOCATION] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS_CODE] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS_DESC] = null;\n $this->_dataServiceVersion = null;\n }", "public function getRawResponseHeaders() {\n\t}", "public function\n\t\tsend_http_headers()\n\t{\n\t\tparent::send_http_headers();\n\t\t\n\t\t/*\n\t\t * Make sure that the user is logged in.\n\t\t */\n\t\t$alm = Admin_LoginManager::get_instance();\n\t\t\n\t\tif (!$alm->is_logged_in()) {\n\t\t\t$_SESSION['admin-login-data']['desired-url'] = new HTMLTags_URL();\n\t\t\t\n// $_SESSION['admin-login-data']['desired-url']->set_file('/hc/admin/navigation.html');\n\t\t\t$_SESSION['admin-login-data']['desired-url']->set_file('/Admin_StartPage');\n\t\t\t\n\t\t\t$redirection_manager = new PublicHTML_RedirectionManager();\n\t\t\t$redirection_url = $redirection_manager->get_url();\n\t\t\t\n\t\t\t$redirection_url->set_file('/hc/admin/login.html');\n\t\t\t\n\t\t\t$location_header_line = 'Location: ' . $redirection_url->get_as_string();\n\t\t\t\n\t\t\theader($location_header_line);\n\t\t\texit;\n\t\t}\n\t}", "public function index()\n\t{\n\t\t$contents = Wager::all();\n\t\t$statusCode = 200;\n\t\t$value = 'application/json';\n\n\t\t$response = Response::make($contents, $statusCode);\n\t\t$response->header('Content-Type', $value);\n\n\t\treturn $response;\n\t}", "public function toResponse()\n {\n $request = $this->request();\n $partialData = $request->getHeader('X-Inertia-Partial-Data');\n $only = array_filter(\n explode(',', $partialData ? $partialData->getValue() : '')\n );\n\n $partialComponent = $request->getHeader('X-Inertia-Partial-Component');\n $props = ($only && ($partialComponent ? $partialComponent->getValue() : '') === $this->component)\n ? Helpers::arrayOnly($this->props, $only)\n : $this->props;\n\n array_walk_recursive($props, static function (&$prop) {\n $prop = Helpers::closureCall($prop);\n });\n\n $page = [\n 'component' => $this->component,\n 'props' => $props,\n 'url' => $request->getURL(),\n 'version' => $this->version ? $this->version : 0,\n ];\n $json = json_encode($page);\n\n $response = new HTTPResponse();\n if ($request->getHeader('X-Inertia')) {\n $response->setBody($json);\n $response->addHeader('Vary', 'Accept');\n $response->addHeader('X-Inertia','true');\n return $response;\n } else {\n $controller = Controller::curr();\n $processed = $controller->renderWith($this->rootView, $this->viewData + ['page' => $page, 'pageJson' => $json]);\n $response->setBody($processed);\n return $response;\n }\n }", "protected function sendHeaders()\n {\n if (!$this->swoole) {\n return;\n }\n if ($this->isSent) {\n return;\n }\n $statusCode = $this->getStatusCode();\n $this->swoole->status($statusCode);\n\n if ($this->_headers) {\n $headers = $this->getHeaders();\n foreach ($headers as $name => $values) {\n $name = str_replace(' ', '-', ucwords(str_replace('-', ' ', $name)));\n // set replace for first occurrence of header but false afterwards to allow multiple\n foreach ($values as $value) {\n $this->swoole->header($name, $value);\n }\n }\n }\n $this->sendCookies();\n }" ]
[ "0.72100633", "0.70166314", "0.6617447", "0.65059", "0.6494378", "0.6429676", "0.64204526", "0.6357893", "0.63467634", "0.63161814", "0.6305381", "0.6291304", "0.62866765", "0.6254819", "0.61898685", "0.61814004", "0.61748695", "0.6126393", "0.6121223", "0.6117924", "0.61154103", "0.61061496", "0.60962486", "0.6096228", "0.607072", "0.60702574", "0.60627615", "0.6034679", "0.6032536", "0.60205835", "0.60137624", "0.59919894", "0.5981252", "0.5960659", "0.5959869", "0.5939766", "0.5918803", "0.5913101", "0.5903212", "0.59020513", "0.58972526", "0.58972526", "0.5888854", "0.5836313", "0.5780235", "0.57777345", "0.5758852", "0.57483536", "0.57460016", "0.5725117", "0.5724825", "0.5720637", "0.5714836", "0.57083774", "0.57083774", "0.56961495", "0.568175", "0.56813645", "0.56743944", "0.56648386", "0.5661478", "0.5656734", "0.5652299", "0.5635548", "0.56296456", "0.56176674", "0.56014484", "0.55935436", "0.55935395", "0.5593494", "0.55785096", "0.5577903", "0.557717", "0.5575687", "0.5575128", "0.55687225", "0.5565168", "0.55635417", "0.5561124", "0.5560166", "0.55595624", "0.5558276", "0.5556616", "0.5539494", "0.55369246", "0.55340797", "0.55246097", "0.55115134", "0.5509001", "0.5508005", "0.55056787", "0.54950076", "0.5474775", "0.54708135", "0.5469236", "0.5467322", "0.5464801", "0.5464461", "0.54634315", "0.54599684" ]
0.6186615
15
Determine if the client has exceeded their rate limit.
protected function exceededRateLimit() { return $this->cache->get($this->config['keys']['requests']) > $this->config['limit']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function isRateLimitReached()\n {\n if (!$this->getRateLimit()) {\n throw new InstagramThrottleException('400 Bad Request : You have reached Instagram API Rate Limit', 400);\n }\n }", "public function isLimitExceeded();", "public function isAPICallLimitErr() {\n // create implementation of this function inside gogoLib for trademe\n // it's easier to hook it there for api call limit checks\n // also if call limit occurs. create log at /var/tragento/apicalllimit.log\n // with dates. than when running new cron process check if date in call is less than 1 hour.\n // actually check if it is in current hour. if current hour than don't execute tragento cron\n // it's nice but requires coding time. don't overcomplicate error handling\n\n // $response->is_ok()\n // $response->error_message()\n // You have exceeded your API call quota for the current hour\n // it's a state for the life of trademe model. when api limit reached it can't be changed to ok later.\n // hovewer in next 5 minutes there will be another call from cron with clear state\n return $this->trademe->isAPICallLimitErr();\n }", "public function isRequestLimitReached(): bool\n {\n if ($this->requestLimit === 0) {\n return true;\n }\n return app(RateLimiter::class)->tooManyAttempts($this->rateLimiterKey, $this->requestLimit, $this->decayTime);\n }", "public function isLimited()\n {\n return ($this->limit > 0);\n }", "public function limitExceeded(): bool\n {\n return $this->limit !== 0 && $this->users()->count() >= $this->limit;\n }", "public function isRateLimitEnabled(): bool\n {\n return $this->rateLimitEnabled === true;\n }", "protected function rateLimitingDisabled()\n {\n return $this->config['limit'] == 0;\n }", "public function hasTimeLimitReached(): bool;", "private function _checkRateLimit()\n {\n if (empty(self::$_responseHeaders))\n {\n return;\n }\n\n // Default the $limit and $remaining values if not set in the last response header.\n /** @var int $limit */\n $limit = isset(self::$_responseHeaders[self::RATE_LIMIT])\n ? (int)self::$_responseHeaders[self::RATE_LIMIT]\n : self::DEFAULT_RATE_LIMIT;\n\n /** @var int $remaining */\n $remaining = isset(self::$_responseHeaders[self::RATE_LIMIT_REMAINING])\n ? (int)self::$_responseHeaders[self::RATE_LIMIT_REMAINING]\n : self::DEFAULT_RATE_LIMIT;\n\n // If no API calls have been made, no need to delay.\n if ($limit == $remaining)\n {\n return;\n }\n\n // If we are below 5% remaining, sleep for 0.50 seconds.\n if ($remaining / $limit < 0.05)\n {\n usleep(500000);\n return;\n }\n\n // If we are below 10% remaining, sleep for 0.25 seconds.\n if ($remaining / $limit < 0.1)\n {\n usleep(250000);\n }\n }", "protected function timeExceeded() {\n if ($this->timeLimit == 0) {\n return FALSE;\n }\n $time_elapsed = time() - REQUEST_TIME;\n $pct_time = $time_elapsed / $this->timeLimit;\n if ($pct_time > $this->timeThreshold) {\n $this->showMessage(\n t('Time limit approaching, starting new batch',\n array('!pct' => round($pct_time*100),\n '!usage' => format_size($time_elapsed),\n '!limit' => format_size($this->timeLimit))),\n 'warning');\n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "public function getLimitReached() {\n return $this->_limitReached = (((int) self::model()->countByAttributes(array('ip'=>$this->ipAddr))) >= self::MAX_REQUESTS);\n }", "private function _checkRequestLimit($clientId)\n {\n // no data in storage - no danger:\n if(!isset($this->_requestStorage[$clientId]))\n {\n $this->_requestStorage[$clientId] = array(\n 'lastRequest' => time(),\n 'totalRequests' => 1\n );\n return true;\n }\n \n // time since last request > 1min - no danger:\n if(time() - $this->_requestStorage[$clientId]['lastRequest'] > 60)\n {\n $this->_requestStorage[$clientId] = array(\n 'lastRequest' => time(),\n 'totalRequests' => 1\n );\n return true;\n }\n \n // did requests in last minute - check limits:\n if($this->_requestStorage[$clientId]['totalRequests'] > $this->_maxRequestsPerMinute)\n {\n return false;\n }\n \n $this->_requestStorage[$clientId]['totalRequests']++;\n return true;\n }", "public function check_rate_limit( $echo = FALSE ){\n\n\t\t\t// check rate-limiting (per IP)\n\t\t\t$raw_response = wp_remote_get( $this->api_urls['ratelimit'], array( 'sslverify' => $this->sslverify ) );\n\n\t\t\tif( is_wp_error( $raw_response ) ){\n\n\t\t\t\t$this->error = TRUE;\n\t\t\t\t$this->set_error(\n\t\t\t\t\t\t'warning',\n\t\t\t\t\t\tsprintf( '%s: %s', __( 'An error occurred while fetching the rate-limit', self::LANG ), $raw_response->get_error_message() )\n\t\t\t\t);\n\n\t\t\t} else {\n\n\t\t\t\t$headers = &$raw_response['headers'];\n\n\t\t\t\tself::$api_calls_remaining = $headers['x-ratelimit-remaining'];\n\t\t\t\tself::$api_calls_ratelimit = $headers['x-ratelimit-limit'];\n\n\t\t\t\tif( 0 >= self::$api_calls_remaining ){\n\n\t\t\t\t\t$this->error = TRUE;\n\t\t\t\t\t$this->set_error( 'warning', sprintf( __( 'Rate limit of %d api-calls is exceeded.', self::LANG ), self::$api_calls_ratelimit ) );\n\t\t\t\t\treturn FALSE;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn ( FALSE !== $echo ) ? sprintf( '%d out of %d api calls remaining.', self::$api_calls_remaining, self::$api_calls_ratelimit ) : TRUE;\n\n\t\t}", "public function is_user_over_quota()\n {\n }", "protected function abortIfApiLimitReached()\n {\n if($this->request_limit_reached_on && date('Y-m-d h:i', strtotime($this->request_limit_reached_on . \" +10 minutes\")) > date('Y-m-d h:i', time())) {\n $this->requestStatus = false;\n return $this;\n //throw new ErplySyncException('API request limit error reached on: ' . $this->request_limit_reached_on, self::API_REQUEST_LIMIT_PER_HOUR_ERR_CODE);\n }\n }", "public function isBalanceExceeded()\n {\n return self::BALANCE_EXCEEDED === $this->code;\n }", "private function isTimeLimitReached() \n {\n return $this->timeLimit < (microtime(true) - $this->startTime);\n }", "public function limit()\n {\n return self::get() >= Config::get('krisawzm.demomanager::limit', 500);\n }", "function sizeLimitExceeded()\n {\n return ($this->getErrorCode() == 4);\n }", "public function limit()\n {\n if ($response = $this->request('limit')) {\n if (isset($response->limit) && $response->limit == true) {\n return $response->limit;\n }\n }\n return false;\n }", "private function checkApiRequestsLimit()\n {\n $tempTime = time() - $this->startTime;\n if($this->apiRequestsCount >= $this->apiRequestsLimit && $tempTime < $this->apiTimeLimit) {\n usleep(($this->apiTimeLimit - $tempTime)*1000000);\n $this->apiRequestsCount = 1;\n $this->startTime = time();\n } else {\n $this->apiRequestsCount++;\n }\n }", "public function isLimitReached(Event $event) :bool\n {\n return $event->is_limit_reached;\n }", "static public function IsRequestTimeoutReached() {\n return (time() - $_SERVER[\"REQUEST_TIME\"]) >= self::GetExpectedConnectionTimeout();\n }", "public function isExceededAttempts()\n { \n $attempts = $this->con->prepare(\"SELECT attempts, last_attempts FROM login_attempts WHERE user_id = ? AND ip = ? \");\n $attempts->bind_param('is', $this->user_id, $this->ip);\n $attempts->execute();\n $attempts->store_result();\n $attempts->bind_result( $number_attempts, $last_attempts);\n $attempts->fetch();\n $rows_attempts = $attempts->num_rows;\n $attempts->free_result();\n $attempts->close();\n \n if( $attempts and $rows_attempts > 0)\n {\n $last_attempts = $this->calcIntervalAttempts($last_attempts);\n if($number_attempts >= self::$max_attempts and $last_attempts <= self::$time_bloq)\n {\n return self::$time_bloq - $last_attempts;\n } \n else\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n }", "public function isDownloadLimitReached() {\r\n\t\treturn ($limit = $this->get('download_limit')) && $this->get('hits', 0) >= $limit;\r\n\t}", "public function getRateLimitLimit(): int\n {\n return $this->httpClient->getRateLimitLimit();\n }", "protected function limitCallRate()\n {\n if (!$this->callRateLimit) {\n return;\n }\n $now = microtime(true);\n $callIntervalActual = $now - $this->callTimeLast;\n $callIntervalNeeded = 1 / $this->callRateLimit;\n $callDelayNeeded = $callIntervalNeeded - $callIntervalActual;\n if ($callDelayNeeded > 0) {\n usleep($callDelayNeeded * 1000000); // Seconds to microseconds\n }\n $this->callTimeLast = $now;\n }", "public function hasQuotaUnlock(){\n return $this->_has(10);\n }", "protected function limit()\n {\n if (count($this->clients) > $this->limit)\n {\n $this->log->info(\"Limit connection exceeded!\");\n\n $this->conn->send('Limit connection exceeded!');\n\n $this->conn->close();\n }\n }", "function rate_limit($key, $interval, $max, $error = 'Slow down a bit, yo.')\n{\n $unit = round(time() / $interval);\n $key .= '-'.$unit;\n $count = 0;\n\n if (apcu_exists($key)) {\n $count = apcu_fetch($key);\n if ($count >= $max) {\n throw new Exception($error);\n }\n }\n\n $count++;\n apcu_store($key, $count, $interval);\n\n return $count;\n}", "function rate_limit($key, $interval, $max, $error = 'Slow down a bit, yo.')\n{\n $unit = round(time() / $interval);\n $key .= '-'.$unit;\n $count = 0;\n\n if (apcu_exists($key)) {\n $count = apcu_fetch($key);\n if ($count >= $max) {\n throw new Exception($error);\n }\n }\n\n $count++;\n apcu_store($key, $count, $interval);\n\n return $count;\n}", "static public function IsRequestMemoryLimitReached() {\n if (self::$memoryLimit === false) {\n return false;\n }\n return memory_get_peak_usage(true) >= self::$memoryLimit;\n }", "public function checkSendQuota()\n {\n try {\n $SesClient = new SesClient([\n 'profile' => $this->profile,\n 'version' => $this->version,\n 'region' => $this->region\n ]);\n $result = $SesClient->getSendQuota([]);\n $send_limit = $result[\"Max24HourSend\"];\n $sent = $result[\"SentLast24Hours\"];\n $available = $send_limit - $sent;\n //print(\"<p>You can send \" . $available . \" more messages in the next 24 hours.</p>\");\n //var_dump($result);\n } catch (AwsException $e) {\n throw new AwsException ($e->getMessage());\n }\n\n return $available;\n }", "public function clientErrorOccurred(): bool\n {\n return $this->getStatusCode() >= 400 && $this->getStatusCode() < 500;\n }", "function ratelimit($userid,$conn){\n $sql=\"SELECT COUNT(userId) AS total FROM message AS m WHERE m.userId = $userid AND m.timePlaced >= now() - interval 5 minute\";\n\n $result = $conn->query($sql);\n\n $total=$result->fetch_assoc()['total'];\n if ($total<=5){\n return true;\n }else{\n return false;\n }\n}", "protected function checkLimits()\n {\n if ($this->isTimeLimit() || $this->isJobLimit()) {\n $this->stop();\n }\n }", "function _checkMaxLimt()\r\n {\r\n if ($this->data[$this->name]['max_limit'] >= $this->data[$this->name]['min_limit']) {\r\n return true;\r\n }\r\n return false;\r\n }", "protected function isTimeLimit(): bool\n {\n return (microtime(true) - $this->startTime) > $this->options->timeLimit;\n }", "public function areClientsLimitedToScopes()\n {\n return $this->limitClientsToScopes;\n }", "public function hasLimit()\n {\n //check is little different than other stuff\n return ($this->_count > 0 || $this->_offset > 0);\n }", "public function hasUserLimit()\n {\n return $this->user_limit !== null;\n }", "public function checkCreditLimit() {\n \n Mage::getModel('storesms/apiClient')->checkCreditLimit(); \n \n }", "public function clientError()\n {\n return $this->status() >= 400 && $this->status() < 500;\n }", "public function getRateLimitRemaining()\n {\n return $this->rateLimitRemaining;\n }", "protected function isOverTotalLimit($user) {\n\t\tif($this->totalLimit) {\n\t\t\t$current = $this->getTotalRequests($user);\n\t\t\tif($current >= $this->totalLimit->limit) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private function _is_api_request_allowed()\n\t{\n\t\t// STEP 1: Check to see if site is private\n\t\tif(Kohana::config('settings.private_deployment'))\n\t\t{\n\t\t\tif ( ! $this->_login())\n\t\t\t{\n\t\t\t\t// @todo better error message\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// STEP 2: Check if the IP has been banned\n\t\t$banned_count = ORM::factory('api_banned')\n\t\t\t\t\t\t->where('banned_ipaddress', $this->request_ip_address)\n\t\t\t\t\t\t->count_all();\n\n\t\tif ($banned_count > 0)\n\t\t\treturn FALSE;\n\n\t\t// STEP 3: Check if the IP address has exceeded the request quota\n\n\t\t// Get the API settings\n\t\t$api_settings = new Api_Settings_Model(1);\n\n\t\t// Check if an API request quota has been set\n\t\tif ( ! isset ($api_settings->max_requests_per_ip_address))\n\t\t\treturn TRUE;\n\n\t\t// Get the API request quota\n\t\t$request_quota = $api_settings->max_requests_per_ip_address;\n\n\t\t// Get the quota basis\n\t\t$quota_basis = (isset($api_settings->max_requests_quota_basis))\n\t\t\t? $api_settings->max_requests_quota_basis\n\t\t\t: NULL;\n\n\t\t$num_api_requests = -1; // Will hold the number of API requests for the specified IP\n\n\t\t// Database table prefix\n\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\n\t\t// Template query\n\t\t$template_query = \"SELECT COUNT(*) AS record_count \";\n\t\t$template_query .= \"FROM \".$table_prefix.\"api_log \";\n\t\t$template_query .= \"WHERE DATE_FORMAT(api_date, '%s') = '%s' \";\n\t\t$template_query .= \"AND api_ipaddress = '\".$this->request_ip_address.\"'\";\n\n\t\t// Get the number of api requests logged depending on the quota basis\n\t\tswitch ($quota_basis)\n\t\t{\n\t\t\t// Per day quota\n\t\t\tcase 0:\n\t\t\t\t$items = $this->db->query(sprintf($template_query, '%Y-%m-%d', date('Y-m-d', time())));\n\t\t\t\t$num_api_requests = (int)$items[0]->record_count;\n\t\t\tbreak;\n\n\t\t\t// Per month quota\n\t\t\tcase 1:\n\t\t\t\t$items = $this->db->query(sprintf($template_query, '%Y-%m', date('Y-m', time())));\n\t\t\t\t$num_api_requests = (int)$items[0]->record_count;\n\t\t\tbreak;\n\t\t}\n\n\t\t// Return value\n\t\treturn ($num_api_requests >= $request_quota)? FALSE : TRUE;\n\t}", "private function limitCalls()\n {\n if ($this->lastCallTimestamp > 0) {\n $callsLimit = $this->shopifyClient->callLimit();\n $callsMade = $this->shopifyClient->callsMade();\n $callsLeft = $this->shopifyClient->callsLeft();\n\n Log::debug(\"ShopifyApi.limitCalls: callsLimit=$callsLimit, callsMade=$callsMade, callsLeft=$callsLeft\");\n $currentTimestamp = microtime(true);\n $deltaTimestamp = ($this->lastCallTimestamp > 0) ? $currentTimestamp - $this->lastCallTimestamp : 0;\n Log::debug(\"ShopifyApi.limitCalls: deltaTimestamp=$deltaTimestamp\");\n\n if ($callsLeft < 10) {\n Log::debug(\"ShopifyApi.limitCalls: DELTA < 10: wait 0.5 seconds\");\n usleep(500000);\n }\n } else {\n Log::debug(\"ShopifyApi.limitCalls: first call\");\n }\n $this->lastCallTimestamp = microtime(true);\n }", "public function hasQuota(){\n return $this->_has(12);\n }", "public function getRateLimitRemaining(): int\n {\n return $this->httpClient->getRateLimitRemaining();\n }", "protected function isUserRateLimited(UserInterface $user, $field, $count, $interval)\n {\n return $this->login->isUserRateLimited($user, $field, $count, $interval);\n }", "public function testRateLimit()\n {\n $this->markTestIncomplete('Not yet implemented.');\n }", "public function notifCountHasReachedMax() {\n\t\tif ( $this->getLocalNotificationCount() >= self::MAX_BADGE_COUNT ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getRateLimit()\n {\n return $this->xRateLimitRemaining;\n }", "function _checkMaxQuantityLimt()\r\n {\r\n if ($this->data[$this->name]['buy_max_quantity_per_user'] >= $this->data[$this->name]['buy_min_quantity_per_user']) {\r\n return true;\r\n }\r\n return false;\r\n }", "private function validate_usage_limit() {\n\t\tif ( $this->usage_limit > 0 && $this->usage_count >= $this->usage_limit ) {\n\t\t\tthrow new Exception( self::E_WC_COUPON_USAGE_LIMIT_REACHED );\n\t\t}\n\t}", "protected function handleRateLimit(): void\n {\n if (!$this->isRateLimitEnabled() || !$this->requestTimestamp) {\n return;\n }\n\n /** @var DateTime $limitReset */\n $limitReset = $this->getApiCallLimits('reset');\n if (!$limitReset) {\n return;\n }\n\n $limitLeft = $this->getApiCallLimits('left') ?: 1;\n $secondsLeft = $limitReset->getTimestamp() - time();\n $rateLimitCycle = round(($secondsLeft / $limitLeft) * 1000);\n\n // Calculate in milliseconds the duration the API call took\n $duration = round(microtime(true) - $this->requestTimestamp, 3) * 1000;\n $waitTime = $rateLimitCycle - $duration;\n\n if ($waitTime > 0) {\n // Do the sleep for X microseconds (convert from milliseconds)\n usleep($waitTime * 1000);\n }\n }", "protected function get_email_rate_limit()\n {\n }", "public function getXsiTypeName() {\n return \"RateExceededError\";\n }", "public function getRateLimit(){\n\t\treturn $this->rateLimit;\n\t}", "protected function hasTimeLimitReached()\n\t{\n\t\tif ($this->timeLimit > 0)\n\t\t{\n\t\t\tif ($this->timeLimitReached)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ((time() - $this->hitStartTime) >= $this->timeLimit)\n\t\t\t{\n\t\t\t\t$this->timeLimitReached = true;\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function exceedsWatchLimit(){\n return $this->getWatchedVideosToday()->count() >= self::MAX_NUMBER_OF_VIDEOS;\n }", "function qa_post_limit_exceeded()\n{\n\tif (in_array($_SERVER['REQUEST_METHOD'], array('POST', 'PUT')) && empty($_POST) && empty($_FILES)) {\n\t\t$postmaxsize = ini_get('post_max_size'); // Gets the current post_max_size configuration\n\t\t$unit = substr($postmaxsize, -1);\n\t\tif (!is_numeric($unit)) {\n\t\t\t$postmaxsize = substr($postmaxsize, 0, -1);\n\t\t}\n\t\t// Gets an integer value that can be compared against the size of the HTTP request\n\t\t$postmaxsize = convert_to_bytes($unit, $postmaxsize);\n\t\treturn $_SERVER['CONTENT_LENGTH'] > $postmaxsize;\n\t}\n}", "public function isClientError(): bool\n {\n return $this->code >= 400 && $this->code < 500;\n }", "public function getServerFailureLimit()\n {\n return $this->serverFailureLimit;\n }", "public function isDailyLimitRemained($ipAddress): bool\n {\n $todayRates = ArticleRating::where('ip_address', $ipAddress)\n ->whereDate('created_at', date('Y-m-d'))\n ->count();\n\n if ($todayRates >= self::RATE_LIMIT_PER_DAY) {\n throw RatingException::dailyLimitExceeded(self::RATE_LIMIT_PER_DAY);\n }\n\n return true;\n }", "protected function exceededMaxRuntime(): bool\n {\n return (($this->maxRuntime > 0) && (time() - $this->startTime) > $this->maxRuntime);\n }", "function updateLimitEnabled()\r\n\t{\r\n\t\treturn true;\r\n\t}", "function ratelimit(array $data);", "public function isConcurrentUsersExceeded()\n {\n $concurrent_user_count = $this->concurrentUserCount();\n $users_allowed_count = $this->usersAllowedCount();\n $user_waiting_count = 1;\n if (($concurrent_user_count + $user_waiting_count) > $users_allowed_count)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "protected function _handle_count_fail()\n\t{\n\t\t$count_max = mod('deposit_card')->setting('fail_count_max');\n\t\t$block_timeout = mod('deposit_card')->setting('fail_block_timeout') * 60;\n\n\t\tif (!$count_max) return;\n\n\t\t$count = model('ip')->action_count_change('deposit_card_fail', 1);\n\n\t\tif ($count >= $count_max) {\n\t\t\t$ip = t('input')->ip_address();\n\n\t\t\tmodel('ip_block')->set($ip, $block_timeout);\n\t\t\tmodel('ip')->action_count_set('deposit_card_fail', 0);\n\t\t}\n\t}", "public function shouldGoToPenalty()\n {\n if( $this -> charger_connector_type -> isChargerFast() )\n {\n return false;\n }\n\n if( ! $this -> carHasAlreadyStoppedCharging() )\n {\n return false;\n }\n\n if( ! $this -> getCharger() -> penalty_enabled ) \n {\n return false;\n }\n\n $config = Config :: first();\n $penaltyReliefMinutes = $config -> penalty_relief_minutes;\n\n $chargedTime = Timestamp :: build( $this ) -> getStopChargingTimestamp();\n\n if( ! $chargedTime )\n {\n return false;\n }\n\n $elapsedTime = $chargedTime -> diffInMinutes( now() );\n\n return $elapsedTime >= $penaltyReliefMinutes;\n }", "public static function rateLimit(): self\n {\n return self::getInstance('RATE_LIMIT');\n }", "public function hasReadLimit(){\n return $this->_has(3);\n }", "public function is_over_limit( $ignore_cache = false ) {\n\t\t$limits = $this->get_usage( 'import', $ignore_cache );\n\n\t\treturn isset( $limits->remaining ) && 0 >= $limits->remaining;\n\t}", "public function isCheckLimitsEnabled(): bool\n\t{\n\t\treturn $this->isCheckLimitsEnabled;\n\t}", "private function validate_maximum_amount() {\n\t\tif ( $this->maximum_amount > 0 && wc_format_decimal( $this->maximum_amount ) < wc_format_decimal( WC()->cart->subtotal ) ) {\n\t\t\tthrow new Exception( self::E_WC_COUPON_MAX_SPEND_LIMIT_MET );\n\t\t}\n\t}", "public function serverErrorOccurred(): bool\n {\n return $this->getStatusCode() >= 500;\n }", "function errorlog_is_limitlogin() {\n return defined(LIMIT_LOGIN_LOCKOUT_NOTIFY_ALLOWED);\n}", "public function isAccountOldEnough()\n {\n\n $data = $this->facebook->api('/me/posts?limit=1&until=1388534400');\n\n if (!empty($data['data']['0'])) {\n return true;\n } else {\n return false;\n }\n }", "private function validate_user_usage_limit( $user_id = null ) {\n\t\tif ( ! $user_id ) {\n\t\t\t$user_id = get_current_user_id();\n\t\t}\n\t\tif ( $this->usage_limit_per_user > 0 && is_user_logged_in() && $this->id ) {\n\t\t\tglobal $wpdb;\n\t\t\t$usage_count = $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT( meta_id ) FROM {$wpdb->postmeta} WHERE post_id = %d AND meta_key = '_used_by' AND meta_value = %d;\", $this->id, $user_id ) );\n\n\t\t\tif ( $usage_count >= $this->usage_limit_per_user ) {\n\t\t\t\tthrow new Exception( self::E_WC_COUPON_USAGE_LIMIT_REACHED );\n\t\t\t}\n\t\t}\n\t}", "public function setMaxRequestsPerMinute($limit)\n {\n if(!is_int($limit))\n {\n return false;\n }\n $this->_maxRequestsPerMinute = $limit;\n return true;\n }", "public function isNotEnoughBalance() {\n return ($this->getFailedReason() == 'BALANCE_NOT_ENOUGH');\n }", "protected function isRecursionLimit()\n {\n return ($this->maxRecursionLimit > 0 && $this->totalRecursion >= $this->maxRecursionLimit);\n }", "public function rateLimitByIP($limit=100, $interval=60) {\n session_start();\n\n if($limit != $this->limit) {\n $limit = $this->limit;\n }\n\n if($interval != $this->interval) {\n $interval = $this->interval;\n }\n\n $defaultSession = array('requests'=>1, 'date'=>date('Y-m-d h:i:s'));\n\n $ipServices = new IPServices();\n $ip = $ipServices->getIP();\n $sessionID = 'RATE_LIMIT_'.$ip;\n\n if (isset($_SESSION[$sessionID])) {\n $sessionData = $_SESSION[$sessionID];\n\n $last = strtotime($_SESSION[$sessionID]['date']);\n $curr = strtotime(date('Y-m-d h:i:s'));\n $sec = abs($last - $curr);\n\n if ($sec <= $interval) { \n if($sessionData['requests'] == $limit) {\n // rate limit client\n return false;\n } else {\n if($sessionData['requests'] > $limit) {\n $_SESSION[$sessionID] = $defaultSession;\n return false;\n }\n\n $sessionData['requests'] = $sessionData['requests'] + 1;\n $_SESSION[$sessionID] = $sessionData;\n return true;\n } \n } \n }\n \n $_SESSION[$sessionID] = $defaultSession;\n return true;\n }", "public function isUsersAllowedDevicesExceeded($userid)\n {\n $users_active_dev_count = $this->checkUserDevicesCount($userid);\n $devices_allowed_count = $this->devicesAllowedCount();\n $user_waiting_count = 1;\n if (($users_active_dev_count + $user_waiting_count) > $devices_allowed_count)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function hasRates()\n {\n return $this->getInvoker()->getNbRates() > 0;\n }", "public function canBeDeclined()\n {\n return $this->isAwaitingFee();\n }", "function is_max_login_attempts_exceeded()\n\t{\n\t\t$this->ci->load->model('dx_auth/login_attempts', 'login_attempts');\n\t\t\n\t\treturn ($this->ci->login_attempts->check_attempts($this->ci->input->ip_address())->num_rows() >= $this->ci->config->item('DX_max_login_attempts'));\n\t}", "public function hasLimit()\n\t\t{\n\t\t\treturn is_array($this->limit);\n\t\t}", "public function hasQuotaLock(){\n return $this->_has(11);\n }", "public function testTooMuchRequest()\n {\n $this->mock(AlphaVantageApiService::class, function ($mock) {\n return $mock->shouldReceive('querySymbol')\n ->once()\n ->andReturn(new \\GuzzleHttp\\Psr7\\Response(\n Response::HTTP_OK,\n [],\n '{\"Note\": \"Thank you for using Alpha Vantage! Our standard API call frequency is 5 calls per minute and 500 calls per day. Please visit https://www.alphavantage.co/premium/ if you would like to target a higher API call frequency.\"}'\n ));\n });\n\n $response = $this->getJson('api/stock-quotes?symbol=AMZN');\n $response->assertStatus(Response::HTTP_TOO_MANY_REQUESTS);\n $response->assertJson([\n 'message' => 'Too many requests. Please try again later',\n ]);\n }", "public function isElapsed()\n {\n return ($this->isTimeout() || $this->isLimitExceeded());\n }", "public static function isOverdue()\n {\n $config = JRegister::get('config');\n\n // Verify access token exist\n if (!$config->get('accessToken', false))\n {\n return false;\n }\n\n // Verify oauth start time and expires_in exist\n $oauthStartTime = $config->get('time');\n $oauthLengthTime = $config->get('expiresIn');\n if (!$oauthStartTime || !$oauthLengthTime)\n {\n return false;\n }\n\n // Verify oauth end time is useful or not\n return !($oauthStartTime/1000 + $oauthLengthTime < time());\n }", "function _compareItemAndBuyMaxLimt()\r\n {\r\n if (empty($this->data[$this->name]['max_limit']) || $this->data[$this->name]['max_limit'] >= $this->data[$this->name]['buy_max_quantity_per_user']) {\r\n return true;\r\n }\r\n return false;\r\n }" ]
[ "0.76984394", "0.7511876", "0.7430753", "0.7338698", "0.705702", "0.70023066", "0.6976481", "0.6953007", "0.6891207", "0.6840113", "0.6775359", "0.6755924", "0.6675948", "0.66168153", "0.6584276", "0.6497298", "0.6490639", "0.6482962", "0.64381623", "0.6385098", "0.6330897", "0.6292723", "0.62880945", "0.62592983", "0.6167759", "0.61485726", "0.61339384", "0.6124917", "0.6122702", "0.61205167", "0.61087936", "0.61087936", "0.6099359", "0.60836494", "0.6059361", "0.60581017", "0.60524195", "0.6017218", "0.60089785", "0.60030085", "0.60011005", "0.5975151", "0.59666723", "0.595951", "0.59574586", "0.5957376", "0.59523845", "0.59488577", "0.5916082", "0.59034806", "0.59002244", "0.5875656", "0.58743", "0.5867728", "0.5860469", "0.5853468", "0.5840824", "0.5822481", "0.5803964", "0.5784105", "0.57498854", "0.57398725", "0.57349485", "0.5726482", "0.5696138", "0.5687217", "0.56729215", "0.5660984", "0.56588584", "0.56478", "0.5645871", "0.5645871", "0.5645871", "0.5645871", "0.5645871", "0.5608404", "0.5601136", "0.5597382", "0.55854577", "0.55821747", "0.5573356", "0.5571828", "0.5566204", "0.5543209", "0.5534777", "0.5529328", "0.5500275", "0.5496183", "0.5484663", "0.54785943", "0.54611814", "0.54551744", "0.54485124", "0.5429178", "0.542495", "0.540549", "0.5401353", "0.53910846", "0.5386791", "0.5383464" ]
0.83757097
0
Deteremine if the request is authenticated.
protected function isAuthenticatedRequest() { if (! is_null($this->authenticatedRequest)) { return $this->authenticatedRequest; } return $this->authenticatedRequest = $this->auth->check(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _isAuthenticated()\n\t{\n\t\treturn true;\n\t}", "public function isAuthenticated() {\n\t}", "public function isAuthenticated()\n {\n return $this->getUser() !== null;\n }", "public function isAuthenticated()\r\n {\r\n return true; \r\n }", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated(): bool;", "public function isAuthenticated(): bool;", "public function isAuthenticated(): bool {\n return true;\n }", "public function isAuthenticated(){\n return $this->authenticated;\n }", "public function isAuthenticated() {return $this->isauthenticated;}", "public function isAuthenticated(): bool\n {\n return null !== $this->getUser();\n }", "public function isAuthenticated()\n {\n return $this->authenticated;\n }", "public function isUserAuthenticated () : bool {\n return $this->mainController->isUserAuthenticated();\n }", "public function isAuthenticated()\r\n {\r\n if (!isset($_SESSION[\"ed\"])) {\r\n echo '<meta http-equiv=\"refresh\" content=\"0; url=' . (new CodeFlirt\\Handlers)->path(\"login\") . '\">';\r\n exit(0);\r\n }\r\n }", "public function isAuthenticated() : bool;", "public function isAuthenticated()\n {\n return $this->isAuthenticated;\n }", "public function isAuthenticated() {\n\t\treturn $this->isAuthenticated;\n\t}", "public function isAuthenticated()\n\t{\n\t\treturn $this->authenticated;\n\t}", "public function isAuth()\n {\n return !empty($this->getAuth());\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function isAuthenticated()\n {\n return $this->_isAuthenticated;\n }", "private function _checkAuth()\n {\n // check login or not\n if (!$this->getUser()->isAuthenticated()) {\n $this->redirect('login');\n }\n }", "public function isAuthenticated(): bool {\n return $this->check('id');\n }", "public static function check()\n {\n return (new Authenticator(request()))->isAuthenticated();\n }", "public function isAuthenticated(): bool\n {\n return getApp()->security()->isAuthenticated();\n }", "public function isAuthenticated()\n {\n return $this->getAuth()->hasIdentity();\n }", "public function checkAccess()\n {\n if (!$this->isAuthenticated()) {\n header('HTTP/1.1 401 Unauthorized');\n exit();\n }\n }", "public function isAuthenticated()\n {\n //get headers from postMan\n $this->headers = getallheaders();\n //cut the first word from the header, ex:Bearer, the space before and after the token\n $token = !empty($this->headers['Authorization']) ? trim(substr($this->headers['Authorization'], 6)) : null;\n\n //request in the database to take the token\n $tokenDataBase = $this->authToken->getToken();\n\n //the token in the header must exist and be the same as in the base date in order to make the request\n if (!$token || $token !== $tokenDataBase) {\n http_response_code(401);\n echo json_encode(array(\"message\" => \"Unauthorized\"));\n exit;\n }\n }", "public function isAuth() {}", "function is_authenticated()\n{\n global $app;\n return (is_object($app->auth) && $app->auth->isValid());\n}", "public function isAuthenticated()\n {\n return $this->authenticator->isAuthenticated();\n }", "protected function isAuthenticatedUser() {\n\t\treturn !$this->getUser()->isAnon();\n\t}", "public function IsAuthenticated() {\n\t\treturn ($this->session->GetAuthenticatedUser() != false);\n\t}", "public function isAuthenticated()\n\t{\n\t\treturn $this->_authenticationInstance->isAuthenticated();\n\t}", "public static function isAuthenticated() {\n\n return isset($_SESSION[Security::SESSION_USER]) && $_SESSION[Security::SESSION_USER]->id > 0;\n\n }", "public function isAuthenticated()\n {\n return ($this->getAccessToken()) ? true : false;\n }", "function is_already_authenticated()\n {\n /**\n * Checks is user already authenticated\n * If it's true, sends to main page\n */\n $session = Session::getInstance();\n $username = $session->username;\n $logged = $session->logged;\n if (self::check($username,$logged))\n {\n header(\"Location: /admin\");\n }\n }", "public static function isAuthenticated() {\n $auth = self::get('auth');\n\n return empty($auth['isauthenticated']) ? FALSE : TRUE;\n }", "private function isAuth()\n\t{\n\t\treturn $this->session->userdata('auth') ? true : false;\n\t}", "public function isAuth();", "public function isAuthenticated()\n\t{\n\t\t$token = $this->getToken();\n\n\t\tif (!$token || !array_key_exists('access_token', $token))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telseif (array_key_exists('expires_in', $token) && $token['created'] + $token['expires_in'] < time() + 20)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "public function redirectUnauthenticatedUser(){\n if(!$this->isAuthenticated() )\n $this->logout();\n }", "protected function hasAuth()\n {\n return !! $this->options['authentication'];\n }", "public function authenticated(){\n if(isset($_SESSION['user'])){\n if($this->load($_SESSION['user']) == false){\n header('Location: /logout.php');\n die;\n }\n return true;\n }\n return false;\n }", "public function isAuthenticated(){\n return $_SESSION['loggedIn'];\n }", "function auth(){\n\t\t//TODO auth implementieren\n\t\treturn true;\n\t}", "private function is_authenticated()\n {\n if($this->mode == rabkTwttr::MODE_APP)\n return isset($_SESSION['access_token']);\n \n if($this->mode == rabkTwttr::MODE_USER)\n return isset($_SESSION['access_token']) && isset($_SESSION['access_token_secret']);\n }", "public function getIsAuthenticated()\n {\n return $this->IsAuthenticated;\n }", "protected function authRequired()\n {\n return true;\n }", "public function isAuth() {\n $connector = Mage::getSingleton('vidtest/connector')->getApiModel($this->getApiModelCode());\n return $connector->isLoggedIn();\n }", "public function isAuthenticate()\n {\n return !empty($this->access_token);\n }", "function isAuthenticated() {\n if (array_key_exists(\"token\", $_POST)) authenticate($_POST[\"token\"]);\n else setLoggedIn(false);\n\n // TODO: Check for time on remaining token.\n\n // Finally, check if they're logged in.\n return isLoggedIn();\n}", "public function is_authenticated(){\n\t\tif(isset($_SESSION['uid']) && $_SESSION['ip'] == $_SERVER['REMOTE_ADDR']){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasAuthMiddleware(): bool{\n return isset($this->_authorisationMiddleware) && $this->_authorisationMiddleware !== null;\n }", "public function isAuth() {\n\t\tif($this->auth === null) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}", "public function requiresAuthentication() {\n return false;\n }", "public function before()\n {\n if (in_array($this->request->action(), $this->_no_auth_action))\n {\n $this->_auth_required = FALSE;\n }\n\n parent::before();\n }", "protected function loginIfRequested() {}", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function unauthenticated(Request $request, Response $response)\n {\n $response;\n\n return $this->isAuthorized(null, $request->action);\n }", "public function isAuthenticatedSuccessfully(): bool;", "function isAuthenticated(){\n return Session::has('SESSION_USER_NAME') ? true:false;\n}", "private function checkIfLoggedIn()\n {\n if (!session()->has('user')) {\n abort(403, 'You are not logged in.');\n }\n }", "public function checkAuthentication() {}", "private function isAuthenticated(Request $request, $data = null)\n {\n $event = new ApiRequestEvent($request);\n $config = $this->container->getParameter('DocumentLandingSdkBundleConfig');\n $authorizationHeader = $request->headers->get('Authorization');\n\n if (!$authorizationHeader) {\n $event->setIsValid(false);\n }\n else {\n // See DocumentLandingSdkBundleEvents.php for more about this.\n if ($config['access_token']) {\n if ($authorizationHeader != 'Bearer ' . $config['access_token']) {\n $event->setIsValid(false);\n }\n }\n }\n \n $dispatcher = $this->container->get('event_dispatcher');\n $dispatcher->dispatch(DocumentLandingSdkBundleEvents::API_REQUEST, $event);\n if (!$event->getIsValid()) {\n throw new HttpException(401, \"Session expired or invalid\");\n }\n }", "public function getIsAuthenticated()\n {\n return $this->lib->getToken();\n }", "private function authenticate() {\n\t\t//we do not need a session, so we don't need to have unnused db-entries in session db\n\t\tsession_destroy();\n\n\t\t$token = FormUtil::getPassedValue('token', null, 'GETPOST');\n\t\t$addr = $_SERVER['REMOTE_ADDR'];\n\n\t\tif($token == $this->getVar('Authtoken') && $this->getVar('Authtoken') != null && ($addr == $this->getVar('AllowedHost') || $this->getVar('AllowedHost') == '*')) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\techo 'You are a hacker, right?';\n\t\t\texit();\n\t\t}\n\t}", "public function isAuthenticated()\n {\n $token = $this->app['security']->getToken();\n \n if ( !is_null($token) ) {\n return ($token->getUser() instanceof SecurityUser);\n }\n \n return false;\n }", "function isLoggedIn(){\n return $this->auth->isLoggedIn();\n }", "public function unauthenticated(CakeRequest $request, CakeResponse $response) {\n $controller = $this->_Collection->getController();\n $url = '';\n\n if (isset($controller->request->url)) {\n $url = $controller->request->url;\n }\n\n $url = Router::normalize($url);\n $loginAction = Router::normalize($controller->Auth->loginAction);\n\n if ($url != $loginAction) {\n $controller->_falseJson(ApiResponseCode::UNAUTHORIZED);\n $controller->response->send();\n exit;\n }\n\n return false;\n }", "function verifyAuth()\n\t{\n\t\tsanitizeRequest($_POST);\n\t\tsanitizeRequest($_GET);\n\t\t\n\t\t$currentUser = UserService::getInstance()->getCurrentUser();\n\t\tif (!$currentUser || !$currentUser->getSessionId()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t$payload = JWT::decode($currentUser->getSessionId(), SERVER_KEY, array('HS256'));\n\t\t\t$sessionId = UserService::getInstance()->getSessionId($currentUser->getId());\n\t\t\tif ($sessionId === $currentUser->getSessionId() &&\n\t\t\t\t\t$currentUser->getId() === $payload->id &&\n\t\t\t\t\t$currentUser->getEmail() === $payload->email) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\tif ($currentUser->isRemember() && $e->getMessage() === 'Expired token') {\n\t\t\t\t$currentUser->extendSession();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "function middleware_Loggedin()\n{\n return isset($_SESSION['auth']);\n}", "public function authorize()\n {\n return !Auth::guest();\n }", "public function is_auth_required() {\r\n\r\n\t\treturn false;\r\n\t}", "public static function getIsAuthenticated()\n\t{\n\t\treturn self::$isAuthenticated;\n\t}", "private function checkAuth()\n {\n $this->isAuthenticated = false;\n $isLoggedIn = is_user_logged_in();\n\n if ($isLoggedIn) {\n $this->username = wp_get_current_user()->user_login;\n $id = wp_get_current_user()->ID;\n $meta = get_user_meta($id, 'wp_capabilities', false);\n foreach ($meta[0] as $key => $value) {\n $k = strtoupper($key);\n if (($k == $this->PluginRole) or\n ($k == $this->AdminRole)) {\n $this->isAuthenticated = true;\n }\n }\n }\n }", "protected function authenticated() \n {\n \n if (\\Auth::check()) {\n return redirect()->route('eventmie.welcome');\n }\n }", "function isLoggedIn()\n{\n\treturn auth()->check();\n}", "function isAuthenticated() {\n // Changed by Trevor Mills to integrate with his CMS. \n // \n // Old code: \n\t\t// return ($this->_authenticated) ? true : false;\n\t\tswitch (CMS_PLATFORM){\n\t\tcase 'WordPress':\n\t\t\tif (isset($_COOKIE['wordpress_logged_in_'.COOKIEHASH])){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'topCMS':\n\t\tdefault:\n\t\t\tif (!isset($_SESSION['auth_level']) or $_SESSION['auth_site'] != md5(SITE_URL)){\n\t return false;\n\t\t\t}\n\t else{\n\t return true;\n\t }\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}", "protected function notAuthenticated()\n {\n $this->response = $this->response->withStatus(401);\n $this->jsonBody($this->payload->getInput());\n }", "public function isAuthenticated()\n {\n return $this->hasRole(RoleInterface::ROLE_AUTHENTICATED);\n }", "function isLoggedIn() {\n\t\t\tif(!$this->params['requested']) $this->cakeError('error404');\n\t\t\treturn $this->User->isLoggedIn();\n\t\t}", "public function requestAuth()\n {\n return null;\n }", "public function IsAuthenticated()\n {\n $acronym = isset($_SESSION['user']) ? $_SESSION['user']->acronym : null;\n\n if($acronym) \n {\n $this->IsAuthenticated = true;\n }\n else \n {\n $this->IsAuthenticated = false;\n }\n \n return $this->IsAuthenticated;\n }", "public function isAnonymous()\r\n {\r\n return !$this->isAuthenticated();\r\n }", "public function deAuth(){\n $this->updateIP();\n $this->updateLoginDate();\n $this->authenticated = false;\n unset($_COOKIE['authenticated']);\n setcookie(\"authenticated\", \"\", time()-3600, \"/\");\n session_destroy();\n }", "static function isAuthenticated($app) {\n $found = AuthControllerNative::isAuthenticated($app->request->post());\n if($found['authenticated']) {\n return $app->render(200, $found);\n } \n \n $fb = AuthControllerFacebook::isAuthenticated($app->request->post());\n if($fb) {\n return $app->render(222, $found);\n } else {\n return $app->render(400, $found);\n }\n }", "public function preAuth(Request $request, Response $response);", "public function preAuth(Request $request, Response $response);", "public static function isAuthenticated() \n\t{\n\t\tacPhpCas::setReporting();\n\t\treturn phpCAS::isAuthenticated();\t\t\n\t}", "public function authorize(): bool\n {\n return !auth()->check();\n }", "public function authenticate() { return false; }", "function auth_isLoggedIn()\n{\n return ! auth_isAnonymous();\n}", "public function unauthenticated(CakeRequest $request, CakeResponse $response) {\n }", "private\n function checkAuth()\n {\n if (!isset($_SESSION['artiste_id'])) {\n return false;\n }\n return true;\n }", "protected function _authenticated()\n\t{\n\t\tif(!$this->_logged_in()){\n\t\t\t\n\t\t\t$this->session->set('alert',array('type' => 'danger', 'message' => 'Please login'));\n\t\t\t\t\n\t\t\turl::redirect(Kohana::config('admin.url').'/account/login', 301);\n\t\t}\n\t}", "public static function forceAuthentication() {\n\t\tif (!self::authenticated()) {\n\t\t\tself::redirectToLogin();\n\t\t}\n\t}" ]
[ "0.734579", "0.7165258", "0.7108767", "0.7032801", "0.7004497", "0.7004497", "0.7004497", "0.7004497", "0.6991808", "0.6991808", "0.69695544", "0.6878613", "0.68752825", "0.6846195", "0.684384", "0.6816934", "0.67929107", "0.6769155", "0.6715971", "0.6715526", "0.67150074", "0.66635793", "0.66565216", "0.66418797", "0.6620761", "0.66144514", "0.6596555", "0.6585896", "0.65848285", "0.6554047", "0.6547631", "0.6547208", "0.65223646", "0.6497441", "0.6474776", "0.6446987", "0.64370936", "0.6433599", "0.6431461", "0.63991994", "0.6388084", "0.63810736", "0.6378911", "0.6375265", "0.63540554", "0.63438743", "0.6337385", "0.6290628", "0.62794757", "0.62599474", "0.62571496", "0.6249045", "0.62436235", "0.62353176", "0.6234276", "0.6230283", "0.6219826", "0.62185985", "0.621172", "0.6205636", "0.6202167", "0.6177247", "0.61526203", "0.6136243", "0.6131437", "0.6123371", "0.6118799", "0.6111592", "0.61071813", "0.6106437", "0.6104435", "0.6103706", "0.60979044", "0.6079438", "0.60702825", "0.60642403", "0.6062264", "0.6061093", "0.60550684", "0.60412383", "0.6037286", "0.6036357", "0.6030521", "0.60259444", "0.60246485", "0.60133165", "0.6003585", "0.6002539", "0.5993489", "0.59931815", "0.59878945", "0.59878945", "0.59802717", "0.5972081", "0.59706444", "0.5970206", "0.5967048", "0.5960991", "0.59565806", "0.59557855" ]
0.6461455
35
Prepare the configuration for the request.
protected function prepareConfig($request) { $this->config = array_merge($this->config, $this->container->make('config')->get('api::rate_limiting')); if ($this->isAuthenticatedRequest()) { $this->config = array_merge(['exceeded' => $this->config['exceeded']], $this->config['authenticated']); } else { $this->config = array_merge(['exceeded' => $this->config['exceeded']], $this->config['unauthenticated']); } $this->config['keys']['requests'] = sprintf('dingo:api:requests:%s', $request->getClientIp()); $this->config['keys']['reset'] = sprintf('dingo:api:reset:%s', $request->getClientIp()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prepareRequest()\r\n {\r\n\r\n }", "public function prepareRequest()\n {\n }", "protected function initConfiguration()\n {\n $this->initJsonConfiguration();\n $this->initApiGatewayConfiguration('kyc_service/' . $this->requestPath, false);\n }", "public function __prepare()\n {\n $config = $this->objectManager->get(\\Magento\\Mtf\\Config\\DataInterface::class);\n // Prepare config data\n $configData['dbHost'] = $config->get('install/0/host/0');\n $configData['dbUser'] = $config->get('install/0/user/0');\n $configData['dbPassword'] = $config->get('install/0/password/0');\n $configData['dbName'] = $config->get('install/0/dbName/0');\n $configData['baseUrl'] = $config->get('install/0/baseUrl/0');\n $configData['admin'] = $config->get('install/0/backendName/0');\n\n return ['configData' => $configData];\n }", "public function prepare($request) {\n\t\t$this->request = $request;\n\t}", "public function prepareRequest() {\n $auth = new WebServiceSoap\\SveaAuth(\n $this->conf->getUsername($this->orderType, $this->countryCode),\n $this->conf->getPassword($this->orderType, $this->countryCode),\n $this->conf->getClientNumber($this->orderType, $this->countryCode) \n );\n\n $address = new WebServiceSoap\\SveaAddress( \n $auth, \n (isset($this->companyId) ? true : false), \n $this->countryCode, \n (isset($this->companyId) ? $this->companyId : $this->ssn) \n );\n\n $this->request = new WebServiceSoap\\SveaRequest( $address );\n\n return $this->request;\n }", "protected function configureRequest()\n {\n $this->transporter\n ->setMethod('getFields')\n ->setParam('version', 2);\n }", "public function __construct()\n {\n $this->_config = request('_config');\n }", "protected function initializeConfiguration() {}", "public function prepare()\n {\n $this->status = $this->response->getStatusCode();\n\n $rawResponseData = $this->response->getBody()->getContents();\n\n $this->body = $rawResponseData ? \\GuzzleHttp\\json_decode($rawResponseData, true) : '';\n\n $this->errors = isset($this->body['errors']) ? $this->body['errors'] : [];\n\n if ($this->throwException && (substr($this->status, 0, 1) != 2)) {\n $this->throwException($this->status, $this->errors);\n }\n\n //Set data\n if ($this->body) {\n //This happens when array was expected but it is empty\n if (empty($this->body['data'])) {\n $this->data = collect([]);\n } else {\n $document = Document::createFromArray($this->body);\n $hydrator = new ClassHydrator();\n $hydrated = $hydrator->hydrate($document);\n $this->data = is_array($hydrated) ? collect($hydrated) : $hydrated;\n }\n }\n\n //Set meta\n if (isset($this->body['meta'])) {\n $this->meta = $this->body['meta'];\n }\n }", "private function prepareRequest() {\n foreach ($this->formats as $format) {\n $req = $this->request->addChild('format');\n $format = parse_ini_string($format);\n\n // Destination to save the new encoding.\n $source_info = pathinfo($this->source);\n $prefix = isset($format['file-prefix']) ? $format['file-prefix'] : '';\n unset($format['file-prefix']);\n $format['destination'] = $this->destination . '/' . $source_info['filename'] . '/' . $prefix . $source_info['filename'] . $format['file-suffix'];\n unset($format['file-suffix']);\n\n foreach ($format as $key => $value) {\n $req->addChild($key, $value);\n }\n }\n }", "private function prepare()\n\t{\n\t\t// remove anchors (#foo) from the URL\n\t\t$this->url = preg_replace( '/(#.*?)?$/', '', $this->url );\n\t\t// merge query params from the URL with params given\n\t\t$this->url = $this->mergeQueryParams( $this->url, $this->params );\n\n\t\tif ( $this->method === 'POST' ) {\n\t\t\tif ( !isset( $this->headers['Content-Type'] ) ) {\n\t\t\t\t$this->setHeader( array( 'Content-Type' => 'application/x-www-form-urlencoded' ) );\n\t\t\t}\n\t\t\tif ( $this->headers['Content-Type'] == 'application/x-www-form-urlencoded' || $this->headers['Content-Type'] == 'application/json' ) {\n\t\t\t\t$count = count( $this->postdata );\n\t\t\t\tif( $this->body != '' && $count > 0 ) {\n\t\t\t\t\t$this->body .= '&';\n\t\t\t\t}\n\t\t\t\t//$this->body .= http_build_query( $this->postdata, '', '&' );\n\t\t\t\t// We don't use http_build_query() as it converts empty array values to 0, which we don't want.\n\t\t\t\tforeach ( $this->postdata as $key => $value ) {\n\t\t\t\t\t$count--;\n\t\t\t\t\t$this->body .= $key . '=' . $value;\n\t\t\t\t\tif ( $count )\t{\n\t\t\t\t\t\t$this->body .= '&';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->setHeader( array( 'Content-Length' => strlen( $this->body ) ) );\n\t\t}\n\t}", "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 }", "protected function configureRequest()\n {\n $this->transporter\n ->setMethod('getAssociatedCandidates')\n ->setParam('version', 2);\n }", "protected function setup_config() {\n\t\t\t// TODO: Implement setup_config() method.\n\t\t}", "protected function prepare()\n {\n $this->register('require', function($context, $path) {\n $context->requireAsset($path);\n });\n\n $this->register('depend_on', function($context, $path) {\n $context->dependOn($path);\n });\n\n $this->register('require_tree', function($context, $path) {\n $context->requireTree($path);\n });\n\n $this->body = $this->getData();\n\n if (preg_match(static::HEADER_PATTERN, $this->getData(), $matches)) {\n $this->header = $matches[0];\n $this->body = substr($this->getData(), strlen($matches[0])) ?: '';\n }\n\n $this->processed = array();\n }", "public function setup()\n {\n $this->config = new Config($this->emailOrMobileNumber, $this->merchantKey);\n }", "function _prepare() {\n $this->reset();\n if (Configure::read('debug') > 0) {\n $this->delivery = 'debug';\n }\n }", "private function buildRequest(): void\n {\n if (isset($this->parameters) && !Str::contains($this->requestUri, '?')) {\n $this->requestUri .= '?';\n $params = $this->parameters;\n array_walk($params, function (&$a, $b) {\n $a = \"$b=$a\";\n });\n $this->requestUri .= implode('&', $params);\n }\n \n if (isset($this->queries) && sizeof($this->queries) > 0) {\n $this->addJsonParam('query', '{'.implode(',', $this->queries).'}');\n }\n \n $this->options['headers'] = $this->headers;\n \n if (isset($this->json)) {\n $this->options['json'] = $this->json;\n }\n if (isset($this->body)) {\n $this->options['body'] = $this->body;\n }\n }", "private function setRequest() {\n // Create request object\n $this->request = Request::createFromGlobals();\n // Check caching and exit if so\n // - create a dummy response for possible 304\n $response = new Response();\n $seconds = Config::get()->pagecachetime;\n $response->setLastModified(new DateTime('-' . $seconds . ' seconds'));\n if ($response->isNotModified($this->getRequest())) {\n $response\n ->setSharedMaxAge($seconds)\n ->send();\n exit();\n }\n // Add better json request support\n // check request Content-Type\n $ctCheck = 0 === strpos(\n $this->request->headers->get('CONTENT_TYPE')\n , 'application/json'\n );\n // check request Method\n $methodCheck = in_array(\n strtoupper($this->request->server->get('REQUEST_METHOD', 'GET'))\n , array('PUT', 'DELETE', 'POST')\n );\n if ($ctCheck && $methodCheck) {\n $params = (array) json_decode($this->request->getContent());\n $this->request->request = new ParameterBag($params);\n }\n }", "public function processConfiguration() {}", "protected function _preConfig()\n {\n parent::_preConfig();\n $this->_request = Solar_Registry::get('request');\n $this->_Solar_Uri_Action['path'] = $this->_request->server(\n 'SOLAR_URI_ACTION_PATH',\n '/index.php'\n );\n }", "abstract protected function preConfigure();", "private function prepare(): self\n\t{\n\t\t// Or 'connection_string', or 'connection': 'connection_string' replaces all data in 'connection'.\n\t\tif (isset($this->config['connection_string']) && $this->config['connection_string'] != '')\n\t\t{\n\t\t\t$this->config['connection'] = $this->parse_connection_string($this->config['connection_string']);\n\t\t}\n\n\t\t$settings = $this->config['settings'];\n\t\t$connection = $this->config['connection'];\n\t\t$driver = $this->config['driver'];\n\n\t\t/**\n\t\t * Settings.\n\t\t */\n\t\t// Authentication status. Default: TRUE.\n\t\tif (isset($settings['auth']) && is_bool($settings['auth']))\n\t\t{\n\t\t\t$this->auth = $settings['auth'];\n\t\t}\n\n\t\t// Debug mode. Default: FALSE.\n\t\tif (isset($settings['debug']) && is_bool($settings['debug']))\n\t\t{\n\t\t\t$this->debug = $settings['debug'];\n\t\t}\n\n\t\t// Returnable type of data, when use get() and similar functions. Default: 'array'.\n\t\tif (isset($settings['return_as']) && is_string($settings['return_as']) && $settings['return_as'] != '')\n\t\t{\n\t\t\t$this->return_as = $settings['return_as'];\n\t\t}\n\n\t\t// Auto query resetting. Default: TRUE.\n\t\tif (isset($settings['auto_reset_query']) && is_bool($settings['auto_reset_query']))\n\t\t{\n\t\t\t$this->auto_reset_query = $settings['auto_reset_query'];\n\t\t}\n\n\t\t/**\n\t\t * Connection.\n\t\t */\n\t\t// Hosts (required).\n\t\tif (isset($connection['host']) && is_array($connection['host']) && !empty($connection['host']))\n\t\t{\n\t\t\t$this->hosts = $connection['host'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error('Connection host is a required parameter. Type it as string or array!');\n\t\t}\n\n\t\t// Ports.\n\t\tif (isset($connection['port']) && is_array($connection['port']) && !empty($connection['port']))\n\t\t{\n\t\t\t$this->ports = $connection['port'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// This parameter can not be empty, because config constructor \n\t\t\t// creates an association between each host and port.\n\t\t}\n\n\t\t// User name.\n\t\tif (isset($connection['user_name']) && is_string($connection['user_name']) && $connection['user_name'] != '')\n\t\t{\n\t\t\t$this->user_name = trim($connection['user_name']);\n\t\t}\n\t\telseif ($this->auth === TRUE)\n\t\t{\n\t\t\t$this->error('User name is a required parameter. Type it!');\n\t\t}\n\n\t\t// User password.\n\t\tif (isset($connection['user_password']) && is_string($connection['user_password']) && $connection['user_password'] != '')\n\t\t{\n\t\t\t$this->user_password = trim($connection['user_password']);\n\t\t}\n\t\telseif ($this->auth === TRUE)\n\t\t{\n\t\t\t$this->error('User password is a required parameter. Type it!');\n\t\t}\n\n\t\t// Database name.\n\t\tif (isset($connection['db_name']) && is_string($connection['db_name']) && $connection['db_name'] != '')\n\t\t{\n\t\t\t$this->db_name = trim($connection['db_name']);\n\t\t}\n\t\telseif ($this->auth === TRUE)\n\t\t{\n\t\t\t$this->error('Database name is a required parameter. Type it!');\n\t\t}\n\n\t\t// Database options.\n\t\tif (isset($connection['db_options']) && is_array($connection['db_options']) && !empty($connection['db_options']))\n\t\t{\n\t\t\t$this->db_options = $connection['db_options'];\n\t\t}\n\n\t\t/**\n\t\t * Driver.\n\t\t */\n\t\tif (is_array($driver) && !empty($driver))\n\t\t{\n\t\t\t$this->driver_options = $driver;\n\t\t}\n\t\n\t\treturn $this;\n\t}", "public function init()\n {\n if (isset($this->_server['REQUEST_METHOD'])) {\n $this->_properties = $this->_request;\n\n if (array_key_exists('parameters', $this->_get)\n && gettype($this->_get['parameters']) != 'array'\n && strlen(trim($this->_get['parameters'])) > 0\n ) {\n $paramData = explode('/', $this->_get['parameters']);\n for ($index = 0, $maxCount = sizeof($paramData); $index < $maxCount; $index += 2) {\n if (isset($paramData[$index+1])) {\n if ($paramData[$index+1] == \"_\") {\n $value = \"\";\n } else {\n $value = $paramData[$index+1];\n }\n $this->setProperty(\n $paramData[$index], $value\n );\n }\n }\n } elseif (isset($this->_get['parameters'])\n && gettype($this->_get['parameters']) == 'array'\n && count($this->_get['parameters']) > 0) {\n\n $paramData = $this->_get['parameters'];\n\n foreach ($paramData as $index => $value) {\n $this->setProperty($index, $value);\n }\n }\n\n return;\n }\n\n if (isset($this->_server['argv'])) {\n foreach ($this->_server['argv'] as $arg) {\n if (strpos($arg, '=')) {\n list($key, $val) = explode(\"=\", $arg);\n $this->setProperty($key, $val);\n }\n }\n }\n }", "protected function initialize()\n {\n if ($this->get('serverData') === null) {\n $this->set('serverData', (array) $_SERVER);\n }\n\n if ($this->get('getData') === null) {\n $this->set('getData', (array) $_GET);\n }\n\n if ($this->get('postData') === null) {\n $this->set('postData', (array) $_POST);\n }\n\n if ($this->get('sessionData') === null && isset($_SESSION)) {\n $this->set('sessionData', (array) $_SESSION);\n }\n\n $serverData = $this->get('serverData');\n\n if (!$this->get('projectRoot')) {\n $projectRoot = isset($serverData['_']) ? $serverData['_'] : $serverData['DOCUMENT_ROOT'];\n $this->set('projectRoot', $projectRoot);\n }\n\n if (!$this->get('url')) {\n if (isset($serverData['REDIRECT_URL'])) {\n $this->set('url', $serverData['REDIRECT_URL']);\n } elseif (isset($serverData['SCRIPT_NAME'])) {\n $this->set('url', $serverData['SCRIPT_NAME']);\n }\n }\n\n if (!$this->get('hostname')) {\n $this->set('hostname', isset($serverData['HTTP_HOST']) ? $serverData['HTTP_HOST'] : 'No Host');\n }\n\n $protocol = $this->get('secure') ? 'https' : 'http';\n $endPoint = $this->get('apiEndPoint') ?: $protocol . '://' . $this->get('host') . $this->get('resource');\n $this->set('apiEndPoint', $endPoint);\n }", "protected function setUp()\n {\n // create request\n $this->request = new Request([\n 'sEcho' => 13,\n 'iDisplayStart' => 11,\n 'iDisplayLength' => 103,\n 'iColumns' => 1, // will be ignored, the column number is already set on the server side\n 'sSearch' => 'fooBar',\n 'bRegex' => true,\n 'bSearchable_1' => true, // will be ignored, the configuration is already set on the server side\n 'sSearch_0' => 'fooBar_1',\n 'bRegex_0' => true, // will be ignored, the configuration is already set on the server side\n 'bSortable_0' => true, // will be ignored, the configuration is already set on the server side\n 'iSortingCols' => 1,\n 'iSortCol_0' => 0,\n 'sSortDir_0' => 'desc',\n ]);\n\n $this->parser = new Datatable19QueryParser();\n }", "protected function prepareRequest(RequestInterface $request)\n {\n $request->setClient($this);\n\n foreach ($this->getConfig()->getAll() as $key => $value) {\n // Add any curl options that might in the config to the request\n if (strpos($key, 'curl.') === 0 && $key != 'curl.blacklist') {\n $curlOption = str_replace('curl.', '', $key);\n if (defined($curlOption)) {\n $curlValue = is_string($value) && defined($value) ? constant($value) : $value;\n $request->getCurlOptions()->set(constant($curlOption), $curlValue);\n }\n }\n // Add any cache options from the config to the request\n // Add any curl options that might in the config to the request\n if (strpos($key, 'cache.') === 0) {\n $request->getParams()->set($key, $value);\n }\n }\n\n // Attach client observers to the request\n $request->setEventDispatcher(clone $this->getEventDispatcher());\n\n $this->dispatch('client.create_request', array(\n 'client' => $this,\n 'request' => $request\n ));\n\n return $request;\n }", "protected function configureRequest()\n {\n $this->transporter\n ->setMethod('changeStatus')\n ->setParam('version', 2);\n }", "public function prepare()\n {\n parent::prepare();\n\n $this->_data['config']['actions'] = [\n [\n 'actionName' => 'reset',\n 'targetName' => '${ $.name }',\n 'params' => [\n json_encode($this->getRobotsDefaultCustomInstructions())\n ]\n ]\n ];\n }", "protected function _prepare()\n {\n $rt = Konekt::app()->getConfigValue('routing');\n foreach ($rt as $route => $settings)\n {\n if (is_array($settings))\n {\n $ctrl = $settings['controller'];\n $params = isset($settings['params']) ? $settings['params'] : array();\n }\n else\n {\n $ctrl = $settings;\n $params = array();\n }\n \n \n $this->_routingTable[$this->_replaceVariables($route)] = array(\n 'controller' => $ctrl,\n 'params' => $params\n );\n }\n }", "public function prepare():void\n {\n\n // Get IP address\n if ($this->reg_ip == '') { \n $this->reg_ip = IpAddress::get();\n }\n\n // Get user-agent\n if ($this->reg_user_agent == '') { \n $this->reg_user_agent = UserAgent::get();\n }\n\n // Lookup ip address\n if ($this->reg_country == '' && $this->reg_ip != '') { \n $res = LookupIP::query($this->reg_ip);\n foreach ($res as $key => $value) {\n $key = 'reg_' . $key; \n $this->$key = $value;\n }\n }\n\n }", "protected function initializeRequestBuilder()\n {\n $this->requestBuilder = $this->objectManager->get(\\Sto\\Mediaoembed\\Request\\RequestBuilder::class);\n $this->requestBuilder->setConfiguration($this->configuration);\n }", "public function setupConfig()\n {\n registry::getInstance()->set('config', $this->parseConfig());\n }", "public function validateAndPrepare(){\n if (!isset($this->extras['copyconf-parameters'])) {\n throw new \\InvalidArgumentException('The parameter handler needs to be configured through the extra.copyconf-parameters setting.');\n }\n\n $this->configs = $this->extras['copyconf-parameters'];\n\n if (!is_array($this->configs)) {\n throw new \\InvalidArgumentException('The extra.copyconf-parameters setting must be an array or a configuration object.');\n }\n\n foreach (array('dist_ext', 'reg_exp', 'backup_mode', 'backup_dir') as $var){\n if (isset($this->configs[$var]) && !empty($this->configs[$var])){\n $this->$var = $this->configs[$var];\n }\n }\n }", "public final function prep(){\n\n //disable apache from append session ids to requests\n ini_set('session.use_trans_sid',0);\n //only allow sessions to be used with cookies\n ini_set('session.use_only_cookies',1);\n\n //base directory of application\n //$this->path = dirname($_SERVER['DOCUMENT_ROOT']);\n $this->path = dirname(dirname(dirname(dirname(dirname(__DIR__)))));\n \n //load the appropriate application production configuration \n //and override with any dev config.\n if(is_file($this->path.'/.config.php')){\n $this->config = require($this->path.'/.config.php');\n if($this->config['APP_MODE']!='PROD' && is_file($this->path.'/.dev.config.php')){\n $this->config = array_merge($this->config,require($this->path.'/.dev.config.php'));\n }//if\n }//if\n \n //if the COMPOSER PATH isn't set then resort to the default installer path \"vendor/\"\n if(!isset($this->config['COMPOSER_PATH'])){\n $this->config['COMPOSER_PATH'] = 'vendor';\n }//if\n\n }", "protected function prepareForValidation()\n {\n \n //Filling uncaught parameters to blank default value\n foreach($this->columns_rules as $column => $rules){\n if(empty($this->get($column))) {\n $this->request->add([$column => '']); \n }\n }\n\n }", "function prepare()\r\n\t{\r\n\t\t$domain = $this->config->get(\"url\");\r\n\t\t$this->af->setApp('domain' ,$domain);\r\n\t\treturn null;\r\n\t}", "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 }", "public function prepare()\n {\n parent::prepare();\n\n if ($this->getOptions() instanceof \\MageWorx\\SeoReports\\Model\\Source\\DynamicProblems) {\n\n $reportConfig = $this->reportConfig->getConfigProblemSections();\n\n if (!empty($reportConfig[$this->getName()])) {\n\n $config = $this->getData('config');\n $options = [];\n\n foreach ($reportConfig[$this->getName()] as $problemType => $problemConfig) {\n\n if ($problemType == 'duplicate') {\n $options[] = [\n 'value' => 'duplicate',\n 'label' => __('Duplicated')\n ];\n } elseif ($problemType == 'missing') {\n $options[] = [\n 'value' => 'missing',\n 'label' => __('Missing')\n ];\n } elseif ($problemType == 'length') {\n $options[] = [\n 'value' => 'length',\n 'label' => __('Length')\n ];\n }\n }\n\n $config['options'] = $options;\n $this->setData('config', $config);\n }\n }\n }", "protected function RTEtsConfigParams() {}", "public function prepare() {}", "public function prepare() {}", "public function prepare()\n\t{\n\t\tcreateToken('admin-ssc');\n\t\t$this->adapter->prepare();\n\t}", "protected function buildRequest()\n {\n $rules = collect($this->columns)->pluck('column')->transform(function ($rule) {\n return $rule.':required';\n })->implode('|');\n\n $this->request = [\n 'name' => $this->class,\n '--rules' => $rules,\n '--module' => $this->module->id,\n ];\n }", "protected function setDefaultParameters() {\n // Vendor token of the business that done the request.\n $this->setParameter('vendor_token', $this->getLydiaVendorToken()) ;\n\n // UUID of the remote payment request.\n $this->setParameter('request_uuid', $this->requestUUID) ;\n }", "protected function setUpConfigurationData() {}", "protected function prepareURL() {\n $request = trim($_SERVER['REQUEST_URI'], '/');\n if( !empty($request)) {\n $url = explode('/', $request); // split the request into an array of controller, action, parameters\n \n // is controller is given, then set that name as controller\n // if this is empty, then make homeController as default controller\n $this->controller = isset($url[0]) ? $url[0].'Controller' : 'accountController';\n \n // action to be performed\n // it is specified after the controller name in the url\n // \n $this->action = isset($url[1]) ? $url[1]: 'index';\n \n unset($url[0], $url[1]); // delete this values from the url so that we can have parameters only\n \n // now add the parameters passed, to the prams array\n $this->prams = !empty($url) ? array_values($url) : [];\n }\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n\n $path = explode('\\\\', get_class($this->model));\n\n $this->vars['task_id'] = array_pop($path) . '-' . $this->model->{$this->taskKey};\n $this->vars['task_name'] = $this->model->{$this->taskName};\n\n $this->vars['app_name'] = HarvestSettings::get('app_name', 'Harvest');\n $this->vars['app_url'] = Request::url();\n }", "private function prepareAPIRequest()\n {\n $api_key = $this->getAPIKey();\n\n $api_key_parts = \"\";\n if (count($api_key_parts = explode(\"-\", $api_key)) != 2) {\n throw new Exception(\"Invalid API Key\");\n }\n\n $this->setAPIEndpoint(\"https://$api_key_parts[1].api.mailchimp.com/\" . $this->api_version);\n }", "abstract protected function configure();", "abstract protected function configure();", "public function configure()\n {\n if ($this->getTestMode()) {\n $this->braintree->config->environment('sandbox');\n } else {\n $this->braintree->config->environment('production');\n }\n\n // Set the keys\n $this->braintree->config->merchantId($this->getMerchantId());\n $this->braintree->config->publicKey($this->getPublicKey());\n $this->braintree->config->privateKey($this->getPrivateKey());\n }", "protected function prepare()\n\t{\n\t}", "private static function _initialise () {\r\n\t\tif (!self::$_request) {\r\n\t\t\tself::$_request = array_merge ($_GET, $_POST);\r\n\t\t}\n\t\t\r\n\t}", "abstract public function configure();", "private function initConfig()\n {\n return $this->config = [\n 'api' => 'https://api.gfycat.com/v1',\n ];\n }", "protected function _prepareOptions()\n {\n // apply options\n if (isset($this->_deploy['set_time_limit'])) {\n // script needs time to proces huge amount of data (important)\n set_time_limit($this->_deploy['set_time_limit']);\n }\n if (isset($this->_deploy['memory_limit'])) {\n // adjust memory_limit if needed (not very important)\n ini_set('memory_limit', $this->_deploy['memory_limit']);\n }\n }", "protected function prepare()\n {\n if ($this->stream !== null) {\n return;\n }\n if (isset($this->formatters[$this->format])) {\n $formatter = $this->formatters[$this->format];\n if (!is_object($formatter)) {\n $this->formatters[$this->format] = $formatter = \\Yii::createObject($formatter);\n }\n if ($formatter instanceof ResponseFormatterInterface) {\n $formatter->format($this);\n } else {\n throw new InvalidConfigException(\"The '{$this->format}' response formatter is invalid. It must implement the ResponseFormatterInterface.\");\n }\n } elseif ($this->format === self::FORMAT_RAW) {\n if ($this->data !== null) {\n $this->content = $this->data;\n }\n } else {\n throw new InvalidConfigException(\"Unsupported response format: {$this->format}\");\n }\n\n if (is_array($this->content)) {\n\n throw new InvalidParamException(\"Response content must not be an array.\");\n } elseif (is_object($this->content)) {\n if (method_exists($this->content, '__toString')) {\n $this->content = $this->content->__toString();\n } else {\n throw new InvalidParamException(\"Response content must be a string or an object implementing __toString().\");\n }\n }\n }", "function _prepare() {}", "protected function buildRequest() {\n\t\t/* @var $request \\TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request */\n\t\t$request = $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Web\\\\Request');\n\t\t$request->setControllerVendorName($this->vendorName);\n\t\t$request->setControllerExtensionName($this->extensionName);\n\t\t$request->setPluginName($this->pluginName);\n\t\t$request->setControllerName($this->controllerName);\n\t\t$request->setControllerActionName($this->actionName);\n\t\t$request->setFormat($this->formatName);\n\t\t$request->setArguments($this->arguments);\n\t\treturn $request;\n\t}", "protected function prepareForValidation()\n {\n $this->merge([\n self::ATTRIBUTE_REFERER => $this->prepareArray($this->input(self::ATTRIBUTE_REFERER)),\n self::ATTRIBUTE_IP => $this->prepareArray($this->input(self::ATTRIBUTE_IP)),\n ]);\n }", "public function setup()\n {\n CRUD::setModel('App\\Models\\Request');\n CRUD::setRoute(config('backpack.base.route_prefix').'/request');\n CRUD::setEntityNameStrings('demande', 'demandes');\n if (! $this->crud->getRequest()->has('order')) {\n CRUD::orderBy('created_at', 'DESC');\n }\n $this->crud->enableDetailsRow();\n }", "public function prepare() {\n if (!isset($this->Created))\n $this->Created = date('YmdHis', time());\n\n if (isset($this->ConfirmPassword))\n unset($this->ConfirmPassword);\n\n $this->Password = Auth::getHash($this->Password);\n// $this->ProfileImage = $this->_processProfileImage();\n }", "protected function prepareData()\n {\n parent::prepareData();\n $this->prepareConfigurableProductOptions();\n $this->prepareAttributeSet();\n }", "public function prepareBaseAssignation()\n {\n /** @var KernelInterface $kernel */\n $kernel = $this->get('kernel');\n $this->assignation = [\n 'head' => [\n 'ajax' => $this->getRequest()->isXmlHttpRequest(),\n 'devMode' => $kernel->isDebug(),\n 'maintenanceMode' => (bool) $this->getSettingsBag()->get('maintenance_mode'),\n 'universalAnalyticsId' => $this->getSettingsBag()->get('universal_analytics_id'),\n 'googleTagManagerId' => $this->getSettingsBag()->get('google_tag_manager_id'),\n 'baseUrl' => $this->getRequest()->getSchemeAndHttpHost() . $this->getRequest()->getBasePath(),\n ]\n ];\n\n return $this;\n }", "public function resetInternalProperties()\n {\n // From abstract request\n $this->_dispatched = false;\n $this->_module = null;\n $this->_moduleKey = 'module';\n $this->_controller = null;\n $this->_controllerKey = 'controller';\n $this->_action = null;\n $this->_actionKey = 'action';\n\n // From Http request\n $this->_paramSources = array('_GET', '_POST');\n $this->_requestUri = null;\n $this->_baseUrl = null;\n $this->_basePath = null;\n $this->_pathInfo = '';\n $this->_rawBody = null;\n $this->_aliases = array();\n\n // From Magento Http request\n $this->_originalPathInfo = '';\n $this->_storeCode = null;\n $this->_requestString = '';\n $this->_rewritedPathInfo = null;\n $this->_requestedRouteName = null;\n $this->_routingInfo = array();\n $this->_route = null;\n $this->_directFrontNames = null;\n $this->_controllerModule = null;\n return $this;\n }", "protected function prepareForValidation()\n {\n $this->merge([\n 'advertiser_id' => $this->route('advertiser_id'),\n ]);\n }", "private function setUpConfig() {\n\n //Get the file where the configs are and process the arrays\n require($this->_data['pathtodata']);\n\n $this->_data = array_merge($this->_data,$acs_confdata);\n\n if (empty($this->_data['indexfile']))\n $this->_data['indexfile'] = 'index';\n\n if (empty($this->_data['common_extension']))\n $this->_data['common_extension'] = COMMON_EXTENSION;\n \n $this->setUriData($this->_data); \n \n //Create the cache file of the config\n if (isset($this->_data['cache_config']) && $this->_data['cache_config'])\n $this->saveConfig();\n else\n if (file_exists($this->_data['cache_config_file']))\n unlink($this->_data['cache_config_file']); \n }", "protected function preConfigure()\n\t{\n\t\t$this->setupConfig();\n\t\t$this->setupData();\n\n\t\t$this->debug = $this->config->debug;\n\t}", "private function init() {\n $apiParts = $this->request->getApiParts();\n $this->requestedId = array_shift($apiParts);\n $this->apiParts = $apiParts;\n \n $this->siteDriver = Datastore::getSiteDriver();\n }", "public function initialize() {\n// set_error_handler([$this, 'fatalHandler']);\n register_shutdown_function([$this, 'shutdownHandler']);\n\n /**\n * @todo: инициализация произойдет уже внутри, поэтому не надо ничего присваивать\n * но возможно, сделать вызов покрасивей\n */\n $this->getSession();\n\n $this->Request = $this->getRequest();\n $this->Response = $this->getResponse(); // @todo: задейстовать!!!\n $this->Request->extractParams();\n\n return $this;\n }", "abstract public function initFromRequest(\\App\\Request $request);", "public function prepare() {\n // Initialize instance variables\n $this->postData = $this->bot->getPostData();\n\n $this->findAndReplacesForImageUrls = $this->bot->getSetting(SettingKey::POST_FIND_REPLACE_IMAGE_URLS);\n $this->postSaveImagesAsMedia = $this->bot->getSettingForCheckbox(SettingKey::POST_SAVE_IMAGES_AS_MEDIA);\n $this->postSaveAllImagesInContent = $this->bot->getSettingForCheckbox(SettingKey::POST_SAVE_ALL_IMAGES_IN_CONTENT);\n $this->postSaveImagesAsGallery = $this->postSaveImagesAsMedia && $this->bot->getSettingForCheckbox(SettingKey::POST_SAVE_IMAGES_AS_GALLERY);\n\n // If the user wants to save all images in the post content, set \"save images as media\" to true so that the\n // script can run properly.\n if($this->postSaveAllImagesInContent) {\n $this->postSaveImagesAsMedia = true;\n }\n\n // Save the thumbnail URL first, because the thumbnail may be removed by gallery image selectors later.\n $this->prepareAndSaveThumbnail();\n\n // Prepare the attachment data.\n $this->prepareAttachmentData();\n }", "protected function startup()\n {\n parent::startup();\n\n if (!$this->user->isLoggedIn()) throw new BadRequestException;\n\n $this->info = $this->template->info;\n $this->template->numq = $this->info->getQuotations()->count();\n $this->template->numc = $this->info->getComments()->count();\n $this->template->rank = $this->info->getCrank();\n $this->template->u = $this->info;\n\n $this->section = $this->session->getSection('mff');\n }", "function processConfiguration() ;", "public function prepare()\n {\n if ($this->ready === false) {\n $this->ready = true;\n\n $path = $this->path;\n $format = $this->format;\n $controller = $this->controller;\n\n foreach ($this->classMethods as $value) {\n $route = null;\n\n if ($format === self::BOTH || $format === self::SLASH) {\n $route = ($value[1] === '' ? '' : ($value[1] . '/'));\n }\n\n if ($format === self::BOTH || $format === self::NOSLASH) {\n $route = $value[1] === '' ? '' : ('/' . $value[1]);\n }\n\n if ($route !== null) {\n Route::set($value[0], $path . $route, $controller . ':' . $value[2]);\n }\n }\n }\n }", "protected function prepareForValidation()\n {\n $this->merge([\n 'nome' => $this->nome,\n 'nascimento' => convertDateToDatabase($this->nascimento),\n 'cpf' => returnOnlyNumbers($this->cpf),\n 'email' => $this->email,\n ]);\n }", "abstract protected function defineConfiguration();", "public function init()\n {\n $this->rootPageUid = $this->filterConfig->getSettings('rootPageUid');\n $this->respectEnableFields = $this->filterConfig->getSettings('respectEnableFields');\n $this->respectDeletedField = $this->filterConfig->getSettings('respectDeletedField');\n }", "protected function getConfiguration() {}", "protected function configure()\n {\n }", "protected function configure()\n {\n }", "public function prepare($request)\n {\n $this->inject(self::REQUEST, $request);\n $this->setFlashMessage();\n }", "protected function configure()\n {\n\n \n }", "private function prepare(){\r\n \r\n $autoload = &$this->settings->autoload; \r\n \r\n if(isset($autoload)){\r\n \r\n foreach($autoload AS $key => $class){\r\n \r\n $settings = &$this->settings->{$key};\r\n \r\n if(isset($settings)){\r\n\r\n $this->{$key} = new $class($settings);\r\n }\r\n }\r\n }\r\n }", "public function setConfig()\n {\n $this->postcode = isset($_POST['postcode']) ? htmlspecialchars($_POST['postcode']) : '000-0000';\n $this->maptype = isset($_POST['maptype']) ? htmlspecialchars($_POST['maptype']) : 'Static MAP';\n $this->unit = isset($_POST['unit']) ? htmlspecialchars($_POST['unit']) : 'CELSIUS';\n $this->apiLocation = isset($_POST['apiLocation']) ? htmlspecialchars($_POST['apiLocation']) : 'Google';\n $this->apiWeather = isset($_POST['apiWeather']) ? htmlspecialchars($_POST['apiWeather']) : 'OpenWeatherMap';\n }", "public function prepareRequest() { \n \n $this->validateRequest();\n \n $soapRequest = new \\Svea\\WebPay\\AdminService\\AdminSoap\\CancelOrderRequest( \n new Authentication( \n $this->orderBuilder->conf->getUsername( ($this->orderBuilder->orderType), $this->orderBuilder->countryCode ), \n $this->orderBuilder->conf->getPassword( ($this->orderBuilder->orderType), $this->orderBuilder->countryCode ) \n ),\n $this->orderBuilder->orderId, \n AdminServiceRequest::CamelCaseOrderType( $this->orderBuilder->orderType ),\n $this->orderBuilder->conf->getPassword(($this->orderBuilder->orderType), $this->orderBuilder->countryCode)\n );\n \n return $soapRequest;\n }", "private function initRequestValidator() {\n\t\t\t// language\n\t\t\t$this->rq->addAllowed('GET', 'lang', '', '/^[a-z]{1,7}$/', true);\n\t\t\t\n\t\t\t// project\n\t\t\t$this->rq->addAllowed('GET', 'project', '', '/^[a-z]{1,15}$/', true);\n\t\t\t\n\t\t\t// page\n\t\t\t$this->rq->addAllowed('GET', 'page', '', '', true, false);\n\t\t\t\n\t\t\t$this->par = $this->rq->getParams();\n\t\t}", "public static function initialRequest()\n {\n $secure = [\n 'password',\n 'pass',\n 'access_key',\n 'access_token',\n 'token',\n 'key',\n 'secret',\n 'login',\n 'api_key',\n 'hash',\n ];\n $params = Spry::params();\n\n foreach ($params as $paramKey => $paramValue) {\n if (in_array(strtolower($paramKey), $secure)) {\n $params[$paramKey] = 'xxxxxx...';\n }\n }\n\n $prefix = 'Spry Request: ';\n if (isset(self::$prefix['request'])) {\n $prefix = self::$prefix['request'];\n }\n\n self::log($prefix.(empty($params) ? 'Empty' : str_replace('Array', '', print_r($params, true))));\n }", "public function configure() {\n\t\t}", "private function prepare()\n {\n $this->selectFields[$this->tableName][] = $this->rootEntityIdentifier;\n\n $sColumns = explode(',', $this->requestParams['sColumns']);\n\n for ($i = 0; $i < $this->iColumns; $i++) {\n\n if ($this->requestParams['mDataProp_' . $i] != null) {\n\n $field = $this->requestParams['mDataProp_' . $i];\n\n if ($sColumns[$i] != '') {\n if ($field != $sColumns[$i]) {\n $field = $sColumns[$i];\n }\n }\n\n // association delimiter found\n if (strstr($field, '.') !== false) {\n\n // separate fields\n $fieldsArray = explode('.', $field);\n // set associations in selectFields[]\n $this->setAssociations($fieldsArray, 0, $this->metadata);\n\n } else {\n\n // no association found\n if ($field !== $this->rootEntityIdentifier) {\n array_push($this->selectFields[$this->tableName], $field);\n }\n\n $this->allFields[] = $this->tableName . '.' . $field;\n\n }\n\n } else {\n\n $this->allFields[] = '';\n\n }\n }\n\n return $this;\n }", "protected function setUpFromConfig()\n\t{\n\t\t$timeLimit = 4 * 60 * 60;\n\n\t\t$parameters = $this->container->getParameters();\n\t\tif (is_array($parameters) and array_key_exists(\"taskManager\", $parameters)) {\n\t\t\t/// ***** TIMELIMIT ****** //\n\t\t\tif (isset($parameters[\"taskManager\"][\"timeLimit\"])) {\n\t\t\t\t$timeLimit = $parameters[\"taskManager\"][\"timeLimit\"];\n\t\t\t}\n\t\t\t/// ***** MAX HISTORY DAYS ****** //\n\t\t\tif (isset($parameters[\"taskManager\"][\"history\"][\"maxDays\"])) {\n\t\t\t\t$this->maxHistoryDays = (int)$parameters[\"taskManager\"][\"history\"][\"maxDays\"];\n\t\t\t}\n\t\t\t/// ***** MAX HISTORY RECORDS ****** //\n\t\t\tif (isset($parameters[\"taskManager\"][\"history\"][\"maxRecords\"])) {\n\t\t\t\t$this->maxHistoryRecords = (int)$parameters[\"taskManager\"][\"history\"][\"maxRecords\"];\n\t\t\t}\n\t\t}\n\n\t\tset_time_limit($timeLimit);\n\t}", "protected function initRequest()\n {\n $context = new RequestContext();\n $context->fromRequest(self::$request);\n $matcher = new UrlMatcher($this->routCollection, $context);\n\n try {\n $attributes = $matcher->match(self::$request->getPathInfo());\n $response = $this->callController($attributes);\n } catch (ResourceNotFoundException $e) {\n $response = new Response('Not Found', 404);\n } catch (Exception $e) {\n $response = new Response('An error occurred', 500);\n }\n\n $response->send();\n }", "protected function initConfig()\n {\n $this->config = [];\n }", "public function configure() {}", "public function configure() {}", "private function prepare()\n {\n $constantParameters = $this->uriParser->predefinedParameters();\n array_map([$this, 'prepareConstant'], $constantParameters);\n\n $this->filter();\n $this->sort();\n\n return $this;\n }", "protected function initializeConnection() {\n GatherContent\\Configuration::configure($this->email, $this->api_key);\n\n if (!$this->project_id) {\n $project = $this->retrieveProject($this->account_slug, $this->project_name);\n $this->project_id = $project->id;\n }\n\n if (!$this->template) {\n if ($this->template_id) {\n $this->template = $this->retrieveTemplate($this->template_id);\n }\n elseif ($this->template_name) {\n $this->template = $this->retrieveTemplateByName($this->project_id, $this->template_name);\n $this->template_id = $this->template->id;\n }\n }\n\n if ($this->template_id) {\n $this->include_filters['template_id'] = $this->template_id;\n }\n }", "protected function prepare(): void\n {\n config(['dluwang-auth.entities.permission' => \\Dluwang\\Auth\\Tests\\Permission::class]);\n $gate = $this->app->make(Gate::class);\n\n $gate->define('permission-test', function($user){\n return true;\n });\n\n $gate->policy(\\Dluwang\\Auth\\Tests\\User::class, UserPolicy::class);\n $this->artisan('dluwang-auth:install');\n $this->artisan('migrate');\n }" ]
[ "0.69601846", "0.6925541", "0.6668498", "0.6461505", "0.6407273", "0.6392652", "0.6287327", "0.6282456", "0.62120664", "0.62031174", "0.61844707", "0.6163672", "0.6125928", "0.6116237", "0.611167", "0.60669315", "0.6005491", "0.5999368", "0.59947604", "0.5992889", "0.59454376", "0.5941642", "0.59383", "0.59327734", "0.59180266", "0.591264", "0.5911511", "0.5894043", "0.5886446", "0.585709", "0.58539516", "0.5853491", "0.5843584", "0.5829668", "0.5829139", "0.58011556", "0.57930446", "0.57791716", "0.5773862", "0.57738364", "0.5759853", "0.575958", "0.575834", "0.575603", "0.5737028", "0.57359093", "0.572827", "0.57236904", "0.56862694", "0.5672274", "0.5669014", "0.5669014", "0.56671524", "0.56658006", "0.5619862", "0.56180626", "0.5617481", "0.56075567", "0.55926967", "0.5591623", "0.559141", "0.5583212", "0.5578043", "0.55772233", "0.55745566", "0.55629516", "0.55578685", "0.5557317", "0.555466", "0.5553783", "0.55513614", "0.55491734", "0.5546235", "0.5543911", "0.5542632", "0.55072135", "0.5506003", "0.5504246", "0.5501566", "0.5496821", "0.54957426", "0.5482395", "0.5482395", "0.5474816", "0.5473726", "0.54684246", "0.5463651", "0.5462706", "0.54616785", "0.5455807", "0.5454979", "0.5453369", "0.54520077", "0.5446934", "0.5434224", "0.5430026", "0.5430026", "0.54248965", "0.5424279", "0.5423616" ]
0.6381858
6
Determine if rate limiting is disabled.
protected function rateLimitingDisabled() { return $this->config['limit'] == 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isRateLimitEnabled(): bool\n {\n return $this->rateLimitEnabled === true;\n }", "protected function exceededRateLimit()\n {\n return $this->cache->get($this->config['keys']['requests']) > $this->config['limit'];\n }", "public function isDisabled() {}", "public function isDisabled();", "public function isDisabled();", "public function isDisabled();", "public function is_allowed() {\n\t\tif ( rocket_bypass() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( rocket_get_constant( 'DONOTROCKETOPTIMIZE' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( is_rocket_post_excluded_option( 'delay_js' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (bool) $this->options->get( 'delay_js', 0 );\n\t}", "public function isDisabled()\n {\n if (!GoogleAPI::singleton()->hasAPIKey()) {\n return true;\n }\n \n return parent::isDisabled();\n }", "protected function isAllowedStatusUsed()\n\t{\n\t\treturn $this->use_allowed_status;\n\t}", "public function isLimited()\n {\n return ($this->limit > 0);\n }", "public function isCheckLimitsEnabled(): bool\n\t{\n\t\treturn $this->isCheckLimitsEnabled;\n\t}", "public function isAllow() {\n return !$this->isEnabled();\n }", "public static function isDisabled(): bool\n {\n return !empty(static::DISABLED);\n }", "public function isDisabled()\n {\n }", "public function is_disabled()\n {\n }", "public function getIsDisabled() {}", "public function isDisabled()\n {\n return false;\n }", "public function isDisabled()\n\t{\n\t\treturn false;\n\t}", "public function getRateLimit(){\n\t\treturn $this->rateLimit;\n\t}", "public function isEnabled()\n {\n return !$this->banned;\n }", "public function isRequestLimitReached(): bool\n {\n if ($this->requestLimit === 0) {\n return true;\n }\n return app(RateLimiter::class)->tooManyAttempts($this->rateLimiterKey, $this->requestLimit, $this->decayTime);\n }", "public function isBlocked()\n {\n if ($this->status == 2) {\n return true;\n } else {\n return false;\n }\n }", "public function getIpLockIsDisabled() {}", "public function isDisabled()\n {\n return $this->getData(self::DISABLED);\n }", "private function _checkRateLimit()\n {\n if (empty(self::$_responseHeaders))\n {\n return;\n }\n\n // Default the $limit and $remaining values if not set in the last response header.\n /** @var int $limit */\n $limit = isset(self::$_responseHeaders[self::RATE_LIMIT])\n ? (int)self::$_responseHeaders[self::RATE_LIMIT]\n : self::DEFAULT_RATE_LIMIT;\n\n /** @var int $remaining */\n $remaining = isset(self::$_responseHeaders[self::RATE_LIMIT_REMAINING])\n ? (int)self::$_responseHeaders[self::RATE_LIMIT_REMAINING]\n : self::DEFAULT_RATE_LIMIT;\n\n // If no API calls have been made, no need to delay.\n if ($limit == $remaining)\n {\n return;\n }\n\n // If we are below 5% remaining, sleep for 0.50 seconds.\n if ($remaining / $limit < 0.05)\n {\n usleep(500000);\n return;\n }\n\n // If we are below 10% remaining, sleep for 0.25 seconds.\n if ($remaining / $limit < 0.1)\n {\n usleep(250000);\n }\n }", "public function isDisabled()\n {\n return !$this->enabled;\n }", "public function isApiEnabled()\n {\n return (Mage::getStoreConfig('smsnotifier/main_conf/active')==0) ? 0 : 1;\n\n }", "public function isCDEnabledAndRequestNonLocalNonAdmin()\n {\n $settings = $this->getSettings();\n return !Mage::app()->getRequest()->getPost('is_local_request')\n && !Mage::app()->getStore()->isAdmin()\n && $settings['enabled'];\n }", "public static function DISABLED()\n {\n return new RateDistortionLevelForQuantization(self::DISABLED);\n }", "public function isDenied()\n {\n return isset($this->_data[OAuth::PARAM_DENIED]);\n }", "public function disableRateLimit(): self\n {\n $this->rateLimitEnabled = false;\n\n return $this;\n }", "public function isApiEnabled()\n {\n return (Mage::getStoreConfig('easywebshopsms/api_connection/active')==0) ? false : true;\n }", "public function isDisabled(): bool\n {\n return $this->disabled;\n }", "public function isDisabled()\n {\n return parent::isDisabled();\n }", "function isDisabled() {\n\t\treturn ($this->getActive() == self::PROFILE_DISABLED);\n\t}", "public function isDisabled(): bool\n {\n return ! $this->isEnabled();\n }", "function isDisabled()\n {\n return false;\n }", "public function is_enabled() {\n $settings = get_option('woocommerce_enda_bundle_rate_settings');\n return $settings['enabled'] == 'yes' ? true : false;\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n });\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n });\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n });\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n });\n }", "function isDisabled()\n {\n return $this->_disabled;\n }", "private function isRateLimitReached()\n {\n if (!$this->getRateLimit()) {\n throw new InstagramThrottleException('400 Bad Request : You have reached Instagram API Rate Limit', 400);\n }\n }", "protected function _isEnabled()\n {\n $area = $this->BRequest->area();\n\n if ($area == 'FCom_Frontend' && !$this->Sellvana_CurrencyManager_Model_Manager->getConfig('enabled_on_frontend')) {\n return false;\n }\n\n if ($area == 'FCom_Admin' && !$this->Sellvana_CurrencyManager_Model_Manager->getConfig('enabled_on_admin')) {\n return false;\n }\n\n $disabledViews = $this->Sellvana_CurrencyManager_Model_Manager->getConfig('disabled_in_views', null, []);\n $currentView = $this->_getCurrentView();\n\n return !($area == 'FCom_Frontend' && in_array($currentView, $disabledViews));\n }", "public static function rateLimit(): self\n {\n return self::getInstance('RATE_LIMIT');\n }", "function updateLimitEnabled()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function isDisabled() {\n if ( $this->reflectionSource instanceof ReflectionFunction ) {\n return $this->reflectionSource->isDisabled();\n } else {\n return parent::isDisabled();\n }\n }", "public function isModeSecurityDisabled()\n {\n $checking_result = true;\n\n ob_start();\n phpinfo(INFO_MODULES);\n $_info = ob_get_contents();\n ob_end_clean();\n\n if (strpos($_info, 'mod_security') !== false) {\n App::instance()->setNotification('E', App::instance()->t('error'), App::instance()->t('text_mod_security'), true, 'validator');\n $checking_result = false;\n }\n\n return $checking_result;\n }", "public function hasUserLimit()\n {\n return $this->user_limit !== null;\n }", "public function isDisabled()\n\t{\n\t\treturn ($this->disabled_at !== null);\n\t}", "public function getMyRateLimitInfo () {\n var_dump($this->talkToTwitter('application/rate_limit_status', '?'));\n exit();\n }", "public function hasDisabled()\n {\n return $this->disabled;\n }", "public function canRate()\n {\n if ($this->_blCanRate === null) {\n\n $this->_blCanRate = false;\n\n if ($this->ratingIsActive() && $oUser = $this->getUser()) {\n\n $oRating = oxNew('oxrating');\n $this->_blCanRate = $oRating->allowRating($oUser->getId(), 'oxarticle', $this->getProduct()->getId());\n }\n }\n\n return $this->_blCanRate;\n }", "public function getDisabled(): bool;", "protected function is_no_limit_or_pagination( $view_settings ) {\n\t\treturn ( $view_settings['limit'] === -1 && $view_settings['pagination']['type'] === 'disabled' );\n\t}", "public function canBeEnabled();", "public function isDisabled($name)\n {\n return in_array($name, $this->except);\n }", "public function isDisabled()\n {\n return $this->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED;\n }", "public function disable(): bool {}", "public function isDisabled()\n {\n // TODO AccessControl or checking Role?\n /*if (Yii::$app->user->username !== 'admin') {\n return true;\n }*/\n\n return $this->parentIsDisabled();\n }", "public function isBlocked()\n {\n return $this->getStatus() == self::STATUS_BLOCKED;\n }", "public function getRateLimiterConfig() {\n return $this->rateLimiterConfig;\n }", "protected function isStatusDenied()\n {\n return $this->getStatus() === self::STATUS_DENIED;\n }", "public static function subscription_disabled($reactforum) {\n return ($reactforum->forcesubscribe == REACTFORUM_DISALLOWSUBSCRIBE);\n }", "public function isSafeModeDisabled()\n {\n $checking_result = (Bootstrap::getIniParam('safe_mode') == true) ? false : true;\n\n if (!$checking_result) {\n App::instance()->setNotification('E', App::instance()->t('error'), App::instance()->t('text_safe_mode_notice'), true, 'validator');\n }\n\n return $checking_result;\n }", "private function throttleIsActive()\n {\n return $this->config['throttle'];\n }", "public function isQuotationCouponDisabled() {\n return $this->scopeConfig->getValue(\n self::QUOTATION_COUPON_CONFIG,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "private function _is_api_request_allowed()\n\t{\n\t\t// STEP 1: Check to see if site is private\n\t\tif(Kohana::config('settings.private_deployment'))\n\t\t{\n\t\t\tif ( ! $this->_login())\n\t\t\t{\n\t\t\t\t// @todo better error message\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// STEP 2: Check if the IP has been banned\n\t\t$banned_count = ORM::factory('api_banned')\n\t\t\t\t\t\t->where('banned_ipaddress', $this->request_ip_address)\n\t\t\t\t\t\t->count_all();\n\n\t\tif ($banned_count > 0)\n\t\t\treturn FALSE;\n\n\t\t// STEP 3: Check if the IP address has exceeded the request quota\n\n\t\t// Get the API settings\n\t\t$api_settings = new Api_Settings_Model(1);\n\n\t\t// Check if an API request quota has been set\n\t\tif ( ! isset ($api_settings->max_requests_per_ip_address))\n\t\t\treturn TRUE;\n\n\t\t// Get the API request quota\n\t\t$request_quota = $api_settings->max_requests_per_ip_address;\n\n\t\t// Get the quota basis\n\t\t$quota_basis = (isset($api_settings->max_requests_quota_basis))\n\t\t\t? $api_settings->max_requests_quota_basis\n\t\t\t: NULL;\n\n\t\t$num_api_requests = -1; // Will hold the number of API requests for the specified IP\n\n\t\t// Database table prefix\n\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\n\t\t// Template query\n\t\t$template_query = \"SELECT COUNT(*) AS record_count \";\n\t\t$template_query .= \"FROM \".$table_prefix.\"api_log \";\n\t\t$template_query .= \"WHERE DATE_FORMAT(api_date, '%s') = '%s' \";\n\t\t$template_query .= \"AND api_ipaddress = '\".$this->request_ip_address.\"'\";\n\n\t\t// Get the number of api requests logged depending on the quota basis\n\t\tswitch ($quota_basis)\n\t\t{\n\t\t\t// Per day quota\n\t\t\tcase 0:\n\t\t\t\t$items = $this->db->query(sprintf($template_query, '%Y-%m-%d', date('Y-m-d', time())));\n\t\t\t\t$num_api_requests = (int)$items[0]->record_count;\n\t\t\tbreak;\n\n\t\t\t// Per month quota\n\t\t\tcase 1:\n\t\t\t\t$items = $this->db->query(sprintf($template_query, '%Y-%m', date('Y-m', time())));\n\t\t\t\t$num_api_requests = (int)$items[0]->record_count;\n\t\t\tbreak;\n\t\t}\n\n\t\t// Return value\n\t\treturn ($num_api_requests >= $request_quota)? FALSE : TRUE;\n\t}", "function isDenied() {\n return !empty($this->denied_reasons);\n }", "public function isLimitExceeded();", "public function check_rate_limit( $echo = FALSE ){\n\n\t\t\t// check rate-limiting (per IP)\n\t\t\t$raw_response = wp_remote_get( $this->api_urls['ratelimit'], array( 'sslverify' => $this->sslverify ) );\n\n\t\t\tif( is_wp_error( $raw_response ) ){\n\n\t\t\t\t$this->error = TRUE;\n\t\t\t\t$this->set_error(\n\t\t\t\t\t\t'warning',\n\t\t\t\t\t\tsprintf( '%s: %s', __( 'An error occurred while fetching the rate-limit', self::LANG ), $raw_response->get_error_message() )\n\t\t\t\t);\n\n\t\t\t} else {\n\n\t\t\t\t$headers = &$raw_response['headers'];\n\n\t\t\t\tself::$api_calls_remaining = $headers['x-ratelimit-remaining'];\n\t\t\t\tself::$api_calls_ratelimit = $headers['x-ratelimit-limit'];\n\n\t\t\t\tif( 0 >= self::$api_calls_remaining ){\n\n\t\t\t\t\t$this->error = TRUE;\n\t\t\t\t\t$this->set_error( 'warning', sprintf( __( 'Rate limit of %d api-calls is exceeded.', self::LANG ), self::$api_calls_ratelimit ) );\n\t\t\t\t\treturn FALSE;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn ( FALSE !== $echo ) ? sprintf( '%d out of %d api calls remaining.', self::$api_calls_remaining, self::$api_calls_ratelimit ) : TRUE;\n\n\t\t}", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60);\n });\n }", "public function hasQuotaUnlock(){\n return $this->_has(10);\n }", "function errorlog_is_limitlogin() {\n return defined(LIMIT_LOGIN_LOCKOUT_NOTIFY_ALLOWED);\n}", "public function isAllow()\n {\n return $this->allow;\n }", "public function isInBurstMode()\n {\n return $this->isInBurstMode;\n }", "public function getIsCustomerAccessLimited(): bool;", "public function isNotReadyForRequests() {\n return empty($this->service_url) || empty($this->api_key);\n }", "public function is_user_over_quota()\n {\n }", "public function allowRequest(): bool\n {\n return true;\n }", "public function isDenied() {\n return $this->denied;\n }", "protected function configureRateLimiting(): void\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());\n });\n }", "protected function configureRateLimiting(): void\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());\n });\n }", "public function isEnabled()\n {\n return $this->profiler['enabled'];\n }", "public function isDisabled()\n\t{\n\t\tif (($record=$this->getActiveRecord())===null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (bool)$record->esta_deshabilitado;\n\t}", "protected function get_email_rate_limit()\n {\n }", "public function canBeDisabledAndEnabled() {}", "public function getIsBlocked();", "public function isDisabled()\n {\n return !$this->hasListItems();\n }", "function canProcessRequests()\n\t{\n\t\tif ($this->getRequestMode() != -1) return true;\n\t\treturn false;\n\t}", "public function isDisabled()\n {\n if (!$this->Image()->exists()) {\n return true;\n }\n \n return parent::isDisabled();\n }", "protected function checkDisableFunctions() {}", "public function getRateLimit()\n {\n return $this->xRateLimitRemaining;\n }", "public function is_enabled() {\n\t\treturn WPSEO_Options::get( 'ryte_indexability' );\n\t}", "protected function isStatusAllowed()\n {\n return $this->getStatus() === self::STATUS_ALLOWED;\n }", "public function isAjaxEnabled()\n {\n if (!$this->isEnabled()) {\n return false;\n }\n return Mage::getStoreConfigFlag('training_layred/catalog/ajax_enabled');\n }", "public function isEnabled()\n {\n return !($this instanceof NullSecurityToken);\n }", "public function testRateLimit()\n {\n $this->markTestIncomplete('Not yet implemented.');\n }", "public function isDisabled(string $name): bool\n {\n return in_array($name, $this->except);\n }" ]
[ "0.80362725", "0.6431033", "0.6367116", "0.6316369", "0.6316369", "0.6316369", "0.62642473", "0.6238752", "0.62275565", "0.62133664", "0.61785895", "0.6177483", "0.611829", "0.6115391", "0.60724354", "0.60677505", "0.6042399", "0.602266", "0.60194993", "0.60177106", "0.59980196", "0.59360236", "0.59307414", "0.5928132", "0.5926846", "0.5924955", "0.5923413", "0.59179056", "0.59022695", "0.5890076", "0.5882782", "0.58800817", "0.587717", "0.5874608", "0.5868891", "0.5865456", "0.5865255", "0.586162", "0.5846845", "0.5846845", "0.5846845", "0.5846845", "0.58439296", "0.5834429", "0.58034134", "0.5797234", "0.5787989", "0.5773716", "0.5754192", "0.57297784", "0.57289964", "0.57285327", "0.5721763", "0.57199275", "0.56841654", "0.56623155", "0.56595033", "0.5646265", "0.5604886", "0.559734", "0.55877566", "0.5587401", "0.55831337", "0.5581879", "0.55805886", "0.557915", "0.5572842", "0.5559779", "0.5559556", "0.5557969", "0.55572915", "0.55541956", "0.55459315", "0.5542183", "0.55393976", "0.5534249", "0.5518596", "0.5500867", "0.5494122", "0.5491995", "0.5487919", "0.54859084", "0.547204", "0.547204", "0.54709685", "0.5468202", "0.5452381", "0.5449275", "0.5445524", "0.54439324", "0.54315406", "0.54249245", "0.5410348", "0.54095113", "0.5399414", "0.5398415", "0.5397628", "0.53927535", "0.5391087", "0.53910565" ]
0.85676414
0
Dynamically handle binding calls on the container.
public function __get($binding) { $binding = isset($this->mappings[$binding]) ? $this->mappings[$binding] : $binding; if (isset($this->bindings[$binding])) { return $this->bindings[$binding]; } return $this->bindings[$binding] = $this->container->make($binding); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function bind() {}", "private function bindContainer()\n {\n parent::setInstance($this);\n \n $this->instance('container', $this);\n $this->instance(BaseContainer::class, $this);\n }", "protected function bind()\n {\n if (!isset($this->di)) {\n return false;\n }\n foreach ($this->di as $contract => $object) {\n $this->app->bind($contract, $object);\n }\n }", "private function registerBindings()\n {\n foreach($this->bindings as $key => $val)\n {\n $this->app->bind($key, $val);\n }\n }", "protected function registerBaseBindings()\n {\n $this->container->bind(\n \\Lib\\Contracts\\Http\\Kernel::class,\n \\Lib\\Http\\Kernel::class\n );\n\n $this->container->bind(\n \\Lib\\Contracts\\Support\\Config::class,\n \\Lib\\Support\\Config::class\n );\n }", "protected function registerBaseBindings()\n {\n static::setInstance($this);\n\n $this->instance('app', $this);\n\n $this->instance(Container::class, $this);\n }", "private function bindServices()\n {\n // $this->app->singleton('package-blueprint-service', function ($app) {\n // return new FooService();\n // });\n }", "protected function registerBaseBindings()\n {\n $container = $this->getContainer();\n\n $container->share(Parser::class, Parser::class);\n }", "protected function bindParametersFromContainer()\n {\n $parameters = $this->parameterContainer->getNamedArray();\n $type = '';\n $args = [];\n\n foreach ($parameters as $name => &$value) {\n if ($this->parameterContainer->offsetHasErrata($name)) {\n switch ($this->parameterContainer->offsetGetErrata($name)) {\n case ParameterContainer::TYPE_DOUBLE:\n $type .= 'd';\n break;\n case ParameterContainer::TYPE_NULL:\n $value = null; // as per @see http://www.php.net/manual/en/mysqli-stmt.bind-param.php#96148\n case ParameterContainer::TYPE_INTEGER:\n $type .= 'i';\n break;\n case ParameterContainer::TYPE_STRING:\n default:\n $type .= 's';\n break;\n }\n } else {\n $type .= 's';\n }\n $args[] = &$value;\n }\n\n if ($args) {\n array_unshift($args, $type);\n call_user_func_array([$this->resource, 'bind_param'], $args);\n }\n }", "public function bind(array $bindings);", "protected function registerApplicationsBaseBindings(): void\n {\n static::setInstance($this);\n\n $this->instance('application', $this);\n $this->instance('container', $this);\n }", "private function registerBinding()\n {\n /**\n * bind Tax Repository to its Eloquent implementation\n */\n $this->app->bind(\n \\Innovate\\Repositories\\Tax\\TaxContract::class,\n \\Innovate\\Repositories\\Tax\\EloquentTaxRepository::class\n );\n /**\n * bind BankTransferInfoContract to its elquent implementation EloquentBankTransferInfoRepository\n */\n $this->app->bind(\n \\Innovate\\Repositories\\StaticPages\\BankTransferInfo\\BankTransferInfoContract::class,\n \\Innovate\\Repositories\\StaticPages\\BankTransferInfo\\EloquentBankTransferInfoRepository::class\n );\n\n /**\n *\n */\n $this->app->bind(\n \\Innovate\\Repositories\\StaticPages\\CheckOutAgreement\\CheckOutAgreementContract::class,\n \\Innovate\\Repositories\\StaticPages\\CheckOutAgreement\\EloquentCheckOutAgreementRepository::class\n );\n\n $this->eavAttributeBindings();\n $this->eavAttributeCategoryBindings();\n }", "protected function bindPathsInContainer(): void\n {\n $this->instance('path.base', $this->basePath());\n\n foreach ($this->getApplicationDirectoreis() as $path) {\n $this->instance('path.' . $path, $this->basePath($path));\n }\n }", "protected function bindings()\n\t{\n\t\t$this->app->singleton('anodyne', function ($app) {\n\t\t\treturn new \\App\\Anodyne;\n\t\t});\n\n\t\t// Bind the avatar class into the container\n\t\t$this->app->bind('avatar', function ($app) {\n\t\t\treturn new \\App\\Avatar;\n\t\t});\n\n\t\t// Bind the flash notifier class into the container\n\t\t$this->app->bind('flash', function ($app) {\n\t\t\treturn new \\App\\FlashNotifier;\n\t\t});\n\t}", "private function bindFacades()\n {\n foreach ($this->facades as $name => $facade) {\n app()->bind($name, function () use ($facade) {\n return new $facade;\n });\n }\n }", "protected function registerBindings(Collection $bindings)\n {\n $bindings->each(function ($concretion, $abstraction) {\n $this->app->bind($abstraction, $concretion);\n });\n }", "public function bindings();", "private function bindAliasesToContainer()\n {\n foreach (static::$aliasMap as $alias => $classes)\n {\n foreach ($classes as $class)\n {\n $this->alias($alias, $class);\n }\n }\n }", "private function registerBaseBindings()\n {\n static::setInstance($this);\n\n $this->instance(self::class, $this);\n\n $this->singleton('config', \\config\\Repository::class);\n }", "public function testCanBindServicesPassingArrayToContainer()\n {\n $container = new Container([\n \\stdClass::class => function () {\n return new \\stdClass;\n },\n 'config' => [\n 'db' => ['host' => '127.0.0.1'],\n ],\n ]);\n\n $this->assertTrue($container->has(\\stdClass::class));\n $this->assertTrue($container->has('config'));\n $this->assertInternalType('array', $container->resolve('config'));\n $this->assertArrayHasKey('db', $container->resolve('config'));\n }", "protected function buildBindings(): void\n {\n $this->bindings = $this->fieldValueSet->getBoundValues();\n }", "public static function getBindings(){\n //Method inherited from \\Illuminate\\Container\\Container \n return \\Illuminate\\Foundation\\Application::getBindings();\n }", "public function getBindings();", "protected function registerBaseBindings() \n {\n static::setInstance($this);\n \n $this->instance('app', $this);\n $this->instance('config', $this[\\Syscodes\\Components\\Config\\Configure::class]);\n }", "public function bindings()\n {\n $this->_injector->bindImplementation(\n 'Horde_Kolab_FreeBusy_Factory', $this->_factory\n );\n $this->_injector->bindFactory(\n 'Horde_Routes_Mapper', $this->_factory, 'createMapper'\n );\n $this->_injector->bindFactory(\n 'Horde_Kolab_FreeBusy_Controller_RequestConfiguration',\n $this->_factory,\n 'createRequestConfiguration'\n );\n $this->_injector->bindFactory(\n 'Horde_Controller_Request', $this->_factory, 'createRequest'\n );\n $this->_injector->bindFactory(\n 'Horde_View_Base', $this->_factory, 'createView'\n );\n $this->_injector->bindFactory(\n 'Horde_Controller_ResponseWriter',\n $this->_factory,\n 'createResponseWriter'\n );\n $this->_injector->bindFactory(\n 'Horde_Log_Logger', $this->_factory, 'createLogger'\n );\n $this->_injector->bindFactory(\n 'Horde_Kolab_FreeBusy_User', $this->_factory, 'createUser'\n );\n $this->_injector->bindFactory(\n 'Horde_Kolab_FreeBusy_Owner', $this->_factory, 'createOwner'\n );\n $this->_injector->bindFactory(\n 'Horde_Kolab_FreeBusy_Resource', $this->_factory, 'createResource'\n );\n $this->_injector->bindFactory(\n 'Horde_Kolab_FreeBusy_Provider', $this->_factory, 'createProvider'\n );\n }", "public function register()\n {\n foreach ($this->bindings as $abstract => $concrete) {\n $this->app->bind($abstract, $concrete);\n }\n }", "public function bind($key, $value)\n {\n if ($this->isClassString($value) || is_callable($value)) {\n $this->nonSingletonClassBinds[] = $key;\n }\n\n $this->addToContainer($key, $value);\n }", "protected function registerBindings()\n {\n $this->app->bind(\n \\LaravelFlare\\Flare\\Contracts\\Permissions\\Permissionable::class,\n \\Flare::config('permissions')\n );\n }", "public function register()\n {\n foreach ($this->simpleBindings as $contract => $service) {\n $this->app->bind($contract, $service);\n }\n }", "public function register()\n {\n foreach ($this->getBindings() as $interface => $class) {\n $this->app->bind($interface, $class);\n }\n }", "private function registerDefaultEventSourcingBindings() : void\n {\n $this->app->bind(\n AggregateFactory::class,\n PublicConstructorAggregateFactory::class\n );\n\n $this->app->bind(\n Serializer::class,\n SimpleInterfaceSerializer::class\n );\n\n $this->app->singleton(\n EventBus::class,\n SimpleEventBus::class\n );\n }", "public function registerBindings() {\n $this->app->bind(\n 'App\\Repositories\\Backend\\Slider\\SliderContract',\n 'App\\Repositories\\Backend\\Slider\\EloquentSliderRepository'\n );\n $this->app->bind(\n 'App\\Repositories\\Frontend\\Slider\\SliderContract',\n 'App\\Repositories\\Frontend\\Slider\\EloquentSliderRepository'\n );\n }", "protected function registerFacadeServiceContainerBindings()\n {\n $facades = base_path(config('make-facades.path'));\n $directories = glob($facades . '/*' , GLOB_ONLYDIR);\n\n foreach($directories as $directory)\n {\n $path = explode('/', $directory);\n $service = end($path);\n $namespace = config('make-facades.namespace');\n $serviceClass = \"{$namespace}\\\\{$service}\\\\{$service}\";\n $retrieveService = (new \\ReflectionClass($serviceClass));\n $this->bindings[$retrieveService->getShortName()] = $retrieveService->getName();\n }\n\n return $this;\n }", "function bind(string $name, callable $transform): void {\n $bindings = stash(DISPATCH_BINDINGS_KEY) ?? [];\n $bindings[$name] = $transform;\n stash(DISPATCH_BINDINGS_KEY, $bindings);\n}", "private function bindImplementations(): void\n {\n $this->app->bind(RestaurantRepositoryInterface::class, function () {\n return new FileRestaurantRepository(\n storage_path('data/restaurants.json'), Restaurant::class\n );\n });\n\n $this->app->bind(UserFavoriteRestaurantRepositoryInterface::class, function () {\n return new FileUserFavoriteRestaurantRepository(\n storage_path('data/user_favorite_restaurants.json'), UserFavoriteRestaurant::class\n );\n });\n }", "protected function bindContracts()\n {\n $dir = dirname((new ReflectionClass(get_called_class()))->getFileName());\n $configPath = $dir . '/../resources/config/config.php';\n if (!file_exists($configPath)) {\n return false;\n }\n if (empty($di = require $configPath)) {\n return false;\n }\n\n foreach (array_get($di, 'di', []) as $contract => $class) {\n $this->app->bind($contract, $class);\n }\n }", "public function boot()\n {\n $this->mapBindings();\n\n parent::boot();\n }", "protected function bindInterfaceImplementor()\n {\n $this->app->bind(\n 'vital40\\Repositories\\ArticleRepositoryInterface',\n 'vital40\\Repositories\\DBArticleRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\InventorySummaryRepositoryInterface',\n 'vital40\\Repositories\\DBInventorySummaryRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\PerformanceTallyRepositoryInterface',\n 'vital40\\Repositories\\DBPerformanceTallyRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\JobExperienceRepositoryInterface',\n 'vital40\\Repositories\\DBJobExperienceRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\JobStatusRepositoryInterface',\n 'vital40\\Repositories\\DBJobStatusRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\PermissionRepositoryInterface',\n 'vital40\\Repositories\\DBPermissionRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\PermissionRoleRepositoryInterface',\n 'vital40\\Repositories\\DBPermissionRoleRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\PurchaseOrderRepositoryInterface',\n 'vital40\\Repositories\\DBPurchaseOrderRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\PurchaseOrderDetailRepositoryInterface',\n 'vital40\\Repositories\\DBPurchaseOrderDetailRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\ReceiptHistoryRepositoryInterface',\n 'vital40\\Repositories\\DBReceiptHistoryRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\RoleRepositoryInterface',\n 'vital40\\Repositories\\DBRoleRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\RoleUserRepositoryInterface',\n 'vital40\\Repositories\\DBRoleUserRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\SessionTypeRepositoryInterface',\n 'vital40\\Repositories\\DBSessionTypeRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\ToteRepositoryInterface',\n 'vital40\\Repositories\\DBToteRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\UPCRepositoryInterface',\n 'vital40\\Repositories\\DBUPCRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\UserRepositoryInterface',\n 'vital40\\Repositories\\DBUserRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\UserActivityRepositoryInterface',\n 'vital40\\Repositories\\DBUserActivityRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\UserConversationRepositoryInterface',\n 'vital40\\Repositories\\DBUserConversationRepository'\n );\n $this->app->bind(\n 'vital40\\Repositories\\VendorComplianceRepositoryInterface',\n 'vital40\\Repositories\\DBVendorComplianceRepository'\n );\n }", "public function bindIn(&...$binds);", "private function addBind($_is404){\n\t\tif ($_is404)\n\t\t\tself::$bind404A[] = $this;\n\t\telse\n\t\t\tself::$bindA[] = $this;\n\t}", "public function getBindings(): array;", "protected function registerRouteBindings()\n {\n //\n }", "public function boot()\n {\n parent::boot();\n\n $this->app->call([$this, 'bind']);\n }", "protected function registerCustomBindings(): void\n {\n $entityServiceFactory = $this->app->make(IEntityServiceFactory::class);\n\n foreach (config('laravel_entity_services.bindings') as $className => $entityService) {\n $entityServiceFactory->register($className, $entityService);\n }\n }", "protected function setRepositoryBindings()\n\t{\n\t\t$this->aliases = $this->app['config']['app.aliases'];\n\n\t\t// Set the items being bound\n\t\t$bindings = ['Comment', 'Goal', 'Plan', 'Stat'];\n\n\t\tforeach ($bindings as $binding)\n\t\t{\n\t\t\t$this->bindRepository($binding);\n\t\t}\n\t}", "public function getBind();", "protected function bindPathsInContainer()\n {\n $this->instance('path', $this->path());\n $this->instance('path.base', $this->basePath());\n $this->instance('path.config', $this->configPath());\n $this->instance('path.public', $this->publicPath());\n $this->instance('path.storage', $this->storagePath());\n $this->instance('path.database', $this->databasePath());\n $this->instance('path.resources', $this->resourcePath());\n }", "protected function bindClasses()\n {\n $this->app->bind(FileLoader::class, LaravelFileLoader::class);\n $this->app->bind(Importer::class, DatabaseImporter::class);\n $this->app->bind(Exporter::class, FileExporter::class);\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 function getBinds(): array;", "public function add(Bind $bind): void\n {\n $dependency = $bind->getBound();\n $dependency->register($this->container, $bind);\n }", "public function bind()\n {\n foreach ($this->columns as $column) {\n $column->bind();\n }\n }", "protected function registerBindings()\n {\n // bind the manager class.\n $this->app->bind(Contracts\\Token\\Manager::class, Manager::class);\n\n // bind the guard class.\n $this->app->bind(Contracts\\Auth\\Guard::class, Guard::class);\n }", "protected function bindContainerPaths()\n {\n $this->instance('path', $this->path());\n $this->instance('path.base', $this->basePath());\n $this->instance('path.config', $this->configPath());\n $this->instance('path.public', $this->publicPath());\n $this->instance('path.storage', $this->storagePath());\n $this->instance('path.database', $this->databasePath());\n $this->instance('path.resources', $this->resourcePath());\n $this->instance('path.bootstrap', $this->bootstrapPath());\n \n $this->setLangPath(value(function () {\n if (is_dir($directory = $this->resourcePath('lang'))) {\n return $directory;\n }\n \n return $this->basePath('lang');\n }));\n }", "public function processBind()\n {\n $bind = [];\n\n foreach ($this->fields as $field)\n {\n\n if($field == $this->tablePK)\n {\n $bind[\":id\"] = $this->data[$field];\n }\n else\n {\n $bind[\":$field\"] = $this->data[$field];\n }\n }\n $this->bind = $bind;\n }", "public function bind($name,$value,$type = NULL);", "private function bind()\n {\n pcntl_signal(SIGTERM, [$this, 'shutdown']);\n pcntl_signal(SIGQUIT, [$this, 'shutdown']);\n pcntl_signal(SIGINT, [$this, 'shutdown']);\n }", "public function bind($interface)\n {\n $bind = new Sabel_Container_Bind($interface);\n $this->binds[$interface][] = $bind;\n \n return $bind;\n }", "private function bind_object_class(): void\n\t{\n\t\tPrototype::from(Prototyped::class)['get_app'] = function() {\n\n\t\t\treturn $this;\n\n\t\t};\n\t}", "public function prepareBindings(array $bindings);", "public function bind($target): void\n {\n $this->bindings[] = $target;\n }", "public function registerBindings() {\n $this->app->bind(\n 'App\\Repositories\\Backend\\Course\\CourseContract',\n 'App\\Repositories\\Backend\\Course\\EloquentCourseRepository'\n );\n $this->app->bind(\n 'App\\Repositories\\Frontend\\Course\\CourseContract',\n 'App\\Repositories\\Frontend\\Course\\EloquentCourseRepository'\n );\n\n $this->app->bind(\n 'App\\Repositories\\Backend\\CourseContent\\CourseContentContract',\n 'App\\Repositories\\Backend\\CourseContent\\EloquentCourseContentRepository'\n );\n }", "public function bind(InputDefinition $definition): void\n {\n }", "protected function bindExchangesAndQueues()\n {\n $exchanges = static::getConfigurations()['exchanges'];\n\n if (count($exchanges)) {\n\n foreach ($exchanges as $exchangeName => $details) {\n\n foreach ($details['queues'] as $queueName => $routingKeys) {\n\n // bind with routing key.\n if (count($routingKeys)) {\n\n foreach ($routingKeys as $routingKey) {\n $this->node->queue_bind($queueName, $exchangeName, $routingKey);\n }\n\n continue;\n }\n\n // Bind without routing key.\n $this->node->queue_bind($queueName, $exchangeName);\n }\n }\n }\n }", "function create_binding() {\r\n\t\ttry {\r\n\t\t\t$conn = db_connect::getInstance();\r\n\t\t\t$result = $conn->db->query(\"SELECT OLT_ID from OLT_IP_POOLS where OLT_ID = '$this->olt_id'\");\r\n\t\t} catch (PDOException $e) {\r\n\t\t\t$error = \"Connection Failed:\" . $e->getMessage() . \"\\n\";\r\n\t\t\treturn $error;\r\n\t\t}\r\n\t\twhile ($row = $result->fetch(PDO::FETCH_ASSOC)) {\r\n\t\t\tif ($row[\"OLT_ID\"])\r\n\t\t\t\t$error = (\"ERROR: THIS OLT have been ASSIGNED pool ALREADY, Please remove any existing bindings and try to create again!\");\r\n\t\t\t\treturn $error;\t\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$conn = db_connect::getInstance();\r\n\t\t\t$result = $conn->db->query(\"INSERT INTO OLT_IP_POOLS (OLT_ID, IP_POOL_ID) VALUES ('$this->olt_id', '$this->id')\");\r\n\t\t} catch (PDOException $e) {\r\n\t\t\t$error = \"Connection Failed:\" . $e->getMessage() . \"\\n\";\r\n\t\t\treturn $error;\r\n\t\t}\r\n\t}", "public function setBindings(BindingsInterface $bindings, int $scope): void;", "function bind($bindings_a,$bindings_b,$arg_list_b) {\n\n // return a list of conjuncts that \n\n if (count($arg_list_b) > 0) {\n\n $arg_b = array_shift($arg_list_b);\n\n if (isset($bindings_a[$arg_b])) {\n\n $val = $bindings_a[$arg_b];\n\n if (isset($bindings_b[$arg_b])) {\n\n\tif ($bindings_b[$arg_b] != $val) {\n\t // binding failed.\n\t return \"FAIL\";\n\t}\n }\n else {\n\t$bindings_b[$arg_b] = $val;\n }\n }\n // do rest of $arg_list_b.\n return bind($bindings_a,$bindings_b,$arg_list_b);\n }\n return $bindings_b;\n}", "protected function registerConfigBindings()\n {\n $this->singleton('config', function () {\n return new ConfigRepository;\n });\n }", "private function setBindings(array $bindings): void\n\t{\n\t\tEntityBinding::normalizeEntityBindings($this->boundEntityTypeId, $bindings);\n\t\tEntityBinding::removeBindingsWithDuplicatingEntityIDs($this->boundEntityTypeId, $bindings);\n\n\t\t$bindingsCollection = $this->getBindingsCollection();\n\t\t$currentBindings = $bindingsCollection ? $this->bindingsCollectionToArray($bindingsCollection) : [];\n\n\t\t[$add, $update, $delete] = $this->separateBindingsByOperation($currentBindings, $bindings);\n\n\t\t$this->addBindings($add);\n\n\t\t// may be bindings collection was created in entityObject while we were adding new bindings to it\n\t\t$bindingsCollection = $bindingsCollection ? $bindingsCollection : $this->getBindingsCollection();\n\t\tif ($bindingsCollection)\n\t\t{\n\t\t\t$this->updateBindings($bindingsCollection, $update);\n\t\t\t$this->deleteBindings($bindingsCollection, $delete);\n\t\t}\n\n\t\tif (!$bindingsCollection || count($bindingsCollection) <= 0)\n\t\t{\n\t\t\tif ($this->fieldNameMap->isSingleIdFilled())\n\t\t\t{\n\t\t\t\t$this->entityObject->set($this->fieldNameMap->getSingleId(), 0);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t$idOfPrimaryBoundEntity = $this->ensureExactlyOnePrimaryBoundEntityExists($bindingsCollection, $bindings);\n\n\t\tif ($this->fieldNameMap->isSingleIdFilled())\n\t\t{\n\t\t\t$this->entityObject->set($this->fieldNameMap->getSingleId(), $idOfPrimaryBoundEntity);\n\t\t}\n\t}", "public function bindVariable($bindVariableName);", "protected static function addDefaultBindings(Container $container)\n {\n foreach (static::getSharedBinds() as $key => $bindable) {\n $container[$key] = function() use($bindable) {\n return new $bindable;\n };\n }\n\n return $container;\n }", "public function bind( $abstract, $concrete = NULL, $shared = FALSE );", "public function bindOut(&...$binds);", "private function bind()\n {\n pcntl_signal(SIGALRM, [$this, 'shutdown']);\n pcntl_signal(SIGINT, [$this, 'shutdown']);\n pcntl_signal(SIGQUIT, [$this, 'shutdown']);\n pcntl_signal(SIGTERM, [$this, 'shutdown']);\n pcntl_alarm(2);\n }", "public function registerInterfaceBindings()\n {\n $this->app->bind('League\\OAuth2\\Server\\Storage\\ClientInterface', 'LucaDegasperi\\OAuth2Server\\Repositories\\FluentClient');\n $this->app->bind('League\\OAuth2\\Server\\Storage\\ScopeInterface', 'LucaDegasperi\\OAuth2Server\\Repositories\\FluentScope');\n $this->app->bind('League\\OAuth2\\Server\\Storage\\SessionInterface', 'LucaDegasperi\\OAuth2Server\\Repositories\\FluentSession');\n $this->app->bind('League\\OAuth2\\Server\\Storage\\AccessTokenInterface', 'LucaDegasperi\\OAuth2Server\\Repositories\\FluentAccessToken');\n $this->app->bind('League\\OAuth2\\Server\\Storage\\RefreshTokenInterface', 'LucaDegasperi\\OAuth2Server\\Repositories\\FluentRefreshToken');\n }", "protected function bindToLaravelApp()\n {\n $this->bindSwooleServer();\n $this->bindSwooleTable();\n\n if ($this->isWebsocket) {\n $this->bindRoom();\n $this->bindWebsocket();\n }\n }", "public function testBindingProcessor()\n {\n $processor = new Processor\\Bindings();\n $input = '{{ test }} works';\n\n $output = $processor->replace($input, []);\n $this->assertSame(' works', $output);\n\n $output = $processor->replace($input, ['test' => 'yay']);\n $this->assertSame('yay works', $output);\n\n $input = '{{ test.nested }} works';\n $output = $processor->replace($input, ['test' => ['nested' => 'also']]);\n $this->assertSame('also works', $output);\n\n $bindingObj = new \\stdClass();\n $bindingObj->nested = 'obj';\n $output = $processor->replace($input, ['test' => $bindingObj]);\n $this->assertSame('obj works', $output);\n\n $bindingObj->nested = ['sub' => 'yyyaaayyy'];\n $input = '{{ test.nested.sub }} works';\n $output = $processor->replace($input, ['test' => $bindingObj]);\n $this->assertSame('yyyaaayyy works', $output);\n }", "private function bindRepository($item)\n\t{\n\t\t$abstract = \"{$item}RepositoryInterface\";\n\t\t$concrete = \"{$item}Repository\";\n\n\t\t// Bind to the container\n\t\t$this->app->bind(\n\t\t\t[$abstract => $this->aliases[$abstract]], \n\t\t\t$this->aliases[$concrete]\n\t\t);\n\t}", "private function registerDispatcher()\n\t{\n\t\t$abstract = 'Cerbero\\Workflow\\Wrappers\\DispatcherInterface';\n\n\t\t$this->app->bind($abstract, function($app)\n\t\t{\n\t\t\treturn $app['Cerbero\\Workflow\\Wrappers\\MarshalDispatcher'];\n\t\t});\n\t}", "public function bind(string $key, $resolver)\n {\n $this->app->set($key, $resolver);\n }", "protected function resolveEnumBinding()\n {\n foreach ($this->enums as $name => $class) {\n Route::bind($name, function ($value) use ($class) {\n return $class::from($value);\n });\n }\n }", "public static function bind($key, $object = null)\n {\n if(is_array($key))\n {\n foreach($key as $key => $object)\n {\n self::$bindings[$key] = $object;\n }\n }\n else\n {\n self::$bindings[$key] = $object;\n }\n }", "public function process(ContainerBuilder $container)\n {\n // we have our own 'http_kernel' service definition, we must reenable\n // the 'argument_resolver' service if exists\n if ($container->hasDefinition('argument_resolver') || $container->hasAlias('argument_resolver')) {\n $kernelDefinition = $container->getDefinition('http_kernel');\n $kernelArguments = $kernelDefinition->getArguments();\n $kernelArguments[3] = new Reference('argument_resolver');\n $kernelDefinition->setArguments($kernelArguments);\n }\n\n // This modules hacks a bit event dispatcher, and the event dispatcher\n // debug implementation will raise some exceptions until we fixed the\n // way we use the dispatcher, let's just disable it\n if ($container->hasDefinition('debug.event_dispatcher')) {\n $container->removeDefinition('debug.event_dispatcher');\n }\n\n // Add a foo router\n if (!$container->has('router')) {\n $container->addDefinitions(['router' => (new Definition())->setClass(NullRouter::class)]);\n }\n\n // Drops the firewall context listener and replace using a foo\n // implementation to avoid Symfony from managing the session\n // by itself, Drupal does it very well\n if ($container->hasDefinition('security.context_listener')) {\n $container->setDefinition('security.context_listener', (new Definition())\n ->setClass(ContextListener::class)\n ->setPublic(false)\n // Yup, security bundles does replace arguments there\n ->setArguments([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])\n );\n }\n }", "public function process(ContainerBuilder $container)\n {\n if (!$container->has($this->registry)) {\n return;\n }\n\n $definition = $container->findDefinition($this->registry);\n $taggedServices = $container->findTaggedServiceIds($this->tag);\n\n foreach ($taggedServices as $id => $tags) {\n $arguments = [new Reference($id)];\n if ($this->withPriority) {\n $arguments[] = $this->resolvePriority($tags);\n }\n $definition->addMethodCall($this->method, $arguments);\n }\n }", "protected function prepareContainer()\n {\n $this -> container\n -> set('app', new InstanceService($this))\n -> set('config', new InstanceService($this -> config));\n }", "public function bind($app) {\n $this->apps[] = $app;\n }", "public function bindEventListeners(ContainerInterface $container)\n {\n foreach ($container->findTaggedServiceIds('behat.events_listener') as $id => $tag) {\n $container->get($id)->registerListeners($this);\n }\n }", "public function add_bind($key, $value)\r\n {\r\n $this->binds[$key] = array_merge($this->binds[$key],(array) $value);\r\n\r\n return $this->binds;\r\n }", "protected function bind($id, $value)\n {\n $this->container[$id] = $value;\n }", "public function process(ContainerBuilder $container)\n {\n $commandBus = 'command_bus';\n\n if (!$container->hasDefinition($commandBus)) {\n return;\n }\n\n $tagName = 'command_handler';\n $definition = $container->getDefinition($commandBus);\n\n foreach ($container->findTaggedServiceIds($tagName) as $service => $tags) {\n $definition->addMethodCall('addHandler', [new Reference($service)]);\n }\n }", "public static function bind($key, $value)\n {\n static::$registry[$key] = $value;\n }", "protected function registerDatabaseBindings()\n {\n $this->singleton('db', function () {\n $this->register(\\App\\Providers\\DatabaseServiceProvider::class);\n return $this->make('db');\n });\n }", "public function addBindings(array $bindings)\n {\n $this->bindlings = array_merge_recursive($this->bindlings, $bindings);\n }", "public function bind($param, $value);", "public function boot(): void\n {\n $this->bindImplementations();\n }", "public function process(ContainerBuilder $container)\n {\n $this->container = $container;\n\n foreach ($container->getDefinitions() as $definition) {\n if ($definition->isSynthetic() || $definition->isAbstract()) {\n continue;\n }\n\n $definition->setArguments($this->processArguments($definition->getArguments()));\n $definition->setMethodCalls($this->processArguments($definition->getMethodCalls()));\n $definition->setProperties($this->processArguments($definition->getProperties()));\n $definition->setFactory($this->processFactory($definition->getFactory()));\n }\n\n foreach ($container->getAliases() as $id => $alias) {\n $aliasId = (string) $alias;\n if ($aliasId !== $defId = $this->getDefinitionId($aliasId)) {\n $container->setAlias($id, new Alias($defId, $alias->isPublic()));\n }\n }\n }", "public function testBind(): void\n {\n $request = new Request([]);\n\n $this->assertFalse($request->isComplexQuery());\n\n $this->assertNotNull($request->bind('banana', static function () {\n return 'strawberry';\n }));\n }", "public function bind(InputDefinition $definition);", "private function addToBindings($value): void\n {\n if (is_array($value)) {\n $this->bindings = array_merge($this->bindings, array_values($value));\n } else {\n $this->bindings[] = $value;\n }\n }", "private function setUpContainerMockBindInstance(array $parameters): void\n {\n foreach ($parameters as $parameter) {\n $this->container->shouldReceive('bindInstance')\n ->with($parameter[0], Mockery::type($parameter[1]));\n }\n }", "public function bind(array $commandDefinitions);" ]
[ "0.7012186", "0.6951914", "0.6830161", "0.678788", "0.6603382", "0.6479015", "0.64080894", "0.6309403", "0.62760365", "0.6273394", "0.61973417", "0.6165383", "0.6155472", "0.6136002", "0.60884905", "0.6042611", "0.603274", "0.6000865", "0.5976934", "0.5955015", "0.5952089", "0.5945366", "0.59395224", "0.59381986", "0.59114456", "0.588826", "0.585851", "0.5818396", "0.5747207", "0.57283527", "0.571742", "0.5709045", "0.5707934", "0.5694019", "0.5689513", "0.56880605", "0.5687272", "0.5651459", "0.5647937", "0.56413716", "0.56373924", "0.5617309", "0.56140894", "0.5608992", "0.5595716", "0.55879194", "0.5579413", "0.5546694", "0.55458575", "0.5536352", "0.55242854", "0.55043775", "0.54952323", "0.5476807", "0.5419242", "0.54184", "0.5411028", "0.54093486", "0.5407624", "0.5404899", "0.53968686", "0.53947395", "0.5392493", "0.5382174", "0.5371944", "0.53580374", "0.5347542", "0.53448516", "0.532738", "0.53212", "0.5313119", "0.5308428", "0.5305609", "0.5290227", "0.5289391", "0.5288855", "0.52658325", "0.5262558", "0.5260147", "0.5239951", "0.5223423", "0.5216098", "0.5215896", "0.5203526", "0.51990664", "0.51932716", "0.5187823", "0.5175201", "0.51709193", "0.51698035", "0.5156105", "0.5147399", "0.5135032", "0.5134781", "0.5114716", "0.5113261", "0.5108605", "0.5105235", "0.5103958", "0.5103315", "0.509142" ]
0.0
-1
Specify Zend_Db_Table instance to use for data operations
public function setDbTable ($dbTable) { if (is_string($dbTable)) { $dbTable = new $dbTable(); } if (! $dbTable instanceof Zend_Db_Table_Abstract) { throw new Exception('Invalid table data gateway provided'); } $this->_dbTable = $dbTable; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTable()\n {\n if ($this->_table == null) {\n $this->_table = new Zend_Db_Table($this->_tableName);\n }\n\n return $this->_table;\n }", "abstract protected function getTable();", "public function getTable()\r\n\t{\r\n\t\tif ($this->_table===null) {\r\n\t\t\t$this->_table=new $this->_tableClass;\r\n\t\t}\r\n\t\treturn $this->_table;\r\n\t}", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "abstract public function getTable();", "abstract public function getTable();", "private function tableDataTable()\r\n\t{\r\n\t\t$source = $this->getSource();\r\n\r\n\t\t//$table = new TableExample\\DataTable();\r\n\t\t$table = new Model\\DataInsTable();\r\n\t\t$table->setAdapter($this->getDbAdapter())\r\n\t\t->setSource($source)\r\n\t\t->setParamAdapter(new AdapterDataTables($this->getRequest()->getPost()))\r\n\t\t;\r\n\t\treturn $table;\r\n\t}", "public abstract function getDbTable();", "public function setTable($table);", "public function getTable();", "function table($table, array $params = ['pk' => 'id'])\n {\n if (class_exists($table) && is_subclass_of($table, 'Objectiveweb\\DB\\Table')) {\n\n return new $table($this);\n } else {\n return new DB\\Table($this, $table, $params);\n }\n }", "protected function _getTable()\n\t{\n\t\t$tableName = substr( get_class($this), strlen(self::PREFIX) );\n\t\t$tableClass = self::PREFIX . 'DbTable_' . $tableName;\n\t\t$table = new $tableClass();\n\t\treturn $table;\n\t}", "public function getTable() { return( $this->_table ); }", "public function testGetDbTable() {\n $comments = new Application_Model_Comments();\n\n $this->assertType('Zend_Db_Table_Abstract', $comments->getDbTable());\n }", "function ActiveRecord($table)\n\t\t{\n\t\t\tparent::Model();\n\t\t\t$this->record = $table;\n\t\t}", "public function table($table);", "public function table($table);", "public function __construct(){\n\t\tparent::__construct($this->table);\n\t}", "protected function tableModel()\n {\n }", "protected function setUpTable()\n {\n return new Table('foo', array($this->oldColumn));\n }", "public function table($table){\n\t\t$this->table = $table;\n\t\treturn $this;\n\t}", "public static function getTable();", "public function getTable()\r\n {\r\n }", "public function table($tableName, $options);", "protected function createDbTable(Zend_Db_Table_Abstract $table, $where=null, $order=null, $count=null, $offset=null)\n {\n return new Zend_Test_PHPUnit_Db_DataSet_DbTable($table, $where, $order, $count, $offset);\n }", "public function table($table)\n {\n $this->table = $table;\n return $this;\n }", "public function getTable(): Table;", "public function getTable()\r\n {\r\n if($this->_table === null){\r\n $this->_table = new SampleTable();\r\n }\r\n return $this->_table;\r\n }", "private function setTable()\n {\n if (is_null($this->table)) {\n $this->table = $this->getTableName();\n }\n }", "public function table(){\r\n\r\n return $this;\r\n }", "public function setTable($tablename){\r\n$this->tablename=$tablename;\r\n}", "function table ( $name ) {\n $this->table = $name;\n $this->alias = $name;\n return $this;\n }", "public function dbTable($tableName) {\r\n $this->tableName = $tableName;\r\n return $this;\r\n }", "public function getTable()\n {\n\n }", "function __construct(){\r\n $this->db=new ConnectDb();\r\n $this->connection=$this->db->open_connection();\r\n $this->db->setTable($this->tablename);\r\n}", "public function table($table)\n\t{\n\t\t$this->table = $table;\n\t\t\n\t\treturn $this;\n\t}", "public function getTable() {}", "public function getTable() {}", "public function getTable() {}", "public function get_table()\n\t{\n\t\treturn $this->_table;\n\t}", "public static function table($table)\n {\n }", "function setTable($table) {\r\r\n\t\t$this->table = $table;\r\r\n\t}", "public function baseTable();", "abstract public function setTableName();", "public function getTable() { return $this->table->getTable(); }", "private function getTable()\n\t{\n\t\treturn $this->_table;\n\t}", "function __construct()\n {\n if (empty($this->table)) {\n $this->table = get_called_class();\n }\n }", "public function table($table){\n $this->from($table);\n return $this;\n }", "public function setTable($table = null)\n {\n if (!$this->table) {\n if (!$table) {\n $object = get_class($this);\n $table = strtolower($object);\n }\n $this->table = $table;\n }\n return $this->table;\n }", "public function setDbTable($table)\n {\n if(is_string($table)) {\n $this->_dbTable = new $table();\n } elseif($table instanceof Zend_Db_Table_Abstract) {\n $this->_dbTable = $table;\n } else {\n throw new Exception('Not a valid table gateway for Mimetypes Model');\n }\n }", "public function testTableMethod() {\n\t\t$table = new Table(['table' => 'users']);\n\t\t$this->assertEquals('users', $table->table());\n\n\t\t$table = new UsersTable;\n\t\t$this->assertEquals('users', $table->table());\n\n\t\t$table = $this->getMockBuilder('Table')\n\t\t\t\t->setMethods(['find'])\n\t\t\t\t->setMockClassName('SpecialThingsTable')\n\t\t\t\t->getMock();\n\t\t$this->assertEquals('special_things', $table->table());\n\n\t\t$table = new Table(['alias' => 'LoveBoats']);\n\t\t$this->assertEquals('love_boats', $table->table());\n\n\t\t$table->table('other');\n\t\t$this->assertEquals('other', $table->table());\n\t}", "public function table($t){\r\n\t\tif(is_array($t)){\r\n\t\t\t$tArray = $t;\r\n\t\t\t$t = $t_alias = array_shift(array_keys($tArray));\r\n\t\t\t$driver = get_called_class();\r\n\t\t\tif(($tArray[$t_alias] instanceof $driver) === true){\r\n\t\t\t\t$this->_placeholders = array_merge($this->_placeholders, $tArray[$t_alias]->queryData());\r\n\t\t\t\t$t = $tArray[$t_alias]->queryString();\r\n\t\t\t\t$t = \"({$t}) AS {$this->formatWithQuote($t_alias, 'alias')}\";\r\n\t\t\t}\r\n\t\t\t$t = (string) $t;\r\n\t\t\t$this->_table = trim($t);\r\n\t\t}else{\r\n\t\t\t$t = \\Dorsataio\\Squibble\\Resource\\Extract::fromTable((string) $t);\r\n\t\t\t$this->_table = trim($t['table']);\r\n\t\t\tif(isset($t['alias']) && !empty($t['alias'])){\r\n\t\t\t\t$this->_table = \"{$this->_table} as {$t['alias']}\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $this;\r\n\t}", "protected function createDbTable(\\Zend\\Db\\Table\\AbstractTable $table, $where=null, $order=null, $count=null, $offset=null)\n {\n return new Db\\DataSet\\DbTable($table, $where, $order, $count, $offset);\n }", "public function __construct()\n {\n $this->table = 'orders';\n }", "public function __construct ($tablename = 'tablename')\n {\n// $adapter=$this->getAdapter();\n// $newadaptor=clone($adapter);\n \n// $this->\n $this->_tablename = $tablename;\n $this->_from = $tablename;\n }", "public function getTableBase();", "public function createRowTable($options = NULL) {\n $request = $this->getRequest();\n $params = $request->getParams();\n $table = $params['table'];\n //---------------------------\n\n if ($table == 'admin.blog_posts') {\n return new Default_Model_DbTable_BlogPost($this->db);\n }\n\n if ($table == 'admin.blog_posts_tags') {\n return new Default_Model_DbTable_BlogPostTag($this->db);\n }\n\n if ($table == 'admin.blog_posts_images') {\n return new Default_Model_DbTable_BlogPostImage($this->db);\n }\n\n if ($table == 'admin.blog_posts_audio') {\n return new Default_Model_DbTable_BlogPostAudio($this->db);\n }\n\n if ($table == 'admin.blog_posts_video') {\n return new Default_Model_DbTable_BlogPostVideo($this->db);\n }\n\n if ($table == 'admin.blog_posts_locations') {\n return new Default_Model_DbTable_BlogPostLocation($this->db);\n }\n }", "public function table($tbl){\n if(empty($this->tbl)){\n $this->tbl = $tbl;\n $this->query = r\\table($tbl);\n $this->old_state = $this->query;\n }\n }", "public function setTable(string $table);", "public function getUserTable(){\n\t \t if(!$this->usersTAble){\n\t \t \t$sm=$this->getServiceLocator();\n\t\t\t$this->usersTAble=$sm->get('User\\Model\\UserTable'); \n\t \t \t//$this->usersTAble=new TableGateway('users',$this->getServiceLocator()->get('Zend\\Db\\Adapter\\Adapter'));\n\t \t }\n\t \t return $this->usersTAble;\n\t }", "public function setTable($table)\n {\n $this->_table = $table;\n\n return $this;\n }", "public function getTableAlias() ;", "public function __construct($tableName = null)\n {\n //intended especially for testing porpouses so it can be easily mocked\n (!isset($tableName))||$this->setTableGateway(new \\Zend_Db_Table($tableName));\n }", "public function __construct($table)\n {\n $this->table = $table;\n }", "public function set_table($table = NULL)\n\t{\n\t\t$this->_table = $table;\n\t}", "public function setTable($table)\n\t{\n\t\t$this->table = $table;\n\t\t\n\t\treturn $this;\n\t}", "protected function _getTable()\n {\n if (!$this->_table) {\n $this->_throwException('No table instance set.');\n }\n\n return $this->_table;\n }", "public function __construct()\n {\n parent::__construct(self::TABLE);\n }", "function __construct() {\n // Initialize the dbms pointer.\n parent::__construct();\n\n // Initialize table name.\n $this->tableName = \"admin\";\n }", "function set_table(){\n $this->table = 'network_posts';\n }", "protected function setTable() : void {\n\t\t$annotation = $this->annotationReader->getClassAnnotation($this->reflectionClass, 'Henri\\Framework\\Annotations\\Annotation\\DB');\n\t\tif ($annotation && isset($annotation->table)) {\n\t\t\t$this->tableName = $annotation->table;\n\t\t\t$this->tableNamePrefixed = $this->database->getPrefix() . $this->tableName;\n\t\t}\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->table = 'actividades';\n }", "public function setTable( $table ) {\n\t\t$this->_table = $table;\n\t}", "public function getTableData()\n\t{\n\t}", "public static function getInstance()\n {\n return Doctrine_Core::getTable('FakturaObj');\n }", "function table()\n {\n return array('pattern' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL,\n 'created' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL);\n }", "public function getCurrentTable() {}", "public function table($name)\n {\n $this->statement['table'] = $name;\n return $this;\n }", "public function from($table);", "public function initTable(){\n\t\t\t\n\t\t}", "function &returnTable()\n\t{\n\t\treturn $this->table;\n\t}", "protected abstract function createTestTable();", "private function _fetch_table()\n {\n if (!isset($this->table))\n {\n $this->table = $this->_get_table_name(get_class($this));\n }\n }", "public function table()\n {\n return $this->table;\n }", "protected function setTable()\n {\n $class = explode('\\\\', get_called_class());\n $this->table = lcfirst(end($class)).'s';\n }", "public function __construct($table){\n parent::__construct($table);\n }", "public function Table()\n {\n return $this->table;\n }", "public function table(string $table) : self {\n $this->query_builder->setTable($table);\n\n return $this;\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('TrOnlineRecord');\n }", "public static function getTable() {}", "public static function getTable() {}", "public static function getTable() {}", "public static function getTable() {}" ]
[ "0.70389414", "0.6711118", "0.6651927", "0.6640382", "0.6640382", "0.6640382", "0.6640382", "0.6640382", "0.6640382", "0.6640382", "0.65645045", "0.65645045", "0.65415335", "0.65367997", "0.6514711", "0.6512614", "0.6463396", "0.6457792", "0.6435995", "0.63897693", "0.6362614", "0.63593173", "0.63593173", "0.6354534", "0.6342629", "0.6319181", "0.6318307", "0.63159513", "0.62985694", "0.6296669", "0.62747705", "0.6265088", "0.6245108", "0.6242069", "0.6233151", "0.62178713", "0.62025267", "0.61953294", "0.61920255", "0.6174762", "0.6160282", "0.61443835", "0.6134531", "0.61329764", "0.61329156", "0.61316884", "0.61166114", "0.6098691", "0.6088536", "0.608709", "0.6076378", "0.6065586", "0.6062065", "0.605258", "0.60464156", "0.6031027", "0.6029344", "0.60280985", "0.600541", "0.6004957", "0.5992354", "0.59806097", "0.597964", "0.5961843", "0.5960985", "0.59548044", "0.5954703", "0.594454", "0.5929227", "0.5916382", "0.59142107", "0.5910397", "0.5909741", "0.59091544", "0.5901795", "0.58987784", "0.58830714", "0.5877115", "0.5870416", "0.58690304", "0.5861132", "0.5854735", "0.58526796", "0.5850258", "0.5846606", "0.58450794", "0.58424085", "0.5841283", "0.5840778", "0.5834078", "0.5830824", "0.5823833", "0.582312", "0.5819593", "0.581146", "0.58106416", "0.58106416", "0.58106416", "0.58106416" ]
0.5845462
86
Get registered Zend_Db_Table instance
public function getDbTable () { if (null === $this->_dbTable) { $this->setDbTable('Core_Model_DbTable_Nationalities'); } return $this->_dbTable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTable()\n {\n if ($this->_table == null) {\n $this->_table = new Zend_Db_Table($this->_tableName);\n }\n\n return $this->_table;\n }", "public function getTable()\r\n\t{\r\n\t\tif ($this->_table===null) {\r\n\t\t\t$this->_table=new $this->_tableClass;\r\n\t\t}\r\n\t\treturn $this->_table;\r\n\t}", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Application_Model_RozwiazanieZadania');\n }", "protected function _getTable()\n\t{\n\t\t$tableName = substr( get_class($this), strlen(self::PREFIX) );\n\t\t$tableClass = self::PREFIX . 'DbTable_' . $tableName;\n\t\t$table = new $tableClass();\n\t\treturn $table;\n\t}", "public static function getInstance()\n {\n return Doctrine_Core::getTable('FakturaObj');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Viaje');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Pizarra');\n }", "public function getTable() { return( $this->_table ); }", "public function get_table()\n\t{\n\t\treturn $this->_table;\n\t}", "private function getTable()\n\t{\n\t\treturn $this->_table;\n\t}", "public static function getTable();", "public static function getInstance()\r\n {\r\n return Doctrine_Core::getTable('question_bank');\r\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('TipoResgate');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Fertilizer');\n }", "public abstract function getDbTable();", "public static function getInstance()\n {\n return Doctrine_Core::getTable('PsTabLang');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('TrOnlineRecord');\n }", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable()\r\n {\r\n if($this->_table === null){\r\n $this->_table = new SampleTable();\r\n }\r\n return $this->_table;\r\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Actividad');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Encadrant_ere');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('OtraInformacion');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Cal');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('FormatoQr');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Alerte_bpi');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('TbQuestoes');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Models_Main_SuppliesOrdersTemp');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('PolozkyObj');\n }", "public function getTable();", "public static function getInstance()\r\n {\r\n return Doctrine_Core::getTable('Hospital');\r\n }", "public function getTable() {\n\t\treturn $this->_table;\n\t}", "public function getTable() {\n\t\treturn $this->_table;\n\t}", "public function getTable() {\n\t\treturn $this->_table;\n\t}", "public static function getInstance() {\n return Doctrine_Core::getTable('EiFonction');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Slozeni');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Resource');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('VehiculeMarque');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('HotelFacility');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Horario_atencion');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('HotelChain');\n }", "public function getTable()\n\t{\n\t\treturn $this->connection->table(self::TABLE_NAME);\n\t}", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Email_Model_Mapper_Template');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('TesisTema');\n }", "public function getDbTable()\n {\n if (null === $this->_dbTable) {\n $this->setDbTable($this->_tableClass);\n }\n return $this->_dbTable;\n }", "public static function getInstance()\r\n {\r\n return Doctrine_Core::getTable('pan_application');\r\n }", "public function getTable() {\n return $this->_table;\n }", "public function getTable() {\n return $this->_table;\n }", "public function getTable()\n\t{\n\t\treturn $this->table;\n\t}", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Models_Solaria_StaffType');\n }", "public static function getTable() {}", "public static function getTable() {}", "public static function getTable() {}", "public static function getTable() {}", "public static function getTable() {}", "public static function getTable() {}", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Models_Solaria_TimeZone');\n }", "public static function getTable() {}", "private function getUserTable()\n {\n if (null === $this->userTable) {\n $this->userTable = new Core_Model_DbTable_User();\n }\n return $this->userTable;\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Sede');\n }", "public static function getInstance()\r\r\n {\r\r\n return Doctrine_Core::getTable('PaqueteUsuario');\r\r\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Sesion');\n }", "protected static function getTable()\n {\n if (static::$TABLE === null) {\n throw new NotImplementedException(_s('Missing table definition in Model ').get_called_class());\n }\n\n return static::$TABLE;\n }", "public static function getTable()\n {\n return (new static)->model->getTable();\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Vendas');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('ReunionContractsIntermediation');\n }", "public function getDbTable()\n {\n if (null === $this->_dbTable) {\n \t//set to a table match\n $this->setDbTable('Application_Model_DbTable_Match');\n }\n return $this->_dbTable;\n }", "public function getTable() { return $this->table->getTable(); }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('cabecalho_uf');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Permohonan');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('PluginiframeSlot');\n }", "public static function getInstance()\r\n {\r\n return Doctrine_Core::getTable('UtoconsultAdvertisement');\r\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('EiParam');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Parroquia');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('CompFact');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Presta');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Echec_authentification');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('BarbaraClass');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Type');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('sfGuardGram');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('PluginsfDoctrineSlot');\n }", "public static function getInstance() {\n return Doctrine_Core::getTable('Faqs');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('DesignacionesEmpleados');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Revista');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('HsHrEmployee');\n }", "public function getTable()\n {\n return $this->table;\n }", "public function getTable()\n {\n return $this->table;\n }", "public function getTable()\n {\n return $this->table;\n }", "public function getTable()\n {\n return $this->table;\n }", "public function getTable()\n {\n return $this->table;\n }", "public function getTable()\n {\n return $this->table;\n }", "public function getTable()\n {\n return $this->table;\n }", "public function getTable()\n {\n return $this->table;\n }", "public function getTable()\n {\n return $this->table;\n }", "public function getTable()\n {\n return $this->table;\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Preregistro');\n }" ]
[ "0.79708755", "0.73712486", "0.7011595", "0.69867915", "0.69488376", "0.69312936", "0.6903663", "0.687256", "0.68554455", "0.68460095", "0.682809", "0.68018216", "0.6791526", "0.67760456", "0.6772882", "0.6760848", "0.67447394", "0.67272943", "0.67272943", "0.67272943", "0.67272943", "0.67272943", "0.67272943", "0.67272943", "0.67235607", "0.67070585", "0.67066", "0.66947275", "0.66934216", "0.6688048", "0.66868675", "0.6678609", "0.66639477", "0.6663836", "0.6648715", "0.6642803", "0.6642754", "0.6642754", "0.6642754", "0.66389114", "0.6636828", "0.6630879", "0.6628462", "0.66216207", "0.66216165", "0.66172105", "0.6601601", "0.6598163", "0.659778", "0.65950614", "0.65923584", "0.6591262", "0.6591262", "0.65910983", "0.65899074", "0.65858936", "0.65858936", "0.65858936", "0.65858936", "0.65858936", "0.65858936", "0.6585887", "0.6585466", "0.6583695", "0.65754485", "0.65744925", "0.6568918", "0.6566785", "0.65623254", "0.656223", "0.6557671", "0.65572876", "0.655255", "0.6549274", "0.65439314", "0.6531393", "0.6529026", "0.65289646", "0.6521164", "0.6520871", "0.651767", "0.6516831", "0.6512992", "0.6511681", "0.65081084", "0.6505778", "0.6502402", "0.65018505", "0.65001905", "0.64993477", "0.6494151", "0.6494151", "0.6494151", "0.6494151", "0.6494151", "0.6494151", "0.6494151", "0.6494151", "0.6494151", "0.6494151", "0.6493248" ]
0.0
-1
$status = Post::where('id', $post_id)>pbpgs()>where('id', $pbpg_id)>pivot('status');
public static function check($post_id, $pbpg_id) { $post = Post::where('id', $post_id)->first(); $status = $post->pbpgs->where('id', $pbpg_id)->first()->pivot->status; return $status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function blue()\n {\n return $this->users()->wherePivot('team','modry');\n }", "public function bimbingan($status = null)\n {\n $bimbingan = $this->belongsToMany(\n 'PMW\\Models\\Proposal',\n 'bimbingan',\n 'id_pengguna',\n 'id_tim')\n ->withPivot('status_request');\n\n if (!is_null($status))\n $bimbingan = $bimbingan->wherePivot('status_request', $status);\n\n return $bimbingan;\n }", "public function tags(){\n return $this->belongsToMany(Tag::class);\n// $result = DB::select( select `tags`.*, `\n//tag_thread`.`thread_id` as `pivot_thread_id`, `tag_thread`.`tag_id` as\n// `pivot_tag_id` from `tags` inner join `tag_thread` on `tags`.`id` = `tag_thread`.`tag_id` where `tag\n//_thread`.`thread_id` = 3);\n// $result = DB::statement('SELECT name FROM tags WHERE tags.id = post_tag.tag_id AND post_tag.pos')\n }", "public function getStatus()\n {\n return $this->withDisabled()->rolesQuery()->first()['pivot']['status'];\n }", "public function isPivot(): bool\n {\n return true;\n }", "public function white()\n {\n return $this->users()->wherePivot('team','biely');\n }", "public function posters()\n {\n return $this->belongsToMany(\"App\\Poster\")->withPivot('order')->orderBy('order');\n }", "public function hasPivotData(): bool;", "public function friends(){\n return $this->belongsToMany('App\\User', 'friends', 'user_1', 'user_2')->withPivot('status');\n }", "public function favorite()\n {\n return $this->belongsToMany(Realestate::class,'favourites')->withPivot('user_id', 'property_id');\n }", "public function stages(){\n return $this->belongsToMany('SimulatorOperation\\Stage')->withPivot('cabin_id')->withTimestamps();\n }", "public function getAllpost(){\n return $slug=post::with('likes')->where('status',1)->orderBy('created_at','DESC')->paginate(4);\n\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 }", "public function vacant(){\n\n return $this->belongsToMany('App\\Office')\n ->withPivot('user_id','active')\n ->where('user_id','=',null)\n ->leftJoin('users','user_id','users.id')\n ->select('offices.id','offices.name','users.name as pivot_user_name');\n }", "public function forPost(Post $post)\n {\n return $post->where('status', 1)\n ->orderBy('created_at', 'desc')\n ->get();\n }", "public function pivotTicketPriorities () {\n /* TableName de relacion 'ticket_priority_ticket_user' */\n //return $this->belongsToMany('App\\TicketPriority');\n /* TableName de relacion asignada como segundo parametro */\n //return $this->belongsToMany('App\\TicketPriority', 'ticket_tickets');\n /**\n * Pivot es para acceder a los datos de la tabla de relacion entre los modelos\n * Many to many\n * belongsToMany('Model','tableRelations','foreignKeydelInvocador','foreignKeydel Invocado')\n */\n return $this->belongsToMany('App\\TicketPriority', 'ticket_tickets', 'fk_ticket_users', 'fk_ticket_priorities');\n /* Para redefinir la variable 'pivot' y asignar el nombre deseado */\n /*return $this->belongsToMany('App\\TicketPriority')\n ->as('NewNamePivot')\n ->withTimestamps();*/\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product')->withPivot('feature_value');\n }", "function filter_posts( $params ) {\n global $wpdb;\n\n $facet = $params['facet'];\n $selected_values = $params['selected_values'];\n $selected_values = array_pop( $selected_values );\n $selected_values = explode( '-', $selected_values );\n $selected_values = array_map( 'floatval', $selected_values );\n\n $sql = \"\n SELECT DISTINCT post_id FROM {$wpdb->prefix}facetwp_index\n WHERE facet_name = '{$facet['name']}' AND facet_value > $selected_values[0]\";\n\n if ( ! empty( $selected_values[1] ) ) {\n $sql .= \" AND facet_value < $selected_values[1] \";\n }\n\n return facetwp_sql( $sql, $facet );\n }", "public function users() {\n return $this->belongsToMany(User::class,'reades')->withPivot('readStatus','score','favourite');\n }", "public function getPosts() {\n //$this->db->from('post');\n //$this->db->get('post');\n //$query = $this->db->order_by(\"vote_count\", \"desc\");\n \n $this->db->from('post');\n $this->db->order_by(\"vote_count\", \"desc\");\n $query = $this->db->get();\n return $query->result();\n\n// if ($query->num_rows() >= 1){\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product', 'royalty_chart', 'vehicle_type_id', 'product_id')->withPivot('amount', 'status');\n }", "public function approvePosts(){\n if (Request::isMethod('get'))\n {\n $posts = Post::where('status', '=', 0)->paginate(5);\n \n return View::make('admin.authenticated.approve_posts')->with('posts',$posts);\n }\n \n if (Request::isMethod('post'))\n {\n if(Session::has('admin_auth')){\n $pid = Input::get('pid');\n \n $post = Post::where('p_id','=',$pid)->update(array(\n 'status' => 1\n ));\n if($post){\n return Response::json(true);\n }\n }\n }\n }", "function filter_posts( $params ) {\n global $wpdb;\n\n $output = [];\n $facet = $params['facet'];\n $selected_values = $params['selected_values'];\n\n $now = date( 'Y-m-d H:i:s' );\n $compare = implode( ',', $selected_values );\n $compare = ( 'future' == $compare ) ? '>' : '<=';\n\n $sql = $wpdb->prepare( \"SELECT DISTINCT post_id\n FROM {$wpdb->prefix}facetwp_index\n WHERE facet_name = %s\",\n $facet['name']\n );\n\n $output = facetwp_sql( $sql . \" AND facet_value $compare '$now'\", $facet );\n\n return $output;\n }", "public function approve(){\n\n\n // $posts = Leave::orderBy('created_at', 'desc')->paginate(6);\n\n\n//dd($leave);\n //get for HR\n if((auth::id() == '162') || (auth::id() == '168') || (auth::id() == '182')) {\n\n\n $leaves = Leave::where('supervisor_action', '=', '1')->where('hr_action', '=', '0')->get();\n\n $leaves_count = Leave::where('supervisor_action', '=', '1')->where('hr_action', '=', '0')->count();\n\n $leaves_completed = Leave::where('hr_action', '!=', '0')->get();\n\n $leaves_completed_count = Leave::where('hr_action', '!=', '0')->count();\n\n\n\n }else{ // ELSE IT IS A SUPERVISOR\n\n $leaves = Leave::where('supervisor_id', '=', Auth::user()->ID)\n ->where('supervisor_action', '=', '0')->get();\n\n $leaves_count = Leave::where('supervisor_id', '=', Auth::user()->ID)\n ->where('supervisor_action', '=', '0')->count();\n\n $leaves_completed = Leave::where('supervisor_id', '=', Auth::user()->ID)\n ->where('supervisor_action', '!=', '0')->get();\n\n $leaves_completed_count = Leave::where('supervisor_id', '=', Auth::user()->ID)\n ->where('supervisor_action', '!=', '0')->count();\n\n /* $leaves = Leave::where('supervisor_id', '=', Auth::user()->ID)->get();*/\n\n }\n // return view('leave.index', compact('leaves'))->with('users', User::all());\n\n\n return view('leave.approve')->with('users', User::all())->with('leaves', $leaves)\n ->with('leaves_completed', $leaves_completed)\n ->with('leaves_count', $leaves_count)\n ->with('leaves_completed_count', $leaves_completed_count);\n\n }", "public function my_is_not_approved()\n {\n $user = User::all();\n $category = Category::all();\n $posts = Post::where('user_id',Auth::user()->id)->where('post_status', 0)->orWhere('post_status', 1)->orWhere('post_status', 3)->orderBy('post_id', 'DESC')->paginate(15);\n return view('admin.my_post.is_not_approved', compact('posts', 'category', 'user'));\n }", "public function projects()\n {\n return $this->belongsToMany('App\\Project', 'project_education')->withPivot('is_required');\n }", "public function teams()\n {\n return $this->belongsToMany('p4\\Team')->withPivot('status')->withTimestamps();\n }", "function is_post_status_viewable($post_status)\n {\n }", "public function draftPost()\n {\n \t$posts = Post::where([['status', 0], ['user_id', auth()->id()]])->get();\n \t$countPublicPosts = Post::where([['status', 1], ['user_id', auth()->id()]])->count();\n\n \treturn view('users.posts.draft', compact('posts', 'countPublicPosts'));\n }", "public static function budgethomeadmin(){\n \n $sql= DB::table('budgets')\n ->select('budgets.*', 'departments.department',DB::raw('FORMAT(budgets.cost,2) as costt'),DB::raw('DATE_FORMAT(budgets.created_at, \"%d-%b-%Y\") as date'))\n ->leftjoin('departments','budgets.department_id', '=', 'departments.id')\n ->whereIn('budgets.status',[1,3]) \n //->where('budgets.head_id',$logedid)\n ->get();\n return $sql; \n }", "public function listPost()\n {\n //Your code goes here\n $data['posts'] = PostModel::where('status',1)->orWhere('status',2)->orderBy('id','desc')->get();\n $data['pagemode'] = 'edit';\n return admin_view('Posts::List', $data);\n }", "public function my_is_approved()\n {\n $user = User::all();\n $category = Category::all();\n $posts = Post::where('post_status', 2)->where('user_id',Auth::user()->id)->orderBy('post_id', 'DESC')->paginate(15);\n\n return view('admin.my_post.index', compact('posts', 'category', 'user'));\n }", "public function branches()\n\t{\n return $this->belongsToMany('App\\Models\\Admin\\Branch');\n //->where('has_buffet_service', 1);\n }", "public function filled(){\n\n return $this->belongsToMany('App\\Office')\n ->withPivot('user_id','active')\n ->where([\n ['user_id','!=',null],\n ['active','=',1]\n ])\n ->join('users','user_id','users.id')\n ->select('offices.id','offices.name','users.name as pivot_user_name');\n }", "public function query(Request $request) {\n /* $query = $model->newQuery();\n $query->where(['role' => 'USER']);\n $query->with(['profile'])->select('id', 'email', 'status', 'created_at', 'updated_at');\n $posts = User::with('profile')->select('users.*', 'user.profile.first_name');\n return $posts; */\n\n\n\n $where = ['published' => 1];\n\n if ($request->get('status') != '') {\n if ($request->input('status') == 'all') {\n unset($where['published']);\n } elseif($request->input('status')=='unpublished') {\n $where['published'] = 0;\n }\n }\n\n $users = Page::select('*')\n ->where($where);\n return $users;\n }", "public function bookings(){\n return $this->belongsToMany('App\\Booking', 'payments', 'payment_status_id', 'booking_id');\n }", "public function pokemon()\n {\n //belongsToMany($related, $table = null, $foreignPivotKey = null, $relatedPivotKey = null,\n //$parentKey = null, $relatedKey = null, $relation = null)\n //return $this->belongsToMany(Pokemon::class, 'users_captured', 'user_id', 'pokemon_id')->withTimestamps();\n return $this->belongsToMany(Pokemon::class, 'users_captured')->withTimestamps();\n }", "public function asignacion_pe()\n {\n return $this->belongsToMany('App\\Personal', 'personal_has_asignatura', 'id_seccion','id_personal')->withPivot('id_periodo','id_asignatura');\n }", "public function players() {\n return $this->belongsToMany('App\\Models\\User')->withPivot('score', 'state');\n }", "public function subscribers(){\n return $this->belongsToMany('\\App\\Subscriber','subscriber_subscription_type')->withPivot('subscription_id', 'startdate', 'closedate','status', 'limit');\n }", "function dataGetPublishStatus($p_id)\n {\n $p_id = parent::escape($p_id);\n \n $sql = 'SELECT isactive ';\n $sql .= 'FROM user ';\n $sql .= 'WHERE id = ' . $p_id . ' ';\n \n $result_mysqli = parent::query($sql);\n $result = parent::fetchAllRows($result_mysqli);\n parent::clear($result_mysqli); \n\n return $result; \n }", "public function getPostsAceptados()\n {\n return $this->getPosts()->approved()->all();\n }", "public function profileShowGuitars()\n {\n return $this->belongsToMany('App\\Guitar', 'user_guitar')->wherePivot('profile_show', true);\n }", "public function run()\n {\n\n\n//profiles\n App\\Status::create ([\n 'statusable_id' => 1,\n 'statusable_type' => 'profiles',\n 'status' => 'active',\n ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 2,\n// 'statusable_type' => 'profiles',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 3,\n// 'statusable_type' => 'profiles',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 4,\n// 'statusable_type' => 'profiles',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 5,\n// 'statusable_type' => 'profiles',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 6,\n// 'statusable_type' => 'profiles',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 7,\n// 'statusable_type' => 'profiles',\n// 'status' => 'active',\n// ]); \n\n \n// //categories\n// App\\Status::create ([\n// 'statusable_id' => 1,\n// 'statusable_type' => 'categories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 2,\n// 'statusable_type' => 'categories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 3,\n// 'statusable_type' => 'categories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 4,\n// 'statusable_type' => 'categories',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 5,\n// 'statusable_type' => 'categories',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 6,\n// 'statusable_type' => 'categories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 7,\n// 'statusable_type' => 'categories',\n// 'status' => 'active',\n// ]); \n\n// //Subcategories\n// App\\Status::create ([\n// 'statusable_id' => 1,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 2,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 3,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 4,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 5,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 6,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 7,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 8,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 9,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 10,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 11,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 12,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 13,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 14,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 15,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'inactive',\n// ]); \n\n// //channelss\n// App\\Status::create ([\n// 'statusable_id' => 1,\n// 'statusable_type' => 'channels',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 2,\n// 'statusable_type' => 'channels',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 3,\n// 'statusable_type' => 'channels',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 4,\n// 'statusable_type' => 'channels',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 5,\n// 'statusable_type' => 'channels',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 6,\n// 'statusable_type' => 'channels',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 7,\n// 'statusable_type' => 'channels',\n// 'status' => 'inactive',\n// ]); \n\n// //discussionss\n\n// App\\Status::create ([\n// 'statusable_id' => 1,\n// 'statusable_type' => 'discussions',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 2,\n// 'statusable_type' => 'discussions',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 3,\n// 'statusable_type' => 'discussions',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 4,\n// 'statusable_type' => 'discussions',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 5,\n// 'statusable_type' => 'discussions',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 6,\n// 'statusable_type' => 'discussions',\n// 'status' => 'active',\n// ]); \n// //pages\n\n// App\\Status::create ([\n// 'statusable_id' => 1,\n// 'statusable_type' => 'pages',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 2,\n// 'statusable_type' => 'pages',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 3,\n// 'statusable_type' => 'pages',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 4,\n// 'statusable_type' => 'pages',\n// 'status' => 'active',\n// ]); \n\n// //postcategories\n\n// App\\Status::create ([\n// 'statusable_id' => 1,\n// 'statusable_type' => 'postcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 2,\n// 'statusable_type' => 'postcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 3,\n// 'statusable_type' => 'postcategories',\n// 'status' => 'active',\n// ]); \n\n// //posts\n\n// App\\Status::create ([\n// 'statusable_id' => 1,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 2,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 3,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 4,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 5,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 6,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 7,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 8,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 9,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 10,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 11,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n \n\n }", "public function getPostPendiente()\n {\n return $this->getPosts()->pending()->all();\n }", "public function pivot($pivot)\n {\n return $this->pivots($pivot,$pivot);\n }", "public function loan(){\n \treturn $this->belongsToMany('App\\Loan','user_loan','user_id','loan_id')->withpivot('incentivevalue','id')->withTimestamps();\n }", "public function parfums()\n {\n return $this->hasMany(Parfum::class);\n }", "public function heads()\n {\n return $this->belongsToMany(User::class,'department_head', 'department_id','user_id')\n ->withPivot('main');\n }", "protected function newPivotQuery()\n {\n $query = $this->newPivotStatement ();\n return $query->where ( $this->foreignKey, $this->parent->getKey () );\n }", "function get_post_status_object($post_status)\n {\n }", "public function status() { return $this->post->post_status; }", "public function reportStatus($id)\n {\n if (Auth::user() !== null) {\n $reported = false;\n $user = Auth::user();\n foreach ($user->postsReports as $value) {\n if ($value['pivot']['post_id'] == $id) {\n return $reported = true;\n }\n }\n return $reported;\n }\n }", "public function a4(){\n $pengumumans=Pengumuman::whereHas('user',function (Builder $query){\n $query->whereHas('galeris','function'( $query){\n $query->where('id',269)\n });\n })->with('user.galeris')->get();\n return $pengumumans;\n }", "public function showP()\n {\n return DB::table('pves')\n ->Join('profs','profs.id','=','pves.prof_id')\n ->Join('students','students.id','=','pves.prof_id')\n ->Join('semestres','semestres.id','=','students.semestre_id')\n ->Join('users as u1','u1.id','=','profs.user_id')\n ->Join('users as u2','u2.id','=','students.user_id')\n ->select('u2.nom as stdNom','u2.prenom as stdPrenom','semestres.nom as semestre','pves.sujet','pves.dateP','u1.nom as prfNom','u1.prenom as prfPrenom')\n ->where('profs.user_id', '=', auth()->user()->id)\n ->get();\n }", "public function getPivotData(): Collection;", "public function status()\n {\n return $this->belongsTo(PropertyStatus::class);\n }", "public function barsPubs()\n {\n $tags= [1,2,3,4,5,7,9,10,11];\n $tags_by_cat =[];\n \n $venues_query = Venue::query();\n foreach ($tags as $tag){\n $venues_query->whereHas('tags', function($query) use($tags){\n // THAT HAS tagid from $tags[]\n $query->whereIn('tags.id', $tags); //Verifies: ('column_value' , IN , $array)\n });\n } \n $venues = $venues_query->with('tags')->get();\n foreach($venues as $venue){\n foreach ($venue->tags as $tag) {\n $tags_by_cat[$venue->id][$tag->category_id][] = $tag;\n }\n }\n // dd($tags_by_cat);\n return view('venues.barsPubs.index', compact('venues', 'tags_by_cat'));\n\n //======= WAS THE RETURN BEFORE:\n // return view('venues.barsPubs.index', compact('venues'));\n }", "public function getList(Request $request)\n { \n $post_list=PostList::with(['authorList','postCategory'])->where('author_id','=',$request->user()->id)->paginate('10');\n \n //Filter Controller \n $post_filter=PostList::with(['authorList','postCategory'])\n ->where('author_id','=',$request->user()->id)\n ->select(\n 'id',\n 'author_id',\n 'post_category_id',\n 'status',\n 'view',\n 'updated_at')\n ->get();\n \n \n $collection=collect($post_filter);\n\n $post_category_fill=$collection->unique('post_category_id');\n $post_category_fill->all();\n\n $author_fill=$collection->unique('author_id');\n $author_fill->all();\n\n $status_fill=$collection->unique('status');\n $status_fill->all();\n\n $updated_fill=$collection->unique('updated_at');\n $updated_fill->all();\n\n return view('author.post.post-getList',[\n 'post_list'=>$post_list,\n 'post_category_fill'=>$post_category_fill,\n 'author_fill'=>$author_fill,\n 'status_fill'=>$status_fill,\n 'updated_fill'=>$updated_fill,\n ]);\n\n }", "public static function budgethomesettlement() {\n $logeddip = Auth::user()->department_id;\n $sql= DB::table('budgets')\n ->select('budgets.*', 'departments.department',DB::raw('FORMAT(budgets.cost,2) as costt'),DB::raw('DATE_FORMAT(budgets.created_at, \"%d-%b-%Y\") as date'))\n ->leftjoin('departments','budgets.department_id', '=', 'departments.id')\n ->whereIn('budgets.status',[3]) \n ->where('budgets.department_id',$logeddip)\n ->get();\n return $sql; \n }", "public function index()\n {\n //$array = [];\n //$priorities = priorities::find(1);\n //foreach($priorities->projects as $project){\n // array_push($array,$project);\n //} \n //return $array;\n\n //$priorities=DB::table('priorities')->pluck('projects_id');\n\n //$priorities=priorities::all();\n //$array=[];\n //foreach ($priorities as $project){\n // array_push($array,$project->projects);\n //}\n //return $priorities;\n\n $priorities=DB::table('priorities_projects')->where('priorities_id','1')->orWhere('priorities_id','2')->orWhere('priorities_id','3')->orWhere('priorities_id','4')->get();\n return $priorities;\n }", "public function calculateScoreStatusVotes($projectId) \n {\n $requirements = DB::table('requirements')->where('idProject', $projectId)->get();\n\n $criterias = DB::table('criterias')->where('idProject', $projectId)->where('used', 1)->get();\n \n $scores = [];\n $countMembers = DB::table('userprojects')->where('idProject', $projectId)->where('role', 2)->count();\n $agreementLimit = $countMembers * 2 / 3;\n\n foreach($requirements as $requirement) {\n foreach($criterias as $criteria) {\n $score = DB::table('scores')->where('idRequirement', $requirement->id)->where('idCriteria', $criteria->id)->where('status', 0)->first();\n\n if($score) {\n $scores[] = $score;\n }\n }\n }\n\n $scoreVotes = DB::table('scorevotes')->get();\n\n $finalStatus = [];\n foreach($scores as $score) {\n $vote = 0;\n\n foreach($scoreVotes as $scoreVote) {\n if ($score->id == $scoreVote->idScore) {\n $vote += $scoreVote->vote;\n }\n }\n\n if ($vote > $agreementLimit) {\n $affected = DB::table('scores')->where('id', $score->id)->update(['status' => 1]);\n } \n }\n }", "public function index(Request $request)\n { \n $auth_id=Auth::id();\n\n if($request->src) {\n $posts=Terms::where('type',10)->where('auth_id',$auth_id)->where('title','LIKE','%'.$request->src.'%')->withCount('coupon')->latest()->paginate(20);\n }\n elseif($request->st) {\n if ($request->st=='trash') {\n $posts=Terms::where('type',10)->where('auth_id',$auth_id)->where('status',0)->withCount('coupon')->latest()->paginate(20);\n $status=$request->st;\n return view('plugin::coupon.index',compact('posts','auth_id','status'));\n \n }\n else{\n $posts=Terms::where('type',10)->where('auth_id',$auth_id)->where('status',$request->st)->withCount('coupon')->latest()->paginate(20);\n $status=$request->st;\n return view('plugin::coupon.index',compact('posts','auth_id','status'));\n \n }\n \n }\n else{\n $posts=Terms::where('type',10)->where('auth_id',$auth_id)->withCount('coupon')->latest()->where('status','!=',0)->paginate(20);\n}\n$status=1;\n\n\n$posts=Terms::where('type',10)->where('auth_id',$auth_id)->withCount('coupon')->latest()->paginate(20);\nreturn view('plugin::coupon.index',compact('posts','auth_id','status'));\n\n}", "public function index($status)\n {\n\n if ($status == 'all') {\n return Post::orderBy('id', 'desc')->with(array('user' => function ($query) {\n $query->select('id', 'username', 'job', 'email', 'profile_img');\n }))->get();\n } else if ($status == 'job') {\n return Post::where('status', 'job')->orderBy('id', 'desc')->with(array(\"user\" => function ($query) {\n $query->select('id', 'username', 'profile_img');\n }))->get();\n } else if ($status == 'tweet') {\n return Post::where('status', 'tweet')->orderBy('id', 'desc')->with(array(\"user\" => function ($query) {\n $query->select('id', 'username', 'profile_img');\n }))->get();\n }\n }", "function where_verified($status = 1) {\n\t\t$this->with_verify_status();\n\t\t$this->db->where(array('PPV_STATUS' => $status));\n\t}", "function getFlagVideos($id) {\n // Load Flag videos based on logged in user id\n $model = Flag::where('user_id', $id)\n ->leftJoin('admin_videos' , 'flags.video_id' , '=' , 'admin_videos.id')\n ->leftJoin('categories' , 'admin_videos.category_id' , '=' , 'categories.id')\n ->leftJoin('sub_categories' , 'admin_videos.sub_category_id' , '=' , 'sub_categories.id')\n ->where('admin_videos.is_approved' , 1)\n ->where('admin_videos.status' , 1)\n ->pluck('video_id')->toArray();\n // Return array of id's\n return $model;\n}", "public function post_votes()\n {\n return $this->hasMany('arts\\Post_vote', 'post_id', 'post_id');\n }", "public function getPostsVotadosPositivos()\n {\n return $this->getPostsVotados()->joinWith('votos')->where(['positivo' => true, 'votos.usuario_id' => $this->id])->orderBy('created_at desc');\n }", "public function success()\n {\n return [\n // Assignments.\n [['title' => 'bar'], 'select * from posts where title = \\'bar\\''],\n [['title' => ['=', 'bar']], 'select * from posts where title = \\'bar\\''],\n [['title' => 10], 'select * from posts where title = 10'],\n [['published' => true], 'select * from posts where published = true'],\n\n // Comparisons.\n [['stars' => ['>', 0]], 'select * from posts where stars > 0'],\n [['stars' => ['>=', 0]], 'select * from posts where stars >= 0'],\n [['stars' => ['<', 0]], 'select * from posts where stars < 0'],\n [['stars' => ['<=', 0]], 'select * from posts where stars <= 0'],\n [['created_at' => ['>', '2018-05-14 00:41:10']], 'select * from posts where created_at > \\'2018-05-14 00:41:10\\''],\n\n // Solo.\n [['lonely'], 'select * from posts where title like \\'%lonely%\\''],\n [['3000'], 'select * from posts where (stars >= \\'3000\\' or exists (select * from comments where posts.id = comments.post_id and (stars >= \\'3000\\' or dislikes < \\'3000\\')))'],\n [['keyword' => 'lonely'], 'select * from posts where title like \\'%lonely%\\''],\n [['keyword' => '3000'], 'select * from posts where (stars >= \\'3000\\' or exists (select * from comments where posts.id = comments.post_id and (stars >= \\'3000\\' or dislikes < \\'3000\\')))'],\n\n // Boolean.\n [['published'], 'select * from posts where published = true'],\n [['not' => 'published'], 'select * from posts where published = false'],\n\n // Dates.\n [['created_at'], 'select * from posts where created_at is not null'],\n [['not' => 'created_at'], 'select * from posts where created_at is null'],\n\n // Dates year precision.\n [['created_at' => '2020'], \"select * from posts where created_at between '2020-01-01 00:00:00' and '2020-12-31 23:59:59'\"],\n [['created_at' => ['>', '2020']], \"select * from posts where created_at > '2020-12-31 23:59:59'\"],\n [['created_at' => ['<=', '2020']], \"select * from posts where created_at <= '2020-12-31 23:59:59'\"],\n [['created_at' => ['<', '2020']], \"select * from posts where created_at < '2020-01-01 00:00:00'\"],\n [['created_at' => ['>=', '2020']], \"select * from posts where created_at >= '2020-01-01 00:00:00'\"],\n [['not' => ['created_at' => '2020']], \"select * from posts where created_at not between '2020-01-01 00:00:00' and '2020-12-31 23:59:59'\"],\n\n // Dates month precision.\n [['created_at' => '2020/02'], \"select * from posts where created_at between '2020-02-01 00:00:00' and '2020-02-29 23:59:59'\"],\n [['created_at' => ['>', '2020/02']], \"select * from posts where created_at > '2020-02-29 23:59:59'\"],\n [['created_at' => ['<=', '2020/02']], \"select * from posts where created_at <= '2020-02-29 23:59:59'\"],\n [['created_at' => ['<', '2020/02']], \"select * from posts where created_at < '2020-02-01 00:00:00'\"],\n [['created_at' => ['>=', '2020/02']], \"select * from posts where created_at >= '2020-02-01 00:00:00'\"],\n [['created_at' => ['>', 'Dec 2020']], \"select * from posts where created_at > '2020-12-31 23:59:59'\"],\n\n // Dates day month precision.\n [['created_at' => '2020/02/01'], \"select * from posts where created_at between '2020-02-01 00:00:00' and '2020-02-01 23:59:59'\"],\n [['created_at' => ['>', '2020/02/01']], \"select * from posts where created_at > '2020-02-01 23:59:59'\"],\n [['created_at' => ['<=', '2020/02/01']], \"select * from posts where created_at <= '2020-02-01 23:59:59'\"],\n [['created_at' => ['<', '2020/02/01']], \"select * from posts where created_at < '2020-02-01 00:00:00'\"],\n [['created_at' => ['>=', '2020/02/01']], \"select * from posts where created_at >= '2020-02-01 00:00:00'\"],\n [['created_at' => ['>', 'Dec 31 2020']], \"select * from posts where created_at > '2020-12-31 23:59:59'\"],\n [['created_at' => ['<=', '31/12/2020']], \"select * from posts where created_at <= '2020-12-31 23:59:59'\"],\n\n // Dates hour precision.\n [['created_at' => '2020/02/01 10'], \"select * from posts where created_at between '2020-02-01 10:00:00' and '2020-02-01 10:59:59'\"],\n [['created_at' => ['>', '2020/02/01 10']], \"select * from posts where created_at > '2020-02-01 10:59:59'\"],\n [['created_at' => ['<=', '2020/02/01 10']], \"select * from posts where created_at <= '2020-02-01 10:59:59'\"],\n [['created_at' => ['<', '2020/02/01 10']], \"select * from posts where created_at < '2020-02-01 10:00:00'\"],\n [['created_at' => ['>=', '2020/02/01 10']], \"select * from posts where created_at >= '2020-02-01 10:00:00'\"],\n [['created_at' => '2020/02/01 10pm'], \"select * from posts where created_at between '2020-02-01 22:00:00' and '2020-02-01 22:59:59'\"],\n\n // Dates minute precision.\n [['created_at' => '2020/02/01 10:02'], \"select * from posts where created_at between '2020-02-01 10:02:00' and '2020-02-01 10:02:59'\"],\n [['created_at' => ['>', '2020/02/01 10:02']], \"select * from posts where created_at > '2020-02-01 10:02:59'\"],\n [['created_at' => ['<=', '2020/02/01 10:02']], \"select * from posts where created_at <= '2020-02-01 10:02:59'\"],\n [['created_at' => ['<', '2020/02/01 10:02']], \"select * from posts where created_at < '2020-02-01 10:02:00'\"],\n [['created_at' => ['>=', '2020/02/01 10:02']], \"select * from posts where created_at >= '2020-02-01 10:02:00'\"],\n\n // Dates exact precision.\n [['created_at' => '2020/02/01 10:02:01'], \"select * from posts where created_at = '2020-02-01 10:02:01'\"],\n [['created_at' => 'Dec 31 2020 5:15:10pm'], \"select * from posts where created_at = '2020-12-31 17:15:10'\"],\n\n // Relative dates.\n [['created_at' => ['>', 'yesterday']], sprintf(\"select * from posts where created_at > '%s'\", (new DateTime('yesterday'))->format('Y-m-d 23:59:59'))],\n [['created_at' => ['<', 'yesterday']], sprintf(\"select * from posts where created_at < '%s'\", (new DateTime('yesterday'))->format('Y-m-d 00:00:00'))],\n\n // Not.\n [['not' => 'lonely'], 'select * from posts where title not like \\'%lonely%\\''],\n [['not' => ['title' => 'bar']], 'select * from posts where title != \\'bar\\''],\n [['not' => ['title' => ['=', 'bar']]], 'select * from posts where title != \\'bar\\''],\n [['not' => ['title' => ['!=', 'bar']]], 'select * from posts where title = \\'bar\\''],\n [['not' => ['stars' => ['>', 0]]], 'select * from posts where stars <= 0'],\n [['not' => ['stars' => ['>=', 0]]], 'select * from posts where stars < 0'],\n [['not' => ['stars' => ['<', 0]]], 'select * from posts where stars >= 0'],\n [['not' => ['stars' => ['<=', 0]]], 'select * from posts where stars > 0'],\n\n // And.\n [['bar', 'baz'], 'select * from posts where title like \\'%bar%\\' and title like \\'%baz%\\''],\n ['and' => ['bar', 'baz'], 'select * from posts where title like \\'%bar%\\' and title like \\'%baz%\\''],\n [['title' => 'bar', 'stars' => 0], 'select * from posts where title = \\'bar\\' and stars = 0'],\n ['and' => ['title' => 'bar', 'stars' => 0], 'select * from posts where title = \\'bar\\' and stars = 0'],\n [['title' => ['=', 'bar'], 'stars' => ['>', 0]], 'select * from posts where title = \\'bar\\' and stars > 0'],\n ['and' => ['title' => ['=', 'bar'], 'stars' => ['>', 0]], 'select * from posts where title = \\'bar\\' and stars > 0'],\n [[['title' => ['=', 'bar']], ['stars' => ['>', 0]]], 'select * from posts where title = \\'bar\\' and stars > 0'],\n ['and' => [['title' => ['=', 'bar']], ['stars' => ['>', 0]]], 'select * from posts where title = \\'bar\\' and stars > 0'],\n\n // Or.\n [['or' => ['bar', 'baz']], 'select * from posts where (title like \\'%bar%\\' or title like \\'%baz%\\')'],\n [['or' => ['title' => 'bar', 'stars' => 0]], 'select * from posts where (title = \\'bar\\' or stars = 0)'],\n [['or' => ['title' => ['=', 'bar'], 'stars' => ['>', 0]]], 'select * from posts where (title = \\'bar\\' or stars > 0)'],\n [['or' => [['title' => ['=', 'bar']], ['stars' => ['>', 0]]]], 'select * from posts where (title = \\'bar\\' or stars > 0)'],\n [['or' => ['title' => ['=', 'bar'], 'or' => [['stars' => ['>', 0]], ['stars' => -1]]]], 'select * from posts where (title = \\'bar\\' or stars > 0 or stars = -1)'],\n\n // Or precedes And.\n [['or' => ['stars' => ['>', 10], ['likes' => ['>=', 5], 'forks' => ['<', 5]], 'watches' => ['<=', 10]]], 'select * from posts where (stars > 10 or (likes >= 5 and forks < 5) or watches <= 10)'],\n [[['or' => ['stars' => ['>', 10], 'likes' => ['>=', 10]]], 'forks' => ['<', 10]], 'select * from posts where (stars > 10 or likes >= 10) and forks < 10'],\n [['or' => [['stars' => ['>', 10], 'likes' => ['>=', 10]], ['forks' => ['<', 10], 'watches' => ['<=', 10]]]], 'select * from posts where ((stars > 10 and likes >= 10) or (forks < 10 and watches <= 10))'],\n [[['or' => ['stars' => ['>', 10], 'likes' => ['>=', 10]]], ['or' => ['forks' => ['<', 10], 'watches' => ['<=', 10]]]], 'select * from posts where (stars > 10 or likes >= 10) and (forks < 10 or watches <= 10)'],\n [['or' => [['stars' => ['>', 10]], [['likes' => ['>=', 5]], ['forks' => ['<', 5]]], ['watches' => ['<=', 10]]]], 'select * from posts where (stars > 10 or (likes >= 5 and forks < 5) or watches <= 10)'],\n [[['or' => [['stars' => ['>', 10]], ['likes' => ['>=', 10]]]], ['forks' => ['<', 10]]], 'select * from posts where (stars > 10 or likes >= 10) and forks < 10'],\n [['or' => [[['stars' => ['>', 10]], ['likes' => ['>=', 10]]], [['forks' => ['<', 10]], ['watches' => ['<=', 10]]]]], 'select * from posts where ((stars > 10 and likes >= 10) or (forks < 10 and watches <= 10))'],\n [[['or' => [['stars' => ['>', 10]], ['likes' => ['>=', 10]]]], ['or' => [['forks' => ['<', 10]], ['watches' => ['<=', 10]]]]], 'select * from posts where (stars > 10 or likes >= 10) and (forks < 10 or watches <= 10)'],\n\n // Lists.\n [['status' => ['Finished', 'Archived']], \"select * from posts where status in ('Finished', 'Archived')\"],\n [['status' => ['in', 'Finished', 'Archived']], \"select * from posts where status in ('Finished', 'Archived')\"],\n [['title' => ['in', 1, 2, 3]], 'select * from posts where title in (1, 2, 3)'],\n [['title' => ['in', [1, 2, 3]]], 'select * from posts where title in (1, 2, 3)'],\n\n // Between.\n [['created_at' => ['between', ['2021-01-01 00:00:00', '2021-12-31 23:59:59']]], \"select * from posts where created_at between '2021-01-01 00:00:00' and '2021-12-31 23:59:59'\"],\n [['created_at' => ['between', '2021-01-01 00:00:00', '2021-12-31 23:59:59']], \"select * from posts where created_at between '2021-01-01 00:00:00' and '2021-12-31 23:59:59'\"],\n\n // Relationships.\n [['comments'], 'select * from posts where exists (select * from comments where posts.id = comments.post_id)'],\n [['not' => 'comments'], 'select * from posts where not exists (select * from comments where posts.id = comments.post_id)'],\n [['comments' => 3], 'select * from posts where (select count(*) from comments where posts.id = comments.post_id) = 3'],\n [['comments' => ['>', 10]], 'select * from posts where (select count(*) from comments where posts.id = comments.post_id) > 10'],\n [['comments' => ['>', 0]], 'select * from posts where exists (select * from comments where posts.id = comments.post_id)'],\n [['comments' => ['!=', 0]], 'select * from posts where exists (select * from comments where posts.id = comments.post_id)'],\n [['comments' => ['>=', 1]], 'select * from posts where exists (select * from comments where posts.id = comments.post_id)'],\n [['comments' => ['<=', 0]], 'select * from posts where not exists (select * from comments where posts.id = comments.post_id)'],\n [['comments' => ['=', 0]], 'select * from posts where not exists (select * from comments where posts.id = comments.post_id)'],\n [['comments' => ['<', 1]], 'select * from posts where not exists (select * from comments where posts.id = comments.post_id)'],\n [['comments' => ['title' => ['=', 'bar']]], 'select * from posts where exists (select * from comments where posts.id = comments.post_id and title = \\'bar\\')'],\n [['comments.title' => 'bar'], 'select * from posts where exists (select * from comments where posts.id = comments.post_id and title = \\'bar\\')'],\n [['comments' => [['>', 10], 'title' => 'bar']], 'select * from posts where (select count(*) from comments where posts.id = comments.post_id and title = \\'bar\\') > 10'],\n [['one'], 'select * from posts where exists (select * from comments where posts.id = comments.post_id)'],\n [['many'], 'select * from posts where exists (select * from comments inner join comment_post on comments.id = comment_post.comment_id where posts.id = comment_post.post_id)'],\n [['through'], 'select * from posts where exists (select * from users inner join comments on comments.id = users.comment_id where posts.id = comments.post_id)'],\n [['oneSelf'], 'select * from posts where exists (select * from posts as laravel_reserved_0 where posts.id = laravel_reserved_0.post_id)'],\n [['manySelf'], 'select * from posts where exists (select * from posts as laravel_reserved_0 inner join post_post on laravel_reserved_0.id = post_post.post_id where posts.id = post_post.post_id)'],\n [['throughSelf'], 'select * from posts where exists (select * from users inner join posts as laravel_reserved_0 on laravel_reserved_0.id = users.post_id where posts.id = laravel_reserved_0.post_id)'],\n\n // Nested relationships.\n [['comments' => ['author' => ['name' => 'John']]], 'select * from posts where exists (select * from comments where posts.id = comments.post_id and exists (select * from users where comments.user_id = users.id and name = \\'John\\'))'],\n [['comments' => ['author' => ['name' => 'John', 'phone' => '12345']]], 'select * from posts where exists (select * from comments where posts.id = comments.post_id and exists (select * from users where comments.user_id = users.id and name = \\'John\\' and phone = \\'12345\\'))'],\n [['comments.author.name' => 'John'], 'select * from posts where exists (select * from comments where posts.id = comments.post_id and exists (select * from users where comments.user_id = users.id and name = \\'John\\'))'],\n [['comments.author.name' => 'John', 'comments.author.phone' => '12345'], 'select * from posts where exists (select * from comments where posts.id = comments.post_id and exists (select * from users where comments.user_id = users.id and name = \\'John\\' and phone = \\'12345\\'))'],\n\n // Limit and offset.\n [['limit' => 10], 'select * from posts limit 10'],\n [['from' => 10], 'select * from posts offset 10'],\n [['from' => 10, 'limit' => 10], 'select * from posts limit 10 offset 10'],\n\n // Sort\n [['sort' => 'stars,-created_at'], 'select * from posts order by stars asc, created_at desc'],\n [['sort' => ['stars', '-created_at']], 'select * from posts order by stars asc, created_at desc'],\n\n // Select\n [['columns' => ['title', 'comments_count']], 'select title, (select count(*) from comments where posts.id = comments.post_id) as comments_count from posts'],\n [['columns' => 'title, comments.title'], 'select id, title from posts', ['comments' => 'select post_id, title from comments']],\n [['columns' => ['title', 'comments']], 'select id, title from posts', ['comments' => 'select * from comments']],\n [['columns' => ['title', 'comments.title', 'comments.author.name']], 'select id, title from posts', ['comments' => ['select post_id, user_id, title from comments', 'author' => 'select id, name from users']]],\n [['columns' => ['title', 'views']], 'select title from posts', [], ['views']],\n [['not' => ['columns' => 'id,title']], 'select stars, likes, forks, watches, published, status, created_at, updated_at from posts'],\n [['not' => ['columns' => ['id', 'title', 'comments.title']]], 'select stars, likes, forks, watches, published, status, created_at, updated_at, id from posts', ['comments' => 'select id, user_id, stars, dislikes, post_id from comments']],\n [['not' => ['columns' => ['id', 'title', 'views']]], 'select stars, likes, forks, watches, published, status, created_at, updated_at from posts', [], []],\n [['columns' => ['title', 'one_count']], 'select title, (select count(*) from comments where posts.id = comments.post_id) as one_count from posts'],\n [['columns' => ['title', 'one.title']], 'select id, title from posts', ['one' => 'select post_id, title from comments']],\n [['columns' => ['title', 'many_count']], 'select title, (select count(*) from comments inner join comment_post on comments.id = comment_post.comment_id where posts.id = comment_post.post_id) as many_count from posts'],\n [['columns' => ['title', 'many.title']], 'select id, title from posts', ['many' => 'select comments.id, comments.title from comments inner join comment_post on comments.id = comment_post.comment_id']],\n [['columns' => ['title', 'through.name']], 'select id, title from posts', ['through' => 'select users.name from users inner join comments on comments.id = users.comment_id']],\n [['columns' => ['title', 'oneSelf.title']], 'select id, title from posts', ['oneSelf' => 'select title from posts']],\n [['columns' => ['title', 'manySelf.title']], 'select id, title from posts', ['manySelf' => 'select posts.id, posts.title from posts inner join post_post on posts.id = post_post.post_id']],\n [['columns' => ['title', 'throughSelf.title']], 'select id, title from posts', ['throughSelf' => 'select * from users inner join posts on posts.id = users.post_id']],\n ];\n }", "public function positionQuery()\n {\n return $this->query()->positionPivots($this->currentPivotValues());\n }", "public function status()\n {\n return $this->belongsTo('App\\MasterModel\\MasterFilingStatus', 'status_id', 'id');\n }", "public function status() {\n return $this->belongsTo(Status::class);\n }", "function wpachievements_wordpress_post($pid, $status){\r\n if( !empty($pid) ){\r\n $pdata = get_post( $pid );\r\n if( $pdata->post_author && $pdata->post_type == 'post' ){\r\n if(function_exists('is_multisite') && is_multisite()){\r\n $post_count = (int)get_blog_option(1, 'wpachievements_post_min_count');\r\n $post_deduct = (int)get_blog_option(1, 'wpachievements_post_min_deduct');\r\n } else{\r\n $post_count = (int)get_option('wpachievements_post_min_count');\r\n $post_deduct = (int)get_option('wpachievements_post_min_deduct');\r\n }\r\n if( empty($post_count) || $post_count < 1 ){\r\n $post_count = 1;\r\n }\r\n $uid=$pdata->post_author; $postid=$pid;\r\n if( !empty($post_count) && $post_count > 0 ){\r\n if( str_word_count($pdata->post_content) >= $post_count ){\r\n $type='post_added';\r\n if( !function_exists(WPACHIEVEMENTS_CUBEPOINTS) && !function_exists(WPACHIEVEMENTS_MYCRED) ){\r\n if(function_exists('is_multisite') && is_multisite()){\r\n $points = (int)get_blog_option(1, 'wpachievements_post_points');\r\n } else{\r\n $points = (int)get_option('wpachievements_post_points');\r\n }\r\n }\r\n if(empty($points)){$points=0;}\r\n wpachievements_new_activity($type, $uid, $postid, $points);\r\n } else{\r\n $type='post_added_bad';\r\n if( !empty($post_deduct) && $post_deduct > 0 ){\r\n $points=$post_deduct;\r\n } else{\r\n $points=0;\r\n }\r\n if(empty($points)){$points=0;}\r\n wpachievements_new_activity($type, $uid, $postid, -$points);\r\n }\r\n } else{\r\n $type='post_added';\r\n if( !function_exists(WPACHIEVEMENTS_CUBEPOINTS) && !function_exists(WPACHIEVEMENTS_MYCRED) ){\r\n if(function_exists('is_multisite') && is_multisite()){\r\n $points = (int)get_blog_option(1, 'wpachievements_post_points');\r\n } else{\r\n $points = (int)get_option('wpachievements_post_points');\r\n }\r\n }\r\n if(empty($points)){$points=0;}\r\n wpachievements_new_activity($type, $uid, $postid, $points);\r\n }\r\n }\r\n }\r\n }", "function check_all_is_post_upcoming(){\n $this->loop_through_all(array($this, 'is_post_upcoming'));\n }", "public function getPostsVotados()\n {\n return $this->hasMany(Post::className(), ['id' => 'post_id'])->via('votos');\n }", "function by_status_berlaku()\n {\n $this->db->select(\"COUNT(id) AS total,COUNT( CASE WHEN status_berlaku = '1' THEN 1 END ) AS berlaku,COUNT( CASE WHEN status_berlaku = '0' THEN 1 END ) AS tidak_berlaku\");\n $this->db->from($this->table);\n return $this->db->get()->row();\n }", "public function getStatusSPP()\n {\n return $this->db->select('tbl_siswa.nis_lokal, tbl_siswa.nama_siswa, tbl_siswa.kelas, tbl_statusbayarspp.*, tbl_kelas.nama_kelas')\n ->order_by('tbl_siswa.nis_lokal','ASC')\n ->from('tbl_siswa')\n ->join('tbl_statusbayarspp','tbl_statusbayarspp.nis_spp = tbl_siswa.nis_lokal','left')\n ->join('tbl_kelas','tbl_kelas.id = tbl_siswa.kelas','left')\n ->get()->result();\n }", "public function permissions()\n {\n return $this->belongsToMany(Permission::class)->withPivot('has_access');\n }", "function filter_posts( $params ) {\n global $wpdb;\n\n $facet = $params['facet'];\n $selected_values = $params['selected_values'];\n $selected_values = implode( \"','\", $selected_values );\n\n $sql = \"\n SELECT DISTINCT post_id FROM {$wpdb->prefix}facetwp_index\n WHERE facet_name = '{$facet['name']}' AND facet_value IN ('$selected_values')\";\n return facetwp_sql( $sql, $facet );\n }", "public function tags()\n {\n return $this->belongsToMany('App\\models\\tagModel', 'blog_post_tag', 'post_id', 'tag_id')->withPivot('type');\n }", "public function posts()\n {\n //hasMany(Modelo a comparar) ira a buscar todos los post que concuerden con el id del usuario en la tabla posts\n return $this->hasMany('App\\Models\\Post', 'user_id', 'id');\n\n //return $this->hasMany('Modelo a cruzar con el actual', 'llave foranea a comprar', 'llave del modelo actual');\n }", "protected function _publish_status()\n\t{\n\t\t//$fields = $this->fields();\n\t\t$fields = $fields = array_keys($this->table_info()); // used to prevent an additional query that the fields() method would create\n\n\t\tif (in_array('published', $fields))\n\t\t{\n\t\t\tif (in_array('published', $this->boolean_fields))\n\t\t\t{\n\t\t\t\t$this->db->where(array($this->table_name.'.published' => 1));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where(array($this->table_name.'.published' => 'yes'));\n\t\t\t}\n\t\t}\n\n\t\tif (in_array('active', $fields))\n\t\t{\n\t\t\tif (in_array('active', $this->boolean_fields))\n\t\t\t{\n\t\t\t\t$this->db->where(array($this->table_name.'.active' => 1));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where(array($this->table_name.'.active' => 'yes'));\n\t\t\t}\n\t\t}\n\n\t\tif (in_array('publish_date', $fields))\n\t\t{\n\t\t\t$this->db->where(array($this->table_name.'.publish_date <=' => datetime_now()));\n\t\t}\n\t}", "public function status()\n {\n return $this->belongsTo(Status::class);\n }", "public function status()\n {\n return $this->belongsTo(Status::class);\n }", "public function users() {\n \treturn $this->belongsToMany('App\\User')->withPivot('vote')->withTimestamps();\n }", "public function recruiter(){\n return $this->belongsTo('App\\Models\\Recruiter')->withPivot('Job_title');\n }", "public function PegawaiAktif()\n {\n return $this->hasOne('App\\Models\\Pegawai','id','id_pegawai')->where('status','active');\n }", "public function status()\n {\n return $this->belongsTo( Status::class );\n }", "public function availabilities() {\n return $this->belongsToMany(User::class, 'availability')\n ->withPivot('start', 'end', 'reason');\n }", "public function votes()\n {\n return $this->hasMany(PropertyVote::class,'property_id', 'id');\n }", "public function product()\n\t{\n\t\treturn $this->belongsToMany('App\\Models\\Products','inventory','store_id','product_id')->withPivot('stocks', 'lower_limit', 'higher_limit');\n\t}", "private function setGroup2() {\n $this->qestion->groupBy(\"moods.id\");\n //$this->qestion->havingRaw(\"CASE WHEN count(forwarding_drugs.id_mood) = 0 THEN 1 else forwarding_drugs.id_mood END \");\n }", "public function status()\n {\n return $this->belongsTo('App\\Status');\n }", "public function status()\n {\n return $this->belongsTo('App\\Status');\n }", "public function status()\n {\n return $this->belongsTo('App\\Status');\n }", "public function status()\n {\n return $this->belongsTo('App\\Status');\n }", "function _acf_untrash_field_group_post_status( $new_status, $post_id, $previous_status ) {\n\treturn ( get_post_type( $post_id ) === 'acf-field-group' ) ? $previous_status : $new_status;\n}", "public function sponsors(){\n return $this->belongsToMany('App\\Sponsor')->withPivot('points_balance');\n }", "public function filter(Request $request )\n \n {\n $filter_1=$request->user()->id;\n $filter_2=$request->post_category_id ;\n $filter_3=$request->status;\n $filter_date=$request->updated_at;\n //Put $this $Field->value >>> If Field not Use , fill values='none' ! .\n $field_1='author_id'; \n $field_2='post_category_id';\n $field_3='status';\n $field_date='updated_at';\n\n isset($filter_1)&&isset($filter_2)&&isset($filter_3)&&isset($filter_date)?\n ($filter_1 !=='none')&&\n ($filter_2 !=='none')&&\n ($filter_3 !=='none')&&\n ($filter_date !=='none')\n ||\n ($filter_1 =='none')&&\n ($filter_2 =='none')&&\n ($filter_3 =='none')&&\n ($filter_date !=='none')\n ?\n $post_list=PostList::where([\n [$field_1, '=', $filter_1],\n [$field_2, '=', $filter_2],\n [$field_3, '=', $filter_3],\n [$field_date, 'like', '%'.$filter_date.'%']\n ])->get()\n :false\n :false;\n \n isset($filter_1)&&isset($filter_2)&&isset($filter_3)&&isset($filter_date)?\n ($filter_1 =='none')&&\n ($filter_2 !=='none')&&\n ($filter_3 !=='none')&&\n ($filter_date !=='none')\n ||\n ($filter_1 !=='none')&&\n ($filter_2 =='none')&&\n ($filter_3 =='none')&&\n ($filter_date =='none')\n ?\n $post_list=PostList::where([\n [$field_2, '=', $filter_2],\n [$field_3, '=', $filter_3],\n [$field_date, 'like', '%'.$filter_date.'%']\n ])\n ->orWhere($field_1, '=', $filter_1)\n ->get()\n :false\n :false;\n \n isset($filter_1)&&isset($filter_2)&&isset($filter_3)&&isset($filter_date)?\n ($filter_1 !=='none')&&\n ($filter_2 =='none')&&\n ($filter_3 !=='none')&&\n ($filter_date !=='none')\n ||\n ($filter_1 =='none')&&\n ($filter_2 !=='none')&&\n ($filter_3 =='none')&&\n ($filter_date =='none')\n ?\n $post_list=PostList::where([\n [$field_1, '=', $filter_1],\n [$field_3, '=', $filter_3],\n [$field_date, 'like', '%'.$filter_date.'%']\n ])\n ->orWhere($field_2, '=', $filter_2)\n ->get()\n :false\n :false;\n\n isset($filter_1)&&isset($filter_2)&&isset($filter_3)&&isset($filter_date)?\n ($filter_1 !=='none')&&\n ($filter_2 !=='none')&&\n ($filter_3 =='none')&&\n ($filter_date !=='none')\n ||\n ($filter_1 =='none')&&\n ($filter_2 =='none')&&\n ($filter_3 !=='none')&&\n ($filter_date =='none')\n ?\n $post_list=PostList::where([\n [$field_1, '=', $filter_1],\n [$field_2, '=', $filter_2],\n [$field_date, 'like', '%'.$filter_date.'%']\n ])\n ->orWhere($field_3, '=', $filter_3)\n ->get()\n :false\n :false;\n\n isset($filter_1)&&isset($filter_2)&&isset($filter_3)&&isset($filter_date)?\n ($filter_1 !=='none')&&\n ($filter_2 !=='none')&&\n ($filter_3 !=='none')&&\n ($filter_date =='none')\n ||\n ($filter_1 =='none')&&\n ($filter_2 =='none')&&\n ($filter_3 =='none')&&\n ($filter_date !=='none')\n ?\n $post_list=PostList::where([\n [$field_1, '=', $filter_1],\n [$field_2, '=', $filter_2],\n [$field_3, '=', $filter_3]\n ])\n ->orWhere($field_date, 'like', '%'.$filter_date.'%')\n ->get()\n :false\n :false;\n\n isset($filter_1)&&isset($filter_2)&&isset($filter_3)&&isset($filter_date)?\n ($filter_1 !=='none')&&\n ($filter_2 !=='none')&&\n ($filter_3 =='none')&&\n ($filter_date =='none')\n ||\n ($filter_1 =='none')&&\n ($filter_2 =='none')&&\n ($filter_3 !=='none')&&\n ($filter_date !=='none')\n ?\n $post_list=PostList::where([\n [$field_1, '=', $filter_1],\n [$field_2, '=', $filter_2]\n \n ])\n ->orWhere([\n [$field_3, '=', $filter_3],\n [$field_date, 'like', '%'.$filter_date.'%']\n ])\n ->get()\n :false\n :false; \n\n isset($filter_1)&&isset($filter_2)&&isset($filter_3)&&isset($filter_date)?\n ($filter_1 !=='none')&&\n ($filter_2 =='none')&&\n ($filter_3 !=='none')&&\n ($filter_date =='none')\n ||\n ($filter_1 =='none')&&\n ($filter_2 !=='none')&&\n ($filter_3 =='none')&&\n ($filter_date !=='none')\n ?\n $post_list=PostList::where([\n [$field_1, '=', $filter_1],\n [$field_3, '=', $filter_3]\n \n ])\n ->orWhere([\n [$field_2, '=', $filter_2],\n [$field_date, 'like', '%'.$filter_date.'%']\n ])\n ->get()\n :false\n :false;\n\n isset($filter_1)&&isset($filter_2)&&isset($filter_3)&&isset($filter_date)?\n ($filter_1 !=='none')&&\n ($filter_2 =='none')&&\n ($filter_3 =='none')&&\n ($filter_date !=='none')\n ||\n ($filter_1 =='none')&&\n ($filter_2 !=='none')&&\n ($filter_3 !=='none')&&\n ($filter_date !=='none')\n ?\n $post_list=PostList::where([\n [$field_1, '=', $filter_1],\n [$field_date, 'like', '%'.$filter_date.'%']\n \n ])\n ->orWhere([\n [$field_2, '=', $filter_2],\n [$field_3, '=', $filter_3]\n ])\n ->get()\n :false\n :false;\n\n return view('author.post.post-filter',['post_list'=>$post_list]);\n }", "function mostUpvotedPosts(object $pdo): array\n{\n\n $statement = $pdo->prepare('SELECT posts.*, upvotes.post_id \n FROM posts INNER JOIN upvotes \n ON posts.id = upvotes.post_id \n GROUP BY post_id ORDER BY COUNT(*) DESC');\n $statement->execute();\n\n $posts = $statement->fetchAll(PDO::FETCH_ASSOC);\n return $posts;\n}" ]
[ "0.5501788", "0.52438015", "0.5222567", "0.52159816", "0.51492894", "0.5148914", "0.5147015", "0.5012503", "0.4995222", "0.49465474", "0.4939952", "0.49022", "0.48716477", "0.48268053", "0.482571", "0.4820807", "0.48160303", "0.47997707", "0.4796085", "0.47931153", "0.47806662", "0.4761748", "0.4751897", "0.47478902", "0.4742369", "0.4710575", "0.4704883", "0.46876535", "0.46845663", "0.4669116", "0.46656308", "0.4665043", "0.4660874", "0.46437564", "0.46300602", "0.4623994", "0.46236986", "0.46193475", "0.46148485", "0.4593304", "0.4592389", "0.45897895", "0.45886973", "0.45748094", "0.4573893", "0.45725682", "0.45664814", "0.4546068", "0.4543733", "0.45419014", "0.4541472", "0.4539641", "0.45372808", "0.45272622", "0.45222363", "0.45218146", "0.45179886", "0.4513798", "0.4512106", "0.4511864", "0.4509173", "0.4506426", "0.45020077", "0.4501824", "0.44980392", "0.44952235", "0.4494542", "0.44913384", "0.4489756", "0.448563", "0.44814613", "0.44805354", "0.4471893", "0.4467908", "0.4467716", "0.44672245", "0.44614613", "0.44577387", "0.44570556", "0.44568968", "0.44554576", "0.44451806", "0.44450146", "0.44450146", "0.4439215", "0.44347996", "0.44202647", "0.44175178", "0.44111797", "0.43992198", "0.4393675", "0.4387515", "0.4387066", "0.4387066", "0.4387066", "0.4387066", "0.438637", "0.43856663", "0.43847314", "0.43740863" ]
0.7210851
0
Display a listing of the resource.
public function index() { // }
{ "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 // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('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 //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\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(\"familiasPrograma.create\");\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\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 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 $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\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 create()\n {\n return view('student::students.student.create');\n }", "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}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $validation = Validator::make($request->all(), [ 'name' => 'required', 'acronym' => 'required', ]); if ($validation->fails()) { return response()->json([ 'status' => 400, 'message' => 'Erro! Preencha todos os campos.', ]); } try { $state = new State(); $state->name = $request->input('name'); $state->acronym = $request->input('acronym'); $state->save(); return response()->json([ 'status' => 200, 'message' => 'Criado com sucesso!', ]); } catch (Exception $e) { return response()->json([ 'status' => 400, 'message' => $e->getMessage(), ]); } }
{ "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(State $state) { // }
{ "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(Request $request) { $validation = Validator::make($request->all(), [ 'id' => 'required', 'name' => 'required', 'acronym' => 'required', ]); if ($validation->fails()) { return response()->json([ 'status' => 400, 'message' => 'Erro! Preencha todos os campos.', ]); } try { $state = State::findOrFail($request->input('id')); $state->name = $request->input('name'); $state->acronym = $request->input('acronym'); $state->save(); return response()->json([ 'status' => 200, 'message' => 'Salvo com sucesso!', ]); } catch (Exception $e) { return response()->json([ 'status' => 500, 'message' => $e->getMessage(), ]); } }
{ "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, State $state) { // }
{ "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(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(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(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);", "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 }", "public function update($request, $id);", "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 }", "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 }", "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 }", "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 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 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 abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "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($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "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() {\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 }", "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() {\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 //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(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 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 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, $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.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(State $state) { // }
{ "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
Get the path the user should be redirected to when they are not authenticated.
protected function redirectTo($request) { if (! $request->expectsJson()) { return route('login'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function redirectPath()\n {\n $redirect = app('user.logic')->getUserInfo('admin') ? $this->redirectTo : $this->redirectToHome;\n return $redirect;\n }", "public function redirectPath()\n {\n if (method_exists($this, 'redirectTo')) {\n return $this->redirectTo();\n \n if(Auth::user()->position == 'Administrative Staff')\n {\n return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home';\n }\n if(Auth::user()->position == 'Lawyer')\n {\n return property_exists($this, 'redirectTo') ? $this->redirectTo : '/lawyerside/show';\n }\n } \n }", "public function redirectPath()\n {\n if (method_exists($this, 'redirectTo')) {\n return $this->redirectTo();\n }\n\n return property_exists($this, 'redirectTo') ? $this->redirectTo : '/admin';\n }", "public function redirectPath()\n {\n if (property_exists($this, 'redirectPath')) {\n return $this->redirectPath;\n }\n\n if (Auth::user()->getUserRole() == 'user') {\n return property_exists($this, 'redirectTo') ? $this->redirectTo : '/'.Auth::user()->getUserRole().\"/profile\";\n } else {\n return property_exists($this, 'redirectTo') ? $this->redirectTo : '/'.Auth::user()->getUserRole().\"/dashboard\";\n }\n }", "public function redirectPath()\n {\n if (method_exists($this, 'redirectTo')) {\n return $this->redirectTo();\n }\n\n return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home';\n }", "public function redirectPath()\n\t{\n\t\tif (property_exists($this, 'redirectPath'))\n\t\t{\n\t\t\treturn $this->redirectPath;\n\t\t}\n\n\t\treturn property_exists($this, 'redirectTo') ? $this->redirectTo : '/inicio';\n\t}", "public function redirectPath()\r\n\t{\r\n\t\tif (property_exists($this, 'redirectPath'))\r\n\t\t{\r\n\t\t\treturn $this->redirectPath;\r\n\t\t}\r\n\r\n\t\treturn property_exists($this, 'redirectTo') ? $this->redirectTo : '/home';\r\n\t}", "public function redirectPath()\n\t{\n\t\tif (property_exists($this, 'redirectPath'))\n\t\t{\n\t\t\treturn $this->redirectPath;\n\t\t}\n\n\t\treturn property_exists($this, 'redirectTo') ? $this->redirectTo : '/home';\n\t}", "public function redirectPath()\n {\n return property_exists($this, 'redirectTo') ? $this->redirectTo : route('home');\n }", "public function redirectTo()\n {\n // User role\n $user = Auth::user();\n\n return '/';\n }", "public function redirectPath()\n {\n if (property_exists($this, 'redirectPath')) {\n return $this->redirectPath;\n }\n\n return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home';\n }", "public function redirectPath()\n {\n if (property_exists($this, 'redirectPath')) {\n return $this->redirectPath;\n }\n\n return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home';\n }", "public function redirectPath()\n\t{\n\t\tif (property_exists($this, 'redirectPath'))\n\t\t{\n\t\t\treturn $this->redirectPath;\n\t\t}\n\n\t\treturn property_exists($this, 'redirectTo') ? $this->redirectTo : '/';\n\t}", "public function redirectPath()\n {\n $user = Auth::user();\n $userb = User::with('roles')->where('id', $user->id)->first();\n\n $role= $userb->roles->first()->Nombre;\n\n switch ($role) {\n case 'Supervisor':\n return \"/Admin\";\n break;\n case 'Encargado':\n return \"/Encargado\";\n break;\n case 'Comprador':\n return \"/Cliente\";\n break;\n case 'Vendedor':\n return \"/Cliente\";\n break;\n default:\n return \"/\";\n break;\n }\n }", "public function redirectPath()\n {\n if (Permissions::check()) {\n return Flare::adminUrl();\n }\n\n return '/';\n }", "public function getRedirectPath()\n {\n return $this->redirectPath;\n }", "protected function redirectTo()\n {\n //generate URL dynamicaly .\n return '/login'; // return dynamicaly generated URL.\n }", "protected function redirectTo()\n {\n\n return '/'; // return dynamicaly generated URL.\n }", "function getRedirectPath() {\n return $this->redirectPath;\n }", "protected function redirectTo(): string\n {\n return '/';\n }", "public function redirectPath()\n {\n return route(home_route());\n }", "public function getUnauthenticatedRedirectUrl(ServerRequestInterface $request): ?string;", "public function getLoginRedirect()\n {\n return [\"/\"];\n }", "public function redirectPath()\n {\n if ($referer = $this->request->referer) {\n return $referer;\n }\n\n return route('cp');\n }", "protected function getRedirectUrl()\n {\n return null;\n }", "public function redirectPath()\n {\n return route('crm.login');\n }", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function get_redirect_to() {\n\t\treturn empty( $this->data['redirect_to'] ) ? '' : $this->data['redirect_to'];\n\t}", "public function getRedirectUrl(): string;", "protected function redirectTo()\n {\n $url = Skill::checkUserStatus();\n return $url;\n }", "public function redirectTo();", "public static function userRedirect($path = \"\") {\n if (Session::isLogin()) {\n self::redirect($path);\n }\n }", "public function get_redirect() {\n return new \\moodle_url('/');\n }", "protected function getRedirectUrl()\n\t{\n\t\treturn app('Illuminate\\Routing\\UrlGenerator')->previous();\n\t}", "public function redirectTo()\n {\n //跳转到登录前页面\n return $this->getReferrer($this->redirectTo);\n }", "public function pcr_auth_redirect($redirect_to, $request, $user) {\r\n if(isset($_SESSION['request_uri'])) {\r\n \r\n $redirect_to = $_SESSION['request_uri'];\r\n return $redirect_to;\r\n\r\n } else {\r\n\r\n // # request_uri is not set, return the home_url\r\n return home_url();\r\n }\r\n }", "public function getRedirectUrl()\n {\n }", "public function getPathAuthRequired()\n {\n }", "function return_to_previous_url()\n{\n\tif(empty($_SERVER[\"HTTP_REFERER\"]) || basename($_SERVER[\"HTTP_REFERER\"])==\"user.php\")\n\t\t// go back to main page\n\t\t$redirect_uri = current_page_folder_url();\n\telse\n\t\t$redirect_uri = $_SERVER[\"HTTP_REFERER\"];\n\n\theader(\"Location: \" . $redirect_uri);\n}", "public function getRedirectUri(): string;", "public function getBeforeAuthUrl() {\n\t\tswitch ($this->getModule()) {\n\t\t\tcase RublonMagentoModule::FRONT:\n\t\t\t\t$session = Mage::getSingleton('customer/session');\n\t\t\t\t$helper = Mage::helper('customer');\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$session = Mage::getSingleton('admin/session');\n\t\t\t\t$helper = Mage::helper('admin');\n\t\t}\n\t\tif (!$session->getBeforeAuthUrl() || $session->getBeforeAuthUrl() == Mage::getBaseUrl()) {\n\t\t\treturn $this->getAfterLoginUrl();\n\t\t} else {\n\t\t\treturn $session->getBeforeAuthUrl();\n\t\t}\n\t}", "protected function _getDefaultLandingPath()\n {\n return '/';\n }", "public function redirectPath()\n {\n return route('blog::admin.home');\n }", "abstract protected function redirectTo();", "function redirectWrapper($redirect_to, $requested_redirect_to, $user) {\n // If they're on the login page, don't do anything\n if ( !isset ( $user->user_login ) ) {\n return $redirect_to;\n } else {\n return get_option( 'siteurl' ).\"?xauth=login&redirect_to=\".urlencode($redirect_to);\n }\n }", "public function isRedirection();", "public function mustRedirect();", "public function getRedirectUrl() : string\n {\n return '';\n }", "public function getRedirectURL()\n {\n return $this->redirectURL;\n }", "public function getRedirectUri();", "public function getRedirectUri();", "protected function redirectTo()\n {\n if (auth()->user()->isAdmin) {\n return route('admin.dashboard');\n }\n return route('home');;\n }", "public function getReturnPathLogin()\n\t{\n\t\treturn $this->return_path_login;\n\t}", "protected function getRedirectUrl(): string\n\t{\n\t\tif($this->input === null)\n\t\t{\n\t\t\treturn $this->urlBuilder->current();\n\t\t}\n\n\t\treturn $this->input->getRedirectUrl();\n\t}", "function thrive_get_redirect_page_url() {\n\n\t$selected_login_post_id = intval( get_option( 'thrive_login_page' ) );\n\n\tif ( $selected_login_post_id === 0 ) {\n\n\t\treturn;\n\n\t}\n\n\t$login_post = get_post( $selected_login_post_id );\n\n\tif ( ! empty( $login_post ) ) {\n\n\t\treturn get_permalink( $login_post->ID );\n\n\t}\n\n\treturn false;\n\n}", "protected function redirectTo()\n {\n return route( 'admin.login' );\n }", "public function redirectTo() {\n $role = Auth::user()->role_id; \n switch ($role) {\n case '1':\n return '/home-admin';\n break;\n case '2':\n return '/home-lecturer';\n break; \n case '3':\n return '/my-subjects';\n break; \n \n default:\n return '/home'; \n break;\n }\n }", "function getRedirectUrl()\r\n\t{\r\n\t\treturn $this->redirect_url;\r\n\t}", "public function getRedirectUrl()\n {\n return $this->redirectUrl;\n }", "public function getRedirectUrl()\n {\n return $this->redirectUrl;\n }", "public function getRedirectUrl()\r\n {\r\n return \"{$this->data['redirect_url']}?session={$this->data['session']}\";\r\n }", "protected function getPostRegisterRedirectPath()\r\n {\r\n if (property_exists($this, 'postRegisterRedirect')) {\r\n return $this->postRegisterRedirect;\r\n }\r\n\r\n return $this->redirectPath();\r\n }", "public function getRedirectUrl()\n {\n return $this->redirectUrl;\n }", "public function redirectUnauthenticatedUser(){\n if(!$this->isAuthenticated() )\n $this->logout();\n }", "public function redirectTo()\n {\n return config('tenancy.client_url');\n }", "abstract protected function get_redirect_page();", "function my_login_redirect( $redirect_to, $request, $user ) {\t\t\n\t\tif ( isset( $user->roles ) && is_array( $user->roles ) ) {\n\t\t\t//check for admins\n\t\t\tif ( in_array( 'endorser', $user->roles ) ) {\n\t\t\t\treturn get_permalink(get_option('ENDORSEMENT_FRONT_END'));\n\t\t\t} else {\n\t\t\t\treturn $redirect_to;\n\t\t\t}\n\t\t} else {\n\t\t\treturn $redirect_to;\n\t\t}\n\t}", "public function get_redirect()\n {\n return $this->redirect;\n }", "public function getRedirectUrl() {\n return $this->redirectUrl;\n }", "protected function redirectTo()\n {\n return AccountServiceProvider::HOME; //route('users.index')\n }", "public function GetRedirect ();", "protected function redirectTo()\n {\n if (Auth::user()->isBoardMember()) {\n return route('boardmember.index', [], false);\n } elseif (Auth::user()->isComplianceOfficer()) {\n return route('compliance.index', [], false);\n } else { // if (Auth::user()->isOwner()) \n return route('owner.index', [], false);\n }\n }", "public function getRedirectUrl(): string\n {\n return $this->redirectUrl;\n }", "abstract protected function getRedirectUrl(): Url;", "public function redirectTo(): string\n {\n return route('guest-home');\n }", "public function getReturnUrl()\n {\n return $this->_getUrl(self::URL_REDIRECT);\n }", "function my_login_redirect( $url, $request, $user ){\n if( $user && is_object( $user ) && is_a( $user, 'WP_User' ) ) {\n if( $user->has_cap( 'administrator' ) ) {\n $url = admin_url();\n } else {\n $url = home_url();\n }\n }\n return $url;\n}", "public function loginPath()\n\t{\n\t\treturn property_exists($this, 'loginPath') ? $this->loginPath : '/';\n\t}", "public function getRedirectUrl()\n {\n return $this->_redirectUrl;\n }", "public function getRedirectUrl()\n {\n return $this->_redirectUrl;\n }", "public function getRedirectUrl()\n {\n return $this->_redirectUrl;\n }", "public function loginPath()\n {\n return property_exists($this, 'loginPath') ? $this->loginPath : '/auth/login';\n }", "public function redirected()\n {\n return $this->redirect;\n }", "protected function redirectTo()\n {\n if (Auth::user()->role == '2') {\n return 'madc';\n }\n\n //rediret to /wdc if role == 3\n if (Auth::user()->role == '3') {\n return 'wdc';\n }\n\n \n }", "public function getRedirectUrl() {\n return (string) $this->getValue('redirect_url');\n }", "function redirect_url() {\n if( strpos( $_SERVER['HTTP_REFERER'], 'my-account') === false ){\n // only if the url does not contain 'my-account'\n $_SESSION['referer_url'] = $_SERVER['HTTP_REFERER'];\n }\n}", "public function getRedirect() {\n\t\treturn $this->redirect;\n\t}", "private function getRedirectUrl()\n {\n return $this->getConfigData('url');\n }", "function redirect_when_logged() {\n $is_logged_in = AppAuthentication::is_logged_in();\n\n // If the user is already logged in we redirect to the default path of\n // his role.\n if ($is_logged_in) {\n $user_info = AppAuthentication::get_user_data();\n redirect_to_user_default_path($user_info);\n return TRUE;\n }\n\n return FALSE;\n }", "function getRedirectLink()\n {\n global $wgRequest;\n if($this->user->isTemporary)\n {\n // User is viewing this from liveshow, means we have to redirect back to ViewSurvey page,\n // and not the wiki page.\n // In this case 'returnto' value does not mean anything, we know where to return.\n $t = Title::newFromText('Special:ViewSurvey');\n\n $url = $t->getLocalURL('liveshow='.$this->user->getTemporaryKey($this->page_id)\n .'&id='.$this->page_id\n .'&userID='.$this->user->userID).'#survey_id_'.$this->page_id;\n return $url;\n }\n else\n {\n $title = Title::newFromText($wgRequest->getVal('returnto'));\n return $title->getLocalURL();\n }\n }", "private static function createRedirectUrl() {\n\t\t$path = \\explode('?', $_SERVER['REQUEST_URI'], 2)[0];\n\n\t\treturn $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['SERVER_NAME'] . $path;\n\t}", "public function deleteImageRedirectPath(): string\n {\n return auth('rocXolid')->user()->is($this)\n ? route('rocXolid.auth.profile')\n : $this->getControllerRoute('show');\n }", "public static function setRedirectUponAuthentication(){\n\n /**\n * Make sure we redirect to the requested page\n */\n if(isset($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]) && !empty($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY])){\n CoreHeaders::setRedirect($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]);\n unset($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]);\n }else{\n CoreHeaders::setRedirect('/');\n }\n\n }", "public static function get_url_path()\n {\n \t//----------------------------------------------------\n \t// If $_SERVER['REDIRECT_URL'] is set\n \t//----------------------------------------------------\n \tif (isset($_SERVER['REDIRECT_URL'])) {\n \t\treturn $_SERVER['REDIRECT_URL'];\n \t}\n \t//----------------------------------------------------\n \t// If $_SERVER['PATH_INFO'] is set\n \t//----------------------------------------------------\n \telse if (isset($_SERVER['PATH_INFO'])) {\n \t\treturn $_SERVER['PATH_INFO'];\n \t}\n \t//----------------------------------------------------\n \t// If $_SERVER['REQUEST_URI'] is set\n \t//----------------------------------------------------\n \telse if (isset($_SERVER['REQUEST_URI'])) {\n \t\t$qs_start = strpos($_SERVER['REQUEST_URI'], '?');\n \t\tif ($qs_start === false) {\n \t\t\treturn $_SERVER['REQUEST_URI'];\n \t\t}\n \t\telse {\n \t\t\treturn substr($_SERVER['REQUEST_URI'], 0, $qs_start);\n \t\t}\n \t}\n\n \treturn false;\n }", "function login_redirect_rules( $redirect_to, $requested_redirect_to, $user ) {\r\n\r\n // If they're on the login page, don't do anything\r\n if( !isset( $user->user_login ) ) {\r\n return $redirect_to;\r\n }\r\n\r\n\r\n //redirect by login/logout redirect table\r\n $wpc_enable_custom_redirects = get_option( 'wpc_enable_custom_redirects', 'no' );\r\n if ( 'yes' == $wpc_enable_custom_redirects ) {\r\n global $wpdb;\r\n\r\n $new_redirect_to = $wpdb->get_var( $wpdb->prepare( \"SELECT rul_url FROM {$wpdb->prefix}wpc_client_login_redirects WHERE rul_value = '%s'\", $user->user_login ) );\r\n if ( $new_redirect_to ) {\r\n return $new_redirect_to;\r\n }\r\n }\r\n\r\n //redirect Client and Staff to my-hub page\r\n if ( ( user_can( $user, 'wpc_client' ) ) && !user_can( $user, 'manage_network_options' ) ) {\r\n return wpc_client_get_slug( 'hub_page_id' );\r\n }\r\n\r\n return $redirect_to;\r\n\r\n }", "protected function redirectTo(){\n\n return url()->previous();\n\n }", "protected function defaultSuccessUrl()\n {\n return $this->user->getReturnUrl();\n }" ]
[ "0.7755095", "0.76014847", "0.7291407", "0.7266697", "0.7207652", "0.7203327", "0.71280384", "0.7094288", "0.70882577", "0.7075417", "0.7048034", "0.7048034", "0.7011364", "0.7000666", "0.6992354", "0.6969801", "0.6922098", "0.68287885", "0.68030256", "0.6769999", "0.6675081", "0.66693956", "0.6592806", "0.6564882", "0.6545854", "0.64623064", "0.6446223", "0.6446223", "0.6446223", "0.6446223", "0.6446223", "0.6441954", "0.6404216", "0.63982606", "0.63626516", "0.63577896", "0.6357318", "0.63497", "0.6347448", "0.63040996", "0.6298965", "0.62748474", "0.6241403", "0.6207928", "0.6202235", "0.6197209", "0.6166814", "0.61482584", "0.61427563", "0.6142504", "0.6141231", "0.6114941", "0.6094334", "0.6085797", "0.6085797", "0.6072301", "0.60669816", "0.6066504", "0.60493886", "0.60424995", "0.60405684", "0.6035826", "0.6028823", "0.6028823", "0.60147136", "0.6011416", "0.6011216", "0.6003394", "0.5994838", "0.5994575", "0.5992668", "0.5992497", "0.5985038", "0.598324", "0.5981952", "0.59797907", "0.5965128", "0.59633344", "0.59450495", "0.59216225", "0.5920932", "0.5908367", "0.5904015", "0.5904015", "0.5904015", "0.5896428", "0.5892113", "0.58861625", "0.5877115", "0.5875665", "0.58740884", "0.5866094", "0.5863054", "0.58564717", "0.5852121", "0.5851625", "0.58459437", "0.5844782", "0.58437663", "0.5840273", "0.58344275" ]
0.0
-1
Handle an incoming request.
public function handle($request, \Closure $next, ...$guards) { if (!is_null(Auth::user()) && !Auth::user()->is_activated) { if (Hash::check('default', Auth::user()->password)) { Auth::logout(); return redirect()->route('password.request')->with('status', trans('auth.passwordDefault')); } Auth::logout(); throw ValidationException::withMessages([ 'email' => [trans('auth.activated')], ]); } $this->authenticate($request, $guards); 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